text
stringlengths
3
1.05M
# # SPDX-FileCopyrightText: Copyright (c) 1993-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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 sys import os ROOT_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), os.path.pardir) sys.path.insert(0, ROOT_DIR) import onnx_graphsurgeon as gs extensions = [ "sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinx.ext.autosummary", "sphinx.ext.napoleon", "sphinx.ext.mathjax", ] # Want to be able to generate docs with no dependencies installed autodoc_mock_imports = ["onnx", "numpy", "onnxruntime"] autodoc_default_options = { "members": True, "show-inheritance": True, "special-members": "__call__, __getitem__, __bool__", } autodoc_member_order = "bysource" autodoc_inherit_docstrings = True autosummary_generate = True source_suffix = [".rst"] # The master toctree document. master_doc = "index" # General information about the project. project = "ONNX GraphSurgeon" copyright = "2020, NVIDIA" author = "NVIDIA" version = gs.__version__ # The full version, including alpha/beta/rc tags. release = version # Style pygments_style = "colorful" html_theme = "sphinx_rtd_theme" # Use the TRT theme and NVIDIA logo html_static_path = ["_static"] html_logo = "_static/img/nvlogo_white.png" # Hide source link html_show_sourcelink = False # Output file base name for HTML help builder. htmlhelp_basename = "OnnxGraphSurgeonDoc" # Template files to extend default Sphinx templates. # See https://www.sphinx-doc.org/en/master/templating.html for details. templates_path = ["_templates"] # For constructor arguments to show up in Sphinx generated doc autoclass_content = "both" # Unlimited depth sidebar. html_theme_options = {"navigation_depth": -1} html_sidebars = {"**": ["globaltoc.html", "relations.html", "sourcelink.html", "searchbox.html"]} # Allows us to override the default page width in the Sphinx theme. def setup(app): app.add_css_file("style.css")
export { default } from 'myfirst-addon/components/my-button';
'use strict'; /* jshint ignore:start */ /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ /* jshint ignore:end */ var Q = require('q'); /* jshint ignore:line */ var _ = require('lodash'); /* jshint ignore:line */ var util = require('util'); /* jshint ignore:line */ var DefaultsList = require('./assistant/defaults').DefaultsList; var DialogueList = require('./assistant/dialogue').DialogueList; var FieldTypeList = require('./assistant/fieldType').FieldTypeList; var ModelBuildList = require('./assistant/modelBuild').ModelBuildList; var Page = require('../../../base/Page'); /* jshint ignore:line */ var QueryList = require('./assistant/query').QueryList; var StyleSheetList = require('./assistant/styleSheet').StyleSheetList; var TaskList = require('./assistant/task').TaskList; var WebhookList = require('./assistant/webhook').WebhookList; var deserialize = require( '../../../base/deserialize'); /* jshint ignore:line */ var serialize = require('../../../base/serialize'); /* jshint ignore:line */ var values = require('../../../base/values'); /* jshint ignore:line */ var AssistantList; var AssistantPage; var AssistantInstance; var AssistantContext; /* jshint ignore:start */ /** * Initialize the AssistantList * * PLEASE NOTE that this class contains preview products that are subject to * change. Use them with caution. If you currently do not have developer preview * access, please contact help@twilio.com. * * @constructor Twilio.Autopilot.V1.AssistantList * * @param {Twilio.Autopilot.V1} version - Version of the resource */ /* jshint ignore:end */ AssistantList = function AssistantList(version) { /* jshint ignore:start */ /** * @function assistants * @memberof Twilio.Autopilot.V1# * * @param {string} sid - sid of instance * * @returns {Twilio.Autopilot.V1.AssistantContext} */ /* jshint ignore:end */ function AssistantListInstance(sid) { return AssistantListInstance.get(sid); } AssistantListInstance._version = version; // Path Solution AssistantListInstance._solution = {}; AssistantListInstance._uri = `/Assistants`; /* jshint ignore:start */ /** * Streams AssistantInstance records from the API. * * This operation lazily loads records as efficiently as possible until the limit * is reached. * * The results are passed into the callback function, so this operation is memory * efficient. * * If a function is passed as the first argument, it will be used as the callback * function. * * @function each * @memberof Twilio.Autopilot.V1.AssistantList# * * @param {object} [opts] - Options for request * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. * Default is no limit * @param {number} [opts.pageSize] - * Number of records to fetch per request, * when not set will use the default value of 50 records. * If no pageSize is defined but a limit is defined, * each() will attempt to read the limit with the most efficient * page size, i.e. min(limit, 1000) * @param {Function} [opts.callback] - * Function to process each record. If this and a positional * callback are passed, this one will be used * @param {Function} [opts.done] - * Function to be called upon completion of streaming * @param {Function} [callback] - Function to process each record */ /* jshint ignore:end */ AssistantListInstance.each = function each(opts, callback) { if (_.isFunction(opts)) { callback = opts; opts = {}; } opts = opts || {}; if (opts.callback) { callback = opts.callback; } if (_.isUndefined(callback)) { throw new Error('Callback function must be provided'); } var done = false; var currentPage = 1; var currentResource = 0; var limits = this._version.readLimits({ limit: opts.limit, pageSize: opts.pageSize }); function onComplete(error) { done = true; if (_.isFunction(opts.done)) { opts.done(error); } } function fetchNextPage(fn) { var promise = fn(); if (_.isUndefined(promise)) { onComplete(); return; } promise.then(function(page) { _.each(page.instances, function(instance) { if (done || (!_.isUndefined(opts.limit) && currentResource >= opts.limit)) { done = true; return false; } currentResource++; callback(instance, onComplete); }); if ((limits.pageLimit && limits.pageLimit <= currentPage)) { onComplete(); } else if (!done) { currentPage++; fetchNextPage(_.bind(page.nextPage, page)); } }); promise.catch(onComplete); } fetchNextPage(_.bind(this.page, this, _.merge(opts, limits))); }; /* jshint ignore:start */ /** * Lists AssistantInstance records from the API as a list. * * If a function is passed as the first argument, it will be used as the callback * function. * * @function list * @memberof Twilio.Autopilot.V1.AssistantList# * * @param {object} [opts] - Options for request * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. * Default is no limit * @param {number} [opts.pageSize] - * Number of records to fetch per request, * when not set will use the default value of 50 records. * If no page_size is defined but a limit is defined, * list() will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @param {function} [callback] - Callback to handle list of records * * @returns {Promise} Resolves to a list of records */ /* jshint ignore:end */ AssistantListInstance.list = function list(opts, callback) { if (_.isFunction(opts)) { callback = opts; opts = {}; } opts = opts || {}; var deferred = Q.defer(); var allResources = []; opts.callback = function(resource, done) { allResources.push(resource); if (!_.isUndefined(opts.limit) && allResources.length === opts.limit) { done(); } }; opts.done = function(error) { if (_.isUndefined(error)) { deferred.resolve(allResources); } else { deferred.reject(error); } }; if (_.isFunction(callback)) { deferred.promise.nodeify(callback); } this.each(opts); return deferred.promise; }; /* jshint ignore:start */ /** * Retrieve a single page of AssistantInstance records from the API. * * The request is executed immediately. * * If a function is passed as the first argument, it will be used as the callback * function. * * @function page * @memberof Twilio.Autopilot.V1.AssistantList# * * @param {object} [opts] - Options for request * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state * @param {number} [opts.pageSize] - Number of records to return, defaults to 50 * @param {function} [callback] - Callback to handle list of records * * @returns {Promise} Resolves to a list of records */ /* jshint ignore:end */ AssistantListInstance.page = function page(opts, callback) { if (_.isFunction(opts)) { callback = opts; opts = {}; } opts = opts || {}; var deferred = Q.defer(); var data = values.of({ 'PageToken': opts.pageToken, 'Page': opts.pageNumber, 'PageSize': opts.pageSize }); var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { deferred.resolve(new AssistantPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { deferred.reject(error); }); if (_.isFunction(callback)) { deferred.promise.nodeify(callback); } return deferred.promise; }; /* jshint ignore:start */ /** * Retrieve a single target page of AssistantInstance records from the API. * * The request is executed immediately. * * If a function is passed as the first argument, it will be used as the callback * function. * * @function getPage * @memberof Twilio.Autopilot.V1.AssistantList# * * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * * @returns {Promise} Resolves to a list of records */ /* jshint ignore:end */ AssistantListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { deferred.resolve(new AssistantPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { deferred.reject(error); }); if (_.isFunction(callback)) { deferred.promise.nodeify(callback); } return deferred.promise; }; /* jshint ignore:start */ /** * create a AssistantInstance * * @function create * @memberof Twilio.Autopilot.V1.AssistantList# * * @param {object} [opts] - Options for request * @param {string} [opts.friendlyName] - A string to describe the new resource * @param {boolean} [opts.logQueries] - * Whether queries should be logged and kept after training * @param {string} [opts.uniqueName] - * An application-defined string that uniquely identifies the new resource * @param {string} [opts.callbackUrl] - Reserved * @param {string} [opts.callbackEvents] - Reserved * @param {object} [opts.styleSheet] - * A JSON string that defines the Assistant's style sheet * @param {object} [opts.defaults] - * A JSON object that defines the Assistant's default tasks for various scenarios * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed AssistantInstance */ /* jshint ignore:end */ AssistantListInstance.create = function create(opts, callback) { if (_.isFunction(opts)) { callback = opts; opts = {}; } opts = opts || {}; var deferred = Q.defer(); var data = values.of({ 'FriendlyName': _.get(opts, 'friendlyName'), 'LogQueries': serialize.bool(_.get(opts, 'logQueries')), 'UniqueName': _.get(opts, 'uniqueName'), 'CallbackUrl': _.get(opts, 'callbackUrl'), 'CallbackEvents': _.get(opts, 'callbackEvents'), 'StyleSheet': serialize.object(_.get(opts, 'styleSheet')), 'Defaults': serialize.object(_.get(opts, 'defaults')) }); var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new AssistantInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { deferred.reject(error); }); if (_.isFunction(callback)) { deferred.promise.nodeify(callback); } return deferred.promise; }; /* jshint ignore:start */ /** * Constructs a assistant * * @function get * @memberof Twilio.Autopilot.V1.AssistantList# * * @param {string} sid - The unique string that identifies the resource * * @returns {Twilio.Autopilot.V1.AssistantContext} */ /* jshint ignore:end */ AssistantListInstance.get = function get(sid) { return new AssistantContext(this._version, sid); }; /* jshint ignore:start */ /** * Provide a user-friendly representation * * @function toJSON * @memberof Twilio.Autopilot.V1.AssistantList# * * @returns Object */ /* jshint ignore:end */ AssistantListInstance.toJSON = function toJSON() { return this._solution; }; AssistantListInstance[util.inspect.custom] = function inspect(depth, options) { return util.inspect(this.toJSON(), options); }; return AssistantListInstance; }; /* jshint ignore:start */ /** * Initialize the AssistantPage * * PLEASE NOTE that this class contains preview products that are subject to * change. Use them with caution. If you currently do not have developer preview * access, please contact help@twilio.com. * * @constructor Twilio.Autopilot.V1.AssistantPage * * @param {V1} version - Version of the resource * @param {Response<string>} response - Response from the API * @param {AssistantSolution} solution - Path solution * * @returns AssistantPage */ /* jshint ignore:end */ AssistantPage = function AssistantPage(version, response, solution) { // Path Solution this._solution = solution; Page.prototype.constructor.call(this, version, response, this._solution); }; _.extend(AssistantPage.prototype, Page.prototype); AssistantPage.prototype.constructor = AssistantPage; /* jshint ignore:start */ /** * Build an instance of AssistantInstance * * @function getInstance * @memberof Twilio.Autopilot.V1.AssistantPage# * * @param {AssistantPayload} payload - Payload response from the API * * @returns AssistantInstance */ /* jshint ignore:end */ AssistantPage.prototype.getInstance = function getInstance(payload) { return new AssistantInstance(this._version, payload); }; /* jshint ignore:start */ /** * Provide a user-friendly representation * * @function toJSON * @memberof Twilio.Autopilot.V1.AssistantPage# * * @returns Object */ /* jshint ignore:end */ AssistantPage.prototype.toJSON = function toJSON() { let clone = {}; _.forOwn(this, function(value, key) { if (!_.startsWith(key, '_') && ! _.isFunction(value)) { clone[key] = value; } }); return clone; }; AssistantPage.prototype[util.inspect.custom] = function inspect(depth, options) { return util.inspect(this.toJSON(), options); }; /* jshint ignore:start */ /** * Initialize the AssistantContext * * PLEASE NOTE that this class contains preview products that are subject to * change. Use them with caution. If you currently do not have developer preview * access, please contact help@twilio.com. * * @constructor Twilio.Autopilot.V1.AssistantInstance * * @property {string} accountSid - The SID of the Account that created the resource * @property {Date} dateCreated - * The RFC 2822 date and time in GMT when the resource was created * @property {Date} dateUpdated - * The RFC 2822 date and time in GMT when the resource was last updated * @property {string} friendlyName - * The string that you assigned to describe the resource * @property {string} latestModelBuildSid - Reserved * @property {string} links - * A list of the URLs of the Assistant's related resources * @property {boolean} logQueries - * Whether queries should be logged and kept after training * @property {string} developmentStage - * A string describing the state of the assistant. * @property {boolean} needsModelBuild - Whether model needs to be rebuilt * @property {string} sid - The unique string that identifies the resource * @property {string} uniqueName - * An application-defined string that uniquely identifies the resource * @property {string} url - The absolute URL of the Assistant resource * @property {string} callbackUrl - Reserved * @property {string} callbackEvents - Reserved * * @param {V1} version - Version of the resource * @param {AssistantPayload} payload - The instance payload * @param {sid_like} sid - The unique string that identifies the resource */ /* jshint ignore:end */ AssistantInstance = function AssistantInstance(version, payload, sid) { this._version = version; // Marshaled Properties this.accountSid = payload.account_sid; // jshint ignore:line this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line this.friendlyName = payload.friendly_name; // jshint ignore:line this.latestModelBuildSid = payload.latest_model_build_sid; // jshint ignore:line this.links = payload.links; // jshint ignore:line this.logQueries = payload.log_queries; // jshint ignore:line this.developmentStage = payload.development_stage; // jshint ignore:line this.needsModelBuild = payload.needs_model_build; // jshint ignore:line this.sid = payload.sid; // jshint ignore:line this.uniqueName = payload.unique_name; // jshint ignore:line this.url = payload.url; // jshint ignore:line this.callbackUrl = payload.callback_url; // jshint ignore:line this.callbackEvents = payload.callback_events; // jshint ignore:line // Context this._context = undefined; this._solution = {sid: sid || this.sid, }; }; Object.defineProperty(AssistantInstance.prototype, '_proxy', { get: function() { if (!this._context) { this._context = new AssistantContext(this._version, this._solution.sid); } return this._context; } }); /* jshint ignore:start */ /** * fetch a AssistantInstance * * @function fetch * @memberof Twilio.Autopilot.V1.AssistantInstance# * * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed AssistantInstance */ /* jshint ignore:end */ AssistantInstance.prototype.fetch = function fetch(callback) { return this._proxy.fetch(callback); }; /* jshint ignore:start */ /** * update a AssistantInstance * * @function update * @memberof Twilio.Autopilot.V1.AssistantInstance# * * @param {object} [opts] - Options for request * @param {string} [opts.friendlyName] - A string to describe the resource * @param {boolean} [opts.logQueries] - * Whether queries should be logged and kept after training * @param {string} [opts.uniqueName] - * An application-defined string that uniquely identifies the resource * @param {string} [opts.callbackUrl] - Reserved * @param {string} [opts.callbackEvents] - Reserved * @param {object} [opts.styleSheet] - * A JSON string that defines the Assistant's style sheet * @param {object} [opts.defaults] - * A JSON object that defines the Assistant's {@link https://www.twilio.com/docs/autopilot/api/assistant/defaults|default tasks} for various scenarios * @param {string} [opts.developmentStage] - * A string describing the state of the assistant. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed AssistantInstance */ /* jshint ignore:end */ AssistantInstance.prototype.update = function update(opts, callback) { return this._proxy.update(opts, callback); }; /* jshint ignore:start */ /** * remove a AssistantInstance * * @function remove * @memberof Twilio.Autopilot.V1.AssistantInstance# * * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed AssistantInstance */ /* jshint ignore:end */ AssistantInstance.prototype.remove = function remove(callback) { return this._proxy.remove(callback); }; /* jshint ignore:start */ /** * Access the fieldTypes * * @function fieldTypes * @memberof Twilio.Autopilot.V1.AssistantInstance# * * @returns {Twilio.Autopilot.V1.AssistantContext.FieldTypeList} */ /* jshint ignore:end */ AssistantInstance.prototype.fieldTypes = function fieldTypes() { return this._proxy.fieldTypes; }; /* jshint ignore:start */ /** * Access the tasks * * @function tasks * @memberof Twilio.Autopilot.V1.AssistantInstance# * * @returns {Twilio.Autopilot.V1.AssistantContext.TaskList} */ /* jshint ignore:end */ AssistantInstance.prototype.tasks = function tasks() { return this._proxy.tasks; }; /* jshint ignore:start */ /** * Access the modelBuilds * * @function modelBuilds * @memberof Twilio.Autopilot.V1.AssistantInstance# * * @returns {Twilio.Autopilot.V1.AssistantContext.ModelBuildList} */ /* jshint ignore:end */ AssistantInstance.prototype.modelBuilds = function modelBuilds() { return this._proxy.modelBuilds; }; /* jshint ignore:start */ /** * Access the queries * * @function queries * @memberof Twilio.Autopilot.V1.AssistantInstance# * * @returns {Twilio.Autopilot.V1.AssistantContext.QueryList} */ /* jshint ignore:end */ AssistantInstance.prototype.queries = function queries() { return this._proxy.queries; }; /* jshint ignore:start */ /** * Access the styleSheet * * @function styleSheet * @memberof Twilio.Autopilot.V1.AssistantInstance# * * @returns {Twilio.Autopilot.V1.AssistantContext.StyleSheetList} */ /* jshint ignore:end */ AssistantInstance.prototype.styleSheet = function styleSheet() { return this._proxy.styleSheet; }; /* jshint ignore:start */ /** * Access the defaults * * @function defaults * @memberof Twilio.Autopilot.V1.AssistantInstance# * * @returns {Twilio.Autopilot.V1.AssistantContext.DefaultsList} */ /* jshint ignore:end */ AssistantInstance.prototype.defaults = function defaults() { return this._proxy.defaults; }; /* jshint ignore:start */ /** * Access the dialogues * * @function dialogues * @memberof Twilio.Autopilot.V1.AssistantInstance# * * @returns {Twilio.Autopilot.V1.AssistantContext.DialogueList} */ /* jshint ignore:end */ AssistantInstance.prototype.dialogues = function dialogues() { return this._proxy.dialogues; }; /* jshint ignore:start */ /** * Access the webhooks * * @function webhooks * @memberof Twilio.Autopilot.V1.AssistantInstance# * * @returns {Twilio.Autopilot.V1.AssistantContext.WebhookList} */ /* jshint ignore:end */ AssistantInstance.prototype.webhooks = function webhooks() { return this._proxy.webhooks; }; /* jshint ignore:start */ /** * Provide a user-friendly representation * * @function toJSON * @memberof Twilio.Autopilot.V1.AssistantInstance# * * @returns Object */ /* jshint ignore:end */ AssistantInstance.prototype.toJSON = function toJSON() { let clone = {}; _.forOwn(this, function(value, key) { if (!_.startsWith(key, '_') && ! _.isFunction(value)) { clone[key] = value; } }); return clone; }; AssistantInstance.prototype[util.inspect.custom] = function inspect(depth, options) { return util.inspect(this.toJSON(), options); }; /* jshint ignore:start */ /** * Initialize the AssistantContext * * PLEASE NOTE that this class contains preview products that are subject to * change. Use them with caution. If you currently do not have developer preview * access, please contact help@twilio.com. * * @constructor Twilio.Autopilot.V1.AssistantContext * * @property {Twilio.Autopilot.V1.AssistantContext.FieldTypeList} fieldTypes - * fieldTypes resource * @property {Twilio.Autopilot.V1.AssistantContext.TaskList} tasks - tasks resource * @property {Twilio.Autopilot.V1.AssistantContext.ModelBuildList} modelBuilds - * modelBuilds resource * @property {Twilio.Autopilot.V1.AssistantContext.QueryList} queries - * queries resource * @property {Twilio.Autopilot.V1.AssistantContext.StyleSheetList} styleSheet - * styleSheet resource * @property {Twilio.Autopilot.V1.AssistantContext.DefaultsList} defaults - * defaults resource * @property {Twilio.Autopilot.V1.AssistantContext.DialogueList} dialogues - * dialogues resource * @property {Twilio.Autopilot.V1.AssistantContext.WebhookList} webhooks - * webhooks resource * * @param {V1} version - Version of the resource * @param {sid_like} sid - The unique string that identifies the resource */ /* jshint ignore:end */ AssistantContext = function AssistantContext(version, sid) { this._version = version; // Path Solution this._solution = {sid: sid, }; this._uri = `/Assistants/${sid}`; // Dependents this._fieldTypes = undefined; this._tasks = undefined; this._modelBuilds = undefined; this._queries = undefined; this._styleSheet = undefined; this._defaults = undefined; this._dialogues = undefined; this._webhooks = undefined; }; /* jshint ignore:start */ /** * fetch a AssistantInstance * * @function fetch * @memberof Twilio.Autopilot.V1.AssistantContext# * * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed AssistantInstance */ /* jshint ignore:end */ AssistantContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new AssistantInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { deferred.reject(error); }); if (_.isFunction(callback)) { deferred.promise.nodeify(callback); } return deferred.promise; }; /* jshint ignore:start */ /** * update a AssistantInstance * * @function update * @memberof Twilio.Autopilot.V1.AssistantContext# * * @param {object} [opts] - Options for request * @param {string} [opts.friendlyName] - A string to describe the resource * @param {boolean} [opts.logQueries] - * Whether queries should be logged and kept after training * @param {string} [opts.uniqueName] - * An application-defined string that uniquely identifies the resource * @param {string} [opts.callbackUrl] - Reserved * @param {string} [opts.callbackEvents] - Reserved * @param {object} [opts.styleSheet] - * A JSON string that defines the Assistant's style sheet * @param {object} [opts.defaults] - * A JSON object that defines the Assistant's {@link https://www.twilio.com/docs/autopilot/api/assistant/defaults|default tasks} for various scenarios * @param {string} [opts.developmentStage] - * A string describing the state of the assistant. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed AssistantInstance */ /* jshint ignore:end */ AssistantContext.prototype.update = function update(opts, callback) { if (_.isFunction(opts)) { callback = opts; opts = {}; } opts = opts || {}; var deferred = Q.defer(); var data = values.of({ 'FriendlyName': _.get(opts, 'friendlyName'), 'LogQueries': serialize.bool(_.get(opts, 'logQueries')), 'UniqueName': _.get(opts, 'uniqueName'), 'CallbackUrl': _.get(opts, 'callbackUrl'), 'CallbackEvents': _.get(opts, 'callbackEvents'), 'StyleSheet': serialize.object(_.get(opts, 'styleSheet')), 'Defaults': serialize.object(_.get(opts, 'defaults')), 'DevelopmentStage': _.get(opts, 'developmentStage') }); var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new AssistantInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { deferred.reject(error); }); if (_.isFunction(callback)) { deferred.promise.nodeify(callback); } return deferred.promise; }; /* jshint ignore:start */ /** * remove a AssistantInstance * * @function remove * @memberof Twilio.Autopilot.V1.AssistantContext# * * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed AssistantInstance */ /* jshint ignore:end */ AssistantContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); }.bind(this)); promise.catch(function(error) { deferred.reject(error); }); if (_.isFunction(callback)) { deferred.promise.nodeify(callback); } return deferred.promise; }; Object.defineProperty(AssistantContext.prototype, 'fieldTypes', { get: function() { if (!this._fieldTypes) { this._fieldTypes = new FieldTypeList(this._version, this._solution.sid); } return this._fieldTypes; } }); Object.defineProperty(AssistantContext.prototype, 'tasks', { get: function() { if (!this._tasks) { this._tasks = new TaskList(this._version, this._solution.sid); } return this._tasks; } }); Object.defineProperty(AssistantContext.prototype, 'modelBuilds', { get: function() { if (!this._modelBuilds) { this._modelBuilds = new ModelBuildList(this._version, this._solution.sid); } return this._modelBuilds; } }); Object.defineProperty(AssistantContext.prototype, 'queries', { get: function() { if (!this._queries) { this._queries = new QueryList(this._version, this._solution.sid); } return this._queries; } }); Object.defineProperty(AssistantContext.prototype, 'styleSheet', { get: function() { if (!this._styleSheet) { this._styleSheet = new StyleSheetList(this._version, this._solution.sid); } return this._styleSheet; } }); Object.defineProperty(AssistantContext.prototype, 'defaults', { get: function() { if (!this._defaults) { this._defaults = new DefaultsList(this._version, this._solution.sid); } return this._defaults; } }); Object.defineProperty(AssistantContext.prototype, 'dialogues', { get: function() { if (!this._dialogues) { this._dialogues = new DialogueList(this._version, this._solution.sid); } return this._dialogues; } }); Object.defineProperty(AssistantContext.prototype, 'webhooks', { get: function() { if (!this._webhooks) { this._webhooks = new WebhookList(this._version, this._solution.sid); } return this._webhooks; } }); /* jshint ignore:start */ /** * Provide a user-friendly representation * * @function toJSON * @memberof Twilio.Autopilot.V1.AssistantContext# * * @returns Object */ /* jshint ignore:end */ AssistantContext.prototype.toJSON = function toJSON() { return this._solution; }; AssistantContext.prototype[util.inspect.custom] = function inspect(depth, options) { return util.inspect(this.toJSON(), options); }; module.exports = { AssistantList: AssistantList, AssistantPage: AssistantPage, AssistantInstance: AssistantInstance, AssistantContext: AssistantContext };
# -*- coding: utf-8 -*- """Who command.""" # Part of Clockwork MUD Server (https://github.com/whutch/cwmud) # :copyright: (c) 2008 - 2017 Will Hutcheson # :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt) from .. import Command, COMMANDS from ...characters import CharacterShell from ...sessions import SESSIONS @COMMANDS.register class WhoCommand(Command): """A command to display the active players.""" def _action(self): chars = [session.char for session in SESSIONS.all() if session.char and session.char.active] self.session.send("Players online:", len(chars)) for char in chars: self.session.send(" ^W", char.name, "^~ ", char.title, sep="") CharacterShell.add_verbs(WhoCommand, "who")
import BoundingRectangle from "../Core/BoundingRectangle.js"; import Color from "../Core/Color.js"; import defined from "../Core/defined.js"; import destroyObject from "../Core/destroyObject.js"; import PixelFormat from "../Core/PixelFormat.js"; import ClearCommand from "../Renderer/ClearCommand.js"; import DrawCommand from "../Renderer/DrawCommand.js"; import FramebufferManager from "../Renderer/FramebufferManager.js"; import Pass from "../Renderer/Pass.js"; import PixelDatatype from "../Renderer/PixelDatatype.js"; import RenderState from "../Renderer/RenderState.js"; import Sampler from "../Renderer/Sampler.js"; import ShaderSource from "../Renderer/ShaderSource.js"; import Texture from "../Renderer/Texture.js"; import CompareAndPackTranslucentDepth from "../Shaders/CompareAndPackTranslucentDepth.js"; import CompositeTranslucentClassification from "../Shaders/PostProcessStages/CompositeTranslucentClassification.js"; import BlendingState from "./BlendingState.js"; import StencilConstants from "./StencilConstants.js"; import StencilFunction from "./StencilFunction.js"; var debugShowPackedDepth = false; /** * Handles buffers, drawing, and deriving commands needed for classifying translucent 3D Tiles. * Uses a depth texture, so classification on translucent 3D Tiles is not available in Internet Explorer. * * @private */ function TranslucentTileClassification(context) { this._drawClassificationFBO = new FramebufferManager({ createDepthAttachments: false, }); this._accumulationFBO = new FramebufferManager({ createDepthAttachments: false, }); this._packFBO = new FramebufferManager(); this._opaqueDepthStencilTexture = undefined; // Reference to either colorTexture or accumulationTexture this._textureToComposite = undefined; this._translucentDepthStencilTexture = undefined; this._packDepthCommand = undefined; this._accumulateCommand = undefined; this._compositeCommand = undefined; this._copyCommand = undefined; this._clearColorCommand = new ClearCommand({ color: new Color(0.0, 0.0, 0.0, 0.0), owner: this, }); this._clearDepthStencilCommand = new ClearCommand({ depth: 1.0, stencil: 0, owner: this, }); this._supported = context.depthTexture; this._viewport = new BoundingRectangle(); this._rsDepth = undefined; this._rsAccumulate = undefined; this._rsComp = undefined; this._useScissorTest = undefined; this._scissorRectangle = undefined; this._hasTranslucentDepth = false; this._frustumsDrawn = 0; } Object.defineProperties(TranslucentTileClassification.prototype, { /** * Gets whether or not translucent depth was rendered. * @memberof TranslucentTileClassification.prototype * * @type {Boolean} * @readonly */ hasTranslucentDepth: { get: function () { return this._hasTranslucentDepth; }, }, }); function destroyTextures(transpClass) { transpClass._textureToComposite = undefined; transpClass._translucentDepthStencilTexture = transpClass._translucentDepthStencilTexture && !transpClass._translucentDepthStencilTexture.isDestroyed() && transpClass._translucentDepthStencilTexture.destroy(); } function destroyFramebuffers(transpClass) { transpClass._drawClassificationFBO.destroyResources(); transpClass._accumulationFBO.destroyResources(); transpClass._packFBO.destroyResources(); } function updateTextures(transpClass, context, width, height) { destroyTextures(transpClass); transpClass._translucentDepthStencilTexture = new Texture({ context: context, width: width, height: height, pixelFormat: PixelFormat.DEPTH_STENCIL, pixelDatatype: PixelDatatype.UNSIGNED_INT_24_8, sampler: Sampler.NEAREST, }); } function updateFramebuffers(transpClass, context, width, height) { destroyFramebuffers(transpClass); transpClass._drawClassificationFBO.setDepthStencilTexture( transpClass._translucentDepthStencilTexture ); transpClass._drawClassificationFBO.update( context, width, height, false, false ); transpClass._accumulationFBO.setDepthStencilTexture( transpClass._translucentDepthStencilTexture ); transpClass._accumulationFBO.update(context, width, height, false, false); transpClass._packFBO.update(context, width, height, false, false); } function updateResources( transpClass, context, passState, globeDepthFramebuffer ) { if (!transpClass.isSupported()) { return; } transpClass._opaqueDepthStencilTexture = globeDepthFramebuffer.depthStencilTexture; var width = transpClass._opaqueDepthStencilTexture.width; var height = transpClass._opaqueDepthStencilTexture.height; if (transpClass._drawClassificationFBO.isDirty(width, height)) { updateTextures(transpClass, context, width, height); updateFramebuffers(transpClass, context, width, height); } var fs; var uniformMap; if (!defined(transpClass._packDepthCommand)) { fs = new ShaderSource({ sources: [CompareAndPackTranslucentDepth], }); uniformMap = { u_opaqueDepthTexture: function () { return transpClass._opaqueDepthStencilTexture; }, u_translucentDepthTexture: function () { return transpClass._translucentDepthStencilTexture; }, }; transpClass._packDepthCommand = context.createViewportQuadCommand(fs, { uniformMap: uniformMap, owner: transpClass, }); } if (!defined(transpClass._compositeCommand)) { fs = new ShaderSource({ sources: [CompositeTranslucentClassification], }); uniformMap = { colorTexture: function () { return transpClass._textureToComposite; }, }; if (debugShowPackedDepth) { fs.defines = ["DEBUG_SHOW_DEPTH"]; uniformMap.u_packedTranslucentDepth = function () { return transpClass._packFBO.getColorTexture(); }; } transpClass._compositeCommand = context.createViewportQuadCommand(fs, { uniformMap: uniformMap, owner: transpClass, }); var compositeCommand = transpClass._compositeCommand; var compositeProgram = compositeCommand.shaderProgram; var compositePickProgram = context.shaderCache.createDerivedShaderProgram( compositeProgram, "pick", { vertexShaderSource: compositeProgram.vertexShaderSource, fragmentShaderSource: new ShaderSource({ sources: fs.sources, defines: ["PICK"], }), attributeLocations: compositeProgram._attributeLocations, } ); var compositePickCommand = DrawCommand.shallowClone(compositeCommand); compositePickCommand.shaderProgram = compositePickProgram; compositeCommand.derivedCommands.pick = compositePickCommand; } if (!defined(transpClass._copyCommand)) { fs = new ShaderSource({ sources: [CompositeTranslucentClassification], }); uniformMap = { colorTexture: function () { return transpClass._drawClassificationFBO.getColorTexture(); }, }; transpClass._copyCommand = context.createViewportQuadCommand(fs, { uniformMap: uniformMap, owner: transpClass, }); } if (!defined(transpClass._accumulateCommand)) { fs = new ShaderSource({ sources: [CompositeTranslucentClassification], }); uniformMap = { colorTexture: function () { return transpClass._drawClassificationFBO.getColorTexture(); }, }; transpClass._accumulateCommand = context.createViewportQuadCommand(fs, { uniformMap: uniformMap, owner: transpClass, }); } transpClass._viewport.width = width; transpClass._viewport.height = height; var useScissorTest = !BoundingRectangle.equals( transpClass._viewport, passState.viewport ); var updateScissor = useScissorTest !== transpClass._useScissorTest; transpClass._useScissorTest = useScissorTest; if ( !BoundingRectangle.equals(transpClass._scissorRectangle, passState.viewport) ) { transpClass._scissorRectangle = BoundingRectangle.clone( passState.viewport, transpClass._scissorRectangle ); updateScissor = true; } if ( !defined(transpClass._rsDepth) || !BoundingRectangle.equals( transpClass._viewport, transpClass._rsDepth.viewport ) || updateScissor ) { transpClass._rsDepth = RenderState.fromCache({ viewport: transpClass._viewport, scissorTest: { enabled: transpClass._useScissorTest, rectangle: transpClass._scissorRectangle, }, }); } if (defined(transpClass._packDepthCommand)) { transpClass._packDepthCommand.renderState = transpClass._rsDepth; } if ( !defined(transpClass._rsAccumulate) || !BoundingRectangle.equals( transpClass._viewport, transpClass._rsAccumulate.viewport ) || updateScissor ) { transpClass._rsAccumulate = RenderState.fromCache({ viewport: transpClass._viewport, scissorTest: { enabled: transpClass._useScissorTest, rectangle: transpClass._scissorRectangle, }, stencilTest: { enabled: true, frontFunction: StencilFunction.EQUAL, reference: StencilConstants.CESIUM_3D_TILE_MASK, }, }); } if (defined(transpClass._accumulateCommand)) { transpClass._accumulateCommand.renderState = transpClass._rsAccumulate; } if ( !defined(transpClass._rsComp) || !BoundingRectangle.equals( transpClass._viewport, transpClass._rsComp.viewport ) || updateScissor ) { transpClass._rsComp = RenderState.fromCache({ viewport: transpClass._viewport, scissorTest: { enabled: transpClass._useScissorTest, rectangle: transpClass._scissorRectangle, }, blending: BlendingState.ALPHA_BLEND, }); } if (defined(transpClass._compositeCommand)) { transpClass._compositeCommand.renderState = transpClass._rsComp; transpClass._compositeCommand.derivedCommands.pick.renderState = transpClass._rsComp; } } TranslucentTileClassification.prototype.executeTranslucentCommands = function ( scene, executeCommand, passState, commands, globeDepthFramebuffer ) { // Check for translucent commands that should be classified var length = commands.length; var command; var i; var useLogDepth = scene.frameState.useLogDepth; var context = scene.context; var framebuffer = passState.framebuffer; for (i = 0; i < length; ++i) { command = commands[i]; command = useLogDepth ? command.derivedCommands.logDepth.command : command; if (command.depthForTranslucentClassification) { this._hasTranslucentDepth = true; break; } } if (!this._hasTranslucentDepth) { return; } updateResources(this, context, passState, globeDepthFramebuffer); // Get translucent depth passState.framebuffer = this._drawClassificationFBO.framebuffer; // Clear depth for multifrustum this._clearDepthStencilCommand.execute(context, passState); for (i = 0; i < length; ++i) { command = commands[i]; command = useLogDepth ? command.derivedCommands.logDepth.command : command; if (!command.depthForTranslucentClassification) { continue; } // Depth-only commands are created for all translucent 3D Tiles commands var depthOnlyCommand = command.derivedCommands.depth.depthOnlyCommand; executeCommand(depthOnlyCommand, scene, context, passState); } this._frustumsDrawn += this._hasTranslucentDepth ? 1 : 0; // Pack depth if any translucent depth commands were performed if (this._hasTranslucentDepth) { passState.framebuffer = this._packFBO.framebuffer; this._packDepthCommand.execute(context, passState); } passState.framebuffer = framebuffer; }; TranslucentTileClassification.prototype.executeClassificationCommands = function ( scene, executeCommand, passState, frustumCommands ) { if (!this._hasTranslucentDepth) { return; } var context = scene.context; var us = context.uniformState; var framebuffer = passState.framebuffer; if (this._frustumsDrawn === 2) { // copy classification from first frustum passState.framebuffer = this._accumulationFBO.framebuffer; this._copyCommand.execute(context, passState); } passState.framebuffer = this._drawClassificationFBO.framebuffer; if (this._frustumsDrawn > 1) { this._clearColorCommand.execute(context, passState); } us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION); var swapGlobeDepth = us.globeDepthTexture; us.globeDepthTexture = this._packFBO.getColorTexture(); var commands = frustumCommands.commands[Pass.CESIUM_3D_TILE_CLASSIFICATION]; var length = frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION]; for (var i = 0; i < length; ++i) { executeCommand(commands[i], scene, context, passState); } us.globeDepthTexture = swapGlobeDepth; passState.framebuffer = framebuffer; if (this._frustumsDrawn === 1) { return; } passState.framebuffer = this._accumulationFBO.framebuffer; this._accumulateCommand.execute(context, passState); passState.framebuffer = framebuffer; }; TranslucentTileClassification.prototype.execute = function (scene, passState) { if (!this._hasTranslucentDepth) { return; } if (this._frustumsDrawn === 1) { this._textureToComposite = this._drawClassificationFBO.getColorTexture(); } else { this._textureToComposite = this._accumulationFBO.getColorTexture(); } var command = scene.frameState.passes.pick ? this._compositeCommand.derivedCommands.pick : this._compositeCommand; command.execute(scene.context, passState); clear(this, scene, passState); }; function clear(translucentTileClassification, scene, passState) { if (!translucentTileClassification._hasTranslucentDepth) { return; } var framebuffer = passState.framebuffer; passState.framebuffer = translucentTileClassification._drawClassificationFBO.framebuffer; translucentTileClassification._clearColorCommand.execute( scene._context, passState ); passState.framebuffer = framebuffer; if (translucentTileClassification._frustumsDrawn > 1) { passState.framebuffer = translucentTileClassification._accumulationFBO.framebuffer; translucentTileClassification._clearColorCommand.execute( scene._context, passState ); } translucentTileClassification._hasTranslucentDepth = false; translucentTileClassification._frustumsDrawn = 0; } TranslucentTileClassification.prototype.isSupported = function () { return this._supported; }; TranslucentTileClassification.prototype.isDestroyed = function () { return false; }; TranslucentTileClassification.prototype.destroy = function () { destroyTextures(this); destroyFramebuffers(this); if (defined(this._compositeCommand)) { this._compositeCommand.shaderProgram = this._compositeCommand.shaderProgram && this._compositeCommand.shaderProgram.destroy(); } if (defined(this._packDepthCommand)) { this._packDepthCommand.shaderProgram = this._packDepthCommand.shaderProgram && this._packDepthCommand.shaderProgram.destroy(); } return destroyObject(this); }; export default TranslucentTileClassification;
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Dag Wieers (dagwieers) <dag@wieers.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'certified'} DOCUMENTATION = r''' --- module: aci_interface_policy_ospf short_description: Manage OSPF interface policies (ospf:IfPol) description: - Manage OSPF interface policies on Cisco ACI fabrics. notes: - More information about the internal APIC class B(ospf:IfPol) from L(the APIC Management Information Model reference,https://developer.cisco.com/docs/apic-mim-ref/). author: - Dag Wieers (@dagwieers) version_added: '2.7' options: tenant: description: - The name of the Tenant the OSPF interface policy should belong to. required: yes aliases: [ tenant_name ] ospf: description: - The OSPF interface policy name. - This name can be between 1 and 64 alphanumeric characters. - Note that you cannot change this name after the object has been saved. required: yes aliases: [ ospf_interface, name ] description: description: - The description for the OSPF interface. aliases: [ descr ] network_type: description: - The OSPF interface policy network type. - OSPF supports broadcast and point-to-point. - The APIC defaults to C(unspecified) when unset during creation. choices: [ bcast, p2p ] cost: description: - The OSPF cost of the interface. - The cost (also called metric) of an interface in OSPF is an indication of the overhead required to send packets across a certain interface. The cost of an interface is inversely proportional to the bandwidth of that interface. A higher bandwidth indicates a lower cost. There is more overhead (higher cost) and time delays involved in crossing a 56k serial line than crossing a 10M ethernet line. The formula used to calculate the cost is C(cost= 10000 0000/bandwith in bps) For example, it will cost 10 EXP8/10 EXP7 = 10 to cross a 10M Ethernet line and will cost 10 EXP8/1544000 = 64 to cross a T1 line. - By default, the cost of an interface is calculated based on the bandwidth; you can force the cost of an interface with the ip ospf cost value interface subconfiguration mode command. - Accepted values range between C(1) and C(450). - The APIC defaults to C(0) when unset during creation. controls: description: - The interface policy controls. - 'This is a list of one or more of the following controls:' - C(advert-subnet) -- Advertise IP subnet instead of a host mask in the router LSA. - C(bfd) -- Bidirectional Forwarding Detection - C(mtu-ignore) -- Disables MTU mismatch detection on an interface. - C(passive) -- The interface does not participate in the OSPF protocol and will not establish adjacencies or send routing updates. However the interface is announced as part of the routing network. type: list choices: [ advert-subnet, bfd, mtu-ignore, passive ] dead_interval: description: - The interval between hello packets from a neighbor before the router declares the neighbor as down. - This value must be the same for all networking devices on a specific network. - Specifying a smaller dead interval (seconds) will give faster detection of a neighbor being down and improve convergence, but might cause more routing instability. - Accepted values range between C(1) and C(65535). - The APIC defaults to C(40) when unset during creation. type: int hello_interval: description: - The interval between hello packets that OSPF sends on the interface. - Note that the smaller the hello interval, the faster topological changes will be detected, but more routing traffic will ensue. - This value must be the same for all routers and access servers on a specific network. - Accepted values range between C(1) and C(65535). - The APIC defaults to C(10) when unset during creation. type: int prefix_suppression: description: - Whether prefix suppressions is enabled or disabled. - The APIC defaults to C(inherit) when unset during creation. type: bool priority: description: - The priority for the OSPF interface profile. - Accepted values ranges between C(0) and C(255). - The APIC defaults to C(1) when unset during creation. type: int retransmit_interval: description: - The interval between LSA retransmissions. - The retransmit interval occurs while the router is waiting for an acknowledgement from the neighbor router that it received the LSA. - If no acknowlegment is received at the end of the interval, then the LSA is resent. - Accepted values range between C(1) and C(65535). - The APIC defaults to C(5) when unset during creation. type: int transmit_delay: description: - The delay time needed to send an LSA update packet. - OSPF increments the LSA age time by the transmit delay amount before transmitting the LSA update. - You should take into account the transmission and propagation delays for the interface when you set this value. - Accepted values range between C(1) and C(450). - The APIC defaults to C(1) when unset during creation. type: int state: description: - Use C(present) or C(absent) for adding or removing. - Use C(query) for listing an object or multiple objects. choices: [ absent, present, query ] default: present extends_documentation_fragment: aci ''' EXAMPLES = r''' - name: Ensure ospf interface policy exists aci_interface_policy_ospf: host: apic username: admin password: SomeSecretPassword tenant: production ospf: ospf1 state: present delegate_to: localhost - name: Ensure ospf interface policy does not exist aci_interface_policy_ospf: host: apic username: admin password: SomeSecretPassword tenant: production ospf: ospf1 state: present delegate_to: localhost - name: Query an ospf interface policy aci_interface_policy_ospf: host: apic username: admin password: SomeSecretPassword tenant: production ospf: ospf1 state: query delegate_to: localhost register: query_result - name: Query all ospf interface policies in tenant production aci_interface_policy_ospf: host: apic username: admin password: SomeSecretPassword tenant: production state: query delegate_to: localhost register: query_result ''' RETURN = r''' current: description: The existing configuration from the APIC after the module has finished returned: success type: list sample: [ { "fvTenant": { "attributes": { "descr": "Production environment", "dn": "uni/tn-production", "name": "production", "nameAlias": "", "ownerKey": "", "ownerTag": "" } } } ] error: description: The error information as returned from the APIC returned: failure type: dict sample: { "code": "122", "text": "unknown managed object class foo" } raw: description: The raw output returned by the APIC REST API (xml or json) returned: parse error type: string sample: '<?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata>' sent: description: The actual/minimal configuration pushed to the APIC returned: info type: list sample: { "fvTenant": { "attributes": { "descr": "Production environment" } } } previous: description: The original configuration from the APIC before the module has started returned: info type: list sample: [ { "fvTenant": { "attributes": { "descr": "Production", "dn": "uni/tn-production", "name": "production", "nameAlias": "", "ownerKey": "", "ownerTag": "" } } } ] proposed: description: The assembled configuration from the user-provided parameters returned: info type: dict sample: { "fvTenant": { "attributes": { "descr": "Production environment", "name": "production" } } } filter_string: description: The filter string used for the request returned: failure or debug type: string sample: ?rsp-prop-include=config-only method: description: The HTTP method used for the request to the APIC returned: failure or debug type: string sample: POST response: description: The HTTP response from the APIC returned: failure or debug type: string sample: OK (30 bytes) status: description: The HTTP status from the APIC returned: failure or debug type: int sample: 200 url: description: The HTTP url used for the request to the APIC returned: failure or debug type: string sample: https://10.11.12.13/api/mo/uni/tn-production.json ''' from ansible.module_utils.network.aci.aci import ACIModule, aci_argument_spec from ansible.module_utils.basic import AnsibleModule def main(): argument_spec = aci_argument_spec() argument_spec.update( tenant=dict(type='str', required=False, aliases=['tenant_name']), # Not required for querying all objects ospf=dict(type='str', required=False, aliases=['ospf_interface', 'name']), # Not required for querying all objects description=dict(type='str', aliases=['descr']), network_type=dict(type='str', choices=['bcast', 'p2p']), cost=dict(type='int'), controls=dict(type='list', choices=['advert-subnet', 'bfd', 'mtu-ignore', 'passive']), dead_interval=dict(type='int'), hello_interval=dict(type='int'), prefix_suppression=dict(type='bool'), priority=dict(type='int'), retransmit_interval=dict(type='int'), transmit_delay=dict(type='int'), state=dict(type='str', default='present', choices=['absent', 'present', 'query']), ) module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=True, required_if=[ ['state', 'absent', ['ospf', 'tenant']], ['state', 'present', ['ospf', 'tenant']], ], ) aci = ACIModule(module) tenant = module.params['tenant'] ospf = module.params['ospf'] description = module.params['description'] if module.params['controls'] is None: controls = None else: controls = ','.join(module.params['controls']) cost = module.params['cost'] if cost is not None and cost not in range(1, 451): module.fail_json(msg="Parameter 'cost' is only valid in range between 1 and 450.") dead_interval = module.params['dead_interval'] if dead_interval is not None and dead_interval not in range(1, 65536): module.fail_json(msg="Parameter 'dead_interval' is only valid in range between 1 and 65536.") hello_interval = module.params['hello_interval'] if hello_interval is not None and hello_interval not in range(1, 65536): module.fail_json(msg="Parameter 'hello_interval' is only valid in range between 1 and 65536.") network_type = module.params['network_type'] prefix_suppression = aci.boolean(module.params['prefix_suppression'], 'enabled', 'disabled') priority = module.params['priority'] if priority is not None and priority not in range(0, 256): module.fail_json(msg="Parameter 'priority' is only valid in range between 1 and 255.") retransmit_interval = module.params['retransmit_interval'] if retransmit_interval is not None and retransmit_interval not in range(1, 65536): module.fail_json(msg="Parameter 'retransmit_interval' is only valid in range between 1 and 65536.") transmit_delay = module.params['transmit_delay'] if transmit_delay is not None and transmit_delay not in range(1, 451): module.fail_json(msg="Parameter 'transmit_delay' is only valid in range between 1 and 450.") state = module.params['state'] aci.construct_url( root_class=dict( aci_class='ospfIfPol', aci_rn='tn-{0}/ospfIfPol-{1}'.format(tenant, ospf), module_object=ospf, target_filter={'name': ospf}, ), ) aci.get_existing() if state == 'present': aci.payload( aci_class='ospfIfPol', class_config=dict( name=ospf, descr=description, cost=cost, ctrl=controls, deadIntvl=dead_interval, helloIntvl=hello_interval, nwT=network_type, pfxSuppress=prefix_suppression, prio=priority, rexmitIntvl=retransmit_interval, xmitDelay=transmit_delay, ), ) aci.get_diff(aci_class='ospfIfPol') aci.post_config() elif state == 'absent': aci.delete_config() aci.exit_json() if __name__ == "__main__": main()
""" =========== Link Editor =========== An Dialog to edit links between two nodes in the scheme. """ from collections import namedtuple from xml.sax.saxutils import escape from AnyQt.QtWidgets import ( QApplication, QDialog, QVBoxLayout, QDialogButtonBox, QGraphicsScene, QGraphicsView, QGraphicsWidget, QGraphicsRectItem, QGraphicsLineItem, QGraphicsTextItem, QGraphicsLayoutItem, QGraphicsLinearLayout, QGraphicsGridLayout, QGraphicsPixmapItem, QGraphicsDropShadowEffect, QSizePolicy, ) from AnyQt.QtGui import QPalette, QPen, QPainter, QIcon from AnyQt.QtCore import Qt, QObject, QSize, QSizeF, QPointF, QRectF, QT_VERSION from AnyQt.QtCore import pyqtSignal as Signal from ..scheme import SchemeNode, SchemeLink, compatible_channels from ..registry import InputSignal, OutputSignal from ..resources import icon_loader # This is a special value defined in Qt4 but does not seem to be exported # by PyQt4 QWIDGETSIZE_MAX = (1 << 24) - 1 class EditLinksDialog(QDialog): """ A dialog for editing links. >>> dlg = EditLinksDialog() >>> dlg.setNodes(file_node, test_learners_node) >>> dlg.setLinks([(file_node.output_channel("Data"), ... (test_learners_node.input_channel("Data")]) >>> if dlg.exec_() == EditLinksDialog.Accpeted: ... new_links = dlg.links() ... """ def __init__(self, *args, **kwargs): QDialog.__init__(self, *args, **kwargs) self.setModal(True) self.__setupUi() def __setupUi(self): layout = QVBoxLayout() # Scene with the link editor. self.scene = LinksEditScene() self.view = QGraphicsView(self.scene) self.view.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.view.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.view.setRenderHint(QPainter.Antialiasing) self.scene.editWidget.geometryChanged.connect(self.__onGeometryChanged) # Ok/Cancel/Clear All buttons. buttons = QDialogButtonBox( QDialogButtonBox.Ok | QDialogButtonBox.Cancel | QDialogButtonBox.Reset, Qt.Horizontal, ) clear_button = buttons.button(QDialogButtonBox.Reset) clear_button.setText(self.tr("Clear All")) buttons.accepted.connect(self.accept) buttons.rejected.connect(self.reject) clear_button.clicked.connect(self.scene.editWidget.clearLinks) layout.addWidget(self.view) layout.addWidget(buttons) self.setLayout(layout) layout.setSizeConstraint(QVBoxLayout.SetFixedSize) self.setSizeGripEnabled(False) def setNodes(self, source_node, sink_node): """ Set the source/sink nodes (:class:`.SchemeNode` instances) between which to edit the links. .. note:: This should be called before :func:`setLinks`. """ self.scene.editWidget.setNodes(source_node, sink_node) def setLinks(self, links): """ Set a list of links to display between the source and sink nodes. The `links` is a list of (`OutputSignal`, `InputSignal`) tuples where the first element is an output signal of the source node and the second an input signal of the sink node. """ self.scene.editWidget.setLinks(links) def links(self): """ Return the links between the source and sink node. """ return self.scene.editWidget.links() def __onGeometryChanged(self): size = self.scene.editWidget.size() left, top, right, bottom = self.getContentsMargins() self.view.setFixedSize( size.toSize() + QSize(left + right + 4, top + bottom + 4) ) def find_item_at(scene, pos, order=Qt.DescendingOrder, type=None, name=None): """ Find an object in a :class:`QGraphicsScene` `scene` at `pos`. If `type` is not `None` the it must specify the type of the item. I `name` is not `None` it must be a name of the object (`QObject.objectName()`). """ items = scene.items(pos, Qt.IntersectsItemShape, order) for item in items: if type is not None and not isinstance(item, type): continue if name is not None and isinstance(item, QObject) and item.objectName() != name: continue return item else: return None class LinksEditScene(QGraphicsScene): """ A :class:`QGraphicsScene` used by the :class:`LinkEditWidget`. """ def __init__(self, *args, **kwargs): QGraphicsScene.__init__(self, *args, **kwargs) self.editWidget = LinksEditWidget() self.addItem(self.editWidget) findItemAt = find_item_at _Link = namedtuple( "_Link", [ "output", # OutputSignal "input", # InputSignal "lineItem", # QGraphicsLineItem connecting the input to output ], ) class LinksEditWidget(QGraphicsWidget): """ A Graphics Widget for editing the links between two nodes. """ def __init__(self, *args, **kwargs): QGraphicsWidget.__init__(self, *args, **kwargs) self.setAcceptedMouseButtons(Qt.LeftButton | Qt.RightButton) self.source = None self.sink = None # QGraphicsWidget/Items in the scene. self.sourceNodeWidget = None self.sourceNodeTitle = None self.sinkNodeWidget = None self.sinkNodeTitle = None self.__links = [] self.__textItems = [] self.__iconItems = [] self.__tmpLine = None self.__dragStartItem = None self.setLayout(QGraphicsLinearLayout(Qt.Vertical)) self.layout().setContentsMargins(0, 0, 0, 0) def removeItems(self, items): """ Remove child items from the widget and scene. """ scene = self.scene() for item in items: item.setParentItem(None) if scene is not None: scene.removeItem(item) def clear(self): """ Clear the editor state (source and sink nodes, channels ...). """ if self.layout().count(): widget = self.layout().takeAt(0).graphicsItem() self.removeItems([widget]) self.source = None self.sink = None def setNodes(self, source, sink): """ Set the source/sink nodes (:class:`SchemeNode` instances) between which to edit the links. .. note:: Call this before :func:`setLinks`. """ self.clear() self.source = source self.sink = sink self.__updateState() def setLinks(self, links): """ Set a list of links to display between the source and sink nodes. `links` must be a list of (`OutputSignal`, `InputSignal`) tuples where the first element refers to the source node and the second to the sink node (as set by `setNodes`). """ self.clearLinks() for output, input in links: self.addLink(output, input) def links(self): """ Return the links between the source and sink node. """ return [(link.output, link.input) for link in self.__links] def mousePressEvent(self, event): if event.button() == Qt.LeftButton: startItem = find_item_at(self.scene(), event.pos(), type=ChannelAnchor) if startItem is not None: # Start a connection line drag. self.__dragStartItem = startItem self.__tmpLine = None event.accept() return lineItem = find_item_at( self.scene(), event.scenePos(), type=QGraphicsLineItem ) if lineItem is not None: # Remove a connection under the mouse for link in self.__links: if link.lineItem == lineItem: self.removeLink(link.output, link.input) event.accept() return QGraphicsWidget.mousePressEvent(self, event) def mouseMoveEvent(self, event): if event.buttons() & Qt.LeftButton: downPos = event.buttonDownPos(Qt.LeftButton) if ( not self.__tmpLine and self.__dragStartItem and (downPos - event.pos()).manhattanLength() > QApplication.instance().startDragDistance() ): # Start a line drag line = QGraphicsLineItem(self) start = self.__dragStartItem.boundingRect().center() start = self.mapFromItem(self.__dragStartItem, start) line.setLine(start.x(), start.y(), event.pos().x(), event.pos().y()) pen = QPen(self.palette().color(QPalette.Foreground), 4) pen.setCapStyle(Qt.RoundCap) line.setPen(pen) line.show() self.__tmpLine = line if self.__tmpLine: # Update the temp line line = self.__tmpLine.line() line.setP2(event.pos()) self.__tmpLine.setLine(line) QGraphicsWidget.mouseMoveEvent(self, event) def mouseReleaseEvent(self, event): if event.button() == Qt.LeftButton and self.__tmpLine: endItem = find_item_at(self.scene(), event.scenePos(), type=ChannelAnchor) if endItem is not None: startItem = self.__dragStartItem startChannel = startItem.channel() endChannel = endItem.channel() possible = False # Make sure the drag was from input to output (or reversed) and # not between input -> input or output -> output if type(startChannel) != type(endChannel): if isinstance(startChannel, InputSignal): startChannel, endChannel = endChannel, startChannel possible = compatible_channels(startChannel, endChannel) if possible: self.addLink(startChannel, endChannel) self.scene().removeItem(self.__tmpLine) self.__tmpLine = None self.__dragStartItem = None QGraphicsWidget.mouseReleaseEvent(self, event) def addLink(self, output, input): """ Add a link between `output` (:class:`OutputSignal`) and `input` (:class:`InputSignal`). """ if not compatible_channels(output, input): return if output not in self.source.output_channels(): raise ValueError( "%r is not an output channel of %r" % (output, self.source) ) if input not in self.sink.input_channels(): raise ValueError("%r is not an input channel of %r" % (input, self.sink)) if input.single: # Remove existing link if it exists. for s1, s2, _ in self.__links: if s2 == input: self.removeLink(s1, s2) line = QGraphicsLineItem(self) source_anchor = self.sourceNodeWidget.anchor(output) sink_anchor = self.sinkNodeWidget.anchor(input) source_pos = source_anchor.boundingRect().center() source_pos = self.mapFromItem(source_anchor, source_pos) sink_pos = sink_anchor.boundingRect().center() sink_pos = self.mapFromItem(sink_anchor, sink_pos) line.setLine(source_pos.x(), source_pos.y(), sink_pos.x(), sink_pos.y()) pen = QPen(self.palette().color(QPalette.Foreground), 4) pen.setCapStyle(Qt.RoundCap) line.setPen(pen) self.__links.append(_Link(output, input, line)) def removeLink(self, output, input): """ Remove a link between the `output` and `input` channels. """ for link in list(self.__links): if link.output == output and link.input == input: self.scene().removeItem(link.lineItem) self.__links.remove(link) break else: raise ValueError( "No such link {0.name!r} -> {1.name!r}.".format(output, input) ) def clearLinks(self): """ Clear (remove) all the links. """ for output, input, _ in list(self.__links): self.removeLink(output, input) def __updateState(self): """ Update the widget with the new source/sink node signal descriptions. """ widget = QGraphicsWidget() widget.setLayout(QGraphicsGridLayout()) # Space between left and right anchors widget.layout().setHorizontalSpacing(50) left_node = EditLinksNode(self, direction=Qt.LeftToRight, node=self.source) left_node.setSizePolicy( QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding ) right_node = EditLinksNode(self, direction=Qt.RightToLeft, node=self.sink) right_node.setSizePolicy( QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding ) left_node.setMinimumWidth(150) right_node.setMinimumWidth(150) widget.layout().addItem(left_node, 0, 0) widget.layout().addItem(right_node, 0, 1) title_template = "<center><b>{0}<b></center>" left_title = GraphicsTextWidget(self) left_title.setHtml(title_template.format(escape(self.source.title))) left_title.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) right_title = GraphicsTextWidget(self) right_title.setHtml(title_template.format(escape(self.sink.title))) right_title.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) widget.layout().addItem( left_title, 1, 0, alignment=Qt.AlignHCenter | Qt.AlignTop ) widget.layout().addItem( right_title, 1, 1, alignment=Qt.AlignHCenter | Qt.AlignTop ) widget.setParentItem(self) max_w = max( left_node.sizeHint(Qt.PreferredSize).width(), right_node.sizeHint(Qt.PreferredSize).width(), ) # fix same size left_node.setMinimumWidth(max_w) right_node.setMinimumWidth(max_w) left_title.setMinimumWidth(max_w) right_title.setMinimumWidth(max_w) self.layout().addItem(widget) self.layout().activate() self.sourceNodeWidget = left_node self.sinkNodeWidget = right_node self.sourceNodeTitle = left_title self.sinkNodeTitle = right_title if QT_VERSION < 0x40700: geometryChanged = Signal() def setGeometry(self, rect): QGraphicsWidget.setGeometry(self, rect) self.geometryChanged.emit() class EditLinksNode(QGraphicsWidget): """ A Node representation with channel anchors. `direction` specifies the layout (default `Qt.LeftToRight` will have icon on the left and channels on the right). """ def __init__( self, parent=None, direction=Qt.LeftToRight, node=None, icon=None, iconSize=None, **args ): QGraphicsWidget.__init__(self, parent, **args) self.setAcceptedMouseButtons(Qt.NoButton) self.__direction = direction self.setLayout(QGraphicsLinearLayout(Qt.Horizontal)) # Set the maximum size, otherwise the layout can't grow beyond its # sizeHint (and we need it to grow so the widget can grow and keep the # contents centered vertically. self.layout().setMaximumSize(QSizeF(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)) self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.__iconSize = iconSize or QSize(64, 64) self.__icon = icon self.__iconItem = QGraphicsPixmapItem(self) self.__iconLayoutItem = GraphicsItemLayoutItem(item=self.__iconItem) self.__channelLayout = QGraphicsGridLayout() self.__channelAnchors = [] if self.__direction == Qt.LeftToRight: self.layout().addItem(self.__iconLayoutItem) self.layout().addItem(self.__channelLayout) channel_alignemnt = Qt.AlignRight else: self.layout().addItem(self.__channelLayout) self.layout().addItem(self.__iconLayoutItem) channel_alignemnt = Qt.AlignLeft self.layout().setAlignment(self.__iconLayoutItem, Qt.AlignCenter) self.layout().setAlignment( self.__channelLayout, Qt.AlignVCenter | channel_alignemnt ) if node is not None: self.setSchemeNode(node) def setIconSize(self, size): """ Set the icon size for the node. """ if size != self.__iconSize: self.__iconSize = QSize(size) if self.__icon: self.__iconItem.setPixmap(self.__icon.pixmap(size)) self.__iconLayoutItem.updateGeometry() def iconSize(self): """ Return the icon size. """ return QSize(self.__iconSize) def setIcon(self, icon): """ Set the icon to display. """ if icon != self.__icon: self.__icon = QIcon(icon) self.__iconItem.setPixmap(icon.pixmap(self.iconSize())) self.__iconLayoutItem.updateGeometry() def icon(self): """ Return the icon. """ return QIcon(self.__icon) def setSchemeNode(self, node): """ Set an instance of `SchemeNode`. The widget will be initialized with its icon and channels. """ self.node = node if self.__direction == Qt.LeftToRight: channels = node.output_channels() else: channels = node.input_channels() self.channels = channels loader = icon_loader.from_description(node.description) icon = loader.get(node.description.icon) self.setIcon(icon) label_template = ( '<div align="{align}">' '<span class="channelname">{name}</span>' "</div>" ) if self.__direction == Qt.LeftToRight: align = "right" label_alignment = Qt.AlignVCenter | Qt.AlignRight anchor_alignment = Qt.AlignVCenter | Qt.AlignLeft label_row = 0 anchor_row = 1 else: align = "left" label_alignment = Qt.AlignVCenter | Qt.AlignLeft anchor_alignment = Qt.AlignVCenter | Qt.AlignLeft label_row = 1 anchor_row = 0 self.__channelAnchors = [] grid = self.__channelLayout for i, channel in enumerate(channels): text = label_template.format(align=align, name=escape(channel.name)) text_item = GraphicsTextWidget(self) text_item.setHtml(text) text_item.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) text_item.setToolTip(escape(getattr(channel, "description", channel.type))) grid.addItem(text_item, i, label_row, alignment=label_alignment) anchor = ChannelAnchor(self, channel=channel, rect=QRectF(0, 0, 20, 20)) anchor.setBrush(self.palette().brush(QPalette.Mid)) layout_item = GraphicsItemLayoutItem(grid, item=anchor) grid.addItem(layout_item, i, anchor_row, alignment=anchor_alignment) anchor.setToolTip(escape(channel.type)) self.__channelAnchors.append(anchor) def anchor(self, channel): """ Return the anchor item for the `channel` name. """ for anchor in self.__channelAnchors: if anchor.channel() == channel: return anchor raise ValueError(channel.name) def paint(self, painter, option, widget=None): painter.save() palette = self.palette() border = palette.brush(QPalette.Mid) pen = QPen(border, 1) pen.setCosmetic(True) painter.setPen(pen) painter.setBrush(palette.brush(QPalette.Window)) brect = self.boundingRect() painter.drawRoundedRect(brect, 4, 4) painter.restore() class GraphicsItemLayoutItem(QGraphicsLayoutItem): """ A graphics layout that handles the position of a general QGraphicsItem in a QGraphicsLayout. The items boundingRect is used as this items fixed sizeHint and the item is positioned at the top left corner of the this items geometry. """ def __init__(self, parent=None, item=None): self.__item = None QGraphicsLayoutItem.__init__(self, parent, isLayout=False) self.setOwnedByLayout(True) self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) if item is not None: self.setItem(item) def setItem(self, item): self.__item = item self.setGraphicsItem(item) def setGeometry(self, rect): # TODO: specifiy if the geometry should be set relative to the # bounding rect top left corner if self.__item: self.__item.setPos(rect.topLeft()) QGraphicsLayoutItem.setGeometry(self, rect) def sizeHint(self, which, constraint): if self.__item: return self.__item.boundingRect().size() else: return QGraphicsLayoutItem.sizeHint(self, which, constraint) class ChannelAnchor(QGraphicsRectItem): """ A rectangular Channel Anchor indicator. """ def __init__(self, parent=None, channel=None, rect=None, **kwargs): QGraphicsRectItem.__init__(self, **kwargs) self.setAcceptHoverEvents(True) self.setAcceptedMouseButtons(Qt.NoButton) self.__channel = None if rect is None: rect = QRectF(0, 0, 20, 20) self.setRect(rect) if channel: self.setChannel(channel) self.__shadow = QGraphicsDropShadowEffect(blurRadius=5, offset=QPointF(0, 0)) self.setGraphicsEffect(self.__shadow) self.__shadow.setEnabled(False) def setChannel(self, channel): """ Set the channel description. """ if channel != self.__channel: self.__channel = channel if hasattr(channel, "description"): self.setToolTip(channel.description) # TODO: Should also include name, type, flags, dynamic in the # tool tip as well as add visual clues to the anchor def channel(self): """ Return the channel description. """ return self.__channel def hoverEnterEvent(self, event): self.__shadow.setEnabled(True) QGraphicsRectItem.hoverEnterEvent(self, event) def hoverLeaveEvent(self, event): self.__shadow.setEnabled(False) QGraphicsRectItem.hoverLeaveEvent(self, event) class GraphicsTextWidget(QGraphicsWidget): """ A QGraphicsWidget subclass that manages a `QGraphicsTextItem`. """ def __init__(self, parent=None, textItem=None): QGraphicsLayoutItem.__init__(self, parent) if textItem is None: textItem = QGraphicsTextItem() self.__textItem = textItem self.__textItem.setParentItem(self) self.__textItem.setPos(0, 0) doc_layout = self.document().documentLayout() doc_layout.documentSizeChanged.connect(self._onDocumentSizeChanged) def sizeHint(self, which, constraint=QSizeF()): if which == Qt.PreferredSize: doc = self.document() textwidth = doc.textWidth() if textwidth != constraint.width(): cloned = doc.clone(self) cloned.setTextWidth(constraint.width()) sh = cloned.size() cloned.deleteLater() else: sh = doc.size() return sh else: return QGraphicsWidget.sizeHint(self, which, constraint) def setGeometry(self, rect): QGraphicsWidget.setGeometry(self, rect) self.__textItem.setTextWidth(rect.width()) def setPlainText(self, text): self.__textItem.setPlainText(text) self.updateGeometry() def setHtml(self, text): self.__textItem.setHtml(text) def adjustSize(self): self.__textItem.adjustSize() self.updateGeometry() def setDefaultTextColor(self, color): self.__textItem.setDefaultTextColor(color) def document(self): return self.__textItem.document() def setDocument(self, doc): doc_layout = self.document().documentLayout() doc_layout.documentSizeChanged.disconnect(self._onDocumentSizeChanged) self.__textItem.setDocument(doc) doc_layout = self.document().documentLayout() doc_layout.documentSizeChanged.connect(self._onDocumentSizeChanged) self.updateGeometry() def _onDocumentSizeChanged(self, size): """The doc size has changed""" self.updateGeometry()
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . import outputs from ._inputs import * __all__ = ['CertificateArgs', 'Certificate'] @pulumi.input_type class CertificateArgs: def __init__(__self__, *, resource_group_name: pulumi.Input[str], service_name: pulumi.Input[str], certificate_name: Optional[pulumi.Input[str]] = None, properties: Optional[pulumi.Input['CertificatePropertiesArgs']] = None): """ The set of arguments for constructing a Certificate resource. :param pulumi.Input[str] resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :param pulumi.Input[str] service_name: The name of the Service resource. :param pulumi.Input[str] certificate_name: The name of the certificate resource. :param pulumi.Input['CertificatePropertiesArgs'] properties: Properties of the certificate resource payload. """ pulumi.set(__self__, "resource_group_name", resource_group_name) pulumi.set(__self__, "service_name", service_name) if certificate_name is not None: pulumi.set(__self__, "certificate_name", certificate_name) if properties is not None: pulumi.set(__self__, "properties", properties) @property @pulumi.getter(name="resourceGroupName") def resource_group_name(self) -> pulumi.Input[str]: """ The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. """ return pulumi.get(self, "resource_group_name") @resource_group_name.setter def resource_group_name(self, value: pulumi.Input[str]): pulumi.set(self, "resource_group_name", value) @property @pulumi.getter(name="serviceName") def service_name(self) -> pulumi.Input[str]: """ The name of the Service resource. """ return pulumi.get(self, "service_name") @service_name.setter def service_name(self, value: pulumi.Input[str]): pulumi.set(self, "service_name", value) @property @pulumi.getter(name="certificateName") def certificate_name(self) -> Optional[pulumi.Input[str]]: """ The name of the certificate resource. """ return pulumi.get(self, "certificate_name") @certificate_name.setter def certificate_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "certificate_name", value) @property @pulumi.getter def properties(self) -> Optional[pulumi.Input['CertificatePropertiesArgs']]: """ Properties of the certificate resource payload. """ return pulumi.get(self, "properties") @properties.setter def properties(self, value: Optional[pulumi.Input['CertificatePropertiesArgs']]): pulumi.set(self, "properties", value) class Certificate(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, certificate_name: Optional[pulumi.Input[str]] = None, properties: Optional[pulumi.Input[pulumi.InputType['CertificatePropertiesArgs']]] = None, resource_group_name: Optional[pulumi.Input[str]] = None, service_name: Optional[pulumi.Input[str]] = None, __props__=None): """ Certificate resource payload. :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] certificate_name: The name of the certificate resource. :param pulumi.Input[pulumi.InputType['CertificatePropertiesArgs']] properties: Properties of the certificate resource payload. :param pulumi.Input[str] resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :param pulumi.Input[str] service_name: The name of the Service resource. """ ... @overload def __init__(__self__, resource_name: str, args: CertificateArgs, opts: Optional[pulumi.ResourceOptions] = None): """ Certificate resource payload. :param str resource_name: The name of the resource. :param CertificateArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(CertificateArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, certificate_name: Optional[pulumi.Input[str]] = None, properties: Optional[pulumi.Input[pulumi.InputType['CertificatePropertiesArgs']]] = None, resource_group_name: Optional[pulumi.Input[str]] = None, service_name: Optional[pulumi.Input[str]] = None, __props__=None): if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = CertificateArgs.__new__(CertificateArgs) __props__.__dict__["certificate_name"] = certificate_name __props__.__dict__["properties"] = properties if resource_group_name is None and not opts.urn: raise TypeError("Missing required property 'resource_group_name'") __props__.__dict__["resource_group_name"] = resource_group_name if service_name is None and not opts.urn: raise TypeError("Missing required property 'service_name'") __props__.__dict__["service_name"] = service_name __props__.__dict__["name"] = None __props__.__dict__["type"] = None alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="azure-nextgen:appplatform/v20210303preview:Certificate"), pulumi.Alias(type_="azure-native:appplatform:Certificate"), pulumi.Alias(type_="azure-nextgen:appplatform:Certificate"), pulumi.Alias(type_="azure-native:appplatform/v20190501preview:Certificate"), pulumi.Alias(type_="azure-nextgen:appplatform/v20190501preview:Certificate"), pulumi.Alias(type_="azure-native:appplatform/v20200701:Certificate"), pulumi.Alias(type_="azure-nextgen:appplatform/v20200701:Certificate"), pulumi.Alias(type_="azure-native:appplatform/v20201101preview:Certificate"), pulumi.Alias(type_="azure-nextgen:appplatform/v20201101preview:Certificate")]) opts = pulumi.ResourceOptions.merge(opts, alias_opts) super(Certificate, __self__).__init__( 'azure-native:appplatform/v20210303preview:Certificate', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None) -> 'Certificate': """ Get an existing Certificate resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = CertificateArgs.__new__(CertificateArgs) __props__.__dict__["name"] = None __props__.__dict__["properties"] = None __props__.__dict__["type"] = None return Certificate(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter def name(self) -> pulumi.Output[str]: """ The name of the resource. """ return pulumi.get(self, "name") @property @pulumi.getter def properties(self) -> pulumi.Output['outputs.CertificatePropertiesResponse']: """ Properties of the certificate resource payload. """ return pulumi.get(self, "properties") @property @pulumi.getter def type(self) -> pulumi.Output[str]: """ The type of the resource. """ return pulumi.get(self, "type")
import React, { useEffect,useState } from 'react'; import { BrowserRouter as Router, Routes } from 'react-router-dom'; import {useNavigate} from 'react-router-dom'; var url = "https://jsonplaceholder.typicode.com" const Login = function(){ let navigate = useNavigate(); const [success,setSuccess] = useState(); const [data,setData] = useState(''); const [name,setName]= useState(''); const [email,setEmail]= useState(''); const getData = (pram)=>{ return fetch(url+pram) .then(res => res.json()) } const handleSubmit = (e)=>{ e.preventDefault(); if(localStorage.length == 0){ localStorage.setItem('user-name',name); localStorage.setItem('email',email); } setSuccess('done'); } const handleLogout = (e)=>{ e.preventDefault(); localStorage.clear(); } useEffect(() => { setSuccess('done'); if(localStorage.length > 0){ setName(localStorage.getItem('user-name')); setEmail(localStorage.getItem('email')); console.log(localStorage.getItem('user-name')); console.log(localStorage.getItem('email')); getData(`/users?username=${name}&&email=${email}`).then( (result) => { setData(result); }, (error) => { console.error(error) } ) } if(name !== ''){ getData(`/users?username=${name}&&email=${email}`).then( (result) => { setData(result[0]); }, (error) => { console.error(error) } ) } }, [success]) return( <> <div> <h2>Login</h2> <input type='name' onChange={(e)=>setName(e.target.value )}placeholder='Enter your name please : '/> <br/> <input type='email' onChange={(e)=>setEmail(e.target.value )} placeholder='Enter your email please : '/> <br/> <button onClick={handleSubmit}>Login</button> </div> <br/><br/> <div> { <div> <p>Name : {data.name}</p> <p>Phone : {data.phone}</p> <p>Website : {data.website}</p> </div> } </div> <br/><br/><br/> <span>Logout : </span> <button onClick={handleLogout}>logout</button> </> ) } export default Login;
export default { confirmLabel: 'Ok', backspaceLabel: 'Backspace', cancelKeyboardLabel: 'CancelKeyboard' }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3ZfU0UuanMiLCJzb3VyY2VSb290IjoiLi4vLi4vY29tcG9uZW50cy8iLCJzb3VyY2VzIjpbImlucHV0LWl0ZW0vbG9jYWxlL3N2X1NFLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQWU7SUFDYixZQUFZLEVBQUUsSUFBSTtJQUNsQixjQUFjLEVBQUUsV0FBVztJQUMzQixtQkFBbUIsRUFBRSxnQkFBZ0I7Q0FDdEMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IHtcbiAgY29uZmlybUxhYmVsOiAnT2snLFxuICBiYWNrc3BhY2VMYWJlbDogJ0JhY2tzcGFjZScsXG4gIGNhbmNlbEtleWJvYXJkTGFiZWw6ICdDYW5jZWxLZXlib2FyZCdcbn07XG4iXX0=
require('babel-polyfill') const bodyParser = require('body-parser') const express = require('express') const path = require('path') const ejs = require('ejs') const { IS_LOCALHOST, IS_DEV, IS_SANDBOX } = require('./lib/config') const { getModelWithApp } = require('./lib/model') const { setApisWithAppAndModel } = require('./lib/apis') // in localhost condition we need to import // the secret values from a secret script if (IS_LOCALHOST) { const env = require('node-env-file') const envType = IS_DEV ? 'development' : (IS_SANDBOX ? 'sandbox' : null) if (envType) { env(`${__dirname}/../scripts/${envType}_secret.sh`) } } const app = express() app.set('view engine', 'html') app.engine('html', ejs.renderFile) app.use(express.static(path.join(__dirname, ''))) app.use(bodyParser.json()) app.use(bodyParser.json({ type: 'application/vnd.api+json' })) const { PORT } = process.env app.set('port', (PORT || 5000)) function redirectHome (req, res) { const indexFileName = process.env.TYPE === 'localhost' ? '_dev_index.html' : '_prod_index.html' res.render(path.join(__dirname, `templates/${indexFileName}`)) } getModelWithApp(app, { mongoUrl: process.env.MONGO_URL }).then( model => { setApisWithAppAndModel(app, model) app.get('/*', redirectHome) } ) module.exports.app = app
/* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. /** * This sample demonstrates how to Lists all the encryption scopes available under the specified storage account. * * @summary Lists all the encryption scopes available under the specified storage account. * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2021-08-01/examples/StorageAccountEncryptionScopeList.json */ const { StorageManagementClient } = require("@azure/arm-storage"); const { DefaultAzureCredential } = require("@azure/identity"); async function storageAccountEncryptionScopeList() { const subscriptionId = "{subscription-id}"; const resourceGroupName = "resource-group-name"; const accountName = "{storage-account-name}"; const credential = new DefaultAzureCredential(); const client = new StorageManagementClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.encryptionScopes.list(resourceGroupName, accountName)) { resArray.push(item); } console.log(resArray); } storageAccountEncryptionScopeList().catch(console.error);
import $axios from '../api.js' const state = () => ({ products: [], //STATE YANG AKAN MENYIMPAN DATA PRODUCT laundry_types: [], page: 1 }) const mutations = { //MUTATION UNTUK MEMASUKKAN DATA KE DALAM STATE PRODUCTS ASSIGN_DATA(state, payload) { state.products = payload }, //MUTATION UNTUK MENGUBAH VALUE DARI STATE PAGE ASSIGN_LAUNDRY_TYPE(state, payload) { state.laundry_types = payload }, SET_PAGE(state, payload) { state.page = payload } } const actions = { //FUNGSI UNTUK MENGAMBIL DATA KE SERVER getProducts( { commit, state }, payload) { let search = typeof payload != 'undefined' ? payload : '' return new Promise((resolve, reject) => { //MENGGUNAKAN AXIOS PADA URL /PRODUCT $axios.get(`/product?page=${state.page}&q=${search}`) .then((response) => { //APABILA MENDAPATKAN RESPONSE, DATA AKAN DICOMMIT KE MUTATION ASSIGN_DATA commit('ASSIGN_DATA', response.data) resolve(response.data) }) }) }, getLaundryType( { commit }) { return new Promise((resolve, reject) => { //MENGIRIM REQUEST UNTUK MENGAMBIL DATA LAUNDRY TYPE $axios.get(`/product/laundry-type`) .then((response) => { commit('ASSIGN_LAUNDRY_TYPE', response.data.data) //COMMIT DATA KE MUTATIONS ASSIGN_LAUNDRY_TYPE resolve(response.data) }) }) }, addLaundryType( { commit }, payload) { return new Promise((resolve, reject) => { //MENGIRIM REQUEST UNTUK MENYIMPAN LAUNDRY_TYPE YANG BARU $axios.post(`/product/laundry-type`, payload) .then((response) => { resolve(response.data) }) .catch((error) => { //JIKA TERJADI ERROR VALIDASI, MAKA ERRORNYA DISIMPAN KE DALAM VARIABLE ERRORS if (error.response.status == 422) { commit('SET_ERRORS', error.response.data.errors, {root: true}) } }) }) }, addProductLaundry( { commit }, payload) { return new Promise((resolve, reject) => { //MENGIRIM REQUEST UNTUK MENAMBAHKAN DATA PRODUCT BARU $axios.post(`/product`, payload) .then((response) => { resolve(response.data) }) .catch((error) => { //SET ERROR VALIDASI if (error.response.status == 422) { commit('SET_ERRORS', error.response.data.errors, {root: true}) } }) }) }, editProduct( { commit }, payload) { return new Promise((resolve, reject) => { //MENGIRIM REQUEST UNTUK MENGAMBIL DATA PRODUCT BERDASARKAN ID $axios.get(`/product/${payload}/edit`) .then((response) => { resolve(response.data) }) }) }, updateCourier( { commit }, payload) { return new Promise((resolve, reject) => { //MENGIRIM REQUEST UNTUK MENGUBAH DATA PRODUCT BERDASARKAN ID $axios.put(`/product/${payload.id}`, payload) .then((response) => { resolve(response.data) }) .catch((error) => { //SET ERROR VALIDASI if (error.response.status == 422) { commit('SET_ERRORS', error.response.data.errors, {root: true}) } }) }) }, removeProduct( { dispatch }, payload) { return new Promise((resolve, reject) => { //MENGIRIM PERMINTAAN UNTUK MENGHAPUS DATA PRODUCT BERDASARKAN ID $axios.delete(`/product/${payload}`) .then((response) => { dispatch('getProducts').then(() => resolve(response.data)) }) }) } } export default { namespaced: true, state, actions, mutations }
/*global history */ sap.ui.define([ 'sap/m/Button', "sap/migratedsalesorder/controller/BaseController", "sap/m/MessageToast" ], function (Button, BaseController, MessageToast, Dialog) { "use strict"; return BaseController.extend("sap.migratedsalesorder.controller.DocFlow", { onInit: function () { // call the base constructor BaseController.prototype.onInit.apply(this, arguments); this._configureSingleSelectSmartTable("editableContainer_docFlow", this._onRowSelectionChange); }, /** * Method for the Document Type filter on the document Flow page . */ onBeforeRebindTableExtension : function(oEvent) { var oBindingParams = oEvent.getParameter("bindingParams"); oBindingParams.parameters = oBindingParams.parameters || {}; var oSmartTable = oEvent.getSource(); var oSmartFilterBar = this.byId(oSmartTable.getSmartFilterId()); if (oSmartFilterBar instanceof sap.ui.comp.smartfilterbar.SmartFilterBar) { var oCustomControl = oSmartFilterBar.getControlByKey("TypeFilter"); if (oCustomControl instanceof sap.m.ComboBox) { var sValue = oCustomControl.getProperty("value"); if(sValue === "" || sValue === "All"){ oBindingParams.filters = []; }else{ oBindingParams.filters.push(new sap.ui.model.Filter("Type", "EQ", sValue)); } } } }, /** * Navigation to Doc Flow Detail on Row selection on the Doc Flow page. */ _onRowSelectionChange: function (oControlEvent) { var oRowContext = oControlEvent.getParameters("rowContext"); // the '/' is not allowed in the hash while navigating. this.getRouter().navTo("genericDocumentDetail", {docFlowPath : oRowContext.rowContext.sPath.substr(1,oRowContext.rowContext.sPath.length)}); } }); } );
const fs = require('fs'); const { performance } = require('perf_hooks'); const puppeteer = require('puppeteer-core'); const axios = require('axios'); const dateFormat = require('dateformat'); const dotEnv = require('dotenv'); (async () => { dotEnv.config(); const browser = await puppeteer.launch({ executablePath: process.env.CHROME_DIR, headless: true, defaultViewport: null }); const page = await browser.newPage(); const fileName = "knownCommentsNumber.txt"; const recheckIntervalInMinutes = 10; // Change here to set how often you want to recheck your game submission page const baseUrl = "https://itch.io"; const itchioTimezoneOffset = "GMT-00:00"; const gameJamPath = process.env.GAME_JAM_PATH; const gameId = process.env.GAME_ID; const iftttPlaceholderUrl = "https://maker.ifttt.com/trigger/TASK/with/key/USER_KEY"; const iftttTask = process.env.IFTTT_TASK; const iftttKey = process.env.IFTTT_KEY; function logger(logMessage) { let logDate = dateFormat(new Date(), "dd-mm-yyyy HH:MM:ss"); console.log(`[${logDate}] ${logMessage}`); } async function loadPage(pageUrl) { await measureTime(["Loading", "Loaded"], "itch.io page", async () => { await page.goto(pageUrl, {waitUntil: 'networkidle2'}); }) } async function sendWebhookRequest(commentBodyString, commentDate, commentLinkString) { logger(`Comment message: "${commentBodyString}"`); logger(`Comment date: ${commentDate.toString()}`); logger(`Comment url: ${baseUrl + commentLinkString}`); let iftttUrl = iftttPlaceholderUrl .replace("TASK", iftttTask) .replace("USER_KEY", iftttKey); await measureTime(["Sending", "Sent"],"webhook request", async () => { await axios.post(iftttUrl, { value1: commentBodyString, value2: commentDate.toString(), value3: baseUrl + commentLinkString }); }); } async function measureTime(logJobActionsDescription, logJobName, callback) { logger(`${logJobActionsDescription[0]} ${logJobName}...`); let start = performance.now(); await callback(); let end = performance.now(); logger(`${logJobActionsDescription[1]} ${logJobName} successfully. It took ${((end - start)/1000).toFixed(5)} seconds`); } (async function checkComments() { console.log(`\n==============================`); logger(`Checking for comments`); await loadPage(baseUrl + gameJamPath + gameId); try { let comments = (await page.$$(".community_post.sidebar_avatar")).reverse(); let fileData = fs.readFileSync(fileName, 'utf8'); let knownCommentsNumber = parseInt(fileData) || 0; if (comments.length > knownCommentsNumber) { fs.writeFileSync(fileName, comments.length); logger(`Updated '${fileName}' with number ${comments.length}`); for (let i = knownCommentsNumber; i < comments.length; i++) { let commentDateElement = await comments[i].$(".post_date"); let commentLinkElement = await comments[i].$(".post_date a"); let commentBodyElement = await comments[i].$(".post_body"); let commentLinkString = await page.evaluate(element => element.getAttribute("href"), commentLinkElement); let commentDateString = await page.evaluate(element => element.getAttribute("title"), commentDateElement); let commentBodyString = await page.evaluate(element => element.textContent, commentBodyElement); let commentDate = new Date(`${commentDateString} ${itchioTimezoneOffset}`); logger(`Sending request for comment #${i+1}:`); await sendWebhookRequest(commentBodyString, commentDate, commentLinkString); } } else { logger(`Already updated. Found ${comments.length} comments, you already known all of them.`); logger(`No webhook request sent`); } } catch (err) { console.error(err) } setTimeout(checkComments, recheckIntervalInMinutes * 60 * 1000); })(); })();
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource from twilio.base.page import Page class SampleList(ListResource): """ PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. """ def __init__(self, version, assistant_sid, task_sid): """ Initialize the SampleList :param Version version: Version that contains the resource :param assistant_sid: The unique ID of the Assistant. :param task_sid: The unique ID of the Task associated with this Sample. :returns: twilio.rest.preview.understand.assistant.task.sample.SampleList :rtype: twilio.rest.preview.understand.assistant.task.sample.SampleList """ super(SampleList, self).__init__(version) # Path Solution self._solution = {'assistant_sid': assistant_sid, 'task_sid': task_sid, } self._uri = '/Assistants/{assistant_sid}/Tasks/{task_sid}/Samples'.format(**self._solution) def stream(self, language=values.unset, limit=None, page_size=None): """ Streams SampleInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient. :param unicode language: An ISO language-country string of the sample. :param int limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000) :returns: Generator that will yield up to limit results :rtype: list[twilio.rest.preview.understand.assistant.task.sample.SampleInstance] """ limits = self._version.read_limits(limit, page_size) page = self.page(language=language, page_size=limits['page_size'], ) return self._version.stream(page, limits['limit'], limits['page_limit']) def list(self, language=values.unset, limit=None, page_size=None): """ Lists SampleInstance records from the API as a list. Unlike stream(), this operation is eager and will load `limit` records into memory before returning. :param unicode language: An ISO language-country string of the sample. :param int limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, list() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000) :returns: Generator that will yield up to limit results :rtype: list[twilio.rest.preview.understand.assistant.task.sample.SampleInstance] """ return list(self.stream(language=language, limit=limit, page_size=page_size, )) def page(self, language=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of SampleInstance records from the API. Request is executed immediately :param unicode language: An ISO language-country string of the sample. :param str page_token: PageToken provided by the API :param int page_number: Page Number, this value is simply for client state :param int page_size: Number of records to return, defaults to 50 :returns: Page of SampleInstance :rtype: twilio.rest.preview.understand.assistant.task.sample.SamplePage """ params = values.of({ 'Language': language, 'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) response = self._version.page( 'GET', self._uri, params=params, ) return SamplePage(self._version, response, self._solution) def get_page(self, target_url): """ Retrieve a specific page of SampleInstance records from the API. Request is executed immediately :param str target_url: API-generated URL for the requested results page :returns: Page of SampleInstance :rtype: twilio.rest.preview.understand.assistant.task.sample.SamplePage """ response = self._version.domain.twilio.request( 'GET', target_url, ) return SamplePage(self._version, response, self._solution) def create(self, language, tagged_text, source_channel=values.unset): """ Create a new SampleInstance :param unicode language: An ISO language-country string of the sample. :param unicode tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. :param unicode source_channel: The communication channel the sample was captured. It can be: voice, sms, chat, alexa, google-assistant, or slack. If not included the value will be null :returns: Newly created SampleInstance :rtype: twilio.rest.preview.understand.assistant.task.sample.SampleInstance """ data = values.of({'Language': language, 'TaggedText': tagged_text, 'SourceChannel': source_channel, }) payload = self._version.create( 'POST', self._uri, data=data, ) return SampleInstance( self._version, payload, assistant_sid=self._solution['assistant_sid'], task_sid=self._solution['task_sid'], ) def get(self, sid): """ Constructs a SampleContext :param sid: A 34 character string that uniquely identifies this resource. :returns: twilio.rest.preview.understand.assistant.task.sample.SampleContext :rtype: twilio.rest.preview.understand.assistant.task.sample.SampleContext """ return SampleContext( self._version, assistant_sid=self._solution['assistant_sid'], task_sid=self._solution['task_sid'], sid=sid, ) def __call__(self, sid): """ Constructs a SampleContext :param sid: A 34 character string that uniquely identifies this resource. :returns: twilio.rest.preview.understand.assistant.task.sample.SampleContext :rtype: twilio.rest.preview.understand.assistant.task.sample.SampleContext """ return SampleContext( self._version, assistant_sid=self._solution['assistant_sid'], task_sid=self._solution['task_sid'], sid=sid, ) def __repr__(self): """ Provide a friendly representation :returns: Machine friendly representation :rtype: str """ return '<Twilio.Preview.Understand.SampleList>' class SamplePage(Page): """ PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. """ def __init__(self, version, response, solution): """ Initialize the SamplePage :param Version version: Version that contains the resource :param Response response: Response from the API :param assistant_sid: The unique ID of the Assistant. :param task_sid: The unique ID of the Task associated with this Sample. :returns: twilio.rest.preview.understand.assistant.task.sample.SamplePage :rtype: twilio.rest.preview.understand.assistant.task.sample.SamplePage """ super(SamplePage, self).__init__(version, response) # Path Solution self._solution = solution def get_instance(self, payload): """ Build an instance of SampleInstance :param dict payload: Payload response from the API :returns: twilio.rest.preview.understand.assistant.task.sample.SampleInstance :rtype: twilio.rest.preview.understand.assistant.task.sample.SampleInstance """ return SampleInstance( self._version, payload, assistant_sid=self._solution['assistant_sid'], task_sid=self._solution['task_sid'], ) def __repr__(self): """ Provide a friendly representation :returns: Machine friendly representation :rtype: str """ return '<Twilio.Preview.Understand.SamplePage>' class SampleContext(InstanceContext): """ PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. """ def __init__(self, version, assistant_sid, task_sid, sid): """ Initialize the SampleContext :param Version version: Version that contains the resource :param assistant_sid: The unique ID of the Assistant. :param task_sid: The unique ID of the Task associated with this Sample. :param sid: A 34 character string that uniquely identifies this resource. :returns: twilio.rest.preview.understand.assistant.task.sample.SampleContext :rtype: twilio.rest.preview.understand.assistant.task.sample.SampleContext """ super(SampleContext, self).__init__(version) # Path Solution self._solution = {'assistant_sid': assistant_sid, 'task_sid': task_sid, 'sid': sid, } self._uri = '/Assistants/{assistant_sid}/Tasks/{task_sid}/Samples/{sid}'.format(**self._solution) def fetch(self): """ Fetch a SampleInstance :returns: Fetched SampleInstance :rtype: twilio.rest.preview.understand.assistant.task.sample.SampleInstance """ params = values.of({}) payload = self._version.fetch( 'GET', self._uri, params=params, ) return SampleInstance( self._version, payload, assistant_sid=self._solution['assistant_sid'], task_sid=self._solution['task_sid'], sid=self._solution['sid'], ) def update(self, language=values.unset, tagged_text=values.unset, source_channel=values.unset): """ Update the SampleInstance :param unicode language: An ISO language-country string of the sample. :param unicode tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. :param unicode source_channel: The communication channel the sample was captured. It can be: voice, sms, chat, alexa, google-assistant, or slack. If not included the value will be null :returns: Updated SampleInstance :rtype: twilio.rest.preview.understand.assistant.task.sample.SampleInstance """ data = values.of({'Language': language, 'TaggedText': tagged_text, 'SourceChannel': source_channel, }) payload = self._version.update( 'POST', self._uri, data=data, ) return SampleInstance( self._version, payload, assistant_sid=self._solution['assistant_sid'], task_sid=self._solution['task_sid'], sid=self._solution['sid'], ) def delete(self): """ Deletes the SampleInstance :returns: True if delete succeeds, False otherwise :rtype: bool """ return self._version.delete('delete', self._uri) def __repr__(self): """ Provide a friendly representation :returns: Machine friendly representation :rtype: str """ context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items()) return '<Twilio.Preview.Understand.SampleContext {}>'.format(context) class SampleInstance(InstanceResource): """ PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. """ def __init__(self, version, payload, assistant_sid, task_sid, sid=None): """ Initialize the SampleInstance :returns: twilio.rest.preview.understand.assistant.task.sample.SampleInstance :rtype: twilio.rest.preview.understand.assistant.task.sample.SampleInstance """ super(SampleInstance, self).__init__(version) # Marshaled Properties self._properties = { 'account_sid': payload.get('account_sid'), 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), 'task_sid': payload.get('task_sid'), 'language': payload.get('language'), 'assistant_sid': payload.get('assistant_sid'), 'sid': payload.get('sid'), 'tagged_text': payload.get('tagged_text'), 'url': payload.get('url'), 'source_channel': payload.get('source_channel'), } # Context self._context = None self._solution = { 'assistant_sid': assistant_sid, 'task_sid': task_sid, 'sid': sid or self._properties['sid'], } @property def _proxy(self): """ Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context :returns: SampleContext for this SampleInstance :rtype: twilio.rest.preview.understand.assistant.task.sample.SampleContext """ if self._context is None: self._context = SampleContext( self._version, assistant_sid=self._solution['assistant_sid'], task_sid=self._solution['task_sid'], sid=self._solution['sid'], ) return self._context @property def account_sid(self): """ :returns: The unique ID of the Account that created this Sample. :rtype: unicode """ return self._properties['account_sid'] @property def date_created(self): """ :returns: The date that this resource was created :rtype: datetime """ return self._properties['date_created'] @property def date_updated(self): """ :returns: The date that this resource was last updated :rtype: datetime """ return self._properties['date_updated'] @property def task_sid(self): """ :returns: The unique ID of the Task associated with this Sample. :rtype: unicode """ return self._properties['task_sid'] @property def language(self): """ :returns: An ISO language-country string of the sample. :rtype: unicode """ return self._properties['language'] @property def assistant_sid(self): """ :returns: The unique ID of the Assistant. :rtype: unicode """ return self._properties['assistant_sid'] @property def sid(self): """ :returns: A 34 character string that uniquely identifies this resource. :rtype: unicode """ return self._properties['sid'] @property def tagged_text(self): """ :returns: The text example of how end-users may express this task. The sample may contain Field tag blocks. :rtype: unicode """ return self._properties['tagged_text'] @property def url(self): """ :returns: The url :rtype: unicode """ return self._properties['url'] @property def source_channel(self): """ :returns: The communication channel the sample was captured. It can be: voice, sms, chat, alexa, google-assistant, or slack. If not included the value will be null :rtype: unicode """ return self._properties['source_channel'] def fetch(self): """ Fetch a SampleInstance :returns: Fetched SampleInstance :rtype: twilio.rest.preview.understand.assistant.task.sample.SampleInstance """ return self._proxy.fetch() def update(self, language=values.unset, tagged_text=values.unset, source_channel=values.unset): """ Update the SampleInstance :param unicode language: An ISO language-country string of the sample. :param unicode tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. :param unicode source_channel: The communication channel the sample was captured. It can be: voice, sms, chat, alexa, google-assistant, or slack. If not included the value will be null :returns: Updated SampleInstance :rtype: twilio.rest.preview.understand.assistant.task.sample.SampleInstance """ return self._proxy.update(language=language, tagged_text=tagged_text, source_channel=source_channel, ) def delete(self): """ Deletes the SampleInstance :returns: True if delete succeeds, False otherwise :rtype: bool """ return self._proxy.delete() def __repr__(self): """ Provide a friendly representation :returns: Machine friendly representation :rtype: str """ context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items()) return '<Twilio.Preview.Understand.SampleInstance {}>'.format(context)
(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.katex=e()}})(function(){var e,t,r;return function e(t,r,a){function n(l,o){if(!r[l]){if(!t[l]){var u=typeof require=="function"&&require;if(!o&&u)return u(l,!0);if(i)return i(l,!0);var s=new Error("Cannot find module '"+l+"'");throw s.code="MODULE_NOT_FOUND",s}var f=r[l]={exports:{}};t[l][0].call(f.exports,function(e){var r=t[l][1][e];return n(r?r:e)},f,f.exports,e,t,r,a)}return r[l].exports}var i=typeof require=="function"&&require;for(var l=0;l<a.length;l++)n(a[l]);return n}({1:[function(e,t,r){"use strict";var a=e("./src/ParseError");var n=v(a);var i=e("./src/Settings");var l=v(i);var o=e("./src/buildTree");var u=v(o);var s=e("./src/parseTree");var f=v(s);var c=e("./src/utils");var d=v(c);function v(e){return e&&e.__esModule?e:{default:e}}var h=function e(t,r,a){d.default.clearNode(r);var n=new l.default(a);var i=(0,f.default)(t,n);var o=(0,u.default)(i,t,n).toNode();r.appendChild(o)};if(typeof document!=="undefined"){if(document.compatMode!=="CSS1Compat"){typeof console!=="undefined"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your "+"website has a suitable doctype.");h=function e(){throw new n.default("KaTeX doesn't work in quirks mode.")}}}var p=function e(t,r){var a=new l.default(r);var n=(0,f.default)(t,a);return(0,u.default)(n,t,a).toMarkup()};var m=function e(t,r){var a=new l.default(r);return(0,f.default)(t,a)};t.exports={render:h,renderToString:p,__parse:m,ParseError:n.default}},{"./src/ParseError":84,"./src/Settings":87,"./src/buildTree":94,"./src/parseTree":109,"./src/utils":115}],2:[function(e,t,r){t.exports={default:e("core-js/library/fn/array/from"),__esModule:true}},{"core-js/library/fn/array/from":12}],3:[function(e,t,r){t.exports={default:e("core-js/library/fn/get-iterator"),__esModule:true}},{"core-js/library/fn/get-iterator":13}],4:[function(e,t,r){t.exports={default:e("core-js/library/fn/is-iterable"),__esModule:true}},{"core-js/library/fn/is-iterable":14}],5:[function(e,t,r){t.exports={default:e("core-js/library/fn/json/stringify"),__esModule:true}},{"core-js/library/fn/json/stringify":15}],6:[function(e,t,r){t.exports={default:e("core-js/library/fn/object/define-property"),__esModule:true}},{"core-js/library/fn/object/define-property":16}],7:[function(e,t,r){t.exports={default:e("core-js/library/fn/object/freeze"),__esModule:true}},{"core-js/library/fn/object/freeze":17}],8:[function(e,t,r){"use strict";r.__esModule=true;r.default=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}},{}],9:[function(e,t,r){"use strict";r.__esModule=true;var a=e("../core-js/object/define-property");var n=i(a);function i(e){return e&&e.__esModule?e:{default:e}}r.default=function(){function e(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||false;a.configurable=true;if("value"in a)a.writable=true;(0,n.default)(e,a.key,a)}}return function(t,r,a){if(r)e(t.prototype,r);if(a)e(t,a);return t}}()},{"../core-js/object/define-property":6}],10:[function(e,t,r){"use strict";r.__esModule=true;var a=e("../core-js/is-iterable");var n=o(a);var i=e("../core-js/get-iterator");var l=o(i);function o(e){return e&&e.__esModule?e:{default:e}}r.default=function(){function e(e,t){var r=[];var a=true;var n=false;var i=undefined;try{for(var o=(0,l.default)(e),u;!(a=(u=o.next()).done);a=true){r.push(u.value);if(t&&r.length===t)break}}catch(e){n=true;i=e}finally{try{if(!a&&o["return"])o["return"]()}finally{if(n)throw i}}return r}return function(t,r){if(Array.isArray(t)){return t}else if((0,n.default)(Object(t))){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}()},{"../core-js/get-iterator":3,"../core-js/is-iterable":4}],11:[function(e,t,r){"use strict";r.__esModule=true;var a=e("../core-js/array/from");var n=i(a);function i(e){return e&&e.__esModule?e:{default:e}}r.default=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return(0,n.default)(e)}}},{"../core-js/array/from":2}],12:[function(e,t,r){e("../../modules/es6.string.iterator");e("../../modules/es6.array.from");t.exports=e("../../modules/_core").Array.from},{"../../modules/_core":24,"../../modules/es6.array.from":73,"../../modules/es6.string.iterator":77}],13:[function(e,t,r){e("../modules/web.dom.iterable");e("../modules/es6.string.iterator");t.exports=e("../modules/core.get-iterator")},{"../modules/core.get-iterator":71,"../modules/es6.string.iterator":77,"../modules/web.dom.iterable":78}],14:[function(e,t,r){e("../modules/web.dom.iterable");e("../modules/es6.string.iterator");t.exports=e("../modules/core.is-iterable")},{"../modules/core.is-iterable":72,"../modules/es6.string.iterator":77,"../modules/web.dom.iterable":78}],15:[function(e,t,r){var a=e("../../modules/_core");var n=a.JSON||(a.JSON={stringify:JSON.stringify});t.exports=function e(t){return n.stringify.apply(n,arguments)}},{"../../modules/_core":24}],16:[function(e,t,r){e("../../modules/es6.object.define-property");var a=e("../../modules/_core").Object;t.exports=function e(t,r,n){return a.defineProperty(t,r,n)}},{"../../modules/_core":24,"../../modules/es6.object.define-property":75}],17:[function(e,t,r){e("../../modules/es6.object.freeze");t.exports=e("../../modules/_core").Object.freeze},{"../../modules/_core":24,"../../modules/es6.object.freeze":76}],18:[function(e,t,r){t.exports=function(e){if(typeof e!="function")throw TypeError(e+" is not a function!");return e}},{}],19:[function(e,t,r){t.exports=function(){}},{}],20:[function(e,t,r){var a=e("./_is-object");t.exports=function(e){if(!a(e))throw TypeError(e+" is not an object!");return e}},{"./_is-object":40}],21:[function(e,t,r){var a=e("./_to-iobject");var n=e("./_to-length");var i=e("./_to-absolute-index");t.exports=function(e){return function(t,r,l){var o=a(t);var u=n(o.length);var s=i(l,u);var f;if(e&&r!=r)while(u>s){f=o[s++];if(f!=f)return true}else for(;u>s;s++)if(e||s in o){if(o[s]===r)return e||s||0}return!e&&-1}}},{"./_to-absolute-index":62,"./_to-iobject":64,"./_to-length":65}],22:[function(e,t,r){var a=e("./_cof");var n=e("./_wks")("toStringTag");var i=a(function(){return arguments}())=="Arguments";var l=function(e,t){try{return e[t]}catch(e){}};t.exports=function(e){var t,r,o;return e===undefined?"Undefined":e===null?"Null":typeof(r=l(t=Object(e),n))=="string"?r:i?a(t):(o=a(t))=="Object"&&typeof t.callee=="function"?"Arguments":o}},{"./_cof":23,"./_wks":69}],23:[function(e,t,r){var a={}.toString;t.exports=function(e){return a.call(e).slice(8,-1)}},{}],24:[function(e,t,r){var a=t.exports={version:"2.5.1"};if(typeof __e=="number")__e=a},{}],25:[function(e,t,r){"use strict";var a=e("./_object-dp");var n=e("./_property-desc");t.exports=function(e,t,r){if(t in e)a.f(e,t,n(0,r));else e[t]=r}},{"./_object-dp":50,"./_property-desc":56}],26:[function(e,t,r){var a=e("./_a-function");t.exports=function(e,t,r){a(e);if(t===undefined)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,a){return e.call(t,r,a)};case 3:return function(r,a,n){return e.call(t,r,a,n)}}return function(){return e.apply(t,arguments)}}},{"./_a-function":18}],27:[function(e,t,r){t.exports=function(e){if(e==undefined)throw TypeError("Can't call method on "+e);return e}},{}],28:[function(e,t,r){t.exports=!e("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":32}],29:[function(e,t,r){var a=e("./_is-object");var n=e("./_global").document;var i=a(n)&&a(n.createElement);t.exports=function(e){return i?n.createElement(e):{}}},{"./_global":33,"./_is-object":40}],30:[function(e,t,r){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],31:[function(e,t,r){var a=e("./_global");var n=e("./_core");var i=e("./_ctx");var l=e("./_hide");var o="prototype";var u=function(e,t,r){var s=e&u.F;var f=e&u.G;var c=e&u.S;var d=e&u.P;var v=e&u.B;var h=e&u.W;var p=f?n:n[t]||(n[t]={});var m=p[o];var g=f?a:c?a[t]:(a[t]||{})[o];var b,y,x;if(f)r=t;for(b in r){y=!s&&g&&g[b]!==undefined;if(y&&b in p)continue;x=y?g[b]:r[b];p[b]=f&&typeof g[b]!="function"?r[b]:v&&y?i(x,a):h&&g[b]==x?function(e){var t=function(t,r,a){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,a)}return e.apply(this,arguments)};t[o]=e[o];return t}(x):d&&typeof x=="function"?i(Function.call,x):x;if(d){(p.virtual||(p.virtual={}))[b]=x;if(e&u.R&&m&&!m[b])l(m,b,x)}}};u.F=1;u.G=2;u.S=4;u.P=8;u.B=16;u.W=32;u.U=64;u.R=128;t.exports=u},{"./_core":24,"./_ctx":26,"./_global":33,"./_hide":35}],32:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(e){return true}}},{}],33:[function(e,t,r){var a=t.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();if(typeof __g=="number")__g=a},{}],34:[function(e,t,r){var a={}.hasOwnProperty;t.exports=function(e,t){return a.call(e,t)}},{}],35:[function(e,t,r){var a=e("./_object-dp");var n=e("./_property-desc");t.exports=e("./_descriptors")?function(e,t,r){return a.f(e,t,n(1,r))}:function(e,t,r){e[t]=r;return e}},{"./_descriptors":28,"./_object-dp":50,"./_property-desc":56}],36:[function(e,t,r){var a=e("./_global").document;t.exports=a&&a.documentElement},{"./_global":33}],37:[function(e,t,r){t.exports=!e("./_descriptors")&&!e("./_fails")(function(){return Object.defineProperty(e("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":28,"./_dom-create":29,"./_fails":32}],38:[function(e,t,r){var a=e("./_cof");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return a(e)=="String"?e.split(""):Object(e)}},{"./_cof":23}],39:[function(e,t,r){var a=e("./_iterators");var n=e("./_wks")("iterator");var i=Array.prototype;t.exports=function(e){return e!==undefined&&(a.Array===e||i[n]===e)}},{"./_iterators":46,"./_wks":69}],40:[function(e,t,r){t.exports=function(e){return typeof e==="object"?e!==null:typeof e==="function"}},{}],41:[function(e,t,r){var a=e("./_an-object");t.exports=function(e,t,r,n){try{return n?t(a(r)[0],r[1]):t(r)}catch(t){var i=e["return"];if(i!==undefined)a(i.call(e));throw t}}},{"./_an-object":20}],42:[function(e,t,r){"use strict";var a=e("./_object-create");var n=e("./_property-desc");var i=e("./_set-to-string-tag");var l={};e("./_hide")(l,e("./_wks")("iterator"),function(){return this});t.exports=function(e,t,r){e.prototype=a(l,{next:n(1,r)});i(e,t+" Iterator")}},{"./_hide":35,"./_object-create":49,"./_property-desc":56,"./_set-to-string-tag":58,"./_wks":69}],43:[function(e,t,r){"use strict";var a=e("./_library");var n=e("./_export");var i=e("./_redefine");var l=e("./_hide");var o=e("./_has");var u=e("./_iterators");var s=e("./_iter-create");var f=e("./_set-to-string-tag");var c=e("./_object-gpo");var d=e("./_wks")("iterator");var v=!([].keys&&"next"in[].keys());var h="@@iterator";var p="keys";var m="values";var g=function(){return this};t.exports=function(e,t,r,b,y,x,w){s(r,t,b);var k=function(e){if(!v&&e in S)return S[e];switch(e){case p:return function t(){return new r(this,e)};case m:return function t(){return new r(this,e)}}return function t(){return new r(this,e)}};var M=t+" Iterator";var _=y==m;var z=false;var S=e.prototype;var T=S[d]||S[h]||y&&S[y];var A=T||k(y);var C=y?!_?A:k("entries"):undefined;var N=t=="Array"?S.entries||T:T;var O,j,E;if(N){E=c(N.call(new e));if(E!==Object.prototype&&E.next){f(E,M,true);if(!a&&!o(E,d))l(E,d,g)}}if(_&&T&&T.name!==m){z=true;A=function e(){return T.call(this)}}if((!a||w)&&(v||z||!S[d])){l(S,d,A)}u[t]=A;u[M]=g;if(y){O={values:_?A:k(m),keys:x?A:k(p),entries:C};if(w)for(j in O){if(!(j in S))i(S,j,O[j])}else n(n.P+n.F*(v||z),t,O)}return O}},{"./_export":31,"./_has":34,"./_hide":35,"./_iter-create":42,"./_iterators":46,"./_library":47,"./_object-gpo":52,"./_redefine":57,"./_set-to-string-tag":58,"./_wks":69}],44:[function(e,t,r){var a=e("./_wks")("iterator");var n=false;try{var i=[7][a]();i["return"]=function(){n=true};Array.from(i,function(){throw 2})}catch(e){}t.exports=function(e,t){if(!t&&!n)return false;var r=false;try{var i=[7];var l=i[a]();l.next=function(){return{done:r=true}};i[a]=function(){return l};e(i)}catch(e){}return r}},{"./_wks":69}],45:[function(e,t,r){t.exports=function(e,t){return{value:t,done:!!e}}},{}],46:[function(e,t,r){t.exports={}},{}],47:[function(e,t,r){t.exports=true},{}],48:[function(e,t,r){var a=e("./_uid")("meta");var n=e("./_is-object");var i=e("./_has");var l=e("./_object-dp").f;var o=0;var u=Object.isExtensible||function(){return true};var s=!e("./_fails")(function(){return u(Object.preventExtensions({}))});var f=function(e){l(e,a,{value:{i:"O"+ ++o,w:{}}})};var c=function(e,t){if(!n(e))return typeof e=="symbol"?e:(typeof e=="string"?"S":"P")+e;if(!i(e,a)){if(!u(e))return"F";if(!t)return"E";f(e)}return e[a].i};var d=function(e,t){if(!i(e,a)){if(!u(e))return true;if(!t)return false;f(e)}return e[a].w};var v=function(e){if(s&&h.NEED&&u(e)&&!i(e,a))f(e);return e};var h=t.exports={KEY:a,NEED:false,fastKey:c,getWeak:d,onFreeze:v}},{"./_fails":32,"./_has":34,"./_is-object":40,"./_object-dp":50,"./_uid":68}],49:[function(e,t,r){var a=e("./_an-object");var n=e("./_object-dps");var i=e("./_enum-bug-keys");var l=e("./_shared-key")("IE_PROTO");var o=function(){};var u="prototype";var s=function(){var t=e("./_dom-create")("iframe");var r=i.length;var a="<";var n=">";var l;t.style.display="none";e("./_html").appendChild(t);t.src="javascript:";l=t.contentWindow.document;l.open();l.write(a+"script"+n+"document.F=Object"+a+"/script"+n);l.close();s=l.F;while(r--)delete s[u][i[r]];return s()};t.exports=Object.create||function e(t,r){var i;if(t!==null){o[u]=a(t);i=new o;o[u]=null;i[l]=t}else i=s();return r===undefined?i:n(i,r)}},{"./_an-object":20,"./_dom-create":29,"./_enum-bug-keys":30,"./_html":36,"./_object-dps":51,"./_shared-key":59}],50:[function(e,t,r){var a=e("./_an-object");var n=e("./_ie8-dom-define");var i=e("./_to-primitive");var l=Object.defineProperty;r.f=e("./_descriptors")?Object.defineProperty:function e(t,r,o){a(t);r=i(r,true);a(o);if(n)try{return l(t,r,o)}catch(e){}if("get"in o||"set"in o)throw TypeError("Accessors not supported!");if("value"in o)t[r]=o.value;return t}},{"./_an-object":20,"./_descriptors":28,"./_ie8-dom-define":37,"./_to-primitive":67}],51:[function(e,t,r){var a=e("./_object-dp");var n=e("./_an-object");var i=e("./_object-keys");t.exports=e("./_descriptors")?Object.defineProperties:function e(t,r){n(t);var l=i(r);var o=l.length;var u=0;var s;while(o>u)a.f(t,s=l[u++],r[s]);return t}},{"./_an-object":20,"./_descriptors":28,"./_object-dp":50,"./_object-keys":54}],52:[function(e,t,r){var a=e("./_has");var n=e("./_to-object");var i=e("./_shared-key")("IE_PROTO");var l=Object.prototype;t.exports=Object.getPrototypeOf||function(e){e=n(e);if(a(e,i))return e[i];if(typeof e.constructor=="function"&&e instanceof e.constructor){return e.constructor.prototype}return e instanceof Object?l:null}},{"./_has":34,"./_shared-key":59,"./_to-object":66}],53:[function(e,t,r){var a=e("./_has");var n=e("./_to-iobject");var i=e("./_array-includes")(false);var l=e("./_shared-key")("IE_PROTO");t.exports=function(e,t){var r=n(e);var o=0;var u=[];var s;for(s in r)if(s!=l)a(r,s)&&u.push(s);while(t.length>o)if(a(r,s=t[o++])){~i(u,s)||u.push(s)}return u}},{"./_array-includes":21,"./_has":34,"./_shared-key":59,"./_to-iobject":64}],54:[function(e,t,r){var a=e("./_object-keys-internal");var n=e("./_enum-bug-keys");t.exports=Object.keys||function e(t){return a(t,n)}},{"./_enum-bug-keys":30,"./_object-keys-internal":53}],55:[function(e,t,r){var a=e("./_export");var n=e("./_core");var i=e("./_fails");t.exports=function(e,t){var r=(n.Object||{})[e]||Object[e];var l={};l[e]=t(r);a(a.S+a.F*i(function(){r(1)}),"Object",l)}},{"./_core":24,"./_export":31,"./_fails":32}],56:[function(e,t,r){t.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}},{}],57:[function(e,t,r){t.exports=e("./_hide")},{"./_hide":35}],58:[function(e,t,r){var a=e("./_object-dp").f;var n=e("./_has");var i=e("./_wks")("toStringTag");t.exports=function(e,t,r){if(e&&!n(e=r?e:e.prototype,i))a(e,i,{configurable:true,value:t})}},{"./_has":34,"./_object-dp":50,"./_wks":69}],59:[function(e,t,r){var a=e("./_shared")("keys");var n=e("./_uid");t.exports=function(e){return a[e]||(a[e]=n(e))}},{"./_shared":60,"./_uid":68}],60:[function(e,t,r){var a=e("./_global");var n="__core-js_shared__";var i=a[n]||(a[n]={});t.exports=function(e){return i[e]||(i[e]={})}},{"./_global":33}],61:[function(e,t,r){var a=e("./_to-integer");var n=e("./_defined");t.exports=function(e){return function(t,r){var i=String(n(t));var l=a(r);var o=i.length;var u,s;if(l<0||l>=o)return e?"":undefined;u=i.charCodeAt(l);return u<55296||u>56319||l+1===o||(s=i.charCodeAt(l+1))<56320||s>57343?e?i.charAt(l):u:e?i.slice(l,l+2):(u-55296<<10)+(s-56320)+65536}}},{"./_defined":27,"./_to-integer":63}],62:[function(e,t,r){var a=e("./_to-integer");var n=Math.max;var i=Math.min;t.exports=function(e,t){e=a(e);return e<0?n(e+t,0):i(e,t)}},{"./_to-integer":63}],63:[function(e,t,r){var a=Math.ceil;var n=Math.floor;t.exports=function(e){return isNaN(e=+e)?0:(e>0?n:a)(e)}},{}],64:[function(e,t,r){var a=e("./_iobject");var n=e("./_defined");t.exports=function(e){return a(n(e))}},{"./_defined":27,"./_iobject":38}],65:[function(e,t,r){var a=e("./_to-integer");var n=Math.min;t.exports=function(e){return e>0?n(a(e),9007199254740991):0}},{"./_to-integer":63}],66:[function(e,t,r){var a=e("./_defined");t.exports=function(e){return Object(a(e))}},{"./_defined":27}],67:[function(e,t,r){var a=e("./_is-object");t.exports=function(e,t){if(!a(e))return e;var r,n;if(t&&typeof(r=e.toString)=="function"&&!a(n=r.call(e)))return n;if(typeof(r=e.valueOf)=="function"&&!a(n=r.call(e)))return n;if(!t&&typeof(r=e.toString)=="function"&&!a(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":40}],68:[function(e,t,r){var a=0;var n=Math.random();t.exports=function(e){return"Symbol(".concat(e===undefined?"":e,")_",(++a+n).toString(36))}},{}],69:[function(e,t,r){var a=e("./_shared")("wks");var n=e("./_uid");var i=e("./_global").Symbol;var l=typeof i=="function";var o=t.exports=function(e){return a[e]||(a[e]=l&&i[e]||(l?i:n)("Symbol."+e))};o.store=a},{"./_global":33,"./_shared":60,"./_uid":68}],70:[function(e,t,r){var a=e("./_classof");var n=e("./_wks")("iterator");var i=e("./_iterators");t.exports=e("./_core").getIteratorMethod=function(e){if(e!=undefined)return e[n]||e["@@iterator"]||i[a(e)]}},{"./_classof":22,"./_core":24,"./_iterators":46,"./_wks":69}],71:[function(e,t,r){var a=e("./_an-object");var n=e("./core.get-iterator-method");t.exports=e("./_core").getIterator=function(e){var t=n(e);if(typeof t!="function")throw TypeError(e+" is not iterable!");return a(t.call(e))}},{"./_an-object":20,"./_core":24,"./core.get-iterator-method":70}],72:[function(e,t,r){var a=e("./_classof");var n=e("./_wks")("iterator");var i=e("./_iterators");t.exports=e("./_core").isIterable=function(e){var t=Object(e);return t[n]!==undefined||"@@iterator"in t||i.hasOwnProperty(a(t))}},{"./_classof":22,"./_core":24,"./_iterators":46,"./_wks":69}],73:[function(e,t,r){"use strict";var a=e("./_ctx");var n=e("./_export");var i=e("./_to-object");var l=e("./_iter-call");var o=e("./_is-array-iter");var u=e("./_to-length");var s=e("./_create-property");var f=e("./core.get-iterator-method");n(n.S+n.F*!e("./_iter-detect")(function(e){Array.from(e)}),"Array",{from:function e(t){var r=i(t);var n=typeof this=="function"?this:Array;var c=arguments.length;var d=c>1?arguments[1]:undefined;var v=d!==undefined;var h=0;var p=f(r);var m,g,b,y;if(v)d=a(d,c>2?arguments[2]:undefined,2);if(p!=undefined&&!(n==Array&&o(p))){for(y=p.call(r),g=new n;!(b=y.next()).done;h++){s(g,h,v?l(y,d,[b.value,h],true):b.value)}}else{m=u(r.length);for(g=new n(m);m>h;h++){s(g,h,v?d(r[h],h):r[h])}}g.length=h;return g}})},{"./_create-property":25,"./_ctx":26,"./_export":31,"./_is-array-iter":39,"./_iter-call":41,"./_iter-detect":44,"./_to-length":65,"./_to-object":66,"./core.get-iterator-method":70}],74:[function(e,t,r){"use strict";var a=e("./_add-to-unscopables");var n=e("./_iter-step");var i=e("./_iterators");var l=e("./_to-iobject");t.exports=e("./_iter-define")(Array,"Array",function(e,t){this._t=l(e);this._i=0;this._k=t},function(){var e=this._t;var t=this._k;var r=this._i++;if(!e||r>=e.length){this._t=undefined;return n(1)}if(t=="keys")return n(0,r);if(t=="values")return n(0,e[r]);return n(0,[r,e[r]])},"values");i.Arguments=i.Array;a("keys");a("values");a("entries")},{"./_add-to-unscopables":19,"./_iter-define":43,"./_iter-step":45,"./_iterators":46,"./_to-iobject":64}],75:[function(e,t,r){var a=e("./_export");a(a.S+a.F*!e("./_descriptors"),"Object",{defineProperty:e("./_object-dp").f})},{"./_descriptors":28,"./_export":31,"./_object-dp":50}],76:[function(e,t,r){var a=e("./_is-object");var n=e("./_meta").onFreeze;e("./_object-sap")("freeze",function(e){return function t(r){return e&&a(r)?e(n(r)):r}})},{"./_is-object":40,"./_meta":48,"./_object-sap":55}],77:[function(e,t,r){"use strict";var a=e("./_string-at")(true);e("./_iter-define")(String,"String",function(e){this._t=String(e);this._i=0},function(){var e=this._t;var t=this._i;var r;if(t>=e.length)return{value:undefined,done:true};r=a(e,t);this._i+=r.length;return{value:r,done:false}})},{"./_iter-define":43,"./_string-at":61}],78:[function(e,t,r){e("./es6.array.iterator");var a=e("./_global");var n=e("./_hide");var i=e("./_iterators");var l=e("./_wks")("toStringTag");var o=("CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,"+"DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,"+"MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,"+"SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,"+"TextTrackList,TouchList").split(",");for(var u=0;u<o.length;u++){var s=o[u];var f=a[s];var c=f&&f.prototype;if(c&&!c[l])n(c,l,s);i[s]=i.Array}},{"./_global":33,"./_hide":35,"./_iterators":46,"./_wks":69,"./es6.array.iterator":74}],79:[function(e,t,r){function a(e){if(!e.__matchAtRelocatable){var t=e.source+"|()";var r="g"+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"");e.__matchAtRelocatable=new RegExp(t,r)}return e.__matchAtRelocatable}function n(e,t,r){if(e.global||e.sticky){throw new Error("matchAt(...): Only non-global regexes are supported")}var n=a(e);n.lastIndex=r;var i=n.exec(t);if(i[i.length-1]==null){i.length=i.length-1;return i}else{return null}}t.exports=n},{}],80:[function(e,t,r){"use strict";var a=Object.getOwnPropertySymbols;var n=Object.prototype.hasOwnProperty;var i=Object.prototype.propertyIsEnumerable;function l(e){if(e===null||e===undefined){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function o(){try{if(!Object.assign){return false}var e=new String("abc");e[5]="de";if(Object.getOwnPropertyNames(e)[0]==="5"){return false}var t={};for(var r=0;r<10;r++){t["_"+String.fromCharCode(r)]=r}var a=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if(a.join("")!=="0123456789"){return false}var n={};"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e});if(Object.keys(Object.assign({},n)).join("")!=="abcdefghijklmnopqrst"){return false}return true}catch(e){return false}}t.exports=o()?Object.assign:function(e,t){var r;var o=l(e);var u;for(var s=1;s<arguments.length;s++){r=Object(arguments[s]);for(var f in r){if(n.call(r,f)){o[f]=r[f]}}if(a){u=a(r);for(var c=0;c<u.length;c++){if(i.call(r,u[c])){o[u[c]]=r[u[c]]}}}}return o}},{}],81:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.controlWordRegex=undefined;var a=e("babel-runtime/helpers/classCallCheck");var n=h(a);var i=e("babel-runtime/helpers/createClass");var l=h(i);var o=e("match-at");var u=h(o);var s=e("./ParseError");var f=h(s);var c=e("./SourceLocation");var d=h(c);var v=e("./Token");function h(e){return e&&e.__esModule?e:{default:e}}var p="%[^\n]*[\n]";var m="\\\\[a-zA-Z@]+";var g="\\\\[^\ud800-\udfff]";var b=new RegExp("([ \r\n\t]+)|"+("("+p+"|")+"[!-\\[\\]-\u2027\u202a-\ud7ff\uf900-\uffff]"+"|[\ud800-\udbff][\udc00-\udfff]"+"|\\\\verb\\*([^]).*?\\3"+"|\\\\verb([^*a-zA-Z]).*?\\4"+("|"+m)+("|"+g)+")");var y=r.controlWordRegex=new RegExp("^"+m);var x=new RegExp("^"+p);var w=function(){function e(t){(0,n.default)(this,e);this.input=t;this.pos=0}(0,l.default)(e,[{key:"lex",value:function e(){var t=this.input;var r=this.pos;if(r===t.length){return new v.Token("EOF",new d.default(this,r,r))}var a=(0,u.default)(b,t,r);if(a===null){throw new f.default("Unexpected character: '"+t[r]+"'",new v.Token(t[r],new d.default(this,r,r+1)))}var n=a[2]||" ";var i=this.pos;this.pos+=a[0].length;var l=this.pos;if(x.test(n)){return this.lex()}else{return new v.Token(n,new d.default(this,i,l))}}}]);return e}();r.default=w},{"./ParseError":84,"./SourceLocation":88,"./Token":90,"babel-runtime/helpers/classCallCheck":8,"babel-runtime/helpers/createClass":9,"match-at":79}],82:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("babel-runtime/helpers/toConsumableArray");var n=b(a);var i=e("babel-runtime/helpers/classCallCheck");var l=b(i);var o=e("babel-runtime/helpers/createClass");var u=b(o);var s=e("./Lexer");var f=b(s);var c=e("./Token");var d=e("./macros");var v=b(d);var h=e("./ParseError");var p=b(h);var m=e("object-assign");var g=b(m);function b(e){return e&&e.__esModule?e:{default:e}}var y=function(){function e(t,r){(0,l.default)(this,e);this.lexer=new f.default(t);this.macros=(0,g.default)({},v.default,r);this.stack=[]}(0,u.default)(e,[{key:"future",value:function e(){if(this.stack.length===0){this.pushToken(this.lexer.lex())}return this.stack[this.stack.length-1]}},{key:"popToken",value:function e(){this.future();return this.stack.pop()}},{key:"consumeSpaces",value:function e(){for(;;){var t=this.future();if(t.text===" "){this.stack.pop()}else{break}}}},{key:"expandOnce",value:function e(){var t;var r=this.popToken();var a=r.text;var i=a.charAt(0)==="\\"||/^[\u2102-\u2124]$/.test(a);if(i&&s.controlWordRegex.test(a)){this.consumeSpaces()}if(!(i&&this.macros.hasOwnProperty(a))){this.pushToken(r);return r}var l=this._getExpansion(a),o=l.tokens,u=l.numArgs;var f=o;if(u){var c=[];for(var d=0;d<u;++d){this.consumeSpaces();var v=this.popToken();if(v.text==="{"){var h=[];var m=1;while(m!==0){var g=this.popToken();h.push(g);if(g.text==="{"){++m}else if(g.text==="}"){--m}else if(g.text==="EOF"){throw new p.default("End of input in macro argument",v)}}h.pop();h.reverse();c[d]=h}else if(v.text==="EOF"){throw new p.default("End of input expecting macro argument",r)}else{c[d]=[v]}}f=f.slice();for(var b=f.length-1;b>=0;--b){var y=f[b];if(y.text==="#"){if(b===0){throw new p.default("Incomplete placeholder at end of macro body",y)}y=f[--b];if(y.text==="#"){f.splice(b+1,1)}else if(/^[1-9]$/.test(y.text)){var x;(x=f).splice.apply(x,[b,2].concat((0,n.default)(c[+y.text-1])))}else{throw new p.default("Not a valid argument number",y)}}}}(t=this.stack).push.apply(t,(0,n.default)(f));return f}},{key:"expandAfterFuture",value:function e(){this.expandOnce();return this.future()}},{key:"expandNextToken",value:function e(){for(;;){var t=this.expandOnce();if(t instanceof c.Token){if(t.text==="\\relax"){this.stack.pop()}else{return this.stack.pop()}}}throw new Error}},{key:"_getExpansion",value:function e(t){var r=this.macros[t];var a=typeof r==="function"?r(this):r;if(typeof a==="string"){var n=0;if(a.indexOf("#")!==-1){var i=a.replace(/##/g,"");while(i.indexOf("#"+(n+1))!==-1){++n}}var l=new f.default(a);var o=[];var u=l.lex();while(u.text!=="EOF"){o.push(u);u=l.lex()}o.reverse();var s={tokens:o,numArgs:n};if(typeof r!=="function"){this.macros[t]=s}return s}return a}},{key:"pushToken",value:function e(t){this.stack.push(t)}}]);return e}();r.default=y},{"./Lexer":81,"./ParseError":84,"./Token":90,"./macros":107,"babel-runtime/helpers/classCallCheck":8,"babel-runtime/helpers/createClass":9,"babel-runtime/helpers/toConsumableArray":11,"object-assign":80}],83:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("babel-runtime/helpers/classCallCheck");var n=s(a);var i=e("babel-runtime/helpers/createClass");var l=s(i);var o=e("./fontMetrics");var u=s(o);function s(e){return e&&e.__esModule?e:{default:e}}var f=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]];var c=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488];var d=function e(t,r){return r.size<2?t:f[t-1][r.size-1]};var v=function(){function e(t){(0,n.default)(this,e);this.style=t.style;this.color=t.color;this.size=t.size||e.BASESIZE;this.textSize=t.textSize||this.size;this.phantom=!!t.phantom;this.font=t.font;this.sizeMultiplier=c[this.size-1];this.maxSize=t.maxSize;this._fontMetrics=undefined}(0,l.default)(e,[{key:"extend",value:function t(r){var a={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,maxSize:this.maxSize};for(var n in r){if(r.hasOwnProperty(n)){a[n]=r[n]}}return new e(a)}},{key:"havingStyle",value:function e(t){if(this.style===t){return this}else{return this.extend({style:t,size:d(this.textSize,t)})}}},{key:"havingCrampedStyle",value:function e(){return this.havingStyle(this.style.cramp())}},{key:"havingSize",value:function e(t){if(this.size===t&&this.textSize===t){return this}else{return this.extend({style:this.style.text(),size:t,textSize:t})}}},{key:"havingBaseStyle",value:function t(r){r=r||this.style.text();var a=d(e.BASESIZE,r);if(this.size===a&&this.textSize===e.BASESIZE&&this.style===r){return this}else{return this.extend({style:r,size:a})}}},{key:"withColor",value:function e(t){return this.extend({color:t})}},{key:"withPhantom",value:function e(){return this.extend({phantom:true})}},{key:"withFont",value:function e(t){return this.extend({font:t||this.font})}},{key:"sizingClasses",value:function e(t){if(t.size!==this.size){return["sizing","reset-size"+t.size,"size"+this.size]}else{return[]}}},{key:"baseSizingClasses",value:function t(){if(this.size!==e.BASESIZE){return["sizing","reset-size"+this.size,"size"+e.BASESIZE]}else{return[]}}},{key:"fontMetrics",value:function e(){if(!this._fontMetrics){this._fontMetrics=u.default.getFontMetrics(this.size)}return this._fontMetrics}},{key:"getColor",value:function t(){if(this.phantom){return"transparent"}else if(this.color!=null&&e.colorMap.hasOwnProperty(this.color)){return e.colorMap[this.color]}else{return this.color}}}]);return e}();v.BASESIZE=6;v.colorMap={"katex-blue":"#6495ed","katex-orange":"#ffa500","katex-pink":"#ff00af","katex-red":"#df0030","katex-green":"#28ae7b","katex-gray":"gray","katex-purple":"#9d38bd","katex-blueA":"#ccfaff","katex-blueB":"#80f6ff","katex-blueC":"#63d9ea","katex-blueD":"#11accd","katex-blueE":"#0c7f99","katex-tealA":"#94fff5","katex-tealB":"#26edd5","katex-tealC":"#01d1c1","katex-tealD":"#01a995","katex-tealE":"#208170","katex-greenA":"#b6ffb0","katex-greenB":"#8af281","katex-greenC":"#74cf70","katex-greenD":"#1fab54","katex-greenE":"#0d923f","katex-goldA":"#ffd0a9","katex-goldB":"#ffbb71","katex-goldC":"#ff9c39","katex-goldD":"#e07d10","katex-goldE":"#a75a05","katex-redA":"#fca9a9","katex-redB":"#ff8482","katex-redC":"#f9685d","katex-redD":"#e84d39","katex-redE":"#bc2612","katex-maroonA":"#ffbde0","katex-maroonB":"#ff92c6","katex-maroonC":"#ed5fa6","katex-maroonD":"#ca337c","katex-maroonE":"#9e034e","katex-purpleA":"#ddd7ff","katex-purpleB":"#c6b9fc","katex-purpleC":"#aa87ff","katex-purpleD":"#7854ab","katex-purpleE":"#543b78","katex-mintA":"#f5f9e8","katex-mintB":"#edf2df","katex-mintC":"#e0e5cc","katex-grayA":"#f6f7f7","katex-grayB":"#f0f1f2","katex-grayC":"#e3e5e6","katex-grayD":"#d6d8da","katex-grayE":"#babec2","katex-grayF":"#888d93","katex-grayG":"#626569","katex-grayH":"#3b3e40","katex-grayI":"#21242c","katex-kaBlue":"#314453","katex-kaGreen":"#71B307"};r.default=v},{"./fontMetrics":101,"babel-runtime/helpers/classCallCheck":8,"babel-runtime/helpers/createClass":9}],84:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("babel-runtime/helpers/classCallCheck");var n=u(a);var i=e("./ParseNode");var l=u(i);var o=e("./Token");function u(e){return e&&e.__esModule?e:{default:e}}var s=function e(t,r){(0,n.default)(this,e);var a="KaTeX parse error: "+t;var i=void 0;var l=r&&r.loc;if(l&&l.start<=l.end){var o=l.lexer.input;i=l.start;var u=l.end;if(i===o.length){a+=" at end of input: "}else{a+=" at position "+(i+1)+": "}var s=o.slice(i,u).replace(/[^]/g,"$&\u0332");var f=void 0;if(i>15){f="\u2026"+o.slice(i-15,i)}else{f=o.slice(0,i)}var c=void 0;if(u+15<o.length){c=o.slice(u,u+15)+"\u2026"}else{c=o.slice(u)}a+=f+s+c}var d=new Error(a);d.name="ParseError";d.__proto__=e.prototype;d.position=i;return d};s.prototype.__proto__=Error.prototype;r.default=s},{"./ParseNode":85,"./Token":90,"babel-runtime/helpers/classCallCheck":8}],85:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("babel-runtime/helpers/classCallCheck");var n=u(a);var i=e("./Token");var l=e("./SourceLocation");var o=u(l);function u(e){return e&&e.__esModule?e:{default:e}}var s=function e(t,r,a,i,l){(0,n.default)(this,e);this.type=t;this.value=r;this.mode=a;this.loc=o.default.range(i,l)};r.default=s},{"./SourceLocation":88,"./Token":90,"babel-runtime/helpers/classCallCheck":8}],86:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("babel-runtime/helpers/classCallCheck");var n=M(a);var i=e("babel-runtime/helpers/createClass");var l=M(i);var o=e("./functions");var u=M(o);var s=e("./environments");var f=M(s);var c=e("./MacroExpander");var d=M(c);var v=e("./symbols");var h=M(v);var p=e("./utils");var m=M(p);var g=e("./units");var b=e("./unicodeRegexes");var y=e("./ParseNode");var x=M(y);var w=e("./ParseError");var k=M(w);function M(e){return e&&e.__esModule?e:{default:e}}function _(e,t){return{type:"arg",result:e,token:t}}function z(e){return{type:"fn",result:e.text,token:e}}function S(e){return{type:"$",result:"$",token:e}}function T(e){if(e.type==="$"){throw new k.default("Unexpected $",e.token)}return e}var A=function(){function e(t,r){(0,n.default)(this,e);this.gullet=new d.default(t,r.macros);if(r.colorIsTextColor){this.gullet.macros["\\color"]="\\textcolor"}this.settings=r;this.leftrightDepth=0}(0,l.default)(e,[{key:"expect",value:function e(t,r){if(this.nextToken.text!==t){throw new k.default("Expected '"+t+"', got '"+this.nextToken.text+"'",this.nextToken)}if(r!==false){this.consume()}}},{key:"consume",value:function e(){this.nextToken=this.gullet.expandNextToken()}},{key:"switchMode",value:function e(t){this.mode=t}},{key:"parse",value:function e(){this.mode="math";this.consume();var e=this.parseInput();return e}},{key:"parseInput",value:function e(){var t=this.parseExpression(false);this.expect("EOF",false);return t}},{key:"parseExpression",value:function t(r,a){var n=[];while(true){if(this.mode==="math"){this.consumeSpaces()}var i=this.nextToken;if(e.endOfExpression.indexOf(i.text)!==-1){break}if(a&&i.text===a){break}if(r&&u.default[i.text]&&u.default[i.text].infix){break}var l=this.parseAtom(a);if(!l){if(!this.settings.throwOnError&&i.text[0]==="\\"){var o=this.handleUnsupportedCmd();n.push(o);continue}break}n.push(l)}return this.handleInfixNodes(n)}},{key:"handleInfixNodes",value:function e(t){var r=-1;var a=void 0;for(var n=0;n<t.length;n++){var i=t[n];if(i.type==="infix"){if(r!==-1){throw new k.default("only one infix operator per group",i.value.token)}r=n;a=i.value.replaceWith}}if(r!==-1){var l=void 0;var o=void 0;var u=t.slice(0,r);var s=t.slice(r+1);if(u.length===1&&u[0].type==="ordgroup"){l=u[0]}else{l=new x.default("ordgroup",u,this.mode)}if(s.length===1&&s[0].type==="ordgroup"){o=s[0]}else{o=new x.default("ordgroup",s,this.mode)}var f=this.callFunction(a,[l,o],[]);return[new x.default(f.type,f,this.mode)]}else{return t}}},{key:"handleSupSubscript",value:function t(r){var a=this.nextToken;var n=a.text;this.consume();this.consumeSpaces();var i=this.parseGroup();if(!i){if(!this.settings.throwOnError&&this.nextToken.text[0]==="\\"){return this.handleUnsupportedCmd()}else{throw new k.default("Expected group after '"+n+"'",a)}}var l=T(i);if(l.type==="fn"){var o=u.default[i.result].greediness;if(o>e.SUPSUB_GREEDINESS){return this.parseGivenFunction(i)}else{throw new k.default("Got function '"+i.result+"' with no arguments "+"as "+r,a)}}else{return i.result}}},{key:"handleUnsupportedCmd",value:function e(){var t=this.nextToken.text;var r=[];for(var a=0;a<t.length;a++){r.push(new x.default("textord",t[a],"text"))}var n=new x.default("text",{body:r,type:"text"},this.mode);var i=new x.default("color",{color:this.settings.errorColor,value:[n],type:"color"},this.mode);this.consume();return i}},{key:"parseAtom",value:function e(t){var r=this.parseImplicitGroup(t);if(this.mode==="text"){return r}var a=void 0;var n=void 0;while(true){this.consumeSpaces();var i=this.nextToken;if(i.text==="\\limits"||i.text==="\\nolimits"){if(!r||r.type!=="op"){throw new k.default("Limit controls must follow a math operator",i)}else{var l=i.text==="\\limits";r.value.limits=l;r.value.alwaysHandleSupSub=true}this.consume()}else if(i.text==="^"){if(a){throw new k.default("Double superscript",i)}a=this.handleSupSubscript("superscript")}else if(i.text==="_"){if(n){throw new k.default("Double subscript",i)}n=this.handleSupSubscript("subscript")}else if(i.text==="'"){if(a){throw new k.default("Double superscript",i)}var o=new x.default("textord","\\prime",this.mode);var u=[o];this.consume();while(this.nextToken.text==="'"){u.push(o);this.consume()}if(this.nextToken.text==="^"){u.push(this.handleSupSubscript("superscript"))}a=new x.default("ordgroup",u,this.mode)}else{break}}if(a||n){return new x.default("supsub",{base:r,sup:a,sub:n},this.mode)}else{return r}}},{key:"parseImplicitGroup",value:function t(r){var a=this.parseSymbol();if(a==null){return this.parseFunction()}var n=a.result;if(n==="\\left"){var i=this.parseGivenFunction(a);++this.leftrightDepth;var l=this.parseExpression(false);--this.leftrightDepth;this.expect("\\right",false);var o=this.parseFunction();return new x.default("leftright",{body:l,left:i.value.value,right:o.value.value},this.mode)}else if(n==="\\begin"){var u=this.parseGivenFunction(a);var s=u.value.name;if(!f.default.has(s)){throw new k.default("No such environment: "+s,u.value.nameGroup)}var c=f.default.get(s);var d=this.parseArguments("\\begin{"+s+"}",c),v=d.args,h=d.optArgs;var p={mode:this.mode,envName:s,parser:this};var g=c.handler(p,v,h);this.expect("\\end",false);var b=this.nextToken;var y=this.parseFunction();if(y.value.name!==s){throw new k.default("Mismatch: \\begin{"+s+"} matched "+"by \\end{"+y.value.name+"}",b)}g.position=y.position;return g}else if(m.default.contains(e.sizeFuncs,n)){this.consumeSpaces();var w=this.parseExpression(false,r);return new x.default("sizing",{size:m.default.indexOf(e.sizeFuncs,n)+1,value:w},this.mode)}else if(m.default.contains(e.styleFuncs,n)){this.consumeSpaces();var M=this.parseExpression(true,r);return new x.default("styling",{style:n.slice(1,n.length-5),value:M},this.mode)}else if(n in e.oldFontFuncs){var _=e.oldFontFuncs[n];this.consumeSpaces();var z=this.parseExpression(true,r);if(_.slice(0,4)==="text"){return new x.default("text",{style:_,body:new x.default("ordgroup",z,this.mode)},this.mode)}else{return new x.default("font",{font:_,body:new x.default("ordgroup",z,this.mode)},this.mode)}}else if(n==="\\color"){var S=this.parseColorGroup(false);if(!S){throw new k.default("\\color not followed by color")}var T=this.parseExpression(true,r);return new x.default("color",{type:"color",color:S.result.value,value:T},this.mode)}else if(n==="$"){if(this.mode==="math"){throw new k.default("$ within math mode")}this.consume();var A=this.mode;this.switchMode("math");var C=this.parseExpression(false,"$");this.expect("$",true);this.switchMode(A);return new x.default("styling",{style:"text",value:C},"math")}else{return this.parseGivenFunction(a)}}},{key:"parseFunction",value:function e(){var t=this.parseGroup();return t?this.parseGivenFunction(t):null}},{key:"parseGivenFunction",value:function e(t){t=T(t);if(t.type==="fn"){var r=t.result;var a=u.default[r];if(this.mode==="text"&&!a.allowedInText){throw new k.default("Can't use function '"+r+"' in text mode",t.token)}else if(this.mode==="math"&&a.allowedInMath===false){throw new k.default("Can't use function '"+r+"' in math mode",t.token)}var n=this.parseArguments(r,a),i=n.args,l=n.optArgs;var o=t.token;var s=this.callFunction(r,i,l,o);return new x.default(s.type,s,this.mode)}else{return t.result}}},{key:"callFunction",value:function e(t,r,a,n){var i={funcName:t,parser:this,token:n};return u.default[t].handler(i,r,a)}},{key:"parseArguments",value:function e(t,r){var a=r.numArgs+r.numOptionalArgs;if(a===0){return{args:[],optArgs:[]}}var n=r.greediness;var i=[];var l=[];for(var o=0;o<a;o++){var s=r.argTypes&&r.argTypes[o];var f=o<r.numOptionalArgs;if(o>0&&!f){this.consumeSpaces()}if(o===0&&!f&&this.mode==="math"){this.consumeSpaces()}var c=this.nextToken;var d=s?this.parseGroupOfType(s,f):this.parseGroup(f);if(!d){if(f){l.push(null);continue}if(!this.settings.throwOnError&&this.nextToken.text[0]==="\\"){d=_(this.handleUnsupportedCmd(),c)}else{throw new k.default("Expected group after '"+t+"'",c)}}var v=void 0;d=T(d);if(d.type==="fn"){var h=u.default[d.result].greediness;if(h>n){v=this.parseGivenFunction(d)}else{throw new k.default("Got function '"+d.result+"' as "+"argument to '"+t+"'",c)}}else{v=d.result}(f?l:i).push(v)}return{args:i,optArgs:l}}},{key:"parseGroupOfType",value:function e(t,r){var a=this.mode;if(t==="original"){t=a}if(t==="color"){return this.parseColorGroup(r)}if(t==="size"){return this.parseSizeGroup(r)}this.switchMode(t);var n=this.parseGroup(r);this.switchMode(a);return n}},{key:"consumeSpaces",value:function e(){while(this.nextToken.text===" "){this.consume()}}},{key:"parseStringGroup",value:function e(t,r){if(r&&this.nextToken.text!=="["){return null}var a=this.mode;this.mode="text";this.expect(r?"[":"{");var n="";var i=this.nextToken;var l=i;while(this.nextToken.text!==(r?"]":"}")){if(this.nextToken.text==="EOF"){throw new k.default("Unexpected end of input in "+t,i.range(this.nextToken,n))}l=this.nextToken;n+=l.text;this.consume()}this.mode=a;this.expect(r?"]":"}");return i.range(l,n)}},{key:"parseRegexGroup",value:function e(t,r){var a=this.mode;this.mode="text";var n=this.nextToken;var i=n;var l="";while(this.nextToken.text!=="EOF"&&t.test(l+this.nextToken.text)){i=this.nextToken;l+=i.text;this.consume()}if(l===""){throw new k.default("Invalid "+r+": '"+n.text+"'",n)}this.mode=a;return n.range(i,l)}},{key:"parseColorGroup",value:function e(t){var r=this.parseStringGroup("color",t);if(!r){return null}var a=/^(#[a-f0-9]{3}|#[a-f0-9]{6}|[a-z]+)$/i.exec(r.text);if(!a){throw new k.default("Invalid color: '"+r.text+"'",r)}return _(new x.default("color",a[0],this.mode),r)}},{key:"parseSizeGroup",value:function e(t){var r=void 0;if(!t&&this.nextToken.text!=="{"){r=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")}else{r=this.parseStringGroup("size",t)}if(!r){return null}var a=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(r.text);if(!a){throw new k.default("Invalid size: '"+r.text+"'",r)}var n={number:+(a[1]+a[2]),unit:a[3]};if(!(0,g.validUnit)(n)){throw new k.default("Invalid unit: '"+n.unit+"'",r)}return _(new x.default("size",n,this.mode),r)}},{key:"parseGroup",value:function e(t){var r=this.nextToken;if(this.nextToken.text===(t?"[":"{")){this.consume();var a=this.parseExpression(false,t?"]":"}");var n=this.nextToken;this.expect(t?"]":"}");if(this.mode==="text"){this.formLigatures(a)}return _(new x.default("ordgroup",a,this.mode,r,n),r.range(n,r.text))}else{return t?null:this.parseSymbol()}}},{key:"formLigatures",value:function e(t){var r=t.length-1;for(var a=0;a<r;++a){var n=t[a];var i=n.value;if(i==="-"&&t[a+1].value==="-"){if(a+1<r&&t[a+2].value==="-"){t.splice(a,3,new x.default("textord","---","text",n,t[a+2]));r-=2}else{t.splice(a,2,new x.default("textord","--","text",n,t[a+1]));r-=1}}if((i==="'"||i==="`")&&t[a+1].value===i){t.splice(a,2,new x.default("textord",i+i,"text",n,t[a+1]));r-=1}}}},{key:"parseSymbol",value:function e(){var t=this.nextToken;if(u.default[t.text]){this.consume();return z(t)}else if(h.default[this.mode][t.text]){this.consume();return _(new x.default(h.default[this.mode][t.text].group,t.text,this.mode,t),t)}else if(this.mode==="text"&&b.cjkRegex.test(t.text)){this.consume();return _(new x.default("textord",t.text,this.mode,t),t)}else if(t.text==="$"){return S(t)}else if(/^\\verb[^a-zA-Z]/.test(t.text)){this.consume();var r=t.text.slice(5);var a=r.charAt(0)==="*";if(a){r=r.slice(1)}if(r.length<2||r.charAt(0)!==r.slice(-1)){throw new k.default("\\verb assertion failed --\n please report what input caused this bug")}r=r.slice(1,-1);return _(new x.default("verb",{body:r,star:a},"text"),t)}else{return null}}}]);return e}();A.endOfExpression=["}","\\end","\\right","&","\\\\","\\cr"];A.SUPSUB_GREEDINESS=1;A.sizeFuncs=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];A.styleFuncs=["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"];A.oldFontFuncs={"\\rm":"mathrm","\\sf":"mathsf","\\tt":"mathtt","\\bf":"mathbf","\\it":"mathit"};r.default=A},{"./MacroExpander":82,"./ParseError":84,"./ParseNode":85,"./environments":99,"./functions":103,"./symbols":112,"./unicodeRegexes":113,"./units":114,"./utils":115,"babel-runtime/helpers/classCallCheck":8,"babel-runtime/helpers/createClass":9}],87:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("babel-runtime/helpers/classCallCheck");var n=o(a);var i=e("./utils");var l=o(i);function o(e){return e&&e.__esModule?e:{default:e}}var u=function e(t){(0,n.default)(this,e);t=t||{};this.displayMode=l.default.deflt(t.displayMode,false);this.throwOnError=l.default.deflt(t.throwOnError,true);this.errorColor=l.default.deflt(t.errorColor,"#cc0000");this.macros=t.macros||{};this.colorIsTextColor=l.default.deflt(t.colorIsTextColor,false);this.maxSize=Math.max(0,l.default.deflt(t.maxSize,Infinity))};r.default=u},{"./utils":115,"babel-runtime/helpers/classCallCheck":8}],88:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("babel-runtime/core-js/object/freeze");var n=s(a);var i=e("babel-runtime/helpers/classCallCheck");var l=s(i);var o=e("babel-runtime/helpers/createClass");var u=s(o);function s(e){return e&&e.__esModule?e:{default:e}}var f=function(){function e(t,r,a){(0,l.default)(this,e);this.lexer=t;this.start=r;this.end=a;(0,n.default)(this)}(0,u.default)(e,null,[{key:"range",value:function t(r,a){if(!a){return r&&r.loc}else if(!r||!r.loc||!a.loc||r.loc.lexer!==a.loc.lexer){return null}else{return new e(r.loc.lexer,r.loc.start,a.loc.end)}}}]);return e}();r.default=f},{"babel-runtime/core-js/object/freeze":7,"babel-runtime/helpers/classCallCheck":8,"babel-runtime/helpers/createClass":9}],89:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("babel-runtime/helpers/classCallCheck");var n=o(a);var i=e("babel-runtime/helpers/createClass");var l=o(i);function o(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(t,r,a){(0,n.default)(this,e);this.id=t;this.size=r;this.cramped=a}(0,l.default)(e,[{key:"sup",value:function e(){return g[b[this.id]]}},{key:"sub",value:function e(){return g[y[this.id]]}},{key:"fracNum",value:function e(){return g[x[this.id]]}},{key:"fracDen",value:function e(){return g[w[this.id]]}},{key:"cramp",value:function e(){return g[k[this.id]]}},{key:"text",value:function e(){return g[M[this.id]]}},{key:"isTight",value:function e(){return this.size>=2}}]);return e}();var s=0;var f=1;var c=2;var d=3;var v=4;var h=5;var p=6;var m=7;var g=[new u(s,0,false),new u(f,0,true),new u(c,1,false),new u(d,1,true),new u(v,2,false),new u(h,2,true),new u(p,3,false),new u(m,3,true)];var b=[v,h,v,h,p,m,p,m];var y=[h,h,h,h,m,m,m,m];var x=[c,d,v,h,p,m,p,m];var w=[d,d,h,h,m,m,m,m];var k=[f,f,d,d,h,h,m,m];var M=[s,f,c,d,c,d,c,d];r.default={DISPLAY:g[s],TEXT:g[c],SCRIPT:g[v],SCRIPTSCRIPT:g[p]}},{"babel-runtime/helpers/classCallCheck":8,"babel-runtime/helpers/createClass":9}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Token=undefined;var a=e("babel-runtime/helpers/classCallCheck");var n=s(a);var i=e("babel-runtime/helpers/createClass");var l=s(i);var o=e("./SourceLocation");var u=s(o);function s(e){return e&&e.__esModule?e:{default:e}}var f=r.Token=function(){function e(t,r){(0,n.default)(this,e);this.text=t;this.loc=r}(0,l.default)(e,[{key:"range",value:function t(r,a){return new e(a,u.default.range(this,r))}}]);return e}()},{"./SourceLocation":88,"babel-runtime/helpers/classCallCheck":8,"babel-runtime/helpers/createClass":9}],91:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("./domTree");var n=c(a);var i=e("./fontMetrics");var l=c(i);var o=e("./symbols");var u=c(o);var s=e("./utils");var f=c(s);function c(e){return e&&e.__esModule?e:{default:e}}var d=["\\imath","\\jmath","\\pounds"];var v=function e(t,r,a){if(u.default[a][t]&&u.default[a][t].replace){t=u.default[a][t].replace}return{value:t,metrics:l.default.getCharacterMetrics(t,r)}};var h=function e(t,r,a,i,l){var o=v(t,r,a);var u=o.metrics;t=o.value;var s=void 0;if(u){var f=u.italic;if(a==="text"){f=0}s=new n.default.symbolNode(t,u.height,u.depth,f,u.skew,l)}else{typeof console!=="undefined"&&console.warn("No character metrics for '"+t+"' in style '"+r+"'");s=new n.default.symbolNode(t,0,0,0,0,l)}if(i){s.maxFontSize=i.sizeMultiplier;if(i.style.isTight()){s.classes.push("mtight")}if(i.getColor()){s.style.color=i.getColor()}}return s};var p=function e(t,r,a,n){if(t==="\\"||u.default[r][t].font==="main"){return h(t,"Main-Regular",r,a,n)}else{return h(t,"AMS-Regular",r,a,n.concat(["amsrm"]))}};var m=function e(t,r,a,n,i){if(i==="mathord"){var l=g(t,r,a,n);return h(t,l.fontName,r,a,n.concat([l.fontClass]))}else if(i==="textord"){var o=u.default[r][t]&&u.default[r][t].font;if(o==="ams"){return h(t,"AMS-Regular",r,a,n.concat(["amsrm"]))}else{return h(t,"Main-Regular",r,a,n.concat(["mathrm"]))}}else{throw new Error("unexpected type: "+i+" in mathDefault")}};var g=function e(t,r,a,n){if(/[0-9]/.test(t.charAt(0))||f.default.contains(d,t)){return{fontName:"Main-Italic",fontClass:"mainit"}}else{return{fontName:"Math-Italic",fontClass:"mathit"}}};var b=function e(t,r,a){var n=t.mode;var i=t.value;var l=["mord"];var o=r.font;if(o){var u=void 0;if(o==="mathit"||f.default.contains(d,i)){u=g(i,n,r,l)}else{u=T[o]}if(v(i,u.fontName,n).metrics){return h(i,u.fontName,n,r,l.concat([u.fontClass||o]))}else{return m(i,n,r,l,a)}}else{return m(i,n,r,l,a)}};var y=function e(t){for(var r=0;r<t.length-1;r++){if(t[r].tryCombine(t[r+1])){t.splice(r+1,1);r--}}return t};var x=function e(t){var r=0;var a=0;var n=0;if(t.children){for(var i=0;i<t.children.length;i++){if(t.children[i].height>r){r=t.children[i].height}if(t.children[i].depth>a){a=t.children[i].depth}if(t.children[i].maxFontSize>n){n=t.children[i].maxFontSize}}}t.height=r;t.depth=a;t.maxFontSize=n};var w=function e(t,r,a){var i=new n.default.span(t,r,a);x(i);return i};var k=function e(t,r){t.children=r.concat(t.children);x(t)};var M=function e(t){var r=new n.default.documentFragment(t);x(r);return r};var _=function e(t,r){var a=t.positionType,i=t.positionData,l=t.children;var o=void 0;var u=void 0;var s=void 0;if(a==="individualShift"){var f=l;l=[f[0]];o=-f[0].shift-f[0].elem.depth;u=o;for(s=1;s<f.length;s++){var c=-f[s].shift-u-f[s].elem.depth;var d=c-(f[s-1].elem.height+f[s-1].elem.depth);u=u+c;l.push({type:"kern",size:d});l.push(f[s])}}else if(a==="top"){var v=i;for(s=0;s<l.length;s++){if(l[s].type==="kern"){v-=l[s].size}else{v-=l[s].elem.height+l[s].elem.depth}}o=v}else if(a==="bottom"){o=-i}else if(a==="shift"){o=-l[0].elem.depth-i}else if(a==="firstBaseline"){o=-l[0].elem.depth}else{o=0}var h=0;for(s=0;s<l.length;s++){if(l[s].type==="elem"){var p=l[s].elem;h=Math.max(h,p.maxFontSize,p.height)}}h+=2;var m=w(["pstrut"],[]);m.style.height=h+"em";var g=[];var b=o;var y=o;u=o;for(s=0;s<l.length;s++){if(l[s].type==="kern"){u+=l[s].size}else{var x=l[s].elem;var k=w([],[m,x]);k.style.top=-h-u-x.depth+"em";if(l[s].marginLeft){k.style.marginLeft=l[s].marginLeft}if(l[s].marginRight){k.style.marginRight=l[s].marginRight}g.push(k);u+=x.height+x.depth}b=Math.min(b,u);y=Math.max(y,u)}var M=w(["vlist"],g);M.style.height=y+"em";var _=void 0;if(b<0){var z=w(["vlist"],[]);z.style.height=-b+"em";var S=w(["vlist-s"],[new n.default.symbolNode("\u200b")]);_=[w(["vlist-r"],[M,S]),w(["vlist-r"],[z])]}else{_=[w(["vlist-r"],[M])]}var T=w(["vlist-t"],_);if(_.length===2){T.classes.push("vlist-t2")}T.height=y;T.depth=-b;return T};var z=function e(t,r){var a=t.value.body;if(t.value.star){a=a.replace(/ /g,"\u2423")}else{a=a.replace(/ /g,"\xa0")}return a};var S={"\\qquad":{size:"2em",className:"qquad"},"\\quad":{size:"1em",className:"quad"},"\\enspace":{size:"0.5em",className:"enspace"},"\\;":{size:"0.277778em",className:"thickspace"},"\\:":{size:"0.22222em",className:"mediumspace"},"\\,":{size:"0.16667em",className:"thinspace"},"\\!":{size:"-0.16667em",className:"negativethinspace"}};var T={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}};r.default={fontMap:T,makeSymbol:h,mathsym:p,makeSpan:w,makeFragment:M,makeVList:_,makeOrd:b,makeVerb:z,tryCombineChars:y,prependChildren:k,spacingFunctions:S}},{"./domTree":98,"./fontMetrics":101,"./symbols":112,"./utils":115}],92:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.buildGroup=r.groupTypes=r.makeNullDelimiter=r.buildExpression=r.spliceSpaces=undefined;var a=e("babel-runtime/core-js/json/stringify");var n=x(a);r.default=R;var i=e("./ParseError");var l=x(i);var o=e("./Style");var u=x(o);var s=e("./buildCommon");var f=x(s);var c=e("./delimiter");var d=x(c);var v=e("./domTree");var h=x(v);var p=e("./units");var m=e("./utils");var g=x(m);var b=e("./stretchy");var y=x(b);function x(e){return e&&e.__esModule?e:{default:e}}var w=f.default.makeSpan;var k=function e(t){return t instanceof h.default.span&&t.classes[0]==="mspace"};var M=function e(t){return t&&t.classes[0]==="mbin"};var _=function e(t,r){if(t){return g.default.contains(["mbin","mopen","mrel","mop","mpunct"],t.classes[0])}else{return r}};var z=function e(t,r){if(t){return g.default.contains(["mrel","mclose","mpunct"],t.classes[0])}else{return r}};var S=r.spliceSpaces=function e(t,r){var a=r;while(a<t.length&&k(t[a])){a++}if(a===r){return null}else{return t.splice(r,a-r)}};var T=r.buildExpression=function e(t,r,a){var n=[];for(var i=0;i<t.length;i++){var l=t[i];var o=P(l,r);if(o instanceof h.default.documentFragment){Array.prototype.push.apply(n,o.children)}else{n.push(o)}}for(var u=0;u<n.length;u++){var s=S(n,u);if(s){if(u<n.length){if(n[u]instanceof h.default.symbolNode){n[u]=w([].concat(n[u].classes),[n[u]])}f.default.prependChildren(n[u],s)}else{Array.prototype.push.apply(n,s);break}}}for(var c=0;c<n.length;c++){if(M(n[c])&&(_(n[c-1],a)||z(n[c+1],a))){n[c].classes[0]="mord"}}for(var d=0;d<n.length;d++){if(n[d].value==="\u0338"&&d+1<n.length){var v=n.slice(d,d+2);v[0].classes=["mainrm"];v[0].style.position="absolute";v[0].style.right="0";var p=n[d+1].classes;var m=w(p,v);if(p.indexOf("mord")!==-1){m.style.paddingLeft="0.277771em"}m.style.position="relative";n.splice(d,2,m)}}return n};var A=function e(t){if(t instanceof h.default.documentFragment){if(t.children.length){return e(t.children[t.children.length-1])}}else{if(g.default.contains(["mord","mop","mbin","mrel","mopen","mclose","mpunct","minner"],t.classes[0])){return t.classes[0]}}return null};var C=function e(t,r){if(!t.value.base){return false}else{var a=t.value.base;if(a.type==="op"){return a.value.limits&&(r.style.size===u.default.DISPLAY.size||a.value.alwaysHandleSupSub)}else if(a.type==="accent"){return O(a.value.base)}else if(a.type==="horizBrace"){var n=t.value.sub?false:true;return n===a.value.isOver}else{return null}}};var N=function e(t){if(!t){return false}else if(t.type==="ordgroup"){if(t.value.length===1){return e(t.value[0])}else{return t}}else if(t.type==="color"){if(t.value.value.length===1){return e(t.value.value[0])}else{return t}}else if(t.type==="font"){return e(t.value.body)}else{return t}};var O=function e(t){var r=N(t);return r.type==="mathord"||r.type==="textord"||r.type==="bin"||r.type==="rel"||r.type==="inner"||r.type==="open"||r.type==="close"||r.type==="punct"};var j=r.makeNullDelimiter=function e(t,r){var a=["nulldelimiter"].concat(t.baseSizingClasses());return w(r.concat(a))};var E=r.groupTypes={};E.mathord=function(e,t){return f.default.makeOrd(e,t,"mathord")};E.textord=function(e,t){return f.default.makeOrd(e,t,"textord")};E.bin=function(e,t){return f.default.mathsym(e.value,e.mode,t,["mbin"])};E.rel=function(e,t){return f.default.mathsym(e.value,e.mode,t,["mrel"])};E.open=function(e,t){return f.default.mathsym(e.value,e.mode,t,["mopen"])};E.close=function(e,t){return f.default.mathsym(e.value,e.mode,t,["mclose"])};E.inner=function(e,t){return f.default.mathsym(e.value,e.mode,t,["minner"])};E.punct=function(e,t){return f.default.mathsym(e.value,e.mode,t,["mpunct"])};E.ordgroup=function(e,t){return w(["mord"],T(e.value,t,true),t)};E.text=function(e,t){var r=t.withFont(e.value.font);var a=T(e.value.body,r,true);f.default.tryCombineChars(a);return w(["mord","text"],a,r)};E.color=function(e,t){var r=T(e.value.value,t.withColor(e.value.color),false);return new f.default.makeFragment(r)};E.supsub=function(e,t){if(C(e,t)){return E[e.value.base.type](e,t)}var r=P(e.value.base,t);var a=void 0;var n=void 0;var i=t.fontMetrics();var l=void 0;var o=0;var s=0;if(e.value.sup){l=t.havingStyle(t.style.sup());a=P(e.value.sup,l,t);if(!O(e.value.base)){o=r.height-l.fontMetrics().supDrop*l.sizeMultiplier/t.sizeMultiplier}}if(e.value.sub){l=t.havingStyle(t.style.sub());n=P(e.value.sub,l,t);if(!O(e.value.base)){s=r.depth+l.fontMetrics().subDrop*l.sizeMultiplier/t.sizeMultiplier}}var c=void 0;if(t.style===u.default.DISPLAY){c=i.sup1}else if(t.style.cramped){c=i.sup3}else{c=i.sup2}var d=t.sizeMultiplier;var v=.5/i.ptPerEm/d+"em";var p=void 0;if(!e.value.sup){s=Math.max(s,i.sub1,n.height-.8*i.xHeight);var m=[{type:"elem",elem:n,marginRight:v}];if(r instanceof h.default.symbolNode){m[0].marginLeft=-r.italic+"em"}p=f.default.makeVList({positionType:"shift",positionData:s,children:m},t)}else if(!e.value.sub){o=Math.max(o,c,a.depth+.25*i.xHeight);p=f.default.makeVList({positionType:"shift",positionData:-o,children:[{type:"elem",elem:a,marginRight:v}]},t)}else{o=Math.max(o,c,a.depth+.25*i.xHeight);s=Math.max(s,i.sub2);var g=i.defaultRuleThickness;if(o-a.depth-(n.height-s)<4*g){s=4*g-(o-a.depth)+n.height;var b=.8*i.xHeight-(o-a.depth);if(b>0){o+=b;s-=b}}var y=[{type:"elem",elem:n,shift:s,marginRight:v},{type:"elem",elem:a,shift:-o,marginRight:v}];if(r instanceof h.default.symbolNode){y[0].marginLeft=-r.italic+"em"}p=f.default.makeVList({positionType:"individualShift",children:y},t)}var x=A(r)||"mord";return w([x],[r,w(["msupsub"],[p])],t)};E.genfrac=function(e,t){var r=t.style;if(e.value.size==="display"){r=u.default.DISPLAY}else if(e.value.size==="text"){r=u.default.TEXT}var a=r.fracNum();var n=r.fracDen();var i=void 0;i=t.havingStyle(a);var l=P(e.value.numer,i,t);i=t.havingStyle(n);var o=P(e.value.denom,i,t);var s=void 0;var c=void 0;var v=void 0;if(e.value.hasBarLine){s=L("frac-line",t);c=s.height;v=s.height}else{s=null;c=0;v=t.fontMetrics().defaultRuleThickness}var h=void 0;var p=void 0;var m=void 0;if(r.size===u.default.DISPLAY.size){h=t.fontMetrics().num1;if(c>0){p=3*v}else{p=7*v}m=t.fontMetrics().denom1}else{if(c>0){h=t.fontMetrics().num2;p=v}else{h=t.fontMetrics().num3;p=3*v}m=t.fontMetrics().denom2}var g=void 0;if(c===0){var b=h-l.depth-(o.height-m);if(b<p){h+=.5*(p-b);m+=.5*(p-b)}g=f.default.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:m},{type:"elem",elem:l,shift:-h}]},t)}else{var y=t.fontMetrics().axisHeight;if(h-l.depth-(y+.5*c)<p){h+=p-(h-l.depth-(y+.5*c))}if(y-.5*c-(o.height-m)<p){m+=p-(y-.5*c-(o.height-m))}var x=-(y-.5*c);g=f.default.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:m},{type:"elem",elem:s,shift:x},{type:"elem",elem:l,shift:-h}]},t)}i=t.havingStyle(r);g.height*=i.sizeMultiplier/t.sizeMultiplier;g.depth*=i.sizeMultiplier/t.sizeMultiplier;var k=void 0;if(r.size===u.default.DISPLAY.size){k=t.fontMetrics().delim1}else{k=t.fontMetrics().delim2}var M=void 0;var _=void 0;if(e.value.leftDelim==null){M=j(t,["mopen"])}else{M=d.default.customSizedDelim(e.value.leftDelim,k,true,t.havingStyle(r),e.mode,["mopen"])}if(e.value.rightDelim==null){_=j(t,["mclose"])}else{_=d.default.customSizedDelim(e.value.rightDelim,k,true,t.havingStyle(r),e.mode,["mclose"])}return w(["mord"].concat(i.sizingClasses(t)),[M,w(["mfrac"],[g]),_],t)};E.spacing=function(e,t){if(e.value==="\\ "||e.value==="\\space"||e.value===" "||e.value==="~"){if(e.mode==="text"){return f.default.makeOrd(e,t,"textord")}else{return w(["mspace"],[f.default.mathsym(e.value,e.mode,t)],t)}}else{return w(["mspace",f.default.spacingFunctions[e.value].className],[],t)}};E.lap=function(e,t){var r=void 0;if(e.value.alignment==="clap"){r=w([],[P(e.value.body,t)]);r=w(["inner"],[r],t)}else{r=w(["inner"],[P(e.value.body,t)])}var a=w(["fix"],[]);return w(["mord",e.value.alignment],[r,a],t)};E.smash=function(e,t){var r=w(["mord"],[P(e.value.body,t)]);if(!e.value.smashHeight&&!e.value.smashDepth){return r}if(e.value.smashHeight){r.height=0;if(r.children){for(var a=0;a<r.children.length;a++){r.children[a].height=0}}}if(e.value.smashDepth){r.depth=0;if(r.children){for(var n=0;n<r.children.length;n++){r.children[n].depth=0}}}return f.default.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r}]},t)};E.op=function(e,t){var r=void 0;var a=void 0;var n=false;if(e.type==="supsub"){r=e.value.sup;a=e.value.sub;e=e.value.base;n=true}var i=t.style;var l=["\\smallint"];var o=false;if(i.size===u.default.DISPLAY.size&&e.value.symbol&&!g.default.contains(l,e.value.body)){o=true}var s=void 0;if(e.value.symbol){var c=o?"Size2-Regular":"Size1-Regular";s=f.default.makeSymbol(e.value.body,c,"math",t,["mop","op-symbol",o?"large-op":"small-op"])}else if(e.value.value){var d=T(e.value.value,t,true);if(d.length===1&&d[0]instanceof h.default.symbolNode){s=d[0];s.classes[0]="mop"}else{s=w(["mop"],d,t)}}else{var v=[];for(var p=1;p<e.value.body.length;p++){v.push(f.default.mathsym(e.value.body[p],e.mode))}s=w(["mop"],v,t)}var m=0;var b=0;if(s instanceof h.default.symbolNode){m=(s.height-s.depth)/2-t.fontMetrics().axisHeight;b=s.italic}if(n){s=w([],[s]);var y=void 0;var x=void 0;var k=void 0;var M=void 0;var _=void 0;if(r){_=t.havingStyle(i.sup());y=P(r,_,t);x=Math.max(t.fontMetrics().bigOpSpacing1,t.fontMetrics().bigOpSpacing3-y.depth)}if(a){_=t.havingStyle(i.sub());k=P(a,_,t);M=Math.max(t.fontMetrics().bigOpSpacing2,t.fontMetrics().bigOpSpacing4-k.height)}var z=void 0;var S=void 0;var A=void 0;if(!r){S=s.height-m;z=f.default.makeVList({positionType:"top",positionData:S,children:[{type:"kern",size:t.fontMetrics().bigOpSpacing5},{type:"elem",elem:k,marginLeft:-b+"em"},{type:"kern",size:M},{type:"elem",elem:s}]},t)}else if(!a){A=s.depth+m;z=f.default.makeVList({positionType:"bottom",positionData:A,children:[{type:"elem",elem:s},{type:"kern",size:x},{type:"elem",elem:y,marginLeft:b+"em"},{type:"kern",size:t.fontMetrics().bigOpSpacing5}]},t)}else if(!r&&!a){return s}else{A=t.fontMetrics().bigOpSpacing5+k.height+k.depth+M+s.depth+m;z=f.default.makeVList({positionType:"bottom",positionData:A,children:[{type:"kern",size:t.fontMetrics().bigOpSpacing5},{type:"elem",elem:k,marginLeft:-b+"em"},{type:"kern",size:M},{type:"elem",elem:s},{type:"kern",size:x},{type:"elem",elem:y,marginLeft:b+"em"},{type:"kern",size:t.fontMetrics().bigOpSpacing5}]},t)}return w(["mop","op-limits"],[z],t)}else{if(m){s.style.position="relative";s.style.top=m+"em"}return s}};E.mod=function(e,t){var r=[];if(e.value.modType==="bmod"){if(!t.style.isTight()){r.push(w(["mspace","negativemediumspace"],[],t))}r.push(w(["mspace","thickspace"],[],t))}else if(t.style.size===u.default.DISPLAY.size){r.push(w(["mspace","quad"],[],t))}else if(e.value.modType==="mod"){r.push(w(["mspace","twelvemuspace"],[],t))}else{r.push(w(["mspace","eightmuspace"],[],t))}if(e.value.modType==="pod"||e.value.modType==="pmod"){r.push(f.default.mathsym("(",e.mode))}if(e.value.modType!=="pod"){var a=[f.default.mathsym("m",e.mode),f.default.mathsym("o",e.mode),f.default.mathsym("d",e.mode)];if(e.value.modType==="bmod"){r.push(w(["mbin"],a,t));r.push(w(["mspace","thickspace"],[],t));if(!t.style.isTight()){r.push(w(["mspace","negativemediumspace"],[],t))}}else{Array.prototype.push.apply(r,a);r.push(w(["mspace","sixmuspace"],[],t))}}if(e.value.value){Array.prototype.push.apply(r,T(e.value.value,t,false))}if(e.value.modType==="pod"||e.value.modType==="pmod"){r.push(f.default.mathsym(")",e.mode))}return f.default.makeFragment(r)};E.katex=function(e,t){var r=w(["k"],[f.default.mathsym("K",e.mode)],t);var a=w(["a"],[f.default.mathsym("A",e.mode)],t);a.height=(a.height+.2)*.75;a.depth=(a.height-.2)*.75;var n=w(["t"],[f.default.mathsym("T",e.mode)],t);var i=w(["e"],[f.default.mathsym("E",e.mode)],t);i.height=i.height-.2155;i.depth=i.depth+.2155;var l=w(["x"],[f.default.mathsym("X",e.mode)],t);return w(["mord","katex-logo"],[r,a,n,i,l],t)};var L=function e(t,r,a){var n=w([t],[],r);n.height=a||r.fontMetrics().defaultRuleThickness;n.style.borderBottomWidth=n.height+"em";n.maxFontSize=1;return n};E.overline=function(e,t){var r=P(e.value.body,t.havingCrampedStyle());var a=L("overline-line",t);var n=f.default.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*a.height},{type:"elem",elem:a},{type:"kern",size:a.height}]},t);return w(["mord","overline"],[n],t)};E.underline=function(e,t){var r=P(e.value.body,t);var a=L("underline-line",t);var n=f.default.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:a.height},{type:"elem",elem:a},{type:"kern",size:3*a.height},{type:"elem",elem:r}]},t);return w(["mord","underline"],[n],t)};E.sqrt=function(e,t){var r=P(e.value.body,t.havingCrampedStyle());if(r.height===0){r.height=t.fontMetrics().xHeight}if(r instanceof h.default.documentFragment){r=w([],[r],t)}var a=t.fontMetrics();var n=a.defaultRuleThickness;var i=n;if(t.style.id<u.default.TEXT.id){i=t.fontMetrics().xHeight}var l=n+i/4;var o=(r.height+r.depth+l+n)*t.sizeMultiplier;var s=d.default.customSizedDelim("\\surd",o,false,t,e.mode);var c=t.fontMetrics().sqrtRuleThickness*s.sizeMultiplier;var v=s.height-c;if(v>r.height+r.depth+l){l=(l+v-r.height-r.depth)/2}var p=s.height-r.height-l-c;r.style.paddingLeft=s.advanceWidth+"em";var m=f.default.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:-(r.height+p)},{type:"elem",elem:s},{type:"kern",size:c}]},t);m.children[0].children[0].classes.push("svg-align");if(!e.value.index){return w(["mord","sqrt"],[m],t)}else{var g=t.havingStyle(u.default.SCRIPTSCRIPT);var b=P(e.value.index,g,t);var y=.6*(m.height-m.depth);var x=f.default.makeVList({positionType:"shift",positionData:-y,children:[{type:"elem",elem:b}]},t);var k=w(["root"],[x]);return w(["mord","sqrt"],[k,m],t)}};function q(e,t,r){var a=T(e,t,false);var n=t.sizeMultiplier/r.sizeMultiplier;for(var i=0;i<a.length;i++){var l=g.default.indexOf(a[i].classes,"sizing");if(l<0){Array.prototype.push.apply(a[i].classes,t.sizingClasses(r))}else if(a[i].classes[l+1]==="reset-size"+t.size){a[i].classes[l+1]="reset-size"+r.size}a[i].height*=n;a[i].depth*=n}return f.default.makeFragment(a)}E.sizing=function(e,t){var r=t.havingSize(e.value.size);return q(e.value.value,r,t)};E.styling=function(e,t){var r={display:u.default.DISPLAY,text:u.default.TEXT,script:u.default.SCRIPT,scriptscript:u.default.SCRIPTSCRIPT};var a=r[e.value.style];var n=t.havingStyle(a);return q(e.value.value,n,t)};E.font=function(e,t){var r=e.value.font;return P(e.value.body,t.withFont(r))};E.verb=function(e,t){var r=f.default.makeVerb(e,t);var a=[];var n=t.havingStyle(t.style.text());for(var i=0;i<r.length;i++){if(r[i]==="\xa0"){var l=w(["mord","rule"],[],n);l.style.marginLeft="0.525em";a.push(l)}else{a.push(f.default.makeSymbol(r[i],"Typewriter-Regular",e.mode,n,["mathtt"]))}}f.default.tryCombineChars(a);return w(["mord","text"].concat(n.sizingClasses(t)),a,n)};E.rule=function(e,t){var r=w(["mord","rule"],[],t);var a=0;if(e.value.shift){a=(0,p.calculateSize)(e.value.shift,t)}var n=(0,p.calculateSize)(e.value.width,t);var i=(0,p.calculateSize)(e.value.height,t);r.style.borderRightWidth=n+"em";r.style.borderTopWidth=i+"em";r.style.bottom=a+"em";r.width=n;r.height=i+a;r.depth=-a;r.maxFontSize=i*1.125*t.sizeMultiplier;return r};E.kern=function(e,t){var r=w(["mord","rule"],[],t);if(e.value.dimension){var a=(0,p.calculateSize)(e.value.dimension,t);r.style.marginLeft=a+"em"}return r};E.accent=function(e,t){var r=e.value.base;var a=void 0;if(e.type==="supsub"){var n=e;e=n.value.base;r=e.value.base;n.value.base=r;a=P(n,t)}var i=P(r,t.havingCrampedStyle());var l=e.value.isShifty&&O(r);var o=0;if(l){var u=N(r);var s=P(u,t.havingCrampedStyle());o=s.skew}var c=Math.min(i.height,t.fontMetrics().xHeight);var d=void 0;if(!e.value.isStretchy){var v=f.default.makeSymbol(e.value.label,"Main-Regular",e.mode,t);v.italic=0;var h=null;if(e.value.label==="\\vec"){h="accent-vec"}else if(e.value.label==="\\H"){h="accent-hungarian"}d=w([],[v]);d=w(["accent-body",h],[d]);d.style.marginLeft=2*o+"em";d=f.default.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-c},{type:"elem",elem:d}]},t)}else{d=y.default.svgSpan(e,t);d=f.default.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:d}]},t);var p=d.children[0].children[0].children[1];p.classes.push("svg-align");if(o>0){p.style.width="calc(100% - "+2*o+"em)";p.style.marginLeft=2*o+"em"}}var m=w(["mord","accent"],[d],t);if(a){a.children[0]=m;a.height=Math.max(m.height,a.height);a.classes[0]="mord";return a}else{return m}};E.horizBrace=function(e,t){var r=t.style;var a=e.type==="supsub";var n=void 0;var i=void 0;if(a){if(e.value.sup){i=t.havingStyle(r.sup());n=P(e.value.sup,i,t)}else{i=t.havingStyle(r.sub());n=P(e.value.sub,i,t)}e=e.value.base}var l=P(e.value.base,t.havingBaseStyle(u.default.DISPLAY));var o=y.default.svgSpan(e,t);var s=void 0;if(e.value.isOver){s=f.default.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.1},{type:"elem",elem:o}]},t);s.children[0].children[0].children[1].classes.push("svg-align")}else{s=f.default.makeVList({positionType:"bottom",positionData:l.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:l}]},t);s.children[0].children[0].children[0].classes.push("svg-align")}if(a){var c=w(["mord",e.value.isOver?"mover":"munder"],[s],t);if(e.value.isOver){s=f.default.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:n}]},t)}else{s=f.default.makeVList({positionType:"bottom",positionData:c.depth+.2+n.height,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:c}]},t)}}return w(["mord",e.value.isOver?"mover":"munder"],[s],t)};E.accentUnder=function(e,t){var r=P(e.value.base,t);var a=y.default.svgSpan(e,t);var n=/tilde/.test(e.value.label)?.12:0;var i=f.default.makeVList({positionType:"bottom",positionData:a.height+n,children:[{type:"elem",elem:a},{type:"kern",size:n},{type:"elem",elem:r}]},t);i.children[0].children[0].children[0].classes.push("svg-align");return w(["mord","accentunder"],[i],t)};E.enclose=function(e,t){var r=P(e.value.body,t);var a=e.value.label.substr(1);var n=t.sizeMultiplier;var i=void 0;var l=0;var o=/color/.test(a);if(a==="sout"){i=w(["stretchy","sout"]);i.height=t.fontMetrics().defaultRuleThickness/n;l=-.5*t.fontMetrics().xHeight}else{r.classes.push(/cancel/.test(a)?"cancel-pad":"boxpad");var u=0;if(/box/.test(a)){u=a==="colorbox"?.3:.34}else{u=O(e.value.body)?.2:0}i=y.default.encloseSpan(r,a,u,t);l=r.depth+u;if(o){i.style.backgroundColor=e.value.backgroundColor.value;if(a==="fcolorbox"){i.style.borderColor=e.value.borderColor.value}}}var s=void 0;if(o){s=f.default.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:l},{type:"elem",elem:r,shift:0}]},t)}else{s=f.default.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:i,shift:l}]},t)}if(/cancel/.test(a)){s.children[0].children[0].children[1].classes.push("svg-align");return w(["mord","cancel-lap"],[s],t)}else{return w(["mord"],[s],t)}};E.xArrow=function(e,t){var r=t.style;var a=t.havingStyle(r.sup());var n=P(e.value.body,a,t);n.classes.push("x-arrow-pad");var i=void 0;if(e.value.below){a=t.havingStyle(r.sub());i=P(e.value.below,a,t);i.classes.push("x-arrow-pad")}var l=y.default.svgSpan(e,t);var o=-t.fontMetrics().axisHeight+.5*l.height;var u=-t.fontMetrics().axisHeight-.5*l.height-.111;var s=void 0;if(e.value.below){var c=-t.fontMetrics().axisHeight+i.height+.5*l.height+.111;s=f.default.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:u},{type:"elem",elem:l,shift:o},{type:"elem",elem:i,shift:c}]},t)}else{s=f.default.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:u},{type:"elem",elem:l,shift:o}]},t)}s.children[0].children[0].children[1].classes.push("svg-align");return w(["mrel","x-arrow"],[s],t)};E.mclass=function(e,t){var r=T(e.value.value,t,true);return w([e.value.mclass],r,t)};E.raisebox=function(e,t){var r=E.sizing({value:{value:[{type:"text",value:{body:e.value.value,font:"mathrm"}}],size:6}},t);var a=(0,p.calculateSize)(e.value.dy.value,t);return f.default.makeVList({positionType:"shift",positionData:-a,children:[{type:"elem",elem:r}]},t)};var P=r.buildGroup=function e(t,r,a){if(!t){return w()}if(E[t.type]){var n=E[t.type](t,r);if(a&&r.size!==a.size){n=w(r.sizingClasses(a),[n],r);var i=r.sizeMultiplier/a.sizeMultiplier;n.height*=i;n.depth*=i}return n}else{throw new l.default("Got group of unknown type: '"+t.type+"'")}};function R(e,t){e=JSON.parse((0,n.default)(e));var r=T(e,t,true);var a=w(["base"],r,t);var i=w(["strut"]);var l=w(["strut","bottom"]);i.style.height=a.height+"em";l.style.height=a.height+a.depth+"em";l.style.verticalAlign=-a.depth+"em";var o=w(["katex-html"],[i,l,a]);o.setAttribute("aria-hidden","true");return o}},{"./ParseError":84,"./Style":89,"./buildCommon":91,"./delimiter":97,"./domTree":98,"./stretchy":110,"./units":114,"./utils":115,"babel-runtime/core-js/json/stringify":5}],93:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.buildGroup=r.buildExpression=r.groupTypes=r.makeText=undefined;r.default=S;var a=e("./buildCommon");var n=y(a);var i=e("./fontMetrics");var l=y(i);var o=e("./mathMLTree");var u=y(o);var s=e("./ParseError");var f=y(s);var c=e("./Style");var d=y(c);var v=e("./symbols");var h=y(v);var p=e("./utils");var m=y(p);var g=e("./stretchy");var b=y(g);function y(e){return e&&e.__esModule?e:{default:e}}var x=r.makeText=function e(t,r){if(h.default[r][t]&&h.default[r][t].replace){t=h.default[r][t].replace}return new u.default.TextNode(t)};var w=function e(t,r){var a=r.font;if(!a){return null}var i=t.mode;if(a==="mathit"){return"italic"}var o=t.value;if(m.default.contains(["\\imath","\\jmath"],o)){return null}if(h.default[i][o]&&h.default[i][o].replace){o=h.default[i][o].replace}var u=n.default.fontMap[a].fontName;if(l.default.getCharacterMetrics(o,u)){return n.default.fontMap[r.font].variant}return null};var k=r.groupTypes={};var M={mi:"italic",mn:"normal",mtext:"normal"};k.mathord=function(e,t){var r=new u.default.MathNode("mi",[x(e.value,e.mode)]);var a=w(e,t)||"italic";if(a!==M[r.type]){r.setAttribute("mathvariant",a)}return r};k.textord=function(e,t){var r=x(e.value,e.mode);var a=w(e,t)||"normal";var n=void 0;if(e.mode==="text"){n=new u.default.MathNode("mtext",[r])}else if(/[0-9]/.test(e.value)){n=new u.default.MathNode("mn",[r])}else if(e.value==="\\prime"){n=new u.default.MathNode("mo",[r])}else{n=new u.default.MathNode("mi",[r])}if(a!==M[n.type]){n.setAttribute("mathvariant",a)}return n};k.bin=function(e){var t=new u.default.MathNode("mo",[x(e.value,e.mode)]);return t};k.rel=function(e){var t=new u.default.MathNode("mo",[x(e.value,e.mode)]);return t};k.open=function(e){var t=new u.default.MathNode("mo",[x(e.value,e.mode)]);return t};k.close=function(e){var t=new u.default.MathNode("mo",[x(e.value,e.mode)]);return t};k.inner=function(e){var t=new u.default.MathNode("mo",[x(e.value,e.mode)]);return t};k.punct=function(e){var t=new u.default.MathNode("mo",[x(e.value,e.mode)]);t.setAttribute("separator","true");return t};k.ordgroup=function(e,t){var r=_(e.value,t);var a=new u.default.MathNode("mrow",r);return a};k.text=function(e,t){var r=e.value.body;var a=[];var n=null;for(var i=0;i<r.length;i++){var l=z(r[i],t);if(l.type==="mtext"&&n!=null){Array.prototype.push.apply(n.children,l.children)}else{a.push(l);if(l.type==="mtext"){n=l}}}if(a.length===1){return a[0]}else{return new u.default.MathNode("mrow",a)}};k.color=function(e,t){var r=_(e.value.value,t);var a=new u.default.MathNode("mstyle",r);a.setAttribute("mathcolor",e.value.color);return a};k.supsub=function(e,t){var r=false;var a=void 0;var n=void 0;if(e.value.base){if(e.value.base.value.type==="horizBrace"){n=e.value.sup?true:false;if(n===e.value.base.value.isOver){r=true;a=e.value.base.value.isOver}}}var i=true;var l=[z(e.value.base,t,i)];if(e.value.sub){l.push(z(e.value.sub,t,i))}if(e.value.sup){l.push(z(e.value.sup,t,i))}var o=void 0;if(r){o=a?"mover":"munder"}else if(!e.value.sub){var s=e.value.base;if(s&&s.value.limits&&t.style===d.default.DISPLAY){o="mover"}else{o="msup"}}else if(!e.value.sup){var f=e.value.base;if(f&&f.value.limits&&t.style===d.default.DISPLAY){o="munder"}else{o="msub"}}else{var c=e.value.base;if(c&&c.value.limits&&t.style===d.default.DISPLAY){o="munderover"}else{o="msubsup"}}var v=new u.default.MathNode(o,l);return v};k.genfrac=function(e,t){var r=new u.default.MathNode("mfrac",[z(e.value.numer,t),z(e.value.denom,t)]);if(!e.value.hasBarLine){r.setAttribute("linethickness","0px")}if(e.value.leftDelim!=null||e.value.rightDelim!=null){var a=[];if(e.value.leftDelim!=null){var n=new u.default.MathNode("mo",[new u.default.TextNode(e.value.leftDelim)]);n.setAttribute("fence","true");a.push(n)}a.push(r);if(e.value.rightDelim!=null){var i=new u.default.MathNode("mo",[new u.default.TextNode(e.value.rightDelim)]);i.setAttribute("fence","true");a.push(i)}var l=new u.default.MathNode("mrow",a);return l}return r};k.sqrt=function(e,t){var r=void 0;if(e.value.index){r=new u.default.MathNode("mroot",[z(e.value.body,t),z(e.value.index,t)])}else{r=new u.default.MathNode("msqrt",[z(e.value.body,t)])}return r};k.accent=function(e,t){var r=void 0;if(e.value.isStretchy){r=b.default.mathMLnode(e.value.label)}else{r=new u.default.MathNode("mo",[x(e.value.label,e.mode)])}var a=new u.default.MathNode("mover",[z(e.value.base,t),r]);a.setAttribute("accent","true");return a};k.spacing=function(e){var t=void 0;if(e.value==="\\ "||e.value==="\\space"||e.value===" "||e.value==="~"){t=new u.default.MathNode("mtext",[new u.default.TextNode("\xa0")])}else{t=new u.default.MathNode("mspace");t.setAttribute("width",n.default.spacingFunctions[e.value].size)}return t};k.op=function(e,t){var r=void 0;if(e.value.symbol){r=new u.default.MathNode("mo",[x(e.value.body,e.mode)])}else if(e.value.value){r=new u.default.MathNode("mo",_(e.value.value,t))}else{r=new u.default.MathNode("mi",[new u.default.TextNode(e.value.body.slice(1))])}return r};k.mod=function(e,t){var r=[];if(e.value.modType==="pod"||e.value.modType==="pmod"){r.push(new u.default.MathNode("mo",[x("(",e.mode)]))}if(e.value.modType!=="pod"){r.push(new u.default.MathNode("mo",[x("mod",e.mode)]))}if(e.value.value){var a=new u.default.MathNode("mspace");a.setAttribute("width","0.333333em");r.push(a);r=r.concat(_(e.value.value,t))}if(e.value.modType==="pod"||e.value.modType==="pmod"){r.push(new u.default.MathNode("mo",[x(")",e.mode)]))}return new u.default.MathNode("mo",r)};k.katex=function(e){var t=new u.default.MathNode("mtext",[new u.default.TextNode("KaTeX")]);return t};k.font=function(e,t){var r=e.value.font;return z(e.value.body,t.withFont(r))};k.styling=function(e,t){var r={display:d.default.DISPLAY,text:d.default.TEXT,script:d.default.SCRIPT,scriptscript:d.default.SCRIPTSCRIPT};var a=r[e.value.style];var n=t.havingStyle(a);var i=_(e.value.value,n);var l=new u.default.MathNode("mstyle",i);var o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]};var s=o[e.value.style];l.setAttribute("scriptlevel",s[0]);l.setAttribute("displaystyle",s[1]);return l};k.sizing=function(e,t){var r=t.havingSize(e.value.size);var a=_(e.value.value,r);var n=new u.default.MathNode("mstyle",a);n.setAttribute("mathsize",r.sizeMultiplier+"em");return n};k.verb=function(e,t){var r=new u.default.TextNode(n.default.makeVerb(e,t));var a=new u.default.MathNode("mtext",[r]);a.setAttribute("mathvariant",n.default.fontMap["mathtt"].variant);return a};k.overline=function(e,t){var r=new u.default.MathNode("mo",[new u.default.TextNode("\u203e")]);r.setAttribute("stretchy","true");var a=new u.default.MathNode("mover",[z(e.value.body,t),r]);a.setAttribute("accent","true");return a};k.underline=function(e,t){var r=new u.default.MathNode("mo",[new u.default.TextNode("\u203e")]);r.setAttribute("stretchy","true");var a=new u.default.MathNode("munder",[z(e.value.body,t),r]);a.setAttribute("accentunder","true");return a};k.accentUnder=function(e,t){var r=b.default.mathMLnode(e.value.label);var a=new u.default.MathNode("munder",[z(e.value.body,t),r]);a.setAttribute("accentunder","true");return a};k.enclose=function(e,t){var r=new u.default.MathNode("menclose",[z(e.value.body,t)]);switch(e.value.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\colorbox":r.setAttribute("mathbackground",e.value.backgroundColor.value);break;case"\\fcolorbox":r.setAttribute("mathbackground",e.value.backgroundColor.value);r.setAttribute("notation","box");break;default:r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return r};k.horizBrace=function(e,t){var r=b.default.mathMLnode(e.value.label);return new u.default.MathNode(e.value.isOver?"mover":"munder",[z(e.value.base,t),r])};k.xArrow=function(e,t){var r=b.default.mathMLnode(e.value.label);var a=void 0;var n=void 0;if(e.value.body){var i=z(e.value.body,t);if(e.value.below){n=z(e.value.below,t);a=new u.default.MathNode("munderover",[r,n,i])}else{a=new u.default.MathNode("mover",[r,i])}}else if(e.value.below){n=z(e.value.below,t);a=new u.default.MathNode("munder",[r,n])}else{a=new u.default.MathNode("mover",[r])}return a};k.rule=function(e){var t=new u.default.MathNode("mrow");return t};k.kern=function(e){var t=new u.default.MathNode("mrow");return t};k.lap=function(e,t){var r=new u.default.MathNode("mpadded",[z(e.value.body,t)]);if(e.value.alignment!=="rlap"){var a=e.value.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",a+"width")}r.setAttribute("width","0px");return r};k.smash=function(e,t){var r=new u.default.MathNode("mpadded",[z(e.value.body,t)]);if(e.value.smashHeight){r.setAttribute("height","0px")}if(e.value.smashDepth){r.setAttribute("depth","0px")}return r};k.mclass=function(e,t){var r=_(e.value.value,t);return new u.default.MathNode("mstyle",r)};k.raisebox=function(e,t){var r=new u.default.MathNode("mpadded",[z(e.value.body,t)]);var a=e.value.dy.value.number+e.value.dy.value.unit;r.setAttribute("voffset",a);return r};var _=r.buildExpression=function e(t,r){var a=[];for(var n=0;n<t.length;n++){var i=t[n];a.push(z(i,r))}return a};var z=r.buildGroup=function e(t,r){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;if(!t){return new u.default.MathNode("mrow")}if(k[t.type]){var n=k[t.type](t,r);if(a){if(n.type==="mrow"&&n.children.length===1){return n.children[0]}}return n}else{throw new f.default("Got group of unknown type: '"+t.type+"'")}};function S(e,t,r){var a=_(e,r);var i=new u.default.MathNode("mrow",a);var l=new u.default.MathNode("annotation",[new u.default.TextNode(t)]);l.setAttribute("encoding","application/x-tex");var o=new u.default.MathNode("semantics",[i,l]);var s=new u.default.MathNode("math",[o]);return n.default.makeSpan(["katex-mathml"],[s])}},{"./ParseError":84,"./Style":89,"./buildCommon":91,"./fontMetrics":101,"./mathMLTree":108,"./stretchy":110,"./symbols":112,"./utils":115}],94:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("./buildHTML");var n=p(a);var i=e("./buildMathML");var l=p(i);var o=e("./buildCommon");var u=p(o);var s=e("./Options");var f=p(s);var c=e("./Settings");var d=p(c);var v=e("./Style");var h=p(v);function p(e){return e&&e.__esModule?e:{default:e}}var m=function e(t,r,a){a=a||new d.default({});var i=h.default.TEXT;if(a.displayMode){i=h.default.DISPLAY}var o=new f.default({style:i,maxSize:a.maxSize});var s=(0,l.default)(t,r,o);var c=(0,n.default)(t,o);var v=u.default.makeSpan(["katex"],[s,c]);if(a.displayMode){return u.default.makeSpan(["katex-display"],[v])}else{return v}};r.default=m},{"./Options":83,"./Settings":87,"./Style":89,"./buildCommon":91,"./buildHTML":92,"./buildMathML":93}],95:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r._environments=undefined;r.default=c;var a=e("./buildHTML");var n=e("./buildMathML");var i=e("./Options");var l=s(i);var o=e("./ParseNode");var u=s(o);function s(e){return e&&e.__esModule?e:{default:e}}var f=r._environments={};function c(e){var t=e.type,r=e.names,i=e.props,l=e.handler,o=e.htmlBuilder,u=e.mathmlBuilder;var s={numArgs:i.numArgs||0,greediness:1,allowedInText:false,numOptionalArgs:0,handler:l};for(var c=0;c<r.length;++c){f[r[c]]=s}if(o){a.groupTypes[t]=o}if(u){n.groupTypes[t]=u}}},{"./Options":83,"./ParseNode":85,"./buildHTML":92,"./buildMathML":93}],96:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.ordargument=r._functions=undefined;r.default=l;var a=e("./buildHTML");var n=e("./buildMathML");var i=r._functions={};function l(e){var t=e.type,r=e.names,l=e.props,o=e.handler,u=e.htmlBuilder,s=e.mathmlBuilder;var f={numArgs:l.numArgs,argTypes:l.argTypes,greediness:l.greediness===undefined?1:l.greediness,allowedInText:!!l.allowedInText,allowedInMath:l.allowedInMath===undefined?true:l.allowedInMath,numOptionalArgs:l.numOptionalArgs||0,infix:!!l.infix,handler:o};for(var c=0;c<r.length;++c){i[r[c]]=f}if(t){if(u){a.groupTypes[t]=u}if(s){n.groupTypes[t]=s}}}var o=r.ordargument=function e(t){if(t.type==="ordgroup"){return t.value}else{return[t]}}},{"./buildHTML":92,"./buildMathML":93}],97:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("./ParseError");var n=g(a);var i=e("./Style");var l=g(i);var o=e("./domTree");var u=g(o);var s=e("./buildCommon");var f=g(s);var c=e("./fontMetrics");var d=g(c);var v=e("./symbols");var h=g(v);var p=e("./utils");var m=g(p);function g(e){return e&&e.__esModule?e:{default:e}}var b=function e(t,r){if(h.default.math[t]&&h.default.math[t].replace){return d.default.getCharacterMetrics(h.default.math[t].replace,r)}else{return d.default.getCharacterMetrics(t,r)}};var y=function e(t,r,a,n){var i=a.havingBaseStyle(r);var l=f.default.makeSpan((n||[]).concat(i.sizingClasses(a)),[t],a);l.delimSizeMultiplier=i.sizeMultiplier/a.sizeMultiplier;l.height*=l.delimSizeMultiplier;l.depth*=l.delimSizeMultiplier;l.maxFontSize=i.sizeMultiplier;return l};var x=function e(t,r,a){var n=r.havingBaseStyle(a);var i=(1-r.sizeMultiplier/n.sizeMultiplier)*r.fontMetrics().axisHeight;t.classes.push("delimcenter");t.style.top=i+"em";t.height-=i;t.depth+=i};var w=function e(t,r,a,n,i,l){var o=f.default.makeSymbol(t,"Main-Regular",i,n);var u=y(o,r,n,l);if(a){x(u,n,r)}return u};var k=function e(t,r,a,n){return f.default.makeSymbol(t,"Size"+r+"-Regular",a,n)};var M=function e(t,r,a,n,i,o){var u=k(t,r,i,n);var s=y(f.default.makeSpan(["delimsizing","size"+r],[u],n),l.default.TEXT,n,o);if(a){x(s,n,l.default.TEXT)}return s};var _=function e(t,r,a){var n=void 0;if(r==="Size1-Regular"){n="delim-size1"}else if(r==="Size4-Regular"){n="delim-size4"}var i=f.default.makeSpan(["delimsizinginner",n],[f.default.makeSpan([],[f.default.makeSymbol(t,r,a)])]);return{type:"elem",elem:i}};var z=function e(t,r,a,n,i,o){var u=void 0;var s=void 0;var c=void 0;var d=void 0;u=c=d=t;s=null;var v="Size1-Regular";if(t==="\\uparrow"){c=d="\u23d0"}else if(t==="\\Uparrow"){c=d="\u2016"}else if(t==="\\downarrow"){u=c="\u23d0"}else if(t==="\\Downarrow"){u=c="\u2016"}else if(t==="\\updownarrow"){u="\\uparrow";c="\u23d0";d="\\downarrow"}else if(t==="\\Updownarrow"){u="\\Uparrow";c="\u2016";d="\\Downarrow"}else if(t==="["||t==="\\lbrack"){u="\u23a1";c="\u23a2";d="\u23a3";v="Size4-Regular"}else if(t==="]"||t==="\\rbrack"){u="\u23a4";c="\u23a5";d="\u23a6";v="Size4-Regular"}else if(t==="\\lfloor"){c=u="\u23a2";d="\u23a3";v="Size4-Regular"}else if(t==="\\lceil"){u="\u23a1";c=d="\u23a2";v="Size4-Regular"}else if(t==="\\rfloor"){c=u="\u23a5";d="\u23a6";v="Size4-Regular"}else if(t==="\\rceil"){u="\u23a4";c=d="\u23a5";v="Size4-Regular"}else if(t==="("){u="\u239b";c="\u239c";d="\u239d";v="Size4-Regular"}else if(t===")"){u="\u239e";c="\u239f";d="\u23a0";v="Size4-Regular"}else if(t==="\\{"||t==="\\lbrace"){u="\u23a7";s="\u23a8";d="\u23a9";c="\u23aa";v="Size4-Regular"}else if(t==="\\}"||t==="\\rbrace"){u="\u23ab";s="\u23ac";d="\u23ad";c="\u23aa";v="Size4-Regular"}else if(t==="\\lgroup"){u="\u23a7";d="\u23a9";c="\u23aa";v="Size4-Regular"}else if(t==="\\rgroup"){u="\u23ab";d="\u23ad";c="\u23aa";v="Size4-Regular"}else if(t==="\\lmoustache"){u="\u23a7";d="\u23ad";c="\u23aa";v="Size4-Regular"}else if(t==="\\rmoustache"){u="\u23ab";d="\u23a9";c="\u23aa";v="Size4-Regular"}var h=b(u,v);var p=h.height+h.depth;var m=b(c,v);var g=m.height+m.depth;var x=b(d,v);var w=x.height+x.depth;var k=0;var M=1;if(s!==null){var z=b(s,v);k=z.height+z.depth;M=2}var S=p+w+k;var T=Math.ceil((r-S)/(M*g));var A=S+T*M*g;var C=n.fontMetrics().axisHeight;if(a){C*=n.sizeMultiplier}var N=A/2-C;var O=[];O.push(_(d,v,i));if(s===null){for(var j=0;j<T;j++){O.push(_(c,v,i))}}else{for(var E=0;E<T;E++){O.push(_(c,v,i))}O.push(_(s,v,i));for(var L=0;L<T;L++){O.push(_(c,v,i))}}O.push(_(u,v,i));var q=n.havingBaseStyle(l.default.TEXT);var P=f.default.makeVList({positionType:"bottom",positionData:N,children:O},q);return y(f.default.makeSpan(["delimsizing","mult"],[P],q),l.default.TEXT,n,o)};var S=function e(t,r,a,n){var i=void 0;if(t==="sqrtTall"){var l=a-54;i="M702 0H400000v40H742v"+l+"l-4 4-4 4c-.667.667\n-2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1h-12l-28-84c-16.667-52-96.667\n-294.333-240-727l-212 -643 -85 170c-4-3.333-8.333-7.667-13 -13l-13-13l77-155\n 77-156c66 199.333 139 419.667 219 661 l218 661zM702 0H400000v40H742z"}var o=new u.default.pathNode(t,i);var s=[["width","400em"],["height",r+"em"]];s.push(["viewBox","0 0 400000 "+a]);s.push(["preserveAspectRatio","xMinYMin slice"]);var c=new u.default.svgNode([o],s);return f.default.makeSpan(["hide-tail"],[c],n)};var T=function e(t,r,a){var n=void 0;var i=a.sizeMultiplier;var l=void 0;var o=void 0;if(r.type==="small"){o=1e3;var u=a.havingBaseStyle(r.style);i=u.sizeMultiplier/a.sizeMultiplier;l=1*i;n=S("sqrtMain",l,o,a);n.style.minWidth="0.853em";n.advanceWidth=.833*i}else if(r.type==="large"){o=1e3*O[r.size];l=O[r.size]/i;n=S("sqrtSize"+r.size,l,o,a);n.style.minWidth="1.02em";n.advanceWidth=1/i}else{l=t/i;o=Math.floor(1e3*t);n=S("sqrtTall",l,o,a);n.style.minWidth="0.742em";n.advanceWidth=1.056/i}n.height=l;n.style.height=l+"em";n.sizeMultiplier=i;return n};var A=["(",")","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd"];var C=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache"];var N=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"];var O=[0,1.2,1.8,2.4,3];var j=function e(t,r,a,i,l){if(t==="<"||t==="\\lt"){t="\\langle"}else if(t===">"||t==="\\gt"){t="\\rangle"}if(m.default.contains(A,t)||m.default.contains(N,t)){return M(t,r,false,a,i,l)}else if(m.default.contains(C,t)){return z(t,O[r],false,a,i,l)}else{throw new n.default("Illegal delimiter: '"+t+"'")}};var E=[{type:"small",style:l.default.SCRIPTSCRIPT},{type:"small",style:l.default.SCRIPT},{type:"small",style:l.default.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}];var L=[{type:"small",style:l.default.SCRIPTSCRIPT},{type:"small",style:l.default.SCRIPT},{type:"small",style:l.default.TEXT},{type:"stack"}];var q=[{type:"small",style:l.default.SCRIPTSCRIPT},{type:"small",style:l.default.SCRIPT},{type:"small",style:l.default.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];var P=function e(t){if(t.type==="small"){return"Main-Regular"}else if(t.type==="large"){return"Size"+t.size+"-Regular"}else if(t.type==="stack"){return"Size4-Regular"}};var R=function e(t,r,a,n){var i=Math.min(2,3-n.style.size);for(var l=i;l<a.length;l++){if(a[l].type==="stack"){break}var o=b(t,P(a[l]));var u=o.height+o.depth;if(a[l].type==="small"){var s=n.havingBaseStyle(a[l].style);u*=s.sizeMultiplier}if(u>r){return a[l]}}return a[a.length-1]};var B=function e(t,r,a,n,i,l){if(t==="<"||t==="\\lt"){t="\\langle"}else if(t===">"||t==="\\gt"){t="\\rangle"}var o=void 0;if(m.default.contains(N,t)){o=E}else if(m.default.contains(A,t)){o=q}else{o=L}var u=R(t,r,o,n);if(t==="\\surd"){return T(r,u,n)}else{if(u.type==="small"){return w(t,u.style,a,n,i,l)}else if(u.type==="large"){return M(t,u.size,a,n,i,l)}else if(u.type==="stack"){return z(t,r,a,n,i,l)}}};var D=function e(t,r,a,n,i,l){var o=n.fontMetrics().axisHeight*n.sizeMultiplier;var u=901;var s=5/n.fontMetrics().ptPerEm;var f=Math.max(r-o,a+o);var c=Math.max(f/500*u,2*f-s);return B(t,c,true,n,i,l)};r.default={sizedDelim:j,customSizedDelim:B,leftRightDelim:D}},{"./ParseError":84,"./Style":89,"./buildCommon":91,"./domTree":98,"./fontMetrics":101,"./symbols":112,"./utils":115}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("babel-runtime/helpers/slicedToArray");var n=h(a);var i=e("babel-runtime/helpers/classCallCheck");var l=h(i);var o=e("babel-runtime/helpers/createClass");var u=h(o);var s=e("./unicodeRegexes");var f=e("./utils");var c=h(f);var d=e("./svgGeometry");var v=h(d);function h(e){return e&&e.__esModule?e:{default:e}}var p=function e(t){t=t.slice();for(var r=t.length-1;r>=0;r--){if(!t[r]){t.splice(r,1)}}return t.join(" ")};var m=function(){function e(t,r,a){(0,l.default)(this,e);this.classes=t||[];this.children=r||[];this.height=0;this.depth=0;this.maxFontSize=0;this.style={};this.attributes={};if(a){if(a.style.isTight()){this.classes.push("mtight")}if(a.getColor()){this.style.color=a.getColor()}}}(0,u.default)(e,[{key:"setAttribute",value:function e(t,r){this.attributes[t]=r}},{key:"tryCombine",value:function e(t){return false}},{key:"toNode",value:function e(){var t=document.createElement("span");t.className=p(this.classes);for(var r in this.style){if(Object.prototype.hasOwnProperty.call(this.style,r)){t.style[r]=this.style[r]}}for(var a in this.attributes){if(Object.prototype.hasOwnProperty.call(this.attributes,a)){t.setAttribute(a,this.attributes[a])}}for(var n=0;n<this.children.length;n++){t.appendChild(this.children[n].toNode())}return t}},{key:"toMarkup",value:function e(){var t="<span";if(this.classes.length){t+=' class="';t+=c.default.escape(p(this.classes));t+='"'}var r="";for(var a in this.style){if(this.style.hasOwnProperty(a)){r+=c.default.hyphenate(a)+":"+this.style[a]+";"}}if(r){t+=' style="'+c.default.escape(r)+'"'}for(var n in this.attributes){if(Object.prototype.hasOwnProperty.call(this.attributes,n)){t+=" "+n+'="';t+=c.default.escape(this.attributes[n]);t+='"'}}t+=">";for(var i=0;i<this.children.length;i++){t+=this.children[i].toMarkup()}t+="</span>";return t}}]);return e}();var g=function(){function e(t){(0,l.default)(this,e);this.children=t||[];this.height=0;this.depth=0;this.maxFontSize=0}(0,u.default)(e,[{key:"toNode",value:function e(){var t=document.createDocumentFragment();for(var r=0;r<this.children.length;r++){t.appendChild(this.children[r].toNode())}return t}},{key:"toMarkup",value:function e(){var t="";for(var r=0;r<this.children.length;r++){t+=this.children[r].toMarkup()}return t}}]);return e}();var b={"\xee":"\u0131\u0302","\xef":"\u0131\u0308","\xed":"\u0131\u0301","\xec":"\u0131\u0300"};var y=function(){function e(t,r,a,n,i,o,u){(0,l.default)(this,e);this.value=t||"";this.height=r||0;this.depth=a||0;this.italic=n||0;this.skew=i||0;this.classes=o||[];this.style=u||{};this.maxFontSize=0;if(s.cjkRegex.test(t)){if(s.hangulRegex.test(t)){this.classes.push("hangul_fallback")}else{this.classes.push("cjk_fallback")}}if(/[\xee\xef\xed\xec]/.test(this.value)){this.value=b[this.value]}}(0,u.default)(e,[{key:"tryCombine",value:function t(r){if(!r||!(r instanceof e)||this.italic>0||p(this.classes)!==p(r.classes)||this.skew!==r.skew||this.maxFontSize!==r.maxFontSize){return false}for(var a in this.style){if(this.style.hasOwnProperty(a)&&this.style[a]!==r.style[a]){return false}}for(var n in r.style){if(r.style.hasOwnProperty(n)&&this.style[n]!==r.style[n]){return false}}this.value+=r.value;this.height=Math.max(this.height,r.height);this.depth=Math.max(this.depth,r.depth);this.italic=r.italic;return true}},{key:"toNode",value:function e(){var t=document.createTextNode(this.value);var r=null;if(this.italic>0){r=document.createElement("span");r.style.marginRight=this.italic+"em"}if(this.classes.length>0){r=r||document.createElement("span");r.className=p(this.classes)}for(var a in this.style){if(this.style.hasOwnProperty(a)){r=r||document.createElement("span");r.style[a]=this.style[a]}}if(r){r.appendChild(t);return r}else{return t}}},{key:"toMarkup",value:function e(){var t=false;var r="<span";if(this.classes.length){t=true;r+=' class="';r+=c.default.escape(p(this.classes));r+='"'}var a="";if(this.italic>0){a+="margin-right:"+this.italic+"em;"}for(var n in this.style){if(this.style.hasOwnProperty(n)){a+=c.default.hyphenate(n)+":"+this.style[n]+";"}}if(a){t=true;r+=' style="'+c.default.escape(a)+'"'}var i=c.default.escape(this.value);if(t){r+=">";r+=i;r+="</span>";return r}else{return i}}}]);return e}();var x=function(){function e(t,r){(0,l.default)(this,e);this.children=t||[];this.attributes=r||[]}(0,u.default)(e,[{key:"toNode",value:function e(){var t="http://www.w3.org/2000/svg";var r=document.createElementNS(t,"svg");for(var a=0;a<this.attributes.length;a++){var i=(0,n.default)(this.attributes[a],2),l=i[0],o=i[1];r.setAttribute(l,o)}for(var u=0;u<this.children.length;u++){r.appendChild(this.children[u].toNode())}return r}},{key:"toMarkup",value:function e(){var t="<svg";for(var r=0;r<this.attributes.length;r++){var a=(0,n.default)(this.attributes[r],2),i=a[0],l=a[1];t+=" "+i+"='"+l+"'"}t+=">";for(var o=0;o<this.children.length;o++){t+=this.children[o].toMarkup()}t+="</svg>";return t}}]);return e}();var w=function(){function e(t,r){(0,l.default)(this,e);this.pathName=t;this.alternate=r}(0,u.default)(e,[{key:"toNode",value:function e(){var t="http://www.w3.org/2000/svg";var r=document.createElementNS(t,"path");if(this.pathName!=="sqrtTall"){r.setAttribute("d",v.default.path[this.pathName])}else{r.setAttribute("d",this.alternate)}return r}},{key:"toMarkup",value:function e(){if(this.pathName!=="sqrtTall"){return"<path d='"+v.default.path[this.pathName]+"'/>"}else{return"<path d='"+this.alternate+"'/>"}}}]);return e}();var k=function(){function e(t){(0,l.default)(this,e);this.attributes=t||[]}(0,u.default)(e,[{key:"toNode",value:function e(){var t="http://www.w3.org/2000/svg";var r=document.createElementNS(t,"line");for(var a=0;a<this.attributes.length;a++){var i=(0,n.default)(this.attributes[a],2),l=i[0],o=i[1];r.setAttribute(l,o)}return r}},{key:"toMarkup",value:function e(){var t="<line";for(var r=0;r<this.attributes.length;r++){var a=(0,n.default)(this.attributes[r],2),i=a[0],l=a[1];t+=" "+i+"='"+l+"'"}t+="/>";return t}}]);return e}();r.default={span:m,documentFragment:g,symbolNode:y,svgNode:x,pathNode:w,lineNode:k}},{"./svgGeometry":111,"./unicodeRegexes":113,"./utils":115,"babel-runtime/helpers/classCallCheck":8,"babel-runtime/helpers/createClass":9,"babel-runtime/helpers/slicedToArray":10}],99:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("./defineEnvironment");e("./environments/array.js");var n={has:function e(t){return a._environments.hasOwnProperty(t)},get:function e(t){return a._environments[t]}};r.default=n},{"./defineEnvironment":95,"./environments/array.js":100}],100:[function(e,t,r){"use strict";var a=e("../buildCommon");var n=w(a);var i=e("../defineEnvironment");var l=w(i);var o=e("../mathMLTree");var u=w(o);var s=e("../ParseError");var f=w(s);var c=e("../ParseNode");var d=w(c);var v=e("../units");var h=e("../utils");var p=w(h);var m=e("../buildHTML");var g=x(m);var b=e("../buildMathML");var y=x(b);function x(e){if(e&&e.__esModule){return e}else{var t={};if(e!=null){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}}t.default=e;return t}}function w(e){return e&&e.__esModule?e:{default:e}}function k(e,t,r){var a=[];var n=[a];var i=[];while(true){var l=e.parseExpression(false,null);l=new d.default("ordgroup",l,e.mode);if(r){l=new d.default("styling",{style:r,value:[l]},e.mode)}a.push(l);var o=e.nextToken.text;if(o==="&"){e.consume()}else if(o==="\\end"){var u=n[n.length-1];if(n.length>1&&u.length===1&&u[0].value.length===0){n.pop()}break}else if(o==="\\\\"||o==="\\cr"){var s=e.parseFunction();i.push(s.value.size);a=[];n.push(a)}else{throw new f.default("Expected & or \\\\ or \\end",e.nextToken)}}t.body=n;t.rowGaps=i;return new d.default(t.type,t,e.mode)}function M(e){if(e.substr(0,1)==="d"){return"display"}else{return"text"}}var _=function e(t,r){var a=void 0;var i=void 0;var l=t.value.body.length;var o=0;var u=new Array(l);var s=1/r.fontMetrics().ptPerEm;var c=5*s;var d=12*s;var h=3*s;var m=p.default.deflt(t.value.arraystretch,1);var b=m*d;var y=.7*b;var x=.3*b;var w=0;for(a=0;a<t.value.body.length;++a){var k=t.value.body[a];var M=y;var _=x;if(o<k.length){o=k.length}var z=new Array(k.length);for(i=0;i<k.length;++i){var S=g.buildGroup(k[i],r);if(_<S.depth){_=S.depth}if(M<S.height){M=S.height}z[i]=S}var T=0;if(t.value.rowGaps[a]){T=(0,v.calculateSize)(t.value.rowGaps[a].value,r);if(T>0){T+=x;if(_<T){_=T}T=0}}if(t.value.addJot){_+=h}z.height=M;z.depth=_;w+=M;z.pos=w;w+=_+T;u[a]=z}var A=w/2+r.fontMetrics().axisHeight;var C=t.value.cols||[];var N=[];var O=void 0;var j=void 0;for(i=0,j=0;i<o||j<C.length;++i,++j){var E=C[j]||{};var L=true;while(E.type==="separator"){if(!L){O=n.default.makeSpan(["arraycolsep"],[]);O.style.width=r.fontMetrics().doubleRuleSep+"em";N.push(O)}if(E.separator==="|"){var q=n.default.makeSpan(["vertical-separator"],[]);q.style.height=w+"em";q.style.verticalAlign=-(w-A)+"em";N.push(q)}else{throw new f.default("Invalid separator type: "+E.separator)}j++;E=C[j]||{};L=false}if(i>=o){continue}var P=void 0;if(i>0||t.value.hskipBeforeAndAfter){P=p.default.deflt(E.pregap,c);if(P!==0){O=n.default.makeSpan(["arraycolsep"],[]);O.style.width=P+"em";N.push(O)}}var R=[];for(a=0;a<l;++a){var B=u[a];var D=B[i];if(!D){continue}var F=B.pos-A;D.depth=B.depth;D.height=B.height;R.push({type:"elem",elem:D,shift:F})}R=n.default.makeVList({positionType:"individualShift",children:R},r);R=n.default.makeSpan(["col-align-"+(E.align||"c")],[R]);N.push(R);if(i<o-1||t.value.hskipBeforeAndAfter){P=p.default.deflt(E.postgap,c);if(P!==0){O=n.default.makeSpan(["arraycolsep"],[]);O.style.width=P+"em";N.push(O)}}}u=n.default.makeSpan(["mtable"],N);return n.default.makeSpan(["mord"],[u],r)};var z=function e(t,r){return new u.default.MathNode("mtable",t.value.body.map(function(e){return new u.default.MathNode("mtr",e.map(function(e){return new u.default.MathNode("mtd",[y.buildGroup(e,r)])}))}))};(0,l.default)({type:"array",names:["array","darray"],props:{numArgs:1},handler:function e(t,r){var a=r[0];a=a.value.map?a.value:[a];var n=a.map(function(e){var t=e.value;if("lcr".indexOf(t)!==-1){return{type:"align",align:t}}else if(t==="|"){return{type:"separator",separator:"|"}}throw new f.default("Unknown column alignment: "+e.value,e)});var i={type:"array",cols:n,hskipBeforeAndAfter:true};i=k(t.parser,i,M(t.envName));return i},htmlBuilder:_,mathmlBuilder:z});(0,l.default)({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix"],props:{numArgs:0},handler:function e(t){var r={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName];var a={type:"array",hskipBeforeAndAfter:false};a=k(t.parser,a,M(t.envName));if(r){a=new d.default("leftright",{body:[a],left:r[0],right:r[1]},t.mode)}return a},htmlBuilder:_,mathmlBuilder:z});(0,l.default)({type:"array",names:["cases","dcases"],props:{numArgs:0},handler:function e(t){var r={type:"array",arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]};r=k(t.parser,r,M(t.envName));r=new d.default("leftright",{body:[r],left:"\\{",right:"."},t.mode);return r},htmlBuilder:_,mathmlBuilder:z});(0,l.default)({type:"array",names:["aligned"],props:{numArgs:0},handler:function e(t){var r={type:"array",cols:[],addJot:true};r=k(t.parser,r,"display");var a=new d.default("ordgroup",[],t.mode);var n=0;r.value.body.forEach(function(e){for(var t=1;t<e.length;t+=2){var r=e[t].value.value[0];r.value.unshift(a)}if(n<e.length){n=e.length}});for(var i=0;i<n;++i){var l="r";var o=0;if(i%2===1){l="l"}else if(i>0){o=1}r.value.cols[i]={type:"align",align:l,pregap:o,postgap:0}}return r},htmlBuilder:_,mathmlBuilder:z});(0,l.default)({type:"array",names:["gathered"],props:{numArgs:0},handler:function e(t){var r={type:"array",cols:[{type:"align",align:"c"}],addJot:true};r=k(t.parser,r,"display");return r},htmlBuilder:_,mathmlBuilder:z})},{"../ParseError":84,"../ParseNode":85,"../buildCommon":91,"../buildHTML":92,"../buildMathML":93,"../defineEnvironment":95,"../mathMLTree":108,"../units":114,"../utils":115}],101:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("./unicodeRegexes");var n=e("./fontMetricsData");var i=l(n);function l(e){return e&&e.__esModule?e:{default:e}}var o={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2]};var u={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xc6":"A","\xc7":"C","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xd0":"D","\xd1":"N","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xdd":"Y","\xde":"o","\xdf":"B","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xe6":"a","\xe7":"c","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xf0":"d","\xf1":"n","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xfd":"y","\xfe":"o","\xff":"y","\u0410":"A","\u0411":"B","\u0412":"B","\u0413":"F","\u0414":"A","\u0415":"E","\u0416":"K","\u0417":"3","\u0418":"N","\u0419":"N","\u041a":"K","\u041b":"N","\u041c":"M","\u041d":"H","\u041e":"O","\u041f":"N","\u0420":"P","\u0421":"C","\u0422":"T","\u0423":"y","\u0424":"O","\u0425":"X","\u0426":"U","\u0427":"h","\u0428":"W","\u0429":"W","\u042a":"B","\u042b":"X","\u042c":"B","\u042d":"3","\u042e":"X","\u042f":"R","\u0430":"a","\u0431":"b","\u0432":"a","\u0433":"r","\u0434":"y","\u0435":"e","\u0436":"m","\u0437":"e","\u0438":"n","\u0439":"n","\u043a":"n","\u043b":"n","\u043c":"m","\u043d":"n","\u043e":"o","\u043f":"n","\u0440":"p","\u0441":"c","\u0442":"o","\u0443":"y","\u0444":"b","\u0445":"x","\u0446":"n","\u0447":"n","\u0448":"w","\u0449":"w","\u044a":"a","\u044b":"m","\u044c":"a","\u044d":"e","\u044e":"m","\u044f":"r"};var s=function e(t,r){var n=t.charCodeAt(0);if(t[0]in u){n=u[t[0]].charCodeAt(0)}else if(a.cjkRegex.test(t[0])){n="M".charCodeAt(0)}var l=i.default[r][""+n];if(l){return{depth:l[0],height:l[1],italic:l[2],skew:l[3],width:l[4]}}};var f={};var c=function e(t){var r=void 0;if(t>=5){r=0}else if(t>=3){r=1}else{r=2}if(!f[r]){var a=f[r]={cssEmPerMu:o.quad[r]/18};for(var n in o){if(o.hasOwnProperty(n)){a[n]=o[n][r]}}}return f[r]};r.default={getFontMetrics:c,getCharacterMetrics:s}},{"./fontMetricsData":102,"./unicodeRegexes":113}],102:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8216:[0,.61111,0,0],8217:[0,.61111,0,0],8242:[0,.61111,0,0],9251:[.11111,.21944,0,0]}};r.default=a},{}],103:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("./utils");var n=c(a);var i=e("./ParseError");var l=c(i);var o=e("./ParseNode");var u=c(o);var s=e("./defineFunction");var f=c(s);e("./functions/phantom");e("./functions/operators");e("./functions/delimsizing");function c(e){return e&&e.__esModule?e:{default:e}}var d=s._functions;r.default=d;var v=function e(t,r,a){(0,f.default)({names:t,props:r,handler:a})};v(["\\sqrt"],{numArgs:1,numOptionalArgs:1},function(e,t,r){var a=r[0];var n=t[0];return{type:"sqrt",body:n,index:a}});var h={"\\text":undefined,"\\textrm":"mathrm","\\textsf":"mathsf","\\texttt":"mathtt","\\textnormal":"mathrm","\\textbf":"mathbf","\\textit":"textit"};v(["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textit"],{numArgs:1,argTypes:["text"],greediness:2,allowedInText:true},function(e,t){var r=t[0];return{type:"text",body:(0,s.ordargument)(r),font:h[e.funcName]}});v(["\\textcolor"],{numArgs:2,allowedInText:true,greediness:3,argTypes:["color","original"]},function(e,t){var r=t[0];var a=t[1];return{type:"color",color:r.value,value:(0,s.ordargument)(a)}});v(["\\color"],{numArgs:1,allowedInText:true,greediness:3,argTypes:["color"]},null);v(["\\colorbox"],{numArgs:2,allowedInText:true,greediness:3,argTypes:["color","text"]},function(e,t){var r=t[0];var a=t[1];return{type:"enclose",label:e.funcName,backgroundColor:r,body:a}});v(["\\fcolorbox"],{numArgs:3,allowedInText:true,greediness:3,argTypes:["color","color","text"]},function(e,t){var r=t[0];var a=t[1];var n=t[2];return{type:"enclose",label:e.funcName,backgroundColor:a,borderColor:r,body:n}});v(["\\overline"],{numArgs:1},function(e,t){var r=t[0];return{type:"overline",body:r}});v(["\\underline"],{numArgs:1},function(e,t){var r=t[0];return{type:"underline",body:r}});v(["\\rule"],{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},function(e,t,r){var a=r[0];var n=t[0];var i=t[1];return{type:"rule",shift:a&&a.value,width:n.value,height:i.value}});v(["\\kern","\\mkern"],{numArgs:1,argTypes:["size"]},function(e,t){return{type:"kern",dimension:t[0].value}});v(["\\KaTeX"],{numArgs:0,allowedInText:true},function(e){return{type:"katex"}});v(["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],{numArgs:1},function(e,t){var r=t[0];return{type:"mclass",mclass:"m"+e.funcName.substr(5),value:(0,s.ordargument)(r)}});v(["\\stackrel"],{numArgs:2},function(e,t){var r=t[0];var a=t[1];var n=new u.default("op",{type:"op",limits:true,alwaysHandleSupSub:true,symbol:false,value:(0,s.ordargument)(a)},a.mode);var i=new u.default("supsub",{base:n,sup:r,sub:null},r.mode);return{type:"mclass",mclass:"mrel",value:[i]}});v(["\\bmod"],{numArgs:0},function(e,t){return{type:"mod",modType:"bmod",value:null}});v(["\\pod","\\pmod","\\mod"],{numArgs:1},function(e,t){var r=t[0];return{type:"mod",modType:e.funcName.substr(1),value:(0,s.ordargument)(r)}});var p={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};v(["\\blue","\\orange","\\pink","\\red","\\green","\\gray","\\purple","\\blueA","\\blueB","\\blueC","\\blueD","\\blueE","\\tealA","\\tealB","\\tealC","\\tealD","\\tealE","\\greenA","\\greenB","\\greenC","\\greenD","\\greenE","\\goldA","\\goldB","\\goldC","\\goldD","\\goldE","\\redA","\\redB","\\redC","\\redD","\\redE","\\maroonA","\\maroonB","\\maroonC","\\maroonD","\\maroonE","\\purpleA","\\purpleB","\\purpleC","\\purpleD","\\purpleE","\\mintA","\\mintB","\\mintC","\\grayA","\\grayB","\\grayC","\\grayD","\\grayE","\\grayF","\\grayG","\\grayH","\\grayI","\\kaBlue","\\kaGreen"],{numArgs:1,allowedInText:true,greediness:3},function(e,t){var r=t[0];return{type:"color",color:"katex-"+e.funcName.slice(1),value:(0,s.ordargument)(r)}});v(["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],{numArgs:0},function(e){return{type:"op",limits:false,symbol:false,body:e.funcName}});v(["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],{numArgs:0},function(e){return{type:"op",limits:true,symbol:false,body:e.funcName}});v(["\\int","\\iint","\\iiint","\\oint"],{numArgs:0},function(e){return{type:"op",limits:false,symbol:true,body:e.funcName}});v(["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint"],{numArgs:0},function(e){return{type:"op",limits:true,symbol:true,body:e.funcName}});v(["\\mathop"],{numArgs:1},function(e,t){var r=t[0];return{type:"op",limits:false,symbol:false,value:(0,s.ordargument)(r)}});v(["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac"],{numArgs:2,greediness:2},function(e,t){var r=t[0];var a=t[1];var n=void 0;var i=null;var l=null;var o="auto";switch(e.funcName){case"\\dfrac":case"\\frac":case"\\tfrac":n=true;break;case"\\\\atopfrac":n=false;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=false;i="(";l=")";break;default:throw new Error("Unrecognized genfrac command")}switch(e.funcName){case"\\dfrac":case"\\dbinom":o="display";break;case"\\tfrac":case"\\tbinom":o="text";break}return{type:"genfrac",numer:r,denom:a,hasBarLine:n,leftDelim:i,rightDelim:l,size:o}});v(["\\mathllap","\\mathrlap","\\mathclap"],{numArgs:1,allowedInText:true},function(e,t){var r=t[0];return{type:"lap",alignment:e.funcName.slice(5),body:r}});v(["\\smash"],{numArgs:1,numOptionalArgs:1,allowedInText:true},function(e,t,r){var a=false;var n=false;var i=r[0];if(i){var l="";for(var o=0;o<i.value.length;++o){l=i.value[o].value;if(l==="t"){a=true}else if(l==="b"){n=true}else{a=false;n=false;break}}}else{a=true;n=true}var u=t[0];return{type:"smash",body:u,smashHeight:a,smashDepth:n}});v(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],{numArgs:0},null);v(["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],{numArgs:0},null);v(["\\rm","\\sf","\\tt","\\bf","\\it"],{numArgs:0},null);v(["\\mathrm","\\mathit","\\mathbf","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],{numArgs:1,greediness:2},function(e,t){var r=t[0];var a=e.funcName;if(a in p){a=p[a]}return{type:"font",font:a.slice(1),body:r}});v(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],{numArgs:1},function(e,t){var r=t[0];var a=!n.default.contains(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot"],e.funcName);var i=!a||n.default.contains(["\\widehat","\\widetilde"],e.funcName);return{type:"accent",label:e.funcName,isStretchy:a,isShifty:i,base:r}});v(["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\r","\\H","\\v"],{numArgs:1,allowedInText:true,allowedInMath:false},function(e,t){var r=t[0];return{type:"accent",label:e.funcName,isStretchy:false,isShifty:true,base:r}});v(["\\overbrace","\\underbrace"],{numArgs:1},function(e,t){var r=t[0];return{type:"horizBrace",label:e.funcName,isOver:/^\\over/.test(e.funcName),base:r}});v(["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],{numArgs:1},function(e,t){var r=t[0];return{type:"accentUnder",label:e.funcName,base:r}});v(["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xLongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xLongequal","\\xtofrom"],{numArgs:1,numOptionalArgs:1},function(e,t,r){var a=r[0];var n=t[0];return{type:"xArrow",label:e.funcName,body:n,below:a}});v(["\\cancel","\\bcancel","\\xcancel","\\sout","\\fbox"],{numArgs:1},function(e,t){var r=t[0];return{type:"enclose",label:e.funcName,body:r}});v(["\\over","\\choose","\\atop"],{numArgs:0,infix:true},function(e){var t=void 0;switch(e.funcName){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",replaceWith:t,token:e.token}});v(["\\\\","\\cr"],{numArgs:0,numOptionalArgs:1,argTypes:["size"]},function(e,t,r){var a=r[0];return{type:"cr",size:a}});v(["\\begin","\\end"],{numArgs:1,argTypes:["text"]},function(e,t){var r=t[0];if(r.type!=="ordgroup"){throw new l.default("Invalid environment name",r)}var a="";for(var n=0;n<r.value.length;++n){a+=r.value[n].value}return{type:"environment",name:a,nameGroup:r}});v(["\\raisebox"],{numArgs:2,argTypes:["size","text"],allowedInText:true},function(e,t){var r=t[0];var a=t[1];return{type:"raisebox",dy:r,body:a,value:(0,s.ordargument)(a)}});v(["\\verb"],{numArgs:0,allowedInText:true},function(e){throw new l.default("\\verb ended by end of line instead of matching delimiter")})},{"./ParseError":84,"./ParseNode":85,"./defineFunction":96,"./functions/delimsizing":104,"./functions/operators":105,"./functions/phantom":106,"./utils":115}],104:[function(e,t,r){"use strict";var a=e("../buildCommon");var n=x(a);var i=e("../defineFunction");var l=x(i);var o=e("../delimiter");var u=x(o);var s=e("../mathMLTree");var f=x(s);var c=e("../ParseError");var d=x(c);var v=e("../utils");var h=x(v);var p=e("../buildHTML");var m=y(p);var g=e("../buildMathML");var b=y(g);function y(e){if(e&&e.__esModule){return e}else{var t={};if(e!=null){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}}t.default=e;return t}}function x(e){return e&&e.__esModule?e:{default:e}}var w={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};var k=["(",")","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","<",">","\\langle","\\rangle","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function M(e,t){if(h.default.contains(k,e.value)){return e}else{throw new d.default("Invalid delimiter: '"+e.value+"' after '"+t.funcName+"'",e)}}(0,l.default)({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1},handler:function e(t,r){var a=M(r[0],t);return{type:"delimsizing",size:w[t.funcName].size,mclass:w[t.funcName].mclass,value:a.value}},htmlBuilder:function e(t,r){var a=t.value.value;if(a==="."){return n.default.makeSpan([t.value.mclass])}return u.default.sizedDelim(a,t.value.size,r,t.mode,[t.value.mclass])},mathmlBuilder:function e(t){var r=[];if(t.value.value!=="."){r.push(b.makeText(t.value.value,t.mode))}var a=new f.default.MathNode("mo",r);if(t.value.mclass==="mopen"||t.value.mclass==="mclose"){a.setAttribute("fence","true")}else{a.setAttribute("fence","false")}return a}});(0,l.default)({type:"leftright",names:["\\left","\\right"],props:{numArgs:1},handler:function e(t,r){var a=M(r[0],t);return{type:"leftright",value:a.value}},htmlBuilder:function e(t,r){var a=m.buildExpression(t.value.body,r,true);var i=0;var l=0;var o=false;for(var s=0;s<a.length;s++){if(a[s].isMiddle){o=true}else{i=Math.max(a[s].height,i);l=Math.max(a[s].depth,l)}}i*=r.sizeMultiplier;l*=r.sizeMultiplier;var f=void 0;if(t.value.left==="."){f=m.makeNullDelimiter(r,["mopen"])}else{f=u.default.leftRightDelim(t.value.left,i,l,r,t.mode,["mopen"])}a.unshift(f);if(o){for(var c=1;c<a.length;c++){var d=a[c];if(d.isMiddle){a[c]=u.default.leftRightDelim(d.isMiddle.value,i,l,d.isMiddle.options,t.mode,[]);var v=m.spliceSpaces(d.children,0);if(v){n.default.prependChildren(a[c],v)}}}}var h=void 0;if(t.value.right==="."){h=m.makeNullDelimiter(r,["mclose"])}else{h=u.default.leftRightDelim(t.value.right,i,l,r,t.mode,["mclose"])}a.push(h);return n.default.makeSpan(["minner"],a,r)},mathmlBuilder:function e(t,r){var a=b.buildExpression(t.value.body,r);if(t.value.left!=="."){var n=new f.default.MathNode("mo",[b.makeText(t.value.left,t.mode)]);n.setAttribute("fence","true");a.unshift(n)}if(t.value.right!=="."){var i=new f.default.MathNode("mo",[b.makeText(t.value.right,t.mode)]);i.setAttribute("fence","true");a.push(i)}var l=new f.default.MathNode("mrow",a);return l}});(0,l.default)({type:"middle",names:["\\middle"],props:{numArgs:1},handler:function e(t,r){var a=M(r[0],t);if(!t.parser.leftrightDepth){throw new d.default("\\middle without preceding \\left",a)}return{type:"middle",value:a.value}},htmlBuilder:function e(t,r){var a=void 0;if(t.value.value==="."){a=m.makeNullDelimiter(r,[])}else{a=u.default.sizedDelim(t.value.value,1,r,t.mode,[]);a.isMiddle={value:t.value.value,options:r}}return a},mathmlBuilder:function e(t,r){var a=new f.default.MathNode("mo",[b.makeText(t.value.middle,t.mode)]);a.setAttribute("fence","true");return a}})},{"../ParseError":84,"../buildCommon":91,"../buildHTML":92,"../buildMathML":93,"../defineFunction":96,"../delimiter":97,"../mathMLTree":108,"../utils":115}],105:[function(e,t,r){"use strict";var a=e("../defineFunction");var n=b(a);var i=e("../buildCommon");var l=b(i);var o=e("../mathMLTree");var u=b(o);var s=e("../domTree");var f=b(s);var c=e("../utils");var d=b(c);var v=e("../buildHTML");var h=g(v);var p=e("../buildMathML");var m=g(p);function g(e){if(e&&e.__esModule){return e}else{var t={};if(e!=null){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}}t.default=e;return t}}function b(e){return e&&e.__esModule?e:{default:e}}(0,n.default)({type:"operatorname",names:["\\operatorname"],props:{numArgs:1},handler:function e(t,r){var n=r[0];return{type:"operatorname",value:(0,a.ordargument)(n)}},htmlBuilder:function e(t,r){var a=[];if(t.value.value.length>0){var n="";var i="";var o=h.buildExpression(t.value.value,r.withFont("mathrm"),true);for(var u=0;u<o.length;u++){var s=o[u];if(s instanceof f.default.symbolNode){n=s.value;n=n.replace(/\u2212/,"-");n=n.replace(/\u2217/,"*");i=/[\u0391-\u03D7]/.test(n)?"math":"text";a.push(l.default.mathsym(n,i))}else{a.push(s)}}}var c=l.default.makeSpan(["mop"],a,r);return c},mathmlBuilder:function e(t,r){var a=[];if(t.value.value.length>0){var n=m.buildExpression(t.value.value,r.withFont("mathrm"));var i="";for(var l=0;l<n.length;l++){if(d.default.contains(["mi","mn","mo"],n[l].type)){i+=n[l].children[0].text}else if(n[l].type==="mspace"){if(t.value.value[l].value==="\\,"){i+="\u2006"}else{i+=" "}}else{if(n[l].lexer){var o=n[l].lexer.pos;throw new Error("unrecognized group in \\operatorname at "+o)}}}i=i.replace(/\u2212/g,"-");i=i.replace(/\u2217/g,"*");a=[new u.default.TextNode(i)]}var s=new u.default.MathNode("mi",a);s.setAttribute("mathvariant","normal");var c=new u.default.MathNode("mo",[m.makeText("&ApplyFunction;","text")]);return new f.default.documentFragment([s,c])}})},{"../buildCommon":91,"../buildHTML":92,"../buildMathML":93,"../defineFunction":96,"../domTree":98,"../mathMLTree":108,"../utils":115}],106:[function(e,t,r){"use strict";var a=e("../defineFunction");var n=h(a);var i=e("../buildCommon");var l=h(i);var o=e("../mathMLTree");var u=h(o);var s=e("../buildHTML");var f=v(s);var c=e("../buildMathML");var d=v(c);function v(e){if(e&&e.__esModule){return e}else{var t={};if(e!=null){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}}t.default=e;return t}}function h(e){return e&&e.__esModule?e:{default:e}}(0,n.default)({type:"phantom",names:["\\phantom"],props:{numArgs:1},handler:function e(t,r){var n=r[0];return{type:"phantom",value:(0,a.ordargument)(n)}},htmlBuilder:function e(t,r){var a=f.buildExpression(t.value.value,r.withPhantom(),false);return new l.default.makeFragment(a)},mathmlBuilder:function e(t,r){var a=d.buildExpression(t.value.value,r);return new u.default.MathNode("mphantom",a)}});(0,n.default)({type:"hphantom",names:["\\hphantom"],props:{numArgs:1},handler:function e(t,r){var n=r[0];return{type:"hphantom",value:(0,a.ordargument)(n),body:n}},htmlBuilder:function e(t,r){var a=l.default.makeSpan([],[f.buildGroup(t.value.body,r.withPhantom())]);a.height=0;a.depth=0;if(a.children){for(var n=0;n<a.children.length;n++){a.children[n].height=0;a.children[n].depth=0}}a=l.default.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a}]},r);return a},mathmlBuilder:function e(t,r){var a=d.buildExpression(t.value.value,r);var n=new u.default.MathNode("mphantom",a);n.setAttribute("height","0px");return n}});(0,n.default)({type:"vphantom",names:["\\vphantom"],props:{numArgs:1},handler:function e(t,r){var n=r[0];return{type:"vphantom",value:(0,a.ordargument)(n),body:n}},htmlBuilder:function e(t,r){var a=l.default.makeSpan(["inner"],[f.buildGroup(t.value.body,r.withPhantom())]);var n=l.default.makeSpan(["fix"],[]);return l.default.makeSpan(["mord","rlap"],[a,n],r)},mathmlBuilder:function e(t,r){var a=d.buildExpression(t.value.value,r);var n=new u.default.MathNode("mphantom",a);n.setAttribute("width","0px");return n}})},{"../buildCommon":91,"../buildHTML":92,"../buildMathML":93,"../defineFunction":96,"../mathMLTree":108}],107:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("./symbols");var n=u(a);var i=e("./utils");var l=u(i);var o=e("./Token");function u(e){return e&&e.__esModule?e:{default:e}}var s={};r.default=s;function f(e,t){s[e]=t}f("\\bgroup","{");f("\\egroup","}");f("\\begingroup","{");f("\\endgroup","}");f("\u2102","\\mathbb{C}");f("\u210d","\\mathbb{H}");f("\u2115","\\mathbb{N}");f("\u2119","\\mathbb{P}");f("\u211a","\\mathbb{Q}");f("\u211d","\\mathbb{R}");f("\u2124","\\mathbb{Z}");f("\\mkern","\\kern");f("\\llap","\\mathllap{\\textrm{#1}}");f("\\rlap","\\mathrlap{\\textrm{#1}}");f("\\clap","\\mathclap{\\textrm{#1}}");f("\\overset","\\mathop{#2}\\limits^{#1}");f("\\underset","\\mathop{#2}\\limits_{#1}");f("\\boxed","\\fbox{\\displaystyle{#1}}");f("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");f("\\implies","\\DOTSB\\;\\Longrightarrow\\;");f("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var c={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\implies":"\\dotsb","\\impliedby":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\iff":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\bmod":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};f("\\dots",function(e){var t="\\dotso";var r=e.expandAfterFuture().text;if(r in c){t=c[r]}else if(r.substr(0,4)==="\\not"){t="\\dotsb"}else if(r in n.default.math){if(l.default.contains(["bin","rel"],n.default.math[r].group)){t="\\dotsb"}}return t});var d={")":true,"]":true,"\\rbrack":true,"\\}":true,"\\rbrace":true,"\\rangle":true,"\\rceil":true,"\\rfloor":true,"\\rgroup":true,"\\rmoustache":true,"\\right":true,"\\bigr":true,"\\biggr":true,"\\Bigr":true,"\\Biggr":true,$:true,";":true,".":true,",":true};f("\\dotso",function(e){var t=e.future().text;if(t in d){return"\\ldots\\,"}else{return"\\ldots"}});f("\\dotsc",function(e){var t=e.future().text;if(t in d&&t!==","){return"\\ldots\\,"}else{return"\\ldots"}});f("\\cdots",function(e){var t=e.future().text;if(t in d){return"\\@cdots\\,"}else{return"\\@cdots"}});f("\\dotsb","\\cdots");f("\\dotsm","\\cdots");f("\\dotsi","\\!\\cdots");f("\\dotsx","\\ldots\\,");f("\\DOTSI","\\relax");f("\\DOTSB","\\relax");f("\\DOTSX","\\relax");f("\\thinspace","\\,");f("\\medspace","\\:");f("\\thickspace","\\;");f("\\hspace","\\kern{#1}");f("\\ordinarycolon",":");f("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");f("\\dblcolon","\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon");f("\\coloneqq","\\vcentcolon\\mathrel{\\mkern-1.2mu}=");f("\\Coloneqq","\\dblcolon\\mathrel{\\mkern-1.2mu}=");f("\\coloneq","\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}");f("\\Coloneq","\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}");f("\\eqqcolon","=\\mathrel{\\mkern-1.2mu}\\vcentcolon");f("\\Eqqcolon","=\\mathrel{\\mkern-1.2mu}\\dblcolon");f("\\eqcolon","\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon");f("\\Eqcolon","\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon");f("\\colonapprox","\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx");f("\\Colonapprox","\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx");f("\\colonsim","\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim");f("\\Colonsim","\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim");f("\\ratio","\\vcentcolon");f("\\coloncolon","\\dblcolon");f("\\colonequals","\\coloneqq");f("\\coloncolonequals","\\Coloneqq");f("\\equalscolon","\\eqqcolon");f("\\equalscoloncolon","\\Eqqcolon");f("\\colonminus","\\coloneq");f("\\coloncolonminus","\\Coloneq");f("\\minuscolon","\\eqcolon");f("\\minuscoloncolon","\\Eqcolon");f("\\coloncolonapprox","\\Colonapprox");f("\\coloncolonsim","\\Colonsim");f("\\simcolon","\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon");f("\\simcoloncolon","\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon");f("\\approxcolon","\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon");f("\\approxcoloncolon","\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon");f("\\limsup","\\DOTSB\\mathop{\\operatorname{lim\\,sup}}\\limits");f("\\liminf","\\DOTSB\\mathop{\\operatorname{lim\\,inf}}\\limits")},{"./Token":90,"./symbols":112,"./utils":115}],108:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("babel-runtime/helpers/classCallCheck");var n=s(a);var i=e("babel-runtime/helpers/createClass");var l=s(i);var o=e("./utils");var u=s(o);function s(e){return e&&e.__esModule?e:{default:e}}var f=function(){function e(t,r){(0,n.default)(this,e);this.type=t;this.attributes={};this.children=r||[]}(0,l.default)(e,[{key:"setAttribute",value:function e(t,r){this.attributes[t]=r}},{key:"toNode",value:function e(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes){if(Object.prototype.hasOwnProperty.call(this.attributes,r)){t.setAttribute(r,this.attributes[r])}}for(var a=0;a<this.children.length;a++){t.appendChild(this.children[a].toNode())}return t}},{key:"toMarkup",value:function e(){var t="<"+this.type;for(var r in this.attributes){if(Object.prototype.hasOwnProperty.call(this.attributes,r)){t+=" "+r+'="';t+=u.default.escape(this.attributes[r]);t+='"'}}t+=">";for(var a=0;a<this.children.length;a++){t+=this.children[a].toMarkup()}t+="</"+this.type+">";return t}}]);return e}();var c=function(){function e(t){(0,n.default)(this,e);this.text=t}(0,l.default)(e,[{key:"toNode",value:function e(){return document.createTextNode(this.text)}},{key:"toMarkup",value:function e(){return u.default.escape(this.text)}}]);return e}();r.default={MathNode:f,TextNode:c}},{"./utils":115,"babel-runtime/helpers/classCallCheck":8,"babel-runtime/helpers/createClass":9}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("./Parser");var n=i(a);function i(e){return e&&e.__esModule?e:{default:e}}var l=function e(t,r){if(!(typeof t==="string"||t instanceof String)){throw new TypeError("KaTeX can only parse string typed expression")}var a=new n.default(t,r);return a.parse()};r.default=l},{"./Parser":86}],110:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=e("babel-runtime/helpers/slicedToArray");var n=v(a);var i=e("./domTree");var l=v(i);var o=e("./buildCommon");var u=v(o);var s=e("./mathMLTree");var f=v(s);var c=e("./utils");var d=v(c);function v(e){return e&&e.__esModule?e:{default:e}}var h={widehat:"^",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23b5",overbrace:"\u23de",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21d2",xRightarrow:"\u21d2",overleftharpoon:"\u21bc",xleftharpoonup:"\u21bc",overrightharpoon:"\u21c0",xrightharpoonup:"\u21c0",xLeftarrow:"\u21d0",xLeftrightarrow:"\u21d4",xhookleftarrow:"\u21a9",xhookrightarrow:"\u21aa",xmapsto:"\u21a6",xrightharpoondown:"\u21c1",xleftharpoondown:"\u21bd",xrightleftharpoons:"\u21cc",xleftrightharpoons:"\u21cb",xtwoheadleftarrow:"\u219e",xtwoheadrightarrow:"\u21a0",xLongequal:"=",xtofrom:"\u21c4"};var p=function e(t){var r=new f.default.MathNode("mo",[new f.default.TextNode(h[t.substr(1)])]);r.setAttribute("stretchy","true");return r};var m={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xLongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528]};var g=function e(t){if(t.type==="ordgroup"){return t.value.length}else{return 1}};var b=function e(t,r){var a=t.value.label.substr(1);var i=[];var o=void 0;var s=4e5;var f=0;var c=0;var v=void 0;var h=void 0;var p=void 0;var b=void 0;var y=void 0;if(d.default.contains(["widehat","widetilde","utilde"],a)){var x=g(t.value.base);var w=void 0;if(x>5){w=a==="widehat"?420:312;s=a==="widehat"?2364:2340;o=a==="widehat"?.42:.34;p=(a==="widehat"?"widehat":"tilde")+"4"}else{var k=[1,1,2,2,3,3][x];if(a==="widehat"){s=[0,1062,2364,2364,2364][k];w=[0,239,300,360,420][k];o=[0,.24,.3,.3,.36,.42][k];p="widehat"+k}else{s=[0,600,1033,2339,2340][k];w=[0,260,286,306,312][k];o=[0,.26,.286,.3,.306,.34][k];p="tilde"+k}}v=new l.default.pathNode(p);i.push(["width","100%"]);i.push(["height",o+"em"]);i.push(["viewBox","0 0 "+s+" "+w]);i.push(["preserveAspectRatio","none"]);b=new l.default.svgNode([v],i);y=u.default.makeSpan([],[b],r)}else{var M=void 0;var _=void 0;var z=[];var S=(0,n.default)(m[a],4);h=S[0];c=S[1];f=S[2];_=S[3];var T=h.length;o=f/1e3;for(var A=0;A<T;A++){v=new l.default.pathNode(h[A]);i=[["width","400em"],["height",o+"em"]];i.push(["viewBox","0 0 "+s+" "+f]);if(T===2){M=["halfarrow-left","halfarrow-right"][A];_=["xMinYMin","xMaxYMin"][A]}else if(T===3){M=["brace-left","brace-center","brace-right"][A];_=["xMinYMin","xMidYMin","xMaxYMin"][A]}i.push(["preserveAspectRatio",_+" slice"]);b=new l.default.svgNode([v],i);if(T===1){y=u.default.makeSpan(["hide-tail"],[b],r)}else{y=u.default.makeSpan([M],[b],r);y.style.height=o+"em";z.push(y)}}if(T>1){y=u.default.makeSpan(["stretchy"],z,r)}}y.height=o;y.style.height=o+"em";if(c>0){y.style.minWidth=c+"em"}return y};var y=function e(t,r,a,n){var i=void 0;var o=t.height+t.depth+2*a;if(/(fbox)|(color)/.test(r)){i=u.default.makeSpan(["stretchy",r],[],n);if(r==="fbox"&&n.color){i.style.borderColor=n.getColor()}}else{var s=[["x1","0"]];var f=[];if(r!=="cancel"){s.push(["y1","0"]);s.push(["x2","100%"]);s.push(["y2","100%"]);s.push(["stroke-width","0.046em"]);f.push(new l.default.lineNode(s))}if(r==="xcancel"){s=[["x1","0"]]}if(r!=="bcancel"){s.push(["y1","100%"]);s.push(["x2","100%"]);s.push(["y2","0"]);s.push(["stroke-width","0.046em"]);f.push(new l.default.lineNode(s))}s=[["width","100%"],["height",o+"em"]];var c=new l.default.svgNode(f,s);i=u.default.makeSpan([],[c],n)}i.height=o;i.style.height=o+"em";return i};r.default={encloseSpan:y,mathMLnode:p,svgSpan:b}},{"./buildCommon":91,"./domTree":98,"./mathMLTree":108,"./utils":115,"babel-runtime/helpers/slicedToArray":10}],111:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a={sqrtMain:"M95 622c-2.667 0-7.167-2.667-13.5\n-8S72 604 72 600c0-2 .333-3.333 1-4 1.333-2.667 23.833-20.667 67.5-54s\n65.833-50.333 66.5-51c1.333-1.333 3-2 5-2 4.667 0 8.667 3.333 12 10l173\n378c.667 0 35.333-71 104-213s137.5-285 206.5-429S812 17.333 812 14c5.333\n-9.333 12-14 20-14h399166v40H845.272L620 507 385 993c-2.667 4.667-9 7-19\n7-6 0-10-1-12-3L160 575l-65 47zM834 0h399166v40H845z",sqrtSize1:"M263 601c.667 0 18 39.667 52 119s68.167\n 158.667 102.5 238 51.833 119.333 52.5 120C810 373.333 980.667 17.667 982 11\nc4.667-7.333 11-11 19-11h398999v40H1012.333L741 607c-38.667 80.667-84 175-136\n 283s-89.167 185.333-111.5 232-33.833 70.333-34.5 71c-4.667 4.667-12.333 7-23\n 7l-12-1-109-253c-72.667-168-109.333-252-110-252-10.667 8-22 16.667-34 26-22\n 17.333-33.333 26-34 26l-26-26 76-59 76-60zM1001 0h398999v40H1012z",sqrtSize2:"M1001 0h398999v40H1013.084S929.667 308 749\n 880s-277 876.333-289 913c-4.667 4.667-12.667 7-24 7h-12c-1.333-3.333-3.667\n-11.667-7-25-35.333-125.333-106.667-373.333-214-744-10 12-21 25-33 39l-32 39\nc-6-5.333-15-14-27-26l25-30c26.667-32.667 52-63 76-91l52-60 208 722c56-175.333\n 126.333-397.333 211-666s153.833-488.167 207.5-658.5C944.167 129.167 975 32.667\n 983 10c4-6.667 10-10 18-10zm0 0h398999v40H1013z",sqrtSize3:"M424 2398c-1.333-.667-38.5-172-111.5-514 S202.667 1370.667 202\n 1370c0-2-10.667 14.333-32 49-4.667 7.333-9.833 15.667-15.5 25s-9.833 16-12.5\n 20l-5 7c-4-3.333-8.333-7.667-13-13l-13-13 76-122 77-121 209 968c0-2 84.667\n-361.667 254-1079C896.333 373.667 981.667 13.333 983 10c4-6.667 10-10 18-10\nh398999v40H1014.622S927.332 418.667 742 1206c-185.333 787.333-279.333 1182.333\n-282 1185-2 6-10 9-24 9-8 0-12-.667-12-2zM1001 0h398999v40H1014z",sqrtSize4:"M473 2713C812.333 913.667 982.333 13 983 11c3.333-7.333 9.333\n-11 18-11h399110v40H1017.698S927.168 518 741.5 1506C555.833 2494 462 2989 460\n 2991c-2 6-10 9-24 9-8 0-12-.667-12-2s-5.333-32-16-92c-50.667-293.333-119.667\n-693.333-207-1200 0-1.333-5.333 8.667-16 30l-32 64-16 33-26-26 76-153 77-151\nc.667.667 35.667 202 105 604 67.333 400.667 102 602.667 104 606z\nM1001 0h398999v40H1017z",doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z"};r.default={path:a}},{}],112:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a={math:{},text:{}};r.default=a;function n(e,t,r,n,i,l){a[e][i]={font:t,group:r,replace:n};if(l&&n){a[e][n]=a[e][i]}}var i="math";var l="text";var o="main";var u="ams";var s="accent";var f="bin";var c="close";var d="inner";var v="mathord";var h="op";var p="open";var m="punct";var g="rel";var b="spacing";var y="textord";n(i,o,g,"\u2261","\\equiv",true);n(i,o,g,"\u227a","\\prec",true);n(i,o,g,"\u227b","\\succ",true);n(i,o,g,"\u223c","\\sim",true);n(i,o,g,"\u22a5","\\perp");n(i,o,g,"\u2aaf","\\preceq",true);n(i,o,g,"\u2ab0","\\succeq",true);n(i,o,g,"\u2243","\\simeq",true);n(i,o,g,"\u2223","\\mid");n(i,o,g,"\u226a","\\ll");n(i,o,g,"\u226b","\\gg",true);n(i,o,g,"\u224d","\\asymp",true);n(i,o,g,"\u2225","\\parallel");n(i,o,g,"\u22c8","\\bowtie",true);n(i,o,g,"\u2323","\\smile",true);n(i,o,g,"\u2291","\\sqsubseteq",true);n(i,o,g,"\u2292","\\sqsupseteq",true);n(i,o,g,"\u2250","\\doteq",true);n(i,o,g,"\u2322","\\frown",true);n(i,o,g,"\u220b","\\ni",true);n(i,o,g,"\u221d","\\propto",true);n(i,o,g,"\u22a2","\\vdash",true);n(i,o,g,"\u22a3","\\dashv",true);n(i,o,g,"\u220b","\\owns");n(i,o,m,".","\\ldotp");n(i,o,m,"\u22c5","\\cdotp");n(i,o,y,"#","\\#");n(l,o,y,"#","\\#");n(i,o,y,"&","\\&");n(l,o,y,"&","\\&");n(i,o,y,"\u2135","\\aleph",true);n(i,o,y,"\u2200","\\forall",true);n(i,o,y,"\u210f","\\hbar");n(i,o,y,"\u2203","\\exists",true);n(i,o,y,"\u2207","\\nabla",true);n(i,o,y,"\u266d","\\flat",true);n(i,o,y,"\u2113","\\ell",true);n(i,o,y,"\u266e","\\natural",true);n(i,o,y,"\u2663","\\clubsuit",true);n(i,o,y,"\u2118","\\wp",true);n(i,o,y,"\u266f","\\sharp",true);n(i,o,y,"\u2662","\\diamondsuit",true);n(i,o,y,"\u211c","\\Re",true);n(i,o,y,"\u2661","\\heartsuit",true);n(i,o,y,"\u2111","\\Im",true);n(i,o,y,"\u2660","\\spadesuit",true);n(i,o,y,"\u2020","\\dag");n(l,o,y,"\u2020","\\dag");n(l,o,y,"\u2020","\\textdagger");n(i,o,y,"\u2021","\\ddag");n(l,o,y,"\u2021","\\ddag");n(l,o,y,"\u2020","\\textdaggerdbl");n(i,o,c,"\u23b1","\\rmoustache");n(i,o,p,"\u23b0","\\lmoustache");n(i,o,c,"\u27ef","\\rgroup");n(i,o,p,"\u27ee","\\lgroup");n(i,o,f,"\u2213","\\mp",true);n(i,o,f,"\u2296","\\ominus",true);n(i,o,f,"\u228e","\\uplus",true);n(i,o,f,"\u2293","\\sqcap",true);n(i,o,f,"\u2217","\\ast");n(i,o,f,"\u2294","\\sqcup",true);n(i,o,f,"\u25ef","\\bigcirc");n(i,o,f,"\u2219","\\bullet");n(i,o,f,"\u2021","\\ddagger");n(i,o,f,"\u2240","\\wr",true);n(i,o,f,"\u2a3f","\\amalg");n(i,o,f,"&","\\And");n(i,o,g,"\u27f5","\\longleftarrow",true);n(i,o,g,"\u21d0","\\Leftarrow",true);n(i,o,g,"\u27f8","\\Longleftarrow",true);n(i,o,g,"\u27f6","\\longrightarrow",true);n(i,o,g,"\u21d2","\\Rightarrow",true);n(i,o,g,"\u27f9","\\Longrightarrow",true);n(i,o,g,"\u2194","\\leftrightarrow",true);n(i,o,g,"\u27f7","\\longleftrightarrow",true);n(i,o,g,"\u21d4","\\Leftrightarrow",true);n(i,o,g,"\u27fa","\\Longleftrightarrow",true);n(i,o,g,"\u21a6","\\mapsto",true);n(i,o,g,"\u27fc","\\longmapsto",true);n(i,o,g,"\u2197","\\nearrow",true);n(i,o,g,"\u21a9","\\hookleftarrow",true);n(i,o,g,"\u21aa","\\hookrightarrow",true);n(i,o,g,"\u2198","\\searrow",true);n(i,o,g,"\u21bc","\\leftharpoonup",true);n(i,o,g,"\u21c0","\\rightharpoonup",true);n(i,o,g,"\u2199","\\swarrow",true);n(i,o,g,"\u21bd","\\leftharpoondown",true);n(i,o,g,"\u21c1","\\rightharpoondown",true);n(i,o,g,"\u2196","\\nwarrow",true);n(i,o,g,"\u21cc","\\rightleftharpoons",true);n(i,u,g,"\u226e","\\nless",true);n(i,u,g,"\ue010","\\nleqslant");n(i,u,g,"\ue011","\\nleqq");n(i,u,g,"\u2a87","\\lneq",true);n(i,u,g,"\u2268","\\lneqq",true);n(i,u,g,"\ue00c","\\lvertneqq");n(i,u,g,"\u22e6","\\lnsim",true);n(i,u,g,"\u2a89","\\lnapprox",true);n(i,u,g,"\u2280","\\nprec",true);n(i,u,g,"\u22e0","\\npreceq",true);n(i,u,g,"\u22e8","\\precnsim",true);n(i,u,g,"\u2ab9","\\precnapprox",true);n(i,u,g,"\u2241","\\nsim",true);n(i,u,g,"\ue006","\\nshortmid");n(i,u,g,"\u2224","\\nmid",true);n(i,u,g,"\u22ac","\\nvdash",true);n(i,u,g,"\u22ad","\\nvDash",true);n(i,u,g,"\u22ea","\\ntriangleleft");n(i,u,g,"\u22ec","\\ntrianglelefteq",true);n(i,u,g,"\u228a","\\subsetneq",true);n(i,u,g,"\ue01a","\\varsubsetneq");n(i,u,g,"\u2acb","\\subsetneqq",true);n(i,u,g,"\ue017","\\varsubsetneqq");n(i,u,g,"\u226f","\\ngtr",true);n(i,u,g,"\ue00f","\\ngeqslant");n(i,u,g,"\ue00e","\\ngeqq");n(i,u,g,"\u2a88","\\gneq",true);n(i,u,g,"\u2269","\\gneqq",true);n(i,u,g,"\ue00d","\\gvertneqq");n(i,u,g,"\u22e7","\\gnsim",true);n(i,u,g,"\u2a8a","\\gnapprox",true);n(i,u,g,"\u2281","\\nsucc",true);n(i,u,g,"\u22e1","\\nsucceq",true);n(i,u,g,"\u22e9","\\succnsim",true);n(i,u,g,"\u2aba","\\succnapprox",true);n(i,u,g,"\u2246","\\ncong",true);n(i,u,g,"\ue007","\\nshortparallel");n(i,u,g,"\u2226","\\nparallel",true);n(i,u,g,"\u22af","\\nVDash",true);n(i,u,g,"\u22eb","\\ntriangleright");n(i,u,g,"\u22ed","\\ntrianglerighteq",true);n(i,u,g,"\ue018","\\nsupseteqq");n(i,u,g,"\u228b","\\supsetneq",true);n(i,u,g,"\ue01b","\\varsupsetneq");n(i,u,g,"\u2acc","\\supsetneqq",true);n(i,u,g,"\ue019","\\varsupsetneqq");n(i,u,g,"\u22ae","\\nVdash",true);n(i,u,g,"\u2ab5","\\precneqq",true);n(i,u,g,"\u2ab6","\\succneqq",true);n(i,u,g,"\ue016","\\nsubseteqq");n(i,u,f,"\u22b4","\\unlhd");n(i,u,f,"\u22b5","\\unrhd");n(i,u,g,"\u219a","\\nleftarrow",true);n(i,u,g,"\u219b","\\nrightarrow",true);n(i,u,g,"\u21cd","\\nLeftarrow",true);n(i,u,g,"\u21cf","\\nRightarrow",true);n(i,u,g,"\u21ae","\\nleftrightarrow",true);n(i,u,g,"\u21ce","\\nLeftrightarrow",true);n(i,u,g,"\u25b3","\\vartriangle");n(i,u,y,"\u210f","\\hslash");n(i,u,y,"\u25bd","\\triangledown");n(i,u,y,"\u25ca","\\lozenge");n(i,u,y,"\u24c8","\\circledS");n(i,u,y,"\xae","\\circledR");n(l,u,y,"\xae","\\circledR");n(i,u,y,"\u2221","\\measuredangle",true);n(i,u,y,"\u2204","\\nexists");n(i,u,y,"\u2127","\\mho");n(i,u,y,"\u2132","\\Finv",true);n(i,u,y,"\u2141","\\Game",true);n(i,u,y,"k","\\Bbbk");n(i,u,y,"\u2035","\\backprime");n(i,u,y,"\u25b2","\\blacktriangle");n(i,u,y,"\u25bc","\\blacktriangledown");n(i,u,y,"\u25a0","\\blacksquare");n(i,u,y,"\u29eb","\\blacklozenge");n(i,u,y,"\u2605","\\bigstar");n(i,u,y,"\u2222","\\sphericalangle",true);n(i,u,y,"\u2201","\\complement",true);n(i,u,y,"\xf0","\\eth",true);n(i,u,y,"\u2571","\\diagup");n(i,u,y,"\u2572","\\diagdown");n(i,u,y,"\u25a1","\\square");n(i,u,y,"\u25a1","\\Box");n(i,u,y,"\u25ca","\\Diamond");n(i,u,y,"\xa5","\\yen",true);n(i,u,y,"\u2713","\\checkmark",true);n(l,u,y,"\u2713","\\checkmark");n(i,u,y,"\u2136","\\beth",true);n(i,u,y,"\u2138","\\daleth",true);n(i,u,y,"\u2137","\\gimel",true);n(i,u,y,"\u03dd","\\digamma");n(i,u,y,"\u03f0","\\varkappa");n(i,u,p,"\u250c","\\ulcorner");n(i,u,c,"\u2510","\\urcorner");n(i,u,p,"\u2514","\\llcorner");n(i,u,c,"\u2518","\\lrcorner");n(i,u,g,"\u2266","\\leqq",true);n(i,u,g,"\u2a7d","\\leqslant");n(i,u,g,"\u2a95","\\eqslantless",true);n(i,u,g,"\u2272","\\lesssim");n(i,u,g,"\u2a85","\\lessapprox");n(i,u,g,"\u224a","\\approxeq",true);n(i,u,f,"\u22d6","\\lessdot");n(i,u,g,"\u22d8","\\lll");n(i,u,g,"\u2276","\\lessgtr");n(i,u,g,"\u22da","\\lesseqgtr");n(i,u,g,"\u2a8b","\\lesseqqgtr");n(i,u,g,"\u2251","\\doteqdot");n(i,u,g,"\u2253","\\risingdotseq",true);n(i,u,g,"\u2252","\\fallingdotseq",true);n(i,u,g,"\u223d","\\backsim",true);n(i,u,g,"\u22cd","\\backsimeq",true);n(i,u,g,"\u2ac5","\\subseteqq",true);n(i,u,g,"\u22d0","\\Subset",true);n(i,u,g,"\u228f","\\sqsubset",true);n(i,u,g,"\u227c","\\preccurlyeq",true);n(i,u,g,"\u22de","\\curlyeqprec",true);n(i,u,g,"\u227e","\\precsim",true);n(i,u,g,"\u2ab7","\\precapprox",true);n(i,u,g,"\u22b2","\\vartriangleleft");n(i,u,g,"\u22b4","\\trianglelefteq");n(i,u,g,"\u22a8","\\vDash");n(i,u,g,"\u22aa","\\Vvdash",true);n(i,u,g,"\u2323","\\smallsmile");n(i,u,g,"\u2322","\\smallfrown");n(i,u,g,"\u224f","\\bumpeq",true);n(i,u,g,"\u224e","\\Bumpeq",true);n(i,u,g,"\u2267","\\geqq",true);n(i,u,g,"\u2a7e","\\geqslant",true);n(i,u,g,"\u2a96","\\eqslantgtr",true);n(i,u,g,"\u2273","\\gtrsim",true);n(i,u,g,"\u2a86","\\gtrapprox",true);n(i,u,f,"\u22d7","\\gtrdot");n(i,u,g,"\u22d9","\\ggg",true);n(i,u,g,"\u2277","\\gtrless",true);n(i,u,g,"\u22db","\\gtreqless",true);n(i,u,g,"\u2a8c","\\gtreqqless",true);n(i,u,g,"\u2256","\\eqcirc",true);n(i,u,g,"\u2257","\\circeq",true);n(i,u,g,"\u225c","\\triangleq",true);n(i,u,g,"\u223c","\\thicksim");n(i,u,g,"\u2248","\\thickapprox");n(i,u,g,"\u2ac6","\\supseteqq",true);n(i,u,g,"\u22d1","\\Supset",true);n(i,u,g,"\u2290","\\sqsupset",true);n(i,u,g,"\u227d","\\succcurlyeq",true);n(i,u,g,"\u22df","\\curlyeqsucc",true);n(i,u,g,"\u227f","\\succsim",true);n(i,u,g,"\u2ab8","\\succapprox",true);n(i,u,g,"\u22b3","\\vartriangleright");n(i,u,g,"\u22b5","\\trianglerighteq");n(i,u,g,"\u22a9","\\Vdash",true);n(i,u,g,"\u2223","\\shortmid");n(i,u,g,"\u2225","\\shortparallel");n(i,u,g,"\u226c","\\between",true);n(i,u,g,"\u22d4","\\pitchfork",true);n(i,u,g,"\u221d","\\varpropto");n(i,u,g,"\u25c0","\\blacktriangleleft");n(i,u,g,"\u2234","\\therefore");n(i,u,g,"\u220d","\\backepsilon");n(i,u,g,"\u25b6","\\blacktriangleright");n(i,u,g,"\u2235","\\because");n(i,u,g,"\u22d8","\\llless");n(i,u,g,"\u22d9","\\gggtr");n(i,u,f,"\u22b2","\\lhd");n(i,u,f,"\u22b3","\\rhd");n(i,u,g,"\u2242","\\eqsim",true);n(i,o,g,"\u22c8","\\Join");n(i,u,g,"\u2251","\\Doteq",true);n(i,u,f,"\u2214","\\dotplus",true);n(i,u,f,"\u2216","\\smallsetminus");n(i,u,f,"\u22d2","\\Cap",true);n(i,u,f,"\u22d3","\\Cup",true);n(i,u,f,"\u2a5e","\\doublebarwedge",true);n(i,u,f,"\u229f","\\boxminus",true);n(i,u,f,"\u229e","\\boxplus",true);n(i,u,f,"\u22c7","\\divideontimes",true);n(i,u,f,"\u22c9","\\ltimes",true);n(i,u,f,"\u22ca","\\rtimes",true);n(i,u,f,"\u22cb","\\leftthreetimes",true);n(i,u,f,"\u22cc","\\rightthreetimes",true);n(i,u,f,"\u22cf","\\curlywedge",true);n(i,u,f,"\u22ce","\\curlyvee",true);n(i,u,f,"\u229d","\\circleddash",true);n(i,u,f,"\u229b","\\circledast",true);n(i,u,f,"\u22c5","\\centerdot");n(i,u,f,"\u22ba","\\intercal",true);n(i,u,f,"\u22d2","\\doublecap");n(i,u,f,"\u22d3","\\doublecup");n(i,u,f,"\u22a0","\\boxtimes",true);n(i,u,g,"\u21e2","\\dashrightarrow",true);n(i,u,g,"\u21e0","\\dashleftarrow",true);n(i,u,g,"\u21c7","\\leftleftarrows",true);n(i,u,g,"\u21c6","\\leftrightarrows",true);n(i,u,g,"\u21da","\\Lleftarrow",true);n(i,u,g,"\u219e","\\twoheadleftarrow",true);n(i,u,g,"\u21a2","\\leftarrowtail",true);n(i,u,g,"\u21ab","\\looparrowleft",true);n(i,u,g,"\u21cb","\\leftrightharpoons",true);n(i,u,g,"\u21b6","\\curvearrowleft",true);n(i,u,g,"\u21ba","\\circlearrowleft",true);n(i,u,g,"\u21b0","\\Lsh",true);n(i,u,g,"\u21c8","\\upuparrows",true);n(i,u,g,"\u21bf","\\upharpoonleft",true);n(i,u,g,"\u21c3","\\downharpoonleft",true);n(i,u,g,"\u22b8","\\multimap",true);n(i,u,g,"\u21ad","\\leftrightsquigarrow",true);n(i,u,g,"\u21c9","\\rightrightarrows",true);n(i,u,g,"\u21c4","\\rightleftarrows",true);n(i,u,g,"\u21a0","\\twoheadrightarrow",true);n(i,u,g,"\u21a3","\\rightarrowtail",true);n(i,u,g,"\u21ac","\\looparrowright",true);n(i,u,g,"\u21b7","\\curvearrowright",true);n(i,u,g,"\u21bb","\\circlearrowright",true);n(i,u,g,"\u21b1","\\Rsh",true);n(i,u,g,"\u21ca","\\downdownarrows",true);n(i,u,g,"\u21be","\\upharpoonright",true);n(i,u,g,"\u21c2","\\downharpoonright",true);n(i,u,g,"\u21dd","\\rightsquigarrow",true);n(i,u,g,"\u21dd","\\leadsto");n(i,u,g,"\u21db","\\Rrightarrow",true);n(i,u,g,"\u21be","\\restriction");n(i,o,y,"\u2018","`");n(i,o,y,"$","\\$");n(l,o,y,"$","\\$");n(l,o,y,"$","\\textdollar");n(i,o,y,"%","\\%");n(l,o,y,"%","\\%");n(i,o,y,"_","\\_");n(l,o,y,"_","\\_");n(l,o,y,"_","\\textunderscore");n(i,o,y,"\u2220","\\angle",true);n(i,o,y,"\u221e","\\infty",true);n(i,o,y,"\u2032","\\prime");n(i,o,y,"\u25b3","\\triangle");n(i,o,y,"\u0393","\\Gamma",true);n(i,o,y,"\u0394","\\Delta",true);n(i,o,y,"\u0398","\\Theta",true);n(i,o,y,"\u039b","\\Lambda",true);n(i,o,y,"\u039e","\\Xi",true);n(i,o,y,"\u03a0","\\Pi",true);n(i,o,y,"\u03a3","\\Sigma",true);n(i,o,y,"\u03a5","\\Upsilon",true);n(i,o,y,"\u03a6","\\Phi",true);n(i,o,y,"\u03a8","\\Psi",true);n(i,o,y,"\u03a9","\\Omega",true);n(i,o,y,"\xac","\\neg");n(i,o,y,"\xac","\\lnot");n(i,o,y,"\u22a4","\\top");n(i,o,y,"\u22a5","\\bot");n(i,o,y,"\u2205","\\emptyset");n(i,u,y,"\u2205","\\varnothing");n(i,o,v,"\u03b1","\\alpha",true);n(i,o,v,"\u03b2","\\beta",true);n(i,o,v,"\u03b3","\\gamma",true);n(i,o,v,"\u03b4","\\delta",true);n(i,o,v,"\u03f5","\\epsilon",true);n(i,o,v,"\u03b6","\\zeta",true);n(i,o,v,"\u03b7","\\eta",true);n(i,o,v,"\u03b8","\\theta",true);n(i,o,v,"\u03b9","\\iota",true);n(i,o,v,"\u03ba","\\kappa",true);n(i,o,v,"\u03bb","\\lambda",true);n(i,o,v,"\u03bc","\\mu",true);n(i,o,v,"\u03bd","\\nu",true);n(i,o,v,"\u03be","\\xi",true);n(i,o,v,"\u03bf","\\omicron",true);n(i,o,v,"\u03c0","\\pi",true);n(i,o,v,"\u03c1","\\rho",true);n(i,o,v,"\u03c3","\\sigma",true);n(i,o,v,"\u03c4","\\tau",true);n(i,o,v,"\u03c5","\\upsilon",true);n(i,o,v,"\u03d5","\\phi",true);n(i,o,v,"\u03c7","\\chi",true);n(i,o,v,"\u03c8","\\psi",true);n(i,o,v,"\u03c9","\\omega",true);n(i,o,v,"\u03b5","\\varepsilon",true);n(i,o,v,"\u03d1","\\vartheta",true);n(i,o,v,"\u03d6","\\varpi",true);n(i,o,v,"\u03f1","\\varrho",true);n(i,o,v,"\u03c2","\\varsigma",true);n(i,o,v,"\u03c6","\\varphi",true);n(i,o,f,"\u2217","*");n(i,o,f,"+","+");n(i,o,f,"\u2212","-");n(i,o,f,"\u22c5","\\cdot");n(i,o,f,"\u2218","\\circ");n(i,o,f,"\xf7","\\div",true);n(i,o,f,"\xb1","\\pm",true);n(i,o,f,"\xd7","\\times",true);n(i,o,f,"\u2229","\\cap",true);n(i,o,f,"\u222a","\\cup",true);n(i,o,f,"\u2216","\\setminus");n(i,o,f,"\u2227","\\land");n(i,o,f,"\u2228","\\lor");n(i,o,f,"\u2227","\\wedge",true);n(i,o,f,"\u2228","\\vee",true);n(i,o,y,"\u221a","\\surd");n(i,o,p,"(","(");n(i,o,p,"[","[");n(i,o,p,"\u27e8","\\langle");n(i,o,p,"\u2223","\\lvert");n(i,o,p,"\u2225","\\lVert");n(i,o,c,")",")");n(i,o,c,"]","]");n(i,o,c,"?","?");n(i,o,c,"!","!");n(i,o,c,"\u27e9","\\rangle");n(i,o,c,"\u2223","\\rvert");n(i,o,c,"\u2225","\\rVert");n(i,o,g,"=","=");n(i,o,g,"<","<");n(i,o,g,">",">");n(i,o,g,":",":");n(i,o,g,"\u2248","\\approx",true);n(i,o,g,"\u2245","\\cong",true);n(i,o,g,"\u2265","\\ge");n(i,o,g,"\u2265","\\geq",true);n(i,o,g,"\u2190","\\gets");n(i,o,g,">","\\gt");n(i,o,g,"\u2208","\\in",true);n(i,o,g,"\u2209","\\notin",true);n(i,o,g,"\u0338","\\not");n(i,o,g,"\u2282","\\subset",true);n(i,o,g,"\u2283","\\supset",true);n(i,o,g,"\u2286","\\subseteq",true);n(i,o,g,"\u2287","\\supseteq",true);n(i,u,g,"\u2288","\\nsubseteq",true);n(i,u,g,"\u2289","\\nsupseteq",true);n(i,o,g,"\u22a8","\\models");n(i,o,g,"\u2190","\\leftarrow",true);n(i,o,g,"\u2264","\\le");n(i,o,g,"\u2264","\\leq",true);n(i,o,g,"<","\\lt");n(i,o,g,"\u2260","\\ne",true);n(i,o,g,"\u2260","\\neq");n(i,o,g,"\u2192","\\rightarrow",true);n(i,o,g,"\u2192","\\to");n(i,u,g,"\u2271","\\ngeq",true);n(i,u,g,"\u2270","\\nleq",true);n(i,o,b,null,"\\!");n(i,o,b,"\xa0","\\ ");n(i,o,b,"\xa0","~");n(i,o,b,null,"\\,");n(i,o,b,null,"\\:");n(i,o,b,null,"\\;");n(i,o,b,null,"\\enspace");n(i,o,b,null,"\\qquad");n(i,o,b,null,"\\quad");n(i,o,b,"\xa0","\\space");n(i,o,m,",",",");n(i,o,m,";",";");n(i,o,m,":","\\colon");n(i,u,f,"\u22bc","\\barwedge",true);n(i,u,f,"\u22bb","\\veebar",true);n(i,o,f,"\u2299","\\odot",true);n(i,o,f,"\u2295","\\oplus",true);n(i,o,f,"\u2297","\\otimes",true);n(i,o,y,"\u2202","\\partial",true);n(i,o,f,"\u2298","\\oslash",true);n(i,u,f,"\u229a","\\circledcirc",true);n(i,u,f,"\u22a1","\\boxdot",true);n(i,o,f,"\u25b3","\\bigtriangleup");n(i,o,f,"\u25bd","\\bigtriangledown");n(i,o,f,"\u2020","\\dagger");n(i,o,f,"\u22c4","\\diamond");n(i,o,f,"\u22c6","\\star");n(i,o,f,"\u25c3","\\triangleleft");n(i,o,f,"\u25b9","\\triangleright");n(i,o,p,"{","\\{");n(l,o,y,"{","\\{");n(l,o,y,"{","\\textbraceleft");n(i,o,c,"}","\\}");n(l,o,y,"}","\\}");n(l,o,y,"}","\\textbraceright");n(i,o,p,"{","\\lbrace");n(i,o,c,"}","\\rbrace");n(i,o,p,"[","\\lbrack");n(i,o,c,"]","\\rbrack");n(l,o,y,"<","\\textless");n(l,o,y,">","\\textgreater");n(i,o,p,"\u230a","\\lfloor");n(i,o,c,"\u230b","\\rfloor");n(i,o,p,"\u2308","\\lceil");n(i,o,c,"\u2309","\\rceil");n(i,o,y,"\\","\\backslash");n(i,o,y,"\u2223","|");n(i,o,y,"\u2223","\\vert");n(l,o,y,"|","\\textbar");n(i,o,y,"\u2225","\\|");n(i,o,y,"\u2225","\\Vert");n(l,o,y,"\u2225","\\textbardbl");n(i,o,g,"\u2191","\\uparrow",true);n(i,o,g,"\u21d1","\\Uparrow",true);n(i,o,g,"\u2193","\\downarrow",true);n(i,o,g,"\u21d3","\\Downarrow",true);n(i,o,g,"\u2195","\\updownarrow",true);n(i,o,g,"\u21d5","\\Updownarrow",true);n(i,o,h,"\u2210","\\coprod");n(i,o,h,"\u22c1","\\bigvee");n(i,o,h,"\u22c0","\\bigwedge");n(i,o,h,"\u2a04","\\biguplus");n(i,o,h,"\u22c2","\\bigcap");n(i,o,h,"\u22c3","\\bigcup");n(i,o,h,"\u222b","\\int");n(i,o,h,"\u222b","\\intop");n(i,o,h,"\u222c","\\iint");n(i,o,h,"\u222d","\\iiint");n(i,o,h,"\u220f","\\prod");n(i,o,h,"\u2211","\\sum");n(i,o,h,"\u2a02","\\bigotimes");n(i,o,h,"\u2a01","\\bigoplus");n(i,o,h,"\u2a00","\\bigodot");n(i,o,h,"\u222e","\\oint");n(i,o,h,"\u2a06","\\bigsqcup");n(i,o,h,"\u222b","\\smallint");n(l,o,d,"\u2026","\\textellipsis");n(i,o,d,"\u2026","\\mathellipsis");n(l,o,d,"\u2026","\\ldots",true);n(i,o,d,"\u2026","\\ldots",true);n(i,o,d,"\u22ef","\\@cdots",true);n(i,o,d,"\u22f1","\\ddots",true);n(i,o,y,"\u22ee","\\vdots",true);n(i,o,s,"\xb4","\\acute");n(i,o,s,"`","\\grave");n(i,o,s,"\xa8","\\ddot");n(i,o,s,"~","\\tilde");n(i,o,s,"\xaf","\\bar");n(i,o,s,"\u02d8","\\breve");n(i,o,s,"\u02c7","\\check");n(i,o,s,"^","\\hat");n(i,o,s,"\u20d7","\\vec");n(i,o,s,"\u02d9","\\dot");n(i,o,v,"\u0131","\\imath");n(i,o,v,"\u0237","\\jmath");n(l,o,s,"\u02ca","\\'");n(l,o,s,"\u02cb","\\`");n(l,o,s,"\u02c6","\\^");n(l,o,s,"\u02dc","\\~");n(l,o,s,"\u02c9","\\=");n(l,o,s,"\u02d8","\\u");n(l,o,s,"\u02d9","\\.");n(l,o,s,"\u02da","\\r");n(l,o,s,"\u02c7","\\v");n(l,o,s,"\xa8",'\\"');n(l,o,s,"\u030b","\\H");n(l,o,y,"\u2013","--");n(l,o,y,"\u2013","\\textendash");n(l,o,y,"\u2014","---");n(l,o,y,"\u2014","\\textemdash");n(l,o,y,"\u2018","`");n(l,o,y,"\u2018","\\textquoteleft");n(l,o,y,"\u2019","'");n(l,o,y,"\u2019","\\textquoteright");n(l,o,y,"\u201c","``");n(l,o,y,"\u201c","\\textquotedblleft");n(l,o,y,"\u201d","''");n(l,o,y,"\u201d","\\textquotedblright");n(i,o,y,"\xb0","\\degree");n(l,o,y,"\xb0","\\degree");n(i,o,v,"\xa3","\\pounds",true);n(i,o,v,"\xa3","\\mathsterling");n(l,o,v,"\xa3","\\pounds");n(l,o,v,"\xa3","\\textsterling");n(i,u,y,"\u2720","\\maltese");n(l,u,y,"\u2720","\\maltese");n(l,o,b,"\xa0","\\ ");n(l,o,b,"\xa0"," ");n(l,o,b,"\xa0","~");var x='0123456789/@."';for(var w=0;w<x.length;w++){var k=x.charAt(w);n(i,o,y,k,k)}var M='0123456789!@*()-=+[]<>|";:?/.,';for(var _=0;_<M.length;_++){var z=M.charAt(_);n(l,o,y,z,z)}var S="\xe4\xe5\xf6\xf8\xc4\xc5\xd6";for(var T=0;T<S.length;T++){var A=S.charAt(T);n(i,o,v,A,A);n(l,o,y,A,A)}var C="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var N=0;N<C.length;N++){var O=C.charAt(N);n(i,o,v,O,O);n(l,o,y,O,O)}var j="\u03b1\u03b2\u03b3\u03b4\u03b5\u03f5\u03b6\u03b7\u03b8\u03d1\u03b9\u03ba\u03bb\u03bc\u03bd\u03be\u03bf\u03c0\u03d6\u03c1\u03f1\u03c2\u03c3\u03c4\u03c5\u03c6\u03d5\u03c7\u03c8\u03c9";for(var E=0;E<C.length;E++){var L=j.charAt(E);n(i,o,v,L,L)}var q="\u0393\u0394\u0398\u039e\u03a0\u03a3\u03a6\u03a8\u03a9";for(var P=0;P<C.length;P++){var R=q.charAt(P);n(i,o,y,R,R)}for(var B=192;B<=214;B++){var D=String.fromCharCode(B);n(i,o,v,D,D);n(l,o,y,D,D)}for(var F=216;F<=246;F++){var H=String.fromCharCode(F);n(i,o,v,H,H);n(l,o,y,H,H)}for(var I=248;I<=255;I++){var V=String.fromCharCode(I);n(i,o,v,V,V);n(l,o,y,V,V)}for(var G=1040;G<=1103;G++){var Y=String.fromCharCode(G);n(l,o,y,Y,Y)}n(l,o,y,"\u2013","\u2013");n(l,o,y,"\u2014","\u2014");n(l,o,y,"\u2018","\u2018");n(l,o,y,"\u2019","\u2019");n(l,o,y,"\u201c","\u201c");n(l,o,y,"\u201d","\u201d")},{}],113:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=r.hangulRegex=/[\uAC00-\uD7AF]/;var n=r.cjkRegex=/[\u3000-\u30FF\u4E00-\u9FAF\uAC00-\uD7AF\uFF00-\uFF60]/},{}],114:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.calculateSize=r.validUnit=undefined;var a=e("./ParseError");var n=o(a);var i=e("./Options");var l=o(i);function o(e){return e&&e.__esModule?e:{default:e}}var u={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800};var s={ex:true,em:true,mu:true};var f=r.validUnit=function e(t){if(typeof t!=="string"){t=t.unit}return t in u||t in s||t==="ex"};var c=r.calculateSize=function e(t,r){var a=void 0;if(t.unit in u){a=u[t.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier}else if(t.unit==="mu"){a=r.fontMetrics().cssEmPerMu}else{var i=void 0;if(r.style.isTight()){i=r.havingStyle(r.style.text())}else{i=r}if(t.unit==="ex"){a=i.fontMetrics().xHeight}else if(t.unit==="em"){a=i.fontMetrics().quad}else{throw new n.default("Invalid unit: '"+t.unit+"'")}if(i!==r){a*=i.sizeMultiplier/r.sizeMultiplier}}return Math.min(t.number*a,r.maxSize)}},{"./Options":83,"./ParseError":84}],115:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=Array.prototype.indexOf;var n=function e(t,r){if(t==null){return-1}if(a&&t.indexOf===a){return t.indexOf(r)}var n=t.length;for(var i=0;i<n;i++){if(t[i]===r){return i}}return-1};var i=function e(t,r){return n(t,r)!==-1};var l=function e(t,r){return t===undefined?r:t};var o=/([A-Z])/g;var u=function e(t){return t.replace(o,"-$1").toLowerCase()};var s={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"};var f=/[&><"']/g;function c(e){return String(e).replace(f,function(e){return s[e]})}var d=void 0;if(typeof document!=="undefined"){var v=document.createElement("span");if("textContent"in v){d=function e(t,r){t.textContent=r}}else{d=function e(t,r){t.innerText=r}}}function h(e){d(e,"")}r.default={contains:i,deflt:l,escape:c,hyphenate:u,indexOf:n,setTextContent:d,clearNode:h}},{}]},{},[1])(1)});
const { run } = require('runjs') const chalk = require('chalk') const config = require('../vue.config.js') const rawArgv = process.argv.slice(2) const args = rawArgv.join(' ') if (process.env.npm_config_preview || rawArgv.includes('--preview')) { const report = rawArgv.includes('--report') run(`vue-cli-service build ${args}`) const port = 9521 const publicPath = config.publicPath var connect = require('connect') var serveStatic = require('serve-static') const app = connect() app.use( publicPath, serveStatic('./dist', { index: ['index.html', '/'] }) ) app.listen(port, function () { console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) if (report) { console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) } }) } else { run(`vue-cli-service build ${args}`) }
angular.module('App').controller( 'CdnManageCtrl', class CdnManageCtrl { constructor( $scope, $q, $stateParams, $filter, $translate, Cdn, currentActiveLink, domainsLink, ) { // injections this.$scope = $scope; this.$q = $q; this.$stateParams = $stateParams; this.$filter = $filter; this.$translate = $translate; this.Cdn = Cdn; this.currentActiveLink = currentActiveLink; this.domainsLink = domainsLink; // attributes used in view this.cdn = null; this.loading = false; } $onInit() { this.loading = true; return this.$q .allSettled([ this.Cdn.getSelected(this.$stateParams.productId, true), this.Cdn.getServiceInfos(this.$stateParams.productId), ]) .then(([selected, serviceInfos]) => { this.cdn = selected; this.serviceInfos = serviceInfos; const date = new Date(); const { endingDay } = this.cdn; if (!endingDay) { this.cdn.endingEstimationDate = '-'; } else if (endingDay > 90) { this.cdn.endingEstimationDate = this.$translate.instant( 'cdn_configuration_more_than_three_month', ); } else { date.setDate(date.getDate() + endingDay); this.cdn.endingEstimationDate = this.$filter('date')( date, 'mediumDate', ); } }) .catch(([errCdn, errServiceInfos]) => { const errs = []; if (errCdn.data && errCdn.data.type === 'ERROR') { errs.push(errCdn); } else { this.cdn = errCdn; } if (errServiceInfos.data && errServiceInfos.data.type === 'ERROR') { errs.push(errServiceInfos); } else { this.serviceInfos = errServiceInfos.data; } this.$scope.setMessage( this.$translate.instant('cdn_dashboard_loading_error'), { message: errs.map((data) => data.data.message).join(', '), type: 'ERROR', }, ); }) .finally(() => { this.loading = false; }); } }, );
/** * Fill Try Form */ (function(){ var fields = { "trySource" : "1", "trysType" : "1", "IsPostPay" : "0", "DateNum" : "10", "IsSellYear" : "3", "IsTaoke" : "1", "Title" : "测试活动 " + new Date().toLocaleDateString(), "tryType" : "1", "cate_cid" : "10", "img" : "tmp/2014/09/11/16541620901329040689.jpg", "Img_check" : "1", "img_url" : "http://img1.sk0.com/", "GrantNum" : "10", "exchangeNum" : "0", "Price" : "50", "url_order" : "http://www.taobao.com", "url_type" : "1", "url" : "http://www.taobao.com", "Keyword" : "关键字1,关键字2", "tips_no_credit_card" : "1", "tips_no_hurrying" : "1", "tips_has_default_shipping" : "1", "tips_default_shipping" : "申通,圆通", "tips_has_model_limit" : "1", "tips_model_limit" : "男款白色 女款白色", "tips_has_order_price" : "1", "tips_before_order_price" : "10", "tips_after_order_price" : "10", "tips_has_vip_price" : "1", "tips_vip_price" : "10", "tips_has_delivery_fee_limit" : "1", "tips_delivery_fee_limit" : "10", "tips_search_keyword" : "关键字1 关键字2", "tips_search_order_by" : "销量", "tips_wangwang" : "明明亮亮", "tips_bundle_items[]" : ["套餐项1", "套餐项2", "套餐项3"], "pimg" : "tmp/2014/09/11/16541620901329040689.jpg", "PImg_check" : "1", "Intro" : "测试活动 " + new Date().toLocaleString() }; var fillForm = function (form, fields) { var name, type, textVal = function (el, name) { if (fields[name] instanceof Array) { $(el).prop('value', fields[name].shift()); } else { $(el).prop('value', fields[name]); } $(el).change().blur(); }, checkVal = function (el, name) { var checked = $(el).prop('checked'); if (fields[name] instanceof Array) { var i = fields[name].indexOf(el.value); if (i >= 0) { $(el).prop('checked', true); fields[name].splice(i, 1); } } else { if (fields[name] == $(el).val()) $(el).prop('checked', true); } if ($(el).prop('checked') !== checked) { $(el).click().click().blur(); } }, selectVal = function (el, name) { if (fields[name] instanceof Array) { $(el).find('option').each(function(index,opt_el){ var i = fields[name].indexOf(opt_el.value); if (i >= 0) { $(el).prop('selected', true); fields[name].splice(i, 1); return; } }); } else { $(el).val(fields[name]); } $(el).change().blur(); }; var fieldsFound = {}; $(form).find(':input').each(function (i,el) { name = $(el).prop('name'); if (!name) return; fieldsFound[name] = 1; switch (el.tagName) { case 'INPUT': type = $(el).prop('type'); if (!type) { textVal(el, name); } else { switch (type) { case 'text': case 'date': case 'password': case 'number': case 'hidden': textVal(el, name); break; case 'checkbox': case 'radio': checkVal(el, name); break; default: console.log('处理input[name=' + name + ']时遇到未知的type:' + type); break; } } break; case 'TEXTAREA': textVal(el, name); break; case 'SELECT': selectVal(el, name); break; case 'BUTTON': break; } }); Object.keys(fields).forEach(function(v) { if (fieldsFound[v] === undefined) { console.log('找不到字段:' + v); return; } }); }; fillForm($('#trysMesFrom'), fields); })();
var a02813 = [ [ "queueElement", "a02813.html#a73bc58b896e706fe0844d45a6a776449", null ], [ "operator()", "a02813.html#a17bf78ee09ab473f61bbec7d6ac4abd5", null ] ];
// ==UserScript== // @name I Am Distracted - Unlocked-content // @namespace https://github.com/bansan85/IAmDistracted.unlocked-content // @description Help to keep you focus while browsing. Remove boring "Click to continue" or silly hide content. // @include http://* // @include https://* // @license https://opensource.org/licenses/MIT // @homepage https://github.com/bansan85/IAmDistracted // @updateURL https://raw.githubusercontent.com/bansan85/IAmDistracted/master/IAmDistracted-unlocked-content.meta.js // @downloadURL https://raw.githubusercontent.com/bansan85/IAmDistracted/master/IAmDistracted-unlocked-content.user.js // @version 0.1 // @grant none // @run-at document-end // ==/UserScript== if (window.location.href.match(/http[s]?:\/\/observer.com/)) { // Test 0014_observer_com_1 // The easiest thing would be to rename entry-content to make failed script but simply removes getElementsByClassName fail. var elmDeleted = document.getElementById("hidden"); elmDeleted.className = "__hidden__"; elmDeleted = document.getElementById("continue"); elmDeleted.parentNode.removeChild(elmDeleted); elmDeleted = document.getElementById("fade"); elmDeleted.parentNode.removeChild(elmDeleted); }
/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ 'use strict'; /** * Tenant access information update parameters. * */ class AccessInformationUpdateParameters { /** * Create a AccessInformationUpdateParameters. * @property {boolean} [enabled] Determines whether direct access is enabled. */ constructor() { } /** * Defines the metadata of AccessInformationUpdateParameters * * @returns {object} metadata of AccessInformationUpdateParameters * */ mapper() { return { required: false, serializedName: 'AccessInformationUpdateParameters', type: { name: 'Composite', className: 'AccessInformationUpdateParameters', modelProperties: { enabled: { required: false, serializedName: 'properties.enabled', type: { name: 'Boolean' } } } } }; } } module.exports = AccessInformationUpdateParameters;
############################################################################### # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. ############################################################################### import os import sys import unittest import keras2onnx import numpy as np from keras2onnx.proto import keras from onnxconverter_common.onnx_ex import get_maximum_opset_supported from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../tests/')) from test_utils import run_keras_and_ort, test_level_0 K = keras.backend Activation = keras.layers.Activation AveragePooling2D = keras.layers.AveragePooling2D Add = keras.layers.Add Bidirectional = keras.layers.Bidirectional concatenate = keras.layers.concatenate Conv1D = keras.layers.Conv1D Dense = keras.layers.Dense Dropout = keras.layers.Dropout Embedding = keras.layers.Embedding Flatten = keras.layers.Flatten GaussianNoise = keras.layers.GaussianNoise GlobalAveragePooling2D = keras.layers.GlobalAveragePooling2D Input = keras.layers.Input Lambda = keras.layers.Lambda LSTM = keras.layers.LSTM MaxPooling1D = keras.layers.MaxPooling1D Reshape = keras.layers.Reshape TimeDistributed = keras.layers.TimeDistributed Sequential = keras.models.Sequential Model = keras.models.Model # Model from https://github.com/kamalkraj/Named-Entity-Recognition-with-Bidirectional-LSTM-CNNs class TestNameEntityRecognition(unittest.TestCase): def setUp(self): self.model_files = [] def tearDown(self): for fl in self.model_files: os.remove(fl) @unittest.skipIf(get_maximum_opset_supported() < 11, "Deep speech conversion need opset >= 11.") def test_name_entity_recognition(self): K.clear_session() words_input = Input(shape=(None,), dtype='int32', name='words_input') words = Embedding(input_dim=10, output_dim=20, weights=None, trainable=False)(words_input) casing_input = Input(shape=(None,), dtype='int32', name='casing_input') casing = Embedding(output_dim=20, input_dim=12, weights=None, trainable=False)(casing_input) character_input = Input(shape=(None, 52,), name='char_input') embed_char_out = TimeDistributed( Embedding(26, 20), name='char_embedding')(character_input) dropout = Dropout(0.5)(embed_char_out) conv1d_out = TimeDistributed(Conv1D(kernel_size=3, filters=30, padding='same', activation='tanh', strides=1))( dropout) maxpool_out = TimeDistributed(MaxPooling1D(52))(conv1d_out) char = TimeDistributed(Flatten())(maxpool_out) char = Dropout(0.5)(char) output = concatenate([words, casing, char]) output = Bidirectional(LSTM(200, return_sequences=True, dropout=0.50, recurrent_dropout=0.25))(output) output = TimeDistributed(Dense(35, activation='softmax'))(output) keras_model = Model(inputs=[words_input, casing_input, character_input], outputs=[output]) batch_size = 100 data1 = np.random.randint(5, 10, size=(batch_size, 6)).astype(np.int32) data2 = np.random.randint(5, 10, size=(batch_size, 6)).astype(np.int32) data3 = np.random.rand(batch_size, 6, 52).astype(np.float32) expected = keras_model.predict([data1, data2, data3]) onnx_model = keras2onnx.convert_keras(keras_model, keras_model.name) self.assertTrue( run_keras_and_ort(onnx_model.graph.name, onnx_model, keras_model, {keras_model.input_names[0]: data1, keras_model.input_names[1]: data2, keras_model.input_names[2]: data3}, expected, self.model_files, compare_perf=True)) if __name__ == "__main__": unittest.main()
import React from 'react' import { connect } from "react-redux"; class AddOne extends React.Component { render() { return ( <div> <span>Sum the number of the input:</span> <br /> <button onClick={this.props.addOne}>Add One</button> </div> ) } } const mapStateToProps = (state) => { return { total: state.total } } const mapDispatchToProps = (dispatch) => { return { addOne: () => { dispatch({ // action type: "ADD_ONE" }) } } } export default connect(mapStateToProps, mapDispatchToProps)(AddOne);
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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. """ This module is deprecated. Please use :mod:`airflow.providers.microsoft.azure.transfers.file_to_wasb`. """ import warnings # pylint: disable=unused-import from airflow.providers.microsoft.azure.transfers.file_to_wasb import FileToWasbOperator # noqa warnings.warn( "This module is deprecated. Please use `airflow.providers.microsoft.azure.transfers.file_to_wasb`.", DeprecationWarning, stacklevel=2, )
;(function () { var module = { execute: function (lasca) { lasca = lasca || window.lasca; $(document).ready(function(){ var shuffle, diff, obj = {}; window.module('UTILS'); test('lasca.getLanguage()', function() { equal(lasca.getLanguage('uca_arabic').key, 'uca_arabic'); }); test('lasca.getLanguageKeys()', function() { equal(lasca.getLanguageKeys().length, 85); }); test('lasca.compare()', function() { equal(lasca.getLanguageKeys().length, 85); }); window.module('ARRAY SORTING'); _.each(lasca.getLanguageKeys(), function (key) { lasca.setLanguage(key); shuffle = lasca.sort(_.shuffle(lasca.language.collation)); // shuffle, sort test('Shuffle and sort letters for ' + key, function() { equal(_.difference(lasca.language.collation, shuffle).length, 0); }); }); window.module('ARRAY OF OBJECTS SORTING'); _.each(lasca.getLanguageKeys(), function (key) { lasca.setLanguage(key); // shuffle, create array of objects shuffle = _.map(_.shuffle(lasca.language.collation), function (item) { return { letter: item }; }); shuffle = _.pluck(lasca.sort(shuffle, 'letter'), 'letter'); // sort array of objects based on defined key test('Shuffle and sort letters for ' + key, function() { equal(_.difference(lasca.language.collation, shuffle).length, 0); }); }); }); } } if (typeof define === 'function') define(module); else module.execute(); })();
'use strict'; var _ = require('lodash'); var BufferUtil = require('./util/buffer'); var JSUtil = require('./util/js'); var networks = []; var networkMaps = {}; /** * A network is merely a map containing values that correspond to version * numbers for each litecoin network. Currently only supporting "livenet" * (a.k.a. "mainnet") and "testnet". * @constructor */ function Network() {} Network.prototype.toString = function toString() { return this.name; }; /** * @function * @member Networks#get * Retrieves the network associated with a magic number or string. * @param {string|number|Network} arg * @param {string|Array} keys - if set, only check if the magic number associated with this name matches * @return Network */ function get(arg, keys) { if (~networks.indexOf(arg)) { return arg; } if (keys) { if (!_.isArray(keys)) { keys = [keys]; } var containsArg = function(key) { return networks[index][key] === arg; }; for (var index in networks) { if (_.any(keys, containsArg)) { return networks[index]; } } return undefined; } return networkMaps[arg]; } /** * @function * @member Networks#add * Will add a custom Network * @param {Object} data * @param {string} data.name - The name of the network * @param {string} data.alias - The aliased name of the network * @param {Number} data.pubkeyhash - The publickey hash prefix * @param {Number} data.privatekey - The privatekey prefix * @param {Number} data.scripthash - The scripthash prefix * @param {Number} data.xpubkey - The extended public key magic * @param {Number} data.xprivkey - The extended private key magic * @param {Number} data.networkMagic - The network magic number * @param {Number} data.port - The network port * @param {Array} data.dnsSeeds - An array of dns seeds * @return Network */ function addNetwork(data) { var network = new Network(); JSUtil.defineImmutable(network, { name: data.name, alias: data.alias, pubkeyhash: data.pubkeyhash, privatekey: data.privatekey, scripthash: data.scripthash, xpubkey: data.xpubkey, xprivkey: data.xprivkey }); if (data.networkMagic) { JSUtil.defineImmutable(network, { networkMagic: BufferUtil.integerAsBuffer(data.networkMagic) }); } if (data.port) { JSUtil.defineImmutable(network, { port: data.port }); } if (data.dnsSeeds) { JSUtil.defineImmutable(network, { dnsSeeds: data.dnsSeeds }); } _.each(network, function(value) { if (!_.isUndefined(value) && !_.isObject(value)) { networkMaps[value] = network; } }); networks.push(network); return network; } /** * @function * @member Networks#remove * Will remove a custom network * @param {Network} network */ function removeNetwork(network) { for (var i = 0; i < networks.length; i++) { if (networks[i] === network) { networks.splice(i, 1); } } for (var key in networkMaps) { if (networkMaps[key] === network) { delete networkMaps[key]; } } } addNetwork({ name: 'livenet', alias: 'mainnet', pubkeyhash: 0xfd, privatekey: 0x00, scripthash: 0x00, xpubkey: 0x0488b21e, xprivkey: 0x0488ade4, networkMagic: 0xfacf3bdc, port: 22566, dnsSeeds: [ 'node01.getlynx.io', 'node02.getlynx.io', 'node03.getlynx.io', 'node04.getlynx.io', 'node05.getlynx.io' ] }); /** * @instance * @member Networks#livenet */ var livenet = get('livenet'); addNetwork({ name: 'testnet', alias: 'regtest', pubkeyhash: 0x6f, privatekey: 0xef, scripthash: 0x3a, xpubkey: 0x0436f6e1, xprivkey: 0x0436ef7d }); /** * @instance * @member Networks#testnet */ var testnet = get('testnet'); // Add configurable values for testnet/regtest var TESTNET = { PORT: 19335, NETWORK_MAGIC: BufferUtil.integerAsBuffer(0xfdd2c8f1), DNS_SEEDS: [ 'testnet-seed.litecointools.com', 'seed-b.litecoin.loshan.co.uk' ] }; for (var key in TESTNET) { if (!_.isObject(TESTNET[key])) { networkMaps[TESTNET[key]] = testnet; } } var REGTEST = { PORT: 19444, NETWORK_MAGIC: BufferUtil.integerAsBuffer(0xfabfb5da), DNS_SEEDS: [] }; for (var key in REGTEST) { if (!_.isObject(REGTEST[key])) { networkMaps[REGTEST[key]] = testnet; } } Object.defineProperty(testnet, 'port', { enumerable: true, configurable: false, get: function() { if (this.regtestEnabled) { return REGTEST.PORT; } else { return TESTNET.PORT; } } }); Object.defineProperty(testnet, 'networkMagic', { enumerable: true, configurable: false, get: function() { if (this.regtestEnabled) { return REGTEST.NETWORK_MAGIC; } else { return TESTNET.NETWORK_MAGIC; } } }); Object.defineProperty(testnet, 'dnsSeeds', { enumerable: true, configurable: false, get: function() { if (this.regtestEnabled) { return REGTEST.DNS_SEEDS; } else { return TESTNET.DNS_SEEDS; } } }); /** * @function * @member Networks#enableRegtest * Will enable regtest features for testnet */ function enableRegtest() { testnet.regtestEnabled = true; } /** * @function * @member Networks#disableRegtest * Will disable regtest features for testnet */ function disableRegtest() { testnet.regtestEnabled = false; } /** * @namespace Networks */ module.exports = { add: addNetwork, remove: removeNetwork, defaultNetwork: livenet, livenet: livenet, mainnet: livenet, testnet: testnet, get: get, enableRegtest: enableRegtest, disableRegtest: disableRegtest };
/* Miscellaneous utilities */ /* Escape regular expression metacharacters in str */ function escapeRegexInner(str) { return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); } /* Call callback once the returned function has been called counter times * * The return value is a closure that decrements counter, and, when it * reaches zero, calls callback with any arguments the closure is given. * The return has an additional method, add(), that can be used to increase * the counter after the fact. * * Example: * > let wg = waitgroup(3, () => console.log('Callback called')); * ... * > wg() * > wg() * > wg() * Callback called * > wg = waitgroup(0, () => console.log('Callback called')); * ... * > wg.add(2); * > wg() * > wg() * Callback called * > */ function waitgroup(counter, callback) { const ret = function waitgroupCallback() { if (--counter > 0) return; callback.apply(this, arguments); }; ret.add = (n) => { counter += n; }; return ret; } /* Show a progress display for some process * * template is a template for progress lines; the substrings #c and #l in it * are replaced with the values of the counter and the limit, respectively. * The return value is a closure that takes three parameters, counter, limit, * and final; counter is the current progress, limit is how far the process * will go, final indicates whether a line break should be appended to the * progress report. * If template is null or undefined, no progress display is made at all, but * the return value is still a valid function. */ function progress(template) { return function progressDisplay(counter, limit, final) { if (template == null) return; const output = template.replace(/#c/g, counter).replace(/#l/g, limit); process.stderr.write('\r' + output + (final ? '\n' : ' ')); }; } module.exports.escapeRegexInner = escapeRegexInner; module.exports.waitgroup = waitgroup; module.exports.progress = progress;
import React from 'react'; export default class Services extends React.Component { render() { return ( <section className="page-section" id="services"> <div className="container"> <h2 className="text-center mt-0">At Your Service</h2> <hr className="divider my-4" /> <div className="row"> <div className="col-lg-3 col-md-6 text-center"> <div className="mt-5"> <i className="fas fa-4x fa-gem text-primary mb-4"></i> <h3 className="h4 mb-2">Made with innovation</h3> <p className="text-muted mb-0">We work with you to deliver actionable ariticial intelligence products</p> <p className="text-muted mb-0">Our solutions consider users, business value and programming standards at the heart of our development strategies</p> </div> </div> <div className="col-lg-3 col-md-6 text-center"> <div className="mt-5"> <i className="fas fa-4x fa-laptop-code text-primary mb-4"></i> <h3 className="h4 mb-2">Made with ease</h3> <p className="text-muted mb-0">Our solutions are designed to be easy to deploy, use and maintain</p> <p className="text-muted mb-0">You will not need a big machine learning crew to keep uptodate with state of the art artificial intelligence</p> </div> </div> <div className="col-lg-3 col-md-6 text-center"> <div className="mt-5"> <i className="fas fa-4x fa-heart text-primary mb-4"></i> <h3 className="h4 mb-2">Made with love</h3> <p className="text-muted mb-0">Is it really open source if it's not made with love?</p> <p className="text-muted mb-0">Please visit our github repository</p> <p className="text-muted mb-0">https://github.com/mmarouen/marabou</p> </div> </div> <div className="col-lg-3 col-md-6 text-center"> <div className="mt-5"> <i className="fas fa-4x fa-graduation-cap text-primary mb-4"></i> <h3 className="h4 mb-2">Made with care</h3> <p className="text-muted mb-0">Make use of our extensive professionnal experience</p> <p className="text-muted mb-0">We specialize in improving your operations and provide new services!</p> </div> </div> </div> </div> </section> ); } }
import React from "react" import SocialLinks from "../../constants/socialLinks" import Image from "gatsby-image" import { graphql, useStaticQuery } from "gatsby" import Title from "./Title" import styled from "styled-components" const query = graphql` { file(relativePath: { eq: "banner-about.jpeg" }) { childImageSharp { fixed(width: 100, height: 100) { ...GatsbyImageSharpFixed } } } } ` const About = () => { const data = useStaticQuery(query) return ( <Wrapper> <Title title="about me" /> <Image fixed={data.file.childImageSharp.fixed} width="1200" className="img" /> <p> Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum, eligendi. </p> <SocialLinks styleClass="banner-icons"></SocialLinks> </Wrapper> ) } const Wrapper = styled.div` text-align: center; p { color: var(--clr-grey-5); } .img { border-radius: 50%; } ` export default About
# Copyright 2017 The TensorFlow 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. # ============================================================================== """Tests for ssd resnet v1 FPN feature extractors.""" import tensorflow as tf from models import ssd_resnet_v1_fpn_feature_extractor from models import ssd_resnet_v1_fpn_feature_extractor_testbase class SSDResnet50V1FeatureExtractorTest( ssd_resnet_v1_fpn_feature_extractor_testbase. SSDResnetFPNFeatureExtractorTestBase): """SSDResnet50v1Fpn feature extractor test.""" def _create_feature_extractor(self, depth_multiplier, pad_to_multiple, use_explicit_padding=False): min_depth = 32 conv_hyperparams = {} batch_norm_trainable = True is_training = True return ssd_resnet_v1_fpn_feature_extractor.SSDResnet50V1FpnFeatureExtractor( is_training, depth_multiplier, min_depth, pad_to_multiple, conv_hyperparams, batch_norm_trainable, use_explicit_padding=use_explicit_padding) def _resnet_scope_name(self): return 'resnet_v1_50' class SSDResnet101V1FeatureExtractorTest( ssd_resnet_v1_fpn_feature_extractor_testbase. SSDResnetFPNFeatureExtractorTestBase): """SSDResnet101v1Fpn feature extractor test.""" def _create_feature_extractor(self, depth_multiplier, pad_to_multiple, use_explicit_padding=False): min_depth = 32 conv_hyperparams = {} batch_norm_trainable = True is_training = True return ( ssd_resnet_v1_fpn_feature_extractor.SSDResnet101V1FpnFeatureExtractor( is_training, depth_multiplier, min_depth, pad_to_multiple, conv_hyperparams, batch_norm_trainable, use_explicit_padding=use_explicit_padding)) def _resnet_scope_name(self): return 'resnet_v1_101' class SSDResnet152V1FeatureExtractorTest( ssd_resnet_v1_fpn_feature_extractor_testbase. SSDResnetFPNFeatureExtractorTestBase): """SSDResnet152v1Fpn feature extractor test.""" def _create_feature_extractor(self, depth_multiplier, pad_to_multiple, use_explicit_padding=False): min_depth = 32 conv_hyperparams = {} batch_norm_trainable = True is_training = True return ( ssd_resnet_v1_fpn_feature_extractor.SSDResnet152V1FpnFeatureExtractor( is_training, depth_multiplier, min_depth, pad_to_multiple, conv_hyperparams, batch_norm_trainable, use_explicit_padding=use_explicit_padding)) def _resnet_scope_name(self): return 'resnet_v1_152' if __name__ == '__main__': tf.test.main()
import moment from "moment"; export function filterSensorsAggregates(reading, formula, aggregates) { const { date } = reading; const { measurementSample } = formula; const startMillis = moment.utc(date).valueOf() - moment.utc(date).valueOf() % measurementSample; const endMillis = startMillis + measurementSample; return aggregates.map(aggregate => { const { _id, day, sensorId, source, measurementType, unitOfMeasurement, } = aggregate; const measurementTimes = aggregate.measurementTimes.split(","); const measurementValues = aggregate.measurementValues.split(","); const measurements = measurementTimes.map((time, index) => { return { time: parseInt(time), value: measurementValues[index] }; }).filter(x => startMillis <= x.time && x.time < endMillis); if (measurements.length != 0) { return { _id, day, sensorId, source, measurementType, unitOfMeasurement, measurementValues: measurements.map(x => x.value).join(","), measurementTimes: measurements.map(x => x.time).join(",") }; } }).filter(x => x); }
const formidable = require('formidable'); const fs = require('fs'); const path = require('path'); const uuidv1 = require('uuid/v1'); module.exports = (parser, ...names) => { if (typeof parser !== 'function') { names.push(parser); parser = false; } return async (req, res, next) => { var form = new formidable.IncomingForm(); form.on('fileBegin', function(name, file) { file.path = path.join(form.uploadDir, path.basename(file.path)); res.on('finish', () => { fs.unlinkSync(file.path); }); }); form.parse(req, function(err, fields, files) { if (!err) names.forEach(name => { if (parser) req.body[name] = parser(name, fields[name] || files[name] || null); else req.body[name] = fields[name] || files[name] || null; }); next(); }); }; };
YUI.add('newsContainer', function(Y, NAME) { Y.namespace('mojito.controllers')[NAME] = { // BEGIN CODE CHANGES index: function(ac) { // This is a composit mojit, used to contain children // mojits. Pass the action onto the children mojits. ac.composite.done(); } // END CODE CHANGES }; // BEGIN CODE CHANGES // We must require 'mojito-composite-addon' }, '0.0.1', {requires: ['mojito', 'mojito-assets-addon', 'mojito-models-addon', 'mojito-composite-addon']});
# # Copyright 2019 Altran. 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. # # """ Registering myuser model in django admin panel""" from django.contrib import admin from .models import ScfUser admin.site.register(ScfUser)
import { FETCH_COMMENTS_SUCCESS, FETCH_FAILED } from '../../Actions/actionTypes'; const commentsReducers = (api = [], action) => { switch (action.type) { case FETCH_COMMENTS_SUCCESS: return action.receivedApi; case FETCH_FAILED: return []; default: return api; } } export default commentsReducers;
import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import _ from 'lodash'; class ProductSquare extends Component { constructor(props) { super(props); this.state = { product: props.product }; } componentDidMount() { } getHoverImages(product) { return _.map(product.product_images, image => { return ( <img className="hoverable-image" src={image.image_url} alt="" key={image.image_url} /> ); }); } getFirstHoverImage(product) { if (product.product_images.length >= 1) { return ( <img src={product.product_images[0].image_url} alt=""/> ); } } initCarrousel(event) { const holder = event.target; const images = holder.querySelectorAll('img'); _.forEach(images, (image) => { console.log(image); }); } render() { const {product} = this.props; if (!this.props.product) { return (<div className="spinner"></div>); } return ( <div className="col-lg-4 col-md-4 col-sm-6 product-showcase"> <Link to={`productos/${product.id}`}> <div className="product-showcase-inner"> <div className="images-product-hover" onMouseEnter={this.initCarrousel.bind(this)}> {this.getFirstHoverImage(product)} </div> <h3 className="text-center">{product.name}</h3> <p className="product-description text-center">"{product.description}"</p> {/* <div className="text-center"> <div className={product.available ? 'product-availability available' : 'btn product-availability unavailable'}>{product.available ? 'Comprar' : 'No Disponible'}</div> </div> */} </div> </Link> </div> ); } } export default ProductSquare;
import React from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' /** * The Image component. */ const Image = props => { const { responsive, contain, cover, ...otherProps } = props // Prepare class names. const classNames = classnames({ 'img-responsive': responsive, 'img-fit-contain': contain, 'img-fit-cover': cover }) return <img {...otherProps} className={classNames} /> } Image.propTypes = { responsive: PropTypes.bool, contain: PropTypes.bool, cover: PropTypes.bool } export { Image }
import fetch from '@/utils/fetch' export function getMergeResult(id) { return fetch({ url: '/api/data/getMergeResult/' + id, method: 'get' }) } export function getDataStat(id) { return fetch({ url: '/api/data/getDataStat/' + id, method: 'get' }) } export function getCrowdTask(data1, data2) { return fetch({ url: '/api/data/getCrowdTask', method: 'get', params: { processInstanceId: data1, activityId: data2 } }) } export function getCustomResult(serviceName, id) { return fetch({ url: '/api/data/getCustomResult/' + serviceName + '/' + id, method: 'get' }) } // 开始更新 export function getCrowdTaskByProcessInstanceId(processInstanceId) { return fetch({ url: '/api/data/crowdTask/' + processInstanceId, method: 'get' }) } export function getMachineJobByProcessInstanceId(processInstanceId) { return fetch({ url: '/api/data/machineTask/' + processInstanceId, method: 'get' // params: { processInstanceId: processInstanceId } }) } export function getCrowdTaskByUser() { return fetch({ url: '/api/data/crowdTask/list', method: 'get' }) }
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _events = require("events"); var _reconnectingWebsocket = _interopRequireDefault(require("reconnecting-websocket")); var _axios = _interopRequireDefault(require("axios")); var _stargate = require("@cosmjs/stargate"); var _SpClientError = _interopRequireDefault(require("./errors/SpClientError")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var SPClient = /*#__PURE__*/function (_EventEmitter) { _inherits(SPClient, _EventEmitter); var _super = _createSuper(SPClient); function SPClient(_ref) { var _this; var apiAddr = _ref.apiAddr, rpcAddr = _ref.rpcAddr, wsAddr = _ref.wsAddr; _classCallCheck(this, SPClient); _this = _super.call(this); _defineProperty(_assertThisInitialized(_this), "apiAddr", void 0); _defineProperty(_assertThisInitialized(_this), "rpcAddr", void 0); _defineProperty(_assertThisInitialized(_this), "wsAddr", void 0); _defineProperty(_assertThisInitialized(_this), "socket", void 0); _defineProperty(_assertThisInitialized(_this), "signingClient", void 0); _defineProperty(_assertThisInitialized(_this), "signer", void 0); _defineProperty(_assertThisInitialized(_this), "timer", void 0); _this.apiAddr = apiAddr; _this.rpcAddr = rpcAddr; _this.wsAddr = wsAddr; var poll = _this.connectivityTest.bind(_assertThisInitialized(_this)); _this.timer = setInterval(poll, 5000); _this.connectivityTest(); if (_this.wsAddr) { _this.socket = new _reconnectingWebsocket["default"](_this.wsAddr); _this.socket.onopen = _this.onOpenWS.bind(_assertThisInitialized(_this)); _this.socket.onmessage = _this.onMessageWS.bind(_assertThisInitialized(_this)); _this.socket.onerror = _this.onErrorWS.bind(_assertThisInitialized(_this)); _this.socket.onclose = _this.onCloseWS.bind(_assertThisInitialized(_this)); } return _this; } _createClass(SPClient, [{ key: "useSigner", value: function () { var _useSigner = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(signer) { return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return _stargate.SigningStargateClient.connectWithSigner(this.rpcAddr, signer); case 2: this.signingClient = _context.sent; this.signer = signer; case 4: case "end": return _context.stop(); } } }, _callee, this); })); function useSigner(_x) { return _useSigner.apply(this, arguments); } return useSigner; }() }, { key: "switchAPI", value: function switchAPI(apiAddr) { this.apiAddr = apiAddr; } }, { key: "switchWS", value: function switchWS(wsAddr) { this.emit('ws-status', false); this.wsAddr = wsAddr; this.socket = new _reconnectingWebsocket["default"](this.wsAddr); } }, { key: "switchRPC", value: function () { var _switchRPC = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(rpcAddr) { var registry; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: this.rpcAddr = rpcAddr; if (!this.signingClient) { _context2.next = 6; break; } registry = _objectSpread({}, this.signingClient.registry); _context2.next = 5; return _stargate.SigningStargateClient.connectWithSigner(this.rpcAddr, this.signer, { registry: registry }); case 5: this.signingClient = _context2.sent; case 6: case "end": return _context2.stop(); } } }, _callee2, this); })); function switchRPC(_x2) { return _switchRPC.apply(this, arguments); } return switchRPC; }() }, { key: "connectivityTest", value: function () { var _connectivityTest = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() { return regeneratorRuntime.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: if (!this.apiAddr) { _context3.next = 10; break; } _context3.prev = 1; _context3.next = 4; return _axios["default"].get(this.apiAddr + '/node_info'); case 4: this.emit('api-status', true); _context3.next = 10; break; case 7: _context3.prev = 7; _context3.t0 = _context3["catch"](1); if (!_context3.t0.response) { this.emit('api-status', false); console.error(new _SpClientError["default"]('Client-js:API', 'API Node unavailable')); } else { this.emit('api-status', true); } case 10: if (!this.rpcAddr) { _context3.next = 20; break; } _context3.prev = 11; _context3.next = 14; return _axios["default"].get(this.rpcAddr); case 14: this.emit('rpc-status', true); _context3.next = 20; break; case 17: _context3.prev = 17; _context3.t1 = _context3["catch"](11); if (!_context3.t1.response) { console.error(new _SpClientError["default"]('Client-js:API', 'RPC Node unavailable')); this.emit('rpc-status', false); } else { this.emit('api-status', true); } case 20: case "end": return _context3.stop(); } } }, _callee3, this, [[1, 7], [11, 17]]); })); function connectivityTest() { return _connectivityTest.apply(this, arguments); } return connectivityTest; }() }, { key: "onErrorWS", value: function onErrorWS() { console.error(new _SpClientError["default"]('Client-js:WS', 'Could not connect to websocket.')); } }, { key: "onCloseWS", value: function onCloseWS() { this.emit('ws-status', false); } }, { key: "onOpenWS", value: function onOpenWS() { this.emit('ws-status', true); this.socket.send(JSON.stringify({ jsonrpc: '2.0', method: 'subscribe', id: '1', params: ["tm.event = 'NewBlock'"] })); } }, { key: "onMessageWS", value: function onMessageWS(msg) { var result = JSON.parse(msg.data).result; if (result.data && result.data.type === 'tendermint/event/NewBlock') { this.emit('newblock', JSON.parse(msg.data).result); } } }, { key: "query", value: function () { var _query = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(url) { var params, response, _args4 = arguments; return regeneratorRuntime.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : ''; _context4.prev = 1; _context4.next = 4; return _axios["default"].get(this.apiAddr + url + params); case 4: response = _context4.sent; return _context4.abrupt("return", response.data); case 8: _context4.prev = 8; _context4.t0 = _context4["catch"](1); console.error(new _SpClientError["default"]('Client-js:API', 'Could not access API: ' + url)); case 11: case "end": return _context4.stop(); } } }, _callee4, this, [[1, 8]]); })); function query(_x3) { return _query.apply(this, arguments); } return query; }() }, { key: "addQueryParam", value: function addQueryParam(query, key) { var value = query[key]; return encodeURIComponent(key) + '=' + encodeURIComponent(Array.isArray(value) ? value.join(',') : typeof value === 'number' ? value : "".concat(value)); } }, { key: "toQueryString", value: function toQueryString(rawQuery) { var _this2 = this; var query = rawQuery || {}; var keys = Object.keys(query).filter(function (key) { return 'undefined' !== typeof query[key]; }); return keys.map(function (key) { return _typeof(query[key]) === 'object' && !Array.isArray(query[key]) ? _this2.toQueryString(query[key]) : _this2.addQueryParam(query, key); }).join('&'); } }, { key: "addQueryParams", value: function addQueryParams(rawQuery) { var queryString = this.toQueryString(rawQuery); return queryString ? "?".concat(queryString) : ''; } }, { key: "request", value: function () { var _request = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(_ref2) { var body, path, query, method, url, response, data; return regeneratorRuntime.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: body = _ref2.body, path = _ref2.path, query = _ref2.query, method = _ref2.method; url = this.apiAddr + path + this.addQueryParams(query); _context5.prev = 2; response = (0, _axios["default"])({ url: url, method: method, data: body, headers: { Accept: 'application/json', 'Content-Type': 'application/json;charset=UTF-8' } }); _context5.next = 6; return response; case 6: data = _context5.sent; return _context5.abrupt("return", data); case 10: _context5.prev = 10; _context5.t0 = _context5["catch"](2); console.error(new _SpClientError["default"]('Client-js:API', 'Could not access API: ' + url)); case 13: case "end": return _context5.stop(); } } }, _callee5, this, [[2, 10]]); })); function request(_x4) { return _request.apply(this, arguments); } return request; }() }]); return SPClient; }(_events.EventEmitter); exports["default"] = SPClient; //# sourceMappingURL=SPClient.js.map
import argparse from markdown import markdown def findnth(haystack, needle, n): parts = haystack.split(needle, n+1) if len(parts) <= n+1: return -1 return len(haystack)-len(parts[-1])-len(needle) def docs_to_html(output_file): rdme = './README.md' html_out = [] with open(rdme) as f: for line in f: if "For Developers" in line: break if "<img src=" in line: first_quote, second_quote = findnth(line, "\"", 0), findnth(line, "\"", 1) im_name = line[first_quote+1:second_quote] im_name_html = im_name.replace('./', 'images/') im_name_html = "{% static '" + im_name_html + "' }" line = line.replace(im_name, im_name_html) html_out.append(markdown(line)) html_out = "\n".join(html_out) with open(output_file, 'w') as f: f.write(html_out) if __name__ == '__main__': parser = argparse.ArgumentParser() default_out = '../embl-annotation-service/templates/images/about.html' parser.add_argument('--out_file', type=str, default=default_out) args = parser.parse_args() docs_to_html(args.out_file)
/* @flow */ import React, { PureComponent } from 'react'; import { FlatList, StyleSheet } from 'react-native'; import type { Actions } from '../types'; import { privateNarrow, groupNarrow } from '../utils/narrow'; import UserItem from '../users/UserItem'; import ConversationGroup from './ConversationGroup'; const styles = StyleSheet.create({ list: { flex: 1, flexDirection: 'column', }, }); type Props = { actions: Actions, conversations: Object[], presences: Object, usersByEmail: Object, }; export default class ConversationList extends PureComponent<Props> { props: Props; handleUserNarrow = (email: string) => this.props.actions.doNarrow(privateNarrow(email)); handleGroupNarrow = (email: string) => this.props.actions.doNarrow(groupNarrow(email.split(','))); render() { const { conversations, presences, usersByEmail } = this.props; return ( <FlatList style={styles.list} initialNumToRender={20} data={conversations} keyExtractor={item => item.recipients} renderItem={({ item }) => { if (item.recipients.indexOf(',') === -1) { const user = usersByEmail[item.recipients]; if (!user) return null; return ( <UserItem email={user.email} fullName={user.fullName} avatarUrl={user.avatarUrl} presence={presences[user.email]} unreadCount={item.unread} onPress={this.handleUserNarrow} /> ); } return ( <ConversationGroup email={item.recipients} unreadCount={item.unread} usersByEmail={usersByEmail} onPress={this.handleGroupNarrow} /> ); }} /> ); } }
const express = require('express'); const routes = express.Router(); const SessionController = require('../app/controllers/SessionController'); const ProfileController = require('../app/controllers/ProfileController'); const UserController = require('../app/controllers/UserController'); const UserValidator = require('../app/validators/user'); const ProfileValidator = require('../app/validators/profile'); const SessionValidator = require('../app/validators/session'); const { onlyUsers, isAdmin, isLoggedRedirectToProfile } = require('../app/middlewares/sessions'); // Login/logout // routes.get('/login', isLoggedRedirectToProfile, SessionController.loginForm); routes.post('/login', SessionValidator.login, SessionController.login) routes.post('/logout', SessionController.logout); // Profile // routes.get('/profile', onlyUsers, ProfileValidator.show, ProfileController.index); routes.put('/profile', onlyUsers, ProfileValidator.update, ProfileController.update); // Reset Password // routes.get('/forgot-password', SessionController.forgotForm); routes.get('/password-reset', SessionController.resetForm); routes.post('/forgot-password', SessionValidator.forgot, SessionController.forgot); routes.post('/password-reset', SessionValidator.reset, SessionController.reset); // User register // routes.get('/register', onlyUsers, isAdmin, UserController.registerForm); routes.post('/register', onlyUsers, isAdmin, UserValidator.post, UserController.post); // User management // routes.get('/', onlyUsers, isAdmin, UserController.list); routes.get('/:id/edit', onlyUsers, isAdmin, UserValidator.edit, UserController.edit); routes.put('/', onlyUsers, isAdmin, UserValidator.update, UserController.update); routes.delete('/', onlyUsers, isAdmin, UserValidator.exclude, UserController.delete); module.exports = routes;
/*=================================== Author : Bestwebcreator. Template Name: Anger - Creative Business & Portfolio Multi-purpose HTML5 Template Version : 1.8 ===================================*/ (function($) { 'use strict'; // init Isotope var $container = $('.loadmore').isotope({ itemSelector: '.portfolio-item', layoutMode: 'masonry', }); //**************************** // Isotope Load more button //**************************** var initShow = 8; //number of items loaded on init & onclick load more button var counter = initShow; //counter for load more button var iso = $container.data('isotope'); // get Isotope instance loadMore(initShow); //execute function onload function loadMore(toShow) { $container.find(".portfolio-item.portfolio_hide").removeClass("portfolio_hide"); var hiddenElems = iso.filteredItems.slice(toShow, iso.filteredItems.length).map(function(item) { return item.element; }); $(hiddenElems).addClass('portfolio_hide'); $container.isotope('layout'); //when no more to load, hide show more button if (hiddenElems.length == 0) { jQuery("#load-more").hide(); } else { jQuery("#load-more").show(); }; } //append load more button $container.after('<div class="text-center d-inline-block w-100"><button id="load-more" class="btn btn-default mt-5"> Load More</button></div>'); //when load more button clicked $("#load-more").click(function() { counter = counter + 4 ; loadMore(counter); }); })(jQuery);
""" Patch replicate function, to ignore those parameters/buffers that are not copied. Bring a 1.4x performance increase for super_net weights_manager using discrete rollout. """ # pylint: disable-all import os from itertools import chain import functools import torch from torch import distributed as dist from torch.nn.parallel.scatter_gather import scatter_kwargs, gather from torch.nn.parallel.parallel_apply import parallel_apply from torch.cuda._utils import _get_device_index from torch.nn.parallel import DataParallel as _DataParallel from torch.nn.parallel import DistributedDataParallel as _DistributedDataParallel from aw_nas.utils import logger as _logger _torch_version_major, _torch_version_minor = [ int(v) for v in torch.__version__.split(".")[:2] ] __all__ = ["replicate", "DataParallel", "data_parallel", "DistributedDataParallel"] if _torch_version_major == 1 and _torch_version_minor <= 3: # < 1.4.0 from torch.nn.parallel.replicate import ( _replicatable_module, _broadcast_coalesced_reshape, _is_script_module, _init_script_module, _is_script_method, _copy_scriptmodule_methods, ) def replicate(network, devices, detach=False): if not _replicatable_module(network): raise RuntimeError( "Cannot replicate network where python modules are " "childrens of ScriptModule" ) devices = list(map(lambda x: _get_device_index(x, True), devices)) num_replicas = len(devices) params = list(network.parameters()) param_indices = {param: idx for idx, param in enumerate(params)} param_copies = _broadcast_coalesced_reshape(params, devices, detach) buffers = list(network.buffers()) buffers_rg = [] buffers_not_rg = [] for buf in buffers: if buf.requires_grad and not detach: buffers_rg.append(buf) else: buffers_not_rg.append(buf) buffer_indices_rg = {buf: idx for idx, buf in enumerate(buffers_rg)} buffer_indices_not_rg = {buf: idx for idx, buf in enumerate(buffers_not_rg)} buffer_copies_rg = _broadcast_coalesced_reshape( buffers_rg, devices, detach=detach ) buffer_copies_not_rg = _broadcast_coalesced_reshape( buffers_not_rg, devices, detach=True ) modules = list(network.modules()) module_copies = [[] for _ in devices] module_indices = {} scriptmodule_skip_attr = { "_parameters", "_buffers", "_modules", "forward", "_c", } for i, module in enumerate(modules): module_indices[module] = i for j in range(num_replicas): if _is_script_module(module): # we have to initialize ScriptModule properly so that # it works with pybind11 replica = _init_script_module() attribute_names = set( entry[0] for entry in module._c._get_attributes() ) keys = ( set(module.__dict__.keys()) - scriptmodule_skip_attr - attribute_names ) for key in keys: if not _is_script_method(module.__dict__[key]): replica.__dict__[key] = module.__dict__[key] for name, the_type, value in module._c._get_attributes(): if name in module._buffers.keys(): continue replica._c._register_attribute(name, the_type, value) else: replica = module.__new__(type(module)) replica.__dict__ = module.__dict__.copy() replica._parameters = replica._parameters.copy() replica._buffers = replica._buffers.copy() replica._modules = replica._modules.copy() module_copies[j].append(replica) for i, module in enumerate(modules): for key, child in module._modules.items(): if child is None: for j in range(num_replicas): replica = module_copies[j][i] replica._modules[key] = None else: module_idx = module_indices[child] for j in range(num_replicas): replica = module_copies[j][i] replica._modules[key] = module_copies[j][module_idx] for key, param in module._parameters.items(): if param is None: for j in range(num_replicas): replica = module_copies[j][i] replica._parameters[key] = None else: param_idx = param_indices.get(param, None) if param_idx is None: continue for j in range(num_replicas): replica = module_copies[j][i] replica._parameters[key] = param_copies[j][param_idx] for key, buf in module._buffers.items(): if buf is None: for j in range(num_replicas): replica = module_copies[j][i] replica._buffers[key] = None else: if buf.requires_grad and not detach: buffer_copies = buffer_copies_rg buffer_idx = buffer_indices_rg.get(buf, None) else: buffer_copies = buffer_copies_not_rg buffer_idx = buffer_indices_not_rg.get(buf, None) if buffer_idx is None: continue for j in range(num_replicas): replica = module_copies[j][i] replica._buffers[key] = buffer_copies[j][buffer_idx] for j in range(num_replicas): _copy_scriptmodule_methods(modules, module_copies[j], module_indices) replicas = [module_copies[j][0] for j in range(num_replicas)] for model_replica in replicas: for _, submodule in model_replica.named_modules(): if hasattr(submodule, "on_replicate") and callable( submodule.on_replicate ): submodule.on_replicate() return replicas else: # For torch version >=1.4.0 # Do not support `candidate_member_mask=True` in `aw_nas.weights_manager.supernet.SuperNet` # (`cnn` search space) # Add the calls of `on_replicate` callback from torch.nn.parallel.replicate import replicate as _replicate @functools.wraps(_replicate) def replicate(*args, **kwargs): replicas = _replicate(*args, **kwargs) for model_replica in replicas: for _, submodule in model_replica.named_modules(): if hasattr(submodule, "on_replicate") and callable( submodule.on_replicate ): submodule.on_replicate() return replicas ## --- data parallel utils --- def data_parallel( module, inputs, device_ids=None, output_device=None, dim=0, module_kwargs=None, non_scatter_kwargs=None, ): r"""Evaluates module(input) in parallel across the GPUs given in device_ids. This is the functional version of the DataParallel module. Args: module (Module): the module to evaluate in parallel inputs (Tensor): inputs to the module device_ids (list of int or torch.device): GPU ids on which to replicate module output_device (list of int or torch.device): GPU location of the output Use -1 to indicate the CPU. (default: device_ids[0]) Returns: a Tensor containing the result of module(input) located on output_device """ if not isinstance(inputs, tuple): inputs = (inputs,) if device_ids is None: device_ids = list(range(torch.cuda.device_count())) if output_device is None: output_device = device_ids[0] device_ids = list(map(lambda x: _get_device_index(x, True), device_ids)) output_device = _get_device_index(output_device, True) src_device_obj = torch.device("cuda:{}".format(device_ids[0])) for tensor in chain(module.parameters(), module.buffers()): if tensor.device != src_device_obj: raise RuntimeError( "module must have its parameters and buffers " "on device {} (device_ids[0]) but found one of " "them on device: {}".format(src_device_obj, tensor.device) ) inputs, module_kwargs = scatter_kwargs(inputs, module_kwargs, device_ids, dim) if len(device_ids) == 1: return module(*inputs[0], **module_kwargs[0]) used_device_ids = device_ids[: len(inputs)] replicas = replicate(module, used_device_ids) outputs = parallel_apply(replicas, inputs, module_kwargs, used_device_ids) return gather(outputs, output_device, dim) class _WrapperModule(torch.nn.Module): def __init__(self, inner_module): super(_WrapperModule, self).__init__() self.inner_module = inner_module def forward(self, inputs, callback): return self.inner_module.forward_one_step_callback(inputs, callback) class DataParallel(_DataParallel): def replicate(self, module, device_ids): replicas = replicate(module, device_ids, not torch.is_grad_enabled()) return replicas def forward_one_step_callback(self, inputs, callback): _wrapper_module = _WrapperModule(self.module) return data_parallel( _wrapper_module, inputs, device_ids=self.device_ids, output_device=self.output_device, dim=self.dim, module_kwargs={"callback": callback}, ) class DistributedDataParallel(_DistributedDataParallel): def replicate(self, module, device_ids): replicas = replicate(module, device_ids, not torch.is_grad_enabled()) return replicas def parallelize(override_forward=True): def decorator(cls): ori_init = cls.__init__ ori_forward = cls.forward ori_getstate = cls.__getstate__ def __getstate__(self): state = ori_getstate(self) state.pop("parallel_model", None) return state @functools.wraps(ori_init) def __init__(self, *args, multiprocess=False, **kwargs): self.multiprocess = multiprocess ori_init(self, *args, **kwargs) if self.multiprocess: sync_bn = os.environ.get("AWNAS_SET_SYNC_BN", None) if sync_bn and sync_bn != "0": LOGGER.warning("Convert model to SyncBN in search process may cause some " "exception that SyncBN module expect nn.Parameter type weight, but " "sliced weight is torch.Tensor type.") net = SyncBatchNorm.convert_sync_batchnorm(self).to(self.device) else: net = self object.__setattr__( self, "parallel_model", DistributedDataParallel( net, (self.device,), find_unused_parameters=True, check_reduction=True, ), ) else: object.__setattr__(self, "parallel_model", self) @functools.wraps(ori_forward) def forward(self, *args, **kwargs): if not self.multiprocess: return ori_forward(self, *args, **kwargs) self.multiprocess = False out = self.parallel_model(*args, **kwargs) self.multiprocess = True return out cls.__init__ = __init__ cls.__getstate__ = __getstate__ if override_forward: cls.forward = forward return cls return decorator def get_dist_info(): if torch.__version__ < '1.0': initialized = dist._initialized else: if dist.is_available(): initialized = dist.is_initialized() else: initialized = False if initialized: rank = dist.get_rank() world_size = dist.get_world_size() else: rank = 0 world_size = 1 return rank, world_size def _check_support_candidate_member_mask(gpus, candidate_member_mask, wm_name): """ Helper function for checking that `candidate_member_mask` cannot be used for supernet weights managers, when using torch>=1.4.0. """ if len(gpus) > 1: if not (_torch_version_major == 1 and _torch_version_minor <= 3): assert not candidate_member_mask, \ ("When torch>=1.4.0 and data parallel is used, " "{} weights manager do not suport candidate_member_mask=True".format(wm_name))
# Copyright 2014 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. """ Presubmit for Chromium HTML/CSS/JS resources. See chrome/browser/PRESUBMIT.py. """ import regex_check class ResourceChecker(object): def __init__(self, input_api, output_api, file_filter=None): self.input_api = input_api self.output_api = output_api self.file_filter = file_filter def DeprecatedMojoBindingsCheck(self, line_number, line): return regex_check.RegexCheck(self.input_api.re, line_number, line, '(mojo_bindings\.js)', 'Please use mojo_bindings_lite.js in new code') def DisallowIncludeCheck(self, msg, line_number, line): return regex_check.RegexCheck(self.input_api.re, line_number, line, '^\s*(?:\/[\*\/])?\s*(<include)\s*src=', msg) # This is intentionally not included in RunChecks(). It's an optional check # that can be used from a PRESUBMIT.py in a directory that does not wish to # use <include> (i.e. uses a different bundling mechanism, does not grit # process, etc.). def DisallowIncludes(self, msg): check = lambda *args: self.DisallowIncludeCheck(msg, *args) return self._RunCheckOnAffectedFiles(check, 'Found resource errors in %s', is_error=True) def SelfClosingIncludeCheck(self, line_number, line): return regex_check.RegexCheck(self.input_api.re, line_number, line, '(</include>|<include.*/>)', 'Closing <include> tags is unnecessary.') def RunChecks(self): msg = 'Found resources style issues in %s' # TODO(crbug.com/931798): is_error for Mojo check when -lite is majority? return self._RunCheckOnAffectedFiles(self.DeprecatedMojoBindingsCheck, msg, only_changed_lines=True) + \ self._RunCheckOnAffectedFiles(self.SelfClosingIncludeCheck, msg) def _RunCheckOnAffectedFiles(self, check, msg_template, is_error=False, only_changed_lines=False): """Check for violations of the Chromium web development style guide. See https://chromium.googlesource.com/chromium/src/+/master/styleguide/web/web.md """ results = [] affected_files= self.input_api.AffectedFiles(file_filter=self.file_filter, include_deletes=False) for f in affected_files: errors = [] if only_changed_lines: contents = f.ChangedContents() else: contents = enumerate(f.NewContents(), start=1) for line_number, line in contents: error = check(line_number, line) if error: errors.append(error) if errors: abs_local_path = f.AbsoluteLocalPath() msg = msg_template % abs_local_path + '\n\n' + '\n'.join(errors) + '\n' if is_error: results.append(self.output_api.PresubmitError(msg)) else: results.append(self.output_api.PresubmitPromptWarning(msg)) return results
"""Provide info to system health.""" from pyisy import ISY from openpeerpower.components import system_health from openpeerpower.const import CONF_HOST from openpeerpower.core import OpenPeerPower, callback from .const import DOMAIN, ISY994_ISY, ISY_URL_POSTFIX @callback def async_register( opp: OpenPeerPower, register: system_health.SystemHealthRegistration ) -> None: """Register system health callbacks.""" register.async_register_info(system_health_info) async def system_health_info(opp): """Get info for the info page.""" health_info = {} config_entry_id = next( iter(opp.data[DOMAIN]) ) # Only first ISY is supported for now isy: ISY = opp.data[DOMAIN][config_entry_id][ISY994_ISY] entry = opp.config_entries.async_get_entry(config_entry_id) health_info["host_reachable"] = await system_health.async_check_can_reach_url( opp, f"{entry.data[CONF_HOST]}{ISY_URL_POSTFIX}" ) health_info["device_connected"] = isy.connected health_info["last_heartbeat"] = isy.websocket.last_heartbeat health_info["websocket_status"] = isy.websocket.status return health_info
/* This file is part of Ext JS 4.2 Copyright (c) 2011-2013 Sencha Inc Contact: http://www.sencha.com/contact GNU General Public License Usage This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. Build date: 2013-05-16 14:36:50 (f9be68accb407158ba2b1be2c226a6ce1f649314) */ /** * @author Ed Spencer * * Base Writer class used by most subclasses of {@link Ext.data.proxy.Server}. This class is responsible for taking a * set of {@link Ext.data.Operation} objects and a {@link Ext.data.Request} object and modifying that request based on * the Operations. * * For example a Ext.data.writer.Json would format the Operations and their {@link Ext.data.Model} instances based on * the config options passed to the JsonWriter's constructor. * * Writers are not needed for any kind of local storage - whether via a {@link Ext.data.proxy.WebStorage Web Storage * proxy} (see {@link Ext.data.proxy.LocalStorage localStorage} and {@link Ext.data.proxy.SessionStorage * sessionStorage}) or just in memory via a {@link Ext.data.proxy.Memory MemoryProxy}. * * # Dates * Before sending dates to the server, they can be formatted using one of the {@link Ext.Date} formats. * These formats can be specified both on the field and the writer itself. In terms of precedence, from highest to lowest: * * - {@link #dateFormat Writer.dateFormat} The writer dateFormat will always have the highest precedence * - {@link Ext.data.Field#dateWriteFormat} The dateWriteFormat will be used if no format is specified on the writer * - {@link Ext.data.Field#dateFormat Field.dateFormat}/{@link Ext.data.Field#dateReadFormat Field.dateReadFormat} * Finally, if none of the above options are specified the field will be formatted using the format that was used to read the date from the server. */ Ext.define('Ext.data.writer.Writer', { alias: 'writer.base', alternateClassName: ['Ext.data.DataWriter', 'Ext.data.Writer'], /** * @cfg {Boolean} writeAllFields * True to write all fields from the record to the server. If set to false it will only send the fields that were * modified. Note that any fields that have {@link Ext.data.Field#persist} set to false will still be ignored. */ writeAllFields: true, /** * @cfg {String} dateFormat * This is used for each field of type date in the model to format the value before * it is sent to the server. */ /** * @cfg {String} nameProperty * This property is used to read the key for each value that will be sent to the server. For example: * * Ext.define('Person', { * extend: 'Ext.data.Model', * fields: [{ * name: 'first', * mapping: 'firstName' * }, { * name: 'last', * mapping: 'lastName' * }, { * name: 'age' * }] * }); * new Ext.data.writer.Writer({ * writeAllFields: true, * nameProperty: 'mapping' * }); * * // This will be sent to the server * { * firstName: 'first name value', * lastName: 'last name value', * age: 1 * } * * If the value is not present, the field name will always be used. */ nameProperty: 'name', /** * @cfg {Boolean} [writeRecordId] * By default, each record's id is always included in the output for non-phantom records since in most * cases the id will be required on the server to process the record action. This is helpful since the id * will normally not be modified, and so would not be sent to the server unless {@link #writeAllFields} * was explicitly enabled. * * However, there are cases where it is not desirable for the record id to be passed in the data directly. * For example, when using a RESTful API the record id would typically be appended to the url instead. */ writeRecordId: true, /* * @property {Boolean} isWriter * `true` in this class to identify an object as an instantiated Writer, or subclass thereof. */ isWriter: true, /** * Creates new Writer. * @param {Object} [config] Config object. */ constructor: function(config) { Ext.apply(this, config); }, /** * Prepares a Proxy's Ext.data.Request object * @param {Ext.data.Request} request The request object * @return {Ext.data.Request} The modified request object */ write: function(request) { var operation = request.operation, records = operation.records || [], len = records.length, i = 0, data = []; for (; i < len; i++) { data.push(this.getRecordData(records[i], operation)); } return this.writeRecords(request, data); }, /** * Formats the data for each record before sending it to the server. This * method should be overridden to format the data in a way that differs from the default. * @param {Ext.data.Model} record The record that we are writing to the server. * @param {Ext.data.Operation} [operation] An operation object. * @return {Object} An object literal of name/value keys to be written to the server. * By default this method returns the data property on the record. */ getRecordData: function(record, operation) { var isPhantom = record.phantom === true, writeAll = this.writeAllFields || isPhantom, fields = record.fields, fieldItems = fields.items, data = {}, clientIdProperty = record.clientIdProperty, changes, field, key, mappedIdProperty, f, fLen; if (writeAll) { fLen = fieldItems.length; for (f = 0; f < fLen; f++) { field = fieldItems[f]; if (field.persist) { this.writeValue(data, field, record); } } } else { // Only write the changes changes = record.getChanges(); for (key in changes) { if (changes.hasOwnProperty(key)) { field = fields.get(key); if (field.persist) { this.writeValue(data, field, record); } } } } if (isPhantom) { if (clientIdProperty && operation && operation.records.length > 1) { // include clientId for phantom records, if multiple records are being written to the server in one operation. // The server can then return the clientId with each record so the operation can match the server records with the client records data[clientIdProperty] = record.internalId; } } else if (this.writeRecordId) { // Make sure that if a mapping is in place the mapped id name is used instead of the default field name. mappedIdProperty = fields.get(record.idProperty)[this.nameProperty] || record.idProperty; data[mappedIdProperty] = record.getId(); } return data; }, writeValue: function(data, field, record){ var name = field[this.nameProperty], dateFormat = this.dateFormat || field.dateWriteFormat || field.dateFormat, value = record.get(field.name); // Allow the nameProperty to yield a numeric value which may be zero. // For example, using a field's numeric mapping to write an array for output. if (name == null) { name = field.name; } if (field.serialize) { data[name] = field.serialize(value, record); } else if (field.type === Ext.data.Types.DATE && dateFormat && Ext.isDate(value)) { data[name] = Ext.Date.format(value, dateFormat); } else { data[name] = value; } } });
import {css} from 'lit'; export default css` :host { position: relative; } .big-btn { display: inline-block; margin: 10px auto; padding: 9px 14px; border-radius: 10px; font-weight: bold; font-size: 1.2em; background: rgba(107, 107, 107, 0.64); box-shadow: 0 3px 0 rgba(54, 54, 54, 0.94); opacity: 1; transition: all 0.19s; color: var(--yellow); } .big-btn:hover, .big-btn:focus { color: var(--yellow); box-shadow: 0 3px 0 var(--yellow); text-shadow: none; } .big-btn:active { box-shadow: none !important; transform: translateY(3px); } .big-btn span { padding-right: 10px; vertical-align: -1px; } .col-left { display: none; } .col-right { margin-top: 0; } .col-right > div { opacity: 1; visibility: visible; transition: 450ms opacity; position: static; width: 100%; margin-bottom: 20px; } .col-right > div:last-child { margin-bottom: 100px; } .col-right > div.fade-in { opacity: 1 !important; visibility: visible !important; transition: 300ms opacity; } #div-default { display: none; } /* > mobile */ @media (min-width: 801px) { ul { list-style-type: inherit; padding-left: 20px; } .col-left { display: block; } .col-right > div { opacity: 0; visibility: hidden; width: 44%; position: absolute; max-width: 728px; } .col-right > div:last-child { margin-bottom: 20px; } #div-default { display: block; } } /* tablet */ @media (min-width: 801px) and (max-width: 1265px) { .col-right { margin-top: 25px; } .col-right > div { width: 100%; max-width: 490px; } } `;
/** * @license * Copyright 2016 Google Inc. * * 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. */ goog.provide('shaka.text.Cue'); goog.provide('shaka.text.CueRegion'); /** * Creates a Cue object. * * @param {number} startTime * @param {number} endTime * @param {string} payload * * @implements {shaka.extern.Cue} * @constructor * @struct * @export */ shaka.text.Cue = function(startTime, endTime, payload) { const Cue = shaka.text.Cue; /** * @override * @exportInterface */ this.startTime = startTime; /** * @override * @exportInterface */ this.direction = Cue.direction.HORIZONTAL_LEFT_TO_RIGHT; /** * @override * @exportInterface */ this.endTime = endTime; /** * @override * @exportInterface */ this.payload = payload; /** * @override * @exportInterface */ this.region = new shaka.text.CueRegion(); /** * @override * @exportInterface */ this.position = null; /** * @override * @exportInterface */ this.positionAlign = Cue.positionAlign.AUTO; /** * @override * @exportInterface */ this.size = 0; /** * @override * @exportInterface */ this.textAlign = Cue.textAlign.CENTER; /** * @override * @exportInterface */ this.writingMode = Cue.writingMode.HORIZONTAL_TOP_TO_BOTTOM; /** * @override * @exportInterface */ this.lineInterpretation = Cue.lineInterpretation.LINE_NUMBER; /** * @override * @exportInterface */ this.line = null; /** * @override * @exportInterface */ this.lineHeight = ''; /** * Line Alignment is set to start by default. * @override * @exportInterface */ this.lineAlign = Cue.lineAlign.START; /** * Set the captions at the bottom of the text container by default. * @override * @exportInterface */ this.displayAlign = Cue.displayAlign.AFTER; /** * @override * @exportInterface */ this.color = ''; /** * @override * @exportInterface */ this.backgroundColor = ''; /** * @override * @exportInterface */ this.backgroundImage = ''; /** * @override * @exportInterface */ this.fontSize = ''; /** * @override * @exportInterface */ this.fontWeight = Cue.fontWeight.NORMAL; /** * @override * @exportInterface */ this.fontStyle = Cue.fontStyle.NORMAL; /** * @override * @exportInterface */ this.fontFamily = ''; /** * @override * @exportInterface */ this.textDecoration = []; /** * @override * @exportInterface */ this.wrapLine = true; /** * @override * @exportInterface */ this.id = ''; /** * @override * @exportInterface */ this.nestedCues = []; /** * @override * @exportInterface */ this.spacer = false; }; /** * Create a copy of the cue with the same properties. * @return {!shaka.text.Cue} * @suppress {checkTypes} since we must use [] and "in" with a struct type. */ shaka.text.Cue.prototype.clone = function() { const clone = new shaka.text.Cue(0, 0, ''); for (const k in this) { clone[k] = this[k]; // Make copies of array fields, but only one level deep. That way, if we // change, for instance, textDecoration on the clone, we don't affect the // original. if (clone[k] && clone[k].constructor == Array) { clone[k] = /** @type {!Array} */(clone[k]).slice(); } } return clone; }; /** * Check if two Cues have all the same values in all properties. * @param {!shaka.text.Cue} cue1 * @param {!shaka.text.Cue} cue2 * @return {boolean} * @suppress {checkTypes} since we must use [] and "in" with a struct type. */ shaka.text.Cue.equal = function(cue1, cue2) { for (const k in cue1) { if (k == 'nestedCues') { if (!shaka.util.ArrayUtils.equal( cue1.nestedCues, cue2.nestedCues, shaka.text.Cue.equal)) { return false; } } else if (k == 'region' || k == 'cellResolution') { for (const k2 in cue1[k]) { if (cue1[k][k2] != cue2[k][k2]) { return false; } } } else if (Array.isArray(cue1[k])) { if (!shaka.util.ArrayUtils.equal(cue1[k], cue2[k])) { return false; } } else { if (cue1[k] != cue2[k]) { return false; } } } return true; }; /** * @enum {string} * @export */ shaka.text.Cue.positionAlign = { 'LEFT': 'line-left', 'RIGHT': 'line-right', 'CENTER': 'center', 'AUTO': 'auto', }; /** * @enum {string} * @export */ shaka.text.Cue.textAlign = { 'LEFT': 'left', 'RIGHT': 'right', 'CENTER': 'center', 'START': 'start', 'END': 'end', }; /** * Vertical alignments of the cues within their extents. * 'BEFORE' means displaying at the top of the captions container box, 'CENTER' * means in the middle, 'BOTTOM' means at the bottom. * @enum {string} * @export */ shaka.text.Cue.displayAlign = { 'BEFORE': 'before', 'CENTER': 'center', 'AFTER': 'after', }; /** * @enum {string} * @export */ shaka.text.Cue.direction = { 'HORIZONTAL_LEFT_TO_RIGHT': 'ltr', 'HORIZONTAL_RIGHT_TO_LEFT': 'rtl', }; /** * @enum {string} * @export */ shaka.text.Cue.writingMode = { 'HORIZONTAL_TOP_TO_BOTTOM': 'horizontal-tb', 'VERTICAL_LEFT_TO_RIGHT': 'vertical-lr', 'VERTICAL_RIGHT_TO_LEFT': 'vertical-rl', }; /** * @enum {number} * @export */ shaka.text.Cue.lineInterpretation = { 'LINE_NUMBER': 0, 'PERCENTAGE': 1, }; /** * @enum {string} * @export */ shaka.text.Cue.lineAlign = { 'CENTER': 'center', 'START': 'start', 'END': 'end', }; /** * In CSS font weight can be a number, where 400 is normal and 700 is bold. * Use these values for the enum for consistency. * @enum {number} * @export */ shaka.text.Cue.fontWeight = { 'NORMAL': 400, 'BOLD': 700, }; /** * @enum {string} * @export */ shaka.text.Cue.fontStyle = { 'NORMAL': 'normal', 'ITALIC': 'italic', 'OBLIQUE': 'oblique', }; /** * @enum {string} * @export */ shaka.text.Cue.textDecoration = { 'UNDERLINE': 'underline', 'LINE_THROUGH': 'lineThrough', 'OVERLINE': 'overline', }; /** * Creates a CueRegion object. * * @implements {shaka.extern.CueRegion} * @constructor * @struct * @export */ shaka.text.CueRegion = function() { const CueRegion = shaka.text.CueRegion; /** * @override * @exportInterface */ this.id = ''; /** * @override * @exportInterface */ this.viewportAnchorX = 0; /** * @override * @exportInterface */ this.viewportAnchorY = 0; /** * @override * @exportInterface */ this.regionAnchorX = 0; /** * @override * @exportInterface */ this.regionAnchorY = 0; /** * @override * @exportInterface */ this.width = 100; /** * @override * @exportInterface */ this.height = 100; /** * @override * @exportInterface */ this.heightUnits = CueRegion.units.PERCENTAGE; /** * @override * @exportInterface */ this.widthUnits = CueRegion.units.PERCENTAGE; /** * @override * @exportInterface */ this.viewportAnchorUnits = CueRegion.units.PERCENTAGE; /** * @override * @exportInterface */ this.scroll = CueRegion.scrollMode.NONE; }; /** * @enum {number} * @export */ shaka.text.CueRegion.units = { 'PX': 0, 'PERCENTAGE': 1, 'LINES': 2, }; /** * @enum {string} * @export */ shaka.text.CueRegion.scrollMode = { 'NONE': '', 'UP': 'up', };
/* eslint-disable no-use-before-define */ import { CHANGE_ACTIVE_SLIDE, CHANGE_MODE } from '../constants/AppConstants'; export function changeActiveSlide(num) { return { type: CHANGE_ACTIVE_SLIDE, slide: num }; } export function changeMode(mode) { return { mode: mode, type: CHANGE_MODE }; }
module.exports = { UPDATE_VALUE ({ character, data }) { character.world.state[data.payload.key] = data.payload.value } }
import styled from 'styled-components'; import menuItemsStyles from './menuItemsStyles'; const StyledMenuItems = styled.div` ${menuItemsStyles}; `; export default StyledMenuItems;
# Copyright 2020 Google 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 # # https://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. """Macro for building e2e keras vision model tests.""" load("//bindings/python:build_defs.oss.bzl", "iree_py_test") load("@bazel_skylib//lib:new_sets.bzl", "sets") def iree_vision_test_suite( name, models, datasets, backends, reference_backend, failing_configurations = None, external_weights = None, tags = None, deps = None, size = "large", python_version = "PY3", **kwargs): """Creates a test for each configuration and bundles a succeeding and failing test suite. Creates one test per dataset, backend, and model. Tests indicated in `failing_configurations` are bundled into a suite suffixed with "_failing" tagged to be excluded from CI and wildcard builds. All other tests are bundled into a suite with the same name as the macro. Args: name: name of the generated passing test suite. If failing_configurations is not `None` then a test suite named name_failing will also be generated. models: an iterable of model names to generate targets for. datasets: an iterable specifying the datasets on which the models are based. This controls the shape of the input images. Also indicates which weight file to use when loading weights from an external source. backends: an iterable of targets backends to generate targets for. reference_backend: the backend to use as a source of truth for the expected output results. failing_configurations: an iterable of dictionaries with the keys `models`, `datasets` and `backends`. Each key points to a string or iterable of strings specifying a set of models, datasets and backends that are failing. external_weights: a base url to fetch trained model weights from. tags: tags to apply to the test. Note that as in standard test suites, manual is treated specially and will also apply to the test suite itself. deps: test dependencies. size: size of the tests. Default: "large". python_version: the python version to run the tests with. Uses python3 by default. **kwargs: any additional arguments that will be passed to the underlying tests and test_suite. """ failing_set = sets.make([]) if failing_configurations != None: # Parse failing configurations. for configuration in failing_configurations: # Normalize configuration input. # {backend: "iree_llvmjit"} -> {backend: ["iree_llvmjit"]} for key, value in configuration.items(): if type(value) == type(""): configuration[key] = [value] for model in configuration["models"]: for dataset in configuration["datasets"]: for backend in configuration["backends"]: sets.insert(failing_set, (model, dataset, backend)) tests = [] for model in models: for dataset in datasets: for backend in backends: # Check if this is a failing configuration. failing = sets.contains(failing_set, (model, dataset, backend)) # Append "_failing" to name if this is a failing configuration. test_name = name if not failing else name + "_failing" test_name = "{}_{}_{}__{}__{}".format( test_name, model, dataset, reference_backend, backend, ) tests.append(test_name) args = [ "--model={}".format(model), "--data={}".format(dataset), "--include_top=1", "--reference_backend={}".format(reference_backend), "--target_backends={}".format(backend), ] if external_weights: args.append("--url={}".format(external_weights)) # TODO(GH-2175): Simplify this after backend names are # standardized. # "iree_<driver>" --> "<driver>" driver = backend.replace("iree_", "") if driver == "llvmjit": driver = "llvm" py_test_tags = ["driver={}".format(driver)] if tags != None: # `is` is not supported. py_test_tags += tags # Add additional tags if this is a failing configuration. if failing: py_test_tags += [ "failing", # Only used for test_suite filtering below. "manual", "nokokoro", "notap", ] iree_py_test( name = test_name, main = "vision_model_test.py", srcs = ["vision_model_test.py"], args = args, tags = py_test_tags, deps = deps, size = size, python_version = python_version, **kwargs ) native.test_suite( name = name, tests = tests, # Add "-failing" to exclude tests in `tests` that have the "failing" # tag. tags = tags + ["-failing"], # If there are kwargs that need to be passed here which only apply to # the generated tests and not to test_suite, they should be extracted # into separate named arguments. **kwargs ) if failing_configurations != None: native.test_suite( name = name + "_failing", tests = tests, # Add "+failing" to only include tests in `tests` that have the # "failing" tag. tags = tags + ["+failing"], # If there are kwargs that need to be passed here which only apply # to the generated tests and not to test_suite, they should be # extracted into separate named arguments. **kwargs )
const baseURL = "http://localhost:8080"; const navBar = document.getElementById("nav-bar"); navBar.innerHTML = ` <div id="shift-leader-div"> <div class="shift-leader-info"> <ul> <li>Vagtleder:</li> <li id="shift-leader-name"></li> </ul> </div> <div class="shift-leader-info"> <ul> <li>Telefonnummer:</li> <li id="shift-leader-phoneNumber"></li> </ul> </div> </div> <div class="middle"> <a href="../moranti_html/overview.html"> <p><b>Overblik</b></p> </a> <a href="../moranti_html/waitinglist.html"> <p><b>Venteliste</b></p> </a> <a href="../moranti_html/cars.html"> <p><b>Biler</b></p> </a> <a href="../moranti_html/employees.html"> <p><b>Ansatte</b></p> </a> <a href="../moranti_html/caseType.html"> <p><b>Sagstyper</b></p> </a> <div id="week-number"></div> </div> `; //Lavet med hjælp fra https://stackoverflow.com/questions/6117814/get-week-of-year-in-javascript-like-in-php function getWeekNumber(date) { // Copy date so don't modify original date = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())); // Set to nearest Thursday: current date + 4 - current day number // Make Sunday's day number 7 date.setUTCDate(date.getUTCDate() + 4 - (date.getUTCDay()||7)); // Get first day of year let yearStart = new Date(Date.UTC(date.getUTCFullYear(),0,1)); // Calculate full weeks to the nearest Thursday and Return week number return Math.ceil((((date - yearStart) / 86400000) + 1) / 7); } let result = getWeekNumber(new Date()); document.getElementById("week-number").innerText = "Uge " + result.toString(); function escapeHTML(string) { if (!string) { return ""; } string = string.replace(`&`, "&amp;"); string = string.replace(`>`, "&gt;"); string = string.replace(`<`, "&lt;"); string = string.replace(`"`, "&quot;"); string = string.replace(`/`, "&#039;"); return string; }
import React, { useEffect, useState } from "react" import { useStaticQuery, graphql } from "gatsby" import AOS from "aos" import "aos/dist/aos.css" import PropTypes from "prop-types" import Helmet from "react-helmet" import Footer from "../components/footer/index" import MainFloatingScreen from "../components/floatingScreens/main/index" import MainFloatingMenu from "../components/floatingScreens/menu/index" import Cursor from "../components/cursor/cursor" import "../layouts/layout.css" import "../fonts/stylesheet.css" const Layout = ({ children, location }) => { // const [load, setLoad] = useState(true); function removeFixed() { let mainElement = document.querySelectorAll(".main__section__wrapper") window.onscroll = function() { var top = (window.pageYOffset || document.scrollTop) - (document.clientTop || 0) if (mainElement.length > 0) { if ( top >= document.querySelectorAll(".main__section__wrapper")[0].offsetTop - 90 ) { document .querySelectorAll(".column__top__one")[0] .classList.add("force__absolute") document .querySelectorAll(".column__top__two")[0] .classList.add("force__absolute") } else { document .querySelectorAll(".column__top__one")[0] .classList.remove("force__absolute") document .querySelectorAll(".column__top__two")[0] .classList.remove("force__absolute") } } } } // This function draw all lines with class .separator that are inside a parent element with the class .includes__separator function drawLines() { var lines = [...document.querySelectorAll(".includes__separator")] if (lines.length > 0) { lines.map((line, index) => { var isDrawed = false if (!isDrawed) { window.addEventListener( "scroll", function() { var top = (window.pageYOffset || document.scrollTop) - (document.clientTop || 0) let innerLine = line.querySelectorAll(".separator")[0] if (innerLine) { if (top > line.offsetTop + 350) { innerLine.classList.add("full") } } }, { passive: true } ) return false } }) } } // This function handle the position of the footer, once you scroll more than 1000px the footer become fixed thiw way it reveals at the end function changePositionFooter() { window.addEventListener( "scroll", function() { var top = (window.pageYOffset || document.scrollTop) - (document.clientTop || 0) if (top > 1000) { document.querySelectorAll(".footer")[0].classList.add("fixed__footer") } else { document .querySelectorAll(".footer")[0] .classList.remove("fixed__footer") } }, { passive: true } ) } // START SMOOTH SCROLLING // function init() { new SmoothScroll(document, 90, 20) } function SmoothScroll(target, speed, smooth) { if (target === document) target = document.scrollingElement || document.documentElement || document.body.parentNode || document.body // cross browser support for document scrolling var moving = false var pos = target.scrollTop var frame = target === document.body && document.documentElement ? document.documentElement : target // safari is the new IE target.addEventListener("mousewheel", scrolled, { passive: false }) target.addEventListener("DOMMouseScroll", scrolled, { passive: false }) function scrolled(e) { e.preventDefault() // disable default scrolling var delta = normalizeWheelDelta(e) pos += -delta * speed pos = Math.max(0, Math.min(pos, target.scrollHeight - frame.clientHeight)) // limit scrolling if (!moving) update() } function normalizeWheelDelta(e) { if (e.detail) { if (e.wheelDelta) return (e.wheelDelta / e.detail / 40) * (e.detail > 0 ? 1 : -1) // Opera else return -e.detail / 3 // Firefox } else return e.wheelDelta / 120 // IE,Safari,Chrome } function update() { moving = true var delta = (pos - target.scrollTop) / smooth target.scrollTop += delta if (Math.abs(delta) > 0.5) requestFrame(update) else moving = false } var requestFrame = (function() { // requestAnimationFrame cross browser return ( window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(func) { window.setTimeout(func, 1000 / 50) } ) })() } // ENDS SMOOTH SCROLLING // // Add shareable Link function addShareLink() { Array.from(document.querySelectorAll(".share__project")).map(element => { element.dataset.sharelink = window.location.href element.addEventListener("click", function(e) { var textarea = document.createElement("textarea") textarea.textContent = e.target.getAttribute("data-sharelink") textarea.style.position = "fixed" // Prevent scrolling to bottom of page in Microsoft Edge. document.body.appendChild(textarea) textarea.select() try { return document.execCommand("copy") // Security exception may be thrown by some browsers. } catch (ex) { return false } finally { document.body.removeChild(textarea) } }) return false }) } function hideCopyrights() { window.addEventListener( "scroll", function() { var top = (window.pageYOffset || document.scrollTop) - (document.clientTop || 0) if (top > 1500) { document.querySelectorAll( ".main__floating__menu .copyright__inner" )[0].style.opacity = "0" } else { document.querySelectorAll( ".main__floating__menu .copyright__inner" )[0].style.opacity = "1" } }, { passive: true } ) } useEffect(() => { if (window.innerWidth > 768) { init() } removeFixed() drawLines() hideCopyrights() changePositionFooter() addShareLink() AOS.init({ disable: "mobile", once: true, // whether animation should happen only once - while scrolling down mirror: true, // whether elements should animate out while scrolling past them }) setTimeout(function() { var linkMont = document.createElement("link") linkMont.id = "montserrat__font" linkMont.rel = "stylesheet" linkMont.href = "https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap" document.head.appendChild(linkMont) var linkMul = document.createElement("link") linkMul.id = "muli__font" linkMul.rel = "stylesheet" linkMul.href = "https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700&display=swap" document.head.appendChild(linkMul) }, 100) }) // Next query will return the site data, the master acf fields for whole website data, the logo and the favicon. const data = useStaticQuery(graphql` query { allWordpressSiteMetadata { edges { node { description home name url } } } wordpressAcfOptions { options { web_info_column_one web_info_column_two copyright_info contact_email contact_phone management_agreements_info } } logo: allWordpressWpMedia(filter: { title: { eq: "logo" } }) { nodes { source_url title } } favicon: allWordpressWpMedia(filter: { title: { eq: "favicon" } }) { nodes { source_url title } } allWordpressMenusMenusItems(filter: { slug: { eq: "legal-menu" } }) { edges { node { id items { target title url classes attr_title wordpress_id } } } } } `) const siteDataAcf = data.wordpressAcfOptions.options let legalMenu = false let siteLogo = false let siteFavicon = false if (data.logo.nodes.length > 0) { siteLogo = data.logo.nodes[0] } if (data.favicon.nodes.length > 0) { siteFavicon = data.favicon.nodes[0].source_url } if (data.allWordpressMenusMenusItems) { legalMenu = data.allWordpressMenusMenusItems.edges[0].node.items } return ( <> { <> <Helmet> <link rel="icon" href={siteFavicon} /> <html lang="en" /> <script> {` var _ss = _ss || []; _ss.push(['_setDomain', 'https://koi-3QNMLPDA8K.marketingautomation.services/net']); _ss.push(['_setAccount', 'KOI-4A1I4J0QBS']); _ss.push(['_trackPageView']); (function() { var ss = document.createElement('script'); ss.type = 'text/javascript'; ss.async = true; ss.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'koi-3QNMLPDA8K.marketingautomation.services/client/ss.js?ver=2.4.0'; var scr = document.getElementsByTagName('script')[0]; scr.parentNode.insertBefore(ss, scr); })(); var callThisOnReturn = function(resp) { if (resp) { var SharpSpringTracking = resp.trackingID; } }; _ss.push(['_setResponseCallback', callThisOnReturn]); `} </script> <script async src="https://www.googletagmanager.com/gtag/js?id=G-E0E56Y63NM" ></script> <script> {` window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-E0E56Y63NM'); `} </script> </Helmet> <Cursor></Cursor> <MainFloatingMenu agreements={siteDataAcf.management_agreements_info} siteLogo={siteLogo} siteAcf={siteDataAcf} ></MainFloatingMenu> <div className="page__wrapper" id="page__wrapper"> <MainFloatingScreen siteLogo={siteLogo} siteAcf={siteDataAcf} ></MainFloatingScreen> <div id="top"></div> <main>{children}</main> <Footer copyright={siteDataAcf.copyright_info} menu={legalMenu} ></Footer> </div> </> } </> ) } Layout.propTypes = { children: PropTypes.node.isRequired, } export default Layout
const { axios, RTError, IDHelper, _P } = require('../utils/node'); const logger = require('../utils/logger'); const op = require('../core/op'); const { PAGE_SIZE } = require('../conf/sys-config'); function filter(e) { // 处理shortcut if (e.shortcutDetails) { e.id = e.shortcutDetails.targetId; e.mimeType = e.shortcutDetails.targetMimeType; } const r = { type: 1, name: e.name, time: e.modifiedTime, id: e.id, }; if (e.mimeType !== 'application/vnd.google-apps.folder') { r.type = 0; r.mime = e.mimeType; r.size = Number(e.size); } return r; } class Googledrive extends IDHelper { static async build(config) { const g = new Googledrive(config); if (config.callback_code) { await g.redeemCode(config.callback_code); } else { await g.refreshToken(); } g.service.defaults.headers.common.Authorization = 'Bearer ' + g.access_token; return g; } constructor({ refresh_token, root }) { super(root); this.oauth = Object.assign({}, Googledrive.oauth2s[0], { refresh_token }); const service = axios.create({ baseURL: this.oauth.api_url }); service.interceptors.response.use( (response) => response.data, (err) => { if (err.response && err.response.data && err.response.data.error) { if (err.response.status === 404) { return Promise.reject(new RTError(404, 'ItemNotExist')); } else { const d = err.response.data.error; return Promise.reject(new RTError(400, 'ModuleError', d.message || d)); } } return Promise.reject(err); } ); this.service = service; } async refreshToken() { const data = await this.service.post( this.oauth.oauth_url, new URLSearchParams({ client_id: this.oauth.client_id, client_secret: this.oauth.client_secret, grant_type: 'refresh_token', refresh_token: this.oauth.refresh_token, }) ); this.access_token = data.access_token; logger.log('google drive access_token:' + data.access_token); return data; } async redeemCode(code) { return this.service .post( this.oauth.oauth_url, new URLSearchParams({ code, client_id: this.oauth.client_id, client_secret: this.oauth.client_secret, redirect_uri: this.oauth.redirect_uri, grant_type: 'authorization_code', }) ) .then((data) => { this.oauth.refresh_token = data.refresh_token; this.access_token = data.access_token; return data; }); } async findChildItem(pid, name) { return this.service .get('drive/v3/files', { params: { includeItemsFromAllDrives: true, supportsAllDrives: true, q: `name = '${name}' and '${pid}' in parents and trashed = false`, orderBy: 'folder,name,modifiedTime desc', fields: 'files(id,name,mimeType,size,modifiedTime,shortcutDetails),nextPageToken', pageSize: 10, }, }) .then((data) => { const e = data.files.map(filter).find((e) => e.name === name); if (!e) { throw new RTError(404, 'ItemNotExist'); } e.pid = pid; return e; }); } async itemInfo(id) { return this.service .get(`drive/v3/files/${id}`, { params: { supportsAllDrives: true, fields: 'id,name,mimeType,size,modifiedTime,shortcutDetails', }, }) .then(filter); } async fetchList(parentId, pageToken) { const params = { includeItemsFromAllDrives: true, supportsAllDrives: true, q: `'${parentId}' in parents and trashed = false`, orderBy: 'folder,name,modifiedTime desc', fields: 'files(id,name,mimeType,size,modifiedTime,shortcutDetails,webContentLink,thumbnailLink),nextPageToken', pageSize: PAGE_SIZE, }; if (pageToken) { params.pageToken = pageToken; } return this.service.get('drive/v3/files', { params }).then((data) => ({ list: data.files.map(filter), next: data.nextPageToken, })); } downInfo(id) { return { url: `https://www.googleapis.com/drive/v3/files/${id}?alt=media&supportsAllDrives=true`, headers: { Authorization: 'Bearer ' + this.access_token, }, }; } } Googledrive.oauth2s = [ { client_id: '202264815644.apps.googleusercontent.com', client_secret: 'X4Z3ca8xfWDb1Voo-F9a7ZxJ', oauth_url: 'https://www.googleapis.com/oauth2/v4/token', api_url: 'https://www.googleapis.com/', redirect_uri: 'urn:ietf:wg:oauth:2.0:oob', }, ]; // Googledrive.oauth2s[0].client_id = '695250577395-08nocpbl8suogn56vjlpmifnhp5a4d7e.apps.googleusercontent.com'; // Googledrive.oauth2s[0].client_secret = 'k8xsOAGqhcmF1peWUDhZOeCK'; // Googledrive.oauth2s[0].redirect_uri = 'https://point.onesrc.cn/oauth2'; module.exports = { params() { const { client_id, redirect_uri } = Googledrive.oauth2s[0]; const a = `https://accounts.google.com/o/oauth2/auth?client_id=${encodeURIComponent( client_id )}&redirect_uri=${redirect_uri}&response_type=code&access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&approval_prompt=auto`; return [ _P('callback_code', '', `快速获取callback_code:<a href="${a}" target="_blank">${a}</a>`, 7, '与refresh_token互斥,二选一', false, true), _P('refresh_token', '', '', 7, '与callback_code互斥,二选一', false, true), _P('root', '', '默认为根目录;如果想使用子目录,请填写目录id;如果想使用团队盘,请使用团队盘id', 5, 'root', false, false), ]; }, async handle(config, data, cache, ctx) { if ((cache.etime || 0) < Date.now()) { if (!config.root) { config.root = 'root'; } if (!config.refresh_token && !config.callback_code) { throw new RTError(400, 'ConfigError', { fields: ['callback_code', 'refresh_token'] }); } cache.$g = await Googledrive.build(config); if (config.callback_code) { config.refresh_token = cache.$g.oauth.refresh_token; delete config.callback_code; await op.saveConfig(); } cache.etime = Date.now() + 3600 * 1000; } if (!data.id) { data.id = await cache.$g.getIDByPath(data.path); } return this[data.command](data, cache, ctx); }, async ls({ path, id, page }, { $g }, ctx) { if (path.endsWith('/')) { const { list, next } = await $g.fetchList(id, page); if (list.length === 0) { const e = await $g.itemInfo(id); if (e.type === 0) { throw new RTError(400, 'ItemIsFile'); } } ctx.respondList(list, next); } else { const e = await $g.itemInfo(id); ctx.respondOne(e, e.type ? null : $g.downInfo(e.id)); } }, };
import argparse import json import os import re import shutil import sys import time from pathlib import Path from typing import Any, Callable, List, TypedDict import cli_ui as ui import psutil import tankerci import tankerci.conan import tankerci.js class TestFailed(Exception): pass class Config(TypedDict): build: str publish: List[str] # Publish packages in order so that dependencies don't break during deploy configs: List[Config] = [ {"build": "global-this", "publish": ["@tanker/global-this"]}, {"build": "errors", "publish": ["@tanker/errors"]}, {"build": "crypto", "publish": ["@tanker/crypto"]}, { "build": "file-ponyfill", "publish": ["@tanker/file-ponyfill"], }, {"build": "file-reader", "publish": ["@tanker/file-reader"]}, {"build": "http-utils", "publish": ["@tanker/http-utils"]}, {"build": "types", "publish": ["@tanker/types"]}, { "build": "streams", "publish": [ "@tanker/stream-base", "@tanker/stream-cloud-storage", ], }, { "build": "datastores", "publish": [ "@tanker/datastore-base", "@tanker/datastore-dexie-base", "@tanker/datastore-dexie-browser", "@tanker/datastore-pouchdb-base", "@tanker/datastore-pouchdb-memory", "@tanker/datastore-pouchdb-node", ], }, {"build": "core", "publish": ["@tanker/core"]}, { "build": "client-browser", "publish": ["@tanker/client-browser"], }, {"build": "client-node", "publish": ["@tanker/client-node"]}, { "build": "verification-ui", "publish": ["@tanker/verification-ui"], }, { "build": "fake-authentication", "publish": ["@tanker/fake-authentication"], }, {"build": "filekit", "publish": ["@tanker/filekit"]}, ] private_modules = [ "@tanker/datastore-dexie-memory", "@tanker/benchmarks", "@tanker/functional-tests", ] def find_procs_by_name(name: str) -> psutil.Process: "Return a list of processes matching 'name'." ls = [] for p in psutil.process_iter(attrs=["name", "exe", "cmdline"]): if ( name == p.info["name"] or p.info["exe"] and os.path.basename(p.info["exe"]) == name or p.info["cmdline"] and p.info["cmdline"][0] == name ): ls.append(p) return ls def kill_windows_process_if_running(name: str) -> None: processes = find_procs_by_name(name) for p in processes: p.kill() psutil.wait_procs(processes) def kill_windows_processes() -> None: kill_windows_process_if_running("msedge.exe") kill_windows_process_if_running("iexplore.exe") kill_windows_process_if_running("dllhost.exe") def onerror(navigator: str) -> Callable[..., None]: def fcn(_: Callable[..., None], path: str, e: Any) -> None: ui.error( f"While attempting to clear {navigator}'s state, ", f"unable to delete path: {path}\n", f"error: {e}", ) shutil.rmtree(path, ignore_errors=True) return fcn def delete_ie_state() -> None: kill_windows_processes() localappdata = os.environ.get("LOCALAPPDATA") ie_db_path = Path(r"%s\Microsoft\Internet Explorer\Indexed DB" % localappdata) shutil.rmtree(ie_db_path, onerror=onerror("IE")) """ This magic value is the combination of the following bitflags: #define CLEAR_HISTORY 0x0001 // Clears history #define CLEAR_COOKIES 0x0002 // Clears cookies #define CLEAR_CACHE 0x0004 // Clears Temporary Internet Files folder #define CLEAR_CACHE_ALL 0x0008 // Clears offline favorites and download history #define CLEAR_FORM_DATA 0x0010 // Clears saved form data for form auto-fill-in #define CLEAR_PASSWORDS 0x0020 // Clears passwords saved for websites #define CLEAR_PHISHING_FILTER 0x0040 // Clears phishing filter data #define CLEAR_RECOVERY_DATA 0x0080 // Clears webpage recovery data #define CLEAR_SHOW_NO_GUI 0x0100 // Do not show a GUI when running the cache clearing Total: 511 """ tankerci.run("RunDll32.exe", "InetCpl.cpl,ClearMyTracksByProcess", "511") time.sleep(5) def delete_safari_state() -> None: safari_user_path = Path(r"~/Library/Safari").expanduser() if safari_user_path.exists(): shutil.rmtree(safari_user_path) def run_tests_in_browser_ten_times(*, runner: str) -> None: failures = list() for i in range(1, 11): print("\n" + "-" * 80 + "\n") print("Running tests round", i) print("-" * 80, end="\n\n") try: run_tests_in_browser(runner=runner) except (Exception, SystemExit): failures.append(i) if failures: print("Tests failed") print("Failed rounds:", repr(failures)) raise TestFailed def run_tests_in_browser(*, runner: str) -> None: if runner == "linux": tankerci.js.run_yarn("karma", "--browsers", "ChromeInDocker") elif runner == "macos": tankerci.run("killall", "Safari", check=False) delete_safari_state() tankerci.js.run_yarn("karma", "--browsers", "Safari") elif runner == "windows-edge": kill_windows_processes() tankerci.js.run_yarn("karma", "--browsers", "EdgeHeadless") elif runner == "windows-ie": delete_ie_state() tankerci.js.run_yarn("karma", "--browsers", "IE") def get_package_path(package_name: str) -> Path: m = re.match(r"^@tanker/(?:(datastore|stream)-)?(.*)$", package_name) p = Path("packages") assert m if m[1]: p = p.joinpath(m[1]) p = p.joinpath(m[2]) return p def version_to_npm_tag(version: str) -> str: for tag in ["alpha", "beta"]: if tag in version: return tag return "latest" def publish_npm_package(package_name: str, version: str) -> None: package_path = get_package_path(package_name) npm_tag = version_to_npm_tag(version) tankerci.run( "npm", "publish", "--access", "public", "--tag", npm_tag, cwd=package_path ) def run_tests_in_node() -> None: tankerci.js.run_yarn("exec", "--", "node", "--version") tankerci.js.run_yarn("build:ts") tankerci.js.run_yarn("coverage") def lint() -> None: tankerci.js.yarn_install_deps() tankerci.js.run_yarn("build:ts") tankerci.js.run_yarn("lint:js") tankerci.js.run_yarn("lint:ts:all") tankerci.js.run_yarn("lint:compat:all") def check(*, runner: str, nightly: bool) -> None: tankerci.js.yarn_install_deps() if nightly: run_tests_in_browser_ten_times(runner=runner) elif runner == "node": run_tests_in_node() else: run_tests_in_browser(runner=runner) def e2e(*, use_local_sources: bool) -> None: if use_local_sources: base_path = Path.cwd().parent else: base_path = tankerci.git.prepare_sources( repos=["sdk-python", "sdk-js", "qa-python-js"] ) tankerci.conan.set_home_isolation() tankerci.conan.update_config() with tankerci.working_directory(base_path / "sdk-python"): tankerci.run("poetry", "install", "--no-root") tankerci.conan.install_tanker_source( tankerci.conan.TankerSource.SAME_AS_BRANCH, output_path=Path("conan") / "out", profiles=["linux-release"], update=False, tanker_deployed_ref=None, ) tankerci.run("poetry", "install") with tankerci.working_directory(base_path / "sdk-js"): tankerci.js.yarn_install() tankerci.js.run_yarn("build:ts") with tankerci.working_directory(base_path / "qa-python-js"): tankerci.run("poetry", "install") tankerci.run("poetry", "run", "pytest", "--verbose", "--capture=no") def deploy_sdk(*, version: str) -> None: tankerci.js.yarn_install_deps() tankerci.bump.bump_files(version) for config in configs: tankerci.js.yarn_build(delivery=config["build"], env="prod") for package_name in config["publish"]: publish_npm_package(package_name, version) def patch_dexie_resolution(*, test_dir: Path) -> None: # Freeze dexie version until https://github.com/dfahlander/Dexie.js/issues/1439 is fixed package = test_dir / "package.json" with open(package, "r+") as package_file: data = json.load(package_file) package_file.seek(0) # rewind data["resolutions"] = {"dexie": "3.0.3"} json.dump(data, package_file, indent=4) def test_deploy(*, version: str) -> None: test_dir = Path("test") index_file = test_dir / "index.js" test_dir.mkdir() tankerci.js.run_yarn("init", "--yes", cwd=test_dir) patch_dexie_resolution(test_dir=test_dir) tankerci.js.run_yarn("add", f"@tanker/client-browser@{version}", cwd=test_dir) index_file.write_text('require("@tanker/client-browser");') tankerci.run("node", "index.js", cwd=test_dir) def _main() -> None: parser = argparse.ArgumentParser() subparsers = parser.add_subparsers(title="subcommands", dest="command") subparsers.add_parser("lint") check_parser = subparsers.add_parser("check") check_parser.add_argument("--nightly", action="store_true") check_parser.add_argument("--runner", required=True) deploy_parser = subparsers.add_parser("deploy") deploy_parser.add_argument("--version", required=True) e2e_parser = subparsers.add_parser("e2e") e2e_parser.add_argument("--use-local-sources", action="store_true", default=False) subparsers.add_parser("lint") test_deploy_parser = subparsers.add_parser("test-deploy") test_deploy_parser.add_argument("--version", required=True) args = parser.parse_args() if args.command == "check": runner = args.runner nightly = args.nightly check(runner=runner, nightly=nightly) elif args.command == "lint": lint() elif args.command == "deploy": deploy_sdk(version=args.version) elif args.command == "e2e": e2e(use_local_sources=args.use_local_sources) elif args.command == "test-deploy": test_deploy(version=args.version) else: parser.print_help() sys.exit(1) def main() -> None: # hide backtrace when tests fail try: _main() except TestFailed: sys.exit(1) except Exception: raise if __name__ == "__main__": main()
# # This file is part of rasp-machine. # # Copyright (C) 2021 by Franck Chauvel # # This code is licensed under the MIT License. # See LICENSE.txt for details # from rasp.debug.controller import Break, DebugController, Quit, SetAccumulator, SetMemory, \ SetInstructionPointer, ShowCPU, ShowMemory, ShowSource, Step from unittest import TestCase class CommandParserTest(TestCase): def verify(self, expectation, text): command = DebugController._parse_command(text) self.assertEqual(expectation, command) def test_set_ip(self): self.verify(SetInstructionPointer(25), "set ip 25") def test_set_acc(self): self.verify(SetAccumulator(25), "set acc 25") def test_set_memory(self): self.verify(SetMemory(25, -10), "set memory 25 -10") def test_break(self): self.verify(Break(24), "break at address 24") def test_step(self): self.verify(Step(), "step") def test_quit(self): self.verify(Quit(), "quit") def test_show_memory(self): self.verify(ShowMemory(10, 30), "show memory 10 30") def test_show_cpu(self): self.verify(ShowCPU(), "show cpu") def test_show_source(self): self.verify(ShowSource(), "show source") def test_show_source_with_start(self): self.verify(ShowSource(start=12), "show source 12") def test_show_source_with_start_and_end(self): self.verify(ShowSource(12, 20), "show source 12 20")
# ask user if they want a top or a bottom color selection # input what color they watn from our given list # return color combos for that chosen color top_or_bottom = input("would you like a top or a bottom: ") if top_or_bottom == "top": color_top = input("Choose a color: red, green, white, black, blue, purple, orange: ") if color_top == "red": weather = input("is it cold or hot: ") if weather == "cold": print("use black pants: ") elif weather == "hot": print("use red shorts") else: print("please choose the weather situation") """" elif top_or_bottom == "bottom": color_top = input("What color is your bottom: yellow,red,orange,blue,purple,green,white,black: ") else: print("what nonsense is this") fdsfsdfsdfsdf """
import pytest from app.extensions import db from tests.constants import TEST_PARTY_PER_FIRST_NAME_1, TEST_PARTY_PER_PARTY_NAME_1, TEST_PARTY_PER_GUID_1, TEST_MANAGER_GUID, TEST_MINE_GUID, TEST_PARTY_ORG_NAME from app.api.users.minespace.models.minespace_user import MinespaceUser TEST_MINESPACE_USER_EMAIL1 = "email1@srv.com" @pytest.fixture(scope="function") def setup_info(test_client): mu = MinespaceUser.create_minespace_user(TEST_MINESPACE_USER_EMAIL1) mu.save() yield dict(test_minespace_user=mu) db.session.delete(mu) db.session.commit() def test_minespace_user_model_find_by_id(test_client, auth_headers, setup_info): mu = MinespaceUser.find_by_id(setup_info["test_minespace_user"].user_id) assert str(mu.email) == TEST_MINESPACE_USER_EMAIL1 def test_minespace_user_model_find_by_email(test_client, auth_headers, setup_info): mu = MinespaceUser.find_by_email(setup_info["test_minespace_user"].email) assert str(mu.email) == TEST_MINESPACE_USER_EMAIL1 def test_minespace_user_model_find_all(test_client, auth_headers, setup_info): all_mu = MinespaceUser.get_all() assert any(mu.email == TEST_MINESPACE_USER_EMAIL1 for mu in all_mu)
$(document).ready(function(){ $("#cep").mask("99.999-999", { reverse: true }); $("#tel_resid").mask("99999-9999", { reverse: true }); $("#tel_cel").mask("99999-9999", { reverse: true }); $("#cpf").mask("999.999.999-99", { reverse: true }); $("#cep").change(function () { if ($(this).val().length == 10) { var cep = $(this).val(); cep = cep.replace(".", ""); cep = cep.replace("-", ""); $.ajax({ type: "GET", url: "https://viacep.com.br/ws/" + cep + "/json/", success: function (endereco) { $(".icon-load-cep").hide(); if (endereco.erro) { alert("Endereço não encontrado"); $("#rua").val(""); $("#bairro").val(""); $("#cidade").val(""); $("#estado").val(""); } else { $("#rua").val(endereco.logradouro); $("#bairro").val(endereco.bairro); $("#cidade").val(endereco.localidade); $("#uf").val(endereco.uf); } }, beforeSend: function () { $(".icon-load-cep").show(); }, error: function (jq, status, message) { console.log("Status: " + status + " - Message: " + message); }, }); } }); });
import React from 'react'; import IconSortChevron from '../IconSortChevron'; describe('icons/general/IconSortChevron', () => { const getWrapper = (props = {}) => shallow(<IconSortChevron {...props} />); test('should correctly render default icon', () => { const wrapper = getWrapper(); expect(wrapper).toMatchSnapshot(); }); test('should correctly render icon with specified props', () => { const wrapper = getWrapper({ className: 'test', color: '#444', height: 100, title: 'title', width: 200, }); expect(wrapper).toMatchSnapshot(); }); });
import Vue from 'vue' import Vuex from 'vuex' import common from '@/api/common'; import liveBroadcast from './modules/liveBroadcast'; import kidsInfo from './modules/kidsInfo'; Vue.use(Vuex); import studentRouter from '@/router/studentRouter'; const env = process.env.NODE_ENV; export default new Vuex.Store({ modules: { liveBroadcast, kidsInfo }, state: { rootUrl: env === 'production'? 'https://edu.9man.com': '', // https://edu.9man.com resourceUrl: env === 'production'? 'https://api.9mankid.com/uploads': '', // https://api.9mankid.com/uploads apiUrl: env === 'production'? 'https://api.9mankid.com/api': '', // https://api.9mankid.com/api localUrl: env === 'production'? 'https://www.9mankid.com': '', emptyRoomUrl: env === 'production'? 'https://www.9mankid.com:8210': '', identity: '', updateInfo: 0, updateUsername: 0, }, mutations: { // 设置roles setIdentity(state, data) { state.identity = data }, // updateInfo updateUserInfo(state, url) { if (url) { const userInfo = common.getLocalStorage('userInfo'); userInfo.headimg = url; common.setLocalStorage('userInfo', userInfo); } state.updateInfo++; }, // updateUsername updateUsername(state, name) { if (name) { const userInfo = common.getLocalStorage('userInfo'); userInfo.uname = name; common.setLocalStorage('userInfo', userInfo); } state.updateUsername++; }, }, actions: {}, getters: { roles(state) { if (state.identity === 1) { return studentRouter.teacher } else if (state.identity === 2 || state.identity === 0 || state.identity === 4) { return studentRouter.student } }, } })
import React from "react"; import { navigate } from "gatsby-link"; import Layout from "../../components/Layout"; function encode(data) { return Object.keys(data) .map(key => encodeURIComponent(key) + "=" + encodeURIComponent(data[key])) .join("&"); } export default class Index extends React.Component { constructor(props) { super(props); this.state = { isValidated: false }; } handleChange = e => { this.setState({ [e.target.name]: e.target.value }); }; handleSubmit = e => { e.preventDefault(); const form = e.target; fetch("/", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: encode({ "form-name": form.getAttribute("name"), ...this.state }) }) .then(() => navigate(form.getAttribute("action"))) .catch(error => alert(error)); }; render() { return ( <Layout> <section className="section margin-bottom-3"> <div className="container"> <div className="columns"> <div className="column"> <h1 className="title">Contato</h1> <h2 className="subtitle is-spaced"> Envie sua mensagem ou saiba como chegar até nossa sede. </h2> </div> </div> </div> </section> <div className="container"> <div className="content"> <div className="columns margin-bottom-3"> <div className="column is-4"> <h4>Endereço</h4> <p> <strong>Týkhe Associação de Psicanálise</strong> <br /> Rua Américo Brasiliense, 244, sala 61 <br /> Cambuí, Campinas/SP - CEP 13025-230 </p> </div> <div className="column is-4"> <h4>Contato</h4> <p> Tel: 19 3253-1945 <br /> Fax: 19 3254-0542 <br /> Email: tykhepsicanalise@gmail.com </p> </div> <div className="column is-4"> <h4>Secretaria TÝKHE</h4> <p> Horário de <strong>funcionamento da secretaria</strong>: <br /> Terça e quinta-feira <br /> das 15h às 20h. </p> </div> </div> <div className="columns margin-bottom-3"> <div className="column is-4"> <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d58823.47122046687!2d-47.08886598087608!3d-22.859202769122117!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x94c8cf4fd0b35f53%3A0x9fc34167a86cdb9a!2sR.%20Am%C3%A9rico%20Brasiliense%2C%20244%20-%20Cambu%C3%AD%2C%20Campinas%20-%20SP%2C%2013025-230!5e0!3m2!1spt-BR!2sbr!4v1576763631753!5m2!1spt-BR!2sbr" frameborder="0" width="100%" height="100%" allowfullscreen="" ></iframe> </div> <div className="column is-4"> <form name="contact" method="post" action="/contact/thanks/" data-netlify="true" data-netlify-honeypot="bot-field" onSubmit={this.handleSubmit} > {/* The `form-name` hidden field is required to support form submissions without JavaScript */} <input type="hidden" name="form-name" value="contact" /> <div hidden> <label> Don’t fill this out:{" "} <input name="bot-field" onChange={this.handleChange} /> </label> </div> <div className="field"> <label className="label" htmlFor={"name"}> Seu nome </label> <div className="control"> <input className="input" type={"text"} name={"name"} onChange={this.handleChange} id={"name"} required={true} /> </div> </div> <div className="field"> <label className="label" htmlFor={"email"}> Email </label> <div className="control"> <input className="input" type={"email"} name={"email"} onChange={this.handleChange} id={"email"} required={true} /> </div> </div> <div className="field"> <label className="label" htmlFor={"message"}> Mensagem </label> <div className="control"> <textarea className="textarea" name={"message"} onChange={this.handleChange} id={"message"} required={true} /> </div> </div> <div className="field"> <button className="button is-link" type="submit"> Enviar </button> </div> </form> </div> </div> </div> </div> </Layout> ); } }
import { moduleForComponent, test } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; moduleForComponent('footer-partial', 'Integration | Component | footer partial', { integration: true }); test('it renders', function(assert) { // Set any properties with this.set('myProperty', 'value'); // Handle any actions with this.on('myAction', function(val) { ... });" + EOL + EOL + this.render(hbs`{{footer-partial}}`); assert.equal(this.$().text().trim(), ''); // Template block usage:" + EOL + this.render(hbs` {{#footer-partial}} template block text {{/footer-partial}} `); assert.equal(this.$().text().trim(), 'template block text'); });
# This Python file uses the following encoding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function # Imports import json import tensorflow as tf import requests as req import numpy as np from app.solr import Solr from collections import Counter from sklearn.metrics import precision_recall_fscore_support tf.logging.set_verbosity(tf.logging.INFO) # NOTE: change hostname to yours SOLR_INDEXING_END_POINT = 'http://localhost:8983/solr/bits' HASHER_END_POINT = 'http://localhost:8080/hash' def main(unused_argv): # Load training and eval data mnist = tf.contrib.learn.datasets.load_dataset("mnist") test_data = mnist.test.images test_label = mnist.test.labels.tolist() print(test_data.shape) solr = Solr(SOLR_INDEXING_END_POINT, timeout=100) # resize batch size in case of large dimension vector batch_size = 20 hashed = [] chunk = [] for idx in range(1, test_data.shape[0] + 1): chunk.append(norm(test_data[idx - 1]).tolist()) if idx != 0 and idx % batch_size == 0: print('Current indexig offset is {idx}.'.format(idx=idx)) hashed_chunk = hash(chunk, idx - batch_size - 1) chunk[:] = [] hashed.extend(hashed_chunk) print(len(hashed)) n_neighbors = 5 predicts = [] qtime_list = [] hits_list = [] use_index = False for idx in range(0, len(hashed)): params = {'fl': 'id, $x', 'x': 'cos(bits, {bits})'.format(bits=hashed[idx]), 'sort': '$x desc', 'rows': n_neighbors, 'cache': 'false', 'q': 'bits_match_3:"{bits}"'.format(bits=hashed[idx]), 'fq': '-filter(bits:"{bits}")'.format(bits=hashed[idx])} if use_index: params['q'] = '*:*' resposne = solr.select(params) nn = json.loads(resposne) qtime_list.append(int(nn.get('responseHeader').get('QTime'))) hits_list.append(int(nn.get('response').get('numFound'))) predict_list = nn.get('response').get('docs') if len(predict_list) > 0: nn_labels = list(r.get('id').split('_')[1] for r in predict_list) nn_label_predict = Counter(nn_labels).most_common(1)[0][0] predicts.append(int(nn_label_predict)) else: predicts.append(-1) test_predict = np.asarray(predicts, dtype=np.uint8) result = precision_recall_fscore_support(mnist.test.labels, test_predict, average='micro') print(result) def norm(v): n = np.linalg.norm(v) return v / n def hash(data, offset=0): json_fmt = json.dumps(data) r = req.post(HASHER_END_POINT, data={'value': json_fmt}) bits = json.loads(r.text) result_list = [] data_size = len(data) for i in range(0, data_size): result_list.append(bits[i]) return result_list if __name__ == "__main__": tf.app.run()
#!/usr/bin/python3 # author: Charlotte Bunne # imports import jax import jax.numpy as jnp from flax import linen as nn from typing import Any, Callable, Sequence, Tuple PRNGKey = Any Shape = Tuple[int] Dtype = Any Array = Any class Dense(nn.Module): """A linear transformation applied over the last dimension of the input. Attributes: dim_hidden: the number of output dim_hidden. use_bias: whether to add a bias to the output (default: True). dtype: the dtype of the computation (default: float32). precision: numerical precision of the computation see `jax.lax.Precision` for details. kernel_init: initializer function for the weight matrix. bias_init: initializer function for the bias. """ dim_hidden: int beta: float = 1.0 use_bias: bool = True dtype: Any = jnp.float32 precision: Any = None kernel_init: Callable[ [PRNGKey, Shape, Dtype], Array] = nn.initializers.lecun_normal() bias_init: Callable[[PRNGKey, Shape, Dtype], Array] = nn.initializers.zeros @nn.compact def __call__(self, inputs): """Applies a linear transformation to inputs along the last dimension. Args: inputs: The nd-array to be transformed. Returns: The transformed input. """ inputs = jnp.asarray(inputs, self.dtype) kernel = self.param('kernel', self.kernel_init, (inputs.shape[-1], self.dim_hidden)) scaled_kernel = self.beta * kernel kernel = jnp.asarray(1 / self.beta * nn.softplus(scaled_kernel), self.dtype) y = jax.lax.dot_general(inputs, kernel, (((inputs.ndim - 1,), (0,)), ((), ())), precision=self.precision) if self.use_bias: bias = self.param('bias', self.bias_init, (self.dim_hidden,)) bias = jnp.asarray(bias, self.dtype) y = y + bias return y class ICNN(nn.Module): """Input convex neural network.""" dim_hidden: Sequence[int] init_std: float = 0.1 init_fn: str = 'normal' act_fn: Callable = nn.leaky_relu pos_weights: bool = True def setup(self): num_hidden = len(self.dim_hidden) w_zs = list() if self.pos_weights: w_z = Dense else: w_z = nn.Dense if self.init_fn == 'uniform': init_fn = jax.nn.initializers.uniform else: init_fn = jax.nn.initializers.normal for i in range(1, num_hidden): w_zs.append(w_z(self.dim_hidden[i], kernel_init=init_fn(self.init_std), use_bias=False)) w_zs.append(w_z(1, kernel_init=init_fn( self.init_std), use_bias=False)) self.w_zs = w_zs w_xs = list() for i in range(num_hidden): w_xs.append(nn.Dense(self.dim_hidden[i], kernel_init=init_fn(self.init_std), use_bias=True)) w_xs.append(nn.Dense(1, kernel_init=init_fn(self.init_std), use_bias=True)) self.w_xs = w_xs @nn.compact def __call__(self, x): z = self.act_fn(self.w_xs[0](x)) z = jnp.multiply(z, z) for w_z, Wx in zip(self.w_zs[:-1], self.w_xs[1:-1]): z = self.act_fn(jnp.add(w_z(z), Wx(x))) y = jnp.add(self.w_zs[-1](z), self.w_xs[-1](x)) return jnp.squeeze(y)
from sympy.core.function import Add, ArgumentIndexError, Function from sympy.core.power import Pow from sympy.core.singleton import S from sympy.core.sorting import default_sort_key from sympy.functions.elementary.exponential import exp, log def _logaddexp(x1, x2, *, evaluate=True): return log(Add(exp(x1, evaluate=evaluate), exp(x2, evaluate=evaluate), evaluate=evaluate)) _two = S.One*2 _ln2 = log(_two) def _lb(x, *, evaluate=True): return log(x, evaluate=evaluate)/_ln2 def _exp2(x, *, evaluate=True): return Pow(_two, x, evaluate=evaluate) def _logaddexp2(x1, x2, *, evaluate=True): return _lb(Add(_exp2(x1, evaluate=evaluate), _exp2(x2, evaluate=evaluate), evaluate=evaluate)) class logaddexp(Function): """ Logarithm of the sum of exponentiations of the inputs. Helper class for use with e.g. numpy.logaddexp See Also ======== https://numpy.org/doc/stable/reference/generated/numpy.logaddexp.html """ nargs = 2 def __new__(cls, *args): return Function.__new__(cls, *sorted(args, key=default_sort_key)) def fdiff(self, argindex=1): """ Returns the first derivative of this function. """ if argindex == 1: wrt, other = self.args elif argindex == 2: other, wrt = self.args else: raise ArgumentIndexError(self, argindex) return S.One/(S.One + exp(other-wrt)) def _eval_rewrite_as_log(self, x1, x2, **kwargs): return _logaddexp(x1, x2) def _eval_evalf(self, *args, **kwargs): return self.rewrite(log).evalf(*args, **kwargs) def _eval_simplify(self, *args, **kwargs): a, b = map(lambda x: x.simplify(**kwargs), self.args) candidate = _logaddexp(a, b) if candidate != _logaddexp(a, b, evaluate=False): return candidate else: return logaddexp(a, b) class logaddexp2(Function): """ Logarithm of the sum of exponentiations of the inputs in base-2. Helper class for use with e.g. numpy.logaddexp2 See Also ======== https://numpy.org/doc/stable/reference/generated/numpy.logaddexp2.html """ nargs = 2 def __new__(cls, *args): return Function.__new__(cls, *sorted(args, key=default_sort_key)) def fdiff(self, argindex=1): """ Returns the first derivative of this function. """ if argindex == 1: wrt, other = self.args elif argindex == 2: other, wrt = self.args else: raise ArgumentIndexError(self, argindex) return S.One/(S.One + _exp2(other-wrt)) def _eval_rewrite_as_log(self, x1, x2, **kwargs): return _logaddexp2(x1, x2) def _eval_evalf(self, *args, **kwargs): return self.rewrite(log).evalf(*args, **kwargs) def _eval_simplify(self, *args, **kwargs): a, b = map(lambda x: x.simplify(**kwargs).factor(), self.args) candidate = _logaddexp2(a, b) if candidate != _logaddexp2(a, b, evaluate=False): return candidate else: return logaddexp2(a, b)
/* * Copyright 2013 Laurent Bovet <laurent.bovet@windmaster.ch> * * 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. */ var TypeScript, _, traverse; // from global scope (function (definition) { // CommonJS if (typeof exports === "object") { module.exports = definition(require("underscore"), require("q"), require("traverse"), require("./typson.js")); // RequireJS } else if (typeof define === "function" && define.amd) { define(["vendor/underscore", "vendor/q", "vendor/traverse", "./typson"], definition); } }) (function (underscore, Q, _traverse, typson) { if (underscore) { _ = underscore; } if( _traverse) { traverse = _traverse; } var api = {}; var primitiveTypes = [ "string", "number", "boolean", "any" ]; var validationKeywords = [ "type", "minimum", "exclusiveMinimum", "maximum", "exclusiveMaximum", "multipleOf", "minLength", "maxLength", "format", "pattern", "minItems", "maxItems", "uniqueItems", "default", "additionalProperties" ]; var annotedValidationKeywordPattern = /@[a-z.]+\s*[^@\s]+/gi; var TypescriptASTFlags = { "optionalName" : 4, "arrayType" : 8 }; var defaultProperties = { additionalProperties: false}; /** * Creates json-schema type definitions from a type script. * * @param script {string} URI pointing to the source type script or the script itself. * @param refPath {string} A path to prepend to $ref references. */ api.definitions = function (script, refPath) { return Q.promise(function (resolve) { typson.tree(script).done(function (tree) { TypeScript = typson.TypeScript; var definitions = { interfaces: {}, enums: {} }; _.each(tree, function (script) { _.each(script.moduleElements.members, function (decl) { handleDeclaration(decl, definitions, refPath, ""); }); }); traverse(definitions.interfaces).forEach(function(item) { if(this.key === "$ref") { var currentSchema = this.path[0]; var lastDot = currentSchema.lastIndexOf("."); if(lastDot > -1) { this.update(fullModulePath(currentSchema.substring(0, lastDot), item, definitions.interfaces)); } } }); resolve(definitions.interfaces); }); }); }; /** * Generates a schema from a type script. * * @param script {string} URI pointing to the source type script or the script itself. * @param type {string} The type to generate the schema from. * @param [id] {string} Schema id. */ api.schema = function (script, type, id) { return Q.promise(function (resolve) { api.definitions(script, "#/definitions").done(function(definitions) { var schema = {}; schema.$schema = "http://json-schema.org/draft-04/schema#"; _.extend(schema, definitions[type]); delete definitions[type]; if(id) { schema.id = id; } resolve(schema); schema.definitions = definitions; }); }); }; function handleDeclaration(decl, definitions, refPath, modulePath) { if (decl.nodeType() === TypeScript.NodeType.InterfaceDeclaration || decl.nodeType() === TypeScript.NodeType.ClassDeclaration) { handleInterfaceDeclaration(decl, definitions, refPath, modulePath); } else if (decl.nodeType() === TypeScript.NodeType.ModuleDeclaration) { if (decl.getModuleFlags() & TypeScript.ModuleFlags.IsEnum) { handleEnumDeclaration(decl, definitions, modulePath); } else { _.each(decl.members.members, function (subDecl) { var subModulePath = modulePath; if(!(decl.getModuleFlags() & TypeScript.ModuleFlags.IsWholeFile)) { subModulePath+=(decl.name.actualText+"."); } handleDeclaration(subDecl, definitions, refPath, subModulePath); }); } } } /** * Handles interface declaration as new definition and registers it in the global set of interface definitions * * @param type {object} the TypeScript AST node associated to the interface declaration * @param definitions {object} the set of handled interface and enum definitions */ function handleInterfaceDeclaration(type, definitions, refPath, modulePath) { var name = (modulePath.length > 0 ? modulePath : "") + type.name.actualText; var definition = definitions.interfaces[name] = {}; definition.id = name; definition.type = "object"; copyComment(type, definition); definition.properties = {}; mergeInheritedProperties(type, definition, definitions); handlePropertyDeclaration(type, definition, definitions, refPath); _.defaults(definition, defaultProperties); } /** * Handles property or interface declarations and adds them to the interface definition. * Recursive, if the property has child properties, i.e. inline object declarations, * this function will recurse down to get all the definitions in the schema. * * @param type {object} the TypeScript AST node associated to the property declaration * @param definition {object} the property definition * @param definitions {object} the set of handled interface and enum definitions */ function handlePropertyDeclaration(type, definition, definitions, refPath) { _.each(type.members.members, function (variable) { var property = definition.properties[variable.id.actualText] = {}; copyComment(variable, property); var overridenType = property.type; var variableType = extractFullTypeName(variable.typeExpr.term); var propertyType = null; //required if (!(variable.id.getFlags() & TypescriptASTFlags.optionalName)) { if (!definition.required) { definition.required = []; } definition.required.push(variable.id.actualText); } //arrays if (variable.typeExpr.getFlags() & TypescriptASTFlags.arrayType) { property.type = "array"; propertyType = property.items = property.items || {}; } //maps else if (variable.typeExpr.term.getFlags() & TypescriptASTFlags.arrayType) { property.type = "object"; var members = variable.typeExpr.term.members.members; // Map (arbitrary properties) if (members[0].returnTypeAnnotation) { propertyType = property.additionalProperties = {}; variableType = variable.typeExpr.term.members.members[0].returnTypeAnnotation.term.actualText; if (!variableType) { // Map where value is an inline property declaration _.defaults(property, defaultProperties); _.defaults(property.additionalProperties, defaultProperties); property.additionalProperties.type = "object"; property.additionalProperties.properties = {}; handlePropertyDeclaration(variable.typeExpr.term.members.members[0].returnTypeAnnotation.term, property.additionalProperties, definitions); variableType = "any"; } } // Object (inline declaration) else { _.defaults(property, defaultProperties); property.properties = {}; handlePropertyDeclaration(variable.typeExpr.term, property, definitions); variableType = "any"; } } //other else { propertyType = property; } var fullTypeName = variableType; //enums if (definitions.enums[fullTypeName]) { propertyType.id = definitions.enums[fullTypeName].id; propertyType.enum = _.keys(definitions.enums[fullTypeName].enumeration); addEnumDescription(definitions.enums[fullTypeName].enumeration, property); } //other else if (primitiveTypes.indexOf(variableType) === -1) { propertyType.$ref = refPath? refPath+"/"+fullTypeName: fullTypeName; } else { if(variableType !== "any") { propertyType.type = overridenType || variableType; } } }); } function extractFullTypeName(term) { if(term.actualText) { return term.actualText; } else { if(term.nodeType() === TypeScript.NodeType.MemberAccessExpression) { return extractFullTypeName(term.operand1)+"."+extractFullTypeName(term.operand2); } } } /** * Visits every super type extended by the given type recursively and provisions the given definition with the properties of the associated super definitions. * * @param type {object} the TypeScript AST node associated to the interface declaration * @param definition {object} the definition to be provisionned * @param definitions {object} the set of handled interface and enum definitions */ function mergeInheritedProperties(type, definition, definitions) { if (type.extendsList) { _.each(type.extendsList.members, function (superType) { var superDefinition = definitions.interfaces[superType.actualText]; // does the provisionning if a definition exists for the current super type if (superDefinition) { // recursive call mergeInheritedProperties(superType, definition, definitions); // merges properties for(var superKey in superDefinition.properties) { definition.properties[superKey] = superDefinition.properties[superKey]; } // merges required if (superDefinition.required) { _.each(superDefinition.required, function (requiredSuperPropertyName) { if (!definition.required) { definition.required = []; } definition.required.push(requiredSuperPropertyName); }); } } }); } } /** * Handles enum declaration as new definition and registers it in the global set of enum definitions * * @param type {object} the TypeScript AST node associated to the enum declaration * @param definitions {object} the set of handled interface and enum definitions */ function handleEnumDeclaration(type, definitions, modulePath) { var name = (modulePath.length > 0 ? modulePath : "") + type.name.actualText; var definition = definitions.enums[name] = {}; definition.enumeration = {}; definition.id = type.name.actualText; _.each(type.members.members, function (declaration) { var comment = declaration.declaration.declarators.members[0].docComments().slice(-1)[0]; var commentText = comment ? comment.getDocCommentTextValue() : ""; var declarationText = declaration.declaration.declarators.members[0].id.actualText; declarationText = declarationText.replace(/^["'](.+)["']$/, "$1"); definition.enumeration[declarationText] = commentText; }); } /** * Extracts the description and the validation keywords from a comment * * @param from {object} the TypeScript AST node * @param to {object} the destination variable or definition. */ function copyComment(from, to) { var comments = from.docComments(); if (comments.length > 0) { var commentContent = comments.slice(-1)[0].getDocCommentTextValue(); copyValidationKeywords(copyDescription(commentContent, to), to); } } /** * Extracts the description part of a comment and register it in the description property. * The description is supposed to start at first position and may be delimited by @. * * @param comment {string} the full comment. * @param to {object} the destination variable or definition. * @returns {string} the full comment minus the beginning description part. */ function copyDescription(comment, to) { var delimiter = "@"; var delimiterIndex = comment.indexOf(delimiter); var description = comment.slice(0, delimiterIndex < 0 ? comment.length : delimiterIndex); if (description.length > 0) { to.description = description.replace(/\s+$/g, ""); } return delimiterIndex < 0 ? "" : comment.slice(delimiterIndex); } /** * Extracts the schema validation keywords stored in a comment and register them as properties. * A validation keyword starts by a @. It has a name and a value. Several keywords may occur. * * @param comment {string} the full comment. * @param to {object} the destination variable. */ function copyValidationKeywords(comment, to) { annotedValidationKeywordPattern.lastIndex = 0; // TODO: to improve the use of the exec method: it could make the tokenization var annotation; while ((annotation = annotedValidationKeywordPattern.exec(comment))) { var annotationTokens = annotation[0].split(" "); var keyword = annotationTokens[0].slice(1); var path = keyword.split("."); var context = null; if (path.length > 1) { context = path[0]; keyword = path[1]; } // case sensitive check inside the dictionary if (validationKeywords.indexOf(keyword) >= 0) { var value = annotationTokens.length > 1 ? annotationTokens[1] : ""; try { value = JSON.parse(value); } catch (e) { } if (context) { if (!to[context]) { to[context] = {}; } to[context][keyword] = value; } else { to[keyword] = value; } } } } function addEnumDescription(enumeration, property) { if(enumeration && _.values(enumeration).join("")) { var values = ["Value"]; values = values.concat(_.keys(enumeration)); var max = _.max(values, function(value) { return value.length; }).length; var table = "\n\n| "+values[0] + new Array(max+3-values[0].length).join(" ") + "| Description"; table += "\n|-"; _.each(enumeration, function(comment, value) { table += "\n| `"+value+"`"+ new Array(max+1-value.length).join(" ") + "|" + (comment ? " "+comment : "|"); }); property.description = property.description || ""; property.description += table; } } /** * Compute an absolute module path to the target type given a reference module, by looking up it in * a type dictionary. * * @param refModule {string} * @param target {string} * @param types {object} A dictionary whose keys are the known types * @returns {string} the full path to the target */ function fullModulePath(refModule, target, types) { var path = target.split("/"); var prefix = path.splice(0, path.length-1).join("/"); target = path.splice(-1)[0]; var refPath = refModule.split("."); while(refPath.length > 0) { var candidate = refPath.join(".")+"."+target; if(candidate in types) { target = candidate; break; } refPath = refPath.slice(0, refPath.length-1); } return prefix.length > 0 ? prefix + "/" + target : target; } api.exec = function(script, type) { if(type) { api.schema(script, type).done(function(schema) { console.log(JSON.stringify(schema, null, 2)); }); } else { api.definitions(script).done(function(definitions) { console.log(JSON.stringify(definitions, null, 2)); }); } }; if (typeof window === "undefined" && require.main === module) { if (process.argv[2]) { api.exec(process.argv[2], process.argv[3]); } else { console.log("Usage: node typson-schema.js <url-or-path-to-type-script-file> [type]\n"); } } else { return api; } });
import Stream from '../../src/streaming/Stream'; import Events from '../../src/core/events/Events'; import ProtectionEvents from '../../src/streaming/protection/ProtectionEvents'; import EventBus from '../../src/core/EventBus'; import DashJSError from '../../src/streaming/vo/DashJSError'; import ProtectionErrors from '../../src/streaming/protection/errors/ProtectionErrors'; import Constants from '../../src/streaming/constants/Constants'; import AdapterMock from './mocks/AdapterMock'; import ManifestModelMock from './mocks/ManifestModelMock'; import ErrorHandlerMock from './mocks/ErrorHandlerMock'; const expect = require('chai').expect; const sinon = require('sinon'); const context = {}; const eventBus = EventBus(context).getInstance(); describe('Stream', function () { const adapterMock = new AdapterMock(); const manifestModelMock = new ManifestModelMock(); const errHandlerMock = new ErrorHandlerMock(); const streamInfo = { index: 'id' }; Events.extend(ProtectionEvents); it('should return an empty array when getProcessors is called but streamProcessors attribute is an empty array', () => { const stream = Stream(context).create({}); const processors = stream.getProcessors(); expect(processors).to.be.instanceOf(Array); // jshint ignore:line expect(processors).to.be.empty; // jshint ignore:line }); it('should return an null when getId is called but streamInfo attribute is null or undefined', () => { const stream = Stream(context).create({}); const id = stream.getId(); expect(id).to.be.null; // jshint ignore:line }); it('should return an NaN when getStartTime is called but streamInfo attribute is null or undefined', () => { const stream = Stream(context).create({}); const startTime = stream.getStartTime(); expect(startTime).to.be.NaN; // jshint ignore:line }); it('should return an NaN when getDuration is called but streamInfo attribute is null or undefined', () => { const stream = Stream(context).create({}); const duration = stream.getDuration(); expect(duration).to.be.NaN; // jshint ignore:line }); it('should throw an error when getBitrateListFor is called and config object is not defined', function () { const stream = Stream(context).create(); expect(stream.getBitrateListFor.bind(stream)).to.be.throw(Constants.MISSING_CONFIG_ERROR); }); it('should throw an error when getBitrateListFor is called and config object has not been set properly', function () { const stream = Stream(context).create({}); expect(stream.getBitrateListFor.bind(stream)).to.be.throw(Constants.MISSING_CONFIG_ERROR); }); it('should throw an error when activate is called and config object has not been set properly', function () { const stream = Stream(context).create({}); expect(stream.activate.bind(stream)).to.be.throw(Constants.MISSING_CONFIG_ERROR); }); it('should return null when isCompatibleWithStream is called but stream attribute is undefined', () => { const stream = Stream(context).create({}); const isCompatible = stream.isMediaCodecCompatible(); expect(isCompatible).to.be.false; // jshint ignore:line }); it('should return null when isProtectionCompatible is called but stream attribute is undefined', () => { const stream = Stream(context).create({}); const isCompatible = stream.isProtectionCompatible(); expect(isCompatible).to.be.false; // jshint ignore:line }); it('should not call STREAM_INITIALIZED event if initializeMedia has not been called when updateData is called', () => { const spy = sinon.spy(); eventBus.on(Events.STREAM_INITIALIZED, spy); const stream = Stream(context).create({adapter: adapterMock, manifestModel: manifestModelMock}); stream.updateData(streamInfo); expect(spy.notCalled).to.be.true; // jshint ignore:line eventBus.off(Events.STREAM_INITIALIZED, spy); }); describe('License expired behavior', function () { const stream = Stream(context).create({errHandler: errHandlerMock}); stream.initialize(null,{}); eventBus.trigger(Events.KEY_STATUSES_CHANGED, {data: null, error: new DashJSError(ProtectionErrors.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE, ProtectionErrors.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)}); expect(errHandlerMock.errorCode).to.be.equal(ProtectionErrors.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE); // jshint ignore:line expect(errHandlerMock.errorValue).to.be.equal(ProtectionErrors.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE); // jshint ignore:line }); describe('No Licenser server url defined behavior', function () { const stream = Stream(context).create({errHandler: errHandlerMock}); stream.initialize(null,{}); eventBus.trigger(Events.LICENSE_REQUEST_COMPLETE, {data: null, error: new DashJSError(ProtectionErrors.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE, ProtectionErrors.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE)}); expect(errHandlerMock.errorCode).to.be.equal(ProtectionErrors.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE); // jshint ignore:line expect(errHandlerMock.errorValue).to.be.equal(ProtectionErrors.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE); // jshint ignore:line }); describe('Licenser request error behavior', function () { const stream = Stream(context).create({errHandler: errHandlerMock}); stream.initialize(null,{}); eventBus.trigger(Events.LICENSE_REQUEST_COMPLETE, {data: null, error: new DashJSError(ProtectionErrors.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE, ProtectionErrors.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE)}); expect(errHandlerMock.errorCode).to.be.equal(ProtectionErrors.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE); // jshint ignore:line expect(errHandlerMock.errorValue).to.be.equal(ProtectionErrors.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE); // jshint ignore:line }); describe('CDM Access denied behavior', function () { const stream = Stream(context).create({errHandler: errHandlerMock}); stream.initialize(null,{}); eventBus.trigger(Events.KEY_SYSTEM_SELECTED, {data: null, error: new DashJSError(ProtectionErrors.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE, ProtectionErrors.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE)}); expect(errHandlerMock.errorCode).to.be.equal(ProtectionErrors.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE); // jshint ignore:line expect(errHandlerMock.errorValue).to.be.equal(ProtectionErrors.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE); // jshint ignore:line }); describe('Unable to create key session behavior', function () { const stream = Stream(context).create({errHandler: errHandlerMock}); stream.initialize(null,{}); eventBus.trigger(Events.KEY_SESSION_CREATED, {data: null, error: new DashJSError(ProtectionErrors.KEY_SESSION_CREATED_ERROR_CODE, ProtectionErrors.KEY_SESSION_CREATED_ERROR_MESSAGE)}); expect(errHandlerMock.errorCode).to.be.equal(ProtectionErrors.KEY_SESSION_CREATED_ERROR_CODE); // jshint ignore:line expect(errHandlerMock.errorValue).to.be.equal(ProtectionErrors.KEY_SESSION_CREATED_ERROR_MESSAGE); // jshint ignore:line }); });
import React from 'react' import { graphql } from 'gatsby' import { rhythm } from '../utils/typography' import * as Lang from '../constants' export default ({ data }) => { const resumes = data.allMarkdownRemark.edges const resume = resumes .filter(({ node }) => node.frontmatter.lang === Lang.ENGLISH) .map(({ node }) => node)[0] return ( <div style={{ marginLeft: `auto`, marginRight: `auto`, maxWidth: rhythm(24), padding: `${rhythm(0.5)} ${rhythm(3 / 4)} ${rhythm(1.5)} ${rhythm( 3 / 4 )}`, }} > {/* <div dangerouslySetInnerHTML={{ __html: resume.html }} /> */} </div> ) } export const pageQuery = graphql` query { allMarkdownRemark(filter: { frontmatter: { category: { eq: null } } }) { edges { node { id excerpt(pruneLength: 160) html frontmatter { title date(formatString: "MMMM DD, YYYY") lang } } } } } `
import React, { Fragment, Component } from "react"; import { RadioButton, RadioButtonContainer } from "../../reusable/Radio"; import StyledSubtitle from "../../reusable/StyledSubtitle"; import Row from "../../reusable/Row"; import translate from "../../reusable/translate"; import InfoIcon from "../../reusable/InfoIcon"; import { get } from "lodash"; import styled from "styled-components"; const Column = styled.div` display: flex; flex-direction: column; align-items: ${props => props.alignItems || "unset"}; `; class ReportingIntervalSelection extends Component { render() { const { locale, reportingInterval, setReportingInterval, infoText } = this.props; return ( <Fragment> <Row justifyContent="space-between"> <StyledSubtitle> {translate({ languageOverride: locale, textKey: "sit.commitmentCreation.selectReportInterval" })} </StyledSubtitle> <InfoIcon info={infoText} selectedLocale={locale} /> </Row> <Column> <RadioButtonContainer required name="reportingInterval" onChange={e => setReportingInterval(get(e, "target.name"))} > <RadioButton required checked={reportingInterval === "MONTH_1"} defaultChecked={true} value="MONTH_1" id="reporting_interval_1m" name="MONTH_1" label={translate({ languageOverride: locale, textKey: "sit.commitmentCreation.everyOneMonth" })} style={{ marginBottom: "-1px" }} /> <RadioButton required checked={reportingInterval === "MONTH_3"} value="MONTH_3" id="reporting_interval_3m" name="MONTH_3" label={translate({ languageOverride: locale, textKey: "sit.commitmentCreation.everyThreeMonths" })} style={{ marginBottom: "-1px" }} /> <RadioButton required checked={reportingInterval === "MONTH_6"} value="MONTH_6" id="reporting_interval_6m" name="MONTH_6" label={translate({ languageOverride: locale, textKey: "sit.commitmentCreation.everySixMonths" })} style={{ marginBottom: "-1px" }} /> <RadioButton required checked={reportingInterval === "MONTH_12"} value="MONTH_12" id="reporting_interval_12m" name="MONTH_12" label={translate({ languageOverride: locale, textKey: "sit.commitmentCreation.everyTwelveMonths" })} style={{ marginBottom: "-1px" }} /> </RadioButtonContainer> </Column> </Fragment> ); } } export default ReportingIntervalSelection;
import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import ReactTable from 'react-table-6'; import { DeleteButton } from '../components/buttons'; import api from '../api'; import styled from 'styled-components'; import 'react-table-6/react-table.css'; const Wrapper = styled.div` padding: 0 40px 40px 40px; `; class ItemsList extends Component { constructor(props) { super(props); this.state = { items: {}, }; } componentDidMount() { console.log('ItemsList: props'); console.log(this.props); // if (((this.props.itemData || {}).items || []).length) return; this.fetchAllItems(); } fetchAllItems = () => { api .getAllItems() .then(resp => { debugger; const { items } = resp.data; console.log('getAllItems: resp'); console.log(items); this.setState({ items }); }) .catch(err => { console.error(`ERROR in 'getAllItems': ${err}`); console.error(err); return err; }); }; deleteSingleItem = itemId => { return api .deleteItemById(itemId) .then(resp => { console.log('deleteItemById: resp'); console.log(resp); return resp; }) .catch(err => { console.error(`ERROR in 'deleteSingleItem': ${err}`); console.error(err); return err; }); }; handleRemoveItem = data => { const itemId = data; this.deleteSingleItem(itemId).then(resp => { console.log('handleRemoveItem: resp'); console.log(resp); this.fetchAllItems(); }); }; render() { const items = this.state.items || {}; console.log(items); const columns = [ { Header: 'ID', accessor: '_id', filterable: true, Cell: props => { return <span data-item-id={props.original._id}>{props.original._id}</span>; }, }, { Header: 'Name', accessor: 'name', filterable: true, Cell: props => { return <span data-name={props.original.name}>{props.value}</span>; }, }, { Header: 'Gender', accessor: 'gender', filterable: true, Cell: props => { return <span data-gender={props.original.gender}>{props.value}</span>; }, }, { Header: 'Age', accessor: 'age', filterable: true, Cell: props => { return <span data-age={props.original.age}>{props.value}</span>; }, }, { Header: 'Zip', accessor: 'zip', filterable: true, Cell: props => { return <span data-zip={props.original}>{props.value}</span>; }, }, { Header: 'Day(s)', accessor: 'daysOfWeek', filterable: true, Cell: props => { const { daysOfWeek } = props.original; let daysToDisplay = ''; if (daysOfWeek && typeof daysOfWeek === 'object') { for (const day in daysOfWeek) { daysToDisplay = daysToDisplay === '' ? daysOfWeek[day] : `${daysToDisplay}, ${daysOfWeek[day]}`; } } return ( <span data-daysofweek={daysOfWeek && JSON.stringify(daysOfWeek)} data-daysofweek-by-id={props.original._id}> {daysToDisplay || '-'} </span> ); }, }, { Header: 'Timeframe', accessor: 'timeframeNote', Cell: props => { return <span data-timeframe={props.original.timeframeNote}>{props.value || '-'}</span>; }, }, { Header: 'Priority', accessor: 'priority', filterable: true, Cell: props => { return <span data-priority={props.original.priority}>{props.value}</span>; }, }, { Header: 'Patient Info', accessor: '', Cell: props => { return ( <span data-delete-id={props.original._id}> <DeleteButton id={props.original._id} onDelete={this.handleRemoveItem} /> </span> ); }, }, ]; { Header: '', accessor: '', Cell: props => { return ( <Link data-update-id={props.original._id} to={`/item/update/${props.original._id}`}> Update Item </Link> ); }, }, { Header: '', accessor: '', Cell: props => { return ( <span data-delete-id={props.original._id}> <DeleteButton id={props.original._id} onDelete={this.handleRemoveItem} /> </span> ); }, }, ]; return ( <Wrapper> {(items || []).length > 0 ? ( // defeats the purpose of using `isLoading` prop? <ReactTable data={items} columns={columns} defaultPageSize={10} showPageSizeOptions={true} minRows={10} /> ) : ( `No items to render... :(` )} </Wrapper> ); } } export default ItemsList;
# -*- coding: utf-8 -*- # SPDX-License-Identifier: Apache-2.0 # # The OpenSearch Contributors require contributions made to # this file be licensed under the Apache-2.0 license or a # compatible open source license. # # Modifications Copyright OpenSearch Contributors. See # GitHub history for details. # # Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you 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 gzip import io import json import ssl import warnings from platform import python_version import aiohttp import pytest from mock import patch from multidict import CIMultiDict from opensearchpy import AIOHttpConnection, __versionstr__ from opensearchpy.compat import reraise_exceptions from opensearchpy.exceptions import ConnectionError pytestmark = pytest.mark.asyncio def gzip_decompress(data): buf = gzip.GzipFile(fileobj=io.BytesIO(data), mode="rb") return buf.read() class TestAIOHttpConnection: async def _get_mock_connection(self, connection_params={}, response_body=b"{}"): con = AIOHttpConnection(**connection_params) await con._create_aiohttp_session() def _dummy_request(*args, **kwargs): class DummyResponse: async def __aenter__(self, *_, **__): return self async def __aexit__(self, *_, **__): pass async def text(self): return response_body.decode("utf-8", "surrogatepass") dummy_response = DummyResponse() dummy_response.headers = CIMultiDict() dummy_response.status = 200 _dummy_request.call_args = (args, kwargs) return dummy_response con.session.request = _dummy_request return con async def test_ssl_context(self): try: context = ssl.create_default_context() except AttributeError: # if create_default_context raises an AttributeError Exception # it means SSLContext is not available for that version of python # and we should skip this test. pytest.skip( "Test test_ssl_context is skipped cause SSLContext is not available for this version of Python" ) con = AIOHttpConnection(use_ssl=True, ssl_context=context) await con._create_aiohttp_session() assert con.use_ssl assert con.session.connector._ssl == context def test_opaque_id(self): con = AIOHttpConnection(opaque_id="app-1") assert con.headers["x-opaque-id"] == "app-1" def test_http_cloud_id(self): con = AIOHttpConnection( cloud_id="cluster:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyQ0ZmE4ODIxZTc1NjM0MDMyYmVkMWNmMjIxMTBlMmY5NyQ0ZmE4ODIxZTc1NjM0MDMyYmVkMWNmMjIxMTBlMmY5Ng==" ) assert con.use_ssl assert ( con.host == "https://4fa8821e75634032bed1cf22110e2f97.us-east-1.aws.found.io" ) assert con.port is None assert con.hostname == "4fa8821e75634032bed1cf22110e2f97.us-east-1.aws.found.io" assert con.http_compress con = AIOHttpConnection( cloud_id="cluster:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyQ0ZmE4ODIxZTc1NjM0MDMyYmVkMWNmMjIxMTBlMmY5NyQ0ZmE4ODIxZTc1NjM0MDMyYmVkMWNmMjIxMTBlMmY5Ng==", port=9243, ) assert ( con.host == "https://4fa8821e75634032bed1cf22110e2f97.us-east-1.aws.found.io:9243" ) assert con.port == 9243 assert con.hostname == "4fa8821e75634032bed1cf22110e2f97.us-east-1.aws.found.io" def test_api_key_auth(self): # test with tuple con = AIOHttpConnection( cloud_id="cluster:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyQ0ZmE4ODIxZTc1NjM0MDMyYmVkMWNmMjIxMTBlMmY5NyQ0ZmE4ODIxZTc1NjM0MDMyYmVkMWNmMjIxMTBlMmY5Ng==", api_key=("elastic", "changeme1"), ) assert con.headers["authorization"] == "ApiKey ZWxhc3RpYzpjaGFuZ2VtZTE=" assert ( con.host == "https://4fa8821e75634032bed1cf22110e2f97.us-east-1.aws.found.io" ) # test with base64 encoded string con = AIOHttpConnection( cloud_id="cluster:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyQ0ZmE4ODIxZTc1NjM0MDMyYmVkMWNmMjIxMTBlMmY5NyQ0ZmE4ODIxZTc1NjM0MDMyYmVkMWNmMjIxMTBlMmY5Ng==", api_key="ZWxhc3RpYzpjaGFuZ2VtZTI=", ) assert con.headers["authorization"] == "ApiKey ZWxhc3RpYzpjaGFuZ2VtZTI=" assert ( con.host == "https://4fa8821e75634032bed1cf22110e2f97.us-east-1.aws.found.io" ) async def test_no_http_compression(self): con = await self._get_mock_connection() assert not con.http_compress assert "accept-encoding" not in con.headers await con.perform_request("GET", "/") _, kwargs = con.session.request.call_args assert not kwargs["data"] assert "accept-encoding" not in kwargs["headers"] assert "content-encoding" not in kwargs["headers"] async def test_http_compression(self): con = await self._get_mock_connection({"http_compress": True}) assert con.http_compress assert con.headers["accept-encoding"] == "gzip,deflate" # 'content-encoding' shouldn't be set at a connection level. # Should be applied only if the request is sent with a body. assert "content-encoding" not in con.headers await con.perform_request("GET", "/", body=b"{}") _, kwargs = con.session.request.call_args assert gzip_decompress(kwargs["data"]) == b"{}" assert kwargs["headers"]["accept-encoding"] == "gzip,deflate" assert kwargs["headers"]["content-encoding"] == "gzip" await con.perform_request("GET", "/") _, kwargs = con.session.request.call_args assert not kwargs["data"] assert kwargs["headers"]["accept-encoding"] == "gzip,deflate" assert "content-encoding" not in kwargs["headers"] def test_cloud_id_http_compress_override(self): # 'http_compress' will be 'True' by default for connections with # 'cloud_id' set but should prioritize user-defined values. con = AIOHttpConnection( cloud_id="cluster:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyQ0ZmE4ODIxZTc1NjM0MDMyYmVkMWNmMjIxMTBlMmY5NyQ0ZmE4ODIxZTc1NjM0MDMyYmVkMWNmMjIxMTBlMmY5Ng==", ) assert con.http_compress is True con = AIOHttpConnection( cloud_id="cluster:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyQ0ZmE4ODIxZTc1NjM0MDMyYmVkMWNmMjIxMTBlMmY5NyQ0ZmE4ODIxZTc1NjM0MDMyYmVkMWNmMjIxMTBlMmY5Ng==", http_compress=False, ) assert con.http_compress is False con = AIOHttpConnection( cloud_id="cluster:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyQ0ZmE4ODIxZTc1NjM0MDMyYmVkMWNmMjIxMTBlMmY5NyQ0ZmE4ODIxZTc1NjM0MDMyYmVkMWNmMjIxMTBlMmY5Ng==", http_compress=True, ) assert con.http_compress is True async def test_url_prefix(self): con = await self._get_mock_connection( connection_params={"url_prefix": "/_search/"} ) assert con.url_prefix == "/_search" await con.perform_request("GET", "/") # Need to convert the yarl URL to a string to compare. method, yarl_url = con.session.request.call_args[0] assert method == "GET" and str(yarl_url) == "http://localhost:9200/_search/" def test_default_user_agent(self): con = AIOHttpConnection() assert con._get_default_user_agent() == "opensearch-py/%s (Python %s)" % ( __versionstr__, python_version(), ) def test_timeout_set(self): con = AIOHttpConnection(timeout=42) assert 42 == con.timeout def test_keep_alive_is_on_by_default(self): con = AIOHttpConnection() assert { "connection": "keep-alive", "content-type": "application/json", "user-agent": con._get_default_user_agent(), } == con.headers def test_http_auth(self): con = AIOHttpConnection(http_auth="username:secret") assert { "authorization": "Basic dXNlcm5hbWU6c2VjcmV0", "connection": "keep-alive", "content-type": "application/json", "user-agent": con._get_default_user_agent(), } == con.headers def test_http_auth_tuple(self): con = AIOHttpConnection(http_auth=("username", "secret")) assert { "authorization": "Basic dXNlcm5hbWU6c2VjcmV0", "content-type": "application/json", "connection": "keep-alive", "user-agent": con._get_default_user_agent(), } == con.headers def test_http_auth_list(self): con = AIOHttpConnection(http_auth=["username", "secret"]) assert { "authorization": "Basic dXNlcm5hbWU6c2VjcmV0", "content-type": "application/json", "connection": "keep-alive", "user-agent": con._get_default_user_agent(), } == con.headers def test_uses_https_if_verify_certs_is_off(self): with warnings.catch_warnings(record=True) as w: con = AIOHttpConnection(use_ssl=True, verify_certs=False) assert 1 == len(w) assert ( "Connecting to https://localhost:9200 using SSL with verify_certs=False is insecure." == str(w[0].message) ) assert con.use_ssl assert con.scheme == "https" assert con.host == "https://localhost:9200" async def test_nowarn_when_test_uses_https_if_verify_certs_is_off(self): with warnings.catch_warnings(record=True) as w: con = AIOHttpConnection( use_ssl=True, verify_certs=False, ssl_show_warn=False ) await con._create_aiohttp_session() assert w == [] assert isinstance(con.session, aiohttp.ClientSession) def test_doesnt_use_https_if_not_specified(self): con = AIOHttpConnection() assert not con.use_ssl def test_no_warning_when_using_ssl_context(self): ctx = ssl.create_default_context() with warnings.catch_warnings(record=True) as w: AIOHttpConnection(ssl_context=ctx) assert w == [], str([x.message for x in w]) def test_warns_if_using_non_default_ssl_kwargs_with_ssl_context(self): for kwargs in ( {"ssl_show_warn": False}, {"ssl_show_warn": True}, {"verify_certs": True}, {"verify_certs": False}, {"ca_certs": "/path/to/certs"}, {"ssl_show_warn": True, "ca_certs": "/path/to/certs"}, ): kwargs["ssl_context"] = ssl.create_default_context() with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") AIOHttpConnection(**kwargs) assert 1 == len(w) assert ( "When using `ssl_context`, all other SSL related kwargs are ignored" == str(w[0].message) ) @patch("opensearchpy.connection.base.logger") async def test_uncompressed_body_logged(self, logger): con = await self._get_mock_connection(connection_params={"http_compress": True}) await con.perform_request("GET", "/", body=b'{"example": "body"}') assert 2 == logger.debug.call_count req, resp = logger.debug.call_args_list assert '> {"example": "body"}' == req[0][0] % req[0][1:] assert "< {}" == resp[0][0] % resp[0][1:] async def test_surrogatepass_into_bytes(self): buf = b"\xe4\xbd\xa0\xe5\xa5\xbd\xed\xa9\xaa" con = await self._get_mock_connection(response_body=buf) status, headers, data = await con.perform_request("GET", "/") assert u"你好\uda6a" == data @pytest.mark.parametrize("exception_cls", reraise_exceptions) async def test_recursion_error_reraised(self, exception_cls): conn = AIOHttpConnection() def request_raise(*_, **__): raise exception_cls("Wasn't modified!") await conn._create_aiohttp_session() conn.session.request = request_raise with pytest.raises(exception_cls) as e: await conn.perform_request("GET", "/") assert str(e.value) == "Wasn't modified!" class TestConnectionHttpbin: """Tests the HTTP connection implementations against a live server E2E""" async def httpbin_anything(self, conn, **kwargs): status, headers, data = await conn.perform_request("GET", "/anything", **kwargs) data = json.loads(data) data["headers"].pop( "X-Amzn-Trace-Id", None ) # Remove this header as it's put there by AWS. return (status, data) async def test_aiohttp_connection(self): # Defaults conn = AIOHttpConnection("httpbin.org", port=443, use_ssl=True) user_agent = conn._get_default_user_agent() status, data = await self.httpbin_anything(conn) assert status == 200 assert data["method"] == "GET" assert data["headers"] == { "Content-Type": "application/json", "Host": "httpbin.org", "User-Agent": user_agent, } # http_compress=False conn = AIOHttpConnection( "httpbin.org", port=443, use_ssl=True, http_compress=False ) status, data = await self.httpbin_anything(conn) assert status == 200 assert data["method"] == "GET" assert data["headers"] == { "Content-Type": "application/json", "Host": "httpbin.org", "User-Agent": user_agent, } # http_compress=True conn = AIOHttpConnection( "httpbin.org", port=443, use_ssl=True, http_compress=True ) status, data = await self.httpbin_anything(conn) assert status == 200 assert data["headers"] == { "Accept-Encoding": "gzip,deflate", "Content-Type": "application/json", "Host": "httpbin.org", "User-Agent": user_agent, } # Headers conn = AIOHttpConnection( "httpbin.org", port=443, use_ssl=True, http_compress=True, headers={"header1": "value1"}, ) status, data = await self.httpbin_anything( conn, headers={"header2": "value2", "header1": "override!"} ) assert status == 200 assert data["headers"] == { "Accept-Encoding": "gzip,deflate", "Content-Type": "application/json", "Host": "httpbin.org", "Header1": "override!", "Header2": "value2", "User-Agent": user_agent, } async def test_aiohttp_connection_error(self): conn = AIOHttpConnection("not.a.host.name") with pytest.raises(ConnectionError): await conn.perform_request("GET", "/")
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var security = { // Display the server certificate (static) viewCert : function () { var cert = security._cert; viewCertHelper(window, cert); }, _getSecurityInfo : function() { const nsIX509Cert = Components.interfaces.nsIX509Cert; const nsIX509CertDB = Components.interfaces.nsIX509CertDB; const nsX509CertDB = "@mozilla.org/security/x509certdb;1"; const nsISSLStatusProvider = Components.interfaces.nsISSLStatusProvider; const nsISSLStatus = Components.interfaces.nsISSLStatus; // We don't have separate info for a frame, return null until further notice // (see bug 138479) if (gWindow != gWindow.top) return null; var hName = null; try { hName = gWindow.location.host; } catch (exception) { } var ui = security._getSecurityUI(); if (!ui) return null; var isBroken = (ui.state & Components.interfaces.nsIWebProgressListener.STATE_IS_BROKEN); var isMixed = (ui.state & (Components.interfaces.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT | Components.interfaces.nsIWebProgressListener.STATE_LOADED_MIXED_DISPLAY_CONTENT)); var isInsecure = (ui.state & Components.interfaces.nsIWebProgressListener.STATE_IS_INSECURE); var isEV = (ui.state & Components.interfaces.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL); ui.QueryInterface(nsISSLStatusProvider); var status = ui.SSLStatus; if (!isInsecure && status) { status.QueryInterface(nsISSLStatus); var cert = status.serverCert; var issuerName = this.mapIssuerOrganization(cert.issuerOrganization) || cert.issuerName; var retval = { hostName : hName, cAName : issuerName, encryptionAlgorithm : undefined, encryptionStrength : undefined, encryptionSuite : undefined, version: undefined, isBroken : isBroken, isMixed : isMixed, isEV : isEV, cert : cert, fullLocation : gWindow.location }; var version; try { retval.encryptionAlgorithm = status.cipherName; retval.encryptionStrength = status.secretKeyLength; retval.encryptionSuite = status.cipherSuite; version = status.protocolVersion; } catch (e) { } switch (version) { case nsISSLStatus.SSL_VERSION_3: retval.version = "SSL 3"; break; case nsISSLStatus.TLS_VERSION_1: retval.version = "TLS 1.0"; break; case nsISSLStatus.TLS_VERSION_1_1: retval.version = "TLS 1.1"; break; case nsISSLStatus.TLS_VERSION_1_2: retval.version = "TLS 1.2" break; case nsISSLStatus.TLS_VERSION_1_3: retval.version = "TLS 1.3" break; } return retval; } else { return { hostName : hName, cAName : "", encryptionAlgorithm : "", encryptionStrength : 0, encryptionSuite : "", version: "", isBroken : isBroken, isMixed : isMixed, isEV : isEV, cert : null, fullLocation : gWindow.location }; } }, // Find the secureBrowserUI object (if present) _getSecurityUI : function() { if (window.opener.gBrowser) return window.opener.gBrowser.securityUI; return null; }, // Interface for mapping a certificate issuer organization to // the value to be displayed. // Bug 82017 - this implementation should be moved to pipnss C++ code mapIssuerOrganization: function(name) { if (!name) return null; if (name == "RSA Data Security, Inc.") return "Verisign, Inc."; // No mapping required return name; }, /** * Open the cookie manager window */ viewCookies : function() { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var win = wm.getMostRecentWindow("Browser:Cookies"); var eTLDService = Components.classes["@mozilla.org/network/effective-tld-service;1"]. getService(Components.interfaces.nsIEffectiveTLDService); var eTLD; var uri = gDocument.documentURIObject; try { eTLD = eTLDService.getBaseDomain(uri); } catch (e) { // getBaseDomain will fail if the host is an IP address or is empty eTLD = uri.asciiHost; } if (win) { win.gCookiesWindow.setFilter(eTLD); win.focus(); } else window.openDialog("chrome://browser/content/preferences/cookies.xul", "Browser:Cookies", "", {filterString : eTLD}); }, /** * Open the login manager window */ viewPasswords : function() { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var win = wm.getMostRecentWindow("Toolkit:PasswordManager"); if (win) { win.setFilter(this._getSecurityInfo().hostName); win.focus(); } else window.openDialog("chrome://passwordmgr/content/passwordManager.xul", "Toolkit:PasswordManager", "", {filterString : this._getSecurityInfo().hostName}); }, _cert : null }; function securityOnLoad() { var info = security._getSecurityInfo(); if (!info) { document.getElementById("securityTab").hidden = true; document.getElementById("securityBox").collapsed = true; return; } else { document.getElementById("securityTab").hidden = false; document.getElementById("securityBox").collapsed = false; } const pageInfoBundle = document.getElementById("pageinfobundle"); /* Set Identity section text */ setText("security-identity-domain-value", info.hostName); var owner, verifier, generalPageIdentityString; if (info.cert && !info.isBroken) { // Try to pull out meaningful values. Technically these fields are optional // so we'll employ fallbacks where appropriate. The EV spec states that Org // fields must be specified for subject and issuer so that case is simpler. if (info.isEV) { owner = info.cert.organization; verifier = security.mapIssuerOrganization(info.cAName); generalPageIdentityString = pageInfoBundle.getFormattedString("generalSiteIdentity", [owner, verifier]); } else { // Technically, a non-EV cert might specify an owner in the O field or not, // depending on the CA's issuing policies. However we don't have any programmatic // way to tell those apart, and no policy way to establish which organization // vetting standards are good enough (that's what EV is for) so we default to // treating these certs as domain-validated only. owner = pageInfoBundle.getString("securityNoOwner"); verifier = security.mapIssuerOrganization(info.cAName || info.cert.issuerCommonName || info.cert.issuerName); generalPageIdentityString = owner; } } else { // We don't have valid identity credentials. owner = pageInfoBundle.getString("securityNoOwner"); verifier = pageInfoBundle.getString("notset"); generalPageIdentityString = owner; } setText("security-identity-owner-value", owner); setText("security-identity-verifier-value", verifier); setText("general-security-identity", generalPageIdentityString); /* Manage the View Cert button*/ var viewCert = document.getElementById("security-view-cert"); if (info.cert) { security._cert = info.cert; viewCert.collapsed = false; } else viewCert.collapsed = true; /* Set Privacy & History section text */ var yesStr = pageInfoBundle.getString("yes"); var noStr = pageInfoBundle.getString("no"); var uri = gDocument.documentURIObject; setText("security-privacy-cookies-value", hostHasCookies(uri) ? yesStr : noStr); setText("security-privacy-passwords-value", realmHasPasswords(uri) ? yesStr : noStr); var visitCount = previousVisitCount(info.hostName); if(visitCount > 1) { setText("security-privacy-history-value", pageInfoBundle.getFormattedString("securityNVisits", [visitCount.toLocaleString()])); } else if (visitCount == 1) { setText("security-privacy-history-value", pageInfoBundle.getString("securityOneVisit")); } else { setText("security-privacy-history-value", noStr); } /* Set the Technical Detail section messages */ const pkiBundle = document.getElementById("pkiBundle"); var hdr; var msg1; var msg2; if (info.isBroken) { if (info.isMixed) { hdr = pkiBundle.getString("pageInfo_MixedContent"); } else { hdr = pkiBundle.getFormattedString("pageInfo_BrokenEncryption", [info.encryptionAlgorithm, info.encryptionStrength + "", info.version]); } msg1 = pkiBundle.getString("pageInfo_Privacy_Broken1"); msg2 = pkiBundle.getString("pageInfo_Privacy_None2"); } else if (info.encryptionStrength > 0) { hdr = pkiBundle.getFormattedString("pageInfo_EncryptionWithBitsAndProtocol", [info.encryptionAlgorithm, info.encryptionStrength + "", info.version]); msg1 = pkiBundle.getString("pageInfo_Privacy_Encrypted1"); msg2 = pkiBundle.getString("pageInfo_Privacy_Encrypted2"); security._cert = info.cert; } else { hdr = pkiBundle.getString("pageInfo_NoEncryption"); if (info.hostName != null) msg1 = pkiBundle.getFormattedString("pageInfo_Privacy_None1", [info.hostName]); else msg1 = pkiBundle.getString("pageInfo_Privacy_None3"); msg2 = pkiBundle.getString("pageInfo_Privacy_None2"); } setText("security-technical-shortform", hdr); setText("security-technical-longform1", msg1); setText("security-technical-longform2", msg2); setText("general-security-privacy", hdr); } function setText(id, value) { var element = document.getElementById(id); if (!element) return; if (element.localName == "textbox" || element.localName == "label") element.value = value; else { if (element.hasChildNodes()) element.removeChild(element.firstChild); var textNode = document.createTextNode(value); element.appendChild(textNode); } } function viewCertHelper(parent, cert) { if (!cert) return; var cd = Components.classes[CERTIFICATEDIALOGS_CONTRACTID].getService(nsICertificateDialogs); cd.viewCert(parent, cert); } /** * Return true iff we have cookies for uri */ function hostHasCookies(uri) { var cookieManager = Components.classes["@mozilla.org/cookiemanager;1"] .getService(Components.interfaces.nsICookieManager2); return cookieManager.countCookiesFromHost(uri.asciiHost) > 0; } /** * Return true iff realm (proto://host:port) (extracted from uri) has * saved passwords */ function realmHasPasswords(uri) { var passwordManager = Components.classes["@mozilla.org/login-manager;1"] .getService(Components.interfaces.nsILoginManager); return passwordManager.countLogins(uri.prePath, "", "") > 0; } /** * Return the number of previous visits recorded for host before today. * * @param host - the domain name to look for in history */ function previousVisitCount(host, endTimeReference) { if (!host) return false; var historyService = Components.classes["@mozilla.org/browser/nav-history-service;1"] .getService(Components.interfaces.nsINavHistoryService); var options = historyService.getNewQueryOptions(); options.resultType = options.RESULTS_AS_VISIT; // Search for visits to this host before today var query = historyService.getNewQuery(); query.endTimeReference = query.TIME_RELATIVE_TODAY; query.endTime = 0; query.domain = host; var result = historyService.executeQuery(query, options); result.root.containerOpen = true; var cc = result.root.childCount; result.root.containerOpen = false; return cc; }
var searchData= [ ['view_0',['view',['../classecs_1_1view.html',1,'ecs::view&lt; Components &gt;'],['../classecs_1_1registry.html#ae2dd9a290234e17841b32a34a9724434',1,'ecs::registry::view()']]], ['view_5fiterator_1',['view_iterator',['../classecs_1_1view__iterator.html',1,'ecs::view_iterator&lt; Component, Components &gt;'],['../classecs_1_1view__iterator.html#a7f4f1cd35e28349a2bc4a65eefd5248d',1,'ecs::view_iterator::view_iterator()']]] ];
'use strict'; /*! * Bootstrap-fullscreen-select v1.5.1 (http://craftpip.github.io/bootstrap-fullscreen-select/) * Author: boniface pereira * Website: www.craftpip.com * Contact: hey@craftpip.com * * Copyright 2013-2014 bootstrap-select * Licensed under MIT (https://github.com/craftpip/bootstrap-fullscreen-select/blob/master/LICENSE) */ if (typeof jQuery === 'undefined') { throw new Error('Mobileselect\' requires jQuery'); } (function ($) { $.fn.mobileSelect = function (options) { var $this = $(this); /* * backout if no elements are selected. */ if (!$this.length) return 'no elements to process'; /* * set an empty object if options === undefined */ if (!options) options = {}; if (typeof options === 'string') { if (options === 'destroy') { // destroy the mobile select initialization. $this.each(function (i, a) { var id = $(a).attr('data-msid'); $.mobileSelect.elements[id].destroy(); delete $.mobileSelect.elements[id]; }); } if (options === 'sync' || options === 'refresh') { //sync changes in the options. $this.each(function (i, a) { var id = $(a).attr('data-msid'); $.mobileSelect.elements[id].refresh(); }); } if (options === 'hide') { // programmically hide a shown mobileSelect $this.each(function (i, a) { var id = $(a).attr('data-msid'); $.mobileSelect.elements[id].hide(); }); } if (options === 'show') { // programmicallly show a mobileSelect $this.each(function (i, a) { var id = $(a).attr('data-msid'); $.mobileSelect.elements[id].show(); }); } if(options === 'exists'){ // test for existance of mobileSelect var truthyVar = false; $.each($.mobileSelect.elements, function(i,e){ if(e.$e[0] === $this[0]) truthyVar = true; }); return truthyVar; } return; } // if user defaults provided overwrite with mobileSelect defaults. if ($.mobileSelect.defaults) { $.extend($.fn.mobileSelect.defaults, $.mobileSelect.defaults); } // options to be merged with defaults. options = $.extend({}, $.fn.mobileSelect.defaults, options); // start iterating over! $this.each(function (i, a) { var $elm = $(a); //reject non SELECT elements if ($elm[0].tagName !== 'SELECT') { console.warn('Sorry, cannot initialized a ' + $elm[0].tagName + ' element'); return true; // continue; } if ($elm.attr('data-msid') !== undefined) { console.error('This element is already Initialized'); return true; // continue } // track objects via generated IDs var id = Math.floor(Math.random() * 999999); $elm.attr('data-msid', id); var mobileSelectObj = new Mobileselect(a, options); $.mobileSelect.elements[id] = mobileSelectObj; }); }; var Mobileselect = function (element, options) { this.$e = $(element); $.extend(this, options); this.init(); }; Mobileselect.prototype = { init: function () { this._setUserOptions(); this._extractOptions(); this._buildHTML(); this._bindEvents(); }, _buildHTML: function () { /* * build and insert the trigger element */ if (this.$e.attr('data-triggerOn') === undefined) { // no custom trigger element. if (this.$e.attr('data-style') !== undefined) { this.style = this.$e.attr('data-style'); } var b = this.$e.attr('disabled') || ''; this.$e.before('<button type="button" class="btn ' + this.style + ' btn-mobileSelect-gen" ' + b + '><span class="text"></span> <span class="caret"></span></button>'); this.$triggerElement = this.$e.prev(); this.$e.hide(); } else { this.$triggerElement = $(this.$e.attr('data-triggerOn')); } /* * Build mobile select container HTML. */ //seting up the container. this.$c = $('<div class="mobileSelect-container"></div>').addClass(this.theme).appendTo('body'); //appending the container template this.$c.html((!this.filterable ? $.fn.mobileSelect.defaults.template : $.fn.mobileSelect.defaults.templateFilterable)); //settings container animations. this.$c.children('div').css({ '-webkit-transition': 'all ' + this.animationSpeed / 1000 + 's', 'transition': 'all ' + this.animationSpeed / 1000 + 's' }).css(this.padding).addClass('anim-' + this.animation); /* * set title buttons text. */ if(!this.filterable) this.$c.find('.mobileSelect-title').html(this.title).end().find('.mobileSelect-selectallbtn').html(this.buttonSelectAll).end().find('.mobileSelect-savebtn').html(this.buttonSave).end().find('.mobileSelect-clearbtn').html(this.buttonClear).end().find('.mobileSelect-cancelbtn').html(this.buttonCancel).end(); else this.$c.find('.mobileSelect-selectallbtn').html(this.buttonSelectAll).end().find('.mobileSelect-savebtn').html(this.buttonSave).end().find('.mobileSelect-clearbtn').html(this.buttonClear).end().find('.mobileSelect-cancelbtn').html(this.buttonCancel).end(); this.$listcontainer = this.$c.find('.list-container'); if (!this.isMultiple) { this.$c.find('.mobileSelect-clearbtn').remove(); } else { this.$listcontainer.data('multiple', 'true'); } this._appendOptionsList(); }, _appendOptionsList: function () { /* * append options list. */ this.$listcontainer.html(''); var that = this; var prevGroup = ''; $.each(this.options, function (i, a) { if (a.group && a.group !== prevGroup) { if (a.groupDisabled) { var b = 'disabled'; } that.$listcontainer.append('<div><button class="btn-link" data-toggle="collapse" style="width: 100%" data-target="#group' + a.group + '"><span class="mobileSelect-group" ' + b + '>' + a.group + '</span></button><div id="group' + a.group + '" class="collapse in"></div></div>'); prevGroup = a.group; } if (a.groupDisabled || a.disabled) { var b = 'disabled'; } if (a.group) that.$listcontainer.filter($('#group' + a.group).append('<a href="#" class="mobileSelect-control" ' + b + ' data-value="' + a.value + '">' + a.text + '</a>')) else that.$listcontainer.append('<a href="#" class="mobileSelect-control" ' + b + ' data-value="' + a.value + '">' + a.text + '</a>'); }); this.sync(); this._updateBtnCount(); }, _updateBtnCount: function () { /* * Update generated button count. */ var d = this.$triggerElement.find(".text"), c = this.$e.val(); if (c === null) { d.html("Nothing selected"); return false } if (this.isMultiple) { if (c.length === 1) { d.html(this.$e.find('option:selected').text()) } else { d.html(c.length + " items selected") } } else { d.html(c) } }, _bindEvents: function () { /* * binding events on trigger element & buttons. */ var that = this; this.$triggerElement.on('click', function (e) { e.preventDefault(); that.show(); }); this.$c.find('.mobileSelect-selectallbtn').on('click', function (e) { e.preventDefault(); that.$listcontainer.find($('.mobileSelect-control')).filter(':visible').addClass('selected') that.syncR(); $(window).trigger('mobileSelectAll'); }); this.$c.find('.mobileSelect-savebtn').on('click', function (e) { e.preventDefault(); that.syncR(); that.hide(); $(window).trigger('mobileSelectSave'); }); this.$c.find('.mobileSelect-clearbtn').on('click', function (e) { e.preventDefault(); that.$listcontainer.find('.selected').removeClass('selected'); that.syncR(); $(window).trigger('mobileSelectClear'); }); this.$c.find('.mobileSelect-cancelbtn').on('click', function (e) { e.preventDefault(); that.hide(); $(window).trigger('mobileSelectCancel'); }); this.$c.find('.mobileSelect-filter').on('keyup', function (e) { var string = $(this).val().toLowerCase() if (string === "") { that.$listcontainer.find($('.mobileSelect-control')).show(); } else { that.$listcontainer.find($('.mobileSelect-control')).hide(); $.each(that.$listcontainer.find($('.mobileSelect-control')), function (i, item) { if ($(item).text().toLowerCase().indexOf(string) >= 0) $(item).show(); }); } }); this.$c.find('.mobileSelect-control').on('click', function (e) { e.preventDefault(); var $this = $(this); if ($this.attr('disabled') == 'disabled') return false; if (that.isMultiple) { $this.toggleClass('selected'); } else { $this.siblings().removeClass('selected').end().addClass('selected'); } }); this.$c.on('mobileSelectShow', function (event) { if (navigator.appName == 'Microsoft Internet Explorer' || !!(navigator.userAgent.match(/Trident/) || navigator.userAgent.match(/rv:11/)) || (typeof $.browser !== "undefined" && $.browser.msie == 1)) { $(window).off('keyup'); $(window).on('keyup', function (evt) { var string = that.$c.find('.mobileSelect-filter').val().toLowerCase() if (string === "") { that.$listcontainer.find($('.mobileSelect-control')).show(); } else { that.$listcontainer.find($('.mobileSelect-control')).hide(); $.each(that.$listcontainer.find($('.mobileSelect-control')), function (i, item) { if ($(item).text().toLowerCase().indexOf(string) >= 0) $(item).show(); }); } }) } }); this.$c.on('mobileSelectHide', function (event, object) { if (navigator.appName == 'Microsoft Internet Explorer' || !!(navigator.userAgent.match(/Trident/) || navigator.userAgent.match(/rv:11/)) || (typeof $.browser !== "undefined" && $.browser.msie == 1)) { $(window).off('keyup'); } }); }, _unbindEvents: function () { /* * to unbind events while destroy. */ this.$triggerElement.unbind('click'); this.$c.find('.mobileSelect-clearbtn').unbind('click'); this.$c.find('.mobileSelect-cancelbtn').unbind('click'); this.$c.find('.mobileSelect-control').unbind('click'); this.$c.find('.mobileSelect-filter').unbind('keyup'); this.$c.unbind('mobileSelectShow'); this.$c.unbind('mobileSelectHide'); }, sync: function () { /* * sync from select element to mobile select container */ var selectedOptions = this.$e.val(); if (!this.isMultiple) selectedOptions = [selectedOptions]; this.$c.find('a').removeClass('selected'); for (var i in selectedOptions) { this.$c.find('a[data-value="' + selectedOptions[i] + '"]').addClass('selected'); } }, syncR: function () { /* * sync from mobile select container to select element */ var selectedOptions = []; this.$c.find('.selected').each(function () { selectedOptions.push($(this).data('value')); }); this.$e.val(selectedOptions); }, hide: function () { /* * hide animation with onClose callback */ this.$c.children('div').addClass('anim-' + this.animation); var that = this; this._updateBtnCount(); setTimeout(function () { that.$c.hide(); $('body').removeClass('mobileSelect-noscroll'); that.onClose.apply(that.$e); that.$c.trigger('mobileSelectHide'); }, this.animationSpeed); }, show: function () { /* * show animation with onOpen callback */ this.$c.show(); this.sync(); $('body').addClass('mobileSelect-noscroll'); var that = this; setTimeout(function () { that.$c.children('div').removeClass($.mobileSelect.animations.join(' ')); }, 10); this.onOpen.apply(this.$e); this.$c.trigger('mobileSelectShow'); }, _setUserOptions: function () { /* * overwrite options with data-attributes if provided. */ this.isMultiple = this.$e.attr('multiple') ? true : false; if (this.$e.data('title') !== undefined) { this.title = this.$e.data('title'); } if (this.$e.data('animation') !== undefined) { this.animation = this.$e.data('animation'); } if (this.$e.data('animation-speed') !== undefined) { this.animationSpeed = this.$e.data('animation-speed'); } if (this.$e.data('padding') !== undefined) { this.padding = this.$e.data('padding'); } if (this.$e.data('btntext-save') !== undefined) { this.buttonSave = this.$e.data('btntext-save'); } if (this.$e.data('btntext-clear') !== undefined) { this.buttonClear = this.$e.data('btntext-clear'); } if (this.$e.data('btntext-cancel') !== undefined) { this.buttonCancel = this.$e.data('btntext-cancel'); } if (this.$e.data('theme') !== undefined) { this.theme = this.$e.data('theme'); } if (this.animation === 'none') { this.animationSpeed = 0; } }, _extractOptions: function () { /* * Get options from the select element and store them in an array. */ var options = []; $.each(this.$e.find('option'), function (i, a) { var $t = $(a); if ($t.text()) { // var label = $t.parent().is('optgroup') ? $t.parent().attr('label') : false; if ($t.parent().is('optgroup')) { var label = $t.parent().attr('label'); var labelDisabled = $t.parent().prop('disabled'); } else { var label = false; var labelDisabled = false; } options.push({ value: $t.val(), text: $.trim($t.text()), disabled: $t.prop('disabled'), group: label, groupDisabled: labelDisabled }); } }); this.options = options; }, destroy: function () { /* * destroy the select * unbind events * remove triggerElement, container * show the Native select */ this.$e.removeAttr('data-msid'); this._unbindEvents(); this.$triggerElement.remove(); this.$c.remove(); this.$e.show(); console.log('done '); }, refresh: function () { /* * refresh/sync the native select with the mobileSelect. */ this._extractOptions(); this._appendOptionsList(); this._unbindEvents(); this._bindEvents(); } }; /* * for user defaults. */ $.mobileSelect = { elements: {}, //to store records animations: ['anim-top', 'anim-bottom', 'anim-left', 'anim-right', 'anim-opacity', 'anim-scale', 'anim-zoom', 'anim-none'] //supported animations }; /* * plugin defaults */ $.fn.mobileSelect.defaults = { template: '<div><div class="mobileSelect-title"></div><div class="list-container"></div><div class="mobileSelect-buttons"><a href="#" class="mobileSelect-selectallbtn"></a><a href="#" class="mobileSelect-savebtn"></a><a href="#" class="mobileSelect-clearbtn"></a><a href="#" class="mobileSelect-cancelbtn"></a></div></div>', templateFilterable:'<div><div class="mobileSelect-title"><div class="right-inner-addon"><input class="form-control mobileSelect-filter" placeholder="Search"/></div></div><div class="list-container"></div><div class="mobileSelect-buttons"><a href="#" class="mobileSelect-selectallbtn"></a><a href="#" class="mobileSelect-savebtn"></a><a href="#" class="mobileSelect-clearbtn"></a><a href="#" class="mobileSelect-cancelbtn"></a></div></div>', title: 'Select an option', buttonSelectAll: 'Select All Visible', buttonSave: 'Save', buttonClear: 'Clear', buttonCancel: 'Cancel', padding: { 'top': '20px', 'left': '20px', 'right': '20px', 'bottom': '20px' }, animation: 'scale', animationSpeed: 400, theme: 'white', onOpen: function () { }, onClose: function () { }, style: 'btn-default', filterable: false }; })(jQuery);
var searchData= [ ['upcastinner',['upcastInner',['../classfaiss_1_1gpu_1_1Tensor.html#aee5cf46d16344e2a055cf63adb07d24a',1,'faiss::gpu::Tensor']]], ['upcastouter',['upcastOuter',['../classfaiss_1_1gpu_1_1Tensor.html#a309eb97e9c6dbfdecf383343c072d38c',1,'faiss::gpu::Tensor']]], ['update_5fbounds',['update_bounds',['../structfaiss_1_1ParameterSpace.html#ab7039882ec68aabc6c52cff883f75c28',1,'faiss::ParameterSpace']]], ['update_5fi_5fcross',['update_i_cross',['../structfaiss_1_1Score3Computer.html#acf371848bac76ba275ceb5e10f805d33',1,'faiss::Score3Computer']]], ['update_5findex',['update_index',['../structfaiss_1_1ClusteringParameters.html#a27d6192097920fa981cff0acedfaac91',1,'faiss::ClusteringParameters']]], ['update_5fj_5fline',['update_j_line',['../structfaiss_1_1Score3Computer.html#a98da6005edbb5ec26311bc947866122d',1,'faiss::Score3Computer']]], ['update_5fk',['update_k',['../structfaiss_1_1Score3Computer.html#a227601c3dc8779bb13747ba04934e0c8',1,'faiss::Score3Computer']]], ['update_5fpermutation',['update_permutation',['../structfaiss_1_1IndexFlat1D.html#ac7466c6c9b1e9e81ea19b846ddb8209e',1,'faiss::IndexFlat1D']]], ['update_5fvectors',['update_vectors',['../structfaiss_1_1IndexIVFFlat.html#a2adc0b0002c32ddc01aec4ab96dd659f',1,'faiss::IndexIVFFlat']]], ['updatedevicelistinfo_5f',['updateDeviceListInfo_',['../classfaiss_1_1gpu_1_1IVFBase.html#acc695610c9513952b8d234dc0db78e5c',1,'faiss::gpu::IVFBase::updateDeviceListInfo_(cudaStream_t stream)'],['../classfaiss_1_1gpu_1_1IVFBase.html#ae90724e307bbfe49554a2ab77fbd1764',1,'faiss::gpu::IVFBase::updateDeviceListInfo_(const std::vector&lt; int &gt; &amp;listIds, cudaStream_t stream)']]], ['upper_5fbeam',['upper_beam',['../structfaiss_1_1HNSW.html#a857bef0db2dc0000f312cc8a95f857b2',1,'faiss::HNSW']]], ['use_5fprecomputed_5ftable',['use_precomputed_table',['../structfaiss_1_1IndexIVFPQ.html#a1c66ff073c18a1edbe8444c24d870583',1,'faiss::IndexIVFPQ']]], ['usefloat16',['useFloat16',['../structfaiss_1_1gpu_1_1GpuClonerOptions.html#ac7cc57d6091d6a79ea6020bf8d1fbe27',1,'faiss::gpu::GpuClonerOptions::useFloat16()'],['../structfaiss_1_1gpu_1_1GpuIndexFlatConfig.html#afd694186c87751937a646f3db2c8ba3d',1,'faiss::gpu::GpuIndexFlatConfig::useFloat16()']]], ['usefloat16accumulator',['useFloat16Accumulator',['../structfaiss_1_1gpu_1_1GpuIndexFlatConfig.html#a5a2d8737f4277e55fc1a99ef4fc4c630',1,'faiss::gpu::GpuIndexFlatConfig']]], ['usefloat16coarsequantizer',['useFloat16CoarseQuantizer',['../structfaiss_1_1gpu_1_1GpuClonerOptions.html#a85f3093908b6e9a503c24bb226b17b1b',1,'faiss::gpu::GpuClonerOptions']]], ['usefloat16ivfstorage',['useFloat16IVFStorage',['../structfaiss_1_1gpu_1_1GpuIndexIVFFlatConfig.html#ab98ac354bcd5632976f7edc2deda6e57',1,'faiss::gpu::GpuIndexIVFFlatConfig']]], ['usefloat16lookuptables',['useFloat16LookupTables',['../structfaiss_1_1gpu_1_1GpuIndexIVFPQConfig.html#a9dbbec78d77d90b7b150f543e477cc49',1,'faiss::gpu::GpuIndexIVFPQConfig']]], ['useprecomputed',['usePrecomputed',['../structfaiss_1_1gpu_1_1GpuClonerOptions.html#abc9c607f2dfc9f23942a523fb49c63fe',1,'faiss::gpu::GpuClonerOptions']]], ['useprecomputedtables',['usePrecomputedTables',['../structfaiss_1_1gpu_1_1GpuIndexIVFPQConfig.html#ae5b5c7acc06743e5bcca197bc33c30ec',1,'faiss::gpu::GpuIndexIVFPQConfig']]] ];
import axios from "axios"; export default { ajaxGet (api, cb) { axios.get(api) .then(cb) .catch(err => { console.log(err); }) }, ajaxPost (api, post, cb) { axios.post(api, post) .then(cb) .catch(err => { console.log(err); }) }, }
'use strict' var Promise = require('promise'); var db = require('../../db/models'); var Sequelize = require('sequelize'); var Notifi_User = db.NotificationUser; function checkViewedNotification(noti_id, listNotiUser) { var result= false; listNotiUser.forEach(element => { if(noti_id == element.notification_id) result = true; }); if(result == true) return 1; else return 0; } /** * show list notification for user * nếu user chưa có liên kết đến notification => chưa đoc tin (đổi màu) * nếu date now <date finish => là tin mới. * @param {notification_id,admin_id,session.password} req * @param {*} res */ exports.getListNotificationForUser = (req,res) =>{ if(req.session.user_id){ db.Notification.findAll({order: [['updatedAt','DESC']]}).then(list => { db.User.findById(req.session.user_id).then(user => { user.getNotificationUsers().then(listNotiUser =>{ var listNoti = new Array(); var i = 0; list.forEach(noti => { listNoti[i] = { id :noti.id, title :noti.title, description : noti.description, link : noti.link, url_img : noti.url_img, author : noti.admin_id, date_finished : noti.date, isViewed : checkViewedNotification(noti.id,listNotiUser) } i++; }); //update author; var listPromise = new Array(Promise); var x = 0; listNoti.forEach(element => { listPromise[x++] = db.Admin.findById(element.author); }); Promise.all(listPromise).then(values => { var j = 0; listNoti.forEach(element => { element.author = values[j].nickname; j++; }); listNoti.sort(function(obj1, obj2) { // Ascending: first age less than the previous return obj1.isViewed - obj2.isViewed; }); //show list notification return res.send(listNoti); }); }); }).catch(err=>{ console.log(err); return res.send(JSON.stringify({})); }); }); }else res.redirect("/"); } exports.updateNewNotify =(req,res)=>{ var user_id = req.session.user_id; if(user_id){ var list_notifi = req.body.list_notifi; db.User.findById(user_id) .then(user=>{ user.getNotificationUsers().then(listNotiUser=>{ var insert_data=[]; for(var i=0;i< list_notifi.length;i++){ console.log(list_notifi[0]); if(checkViewedNotification(parseInt(list_notifi[i]),listNotiUser)==0){ var data = { "user_id": user_id, "notification_id" : parseInt(list_notifi[i]), "is_viewed" : 1 } insert_data.push(data); } } if(insert_data.length ==0){ console.log(JSON.stringify({status: 0})); return res.send(JSON.stringify({status: 0})); }else{ Notifi_User.bulkCreate(insert_data) .then(function(){ Notifi_User.findAll().then(function(Notifi_User) { return res.send(JSON.stringify({status: 1})) }) }).catch(err=>{ console.log(err); return res.send(JSON.stringify({status: 0})) }) } }); }).catch(err=>{ console.log(err); return res.send(JSON.stringify({status: 0})) }) }else return res.redirect('/'); }
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/cdk/coercion"),require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/platform"),require("@angular/common"),require("@angular/cdk/bidi"),require("@angular/cdk/collections")):"function"==typeof define&&define.amd?define("@angular/cdk/scrolling",["exports","@angular/cdk/coercion","@angular/core","rxjs","rxjs/operators","@angular/cdk/platform","@angular/common","@angular/cdk/bidi","@angular/cdk/collections"],e):e(((t=t||self).ng=t.ng||{},t.ng.cdk=t.ng.cdk||{},t.ng.cdk.scrolling={}),t.ng.cdk.coercion,t.ng.core,t.rxjs,t.rxjs.operators,t.ng.cdk.platform,t.ng.common,t.ng.cdk.bidi,t.ng.cdk.collections)}(this,(function(t,e,r,n,o,i,a,s,l){"use strict"; /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */var c=new r.InjectionToken("VIRTUAL_SCROLL_STRATEGY"),d=function(){function t(t,e,r){this._scrolledIndexChange=new n.Subject,this.scrolledIndexChange=this._scrolledIndexChange.pipe(o.distinctUntilChanged()),this._viewport=null,this._itemSize=t,this._minBufferPx=e,this._maxBufferPx=r}return t.prototype.attach=function(t){this._viewport=t,this._updateTotalContentSize(),this._updateRenderedRange()},t.prototype.detach=function(){this._scrolledIndexChange.complete(),this._viewport=null},t.prototype.updateItemAndBufferSize=function(t,e,r){this._itemSize=t,this._minBufferPx=e,this._maxBufferPx=r,this._updateTotalContentSize(),this._updateRenderedRange()},t.prototype.onContentScrolled=function(){this._updateRenderedRange()},t.prototype.onDataLengthChanged=function(){this._updateTotalContentSize(),this._updateRenderedRange()},t.prototype.onContentRendered=function(){},t.prototype.onRenderedOffsetChanged=function(){},t.prototype.scrollToIndex=function(t,e){this._viewport&&this._viewport.scrollToOffset(t*this._itemSize,e)},t.prototype._updateTotalContentSize=function(){this._viewport&&this._viewport.setTotalContentSize(this._viewport.getDataLength()*this._itemSize)},t.prototype._updateRenderedRange=function(){if(this._viewport){var t=this._viewport.getRenderedRange(),e={start:t.start,end:t.end},r=this._viewport.getViewportSize(),n=this._viewport.getDataLength(),o=this._viewport.measureScrollOffset(),i=this._itemSize>0?o/this._itemSize:0;if(e.end>n){var a=Math.ceil(r/this._itemSize),s=Math.max(0,Math.min(i,n-a));i!=s&&(i=s,o=s*this._itemSize,e.start=Math.floor(i)),e.end=Math.max(0,Math.min(n,e.start+a))}var l=o-e.start*this._itemSize;if(l<this._minBufferPx&&0!=e.start){var c=Math.ceil((this._maxBufferPx-l)/this._itemSize);e.start=Math.max(0,e.start-c),e.end=Math.min(n,Math.ceil(i+(r+this._minBufferPx)/this._itemSize))}else{var d=e.end*this._itemSize-(o+r);if(d<this._minBufferPx&&e.end!=n){var u=Math.ceil((this._maxBufferPx-d)/this._itemSize);u>0&&(e.end=Math.min(n,e.end+u),e.start=Math.max(0,Math.floor(i-this._minBufferPx/this._itemSize)))}}this._viewport.setRenderedRange(e),this._viewport.setRenderedContentOffset(this._itemSize*e.start),this._scrolledIndexChange.next(Math.floor(i))}},t}(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */function u(t){return t._scrollStrategy}var h=function(){function t(){this._itemSize=20,this._minBufferPx=100,this._maxBufferPx=200,this._scrollStrategy=new d(this.itemSize,this.minBufferPx,this.maxBufferPx)}return Object.defineProperty(t.prototype,"itemSize",{get:function(){return this._itemSize},set:function(t){this._itemSize=e.coerceNumberProperty(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minBufferPx",{get:function(){return this._minBufferPx},set:function(t){this._minBufferPx=e.coerceNumberProperty(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxBufferPx",{get:function(){return this._maxBufferPx},set:function(t){this._maxBufferPx=e.coerceNumberProperty(t)},enumerable:!1,configurable:!0}),t.prototype.ngOnChanges=function(){this._scrollStrategy.updateItemAndBufferSize(this.itemSize,this.minBufferPx,this.maxBufferPx)},t}();h.decorators=[{type:r.Directive,args:[{selector:"cdk-virtual-scroll-viewport[itemSize]",providers:[{provide:c,useFactory:u,deps:[r.forwardRef((function(){return h}))]}]}]}],h.propDecorators={itemSize:[{type:r.Input}],minBufferPx:[{type:r.Input}],maxBufferPx:[{type:r.Input}]}; /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var p=function(){function t(t,e,r){this._ngZone=t,this._platform=e,this._scrolled=new n.Subject,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}return t.prototype.register=function(t){var e=this;this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe((function(){return e._scrolled.next(t)})))},t.prototype.deregister=function(t){var e=this.scrollContainers.get(t);e&&(e.unsubscribe(),this.scrollContainers.delete(t))},t.prototype.scrolled=function(t){var e=this;return void 0===t&&(t=20),this._platform.isBrowser?new n.Observable((function(r){e._globalSubscription||e._addGlobalListener();var n=t>0?e._scrolled.pipe(o.auditTime(t)).subscribe(r):e._scrolled.subscribe(r);return e._scrolledCount++,function(){n.unsubscribe(),e._scrolledCount--,e._scrolledCount||e._removeGlobalListener()}})):n.of()},t.prototype.ngOnDestroy=function(){var t=this;this._removeGlobalListener(),this.scrollContainers.forEach((function(e,r){return t.deregister(r)})),this._scrolled.complete()},t.prototype.ancestorScrolled=function(t,e){var r=this.getAncestorScrollContainers(t);return this.scrolled(e).pipe(o.filter((function(t){return!t||r.indexOf(t)>-1})))},t.prototype.getAncestorScrollContainers=function(t){var e=this,r=[];return this.scrollContainers.forEach((function(n,o){e._scrollableContainsElement(o,t)&&r.push(o)})),r},t.prototype._getWindow=function(){return this._document.defaultView||window},t.prototype._scrollableContainsElement=function(t,r){var n=e.coerceElement(r),o=t.getElementRef().nativeElement;do{if(n==o)return!0}while(n=n.parentElement);return!1},t.prototype._addGlobalListener=function(){var t=this;this._globalSubscription=this._ngZone.runOutsideAngular((function(){var e=t._getWindow();return n.fromEvent(e.document,"scroll").subscribe((function(){return t._scrolled.next()}))}))},t.prototype._removeGlobalListener=function(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)},t}();p.ɵprov=r.ɵɵdefineInjectable({factory:function t(){return new p(r.ɵɵinject(r.NgZone),r.ɵɵinject(i.Platform),r.ɵɵinject(a.DOCUMENT,8))},token:p,providedIn:"root"}),p.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],p.ctorParameters=function(){return[{type:r.NgZone},{type:i.Platform},{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[a.DOCUMENT]}]}]}; /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var f=function(){function t(t,e,r,i){var a=this;this.elementRef=t,this.scrollDispatcher=e,this.ngZone=r,this.dir=i,this._destroyed=new n.Subject,this._elementScrolled=new n.Observable((function(t){return a.ngZone.runOutsideAngular((function(){return n.fromEvent(a.elementRef.nativeElement,"scroll").pipe(o.takeUntil(a._destroyed)).subscribe(t)}))}))}return t.prototype.ngOnInit=function(){this.scrollDispatcher.register(this)},t.prototype.ngOnDestroy=function(){this.scrollDispatcher.deregister(this),this._destroyed.next(),this._destroyed.complete()},t.prototype.elementScrolled=function(){return this._elementScrolled},t.prototype.getElementRef=function(){return this.elementRef},t.prototype.scrollTo=function(t){var e=this.elementRef.nativeElement,r=this.dir&&"rtl"==this.dir.value;null==t.left&&(t.left=r?t.end:t.start),null==t.right&&(t.right=r?t.start:t.end),null!=t.bottom&&(t.top=e.scrollHeight-e.clientHeight-t.bottom),r&&0!=i.getRtlScrollAxisType()?(null!=t.left&&(t.right=e.scrollWidth-e.clientWidth-t.left),2==i.getRtlScrollAxisType()?t.left=t.right:1==i.getRtlScrollAxisType()&&(t.left=t.right?-t.right:t.right)):null!=t.right&&(t.left=e.scrollWidth-e.clientWidth-t.right),this._applyScrollToOptions(t)},t.prototype._applyScrollToOptions=function(t){var e=this.elementRef.nativeElement;i.supportsScrollBehavior()?e.scrollTo(t):(null!=t.top&&(e.scrollTop=t.top),null!=t.left&&(e.scrollLeft=t.left))},t.prototype.measureScrollOffset=function(t){var e=this.elementRef.nativeElement;if("top"==t)return e.scrollTop;if("bottom"==t)return e.scrollHeight-e.clientHeight-e.scrollTop;var r=this.dir&&"rtl"==this.dir.value;return"start"==t?t=r?"right":"left":"end"==t&&(t=r?"left":"right"),r&&2==i.getRtlScrollAxisType()?"left"==t?e.scrollWidth-e.clientWidth-e.scrollLeft:e.scrollLeft:r&&1==i.getRtlScrollAxisType()?"left"==t?e.scrollLeft+e.scrollWidth-e.clientWidth:-e.scrollLeft:"left"==t?e.scrollLeft:e.scrollWidth-e.clientWidth-e.scrollLeft},t}();f.decorators=[{type:r.Directive,args:[{selector:"[cdk-scrollable], [cdkScrollable]"}]}],f.ctorParameters=function(){return[{type:r.ElementRef},{type:p},{type:r.NgZone},{type:s.Directionality,decorators:[{type:r.Optional}]}]}; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var g=function(t,e){return(g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},_=function(){function t(t,e,r){var o=this;this._platform=t,this._change=new n.Subject,this._changeListener=function(t){o._change.next(t)},this._document=r,e.runOutsideAngular((function(){if(t.isBrowser){var e=o._getWindow();e.addEventListener("resize",o._changeListener),e.addEventListener("orientationchange",o._changeListener)}o.change().subscribe((function(){return o._updateViewportSize()}))}))}return t.prototype.ngOnDestroy=function(){if(this._platform.isBrowser){var t=this._getWindow();t.removeEventListener("resize",this._changeListener),t.removeEventListener("orientationchange",this._changeListener)}this._change.complete()},t.prototype.getViewportSize=function(){this._viewportSize||this._updateViewportSize();var t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t},t.prototype.getViewportRect=function(){var t=this.getViewportScrollPosition(),e=this.getViewportSize(),r=e.width,n=e.height;return{top:t.top,left:t.left,bottom:t.top+n,right:t.left+r,height:n,width:r}},t.prototype.getViewportScrollPosition=function(){if(!this._platform.isBrowser)return{top:0,left:0};var t=this._document,e=this._getWindow(),r=t.documentElement,n=r.getBoundingClientRect();return{top:-n.top||t.body.scrollTop||e.scrollY||r.scrollTop||0,left:-n.left||t.body.scrollLeft||e.scrollX||r.scrollLeft||0}},t.prototype.change=function(t){return void 0===t&&(t=20),t>0?this._change.pipe(o.auditTime(t)):this._change},t.prototype._getWindow=function(){return this._document.defaultView||window},t.prototype._updateViewportSize=function(){var t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}},t}();_.ɵprov=r.ɵɵdefineInjectable({factory:function t(){return new _(r.ɵɵinject(i.Platform),r.ɵɵinject(r.NgZone),r.ɵɵinject(a.DOCUMENT,8))},token:_,providedIn:"root"}),_.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],_.ctorParameters=function(){return[{type:i.Platform},{type:r.NgZone},{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[a.DOCUMENT]}]}]};var m="undefined"!=typeof requestAnimationFrame?n.animationFrameScheduler:n.asapScheduler,y=function(t){function e(e,r,o,i,a,s,l){var c=t.call(this,e,s,o,a)||this;return c.elementRef=e,c._changeDetectorRef=r,c._scrollStrategy=i,c._detachedSubject=new n.Subject,c._renderedRangeSubject=new n.Subject,c._orientation="vertical",c.scrolledIndexChange=new n.Observable((function(t){return c._scrollStrategy.scrolledIndexChange.subscribe((function(e){return Promise.resolve().then((function(){return c.ngZone.run((function(){return t.next(e)}))}))}))})),c.renderedRangeStream=c._renderedRangeSubject,c._totalContentSize=0,c._totalContentWidth="",c._totalContentHeight="",c._renderedRange={start:0,end:0},c._dataLength=0,c._viewportSize=0,c._renderedContentOffset=0,c._renderedContentOffsetNeedsRewrite=!1,c._isChangeDetectionPending=!1,c._runAfterChangeDetection=[],c._viewportChanges=n.Subscription.EMPTY,c._viewportChanges=l.change().subscribe((function(){c.checkViewportSize()})),c}return function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}g(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._orientation=t,this._calculateSpacerSize())},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;t.prototype.ngOnInit.call(this),this.ngZone.runOutsideAngular((function(){return Promise.resolve().then((function(){e._measureViewportSize(),e._scrollStrategy.attach(e),e.elementScrolled().pipe(o.startWith(null),o.auditTime(0,m)).subscribe((function(){return e._scrollStrategy.onContentScrolled()})),e._markChangeDetectionNeeded()}))}))},e.prototype.ngOnDestroy=function(){this.detach(),this._scrollStrategy.detach(),this._renderedRangeSubject.complete(),this._detachedSubject.complete(),this._viewportChanges.unsubscribe(),t.prototype.ngOnDestroy.call(this)},e.prototype.attach=function(t){var e=this;this.ngZone.runOutsideAngular((function(){e._forOf=t,e._forOf.dataStream.pipe(o.takeUntil(e._detachedSubject)).subscribe((function(t){var r=t.length;r!==e._dataLength&&(e._dataLength=r,e._scrollStrategy.onDataLengthChanged()),e._doChangeDetection()}))}))},e.prototype.detach=function(){this._forOf=null,this._detachedSubject.next()},e.prototype.getDataLength=function(){return this._dataLength},e.prototype.getViewportSize=function(){return this._viewportSize},e.prototype.getRenderedRange=function(){return this._renderedRange},e.prototype.setTotalContentSize=function(t){this._totalContentSize!==t&&(this._totalContentSize=t,this._calculateSpacerSize(),this._markChangeDetectionNeeded())},e.prototype.setRenderedRange=function(t){var e=this;(function r(t,e){return t.start==e.start&&t.end==e.end})(this._renderedRange,t)||(this._renderedRangeSubject.next(this._renderedRange=t),this._markChangeDetectionNeeded((function(){return e._scrollStrategy.onContentRendered()})))},e.prototype.getOffsetToRenderedContentStart=function(){return this._renderedContentOffsetNeedsRewrite?null:this._renderedContentOffset},e.prototype.setRenderedContentOffset=function(t,e){var r=this;void 0===e&&(e="to-start");var n="horizontal"==this.orientation,o=n?"X":"Y",i="translate"+o+"("+Number((n&&this.dir&&"rtl"==this.dir.value?-1:1)*t)+"px)";this._renderedContentOffset=t,"to-end"===e&&(i+=" translate"+o+"(-100%)",this._renderedContentOffsetNeedsRewrite=!0),this._renderedContentTransform!=i&&(this._renderedContentTransform=i,this._markChangeDetectionNeeded((function(){r._renderedContentOffsetNeedsRewrite?(r._renderedContentOffset-=r.measureRenderedContentSize(),r._renderedContentOffsetNeedsRewrite=!1,r.setRenderedContentOffset(r._renderedContentOffset)):r._scrollStrategy.onRenderedOffsetChanged()})))},e.prototype.scrollToOffset=function(t,e){void 0===e&&(e="auto");var r={behavior:e};"horizontal"===this.orientation?r.start=t:r.top=t,this.scrollTo(r)},e.prototype.scrollToIndex=function(t,e){void 0===e&&(e="auto"),this._scrollStrategy.scrollToIndex(t,e)},e.prototype.measureScrollOffset=function(e){return t.prototype.measureScrollOffset.call(this,e||("horizontal"===this.orientation?"start":"top"))},e.prototype.measureRenderedContentSize=function(){var t=this._contentWrapper.nativeElement;return"horizontal"===this.orientation?t.offsetWidth:t.offsetHeight},e.prototype.measureRangeSize=function(t){return this._forOf?this._forOf.measureRangeSize(t,this.orientation):0},e.prototype.checkViewportSize=function(){this._measureViewportSize(),this._scrollStrategy.onDataLengthChanged()},e.prototype._measureViewportSize=function(){var t=this.elementRef.nativeElement;this._viewportSize="horizontal"===this.orientation?t.clientWidth:t.clientHeight},e.prototype._markChangeDetectionNeeded=function(t){var e=this;t&&this._runAfterChangeDetection.push(t),this._isChangeDetectionPending||(this._isChangeDetectionPending=!0,this.ngZone.runOutsideAngular((function(){return Promise.resolve().then((function(){e._doChangeDetection()}))})))},e.prototype._doChangeDetection=function(){var t,e,r=this;this._isChangeDetectionPending=!1,this._contentWrapper.nativeElement.style.transform=this._renderedContentTransform,this.ngZone.run((function(){return r._changeDetectorRef.markForCheck()}));var n=this._runAfterChangeDetection;this._runAfterChangeDetection=[];try{for(var o=function i(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(n),a=o.next();!a.done;a=o.next())(0,a.value)()}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}},e.prototype._calculateSpacerSize=function(){this._totalContentHeight="horizontal"===this.orientation?"":this._totalContentSize+"px",this._totalContentWidth="horizontal"===this.orientation?this._totalContentSize+"px":""},e}(f);function v(t,e,r){if(!r.getBoundingClientRect)return 0;var n=r.getBoundingClientRect();return"horizontal"===t?"start"===e?n.left:n.right:"start"===e?n.top:n.bottom}y.decorators=[{type:r.Component,args:[{selector:"cdk-virtual-scroll-viewport",template:'\x3c!--\r\n Wrap the rendered content in an element that will be used to offset it based on the scroll\r\n position.\r\n--\x3e\r\n<div #contentWrapper class="cdk-virtual-scroll-content-wrapper">\r\n <ng-content></ng-content>\r\n</div>\r\n\x3c!--\r\n Spacer used to force the scrolling container to the correct size for the *total* number of items\r\n so that the scrollbar captures the size of the entire data set.\r\n--\x3e\r\n<div class="cdk-virtual-scroll-spacer"\r\n [style.width]="_totalContentWidth" [style.height]="_totalContentHeight"></div>\r\n',host:{class:"cdk-virtual-scroll-viewport","[class.cdk-virtual-scroll-orientation-horizontal]":'orientation === "horizontal"',"[class.cdk-virtual-scroll-orientation-vertical]":'orientation !== "horizontal"'},encapsulation:r.ViewEncapsulation.None,changeDetection:r.ChangeDetectionStrategy.OnPush,providers:[{provide:f,useExisting:y}],styles:["cdk-virtual-scroll-viewport{display:block;position:relative;overflow:auto;contain:strict;transform:translateZ(0);will-change:scroll-position;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{position:absolute;top:0;left:0;height:1px;width:1px;transform-origin:0 0}[dir=rtl] .cdk-virtual-scroll-spacer{right:0;left:auto;transform-origin:100% 0}\n"]}]}],y.ctorParameters=function(){return[{type:r.ElementRef},{type:r.ChangeDetectorRef},{type:r.NgZone},{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[c]}]},{type:s.Directionality,decorators:[{type:r.Optional}]},{type:p},{type:_}]},y.propDecorators={orientation:[{type:r.Input}],scrolledIndexChange:[{type:r.Output}],_contentWrapper:[{type:r.ViewChild,args:["contentWrapper",{static:!0}]}]};var S,w,b=function(){function t(t,e,r,i,a,s){var l=this;this._viewContainerRef=t,this._template=e,this._differs=r,this._viewRepeater=i,this._viewport=a,this.viewChange=new n.Subject,this._dataSourceChanges=new n.Subject,this.dataStream=this._dataSourceChanges.pipe(o.startWith(null),o.pairwise(),o.switchMap((function(t){var e=function r(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}(t,2);return l._changeDataSource(e[0],e[1])})),o.shareReplay(1)),this._differ=null,this._needsUpdate=!1,this._destroyed=new n.Subject,this.dataStream.subscribe((function(t){l._data=t,l._onRenderedDataChange()})),this._viewport.renderedRangeStream.pipe(o.takeUntil(this._destroyed)).subscribe((function(t){l._renderedRange=t,s.run((function(){return l.viewChange.next(l._renderedRange)})),l._onRenderedDataChange()})),this._viewport.attach(this)}return Object.defineProperty(t.prototype,"cdkVirtualForOf",{get:function(){return this._cdkVirtualForOf},set:function(t){this._cdkVirtualForOf=t,l.isDataSource(t)?this._dataSourceChanges.next(t):this._dataSourceChanges.next(new l.ArrayDataSource(n.isObservable(t)?t:Array.from(t||[])))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cdkVirtualForTrackBy",{get:function(){return this._cdkVirtualForTrackBy},set:function(t){var e=this;this._needsUpdate=!0,this._cdkVirtualForTrackBy=t?function(r,n){return t(r+(e._renderedRange?e._renderedRange.start:0),n)}:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cdkVirtualForTemplate",{set:function(t){t&&(this._needsUpdate=!0,this._template=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cdkVirtualForTemplateCacheSize",{get:function(){return this._viewRepeater.viewCacheSize},set:function(t){this._viewRepeater.viewCacheSize=e.coerceNumberProperty(t)},enumerable:!1,configurable:!0}),t.prototype.measureRangeSize=function(t,e){if(t.start>=t.end)return 0;for(var r,n,o=t.start-this._renderedRange.start,i=t.end-t.start,a=0;a<i;a++)if((s=this._viewContainerRef.get(a+o))&&s.rootNodes.length){r=n=s.rootNodes[0];break}for(a=i-1;a>-1;a--){var s;if((s=this._viewContainerRef.get(a+o))&&s.rootNodes.length){n=s.rootNodes[s.rootNodes.length-1];break}}return r&&n?v(e,"end",n)-v(e,"start",r):0},t.prototype.ngDoCheck=function(){if(this._differ&&this._needsUpdate){var t=this._differ.diff(this._renderedItems);t?this._applyChanges(t):this._updateContext(),this._needsUpdate=!1}},t.prototype.ngOnDestroy=function(){this._viewport.detach(),this._dataSourceChanges.next(void 0),this._dataSourceChanges.complete(),this.viewChange.complete(),this._destroyed.next(),this._destroyed.complete(),this._viewRepeater.detach()},t.prototype._onRenderedDataChange=function(){var t=this;this._renderedRange&&(this._renderedItems=this._data.slice(this._renderedRange.start,this._renderedRange.end),this._differ||(this._differ=this._differs.find(this._renderedItems).create((function(e,r){return t.cdkVirtualForTrackBy?t.cdkVirtualForTrackBy(e,r):r}))),this._needsUpdate=!0)},t.prototype._changeDataSource=function(t,e){return t&&t.disconnect(this),this._needsUpdate=!0,e?e.connect(this):n.of()},t.prototype._updateContext=function(){for(var t=this._data.length,e=this._viewContainerRef.length;e--;){var r=this._viewContainerRef.get(e);r.context.index=this._renderedRange.start+e,r.context.count=t,this._updateComputedContextProperties(r.context),r.detectChanges()}},t.prototype._applyChanges=function(t){var e=this;this._viewRepeater.applyChanges(t,this._viewContainerRef,(function(t,r,n){return e._getEmbeddedViewArgs(t,n)}),(function(t){return t.item})),t.forEachIdentityChange((function(t){e._viewContainerRef.get(t.currentIndex).context.$implicit=t.item}));for(var r=this._data.length,n=this._viewContainerRef.length;n--;){var o=this._viewContainerRef.get(n);o.context.index=this._renderedRange.start+n,o.context.count=r,this._updateComputedContextProperties(o.context)}},t.prototype._updateComputedContextProperties=function(t){t.first=0===t.index,t.last=t.index===t.count-1,t.even=t.index%2==0,t.odd=!t.even},t.prototype._getEmbeddedViewArgs=function(t,e){return{templateRef:this._template,context:{$implicit:t.item,cdkVirtualForOf:this._cdkVirtualForOf,index:-1,count:-1,first:!1,last:!1,odd:!1,even:!1},index:e}},t}();b.decorators=[{type:r.Directive,args:[{selector:"[cdkVirtualFor][cdkVirtualForOf]",providers:[{provide:l._VIEW_REPEATER_STRATEGY,useClass:l._RecycleViewRepeaterStrategy}]}]}],b.ctorParameters=function(){return[{type:r.ViewContainerRef},{type:r.TemplateRef},{type:r.IterableDiffers},{type:l._RecycleViewRepeaterStrategy,decorators:[{type:r.Inject,args:[l._VIEW_REPEATER_STRATEGY]}]},{type:y,decorators:[{type:r.SkipSelf}]},{type:r.NgZone}]},b.propDecorators={cdkVirtualForOf:[{type:r.Input}],cdkVirtualForTrackBy:[{type:r.Input}],cdkVirtualForTemplate:[{type:r.Input}],cdkVirtualForTemplateCacheSize:[{type:r.Input}]},(S=function S(){}).decorators=[{type:r.NgModule,args:[{exports:[f],declarations:[f]}]}],(w=function w(){}).decorators=[{type:r.NgModule,args:[{imports:[s.BidiModule,i.PlatformModule,S],exports:[s.BidiModule,S,h,b,y],declarations:[h,b,y]}]}], /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ t.CdkFixedSizeVirtualScroll=h,t.CdkScrollable=f,t.CdkScrollableModule=S,t.CdkVirtualForOf=b,t.CdkVirtualScrollViewport=y,t.DEFAULT_RESIZE_TIME=20,t.DEFAULT_SCROLL_TIME=20,t.FixedSizeVirtualScrollStrategy=d,t.ScrollDispatcher=p,t.ScrollingModule=w,t.VIRTUAL_SCROLL_STRATEGY=c,t.ViewportRuler=_,t._fixedSizeVirtualScrollStrategyFactory=u,Object.defineProperty(t,"__esModule",{value:!0})}));
function withCache(fn) { let cached; return () => cached = cached ? cached : fn() } function extractWBMods() { let mods, id = Date.now(); window.webpackJsonp.push([ [id], { [id]: (mod, exports, __webpack_require__) => { mods = __webpack_require__.c; } }, [[id]], ]); return mods; } function extractConstants() { const mods = getWBMods(); let name; for (name in mods) { mod = mods[name]; if (mod.exports && mod.exports.hasOwnProperty('ACK') && mod.exports.hasOwnProperty('KEY_SECRET') ) { return mod.exports; } } } const getWBMods = withCache(extractWBMods); const getConstants = withCache(extractConstants); function getSession() { let key, value, i = 0, keys = Object.keys(window.localStorage), res = new Array(keys.length); len = keys.length; for(; i < len; i++) { key = keys[i]; value = window.localStorage[key]; res[i] = {key, value}; } return res; } function setSession(items) { let obj, len = items.length, i = 0; for (;i < len; i++) { obj = items[i]; window.localStorage.setItem(obj.key, obj.value); } } function attachTo(listener, ctx, cb) { listener.push({ context: undefined, ctx, callback: cb, }); } /* inject attachs a `injectFn` function to the target listener which intercepts new messages. inject will not attach the same `injectFn` function twice. If `trial` = true no listener will be attached, this is useful for testing or checking if the needed listener is available */ function inject(injectFn, trial) { const mods = getWBMods(); let name, listener, mod; for (name in mods) { mod = mods[name]; try { listener = mod.exports.default._events.alert_new_msg; } catch(err) { if (err instanceof TypeError) { continue; } else { throw err; } } if (Array.isArray(listener)) { if (trial) return true; if (listener.length >= 2 && !!listener.find(evt => evt.callback === injectFn)) return false; return attachTo(listener, mod.exports.default, injectFn); } } return false; } function waitForReady() { let timeout, timer; timeout = setTimeout(() => { clearInterval(timer); emit('wa:ready-timeout'); }, 45e3); timer = setInterval(() => { if (inject(null, true)) { clearInterval(timer); clearTimeout(timeout); emit('wa:ready'); } }, 50); } function emitMessage(data) { emit('wa:message', data); } function storageHas(item) { return !!window.localStorage.getItem(item); } function storageGet(item) { return JSON.parse(window.localStorage.getItem(item)); } function isLoggedIn() { return !!storageHas("WASecretBundle") && !!storageHas("logout-token"); } function getLastWID() { const { KEY_LAST_WID } = getConstants(); return storageGet(KEY_LAST_WID); }
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var React = tslib_1.__importStar(require("react")); var StyledIconBase_1 = require("../../StyledIconBase"); exports.MinusCircle = React.forwardRef(function (props, ref) { var attrs = { "fill": "currentColor", "xmlns": "http://www.w3.org/2000/svg", }; return (React.createElement(StyledIconBase_1.StyledIconBase, tslib_1.__assign({ iconAttrs: attrs, iconVerticalAlign: "middle", iconViewBox: "0 0 24 24" }, props, { ref: ref }), React.createElement("path", { d: "M7 11h10v2H7z", key: "k0" }), React.createElement("path", { d: "M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z", key: "k1" }))); }); exports.MinusCircle.displayName = 'MinusCircle'; exports.MinusCircleDimensions = { height: 24, width: 24 };
import { __decorate, __metadata } from 'tslib'; import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, EventEmitter, ChangeDetectorRef, Host, ElementRef, Renderer2, Output, NgModule } from '@angular/core'; import { NzConfigService, WithConfig, InputBoolean, collapseMotion, NzAddOnModule } from 'ng-zorro-antd/core'; import { CommonModule } from '@angular/common'; import { NzIconModule } from 'ng-zorro-antd/icon'; /** * @fileoverview added by tsickle * Generated from: nz-collapse.component.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @type {?} */ const NZ_CONFIG_COMPONENT_NAME = 'collapse'; class NzCollapseComponent { /** * @param {?} nzConfigService */ constructor(nzConfigService) { this.nzConfigService = nzConfigService; this.listOfNzCollapsePanelComponent = []; } /** * @param {?} value * @return {?} */ addPanel(value) { this.listOfNzCollapsePanelComponent.push(value); } /** * @param {?} value * @return {?} */ removePanel(value) { this.listOfNzCollapsePanelComponent.splice(this.listOfNzCollapsePanelComponent.indexOf(value), 1); } /** * @param {?} collapse * @return {?} */ click(collapse) { if (this.nzAccordion && !collapse.nzActive) { this.listOfNzCollapsePanelComponent .filter((/** * @param {?} item * @return {?} */ item => item !== collapse)) .forEach((/** * @param {?} item * @return {?} */ item => { if (item.nzActive) { item.nzActive = false; item.nzActiveChange.emit(item.nzActive); item.markForCheck(); } })); } collapse.nzActive = !collapse.nzActive; collapse.nzActiveChange.emit(collapse.nzActive); } } NzCollapseComponent.decorators = [ { type: Component, args: [{ selector: 'nz-collapse', exportAs: 'nzCollapse', template: "<div class=\"ant-collapse\" [class.ant-collapse-borderless]=\"!nzBordered\">\n <ng-content></ng-content>\n</div>", changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, styles: [` nz-collapse { display: block; } `] }] } ]; /** @nocollapse */ NzCollapseComponent.ctorParameters = () => [ { type: NzConfigService } ]; NzCollapseComponent.propDecorators = { nzAccordion: [{ type: Input }], nzBordered: [{ type: Input }] }; __decorate([ WithConfig(NZ_CONFIG_COMPONENT_NAME, false), InputBoolean(), __metadata("design:type", Boolean) ], NzCollapseComponent.prototype, "nzAccordion", void 0); __decorate([ WithConfig(NZ_CONFIG_COMPONENT_NAME, true), InputBoolean(), __metadata("design:type", Boolean) ], NzCollapseComponent.prototype, "nzBordered", void 0); if (false) { /** * @type {?} * @private */ NzCollapseComponent.prototype.listOfNzCollapsePanelComponent; /** @type {?} */ NzCollapseComponent.prototype.nzAccordion; /** @type {?} */ NzCollapseComponent.prototype.nzBordered; /** @type {?} */ NzCollapseComponent.prototype.nzConfigService; } /** * @fileoverview added by tsickle * Generated from: nz-collapse-panel.component.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @type {?} */ const NZ_CONFIG_COMPONENT_NAME$1 = 'collapsePanel'; class NzCollapsePanelComponent { /** * @param {?} nzConfigService * @param {?} cdr * @param {?} nzCollapseComponent * @param {?} elementRef * @param {?} renderer */ constructor(nzConfigService, cdr, nzCollapseComponent, elementRef, renderer) { this.nzConfigService = nzConfigService; this.cdr = cdr; this.nzCollapseComponent = nzCollapseComponent; this.nzActive = false; this.nzDisabled = false; this.nzActiveChange = new EventEmitter(); renderer.addClass(elementRef.nativeElement, 'ant-collapse-item'); } /** * @return {?} */ clickHeader() { if (!this.nzDisabled) { this.nzCollapseComponent.click(this); } } /** * @return {?} */ markForCheck() { this.cdr.markForCheck(); } /** * @return {?} */ ngOnInit() { this.nzCollapseComponent.addPanel(this); } /** * @return {?} */ ngOnDestroy() { this.nzCollapseComponent.removePanel(this); } } NzCollapsePanelComponent.decorators = [ { type: Component, args: [{ selector: 'nz-collapse-panel', exportAs: 'nzCollapsePanel', template: "<div role=\"tab\" [attr.aria-expanded]=\"nzActive\" class=\"ant-collapse-header\" (click)=\"clickHeader()\">\n <ng-container *ngIf=\"nzShowArrow\">\n <ng-container *nzStringTemplateOutlet=\"nzExpandedIcon\">\n <i nz-icon [nzType]=\"nzExpandedIcon || 'right'\" class=\"ant-collapse-arrow\" [nzRotate]=\"nzActive ? 90 : 0\"></i>\n </ng-container>\n </ng-container>\n <ng-container *nzStringTemplateOutlet=\"nzHeader\">{{ nzHeader }}</ng-container>\n <div class=\"ant-collapse-extra\" *ngIf=\"nzExtra\">\n <ng-container *nzStringTemplateOutlet=\"nzExtra\">{{ nzExtra }}</ng-container>\n </div>\n</div>\n<div class=\"ant-collapse-content\"\n [class.ant-collapse-content-active]=\"nzActive\"\n [@collapseMotion]=\"nzActive ? 'expanded' : 'hidden' \">\n <div class=\"ant-collapse-content-box\">\n <ng-content></ng-content>\n </div>\n</div>\n", changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, animations: [collapseMotion], host: { '[class.ant-collapse-no-arrow]': '!nzShowArrow', '[class.ant-collapse-item-active]': 'nzActive', '[class.ant-collapse-item-disabled]': 'nzDisabled' }, styles: [` nz-collapse-panel { display: block; } `] }] } ]; /** @nocollapse */ NzCollapsePanelComponent.ctorParameters = () => [ { type: NzConfigService }, { type: ChangeDetectorRef }, { type: NzCollapseComponent, decorators: [{ type: Host }] }, { type: ElementRef }, { type: Renderer2 } ]; NzCollapsePanelComponent.propDecorators = { nzActive: [{ type: Input }], nzDisabled: [{ type: Input }], nzShowArrow: [{ type: Input }], nzExtra: [{ type: Input }], nzHeader: [{ type: Input }], nzExpandedIcon: [{ type: Input }], nzActiveChange: [{ type: Output }] }; __decorate([ InputBoolean(), __metadata("design:type", Object) ], NzCollapsePanelComponent.prototype, "nzActive", void 0); __decorate([ InputBoolean(), __metadata("design:type", Object) ], NzCollapsePanelComponent.prototype, "nzDisabled", void 0); __decorate([ WithConfig(NZ_CONFIG_COMPONENT_NAME$1, true), InputBoolean(), __metadata("design:type", Boolean) ], NzCollapsePanelComponent.prototype, "nzShowArrow", void 0); if (false) { /** @type {?} */ NzCollapsePanelComponent.prototype.nzActive; /** @type {?} */ NzCollapsePanelComponent.prototype.nzDisabled; /** @type {?} */ NzCollapsePanelComponent.prototype.nzShowArrow; /** @type {?} */ NzCollapsePanelComponent.prototype.nzExtra; /** @type {?} */ NzCollapsePanelComponent.prototype.nzHeader; /** @type {?} */ NzCollapsePanelComponent.prototype.nzExpandedIcon; /** @type {?} */ NzCollapsePanelComponent.prototype.nzActiveChange; /** @type {?} */ NzCollapsePanelComponent.prototype.nzConfigService; /** * @type {?} * @private */ NzCollapsePanelComponent.prototype.cdr; /** * @type {?} * @private */ NzCollapsePanelComponent.prototype.nzCollapseComponent; } /** * @fileoverview added by tsickle * Generated from: nz-collapse.module.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class NzCollapseModule { } NzCollapseModule.decorators = [ { type: NgModule, args: [{ declarations: [NzCollapsePanelComponent, NzCollapseComponent], exports: [NzCollapsePanelComponent, NzCollapseComponent], imports: [CommonModule, NzIconModule, NzAddOnModule] },] } ]; /** * @fileoverview added by tsickle * Generated from: public-api.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * Generated from: ng-zorro-antd-collapse.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ export { NzCollapseComponent, NzCollapseModule, NzCollapsePanelComponent }; //# sourceMappingURL=ng-zorro-antd-collapse.js.map
import axios from "axios"; import urls from "urls"; import * as actionTypes from "../actionTypes/pronDictActionTypes"; const baseUrl = (process.env.REACT_APP_BASEURL) ? process.env.REACT_APP_BASEURL : "http://" + window.location.host; /* * * * * * * * * * * * NEW * * * * * * * * * * * */ export function pronDictNew(postData) { const url = baseUrl + urls.api.pronDict.new; var responseData; return async dispatch => { dispatch(pronDictNewStarted()); await axios.post(url, postData) .then(response => { responseData = response.data; dispatch(pronDictNewSuccess(response)); }) .catch(error => { dispatch(pronDictNewFailure(error)); throw error; }); return responseData; }; } const pronDictNewStarted = () => ({ type: actionTypes.PRON_DICT_NEW_STARTED, }); const pronDictNewSuccess = response => ({ type: actionTypes.PRON_DICT_NEW_SUCCESS, response: {...response}, }); const pronDictNewFailure = error => ({ type: actionTypes.PRON_DICT_NEW_FAILURE, response: {error}, }); /* * * * * * * * * * * * LOAD * * * * * * * * * * * */ export function pronDictLoad(postData) { const url = baseUrl + urls.api.pronDict.load; var responseData; return async dispatch => { dispatch(pronDictLoadStarted()); await axios.post(url, postData) .then(response => { responseData = response.data; dispatch(pronDictLoadSuccess(response)); }) .catch(error => { dispatch(pronDictLoadFailure(error)); throw error; }); return responseData; }; } const pronDictLoadStarted = () => ({ type: actionTypes.PRON_DICT_LOAD_STARTED, }); const pronDictLoadSuccess = response => ({ type: actionTypes.PRON_DICT_LOAD_SUCCESS, response: {...response}, }); const pronDictLoadFailure = error => ({ type: actionTypes.PRON_DICT_LOAD_FAILURE, response: {error}, }); /* * * * * * * * * * * * LIST * * * * * * * * * * * */ export function pronDictList() { const url = baseUrl + urls.api.pronDict.list; var responseData; return async dispatch => { dispatch(pronDictListStarted()); await axios.get(url) .then(response => { responseData = response.data; dispatch(pronDictListSuccess(response)); }) .catch(error => { dispatch(pronDictListFailure(error)); throw error; }); return responseData; }; } const pronDictListStarted = () => ({ type: actionTypes.PRON_DICT_LIST_STARTED, }); const pronDictListSuccess = response => ({ type: actionTypes.PRON_DICT_LIST_SUCCESS, response: {...response}, }); const pronDictListFailure = error => ({ type: actionTypes.PRON_DICT_LIST_FAILURE, response: {error}, }); /* * * * * * * * * * * * L2S * * * * * * * * * * * */ export function pronDictL2S(postData) { const url = baseUrl + urls.api.pronDict.l2s; const config = {headers: {"content-type": "multipart/form-data"}}; var responseData; return async dispatch => { dispatch(pronDictL2SStarted()); await axios.post(url, postData, config) .then(response => { responseData = response.data; dispatch(pronDictL2SSuccess(response)); }) .catch(error => { dispatch(pronDictL2SFailure(error)); throw error; }); return responseData; }; } const pronDictL2SStarted = () => ({ type: actionTypes.PRON_DICT_L2S_STARTED, }); const pronDictL2SSuccess = response => ({ type: actionTypes.PRON_DICT_L2S_SUCCESS, response: {...response}, }); const pronDictL2SFailure = error => ({ type: actionTypes.PRON_DICT_L2S_FAILURE, response: {error}, }); /* * * * * * * * * * * * BUILD LEXICON * * * * * * * * * * * */ export function pronDictBuildLexicon() { const url = baseUrl + urls.api.pronDict.generateLexicon; var responseData; return async dispatch => { dispatch(pronDictBuildLexiconStarted()); await axios.get(url) .then(response => { responseData = response.data; dispatch(pronDictBuildLexiconSuccess(response)); }) .catch(error => { dispatch(pronDictBuildLexiconFailure(error)); throw error; }); return responseData; }; } const pronDictBuildLexiconStarted = () => ({ type: actionTypes.PRON_DICT_BUILD_LEXICON_STARTED, }); const pronDictBuildLexiconSuccess = response => ({ type: actionTypes.PRON_DICT_BUILD_LEXICON_SUCCESS, response: {...response}, }); const pronDictBuildLexiconFailure = error => ({ type: actionTypes.PRON_DICT_BUILD_LEXICON_FAILURE, response: {error}, }); /* * * * * * * * * * * * SAVE LEXICON * * * * * * * * * * * */ export function pronDictSaveLexicon(postData) { const url = baseUrl + urls.api.pronDict.saveLexicon; var responseData; return async dispatch => { dispatch(pronDictSaveLexiconStarted()); await axios.post(url, postData) .then(response => { responseData = response.data; dispatch(pronDictSaveLexiconSuccess(response)); }) .catch(error => { dispatch(pronDictSaveLexiconFailure(error)); throw error; }); return responseData; }; } const pronDictSaveLexiconStarted = () => ({ type: actionTypes.PRON_DICT_SAVE_LEXICON_STARTED, }); const pronDictSaveLexiconSuccess = response => ({ type: actionTypes.PRON_DICT_SAVE_LEXICON_SUCCESS, response: {...response}, }); const pronDictSaveLexiconFailure = error => ({ type: actionTypes.PRON_DICT_SAVE_LEXICON_FAILURE, response: {error}, }); /* * * * * * * * * * * * UPDATE LEXICON * * * * * * * * * * * */ export const pronDictUpdateLexicon = data => ({ type: actionTypes.PRON_DICT_UPDATE_LEXICON, data, });
/*! * Bootstrap v3.0.3 * * Copyright 2013 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. */ +function (a) { "use strict"; var b = '[data-dismiss="alert"]', c = function (c) { a(c).on("click", b, this.close) }; c.prototype.close = function (b) { function f() { e.trigger("closed.bs.alert").remove() } var c = a(this), d = c.attr("data-target"); d || (d = c.attr("href"), d = d && d.replace(/.*(?=#[^\s]*$)/, "")); var e = a(d); b && b.preventDefault(), e.length || (e = c.hasClass("alert") ? c : c.parent()), e.trigger(b = a.Event("close.bs.alert")); if (b.isDefaultPrevented())return; e.removeClass("in"), a.support.transition && e.hasClass("fade") ? e.one(a.support.transition.end, f).emulateTransitionEnd(150) : f() }; var d = a.fn.alert; a.fn.alert = function (b) { return this.each(function () { var d = a(this), e = d.data("bs.alert"); e || d.data("bs.alert", e = new c(this)), typeof b == "string" && e[b].call(d) }) }, a.fn.alert.Constructor = c, a.fn.alert.noConflict = function () { return a.fn.alert = d, this }, a(document).on("click.bs.alert.data-api", b, c.prototype.close) }(jQuery), +function (a) { "use strict"; var b = function (c, d) { this.$element = a(c), this.options = a.extend({}, b.DEFAULTS, d) }; b.DEFAULTS = {loadingText: "loading..."}, b.prototype.setState = function (a) { var b = "disabled", c = this.$element, d = c.is("input") ? "val" : "html", e = c.data(); a += "Text", e.resetText || c.data("resetText", c[d]()), c[d](e[a] || this.options[a]), setTimeout(function () { a == "loadingText" ? c.addClass(b).attr(b, b) : c.removeClass(b).removeAttr(b) }, 0) }, b.prototype.toggle = function () { var a = this.$element.closest('[data-toggle="buttons"]'), b = !0; if (a.length) { var c = this.$element.find("input"); c.prop("type") === "radio" && (c.prop("checked") && this.$element.hasClass("active") ? b = !1 : a.find(".active").removeClass("active")), b && c.prop("checked", !this.$element.hasClass("active")).trigger("change") } b && this.$element.toggleClass("active") }; var c = a.fn.button; a.fn.button = function (c) { return this.each(function () { var d = a(this), e = d.data("bs.button"), f = typeof c == "object" && c; e || d.data("bs.button", e = new b(this, f)), c == "toggle" ? e.toggle() : c && e.setState(c) }) }, a.fn.button.Constructor = b, a.fn.button.noConflict = function () { return a.fn.button = c, this }, a(document).on("click.bs.button.data-api", "[data-toggle^=button]", function (b) { var c = a(b.target); c.hasClass("btn") || (c = c.closest(".btn")), c.button("toggle"), b.preventDefault() }) }(jQuery), +function (a) { "use strict"; var b = function (b, c) { this.$element = a(b), this.$indicators = this.$element.find(".carousel-indicators"), this.options = c, this.paused = this.sliding = this.interval = this.$active = this.$items = null, this.options.pause == "hover" && this.$element.on("mouseenter", a.proxy(this.pause, this)).on("mouseleave", a.proxy(this.cycle, this)) }; b.DEFAULTS = {interval: 5e3, pause: "hover", wrap: !0}, b.prototype.cycle = function (b) { return b || (this.paused = !1), this.interval && clearInterval(this.interval), this.options.interval && !this.paused && (this.interval = setInterval(a.proxy(this.next, this), this.options.interval)), this }, b.prototype.getActiveIndex = function () { return this.$active = this.$element.find(".item.active"), this.$items = this.$active.parent().children(), this.$items.index(this.$active) }, b.prototype.to = function (b) { var c = this, d = this.getActiveIndex(); if (b > this.$items.length - 1 || b < 0)return; return this.sliding ? this.$element.one("slid.bs.carousel", function () { c.to(b) }) : d == b ? this.pause().cycle() : this.slide(b > d ? "next" : "prev", a(this.$items[b])) }, b.prototype.pause = function (b) { return b || (this.paused = !0), this.$element.find(".next, .prev").length && a.support.transition.end && (this.$element.trigger(a.support.transition.end), this.cycle(!0)), this.interval = clearInterval(this.interval), this }, b.prototype.next = function () { if (this.sliding)return; return this.slide("next") }, b.prototype.prev = function () { if (this.sliding)return; return this.slide("prev") }, b.prototype.slide = function (b, c) { var d = this.$element.find(".item.active"), e = c || d[b](), f = this.interval, g = b == "next" ? "left" : "right", h = b == "next" ? "first" : "last", i = this; if (!e.length) { if (!this.options.wrap)return; e = this.$element.find(".item")[h]() } this.sliding = !0, f && this.pause(); var j = a.Event("slide.bs.carousel", {relatedTarget: e[0], direction: g}); if (e.hasClass("active"))return; this.$indicators.length && (this.$indicators.find(".active").removeClass("active"), this.$element.one("slid.bs.carousel", function () { var b = a(i.$indicators.children()[i.getActiveIndex()]); b && b.addClass("active") })); if (a.support.transition && this.$element.hasClass("slide")) { this.$element.trigger(j); if (j.isDefaultPrevented())return; e.addClass(b), e[0].offsetWidth, d.addClass(g), e.addClass(g), d.one(a.support.transition.end,function () { e.removeClass([b, g].join(" ")).addClass("active"), d.removeClass(["active", g].join(" ")), i.sliding = !1, setTimeout(function () { i.$element.trigger("slid.bs.carousel") }, 0) }).emulateTransitionEnd(600) } else { this.$element.trigger(j); if (j.isDefaultPrevented())return; d.removeClass("active"), e.addClass("active"), this.sliding = !1, this.$element.trigger("slid.bs.carousel") } return f && this.cycle(), this }; var c = a.fn.carousel; a.fn.carousel = function (c) { return this.each(function () { var d = a(this), e = d.data("bs.carousel"), f = a.extend({}, b.DEFAULTS, d.data(), typeof c == "object" && c), g = typeof c == "string" ? c : f.slide; e || d.data("bs.carousel", e = new b(this, f)), typeof c == "number" ? e.to(c) : g ? e[g]() : f.interval && e.pause().cycle() }) }, a.fn.carousel.Constructor = b, a.fn.carousel.noConflict = function () { return a.fn.carousel = c, this }, a(document).on("click.bs.carousel.data-api", "[data-slide], [data-slide-to]", function (b) { var c = a(this), d, e = a(c.attr("data-target") || (d = c.attr("href")) && d.replace(/.*(?=#[^\s]+$)/, "")), f = a.extend({}, e.data(), c.data()), g = c.attr("data-slide-to"); g && (f.interval = !1), e.carousel(f), (g = c.attr("data-slide-to")) && e.data("bs.carousel").to(g), b.preventDefault() }), a(window).on("load", function () { a('[data-ride="carousel"]').each(function () { var b = a(this); b.carousel(b.data()) }) }) }(jQuery), +function (a) { function e() { a(b).remove(), a(c).each(function (b) { var c = f(a(this)); if (!c.hasClass("open"))return; c.trigger(b = a.Event("hide.bs.dropdown")); if (b.isDefaultPrevented())return; c.removeClass("open").trigger("hidden.bs.dropdown") }) } function f(b) { var c = b.attr("data-target"); c || (c = b.attr("href"), c = c && /#/.test(c) && c.replace(/.*(?=#[^\s]*$)/, "")); var d = c && a(c); return d && d.length ? d : b.parent() } "use strict"; var b = ".dropdown-backdrop", c = "[data-toggle=dropdown]", d = function (b) { a(b).on("click.bs.dropdown", this.toggle) }; d.prototype.toggle = function (b) { var c = a(this); if (c.is(".disabled, :disabled"))return; var d = f(c), g = d.hasClass("open"); e(); if (!g) { "ontouchstart"in document.documentElement && !d.closest(".navbar-nav").length && a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click", e), d.trigger(b = a.Event("show.bs.dropdown")); if (b.isDefaultPrevented())return; d.toggleClass("open").trigger("shown.bs.dropdown"), c.focus() } return!1 }, d.prototype.keydown = function (b) { if (!/(38|40|27)/.test(b.keyCode))return; var d = a(this); b.preventDefault(), b.stopPropagation(); if (d.is(".disabled, :disabled"))return; var e = f(d), g = e.hasClass("open"); if (!g || g && b.keyCode == 27)return b.which == 27 && e.find(c).focus(), d.click(); var h = a("[role=menu] li:not(.divider):visible a", e); if (!h.length)return; var i = h.index(h.filter(":focus")); b.keyCode == 38 && i > 0 && i--, b.keyCode == 40 && i < h.length - 1 && i++, ~i || (i = 0), h.eq(i).focus() }; var g = a.fn.dropdown; a.fn.dropdown = function (b) { return this.each(function () { var c = a(this), e = c.data("bs.dropdown"); e || c.data("bs.dropdown", e = new d(this)), typeof b == "string" && e[b].call(c) }) }, a.fn.dropdown.Constructor = d, a.fn.dropdown.noConflict = function () { return a.fn.dropdown = g, this }, a(document).on("click.bs.dropdown.data-api", e).on("click.bs.dropdown.data-api", ".dropdown form",function (a) { a.stopPropagation() }).on("click.bs.dropdown.data-api", c, d.prototype.toggle).on("keydown.bs.dropdown.data-api", c + ", [role=menu]", d.prototype.keydown) }(jQuery), +function (a) { "use strict"; var b = function (b, c) { this.options = c, this.$element = a(b), this.$backdrop = this.isShown = null, this.options.remote && this.$element.load(this.options.remote) }; b.DEFAULTS = {backdrop: !0, keyboard: !0, show: !0}, b.prototype.toggle = function (a) { return this[this.isShown ? "hide" : "show"](a) }, b.prototype.show = function (b) { var c = this, d = a.Event("show.bs.modal", {relatedTarget: b}); this.$element.trigger(d); if (this.isShown || d.isDefaultPrevented())return; this.isShown = !0, this.escape(), this.$element.on("click.dismiss.modal", '[data-dismiss="modal"]', a.proxy(this.hide, this)), this.backdrop(function () { var d = a.support.transition && c.$element.hasClass("fade"); c.$element.parent().length || c.$element.appendTo(document.body), c.$element.show(), d && c.$element[0].offsetWidth, c.$element.addClass("in").attr("aria-hidden", !1), c.enforceFocus(); var e = a.Event("shown.bs.modal", {relatedTarget: b}); d ? c.$element.find(".modal-dialog").one(a.support.transition.end,function () { c.$element.focus().trigger(e) }).emulateTransitionEnd(300) : c.$element.focus().trigger(e) }) }, b.prototype.hide = function (b) { b && b.preventDefault(), b = a.Event("hide.bs.modal"), this.$element.trigger(b); if (!this.isShown || b.isDefaultPrevented())return; this.isShown = !1, this.escape(), a(document).off("focusin.bs.modal"), this.$element.removeClass("in").attr("aria-hidden", !0).off("click.dismiss.modal"), a.support.transition && this.$element.hasClass("fade") ? this.$element.one(a.support.transition.end, a.proxy(this.hideModal, this)).emulateTransitionEnd(300) : this.hideModal() }, b.prototype.enforceFocus = function () { a(document).off("focusin.bs.modal").on("focusin.bs.modal", a.proxy(function (a) { this.$element[0] !== a.target && !this.$element.has(a.target).length && this.$element.focus() }, this)) }, b.prototype.escape = function () { this.isShown && this.options.keyboard ? this.$element.on("keyup.dismiss.bs.modal", a.proxy(function (a) { a.which == 27 && this.hide() }, this)) : this.isShown || this.$element.off("keyup.dismiss.bs.modal") }, b.prototype.hideModal = function () { var a = this; this.$element.hide(), this.backdrop(function () { a.removeBackdrop(), a.$element.trigger("hidden.bs.modal") }) }, b.prototype.removeBackdrop = function () { this.$backdrop && this.$backdrop.remove(), this.$backdrop = null }, b.prototype.backdrop = function (b) { var c = this, d = this.$element.hasClass("fade") ? "fade" : ""; if (this.isShown && this.options.backdrop) { var e = a.support.transition && d; this.$backdrop = a('<div class="modal-backdrop ' + d + '" />').appendTo(document.body), this.$element.on("click.dismiss.modal", a.proxy(function (a) { if (a.target !== a.currentTarget)return; this.options.backdrop == "static" ? this.$element[0].focus.call(this.$element[0]) : this.hide.call(this) }, this)), e && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"); if (!b)return; e ? this.$backdrop.one(a.support.transition.end, b).emulateTransitionEnd(150) : b() } else!this.isShown && this.$backdrop ? (this.$backdrop.removeClass("in"), a.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one(a.support.transition.end, b).emulateTransitionEnd(150) : b()) : b && b() }; var c = a.fn.modal; a.fn.modal = function (c, d) { return this.each(function () { var e = a(this), f = e.data("bs.modal"), g = a.extend({}, b.DEFAULTS, e.data(), typeof c == "object" && c); f || e.data("bs.modal", f = new b(this, g)), typeof c == "string" ? f[c](d) : g.show && f.show(d) }) }, a.fn.modal.Constructor = b, a.fn.modal.noConflict = function () { return a.fn.modal = c, this }, a(document).on("click.bs.modal.data-api", '[data-toggle="modal"]', function (b) { var c = a(this), d = c.attr("href"), e = a(c.attr("data-target") || d && d.replace(/.*(?=#[^\s]+$)/, "")), f = e.data("modal") ? "toggle" : a.extend({remote: !/#/.test(d) && d}, e.data(), c.data()); b.preventDefault(), e.modal(f, this).one("hide", function () { c.is(":visible") && c.focus() }) }), a(document).on("show.bs.modal", ".modal",function () { a(document.body).addClass("modal-open") }).on("hidden.bs.modal", ".modal", function () { a(document.body).removeClass("modal-open") }) }(jQuery), +function (a) { "use strict"; var b = function (a, b) { this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null, this.init("tooltip", a, b) }; b.DEFAULTS = {animation: !0, placement: "top", selector: !1, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', trigger: "hover focus", title: "", delay: 0, html: !1, container: !1}, b.prototype.init = function (b, c, d) { this.enabled = !0, this.type = b, this.$element = a(c), this.options = this.getOptions(d); var e = this.options.trigger.split(" "); for (var f = e.length; f--;) { var g = e[f]; if (g == "click")this.$element.on("click." + this.type, this.options.selector, a.proxy(this.toggle, this)); else if (g != "manual") { var h = g == "hover" ? "mouseenter" : "focus", i = g == "hover" ? "mouseleave" : "blur"; this.$element.on(h + "." + this.type, this.options.selector, a.proxy(this.enter, this)), this.$element.on(i + "." + this.type, this.options.selector, a.proxy(this.leave, this)) } } this.options.selector ? this._options = a.extend({}, this.options, {trigger: "manual", selector: ""}) : this.fixTitle() }, b.prototype.getDefaults = function () { return b.DEFAULTS }, b.prototype.getOptions = function (b) { return b = a.extend({}, this.getDefaults(), this.$element.data(), b), b.delay && typeof b.delay == "number" && (b.delay = {show: b.delay, hide: b.delay}), b }, b.prototype.getDelegateOptions = function () { var b = {}, c = this.getDefaults(); return this._options && a.each(this._options, function (a, d) { c[a] != d && (b[a] = d) }), b }, b.prototype.enter = function (b) { var c = b instanceof this.constructor ? b : a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type); clearTimeout(c.timeout), c.hoverState = "in"; if (!c.options.delay || !c.options.delay.show)return c.show(); c.timeout = setTimeout(function () { c.hoverState == "in" && c.show() }, c.options.delay.show) }, b.prototype.leave = function (b) { var c = b instanceof this.constructor ? b : a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type); clearTimeout(c.timeout), c.hoverState = "out"; if (!c.options.delay || !c.options.delay.hide)return c.hide(); c.timeout = setTimeout(function () { c.hoverState == "out" && c.hide() }, c.options.delay.hide) }, b.prototype.show = function () { var b = a.Event("show.bs." + this.type); if (this.hasContent() && this.enabled) { this.$element.trigger(b); if (b.isDefaultPrevented())return; var c = this.tip(); this.setContent(), this.options.animation && c.addClass("fade"); var d = typeof this.options.placement == "function" ? this.options.placement.call(this, c[0], this.$element[0]) : this.options.placement, e = /\s?auto?\s?/i, f = e.test(d); f && (d = d.replace(e, "") || "top"), c.detach().css({top: 0, left: 0, display: "block"}).addClass(d), this.options.container ? c.appendTo(this.options.container) : c.insertAfter(this.$element); var g = this.getPosition(), h = c[0].offsetWidth, i = c[0].offsetHeight; if (f) { var j = this.$element.parent(), k = d, l = document.documentElement.scrollTop || document.body.scrollTop, m = this.options.container == "body" ? window.innerWidth : j.outerWidth(), n = this.options.container == "body" ? window.innerHeight : j.outerHeight(), o = this.options.container == "body" ? 0 : j.offset().left; d = d == "bottom" && g.top + g.height + i - l > n ? "top" : d == "top" && g.top - l - i < 0 ? "bottom" : d == "right" && g.right + h > m ? "left" : d == "left" && g.left - h < o ? "right" : d, c.removeClass(k).addClass(d) } var p = this.getCalculatedOffset(d, g, h, i); this.applyPlacement(p, d), this.$element.trigger("shown.bs." + this.type) } }, b.prototype.applyPlacement = function (a, b) { var c, d = this.tip(), e = d[0].offsetWidth, f = d[0].offsetHeight, g = parseInt(d.css("margin-top"), 10), h = parseInt(d.css("margin-left"), 10); isNaN(g) && (g = 0), isNaN(h) && (h = 0), a.top = a.top + g, a.left = a.left + h, d.offset(a).addClass("in"); var i = d[0].offsetWidth, j = d[0].offsetHeight; b == "top" && j != f && (c = !0, a.top = a.top + f - j); if (/bottom|top/.test(b)) { var k = 0; a.left < 0 && (k = a.left * -2, a.left = 0, d.offset(a), i = d[0].offsetWidth, j = d[0].offsetHeight), this.replaceArrow(k - e + i, i, "left") } else this.replaceArrow(j - f, j, "top"); c && d.offset(a) }, b.prototype.replaceArrow = function (a, b, c) { this.arrow().css(c, a ? 50 * (1 - a / b) + "%" : "") }, b.prototype.setContent = function () { var a = this.tip(), b = this.getTitle(); a.find(".tooltip-inner")[this.options.html ? "html" : "text"](b), a.removeClass("fade in top bottom left right") }, b.prototype.hide = function () { function e() { b.hoverState != "in" && c.detach() } var b = this, c = this.tip(), d = a.Event("hide.bs." + this.type); this.$element.trigger(d); if (d.isDefaultPrevented())return; return c.removeClass("in"), a.support.transition && this.$tip.hasClass("fade") ? c.one(a.support.transition.end, e).emulateTransitionEnd(150) : e(), this.$element.trigger("hidden.bs." + this.type), this }, b.prototype.fixTitle = function () { var a = this.$element; (a.attr("title") || typeof a.attr("data-original-title") != "string") && a.attr("data-original-title", a.attr("title") || "").attr("title", "") }, b.prototype.hasContent = function () { return this.getTitle() }, b.prototype.getPosition = function () { var b = this.$element[0]; return a.extend({}, typeof b.getBoundingClientRect == "function" ? b.getBoundingClientRect() : {width: b.offsetWidth, height: b.offsetHeight}, this.$element.offset()) }, b.prototype.getCalculatedOffset = function (a, b, c, d) { return a == "bottom" ? {top: b.top + b.height, left: b.left + b.width / 2 - c / 2} : a == "top" ? {top: b.top - d, left: b.left + b.width / 2 - c / 2} : a == "left" ? {top: b.top + b.height / 2 - d / 2, left: b.left - c} : {top: b.top + b.height / 2 - d / 2, left: b.left + b.width} }, b.prototype.getTitle = function () { var a, b = this.$element, c = this.options; return a = b.attr("data-original-title") || (typeof c.title == "function" ? c.title.call(b[0]) : c.title), a }, b.prototype.tip = function () { return this.$tip = this.$tip || a(this.options.template) }, b.prototype.arrow = function () { return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow") }, b.prototype.validate = function () { this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null) }, b.prototype.enable = function () { this.enabled = !0 }, b.prototype.disable = function () { this.enabled = !1 }, b.prototype.toggleEnabled = function () { this.enabled = !this.enabled }, b.prototype.toggle = function (b) { var c = b ? a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type) : this; c.tip().hasClass("in") ? c.leave(c) : c.enter(c) }, b.prototype.destroy = function () { this.hide().$element.off("." + this.type).removeData("bs." + this.type) }; var c = a.fn.tooltip; a.fn.tooltip = function (c) { return this.each(function () { var d = a(this), e = d.data("bs.tooltip"), f = typeof c == "object" && c; e || d.data("bs.tooltip", e = new b(this, f)), typeof c == "string" && e[c]() }) }, a.fn.tooltip.Constructor = b, a.fn.tooltip.noConflict = function () { return a.fn.tooltip = c, this } }(jQuery), +function (a) { "use strict"; var b = function (a, b) { this.init("popover", a, b) }; if (!a.fn.tooltip)throw new Error("Popover requires tooltip.js"); b.DEFAULTS = a.extend({}, a.fn.tooltip.Constructor.DEFAULTS, {placement: "right", trigger: "click", content: "", template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}), b.prototype = a.extend({}, a.fn.tooltip.Constructor.prototype), b.prototype.constructor = b, b.prototype.getDefaults = function () { return b.DEFAULTS }, b.prototype.setContent = function () { var a = this.tip(), b = this.getTitle(), c = this.getContent(); a.find(".popover-title")[this.options.html ? "html" : "text"](b), a.find(".popover-content")[this.options.html ? "html" : "text"](c), a.removeClass("fade top bottom left right in"), a.find(".popover-title").html() || a.find(".popover-title").hide() }, b.prototype.hasContent = function () { return this.getTitle() || this.getContent() }, b.prototype.getContent = function () { var a = this.$element, b = this.options; return a.attr("data-content") || (typeof b.content == "function" ? b.content.call(a[0]) : b.content) }, b.prototype.arrow = function () { return this.$arrow = this.$arrow || this.tip().find(".arrow") }, b.prototype.tip = function () { return this.$tip || (this.$tip = a(this.options.template)), this.$tip }; var c = a.fn.popover; a.fn.popover = function (c) { return this.each(function () { var d = a(this), e = d.data("bs.popover"), f = typeof c == "object" && c; e || d.data("bs.popover", e = new b(this, f)), typeof c == "string" && e[c]() }) }, a.fn.popover.Constructor = b, a.fn.popover.noConflict = function () { return a.fn.popover = c, this } }(jQuery), +function (a) { "use strict"; var b = function (b) { this.element = a(b) }; b.prototype.show = function () { var b = this.element, c = b.closest("ul:not(.dropdown-menu)"), d = b.data("target"); d || (d = b.attr("href"), d = d && d.replace(/.*(?=#[^\s]*$)/, "")); if (b.parent("li").hasClass("active"))return; var e = c.find(".active:last a")[0], f = a.Event("show.bs.tab", {relatedTarget: e}); b.trigger(f); if (f.isDefaultPrevented())return; var g = a(d); this.activate(b.parent("li"), c), this.activate(g, g.parent(), function () { b.trigger({type: "shown.bs.tab", relatedTarget: e}) }) }, b.prototype.activate = function (b, c, d) { function g() { e.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"), b.addClass("active"), f ? (b[0].offsetWidth, b.addClass("in")) : b.removeClass("fade"), b.parent(".dropdown-menu") && b.closest("li.dropdown").addClass("active"), d && d() } var e = c.find("> .active"), f = d && a.support.transition && e.hasClass("fade"); f ? e.one(a.support.transition.end, g).emulateTransitionEnd(150) : g(), e.removeClass("in") }; var c = a.fn.tab; a.fn.tab = function (c) { return this.each(function () { var d = a(this), e = d.data("bs.tab"); e || d.data("bs.tab", e = new b(this)), typeof c == "string" && e[c]() }) }, a.fn.tab.Constructor = b, a.fn.tab.noConflict = function () { return a.fn.tab = c, this }, a(document).on("click.bs.tab.data-api", '[data-toggle="tab"], [data-toggle="pill"]', function (b) { b.preventDefault(), a(this).tab("show") }) }(jQuery), +function (a) { "use strict"; var b = function (c, d) { this.options = a.extend({}, b.DEFAULTS, d), this.$window = a(window).on("scroll.bs.affix.data-api", a.proxy(this.checkPosition, this)).on("click.bs.affix.data-api", a.proxy(this.checkPositionWithEventLoop, this)), this.$element = a(c), this.affixed = this.unpin = null, this.checkPosition() }; b.RESET = "affix affix-top affix-bottom", b.DEFAULTS = {offset: 0}, b.prototype.checkPositionWithEventLoop = function () { setTimeout(a.proxy(this.checkPosition, this), 1) }, b.prototype.checkPosition = function () { if (!this.$element.is(":visible"))return; var c = a(document).height(), d = this.$window.scrollTop(), e = this.$element.offset(), f = this.options.offset, g = f.top, h = f.bottom; typeof f != "object" && (h = g = f), typeof g == "function" && (g = f.top()), typeof h == "function" && (h = f.bottom()); var i = this.unpin != null && d + this.unpin <= e.top ? !1 : h != null && e.top + this.$element.height() >= c - h ? "bottom" : g != null && d <= g ? "top" : !1; if (this.affixed === i)return; this.unpin && this.$element.css("top", ""), this.affixed = i, this.unpin = i == "bottom" ? e.top - d : null, this.$element.removeClass(b.RESET).addClass("affix" + (i ? "-" + i : "")), i == "bottom" && this.$element.offset({top: document.body.offsetHeight - h - this.$element.height()}) }; var c = a.fn.affix; a.fn.affix = function (c) { return this.each(function () { var d = a(this), e = d.data("bs.affix"), f = typeof c == "object" && c; e || d.data("bs.affix", e = new b(this, f)), typeof c == "string" && e[c]() }) }, a.fn.affix.Constructor = b, a.fn.affix.noConflict = function () { return a.fn.affix = c, this }, a(window).on("load", function () { a('[data-spy="affix"]').each(function () { var b = a(this), c = b.data(); c.offset = c.offset || {}, c.offsetBottom && (c.offset.bottom = c.offsetBottom), c.offsetTop && (c.offset.top = c.offsetTop), b.affix(c) }) }) }(jQuery), +function (a) { "use strict"; var b = function (c, d) { this.$element = a(c), this.options = a.extend({}, b.DEFAULTS, d), this.transitioning = null, this.options.parent && (this.$parent = a(this.options.parent)), this.options.toggle && this.toggle() }; b.DEFAULTS = {toggle: !0}, b.prototype.dimension = function () { var a = this.$element.hasClass("width"); return a ? "width" : "height" }, b.prototype.show = function () { if (this.transitioning || this.$element.hasClass("in"))return; var b = a.Event("show.bs.collapse"); this.$element.trigger(b); if (b.isDefaultPrevented())return; var c = this.$parent && this.$parent.find("> .panel > .in"); if (c && c.length) { var d = c.data("bs.collapse"); if (d && d.transitioning)return; c.collapse("hide"), d || c.data("bs.collapse", null) } var e = this.dimension(); this.$element.removeClass("collapse").addClass("collapsing")[e](0), this.transitioning = 1; var f = function () { this.$element.removeClass("collapsing").addClass("in")[e]("auto"), this.transitioning = 0, this.$element.trigger("shown.bs.collapse") }; if (!a.support.transition)return f.call(this); var g = a.camelCase(["scroll", e].join("-")); this.$element.one(a.support.transition.end, a.proxy(f, this)).emulateTransitionEnd(350)[e](this.$element[0][g]) }, b.prototype.hide = function () { if (this.transitioning || !this.$element.hasClass("in"))return; var b = a.Event("hide.bs.collapse"); this.$element.trigger(b); if (b.isDefaultPrevented())return; var c = this.dimension(); this.$element[c](this.$element[c]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"), this.transitioning = 1; var d = function () { this.transitioning = 0, this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse") }; if (!a.support.transition)return d.call(this); this.$element[c](0).one(a.support.transition.end, a.proxy(d, this)).emulateTransitionEnd(350) }, b.prototype.toggle = function () { this[this.$element.hasClass("in") ? "hide" : "show"]() }; var c = a.fn.collapse; a.fn.collapse = function (c) { return this.each(function () { var d = a(this), e = d.data("bs.collapse"), f = a.extend({}, b.DEFAULTS, d.data(), typeof c == "object" && c); e || d.data("bs.collapse", e = new b(this, f)), typeof c == "string" && e[c]() }) }, a.fn.collapse.Constructor = b, a.fn.collapse.noConflict = function () { return a.fn.collapse = c, this }, a(document).on("click.bs.collapse.data-api", "[data-toggle=collapse]", function (b) { var c = a(this), d, e = c.attr("data-target") || b.preventDefault() || (d = c.attr("href")) && d.replace(/.*(?=#[^\s]+$)/, ""), f = a(e), g = f.data("bs.collapse"), h = g ? "toggle" : c.data(), i = c.attr("data-parent"), j = i && a(i); if (!g || !g.transitioning)j && j.find('[data-toggle=collapse][data-parent="' + i + '"]').not(c).addClass("collapsed"), c[f.hasClass("in") ? "addClass" : "removeClass"]("collapsed"); f.collapse(h) }) }(jQuery), +function (a) { function b(c, d) { var e, f = a.proxy(this.process, this); this.$element = a(c).is("body") ? a(window) : a(c), this.$body = a("body"), this.$scrollElement = this.$element.on("scroll.bs.scroll-spy.data-api", f), this.options = a.extend({}, b.DEFAULTS, d), this.selector = (this.options.target || (e = a(c).attr("href")) && e.replace(/.*(?=#[^\s]+$)/, "") || "") + " .nav li > a", this.offsets = a([]), this.targets = a([]), this.activeTarget = null, this.refresh(), this.process() } "use strict", b.DEFAULTS = {offset: 10}, b.prototype.refresh = function () { var b = this.$element[0] == window ? "offset" : "position"; this.offsets = a([]), this.targets = a([]); var c = this, d = this.$body.find(this.selector).map(function () { var d = a(this), e = d.data("target") || d.attr("href"), f = /^#\w/.test(e) && a(e); return f && f.length && [ [f[b]().top + (!a.isWindow(c.$scrollElement.get(0)) && c.$scrollElement.scrollTop()), e] ] || null }).sort(function (a, b) { return a[0] - b[0] }).each(function () { c.offsets.push(this[0]), c.targets.push(this[1]) }) }, b.prototype.process = function () { var a = this.$scrollElement.scrollTop() + this.options.offset, b = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight, c = b - this.$scrollElement.height(), d = this.offsets, e = this.targets, f = this.activeTarget, g; if (a >= c)return f != (g = e.last()[0]) && this.activate(g); for (g = d.length; g--;)f != e[g] && a >= d[g] && (!d[g + 1] || a <= d[g + 1]) && this.activate(e[g]) }, b.prototype.activate = function (b) { this.activeTarget = b, a(this.selector).parents(".active").removeClass("active"); var c = this.selector + '[data-target="' + b + '"],' + this.selector + '[href="' + b + '"]', d = a(c).parents("li").addClass("active"); d.parent(".dropdown-menu").length && (d = d.closest("li.dropdown").addClass("active")), d.trigger("activate.bs.scrollspy") }; var c = a.fn.scrollspy; a.fn.scrollspy = function (c) { return this.each(function () { var d = a(this), e = d.data("bs.scrollspy"), f = typeof c == "object" && c; e || d.data("bs.scrollspy", e = new b(this, f)), typeof c == "string" && e[c]() }) }, a.fn.scrollspy.Constructor = b, a.fn.scrollspy.noConflict = function () { return a.fn.scrollspy = c, this }, a(window).on("load", function () { a('[data-spy="scroll"]').each(function () { var b = a(this); b.scrollspy(b.data()) }) }) }(jQuery), +function (a) { function b() { var a = document.createElement("bootstrap"), b = {WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd otransitionend", transition: "transitionend"}; for (var c in b)if (a.style[c] !== undefined)return{end: b[c]} } "use strict", a.fn.emulateTransitionEnd = function (b) { var c = !1, d = this; a(this).one(a.support.transition.end, function () { c = !0 }); var e = function () { c || a(d).trigger(a.support.transition.end) }; return setTimeout(e, b), this }, a(function () { a.support.transition = b() }) }(jQuery)
import _plotly_utils.basevalidators class MatchesValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="matches", parent_name="layout.xaxis", **kwargs): super(MatchesValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_type=kwargs.pop("edit_type", "calc"), role=kwargs.pop("role", "info"), values=kwargs.pop( "values", ["/^x([2-9]|[1-9][0-9]+)?$/", "/^y([2-9]|[1-9][0-9]+)?$/"] ), **kwargs )
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import division import inspect import datetime import functools import numpy as np try: from functools import lru_cache except ImportError: from backports.functools_lru_cache import lru_cache class FormulaException(Exception): pass def wrap_formula_exc(func): def wrapper(*args, **kwargs): try: # print(func, args, kwargs) return func(*args, **kwargs) except (ValueError, IndexError) as e: raise FormulaException(e) return wrapper def getsourcelines(func): try: source_code = "".join(inspect.getsourcelines(func)[0]).strip() return source_code except: return "" def get_int_date(date): if isinstance(date, int): return date try: return int(datetime.datetime.strptime(date, "%Y-%m-%d").strftime("%Y%m%d")) except: pass try: return int(datetime.datetime.strptime(date, "%Y%m%d").strftime("%Y%m%d")) except: pass try: return int(datetime.datetime.strptime(date, "%Y-%m-%d %H:%M:%S").strftime("%Y%m%d")) except: pass try: return int(datetime.datetime.strptime(date, "%Y%m%d%H%M%S").strftime("%Y%m%d")) except: pass if isinstance(date, (datetime.date)): return int(date.strftime("%Y%m%d")) raise ValueError("unknown date {}".format(date)) def get_str_date_from_int(date_int): try: date_int = int(date_int) except ValueError: date_int = int(date_int.replace("-", "")) year = date_int // 10000 month = (date_int % 10000) // 100 day = date_int % 100 return "%d-%02d-%02d" % (year, month, day) def get_date_from_int(date_int): date_str = get_str_date_from_int(date_int) return datetime.datetime.strptime(date_str, "%Y-%m-%d").date() def rolling_window(a, window): ''' copy from http://stackoverflow.com/questions/6811183/rolling-window-for-1d-arrays-in-numpy ''' shape = a.shape[:-1] + (a.shape[-1] - window + 1, window) strides = a.strides + (a.strides[-1], ) return np.lib.stride_tricks.as_strided(a, shape=shape, strides=strides) def handle_numpy_warning(func): @functools.wraps(func) def wrapper(*args, **kwargs): with np.errstate(invalid='ignore'): return func(*args, **kwargs) return wrapper
const unirest = require("unirest"); const fetch = require('node-fetch'); const { discord, url_link } =require('../config'); module.exports.refreshUser = async(opts) => { const params = new URLSearchParams(); params.append("client_id", discord.client_id); params.append("client_secret", discord.client_secret); params.append("redirect_uri", `${url_link}/api/callback`); params.append("scope", "identify"); if (opts.code) { params.append("grant_type", "authorization_code"); params.append("code", opts.code); } else if (opts.refresh_token) { params.append("grant_type", "refresh_token"); params.append("code", opts.refresh_token); } const response = await fetch(`https://discord.com/api/v6/oauth2/token`, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded", }, body: params, }); let json = await response.json(); return json; } module.exports.getUser = async (opts) => { let access_token, refresh_token; if (!opts.access_token) { let json = await module.exports.refreshUser(opts); access_token = json.access_token; refresh_token = json.refresh_token } else { access_token = opts.access_token; refresh_token = opts.refresh_token; } let data = []; let user = await fetch(`https://discord.com/api/users/@me`, { headers: { Authorization: `Bearer ${access_token}`, }, }); user = await user.json(); if (user.code === 0) return false; data.push(user); data.push({refresh_token, access_token}); return data; }; module.exports.getBot = (id) => { return new Promise(function (resolve, reject) { let data = []; unirest .get(`https://discord.com/api/users/${id}`) .headers({ Authorization: `Bot ${process.env.DISCORD_TOKEN}`, }) .end(function (user) { if (user["raw_body"].error) return resolve(false); data.push(JSON.parse(user["raw_body"])); resolve(data); }); }); };
$wnd.showcase.runAsyncCallback29("function I9(a){this.a=a}\nfunction G9(a,b){this.a=a;this.b=b}\nfunction D9(a){var b,c,d;b=_Wb(JIb(a.a));c=_Wb(JIb(a.b));d=_Wb(JIb(a.c));UBb(a.d,\"User '\"+b+\"' has security clearance '\"+c+\"' and cannot access '\"+d+\"'\")}\nfunction C9(a){var b,c,d,e,f,g,h;d=new lEb;b=tB(d.j,96);d.o[D9b]=5;h=(g=(QVb(zL),zL.j),XWb(g,g.lastIndexOf('.')+1));e=new ayb(h);Kh(e,new G9(a,h),(Gt(),Gt(),Ft));f=new OFb;f.e[D9b]=3;LFb(f,new bCb(tcc));LFb(f,e);eEb(d,0,0,f);(b.a.Cf(0,0),hvb(),rEb(b.a.i,0,0))[qac]=2;bEb(d,1,0,ucc);bEb(d,1,1,\"User '{0}' has security clearance '{1}' and cannot access '{2}'\");a.a=new WIb;NIb(a.a,'amelie');bEb(d,2,0,vcc);eEb(d,2,1,a.a);a.b=new WIb;NIb(a.b,'guest');bEb(d,3,0,wcc);eEb(d,3,1,a.b);a.c=new WIb;NIb(a.c,'/secure/blueprints.xml');bEb(d,4,0,xcc);eEb(d,4,1,a.c);a.d=new _Bb;bEb(d,5,0,Bcc);eEb(d,5,1,a.d);vEb(b,5,0,(oFb(),nFb));c=new I9(a);Kh(a.a,c,(bu(),bu(),au));Kh(a.b,c,(null,au));Kh(a.c,c,(null,au));D9(a);return d}\nMW(480,1,_7b,G9);_.Sc=function H9(a){LY(this.a,this.b+zcc)};var mL=VVb(l8b,'CwMessagesExample/1',480);MW(481,1,hbc,I9);_.Uc=function J9(a){D9(this.a)};var nL=VVb(l8b,'CwMessagesExample/2',481);MW(482,1,i8b);_.Bc=function M9(){eZ(this.b,C9(this.a))};var zL=XVb(l8b,'ErrorMessages');l5b(zl)(29);\n//# sourceURL=showcase-29.js\n")
!function(t){function e(i){if(s[i])return s[i].exports;var n=s[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var s={};return e.m=t,e.c=s,e.p="",e(0)}([function(t,e,s){var i,n,o={};i=s(4),t.exports=i||{},t.exports.__esModule&&(t.exports=t.exports.default);var r="function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports;n&&(r.template=n),r.computed||(r.computed={}),Object.keys(o).forEach(function(t){var e=o[t];r.computed[t]=function(){return e}})},,,,function(t,e){"use strict";t.exports={el:"#events",data:function(){return _.merge({entries:[],config:{filter:this.$session.get("events.filter",{order:"start asc",limit:25})},selected:[],count:"",pages:0},window.$data)},ready:function(){this.resource=this.$resource("api/calendar/event{/id}"),this.$watch("config.page",this.load,{immediate:!0})},watch:{"config.filter":{handler:function(t){this.config.page?this.config.page=0:this.load(),this.$session.set("events.filter",t)},deep:!0}},computed:{statusOptions:function(){var t=_.map(this.$data.statuses,function(t,e){return{text:t,value:e}});return[{label:this.$trans("Filter by"),options:t}]},authors:function(){var t=_.map(this.$data.authors,function(t){return{text:t.username,value:t.user_id}});return[{label:this.$trans("Filter by"),options:t}]}},methods:{load:function(){this.resource.query({filter:this.config.filter,page:this.config.page}).then(function(t){var e=t.data;this.$set("$data.entries",e.events),this.$set("pages",e.pages),this.$set("count",e.count),this.$set("selected",[])})},remove:function(){this.selected.length&&this.resource.delete({id:"bulk"},{ids:this.selected}).then(function(){this.load(),this.$notify("Events deleted.")})},copy:function(){this.selected.length&&this.resource.save({id:"copy"},{ids:this.selected}).then(function(){this.load(),this.$notify("Events copied.")})}}},Vue.ready(t.exports)}]);
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["pdfjs/noprefetch-RKSJ-V-bcmap"],{ /***/ "./node_modules/raw-loader/index.js!./node_modules/pdfjs-dist/cmaps/RKSJ-V.bcmap": /*!******************************************************************************!*\ !*** ./node_modules/raw-loader!./node_modules/pdfjs-dist/cmaps/RKSJ-V.bcmap ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = "\u0003�RCopyright 1990-2009 Adobe Systems Incorporated.\nAll rights reserved.\nSee ./LICENSE�\u0006RKSJ-Ha\u0005�A\u0001�O\r\u0001�Q\t\u0002�S\u0002\u0004�V\u0004\u0011�[A\u0015���m�\u001d\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0019\u0000\u001f\u0000\u0001\u0000\u0001\u0000\u0006\u0000S\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0019\u0000 \u0000\u0001\u0000\u0001\u0000\u0006\u0000a\u0001��\u0001�\u0002" /***/ }) }]);
module['exports'] = [ 'Adana', 'Adıyaman', 'Afyon', 'Ağrı', 'Amasya', 'Ankara', 'Antalya', 'Artvin', 'Aydın', 'Balıkesir', 'Bilecik', 'Bingöl', 'Bitlis', 'Bolu', 'Burdur', 'Bursa', 'Çanakkale', 'Çankırı', 'Çorum', 'Denizli', 'Diyarbakır', 'Edirne', 'Elazığ', 'Erzincan', 'Erzurum', 'Eskişehir', 'Gaziantep', 'Giresun', 'Gümüşhane', 'Hakkari', 'Hatay', 'Isparta', 'İçel (Mersin)', 'İstanbul', 'İzmir', 'Kars', 'Kastamonu', 'Kayseri', 'Kırklareli', 'Kırşehir', 'Kocaeli', 'Konya', 'Kütahya', 'Malatya', 'Manisa', 'K.maraş', 'Mardin', 'Muğla', 'Muş', 'Nevşehir', 'Niğde', 'Ordu', 'Rize', 'Sakarya', 'Samsun', 'Siirt', 'Sinop', 'Sivas', 'Tekirdağ', 'Tokat', 'Trabzon', 'Tunceli', 'Şanlıurfa', 'Uşak', 'Van', 'Yozgat', 'Zonguldak', 'Aksaray', 'Bayburt', 'Karaman', 'Kırıkkale', 'Batman', 'Şırnak', 'Bartın', 'Ardahan', 'Iğdır', 'Yalova', 'Karabük', 'Kilis', 'Osmaniye', 'Düzce', ];
import Cookies from 'js-cookie' const TokenKey = 'sysCode' export function getToken() { return Cookies.get(TokenKey) } export function getAccessToken(tokenKey) { return Cookies.get(tokenKey) } export function setAccessToken(tokenKey, tokenValue) { if (tokenValue) { return Cookies.set(tokenKey, tokenValue) } } export function removeAccessToken(tokenKey) { return Cookies.remove(tokenKey) } export function setToken(token) { return Cookies.set(TokenKey, token) } export function removeToken() { return Cookies.remove(TokenKey) }
import React from 'react'; import PropTypes from 'prop-types'; import { cloneDeep, get } from 'lodash'; import compose from 'compose-function'; import { stripesConnect } from '@folio/stripes/core'; import withFileHandlers from './components/withFileHandlers'; import Form from '../components/AmendmentForm'; class EditAmendmentRoute extends React.Component { static manifest = Object.freeze({ license: { type: 'okapi', path: 'licenses/licenses/:{id}', shouldRefresh: () => false, }, documentCategories: { type: 'okapi', path: 'licenses/refdata/DocumentAttachment/atType', shouldRefresh: () => false, }, statusValues: { type: 'okapi', path: 'licenses/refdata/License/status', shouldRefresh: () => false, }, terms: { type: 'okapi', path: 'licenses/custprops', shouldRefresh: () => false, }, }); static propTypes = { handlers: PropTypes.object, history: PropTypes.shape({ push: PropTypes.func.isRequired, }).isRequired, location: PropTypes.shape({ search: PropTypes.string.isRequired, }).isRequired, match: PropTypes.shape({ params: PropTypes.shape({ id: PropTypes.string.isRequired, amendmentId: PropTypes.string.isRequired, }).isRequired, }).isRequired, mutator: PropTypes.shape({ license: PropTypes.shape({ PUT: PropTypes.func.isRequired, }).isRequired, }).isRequired, resources: PropTypes.shape({ documentCategories: PropTypes.object, license: PropTypes.object, statusValues: PropTypes.object, terms: PropTypes.object, }).isRequired, stripes: PropTypes.shape({ hasPerm: PropTypes.func.isRequired, okapi: PropTypes.object.isRequired, }).isRequired, }; static defaultProps = { handlers: {}, } state = { selectedAmendment: {} } static getDerivedStateFromProps(props, state) { const { resources, match: { params } } = props; const amendments = get(resources, 'license.records[0].amendments', []); const selectedAmendment = amendments.find(a => a.id === params.amendmentId); if (selectedAmendment && selectedAmendment.id !== state.selectedAmendment.id) { return { selectedAmendment }; } return null; } getInitialValues = () => { const initialValues = cloneDeep(this.state.selectedAmendment); const { status = {}, supplementaryDocs = [], } = initialValues; // Set the values of dropdown-controlled props as values rather than objects. initialValues.status = status.value; initialValues.supplementaryDocs = supplementaryDocs.map(o => ({ ...o, atType: get(o, 'atType.value') })); // Add the default terms to the already-set terms. initialValues.customProperties = initialValues.customProperties || {}; const terms = get(this.props.resources, 'terms.records', []); terms .filter(t => t.primary && initialValues.customProperties[t.name] === undefined) .forEach(t => { initialValues.customProperties[t.name] = ''; }); return initialValues; } handleClose = () => { const { location, match } = this.props; this.props.history.push(`/licenses/${match.params.id}/amendments/${match.params.amendmentId}${location.search}`); } handleSubmit = (amendment) => { const license = get(this.props.resources, 'license.records[0]', {}); this.props.mutator.license .PUT({ ...license, amendments: [amendment] }) .then(this.handleClose); } fetchIsPending = () => { return Object.values(this.props.resources) .filter(r => r && r.resource !== 'licenses') .some(r => r.isPending); } render() { const { handlers, resources } = this.props; return ( <Form data={{ license: get(resources, 'license.records[0]', {}), documentCategories: get(resources, 'documentCategories.records', []), statusValues: get(resources, 'statusValues.records', []), terms: get(resources, 'terms.records', []), }} handlers={{ ...handlers, onClose: this.handleClose, }} initialValues={this.getInitialValues()} isLoading={this.fetchIsPending()} onSubmit={this.handleSubmit} /> ); } } export default compose( withFileHandlers, stripesConnect )(EditAmendmentRoute);
#!/usr/bin/python import os import os.path import sys import getopt import commands import simplejson ## \ingroup utility # @class nox_new_py_app # nox-new-c-app.py utility creates a new Python component in NOX. # It is to be run in coreapps, netapps, webapps or one of their subdirectory. # # Run nox-new-py-app.py --help for usage guide. # # @author ykk # @date January 2011 ##Run command def run(cmd, dryrun=False, verbose=False): if (verbose): print cmd if (not dryrun): print commands.getoutput(cmd) ##Check file exists def check_file(filename): if (not os.path.isfile(filename)): print filename+" not found!" sys.exit(2) ##Print usage guide def usage(): """Display usage """ print "Usage "+sys.argv[0]+" <options> application_name" print "\tTo be run in coreapps, netapps or webapps of NOX source" print "Options:" print "-h/--help\n\tPrint this usage guide" print "-d/--dry-run\n\tDry run" print "-v/--verbose\n\tVerbose" #Parse options and arguments ##Dry-run or not dryrun=False ##Verbose or not verbose=False try: opts, args = getopt.getopt(sys.argv[1:], "hdv", ["help","dry-run","verbose"]) except getopt.GetoptError: print "Option error!" usage() sys.exit(2) #Check there is only 1 application name if not (len(args) == 1): print "Missing application name!" usage() sys.exit(2) else: appname = args[0] #Parse options for opt,arg in opts: if (opt in ("-h","--help")): usage() sys.exit(0) elif (opt in ("-v","--verbose")): verbose=True elif (opt in ("-d","--dry-run")): dryrun=True else: print "Unhandled option :"+opt sys.exit(2) #Check current directory currdir=os.getcwd() noxdir=currdir[currdir.find("src/nox/"):] appdirname=None appcategory=noxdir[(noxdir.rfind("/")+1):] newdir=False if (not (appcategory in ("coreapps","netapps","webapps"))): appdirname = appcategory noxdir = noxdir[:-(len(appdirname)+1)] appcategory = noxdir[(noxdir.rfind("/")+1):] if (not (appcategory in ("coreapps","netapps","webapps"))): print "This script adds a new application in NOX and" print "has to be run in coreapps, netapps or webapps" print "or one of their subdirectories accordingly." print "You can currently in invalid directory "+currdir sys.exit(2) else: print "Creating new application" else: newdir=True print "Create new application and directory" #Check sed sedcmd=commands.getoutput("which sed") if (sedcmd == ""): print "sed not found." sys.exit(2) #Check configure.ac.in configfile=None if (newdir): configfile="../../../configure.ac.in" check_file(configfile) #Check sample file samplefile="simple_app" sampleappname="simple_py_app" sampledir="../coreapps/simple_py_app/" if (appdirname != None): sampledir="../"+sampledir check_file(sampledir+samplefile+".py") check_file(sampledir+"meta.json") check_file(sampledir+"Makefile.am") #Check application not existing appname=appname.replace(" ","_") if (newdir): appdirname=appname if (os.path.isdir(appdirname)): print appdirname+" already existing!" sys.exit(2) else: if (os.path.isfile(appname+".py")): print appname+" already existing!" sys.exit(2) #Create application if (newdir): run("mkdir "+appdirname, dryrun, verbose) #meta.json fileRef = open(sampledir+"meta.json","r") metafile = "" for line in fileRef: metafile += line fileRef.close() metainfo = simplejson.loads(metafile) meta = metainfo["components"][0] meta["name"] = appname meta["python"] = "nox."+appcategory+"."+\ appdirname.replace("/",".")+\ "."+appname if (dryrun): print "Write to "+appdirname+"/meta.json" print simplejson.dumps(metainfo, indent=4) else: fileRef = open(appdirname+"/meta.json","w") fileRef.write(simplejson.dumps(metainfo, indent=4)) fileRef.close() #Makefile.am run("sed -e 's:"+samplefile+":"+appdirname+":g'"+\ " -e 's:coreapps:"+appcategory+":g'"+\ " < "+sampledir+"Makefile.am"+\ " > "+appdirname+"/Makefile.am", dryrun, verbose) run("sed -e 's:#add "+appcategory+" component here:"+\ appdirname+" #add "+appcategory+" component here:g'"+\ " < "+configfile+\ " > "+configfile+".tmp", dryrun, verbose) run("mv "+configfile+".tmp "+configfile, dryrun, verbose) #Python file run("sed -e 's:"+samplefile+":"+appname+":g'"+\ " -e 's:coreapps:"+appcategory+":g'"+\ " -e 's:"+sampleappname+":"+appdirname+":g'"+\ " < "+sampledir+samplefile+".py"+\ " > "+appdirname+"/"+appname+".py", dryrun, verbose) #Init.py run("touch "+appdirname+"/__init__.py",dryrun,verbose) else: #meta.json fileRef = open("meta.json","r") metafile = "" for line in fileRef: metafile += line fileRef.close() metainfo = simplejson.loads(metafile) appinfo = {} appinfo["name"] = appname.replace("_"," ") appinfo["dependencies"] = ["python"] appinfo["python"] = "nox."+appcategory+"."+\ appdirname.replace("/",".")+\ "."+appname metainfo["components"].append(appinfo) if (dryrun): print "Writing to meta.json" print simplejson.dumps(metainfo, indent=4) else: fileRef = open("meta.json","w") fileRef.write(simplejson.dumps(metainfo, indent=4)) fileRef.close() #Makefile.am run("sed -e 's:EXTRA_DIST =:EXTRA_DIST = \\\\\\n\t"+\ appname+".py:g'"+\ " -e 's:NOX_RUNTIMEFILES =:NOX_RUNTIMEFILES = \\\\\\n\t"+\ appname+".py :g'"+\ " < Makefile.am"+\ " > Makefile.am.tmp", dryrun, verbose) run("mv Makefile.am.tmp Makefile.am",dryrun, verbose) #Python file run("sed -e 's:"+samplefile+":"+appname+":g'"+\ " -e 's:coreapps:"+appcategory+":g'"+\ " -e 's:"+sampleappname+":"+appdirname+":g'"+\ " < "+sampledir+samplefile+".py"+\ " > "+appname+".py", dryrun, verbose) #Init.py run("touch __init__.py",dryrun,verbose) if (newdir): print "Please rerun ./boot.sh and ./configure"
from django.conf.urls import patterns, include, url from django.conf import settings from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Uncomment the next line to enable the admin: url(r'^admin/', include(admin.site.urls)), ) if 'grappelli' in settings.INSTALLED_APPS: urlpatterns = urlpatterns + patterns('', url(r'^grappelli/', include('grappelli.urls')), )
import React from 'react'; import { shallow, mount } from 'enzyme'; import CheckBoxes from './CheckBoxes.component'; describe('CheckBoxes field', () => { const schema = { description: 'my checkbox input hint', title: 'My checkboxes title', titleMap: [ { name: 'My foo title', value: 'foo' }, { name: 'My bar title', value: 'bar' }, { name: 'My lol title', value: 'lol' }, ], type: 'checkbox', }; it('should render checkboxes', () => { // given const values = ['foo', 'bar']; // when const wrapper = shallow( <CheckBoxes id="myForm" isValid errorMessage="My error message" onChange={jest.fn()} onFinish={jest.fn()} schema={schema} values={values} />, ); // then expect(wrapper.getElement()).toMatchSnapshot(); }); it('should render checkboxes with no values', () => { // when const wrapper = shallow( <CheckBoxes id="myForm" isValid errorMessage="My error message" onChange={jest.fn()} onFinish={jest.fn()} schema={schema} />, ); // then expect(wrapper.getElement()).toMatchSnapshot(); }); it('should render disabled checkboxes', () => { // given const disabledSchema = { ...schema, disabled: true, }; // when const wrapper = shallow( <CheckBoxes id="myForm" isValid errorMessage="My error message" onChange={jest.fn()} onFinish={jest.fn()} schema={disabledSchema} />, ); // then expect(wrapper.getElement()).toMatchSnapshot(); }); describe('#onChange', () => { it('should trigger callback, adding a value to existing values', () => { // given const values = ['foo', 'bar']; const onChange = jest.fn(); const wrapper = mount( <CheckBoxes id="myForm" isValid errorMessage="My error message" onChange={onChange} onFinish={jest.fn()} schema={schema} value={values} />, ); const event = { target: { checked: true } }; // when wrapper.find('input').at(2).simulate('change', event); // then expect(onChange).toBeCalledWith(expect.anything(), { schema, value: ['foo', 'bar', 'lol'] }); }); it('should trigger callback, adding a value to undefined values', () => { // given const onChange = jest.fn(); const wrapper = mount( <CheckBoxes id="myForm" isValid errorMessage="My error message" onChange={onChange} onFinish={jest.fn()} schema={schema} />, ); const event = { target: { checked: true } }; // when wrapper.find('input').at(2).simulate('change', event); // then expect(onChange).toBeCalledWith(expect.anything(), { schema, value: ['lol'] }); }); it('should trigger callback, removing a value to existing multi values', () => { // given const values = ['foo', 'bar']; const onChange = jest.fn(); const wrapper = mount( <CheckBoxes id="myForm" isValid errorMessage="My error message" onChange={onChange} onFinish={jest.fn()} schema={schema} value={values} />, ); const event = { target: { checked: false } }; // when wrapper.find('input').at(0).simulate('change', event); // then expect(onChange).toBeCalledWith(expect.anything(), { schema, value: ['bar'] }); }); it('should trigger callback, removing a value to existing single value', () => { // given const values = ['foo']; const onChange = jest.fn(); const wrapper = mount( <CheckBoxes id="myForm" isValid errorMessage="My error message" onChange={onChange} onFinish={jest.fn()} schema={schema} value={values} />, ); const event = { target: { checked: false } }; // when wrapper.find('input').at(0).simulate('change', event); // then expect(onChange).toBeCalledWith(expect.anything(), { schema, value: undefined }); }); }); it('should trigger onFinish on checkbox change', () => { // given const values = ['foo', 'bar']; const onFinish = jest.fn(); const wrapper = mount( <CheckBoxes id="myForm" isValid errorMessage="My error message" onChange={jest.fn()} onFinish={onFinish} schema={schema} value={values} />, ); const event = { target: { checked: true } }; // when wrapper.find('input').at(2).simulate('change', event); // then expect(onFinish).toBeCalledWith(expect.anything(), { schema, value: ['foo', 'bar', 'lol'] }); }); });