text
stringlengths
2
1.05M
//Genre information and a list of movies //functional component because not utilizing state import React from 'react'; import MoviesContainer from '../containers/MoviesContainer'; import GenreEdit from './GenreEdit' import {Container} from 'react-bootstrap'; const Genre = (props) => { // let genre = props.genres[props.match.params.id - 1] let genre = props.genres.filter(genre => genre.id == props.match.params.id)[0] return ( <Container> <h3> {genre ? genre.name : null} </h3> <GenreEdit genre={genre}/> <hr/> <MoviesContainer genre={genre}/> </Container> ) } export default Genre; //using a ternary operator because we don't get access to genres until the second run through
/** * @license Angular v9.1.6 * (c) 2010-2020 Google LLC. https://angular.io/ * License: MIT */ import { Injectable, Inject, ɵstringify, NgModule, Directive, Component, Pipe, createPlatformFactory, COMPILER_OPTIONS, Injector, CompilerFactory } from '@angular/core'; import { TestComponentRenderer, ɵMetadataOverrider, ɵTestingCompilerFactory } from '@angular/core/testing'; import { ɵplatformCoreDynamic, ɵINTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS } from '@angular/platform-browser-dynamic'; import { BrowserTestingModule } from '@angular/platform-browser/testing'; import { ɵgetDOM, DOCUMENT } from '@angular/common'; import { CompileReflector, PipeResolver, DirectiveResolver, NgModuleResolver, ERROR_COMPONENT_TYPE } from '@angular/compiler'; import { MockPipeResolver, MockDirectiveResolver, MockNgModuleResolver } from '@angular/compiler/testing'; /** * @fileoverview added by tsickle * Generated from: packages/platform-browser-dynamic/testing/src/dom_test_component_renderer.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * A DOM based implementation of the TestComponentRenderer. */ import * as ɵngcc0 from '@angular/core'; class DOMTestComponentRenderer extends TestComponentRenderer { /** * @param {?} _doc */ constructor(_doc) { super(); this._doc = _doc; } /** * @param {?} rootElId * @return {?} */ insertRootElement(rootElId) { /** @type {?} */ const template = ɵgetDOM().getDefaultDocument().createElement('template'); template.innerHTML = `<div id="${rootElId}"></div>`; /** @type {?} */ const rootEl = (/** @type {?} */ (getContent(template).firstChild)); // TODO(juliemr): can/should this be optional? /** @type {?} */ const oldRoots = this._doc.querySelectorAll('[id^=root]'); for (let i = 0; i < oldRoots.length; i++) { ɵgetDOM().remove(oldRoots[i]); } this._doc.body.appendChild(rootEl); } } DOMTestComponentRenderer.ɵfac = function DOMTestComponentRenderer_Factory(t) { return new (t || DOMTestComponentRenderer)(ɵngcc0.ɵɵinject(DOCUMENT)); }; DOMTestComponentRenderer.ɵprov = ɵngcc0.ɵɵdefineInjectable({ token: DOMTestComponentRenderer, factory: DOMTestComponentRenderer.ɵfac }); /** @nocollapse */ DOMTestComponentRenderer.ctorParameters = () => [ { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] } ]; /*@__PURE__*/ (function () { ɵngcc0.ɵsetClassMetadata(DOMTestComponentRenderer, [{ type: Injectable }], function () { return [{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT] }] }]; }, null); })(); if (false) { /** * @type {?} * @private */ DOMTestComponentRenderer.prototype._doc; } /** * @param {?} node * @return {?} */ function getContent(node) { if ('content' in node) { return ((/** @type {?} */ (node))).content; } else { return node; } } /** * @fileoverview added by tsickle * Generated from: packages/platform-browser-dynamic/testing/src/metadata_overrider.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * Generated from: packages/platform-browser-dynamic/testing/src/compiler_factory.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @type {?} */ const COMPILER_PROVIDERS = [ { provide: MockPipeResolver, deps: [CompileReflector] }, { provide: PipeResolver, useExisting: MockPipeResolver }, { provide: MockDirectiveResolver, deps: [CompileReflector] }, { provide: DirectiveResolver, useExisting: MockDirectiveResolver }, { provide: MockNgModuleResolver, deps: [CompileReflector] }, { provide: NgModuleResolver, useExisting: MockNgModuleResolver }, ]; class TestingCompilerFactoryImpl { /** * @param {?} _injector * @param {?} _compilerFactory */ constructor(_injector, _compilerFactory) { this._injector = _injector; this._compilerFactory = _compilerFactory; } /** * @param {?} options * @return {?} */ createTestingCompiler(options) { /** @type {?} */ const compiler = (/** @type {?} */ (this._compilerFactory.createCompiler(options))); return new TestingCompilerImpl(compiler, compiler.injector.get(MockDirectiveResolver), compiler.injector.get(MockPipeResolver), compiler.injector.get(MockNgModuleResolver)); } } if (false) { /** * @type {?} * @private */ TestingCompilerFactoryImpl.prototype._injector; /** * @type {?} * @private */ TestingCompilerFactoryImpl.prototype._compilerFactory; } class TestingCompilerImpl { /** * @param {?} _compiler * @param {?} _directiveResolver * @param {?} _pipeResolver * @param {?} _moduleResolver */ constructor(_compiler, _directiveResolver, _pipeResolver, _moduleResolver) { this._compiler = _compiler; this._directiveResolver = _directiveResolver; this._pipeResolver = _pipeResolver; this._moduleResolver = _moduleResolver; this._overrider = new ɵMetadataOverrider(); } /** * @return {?} */ get injector() { return this._compiler.injector; } /** * @template T * @param {?} moduleType * @return {?} */ compileModuleSync(moduleType) { return this._compiler.compileModuleSync(moduleType); } /** * @template T * @param {?} moduleType * @return {?} */ compileModuleAsync(moduleType) { return this._compiler.compileModuleAsync(moduleType); } /** * @template T * @param {?} moduleType * @return {?} */ compileModuleAndAllComponentsSync(moduleType) { return this._compiler.compileModuleAndAllComponentsSync(moduleType); } /** * @template T * @param {?} moduleType * @return {?} */ compileModuleAndAllComponentsAsync(moduleType) { return this._compiler.compileModuleAndAllComponentsAsync(moduleType); } /** * @template T * @param {?} component * @return {?} */ getComponentFactory(component) { return this._compiler.getComponentFactory(component); } /** * @param {?} type * @return {?} */ checkOverrideAllowed(type) { if (this._compiler.hasAotSummary(type)) { throw new Error(`${ɵstringify(type)} was AOT compiled, so its metadata cannot be changed.`); } } /** * @param {?} ngModule * @param {?} override * @return {?} */ overrideModule(ngModule, override) { this.checkOverrideAllowed(ngModule); /** @type {?} */ const oldMetadata = this._moduleResolver.resolve(ngModule, false); this._moduleResolver.setNgModule(ngModule, this._overrider.overrideMetadata(NgModule, oldMetadata, override)); this.clearCacheFor(ngModule); } /** * @param {?} directive * @param {?} override * @return {?} */ overrideDirective(directive, override) { this.checkOverrideAllowed(directive); /** @type {?} */ const oldMetadata = this._directiveResolver.resolve(directive, false); this._directiveResolver.setDirective(directive, this._overrider.overrideMetadata(Directive, (/** @type {?} */ (oldMetadata)), override)); this.clearCacheFor(directive); } /** * @param {?} component * @param {?} override * @return {?} */ overrideComponent(component, override) { this.checkOverrideAllowed(component); /** @type {?} */ const oldMetadata = this._directiveResolver.resolve(component, false); this._directiveResolver.setDirective(component, this._overrider.overrideMetadata(Component, (/** @type {?} */ (oldMetadata)), override)); this.clearCacheFor(component); } /** * @param {?} pipe * @param {?} override * @return {?} */ overridePipe(pipe, override) { this.checkOverrideAllowed(pipe); /** @type {?} */ const oldMetadata = this._pipeResolver.resolve(pipe, false); this._pipeResolver.setPipe(pipe, this._overrider.overrideMetadata(Pipe, oldMetadata, override)); this.clearCacheFor(pipe); } /** * @param {?} summaries * @return {?} */ loadAotSummaries(summaries) { this._compiler.loadAotSummaries(summaries); } /** * @return {?} */ clearCache() { this._compiler.clearCache(); } /** * @param {?} type * @return {?} */ clearCacheFor(type) { this._compiler.clearCacheFor(type); } /** * @param {?} error * @return {?} */ getComponentFromError(error) { return ((/** @type {?} */ (error)))[ERROR_COMPONENT_TYPE] || null; } /** * @param {?} moduleType * @return {?} */ getModuleId(moduleType) { return this._moduleResolver.resolve(moduleType, true).id; } } if (false) { /** * @type {?} * @private */ TestingCompilerImpl.prototype._overrider; /** * @type {?} * @private */ TestingCompilerImpl.prototype._compiler; /** * @type {?} * @private */ TestingCompilerImpl.prototype._directiveResolver; /** * @type {?} * @private */ TestingCompilerImpl.prototype._pipeResolver; /** * @type {?} * @private */ TestingCompilerImpl.prototype._moduleResolver; } /** * @fileoverview added by tsickle * Generated from: packages/platform-browser-dynamic/testing/src/platform_core_dynamic_testing.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ const ɵ0 = { providers: COMPILER_PROVIDERS }; /** * Platform for dynamic tests * * \@publicApi * @type {?} */ const platformCoreDynamicTesting = createPlatformFactory(ɵplatformCoreDynamic, 'coreDynamicTesting', [ { provide: COMPILER_OPTIONS, useValue: ɵ0, multi: true }, { provide: ɵTestingCompilerFactory, useClass: TestingCompilerFactoryImpl, deps: [Injector, CompilerFactory] } ]); /** * @fileoverview added by tsickle * Generated from: packages/platform-browser-dynamic/testing/src/private_export_testing.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * Generated from: packages/platform-browser-dynamic/testing/src/testing.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * \@publicApi * @type {?} */ const platformBrowserDynamicTesting = createPlatformFactory(platformCoreDynamicTesting, 'browserDynamicTesting', ɵINTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS); /** * NgModule for testing. * * \@publicApi */ class BrowserDynamicTestingModule { } BrowserDynamicTestingModule.ɵmod = ɵngcc0.ɵɵdefineNgModule({ type: BrowserDynamicTestingModule }); BrowserDynamicTestingModule.ɵinj = ɵngcc0.ɵɵdefineInjector({ factory: function BrowserDynamicTestingModule_Factory(t) { return new (t || BrowserDynamicTestingModule)(); }, providers: [ { provide: TestComponentRenderer, useClass: DOMTestComponentRenderer }, ], imports: [BrowserTestingModule] }); (function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵngcc0.ɵɵsetNgModuleScope(BrowserDynamicTestingModule, { exports: function () { return [BrowserTestingModule]; } }); })(); /*@__PURE__*/ (function () { ɵngcc0.ɵsetClassMetadata(BrowserDynamicTestingModule, [{ type: NgModule, args: [{ exports: [BrowserTestingModule], providers: [ { provide: TestComponentRenderer, useClass: DOMTestComponentRenderer }, ] }] }], null, null); })(); /** * @fileoverview added by tsickle * Generated from: packages/platform-browser-dynamic/testing/public_api.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * Generated from: packages/platform-browser-dynamic/testing/index.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Generated bundle index. Do not edit. */ export { BrowserDynamicTestingModule, platformBrowserDynamicTesting, DOMTestComponentRenderer as ɵDOMTestComponentRenderer, COMPILER_PROVIDERS as ɵangular_packages_platform_browser_dynamic_testing_testing_a, TestingCompilerFactoryImpl as ɵangular_packages_platform_browser_dynamic_testing_testing_b, platformCoreDynamicTesting as ɵplatformCoreDynamicTesting }; //# sourceMappingURL=testing.js.map
import { expect } from 'chai'; import util from './util'; describe('Prdocuts API', () => { describe('fetch', () => { it('should throw an error when no token', () => { const fsapi = util.getFullSlate({ key: util.getKey() }); expect(() => fsapi.products()).to.throw('FullSlate token missing'); }); it('should get all products', (done) => { const fsapi = util.getFullSlate(); fsapi.products() .then((products) => { expect(products).to.be.an('array'); if (products.length) { expect(products[0].id).to.be.a('number'); } done(); }) .catch(done); }); it('should get an individual product', (done) => { const fsapi = util.getFullSlate(); fsapi.products() .then((products) => { const { id } = products[0]; return fsapi.products(id); }) .then((product) => { expect(product).to.be.an('object'); expect(product).to.have.any.keys([ 'id', 'services', 'name', 'product_type', 'price' ]); done(); }) .catch(done); }); it('should reject request with invalid query parameter', (done) => { const fsapi = util.getFullSlate(); fsapi.products(-1) .then(done) .catch((result) => { expect(result.failure).to.be.true; expect(result.errorMessage).to.equal('Not found.'); done(); }) .catch(done); }); }); });
#!/usr/bin/env node 'use strict'; const spawnSync = require('../common/cross-spawn-sync'); function checkWorkspaceDependencies() { let workspacesInfo = getWorkspacesInfo(); if (!workspacesInfo) { console.error(`Couldn't generate Yarn's workspace root information.`); return; } let count = countMismatchedWorkspaceDependencies(workspacesInfo); if (count === 0) { console.log(`✅ Verified that all workspace dependencies are symlinked.`); return; } else { let singular = count === 1; console.warn( `⚠️ Found ${count} ${ singular ? 'dependency' : 'dependencies' } installed from npm instead of being symlinked because the semver ranges in package.json are not satisfied by the workspaces in this repository.` ); } for (let workspaceName in workspacesInfo) { let workspaceInfo = workspacesInfo[workspaceName]; let { mismatchedWorkspaceDependencies } = workspaceInfo; if (mismatchedWorkspaceDependencies.length) { let singular = mismatchedWorkspaceDependencies.length === 1; console.warn( ` ${workspaceName} has ${mismatchedWorkspaceDependencies.length} ${ singular ? 'dependency' : 'dependencies' } that ${singular ? `isn't` : `aren't`} symlinked:` ); for (let dependency of mismatchedWorkspaceDependencies) { console.warn(` ${dependency}`); } } } } function getWorkspacesInfo() { let result = spawnSync('yarn', ['--silent', 'workspaces', 'info']); if (result.error) { console.error(`Could not run yarn: ${result.error.message}`); return null; } if (result.signal) { console.error(`yarn exited due to ${result.signal}`); return null; } if (result.status !== 0) { console.error(`yarn exited with status code ${result.status}:`); let stdout = result.stdout.toString(); let stderr = result.stderr.toString(); if (stdout) { console.error(stdout); } if (stderr) { console.error(stderr); } return null; } try { return JSON.parse(result.stdout); } catch (e) { console.error(`yarn did not print valid JSON:`); let stdout = result.stdout.toString(); let stderr = result.stderr.toString(); if (stdout) { console.error(stdout); } if (stderr) { console.error(stderr); } return null; } } function countMismatchedWorkspaceDependencies(workspacesInfo) { let count = 0; for (let workspaceName in workspacesInfo) { count += workspacesInfo[workspaceName].mismatchedWorkspaceDependencies.length; } return count; } if (module === require.main) { checkWorkspaceDependencies(); }
import * as api from "../api/api"; // ---------------------------- Class Methods ------------------------------ export const createClass = async (Class, user, Classes, setClasses) => { try { const newClass = { name: Class.name, subcode: Class.subcode, subject: Class.subject, instructor: { name: user.username, email: user.email }, image: user.image, users: [user.email], }; const res = await api.createClass(newClass); setClasses([...Classes, res.data]); } catch (error) { console.log(error.message); } }; export const getClass = async (code, setClass) => { try { if (code) { const res = await api.getClass(code); setClass(res.data); } } catch (error) { console.log(error.message); } }; export const getClasses = async (user, setClasses) => { try { if (user) { const res = await api.getClasses(user); setClasses(res.data); } } catch (error) { console.log(error.message); } }; export const joinClass = async (user, Classes, setClasses, classCode) => { try { const Class = await api.getClass(classCode); if ( Class.data.users.find((element) => { return user.email === element; }) ) { alert("Already joined the class."); } else { const joinedClass = await api.joinClass(classCode, { user: user.email, }); setClasses([...Classes, joinedClass.data]); } } catch (error) { alert("Class does not exist."); } }; export const deleteClass = async (code, user, setClasses) => { try { if (window.confirm("Are you sure you want to delete the classroom ? ")) { await api.deleteClass(code); getClasses(user, setClasses); } } catch (error) { console.log(error.message); } }; export const editClassDetails = async (Class, Config, user, setClasses) => { try { await api.editClass(Class.code, Config); getClasses(user, setClasses); } catch (error) { console.log(error.message); } }; export const leaveClass = async (code, user, setClasses) => { try { if (window.confirm("Are you sure you want to leave the classroom ? ")) { await api.leaveClass(code, { user: user }); getClasses(user, setClasses); } } catch (error) { console.log(error.message); } }; export const removeStudents = async ( code, user, instructor, deleteAll, setClass ) => { try { if (deleteAll) { if ( window.confirm( "Are you sure you want to remove all students from classroom ? " ) ) { await api.leaveClass(code, { user: user }); await api.joinClass(code, { user: instructor.email }); getClass(code, setClass); } } else { if ( window.confirm( "Are you sure you want to remove " + user + " form classroom ? " ) ) { await api.leaveClass(code, { user: user }); getClass(code, setClass); } } } catch (error) { console.log(error.message); } }; //------------------------------- Test Methods ------------------------------- export const createTest = async (newTest) => { try { await api.createTest(newTest); window.location.replace(`${window.location.href}true`); } catch (error) { console.log(error.message); } }; export const removeTest=async(id)=>{ try{ await api.removeTest(id); } catch (error) { console.log(error.message); } } export const getTests = async (code, setTests) => { try { const res = await api.getTests(code); setTests(res.data); } catch (error) { console.log(error.message); } }; export const startTest = async (testId, setTest) => { try { if (testId) { const res = await api.startTest(testId); setTest(res.data); } } catch (error) { console.log(error.message); } }; export const submitTest = async (testId, response, user) => { try { if (window.confirm("Are you sure you want to submit ? ")) { const data = { user: user, response: response }; await api.submitTest(testId, data); window.location.replace(`/`); } } catch (error) { console.log(error.message); } };
(window.webpackJsonp=window.webpackJsonp||[]).push([[116],{MBP6:function(e,t,n){"use strict";n.r(t),n.d(t,"IonActionSheetController",function(){return i});var o=n("euO/"),i=function(){function e(){this.actionSheets=new Map}return e.prototype.actionSheetWillPresent=function(e){this.actionSheets.set(e.target.overlayId,e.target)},e.prototype.actionSheetWillDismiss=function(e){this.actionSheets.delete(e.target.overlayId)},e.prototype.escapeKeyUp=function(){Object(o.d)(this.actionSheets)},e.prototype.create=function(e){return Object(o.a)(this.doc.createElement("ion-action-sheet"),e)},e.prototype.dismiss=function(e,t,n){return void 0===n&&(n=-1),Object(o.b)(e,t,this.actionSheets,n)},e.prototype.getTop=function(){return Object(o.c)(this.actionSheets)},Object.defineProperty(e,"is",{get:function(){return"ion-action-sheet-controller"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{create:{method:!0},dismiss:{method:!0},doc:{context:"document"},getTop:{method:!0}}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"listeners",{get:function(){return[{name:"body:ionActionSheetWillPresent",method:"actionSheetWillPresent"},{name:"body:ionActionSheetWillDismiss",method:"actionSheetWillDismiss"},{name:"body:ionActionSheetDidUnload",method:"actionSheetWillDismiss"},{name:"body:keyup.escape",method:"escapeKeyUp"}]},enumerable:!0,configurable:!0}),e}()}}]);
const config = { ...require('../../build.config'), __SERVER__: false, __CLIENT__: true, __SSR__: false, __TEST__: false, __API_URL__: process.env.API_URL || 'http://localhost:8080/graphql', __WEBSITE_URL__: process.env.WEBSITE_URL || 'http://localhost:8080' }; module.exports = config;
/* * Copyright (c) 2015-2025 Phoinex Scholars Co. http://dpq.co.ir * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ import templateUrl from './category.html'; export default { label: 'Category list', templateUrl: templateUrl, tags: ['sdp-category'], controllerAs: 'ctrl', controller: 'SdpCategoryListResourceCtrl', }
import {storiesOf} from "@storybook/react"; import * as React from 'react'; import ScalableFormAntdMobile from 'scalable-form-antd-mobile'; import './index.less'; const storiesWithMobile = storiesOf('AntDesignMobile', module); export default class FormMobileExample extends React.PureComponent { constructor(args) { super(args); this.form = null; this.state = { formData: {} }; this.jsonSchema = { title: 'Scalable Form render sdk with Ant Design components', description: '', type: 'object', required: ['name', 'note', 'city'], properties: { name: { type: 'string', title: '名称', default: '', maxLength: 15 }, arriveDate: { type: 'string', title: '到达时间', default: '', format: 'date-time' }, note: { type: 'string', title: '备注', default: '', maxLength: 150 }, isFavouriteCity: { type: 'boolean', title: '请问这是你喜欢的城市吗?', default: false }, city: { type: 'string', title: '请选择城市', default: '', enum: ['beijing', 'shanghai', 'hangzhou'], enumNames: ['北京', '上海', '杭州'] } } }; this.uiSchema = { name: { 'ui:help': '关于"名称"字段的帮助说明', 'ui:options': { placeholder: '请输入名称' } }, arriveDate: { 'ui:widget': 'datetime', 'ui:options': { placeholder: '请选择到达时间', format: 'YYYY-MM-DD HH:mm:ss' } }, note: { 'ui:widget': 'textarea', 'ui:options': { validate: [{ type: 'empty', message: '备注不能为空' }] } }, city: { 'ui:widget': 'radio', 'ui:options': { vertical: false, validate: [{ type: 'empty', message: '请选择' }] } } }; } handleChanged = (formData, bizData) => { console.log('ScalableForm Changed!', formData); console.log('ScalableForm Changed!', bizData); this.setState({ formData: {...formData} }); }; handleSubmit = (formData, bizData) => { console.log('ScalableForm Submitted!', formData); console.log('ScalableForm Submitted!', bizData); }; render() { return ( <div className="scalable-form-demo-element mobile"> <ScalableFormAntdMobile ref={(form) => { this.form = form; }} jsonSchema={this.jsonSchema} uiSchema={this.uiSchema} formData={this.state.formData} onChange={this.handleChanged} onSubmit={this.handleSubmit} /> </div> ); } } storiesWithMobile.add( 'schema', () => { return ( <FormMobileExample/> ); } );
/** * Copyright 2020 The Lovefield Project Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import {getHrDbSchemaBuilder} from './hr_schema_no_fk'; export class SampleData { generateSampleEmployeeData() { const buffer = new ArrayBuffer(8); const view = new Uint8Array(buffer); for (let i = 0; i < 8; ++i) { view[i] = i; } return getHrDbSchemaBuilder() .getSchema() .table('Employee') .createRow({ id: 'empId', firstName: 'John', lastName: 'Doe', email: 'john.doe@neverland.com', phoneNumber: '123456', // 'Fri Feb 01 1985 14:15:00 GMT-0800 (PST)' hireDate: new Date(476144100000), jobId: 'jobId', salary: 100, commissionPercent: 0.15, managerId: 'managerId', departmentId: 'departmentId', photo: buffer, }); } generateSampleJobData() { return getHrDbSchemaBuilder().getSchema().table('Job').createRow({ id: 'jobId', title: 'Software Engineer', minSalary: 100000, maxSalary: 500000, }); } generateSampleDepartmentData() { return getHrDbSchemaBuilder().getSchema().table('Department').createRow({ id: 'departmentId', name: 'departmentName', managerId: 'managerId', locationId: 'locationId', }); } generateSampleJobHistoryData() { return getHrDbSchemaBuilder() .getSchema() .table('JobHistory') .createRow({ employeeId: 'employeeId', // 'Fri Feb 01 1985 14:15:00 GMT-0800 (PST)' startDate: new Date(476144100000), // 'Fri Feb 01 1986 14:15:00 GMT-0800 (PST)' endDate: new Date(507680100000), jobId: 'jobId', departmentId: 'departmentId', }); } }
jui.define("chart.brush.bargauge", [], function() { /** * @class chart.brush.bargauge * * @extends chart.brush.core */ var BarGaugeBrush = function(chart, axis, brush) { /** * @method draw * * @protected * @return {TransformElement} */ this.draw = function() { var group = chart.svg.group(); var obj = axis.c(0), width = obj.width, x = obj.x, y = obj.y; this.eachData(function(i, data) { var g = chart.svg.group(), v = this.getValue(data, "value", 0), t = this.getValue(data, "title", ""), max = this.getValue(data, "max", 100), min = this.getValue(data, "min", 0); var value = (width / (max - min)) * v, textY = (y + brush.size / 2 + brush.cut) - 1; g.append(chart.svg.rect({ x : x + brush.cut, y : y, width: width, height : brush.size, fill : chart.theme("bargaugeBackgroundColor") })); g.append(chart.svg.rect({ x : x, y : y, width: value, height : brush.size, fill : chart.color(i) })); g.append(chart.text({ x : x + brush.cut, y : textY, "text-anchor" : "start", "font-size" : chart.theme("bargaugeFontSize"), fill : chart.theme("bargaugeFontColor") }, t)); g.append(chart.text({ x : width - brush.cut, y : textY, "text-anchor" : "end", "font-size" : chart.theme("bargaugeFontSize"), fill : chart.theme("bargaugeFontColor") }, this.format(v, i))); this.addEvent(g, i, null); group.append(g); y += brush.size + brush.cut; }); return group; } } BarGaugeBrush.setup = function() { return { /** @cfg {Number} [cut=5] Determines the spacing of a bar gauge. */ cut: 5, /** @cfg {Number} [size=20] Determines the size of a bar gauge. */ size: 20, /** @cfg {Function} [format=null] bar gauge format callback */ format: null }; } return BarGaugeBrush; }, "chart.brush.core");
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format * @emails oncall+react_native * @flow */ 'use strict'; const React = require('react'); const LogBoxContainer = require('../LogBoxContainer').default; const LogBoxLog = require('../../Data/LogBoxLog').default; const render = require('../../../../jest/renderer'); describe('LogBoxContainer', () => { it('should render null with no logs', () => { const output = render.shallowRender( <LogBoxContainer onDismiss={() => {}} onDismissWarns={() => {}} onDismissErrors={() => {}} logs={new Set()} />, ); expect(output).toMatchSnapshot(); }); it('should render the latest warning', () => { const output = render.shallowRender( <LogBoxContainer onDismiss={() => {}} onDismissWarns={() => {}} onDismissErrors={() => {}} logs={ new Set([ new LogBoxLog( 'warn', { content: 'Some kind of message', substitutions: [], }, [], 'Some kind of message', [], ), new LogBoxLog( 'warn', { content: 'Some kind of message (latest)', substitutions: [], }, [], 'Some kind of message (latest)', [], ), ]) } />, ); expect(output).toMatchSnapshot(); }); it('should render the latest error', () => { const output = render.shallowRender( <LogBoxContainer onDismiss={() => {}} onDismissWarns={() => {}} onDismissErrors={() => {}} logs={ new Set([ new LogBoxLog( 'error', { content: 'Some kind of message', substitutions: [], }, [], 'Some kind of message', [], ), new LogBoxLog( 'error', { content: 'Some kind of message (latest)', substitutions: [], }, [], 'Some kind of message (latest)', [], ), ]) } />, ); expect(output).toMatchSnapshot(); }); it('should render both an error and warning', () => { const output = render.shallowRender( <LogBoxContainer onDismiss={() => {}} onDismissWarns={() => {}} onDismissErrors={() => {}} logs={ new Set([ new LogBoxLog( 'warn', { content: 'Some kind of message', substitutions: [], }, [], 'Some kind of message', [], ), new LogBoxLog( 'error', { content: 'Some kind of message (latest)', substitutions: [], }, [], 'Some kind of message (latest)', [], ), ]) } />, ); expect(output).toMatchSnapshot(); }); it('should render null when disabled with non-fatal error and warning', () => { const output = render.shallowRender( <LogBoxContainer isDisabled onDismiss={() => {}} onDismissWarns={() => {}} onDismissErrors={() => {}} logs={ new Set([ new LogBoxLog( 'warn', { content: 'Some kind of message', substitutions: [], }, [], 'Some kind of message', [], ), new LogBoxLog( 'error', { content: 'Some kind of message (latest)', substitutions: [], }, [], 'Some kind of message (latest)', [], ), ]) } />, ); expect(output).toMatchSnapshot(); }); it('should render fatal before warn and error', () => { const output = render.shallowRender( <LogBoxContainer onDismiss={() => {}} onDismissWarns={() => {}} onDismissErrors={() => {}} logs={ new Set([ new LogBoxLog( 'fatal', { content: 'Some kind of fatal message', substitutions: [], }, [], 'Some kind of fatal message', [], ), new LogBoxLog( 'warn', { content: 'Some kind of message', substitutions: [], }, [], 'Some kind of message', [], ), new LogBoxLog( 'error', { content: 'Some kind of message (latest)', substitutions: [], }, [], 'Some kind of message (latest)', [], ), ]) } />, ); expect(output).toMatchSnapshot(); }); it('should render most recent fatal', () => { const output = render.shallowRender( <LogBoxContainer onDismiss={() => {}} onDismissWarns={() => {}} onDismissErrors={() => {}} logs={ new Set([ new LogBoxLog( 'fatal', { content: 'Should not be selected', substitutions: [], }, [], 'Some kind of fatal message', [], ), new LogBoxLog( 'fatal', { content: 'Should be selected', substitutions: [], }, [], 'Some kind of message', [], ), ]) } />, ); expect(output).toMatchSnapshot(); }); it('should render fatal error even when disabled', () => { const output = render.shallowRender( <LogBoxContainer isDisabled onDismiss={() => {}} onDismissWarns={() => {}} onDismissErrors={() => {}} logs={ new Set([ new LogBoxLog( 'fatal', { content: 'Should be selected', substitutions: [], }, [], 'Some kind of message', [], ), ]) } />, ); expect(output).toMatchSnapshot(); }); it('should render most recent syntax error', () => { const output = render.shallowRender( <LogBoxContainer onDismiss={() => {}} onDismissWarns={() => {}} onDismissErrors={() => {}} logs={ new Set([ new LogBoxLog( 'syntax', { content: 'Should not be selected', substitutions: [], }, [], 'Some kind of syntax error message', [], { fileName: '/path/to/RKJSModules/Apps/CrashReact/CrashReactApp.js', location: '(199:0)', content: ` 197 | }); 198 | > 199 | export default CrashReactApp; | ^ 200 |`, }, ), new LogBoxLog( 'syntax', { content: 'Should be selected', substitutions: [], }, [], 'Some kind of syntax error message', [], { fileName: '/path/to/RKJSModules/Apps/CrashReact/CrashReactApp.js', location: '(199:0)', content: ` 197 | }); 198 | > 199 | export default CrashReactApp; | ^ 200 |`, }, ), ]) } />, ); expect(output).toMatchSnapshot(); }); it('should render syntax error even when disabled', () => { const output = render.shallowRender( <LogBoxContainer isDisabled onDismiss={() => {}} onDismissWarns={() => {}} onDismissErrors={() => {}} logs={ new Set([ new LogBoxLog( 'syntax', { content: 'Should be selected', substitutions: [], }, [], 'Some kind of syntax error message', [], { fileName: '/path/to/RKJSModules/Apps/CrashReact/CrashReactApp.js', location: '(199:0)', content: ` 197 | }); 198 | > 199 | export default CrashReactApp; | ^ 200 |`, }, ), ]) } />, ); expect(output).toMatchSnapshot(); }); });
exports.init = function(console) { if (process.env.NODE_ENV === 'dev' || process.env.NODE_ENV === env) { // console.log('LogSuppress is suppressing all console output.'); if (typeof console.log == 'function') { console.log = function() { }; console.log('You should not see me'); } } };
import React from 'react'; import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'; import CssBaseline from '@material-ui/core/CssBaseline'; // A theme with custom primary and secondary color. // It's optional. const theme = createMuiTheme({ typography: { useNextVariants: true, }, palette: { primary: { light: '#62727b', main: '#37474f', dark: '#102027', contrastText: '#ffffff', }, secondary: { light: '#ff833a', main: '#e65100', dark: '#ac1900', contrastText: '#eeeeee', }, }, }); function withRoot(Component) { function WithRoot(props) { // MuiThemeProvider makes the theme available down the React tree // thanks to React context. return ( <MuiThemeProvider theme={theme}> {/* Reboot kickstart an elegant, consistent, and simple baseline to build upon. */} <CssBaseline /> <Component {...props} /> </MuiThemeProvider> ); } return WithRoot; } export default withRoot;
// This utility function returns a unique URL friendly representation of project // For example, "Frontend Development" gets converted as "frontend-development" export default function (baseString) { return baseString.replace(/[^0-9a-zA-Z- ]/g, "").trim().replace(/\s+/g, "-").toLowerCase() }
import React from "react"; const UserInfo = props => { return ( <div className="user__info"> <p className="user__row"> <span>Email: {props.email}</span> </p> <p className="user__row"> <span>Department: {props.department}</span> </p> <p className="user__row"> <span>Country: {props.country}</span> </p> </div> ); }; export default UserInfo;
/* Modernizr 2.8.3 (Custom Build) | MIT & BSD * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load */ ; window.Modernizr = (function (window, document, undefined) { var version = '2.8.3', Modernizr = {}, enableClasses = true, docElement = document.documentElement, mod = 'modernizr', modElem = document.createElement(mod), mStyle = modElem.style, inputElem = document.createElement('input'), smile = ':)', toString = {}.toString, prefixes = ' -webkit- -moz- -o- -ms- '.split(' '), omPrefixes = 'Webkit Moz O ms', cssomPrefixes = omPrefixes.split(' '), domPrefixes = omPrefixes.toLowerCase().split(' '), ns = {'svg': 'http://www.w3.org/2000/svg'}, tests = {}, inputs = {}, attrs = {}, classes = [], slice = classes.slice, featureName, injectElementWithStyles = function (rule, callback, nodes, testnames) { var style, ret, node, docOverflow, div = document.createElement('div'), body = document.body, fakeBody = body || document.createElement('body'); if (parseInt(nodes, 10)) { while (nodes--) { node = document.createElement('div'); node.id = testnames ? testnames[nodes] : mod + (nodes + 1); div.appendChild(node); } } style = ['&#173;', '<style id="s', mod, '">', rule, '</style>'].join(''); div.id = mod; (body ? div : fakeBody).innerHTML += style; fakeBody.appendChild(div); if (!body) { fakeBody.style.background = ''; fakeBody.style.overflow = 'hidden'; docOverflow = docElement.style.overflow; docElement.style.overflow = 'hidden'; docElement.appendChild(fakeBody); } ret = callback(div, rule); if (!body) { fakeBody.parentNode.removeChild(fakeBody); docElement.style.overflow = docOverflow; } else { div.parentNode.removeChild(div); } return !!ret; }, isEventSupported = (function () { var TAGNAMES = { 'select': 'input', 'change': 'input', 'submit': 'form', 'reset': 'form', 'error': 'img', 'load': 'img', 'abort': 'img' }; function isEventSupported(eventName, element) { element = element || document.createElement(TAGNAMES[eventName] || 'div'); eventName = 'on' + eventName; var isSupported = eventName in element; if (!isSupported) { if (!element.setAttribute) { element = document.createElement('div'); } if (element.setAttribute && element.removeAttribute) { element.setAttribute(eventName, ''); isSupported = is(element[eventName], 'function'); if (!is(element[eventName], 'undefined')) { element[eventName] = undefined; } element.removeAttribute(eventName); } } element = null; return isSupported; } return isEventSupported; })(), _hasOwnProperty = ({}).hasOwnProperty, hasOwnProp; if (!is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined')) { hasOwnProp = function (object, property) { return _hasOwnProperty.call(object, property); }; } else { hasOwnProp = function (object, property) { return ((property in object) && is(object.constructor.prototype[property], 'undefined')); }; } if (!Function.prototype.bind) { Function.prototype.bind = function bind(that) { var target = this; if (typeof target != "function") { throw new TypeError(); } var args = slice.call(arguments, 1), bound = function () { if (this instanceof bound) { var F = function () { }; F.prototype = target.prototype; var self = new F(); var result = target.apply( self, args.concat(slice.call(arguments)) ); if (Object(result) === result) { return result; } return self; } else { return target.apply( that, args.concat(slice.call(arguments)) ); } }; return bound; }; } function setCss(str) { mStyle.cssText = str; } function setCssAll(str1, str2) { return setCss(prefixes.join(str1 + ';') + (str2 || '')); } function is(obj, type) { return typeof obj === type; } function contains(str, substr) { return !!~('' + str).indexOf(substr); } function testProps(props, prefixed) { for (var i in props) { var prop = props[i]; if (!contains(prop, "-") && mStyle[prop] !== undefined) { return prefixed == 'pfx' ? prop : true; } } return false; } function testDOMProps(props, obj, elem) { for (var i in props) { var item = obj[props[i]]; if (item !== undefined) { if (elem === false) return props[i]; if (is(item, 'function')) { return item.bind(elem || obj); } return item; } } return false; } function testPropsAll(prop, prefixed, elem) { var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1), props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' '); if (is(prefixed, "string") || is(prefixed, "undefined")) { return testProps(props, prefixed); } else { props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' '); return testDOMProps(props, prefixed, elem); } } tests['flexbox'] = function () { return testPropsAll('flexWrap'); }; tests['canvas'] = function () { var elem = document.createElement('canvas'); return !!(elem.getContext && elem.getContext('2d')); }; tests['canvastext'] = function () { return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function')); }; tests['webgl'] = function () { return !!window.WebGLRenderingContext; }; tests['touch'] = function () { var bool; if (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) { bool = true; } else { injectElementWithStyles(['@media (', prefixes.join('touch-enabled),('), mod, ')', '{#modernizr{top:9px;position:absolute}}'].join(''), function (node) { bool = node.offsetTop === 9; }); } return bool; }; tests['geolocation'] = function () { return 'geolocation' in navigator; }; tests['postmessage'] = function () { return !!window.postMessage; }; tests['websqldatabase'] = function () { return !!window.openDatabase; }; tests['indexedDB'] = function () { return !!testPropsAll("indexedDB", window); }; tests['hashchange'] = function () { return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7); }; tests['history'] = function () { return !!(window.history && history.pushState); }; tests['draganddrop'] = function () { var div = document.createElement('div'); return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div); }; tests['websockets'] = function () { return 'WebSocket' in window || 'MozWebSocket' in window; }; tests['rgba'] = function () { setCss('background-color:rgba(150,255,150,.5)'); return contains(mStyle.backgroundColor, 'rgba'); }; tests['hsla'] = function () { setCss('background-color:hsla(120,40%,100%,.5)'); return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla'); }; tests['multiplebgs'] = function () { setCss('background:url(https://),url(https://),red url(https://)'); return (/(url\s*\(.*?){3}/).test(mStyle.background); }; tests['backgroundsize'] = function () { return testPropsAll('backgroundSize'); }; tests['borderimage'] = function () { return testPropsAll('borderImage'); }; tests['borderradius'] = function () { return testPropsAll('borderRadius'); }; tests['boxshadow'] = function () { return testPropsAll('boxShadow'); }; tests['textshadow'] = function () { return document.createElement('div').style.textShadow === ''; }; tests['opacity'] = function () { setCssAll('opacity:.55'); return (/^0.55$/).test(mStyle.opacity); }; tests['cssanimations'] = function () { return testPropsAll('animationName'); }; tests['csscolumns'] = function () { return testPropsAll('columnCount'); }; tests['cssgradients'] = function () { var str1 = 'background-image:', str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));', str3 = 'linear-gradient(left top,#9f9, white);'; setCss( (str1 + '-webkit- '.split(' ').join(str2 + str1) + prefixes.join(str3 + str1)).slice(0, -str1.length) ); return contains(mStyle.backgroundImage, 'gradient'); }; tests['cssreflections'] = function () { return testPropsAll('boxReflect'); }; tests['csstransforms'] = function () { return !!testPropsAll('transform'); }; tests['csstransforms3d'] = function () { var ret = !!testPropsAll('perspective'); if (ret && 'webkitPerspective' in docElement.style) { injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function (node, rule) { ret = node.offsetLeft === 9 && node.offsetHeight === 3; }); } return ret; }; tests['csstransitions'] = function () { return testPropsAll('transition'); }; tests['fontface'] = function () { var bool; injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function (node, rule) { var style = document.getElementById('smodernizr'), sheet = style.sheet || style.styleSheet, cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : ''; bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0; }); return bool; }; tests['generatedcontent'] = function () { var bool; injectElementWithStyles(['#', mod, '{font:0/0 a}#', mod, ':after{content:"', smile, '";visibility:hidden;font:3px/1 a}'].join(''), function (node) { bool = node.offsetHeight >= 3; }); return bool; }; tests['video'] = function () { var elem = document.createElement('video'), bool = false; try { if (bool = !!elem.canPlayType) { bool = new Boolean(bool); bool.ogg = elem.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, ''); bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, ''); bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, ''); } } catch (e) { } return bool; }; tests['audio'] = function () { var elem = document.createElement('audio'), bool = false; try { if (bool = !!elem.canPlayType) { bool = new Boolean(bool); bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ''); bool.mp3 = elem.canPlayType('audio/mpeg;').replace(/^no$/, ''); bool.wav = elem.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ''); bool.m4a = (elem.canPlayType('audio/x-m4a;') || elem.canPlayType('audio/aac;')).replace(/^no$/, ''); } } catch (e) { } return bool; }; tests['localstorage'] = function () { try { localStorage.setItem(mod, mod); localStorage.removeItem(mod); return true; } catch (e) { return false; } }; tests['sessionstorage'] = function () { try { sessionStorage.setItem(mod, mod); sessionStorage.removeItem(mod); return true; } catch (e) { return false; } }; tests['webworkers'] = function () { return !!window.Worker; }; tests['applicationcache'] = function () { return !!window.applicationCache; }; tests['svg'] = function () { return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect; }; tests['inlinesvg'] = function () { var div = document.createElement('div'); div.innerHTML = '<svg/>'; return (div.firstChild && div.firstChild.namespaceURI) == ns.svg; }; tests['smil'] = function () { return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate'))); }; tests['svgclippaths'] = function () { return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath'))); }; function webforms() { Modernizr['input'] = (function (props) { for (var i = 0, len = props.length; i < len; i++) { attrs[props[i]] = !!(props[i] in inputElem); } if (attrs.list) { attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement); } return attrs; })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' ')); Modernizr['inputtypes'] = (function (props) { for (var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++) { inputElem.setAttribute('type', inputElemType = props[i]); bool = inputElem.type !== 'text'; if (bool) { inputElem.value = smile; inputElem.style.cssText = 'position:absolute;visibility:hidden;'; if (/^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined) { docElement.appendChild(inputElem); defaultView = document.defaultView; bool = defaultView.getComputedStyle && defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' && (inputElem.offsetHeight !== 0); docElement.removeChild(inputElem); } else if (/^(search|tel)$/.test(inputElemType)) { } else if (/^(url|email)$/.test(inputElemType)) { bool = inputElem.checkValidity && inputElem.checkValidity() === false; } else { bool = inputElem.value != smile; } } inputs[props[i]] = !!bool; } return inputs; })('search tel url email datetime date month week time datetime-local number range color'.split(' ')); } for (var feature in tests) { if (hasOwnProp(tests, feature)) { featureName = feature.toLowerCase(); Modernizr[featureName] = tests[feature](); classes.push((Modernizr[featureName] ? '' : 'no-') + featureName); } } Modernizr.input || webforms(); Modernizr.addTest = function (feature, test) { if (typeof feature == 'object') { for (var key in feature) { if (hasOwnProp(feature, key)) { Modernizr.addTest(key, feature[key]); } } } else { feature = feature.toLowerCase(); if (Modernizr[feature] !== undefined) { return Modernizr; } test = typeof test == 'function' ? test() : test; if (typeof enableClasses !== "undefined" && enableClasses) { docElement.className += ' ' + (test ? '' : 'no-') + feature; } Modernizr[feature] = test; } return Modernizr; }; setCss(''); modElem = inputElem = null; ;(function (window, document) { var version = '3.7.0'; var options = window.html5 || {}; var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; var supportsHtml5Styles; var expando = '_html5shiv'; var expanID = 0; var expandoData = {}; var supportsUnknownElements; (function () { try { var a = document.createElement('a'); a.innerHTML = '<xyz></xyz>'; supportsHtml5Styles = ('hidden' in a); supportsUnknownElements = a.childNodes.length == 1 || (function () { (document.createElement)('a'); var frag = document.createDocumentFragment(); return ( typeof frag.cloneNode == 'undefined' || typeof frag.createDocumentFragment == 'undefined' || typeof frag.createElement == 'undefined' ); }()); } catch (e) { supportsHtml5Styles = true; supportsUnknownElements = true; } }()); function addStyleSheet(ownerDocument, cssText) { var p = ownerDocument.createElement('p'), parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; p.innerHTML = 'x<style>' + cssText + '</style>'; return parent.insertBefore(p.lastChild, parent.firstChild); } function getElements() { var elements = html5.elements; return typeof elements == 'string' ? elements.split(' ') : elements; } function getExpandoData(ownerDocument) { var data = expandoData[ownerDocument[expando]]; if (!data) { data = {}; expanID++; ownerDocument[expando] = expanID; expandoData[expanID] = data; } return data; } function createElement(nodeName, ownerDocument, data) { if (!ownerDocument) { ownerDocument = document; } if (supportsUnknownElements) { return ownerDocument.createElement(nodeName); } if (!data) { data = getExpandoData(ownerDocument); } var node; if (data.cache[nodeName]) { node = data.cache[nodeName].cloneNode(); } else if (saveClones.test(nodeName)) { node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); } else { node = data.createElem(nodeName); } return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; } function createDocumentFragment(ownerDocument, data) { if (!ownerDocument) { ownerDocument = document; } if (supportsUnknownElements) { return ownerDocument.createDocumentFragment(); } data = data || getExpandoData(ownerDocument); var clone = data.frag.cloneNode(), i = 0, elems = getElements(), l = elems.length; for (; i < l; i++) { clone.createElement(elems[i]); } return clone; } function shivMethods(ownerDocument, data) { if (!data.cache) { data.cache = {}; data.createElem = ownerDocument.createElement; data.createFrag = ownerDocument.createDocumentFragment; data.frag = data.createFrag(); } ownerDocument.createElement = function (nodeName) { if (!html5.shivMethods) { return data.createElem(nodeName); } return createElement(nodeName, ownerDocument, data); }; ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' + 'var n=f.cloneNode(),c=n.createElement;' + 'h.shivMethods&&(' + getElements().join().replace(/[\w\-]+/g, function (nodeName) { data.createElem(nodeName); data.frag.createElement(nodeName); return 'c("' + nodeName + '")'; }) + ');return n}' )(html5, data.frag); } function shivDocument(ownerDocument) { if (!ownerDocument) { ownerDocument = document; } var data = getExpandoData(ownerDocument); if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) { data.hasCSS = !!addStyleSheet(ownerDocument, 'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' + 'mark{background:#FF0;color:#000}' + 'template{display:none}' ); } if (!supportsUnknownElements) { shivMethods(ownerDocument, data); } return ownerDocument; } var html5 = { 'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video', 'version': version, 'shivCSS': (options.shivCSS !== false), 'supportsUnknownElements': supportsUnknownElements, 'shivMethods': (options.shivMethods !== false), 'type': 'default', 'shivDocument': shivDocument, createElement: createElement, createDocumentFragment: createDocumentFragment }; window.html5 = html5; shivDocument(document); }(this, document)); Modernizr._version = version; Modernizr._prefixes = prefixes; Modernizr._domPrefixes = domPrefixes; Modernizr._cssomPrefixes = cssomPrefixes; Modernizr.hasEvent = isEventSupported; Modernizr.testProp = function (prop) { return testProps([prop]); }; Modernizr.testAllProps = testPropsAll; Modernizr.testStyles = injectElementWithStyles; Modernizr.prefixed = function (prop, obj, elem) { if (!obj) { return testPropsAll(prop, 'pfx'); } else { return testPropsAll(prop, obj, elem); } }; docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') + (enableClasses ? ' js ' + classes.join(' ') : ''); return Modernizr; })(this, this.document); /*yepnope1.5.4|WTFPL*/ (function (a, b, c) { function d(a) { return "[object Function]" == o.call(a) } function e(a) { return "string" == typeof a } function f() { } function g(a) { return !a || "loaded" == a || "complete" == a || "uninitialized" == a } function h() { var a = p.shift(); q = 1, a ? a.t ? m(function () { ("c" == a.t ? B.injectCss : B.injectJs)(a.s, 0, a.a, a.x, a.e, 1) }, 0) : (a(), h()) : q = 0 } function i(a, c, d, e, f, i, j) { function k(b) { if (!o && g(l.readyState) && (u.r = o = 1, !q && h(), l.onload = l.onreadystatechange = null, b)) { "img" != a && m(function () { t.removeChild(l) }, 50); for (var d in y[c]) y[c].hasOwnProperty(d) && y[c][d].onload() } } var j = j || B.errorTimeout, l = b.createElement(a), o = 0, r = 0, u = {t: d, s: c, e: f, a: i, x: j}; 1 === y[c] && (r = 1, y[c] = []), "object" == a ? l.data = c : (l.src = c, l.type = a), l.width = l.height = "0", l.onerror = l.onload = l.onreadystatechange = function () { k.call(this, r) }, p.splice(e, 0, u), "img" != a && (r || 2 === y[c] ? (t.insertBefore(l, s ? null : n), m(k, j)) : y[c].push(l)) } function j(a, b, c, d, f) { return q = 0, b = b || "j", e(a) ? i("c" == b ? v : u, a, b, this.i++, c, d, f) : (p.splice(this.i++, 0, a), 1 == p.length && h()), this } function k() { var a = B; return a.loader = {load: j, i: 0}, a } var l = b.documentElement, m = a.setTimeout, n = b.getElementsByTagName("script")[0], o = {}.toString, p = [], q = 0, r = "MozAppearance" in l.style, s = r && !!b.createRange().compareNode, t = s ? l : n.parentNode, l = a.opera && "[object Opera]" == o.call(a.opera), l = !!b.attachEvent && !l, u = r ? "object" : l ? "script" : "img", v = l ? "script" : u, w = Array.isArray || function (a) { return "[object Array]" == o.call(a) }, x = [], y = {}, z = { timeout: function (a, b) { return b.length && (a.timeout = b[0]), a } }, A, B; B = function (a) { function b(a) { var a = a.split("!"), b = x.length, c = a.pop(), d = a.length, c = {url: c, origUrl: c, prefixes: a}, e, f, g; for (f = 0; f < d; f++) g = a[f].split("="), (e = z[g.shift()]) && (c = e(c, g)); for (f = 0; f < b; f++) c = x[f](c); return c } function g(a, e, f, g, h) { var i = b(a), j = i.autoCallback; i.url.split(".").pop().split("?").shift(), i.bypass || (e && (e = d(e) ? e : e[a] || e[g] || e[a.split("/").pop().split("?")[0]]), i.instead ? i.instead(a, e, f, g, h) : (y[i.url] ? i.noexec = !0 : y[i.url] = 1, f.load(i.url, i.forceCSS || !i.forceJS && "css" == i.url.split(".").pop().split("?").shift() ? "c" : c, i.noexec, i.attrs, i.timeout), (d(e) || d(j)) && f.load(function () { k(), e && e(i.origUrl, h, g), j && j(i.origUrl, h, g), y[i.url] = 2 }))) } function h(a, b) { function c(a, c) { if (a) { if (e(a)) c || (j = function () { var a = [].slice.call(arguments); k.apply(this, a), l() }), g(a, j, b, 0, h); else if (Object(a) === a) for (n in m = function () { var b = 0, c; for (c in a) a.hasOwnProperty(c) && b++; return b }(), a) a.hasOwnProperty(n) && (!c && !--m && (d(j) ? j = function () { var a = [].slice.call(arguments); k.apply(this, a), l() } : j[n] = function (a) { return function () { var b = [].slice.call(arguments); a && a.apply(this, b), l() } }(k[n])), g(a[n], j, b, n, h)) } else !c && l() } var h = !!a.test, i = a.load || a.both, j = a.callback || f, k = j, l = a.complete || f, m, n; c(h ? a.yep : a.nope, !!i), i && c(i) } var i, j, l = this.yepnope.loader; if (e(a)) g(a, 0, l, 0); else if (w(a)) for (i = 0; i < a.length; i++) j = a[i], e(j) ? g(j, 0, l, 0) : w(j) ? B(j) : Object(j) === j && h(j, l); else Object(a) === a && h(a, l) }, B.addPrefix = function (a, b) { z[a] = b }, B.addFilter = function (a) { x.push(a) }, B.errorTimeout = 1e4, null == b.readyState && b.addEventListener && (b.readyState = "loading", b.addEventListener("DOMContentLoaded", A = function () { b.removeEventListener("DOMContentLoaded", A, 0), b.readyState = "complete" }, 0)), a.yepnope = k(), a.yepnope.executeStack = h, a.yepnope.injectJs = function (a, c, d, e, i, j) { var k = b.createElement("script"), l, o, e = e || B.errorTimeout; k.src = a; for (o in d) k.setAttribute(o, d[o]); c = j ? h : c || f, k.onreadystatechange = k.onload = function () { !l && g(k.readyState) && (l = 1, c(), k.onload = k.onreadystatechange = null) }, m(function () { l || (l = 1, c(1)) }, e), i ? k.onload() : n.parentNode.insertBefore(k, n) }, a.yepnope.injectCss = function (a, c, d, e, g, i) { var e = b.createElement("link"), j, c = i ? h : c || f; e.href = a, e.rel = "stylesheet", e.type = "text/css"; for (j in d) e.setAttribute(j, d[j]); g || (n.parentNode.insertBefore(e, n), m(c, 0)) } })(this, document); Modernizr.load = function () { yepnope.apply(window, [].slice.call(arguments, 0)); }; ;
/* Utility function to fetch required data for component to render in server side. This was inspired from https://github.com/caljrimmer/isomorphic-redux-app/blob/73e6e7d43ccd41e2eb557a70be79cebc494ee54b/src/common/api/fetchComponentDataBeforeRender.js */ import { matchPath } from 'react-router-dom'; import { matchRoutes } from 'react-router-config' import sequence from './promiseUtils'; export default function fetchComponentData(store, routes, location) { const matched = getComponents(routes, location) const needs = matched.components.reduce((prev, current) => { return (current.need || []) .concat((current.WrappedComponent && current.WrappedComponent.need !== current.need ? current.WrappedComponent.need : []) || []) .concat(prev) }, []) return sequence(needs, need => store.dispatch(need(matched.params, store.getState()))) } function getComponents(routes, location) { let match, components = [] const r = matchRoutes(routes, location, components ) // console.log("=============================="); components.map((m,i) => { // console.log("=============================="); // console.log("match=======> ",i," : ", m.match.path); // console.log("=============================="); // // console.log("route=======> ",i," : ", m.route.component); // console.log("=============================="); return }) // console.log("=============================="); const res = { components: components, params: match ? match.params : {}, } return res }
import ChartOperator from "./chart-operator" import ContainerJS from "container-js" import DateWithOffset from "date-with-offset" import _ from "underscore" import CandleSticks from "src/viewmodel/chart/candle-sticks" import Numbers from "src/utils/numbers" import Dates from "src/utils/dates" import ContainerFactory from "../../../utils/test-container-factory" import CustomMatchers from "../../../utils/custom-matchers" describe("coordinateCalculator", () => { var operator; var target; var xhrManager; beforeEach(() => { jasmine.addMatchers(CustomMatchers); let container = new ContainerFactory().createContainer(); let d = container.get("viewModelFactory"); const factory = ContainerJS.utils.Deferred.unpack(d); let chart = factory.createChart(); operator = new ChartOperator(chart); target = chart.coordinateCalculator; xhrManager = chart.slider.context.rates.rateService.xhrManager; Dates.setTimezoneOffset(540); }); afterEach( ()=> Dates.resetTimezoneOffset() ); it("必要なデータが揃うと、座標計算ができる", () => { expect(target.displayableCandleCount).toEqual(undefined); expect(target.rateRange).toEqual(undefined); expect( () => target.calculateX(Dates.date("2015-05-01T00:01:10Z")) ).toThrowError(); expect(target.calculateTime(100)).toBe(null); expect( () => target.calculateY(172) ).toThrowError(); expect(target.calculatePrice(-100)).toBe(null); // データを設定 operator.initialize(300, 300); expect(target.displayableCandleCount).toEqual(39); expect(target.rateRange.highest).toEqual(180.03); expect(target.rateRange.lowest).toEqual(177.27); expect(target.calculateX(Dates.date("2015-05-08T16:00:00Z"))).toEqual(47); expect(target.calculateTime(47)).toEq(Dates.date("2015-05-08T16:00:00Z")); expect(target.calculateX(Dates.date("2015-05-09T00:01:00Z"))).toEqual(95); expect(target.calculateTime(95)).toEq(Dates.date("2015-05-09T00:00:00Z")); expect(target.calculateY(170)).toEqual(618); expect(target.calculatePrice(618)).toBe("170.009"); expect(target.calculateY(178)).toEqual(131); expect(target.calculatePrice(131)).toBe("178.009"); expect(target.calculatePrice(132)).toBe("177.993"); }); it("isRateArea", () => { operator.initialize(300, 300, "one_hour", 100); expect(target.isRateArea(0)).toEqual(false); expect(target.isRateArea(7)).toEqual(false); expect(target.isRateArea(8)).toEqual(true); expect(target.isRateArea(176)).toEqual(true); expect(target.isRateArea(177)).toEqual(false); expect(target.isRateArea(276)).toEqual(false); expect(target.isRateArea(277)).toEqual(false); expect(target.isRateArea(376)).toEqual(false); expect(target.isRateArea(377)).toEqual(false); }); it("isProfitArea", () => { operator.initialize(300, 300, "one_hour", 100); expect(target.isProfitArea(0)).toEqual(false); expect(target.isProfitArea(7)).toEqual(false); expect(target.isProfitArea(8)).toEqual(false); expect(target.isProfitArea(176)).toEqual(false); expect(target.isProfitArea(177)).toEqual(true); expect(target.isProfitArea(276)).toEqual(true); expect(target.isProfitArea(277)).toEqual(false); expect(target.isProfitArea(376)).toEqual(false); expect(target.isProfitArea(377)).toEqual(false); }); it("isGraphArea", () => { operator.initialize(300, 300, "one_hour", 100); expect(target.isGraphArea(0)).toEqual(false); expect(target.isGraphArea(7)).toEqual(false); expect(target.isGraphArea(8)).toEqual(false); expect(target.isGraphArea(176)).toEqual(false); expect(target.isGraphArea(177)).toEqual(false); expect(target.isGraphArea(276)).toEqual(false); expect(target.isGraphArea(277)).toEqual(true); expect(target.isGraphArea(376)).toEqual(true); expect(target.isGraphArea(377)).toEqual(false); }); });
/* * date: 2019-05-28 * desc: */ export {parseTime} from '~/utils'; // 省略字符串,如果字符串的长度超过指定长度,则省略展示。 export function ellipsisStr(str, length) { length = length || 100; let result = str; if (str.length > length) { result = str.slice(0, length) + '...'; } return result; } export function broadcastStatus(status) { return status == 1 ? '有推流' : '无推流' }
export class StringComparisonService { static getLevenshteinDistance(first, second) { const firstLength = first.length; const secondLength = second.length; if (firstLength === 0) { return secondLength; } if (secondLength === 0) { return secondLength; } let i, j, previous, value, list; if (firstLength > secondLength) { value = first; first = second; second = value; } list = new Array(firstLength + 1); for (i = 0; i <= firstLength; i++) { list[i] = i; } value = null; for (i = 1; i <= secondLength; i++) { previous = i; for (j = 1; j <= firstLength; j++) { if (second[i - 1] === first[j - 1]) { value = list[j - 1]; } else { value = Math.min(list[j - 1] + 1, Math.min(previous + 1, list[j] + 1)); } list[j - 1] = previous; previous = value; } list[firstLength] = previous; } return list[firstLength]; } }
//返回值的函数 import axios from 'axios' import { Loading } from 'element-ui'; export function AxiosReturn(url,params){ const api='http://www.mmkashop.com/api/v1/' let that=this var myUrl=api+url return axios.post(myUrl, params).then(function(res) { return res.data // if (res.data.status === 200) { // }else{ // that.$message.warning(res.data.message) // } }) .catch(function(error) { console.log(error); }); } //全局分页操作--页面大小变化的函数 select //val 组件值 url:api接口 prop:加餐 arrName:当返回数据不是result || results 时赋值用 export function pageSizeChange(val,url,prop,arrName) { //分页 let _this=this this.pagesize=val let mypage={} if(prop){ for(var i in prop){ mypage[i]=prop[i] } } let _url=url // if(this.isSearch){ // _url=this.searchAPI // let mySearchData=this.shaixuan // Object.keys(mySearchData).forEach(function(key){ // mypage[key]=mySearchData[key] // }); // } mypage.page_size=this.pagesize mypage.page_no=this.pagenum axios({ method: 'post', url: _url, data:mypage }).then((res)=>{ if(res.data.status === 200){ let result=res.data.data[arrName] _this.tableData=result }else{ console.log(res) _this.$message.warning('查看输出') } }) .catch((error)=>{ this.$message.error(error) }) } //全局分页操作--页数变化的函数 option //val 组件值 url:api接口 prop:加餐 arrName:当返回数据不是result || results 时赋值用 export function pageNumberChange(val,url,prop,arrName) { let _this=this this.pagenum=val let mypage={} if(prop){ for(var i in prop){ mypage[i]=prop[i] } } let _url=url // if(this.isSearch){ // _url=this.searchAPI // let mySearchData=this.shaixuan // Object.keys(mySearchData).forEach(function(key){ // mypage[key]=mySearchData[key] // }); // } mypage.page_size=this.pagesize mypage.page_no=this.pagenum this.axios({ method: 'post', url: _url, data:mypage }).then((res)=>{ if(res.data.status === 200){ console.log('页面大小改变',res.data.data) let result=res.data.data[arrName] _this.tableData=result }else{ console.log(res) this.$message.warning('查看输出') } }) .catch((error)=>{ this.$message.error(error) }) } //导出Excel表格 //第一个参数:表头 第二个参数是:表头对应的this.tableData的键 第三个是文件名可以为空 4当this.tableData有两级时把key传过来 export function myExprotExcel(headerArr,keyArr,filename,arrName){ if(headerArr.length!==keyArr.length){ this.$message.warning('表头数据与数组中的数据不能一一匹配') return } import('@/vendor/Export2Excel').then(excel => { const tHeader = headerArr const filterVal = keyArr let list =this[arrName] console.log('导出函数的List',list) const data = aaa(filterVal, list) excel.export_json_to_excel({ header: tHeader, data, filename: filename, autoWidth: true, bookType: 'xlsx' }) }) } //导出依赖函数 function aaa(filterVal,jsonData,key) { if(key){ return jsonData.map( (v,index) => filterVal.map(j => { var a=j.split('.')[1] return v[key][a] }) ) }else{ return jsonData.map(v => filterVal.map(j => { return v[j] })) } } //返回此刻时间 export function nowDate(){ let now=new Date() return now.getFullYear()+'-'+(now.getMonth() + 1)+'-'+now.getDate()+' '+now.getHours()+':'+now.getMinutes()+":"+now.getSeconds() } export function UnixDate(num){ let now=new Date(num*1000) return now.getFullYear()+'-'+(now.getMonth() + 1)+'-'+now.getDate()+' '+now.getHours()+':'+now.getMinutes()+":"+now.getSeconds() } ////全局删除操作 export function myDelete(index,text,params,url,showurl,arrname){ this.$confirm(`此操作将永久删除${text}, 是否继续?`, '提示', { cancelButtonText: '取消', confirmButtonText: '确定', type: 'warning' }).then(() => { this.axios({ method: 'post', headers:{'Authorization':'Bearer '+localStorage.token}, url: url, data:this.$qs.stringify(params) }).then((res)=>{ if(res.data.response==="fail"){ this.$message({ message: res.data.results, type: 'warning' }); }else{ if(this.tableData.length===1){ var key={IndexPage:this.currentPage-1,PageSize:this.pagesize} this.axios({ method: 'post', headers:{'Authorization':'Bearer '+localStorage.token}, url: showurl, data:this.$qs.stringify(key) }).then((res)=>{ this.totalpage=res.data.totalpage if(arrname){ this.tableData=res.data[arrname] }else{ this.tableData=res.data.result } }) }else{ this.totalpage=this.totalpage*1-1 } this.tableData.splice(index,1); this.$message({ type: 'success', message: '删除成功!' }) } }).catch((err)=>{ console.log(err) this.$notify.error({ title: '错误', message: '网路错误,请稍后再试' }) }) }).catch((err) => { this.$message({ type: 'info', message: '已取消删除' }); }); } // 导出 export function orderImport() { if(this.multipleSelection.length===0){ this.$message.warning('请先选择要导出的数据') return } this.multipleSelection=JSON.parse(this.multipleSelection) this.multipleSelection.map(ite=>{ console.log(ite.trade_status) if(ite.trade_status==0){ ite.trade_status='待审核' }else if(ite.trade_status==1){ ite.trade_status='待发货' }else if(ite.trade_status==2){ ite.trade_status='已发货' }else if(ite.trade_status==3){ ite.trade_status='已完成' }else if(ite.trade_status==4){ ite.trade_status='删除' }else if(ite.trade_status==5){ ite.trade_status='问题订单' }else{ ite.trade_status=ite.trade_status } return ite }) let headArr=[] let keyArr=[] for(var iit of this.clos){ if(iit.isChecked){ if(iit.label=="商品信息"){ console.log('一次就好一次就好一次就好一次就好') this.multipleSelection.map(item=>{ item.myid="" item.myname="" item.mysku="" item.myguige="" item.myprice="" item.mycount="" for(var enen of item.get_order_goods){ item.myid+=enen.goods_code item.myname+=enen.goods_name item.mysku+=enen.goods_sku item.myguige+=enen.key_value item.myprice+=enen.market_price item.mycount+=enen.qty } return item }) headArr.push('商品ID','商品名称','SKU','规格','价格','数量') keyArr.push('myid','myname','mysku','myguige','myprice','mycount') }else{ headArr.push(iit.label) keyArr.push(iit.prop) } } } console.log('qweqqqqqqqq',headArr) console.log('qweeeeqweqwe',keyArr) console.log('kao',this.tableData) this.myExprotExcel(headArr,keyArr,'订单列表','multipleSelection',true) }
/** * Displays the simulation data */ import React from "react" import "./simDataTable.css" class SimulationDataTable extends React.Component { constructor(props) { super(props); this.state = { showTable: false } } toggleTable() { this.setState(prevState => { return { showTable: !prevState.showTable } }) } render() { const modelData = this.props.modelData.current; const dailyData = modelData.dailyData; const scenario = modelData.scenario; return <div> <h1> Simulation Data </h1> <h2>SEIR Model</h2> <p> The scenarios here are based on an SEIR model (Susceptible, Exposed, Infected, Recovered) with a mean time to death of 15 days, mean incubation time of 5 days, mean infectious time of 3 days, and mean time to recovery of 22 days. A case fatality rate of 1.4% is used throughout, both to estimate actual past exposures from deaths and for predicting future deaths. </p> <p> The model simulates daily counts, instead of modeling a continuous function. This leads to some inaccuracies, but ultimately there's so much uncertainty in the input parameters above that calculation inaccuracies don't matter much. </p> { !this.state.showTable && <a onClick={this.toggleTable.bind(this)}>Show raw data</a> } { this.state.showTable && <div> <a onClick={this.toggleTable.bind(this)}>Hide raw data</a> <h2> Inputs </h2> <table className="inputdata"> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>Population</td><td>{scenario.population}</td> </tr> <tr> <td>Basic reproduction number, before (R0)</td><td>{scenario.rBefore}</td> </tr> <tr> <td>Case fatality rate, before (R0)</td><td>{scenario.cfrBefore}</td> </tr> <tr> <td>Threshold date</td><td>{scenario.thresholdDate}</td> </tr> <tr> <td>Basic reproduction number, after (R0)</td><td>{scenario.rAfter}</td> </tr> <tr> <td>Case fatality rate, after (R0)</td><td>{scenario.cfrAfter}</td> </tr> </tbody> </table> <h2> Output </h2> <div className="hscroll"> <table className="simdata"> <thead> <tr> {/* <th rowSpan="2">Index</th> */} <th width="80" rowSpan="2">Date</th> <th width="200" colSpan="2" style={{backgroundColor: "lightGrey", textAlign: "center"}}>Confirmed</th> <th width="680" colSpan="6" style={{backgroundColor: "darkGrey", textAlign: "center"}}>Simulated</th> </tr> <tr> <th>Cases</th> <th>Deaths</th> <th>Susceptible</th> <th>Exposed</th> <th>Infected</th> <th>Infectious</th> <th>Recovered</th> <th>Dead</th> {/* <th>Total Exposed</th> <th>Total Infected</th> <th>Testing %</th> */} </tr> </thead> <tbody> { dailyData.map(row => <tr key={row.index}> {/* <td>{row.index}</td> */} <td width="100px">{row.date}</td> <td>{row.confirmedCases}</td> <td>{row.confirmedDeaths}</td> <td>{Math.round(row.susceptible)}</td> <td>{Math.round(row.exposed)}</td> <td>{Math.round(row.infected)}</td> <td>{Math.round(row.infectious)}</td> <td>{Math.round(row.recovered)}</td> <td>{Math.round(row.dead)}</td> {/* <td>{Math.round(row.totalExposed)}</td> <td>{Math.round(row.totalInfected)}</td> <td>{d3Format.format(",.2%")(row.testingRatio)}</td> */} </tr>) } </tbody> </table> </div> </div> } </div> } } export default SimulationDataTable
function analyticsChart () { //calculate 12 months random users //calculate 12 levels of customers var startNum = Math.floor( Math.random() * 5000) + 5000; var visitors = new Array(12); var customers = new Array(); var magicX = .5; visitors[0] = startNum; customers[0] = Math.floor(visitors[0] * magicX); for(var i = 1; i < 12; i++){ if(Math.random() > .5){ visitors[i] = visitors[i-1] + Math.floor( Math.random() * 200 ); }else{ visitors[i] = visitors[i-1] - Math.floor( Math.random() * 200 ); }//end if up or down customers[i] = Math.floor(visitors[i] * magicX); }//end for 12 months $('#analytics_chart').highcharts({ chart: { type: 'line', backgroundColor: "rgba(255, 255, 255, 0.02)" }, title: { text: 'Random Visitors and Customers', x: -20 //center }, subtitle: { text: 'Source: Math.random', x: -20 }, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, yAxis: { title: { text: '# of Users' }, plotLines: [{ value: 0, width: 1, color: '#808080' }] }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'middle', borderWidth: 0 }, series: [{ name: 'Visitors', data: visitors }, { name: 'Customers', data: customers }] }); };
//=require angular-source/components/marketData/ticker/ticker.module 'use strict'; angular.module('marketData.ticker').service('TickerService', [ '$http', function ($http) { return { query: function () { return $http.get('api/getTickerInfo'); } }; } ]);
/** * Copyright (c) 2015-present, 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. * * @format * @flow */ 'use strict'; const findSymlinkedModules = require('./findSymlinkedModules'); const fs = require('fs'); const getPolyfills = require('../../rn-get-polyfills'); const invariant = require('fbjs/lib/invariant'); const path = require('path'); const {Config: MetroConfig, createBlacklist} = require('metro'); const RN_CLI_CONFIG = 'rn-cli.config.js'; import type {ConfigT as MetroConfigT} from 'metro'; /** * Configuration file of the CLI. */ export type ConfigT = MetroConfigT; function getProjectPath() { if ( __dirname.match(/node_modules[\/\\]react-native[\/\\]local-cli[\/\\]util$/) ) { // Packager is running from node_modules. // This is the default case for all projects created using 'react-native init'. return path.resolve(__dirname, '../../../..'); } else if (__dirname.match(/Pods[\/\\]React[\/\\]packager$/)) { // React Native was installed using CocoaPods. return path.resolve(__dirname, '../../../..'); } return path.resolve(__dirname, '../..'); } const resolveSymlinksForRoots = roots => roots.reduce( (arr, rootPath) => arr.concat(findSymlinkedModules(rootPath, roots)), [...roots], ); const getProjectRoots = () => { const root = process.env.REACT_NATIVE_APP_ROOT; if (root) { return resolveSymlinksForRoots([path.resolve(root)]); } return resolveSymlinksForRoots([getProjectPath()]); }; const getBlacklistRE = () => { return createBlacklist([/.*\/__fixtures__\/.*/]); }; /** * Module capable of getting the configuration out of a given file. * * The function will return all the default configuration, as specified by the * `DEFAULT` param overriden by those found on `rn-cli.config.js` files, if any. If no * default config is provided and no configuration can be found in the directory * hierarchy, an error will be thrown. */ const Config = { DEFAULT: ({ ...MetroConfig.DEFAULT, getBlacklistRE, getProjectRoots, getPolyfills, getModulesRunBeforeMainModule: () => [ require.resolve('../../Libraries/Core/InitializeCore'), ], }: ConfigT), find(startDir: string): ConfigT { return this.findWithPath(startDir).config; }, findWithPath(startDir: string): {config: ConfigT, projectPath: string} { const configPath = findConfigPath(startDir); invariant( configPath, `Can't find "${RN_CLI_CONFIG}" file in any parent folder of "${startDir}"`, ); const projectPath = path.dirname(configPath); return {config: this.load(configPath, startDir), projectPath}; }, findOptional(startDir: string): ConfigT { const configPath = findConfigPath(startDir); return configPath ? this.load(configPath, startDir) : {...Config.DEFAULT}; }, getProjectPath, getProjectRoots, load(configFile: string): ConfigT { return MetroConfig.load(configFile, Config.DEFAULT); }, }; function findConfigPath(cwd: string): ?string { const parentDir = findParentDirectory(cwd, RN_CLI_CONFIG); return parentDir ? path.join(parentDir, RN_CLI_CONFIG) : null; } // Finds the most near ancestor starting at `currentFullPath` that has // a file named `filename` function findParentDirectory(currentFullPath, filename) { const root = path.parse(currentFullPath).root; const testDir = parts => { if (parts.length === 0) { return null; } const fullPath = path.join(root, parts.join(path.sep)); var exists = fs.existsSync(path.join(fullPath, filename)); return exists ? fullPath : testDir(parts.slice(0, -1)); }; return testDir(currentFullPath.substring(root.length).split(path.sep)); } module.exports = Config;
const fs = require('fs'); const DIST_LIB_PATH = 'dist/payment-request/'; const README_PATH = 'README.md'; const ASSETS_PATH = 'projects/demo/src/assets'; const PATH_TO_README = DIST_LIB_PATH + README_PATH; copyExtraFiles(); function copyExtraFiles() { if (!fs.existsSync(README_PATH)) { throw new Error('Requested files do not exit'); } else { copyReadmeIntoDistFolder(README_PATH, PATH_TO_README); } } function copyReadmeIntoDistFolder(srcPath, toPath) { const fileBody = fs.readFileSync(srcPath).toString(); const withoutLogos = fileBody .replace(`![ng-web-apis logo](${ASSETS_PATH}/logo.svg) `, '') .replace(`<img src="${ASSETS_PATH}/web-api.svg" align="top"> `, ''); fs.writeFileSync(toPath, withoutLogos); }
import * as tld from '#/common/tld'; import cache from './cache'; import { getOption, hookOptions } from './options'; tld.initTLD(true); const RE_MATCH_PARTS = /(.*?):\/\/([^/]*)\/(.*)/; let blacklistRules = []; hookOptions((changes) => { if ('blacklist' in changes) resetBlacklist(changes.blacklist || ''); }); const RE_HTTP_OR_HTTPS = /^https?$/i; /* Simple FIFO queue for the results of testBlacklist, cached separately from the main |cache| because the blacklist is updated only once in a while so its entries would be crowding the main cache and reducing its performance (objects with lots of keys are slow to access). We also don't need to auto-expire the entries after a timeout. The only limit we're concerned with is the overall memory used. The limit is specified in the amount of unicode characters (string length) for simplicity. Disregarding deduplication due to interning, the actual memory used is approximately twice as big: 2 * keyLength + objectStructureOverhead * objectCount */ const MAX_BL_CACHE_LENGTH = 100e3; let blCache = {}; let blCacheSize = 0; /** * Test glob rules like `@include` and `@exclude`. */ export function testGlob(url, rules) { return rules.some((rule) => { const key = `re:${rule}`; let re = cache.get(key); if (re) { cache.hit(key); } else { re = autoReg(rule); cache.put(key, re); } return re.test(url); }); } /** * Test match rules like `@match` and `@exclude_match`. */ export function testMatch(url, rules) { return rules.some((rule) => { const key = `match:${rule}`; let matcher = cache.get(key); if (matcher) { cache.hit(key); } else { matcher = matchTester(rule); cache.put(key, matcher); } return matcher.test(url); }); } export function testScript(url, script) { const { custom, meta } = script; const mat = mergeLists(custom.origMatch && meta.match, custom.match); const inc = mergeLists(custom.origInclude && meta.include, custom.include); const exc = mergeLists(custom.origExclude && meta.exclude, custom.exclude); const excMat = mergeLists(custom.origExcludeMatch && meta.excludeMatch, custom.excludeMatch); // match all if no @match or @include rule let ok = !mat.length && !inc.length; // @match ok = ok || testMatch(url, mat); // @include ok = ok || testGlob(url, inc); // @exclude-match ok = ok && !testMatch(url, excMat); // @exclude ok = ok && !testGlob(url, exc); return ok; } function testRegExp(re, text) { const key = `re-test:${re.source}:${text}`; let res = cache.get(key); if (!res) { res = re.test(text) ? 1 : -1; cache.put(key, res); } return res === 1; } function mergeLists(...args) { return args.reduce((res, item) => (item ? res.concat(item) : res), []); } function str2RE(str) { const re = str.replace(/([.?+[\]{}()|^$])/g, '\\$1').replace(/\*/g, '.*?'); return re; } function autoReg(str) { if (str.length > 1 && str[0] === '/' && str[str.length - 1] === '/') { return new RegExp(str.slice(1, -1)); // Regular-expression } const reStr = str2RE(str); if (tld.isReady() && str.includes('.tld/')) { const reTldStr = reStr.replace('\\.tld/', '((?:\\.\\w+)+)/'); return { test: (tstr) => { const matches = tstr.match(reTldStr); if (matches) { const suffix = matches[1].slice(1); if (tld.getPublicSuffix(suffix) === suffix) return true; } return false; }, }; } const re = new RegExp(`^${reStr}$`); // String with wildcards return { test: tstr => testRegExp(re, tstr) }; } function matchScheme(rule, data) { // exact match if (rule === data) return 1; // * = http | https // support http* if ([ '*', 'http*', ].includes(rule) && RE_HTTP_OR_HTTPS.test(data)) return 1; return 0; } const RE_STR_ANY = '(?:|.*?\\.)'; const RE_STR_TLD = '((?:\\.\\w+)+)'; function hostMatcher(rule) { // *.example.com // www.google.* // www.google.tld let prefix = ''; let base = rule; let suffix = ''; if (rule.startsWith('*.')) { base = base.slice(2); prefix = RE_STR_ANY; } if (tld.isReady() && rule.endsWith('.tld')) { base = base.slice(0, -4); suffix = RE_STR_TLD; } const re = new RegExp(`^${prefix}${str2RE(base)}${suffix}$`); return (data) => { // * matches all if (rule === '*') return 1; // exact match if (rule === data) return 1; const matches = data.match(re); if (matches) { const [, tldStr] = matches; if (!tldStr) return 1; const tldSuffix = tldStr.slice(1); return tld.getPublicSuffix(tldSuffix) === tldSuffix; } return 0; }; } function pathMatcher(rule) { const iHash = rule.indexOf('#'); let iQuery = rule.indexOf('?'); let strRe = str2RE(rule); if (iQuery > iHash) iQuery = -1; if (iHash < 0) { if (iQuery < 0) strRe = `^${strRe}(?:[?#]|$)`; else strRe = `^${strRe}(?:#|$)`; } const reRule = new RegExp(strRe); return data => testRegExp(reRule, data); } function matchTester(rule) { let test; if (rule === '<all_urls>') { test = () => true; } else { const ruleParts = rule.match(RE_MATCH_PARTS); if (ruleParts) { const matchHost = hostMatcher(ruleParts[2]); const matchPath = pathMatcher(ruleParts[3]); test = (url) => { const parts = url.match(RE_MATCH_PARTS); return !!ruleParts && !!parts && matchScheme(ruleParts[1], parts[1]) && matchHost(parts[2]) && matchPath(parts[3]); }; } else { // Ignore invalid match rules test = () => false; } } return { test }; } function checkPrefix(prefix, rule) { if (rule.startsWith(prefix)) { return rule.slice(prefix.length).trim(); } } export function testBlacklist(url) { let res = blCache[url]; if (res === undefined) { const rule = blacklistRules.find(({ test }) => test(url)); if (rule) res = rule.reject; updateBlacklistCache(url, res || false); } return res; } export function resetBlacklist(list) { const rules = list == null ? getOption('blacklist') : list; if (process.env.DEBUG) { console.info('Reset blacklist:', rules); } // XXX compatible with {Array} list in v2.6.1- blacklistRules = (Array.isArray(rules) ? rules : (rules || '').split('\n')) .map((line) => { const item = line.trim(); if (!item || item.startsWith('#')) return null; /** * @include and @match rules are added for people who need a whitelist. */ // @include const includeRule = checkPrefix('@include ', item); if (includeRule) { return { test: autoReg(includeRule).test, reject: false, }; } // @match const matchRule = checkPrefix('@match ', item); if (matchRule) { return { test: matchTester(matchRule).test, reject: false, }; } // @exclude const excludeRule = checkPrefix('@exclude ', item); if (excludeRule) { return { test: autoReg(excludeRule).test, reject: true, }; } // domains if (item.indexOf('/') < 0) { return { test: matchTester(`*://${item}/*`).test, reject: true, }; } // @exclude-match return { test: matchTester(item).test, reject: true, }; }) .filter(Boolean); blCache = {}; blCacheSize = 0; } function updateBlacklistCache(key, value) { blCache[key] = value; blCacheSize += key.length; if (blCacheSize > MAX_BL_CACHE_LENGTH) { Object.keys(blCache) .some((k) => { blCacheSize -= blCache[k].length; delete blCache[k]; // reduce the cache to 75% so that this function doesn't run too often. return blCacheSize < MAX_BL_CACHE_LENGTH * 3 / 4; }); } }
/* @flow */ import React from "react"; import ReactMarkdown from "react-markdown"; import Helmet from "react-helmet"; import { makeTitle } from "../routes"; import icons from "../icons"; import Query from "../queries/query"; import StaticPage from "./StaticPage"; import pageQuery from "../queries/content/page.js"; import NotFoundStaticPage from "./NotFoundStaticPage"; import routerContext from "../contexts/router-context"; import gfm from "remark-gfm"; import Accordion from "../components/Accordion"; type Props = { location: any, } class DynamicPage extends React.Component<Props, void> { static contextType = routerContext; absoluteImageUrl(uri: string): string { // Strapi returns a relative image url, we need to change // it to point to our content server. return window.STRAPI_URL + uri; } render() { const params = { "path": this.props.location.pathname, }; const loading = ( <StaticPage title="Loading" bannerName="static" > <icons.Loading className="big" /> </StaticPage> ) const error = ( <StaticPage title="Error" bannerName="static" > <p className="errorMessage"> Error retrieving content. Please try again. </p> </StaticPage> ) return ( <Query query={pageQuery} args={params} loadingComponent={loading} errorComponent={error} > {res => { if ( res.data.pages !== undefined && res.data.pages.length ) { const page = res.data.pages[0]; return ( <StaticPage title={page.Title} bannerName={page.Banner ? page.Banner.Key : ""} bannerPrimary={page.BannerTextPrimary} bannerSecondary={page.BannerTextSecondary} > <Helmet> <title> { makeTitle( page.Title, this.context.router.match.params ) } </title> </Helmet> <div className="DynamicPage"> <ReactMarkdown plugins={[gfm]} source={page.Body} transformImageUri={ this.absoluteImageUrl } /> <Accordion title={page.AccordionTitle} items={page.Accordion} /> </div> </StaticPage> ) } return (<NotFoundStaticPage />) }} </Query> ); } } export default DynamicPage;
import addMilliseconds from 'date-fns/addMilliseconds'; import addSeconds from 'date-fns/addSeconds'; import addMinutes from 'date-fns/addMinutes'; import addHours from 'date-fns/addHours'; import addDays from 'date-fns/addDays'; import addWeeks from 'date-fns/addWeeks'; import addMonths from 'date-fns/addMonths'; import addYears from 'date-fns/addYears'; import formatDistanceStrict from 'date-fns/formatDistanceStrict'; const BEST_UNIT = 'best'; const ADD_UNIT_FN = new Map([ ['millisecond', addMilliseconds], ['second', addSeconds], ['minute', addMinutes], ['hour', addHours], ['day', addDays], ['week', addWeeks], ['month', addMonths], ['year', addYears], ]); const DISALLOWED_FROM_UNITS = new Set(['millisecond']); export default () => /** * Transform between time units. * * @param {*} time The base time amount * @param {string} [toUnit] The unit to convert the time to (supported units: 'second', 'minute', 'hour', 'day', 'week', 'month', 'year') * Defaults to using the "best" unit * @param {string} [fromUnit='second'] The unit to convert the time from (supported units: 'millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year') * @return {Promise<radspec/evaluator/TypedValue>} */ async (time, toUnit = BEST_UNIT, fromUnit = 'second') => { if (DISALLOWED_FROM_UNITS.has(fromUnit) || !ADD_UNIT_FN.has(fromUnit)) { throw new Error( `@transformTime: Time unit '${fromUnit}' is not supported as a fromUnit` ); } if (toUnit !== BEST_UNIT && !ADD_UNIT_FN.has(toUnit)) { throw new Error( `@transformTime: Time unit '${toUnit}' is not supported as a toUnit` ); } const addTime = ADD_UNIT_FN.get(fromUnit); const zeroDate = new Date(0); const duration = addTime(zeroDate, Number(time)); return { type: 'string', value: formatDistanceStrict( zeroDate, duration, toUnit !== BEST_UNIT ? { unit: toUnit } : {} ), }; };
/*! For license information please see chunk.07887fd1117e655def19.js.LICENSE.txt */ (self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[4920,1823],{63207:(e,t,r)=>{"use strict";r(65660),r(15112);var i=r(9672),n=r(87156),o=r(50856),s=r(43437);(0,i.k)({_template:o.d` <style> :host { @apply --layout-inline; @apply --layout-center-center; position: relative; vertical-align: middle; fill: var(--iron-icon-fill-color, currentcolor); stroke: var(--iron-icon-stroke-color, none); width: var(--iron-icon-width, 24px); height: var(--iron-icon-height, 24px); @apply --iron-icon; } :host([hidden]) { display: none; } </style> `,is:"iron-icon",properties:{icon:{type:String},theme:{type:String},src:{type:String},_meta:{value:s.XY.create("iron-meta",{type:"iconset"})}},observers:["_updateIcon(_meta, isAttached)","_updateIcon(theme, isAttached)","_srcChanged(src, isAttached)","_iconChanged(icon, isAttached)"],_DEFAULT_ICONSET:"icons",_iconChanged:function(e){var t=(e||"").split(":");this._iconName=t.pop(),this._iconsetName=t.pop()||this._DEFAULT_ICONSET,this._updateIcon()},_srcChanged:function(e){this._updateIcon()},_usesIconset:function(){return this.icon||!this.src},_updateIcon:function(){this._usesIconset()?(this._img&&this._img.parentNode&&(0,n.vz)(this.root).removeChild(this._img),""===this._iconName?this._iconset&&this._iconset.removeIcon(this):this._iconsetName&&this._meta&&(this._iconset=this._meta.byKey(this._iconsetName),this._iconset?(this._iconset.applyIcon(this,this._iconName,this.theme),this.unlisten(window,"iron-iconset-added","_updateIcon")):this.listen(window,"iron-iconset-added","_updateIcon"))):(this._iconset&&this._iconset.removeIcon(this),this._img||(this._img=document.createElement("img"),this._img.style.width="100%",this._img.style.height="100%",this._img.draggable=!1),this._img.src=this.src,(0,n.vz)(this.root).appendChild(this._img))}})},15112:(e,t,r)=>{"use strict";r.d(t,{P:()=>n});r(43437);var i=r(9672);class n{constructor(e){n[" "](e),this.type=e&&e.type||"default",this.key=e&&e.key,e&&"value"in e&&(this.value=e.value)}get value(){var e=this.type,t=this.key;if(e&&t)return n.types[e]&&n.types[e][t]}set value(e){var t=this.type,r=this.key;t&&r&&(t=n.types[t]=n.types[t]||{},null==e?delete t[r]:t[r]=e)}get list(){if(this.type){var e=n.types[this.type];return e?Object.keys(e).map((function(e){return o[this.type][e]}),this):[]}}byKey(e){return this.key=e,this.value}}n[" "]=function(){},n.types={};var o=n.types;(0,i.k)({is:"iron-meta",properties:{type:{type:String,value:"default"},key:{type:String},value:{type:String,notify:!0},self:{type:Boolean,observer:"_selfChanged"},__meta:{type:Boolean,computed:"__computeMeta(type, key, value)"}},hostAttributes:{hidden:!0},__computeMeta:function(e,t,r){var i=new n({type:e,key:t});return void 0!==r&&r!==i.value?i.value=r:this.value!==i.value&&(this.value=i.value),i},get list(){return this.__meta&&this.__meta.list},_selfChanged:function(e){e&&(this.value=this)},byKey:function(e){return new n({type:this.type,key:e}).value}})},58993:(e,t,r)=>{"use strict";r.d(t,{yh:()=>i,U2:()=>s,t8:()=>a,ZH:()=>c});class i{constructor(e="keyval-store",t="keyval"){this.storeName=t,this._dbp=new Promise(((r,i)=>{const n=indexedDB.open(e,1);n.onerror=()=>i(n.error),n.onsuccess=()=>r(n.result),n.onupgradeneeded=()=>{n.result.createObjectStore(t)}}))}_withIDBStore(e,t){return this._dbp.then((r=>new Promise(((i,n)=>{const o=r.transaction(this.storeName,e);o.oncomplete=()=>i(),o.onabort=o.onerror=()=>n(o.error),t(o.objectStore(this.storeName))}))))}}let n;function o(){return n||(n=new i),n}function s(e,t=o()){let r;return t._withIDBStore("readonly",(t=>{r=t.get(e)})).then((()=>r.result))}function a(e,t,r=o()){return r._withIDBStore("readwrite",(r=>{r.put(t,e)}))}function c(e=o()){return e._withIDBStore("readwrite",(e=>{e.clear()}))}},54909:(e,t,r)=>{"use strict";var i=r(50856),n=r(28426),o=r(26765),s=r(11052);r(98762);class a extends((0,s.I)(n.H3)){static get template(){return i.d` <ha-progress-button id="progress" progress="[[progress]]" on-click="buttonTapped" tabindex="0" ><slot></slot ></ha-progress-button> `}static get properties(){return{hass:{type:Object},progress:{type:Boolean,value:!1},domain:{type:String},service:{type:String},serviceData:{type:Object,value:{}},confirmation:{type:String}}}callService(){this.progress=!0;const e=this,t={domain:this.domain,service:this.service,serviceData:this.serviceData};this.hass.callService(this.domain,this.service,this.serviceData).then((function(){e.progress=!1,e.$.progress.actionSuccess(),t.success=!0}),(function(){e.progress=!1,e.$.progress.actionError(),t.success=!1})).then((function(){e.fire("hass-service-called",t)}))}buttonTapped(){this.confirmation?(0,o.g7)(this,{text:this.confirmation,confirm:()=>this.callService()}):this.callService()}}customElements.define("ha-call-service-button",a)},98762:(e,t,r)=>{"use strict";r(53918);var i=r(15652);r(31206);function n(){n=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!a(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,n[o])(a)||a);e=c.element,this.addElementPlacement(e,t),c.finisher&&i.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=d(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:l(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=l(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function o(e){var t,r=d(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function s(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function a(e){return e.decorators&&e.decorators.length}function c(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function l(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function d(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}!function(e,t,r,i){var l=n();if(i)for(var d=0;d<i.length;d++)l=i[d](l);var p=t((function(e){l.initializeInstanceElements(e,u.elements)}),r),u=l.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if(c(o.descriptor)||c(n.descriptor)){if(a(o)||a(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(a(o)){if(a(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}s(o,n)}else t.push(o)}return t}(p.d.map(o)),e);l.initializeClassElements(p.F,u.elements),l.runClassFinishers(p.F,u.finishers)}([(0,i.Mo)("ha-progress-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,i.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,i.Cb)({type:Boolean})],key:"progress",value:()=>!1},{kind:"field",decorators:[(0,i.Cb)({type:Boolean})],key:"raised",value:()=>!1},{kind:"field",decorators:[(0,i.IO)("mwc-button",!0)],key:"_button",value:void 0},{kind:"method",key:"render",value:function(){return i.dy` <mwc-button ?raised=${this.raised} .disabled=${this.disabled||this.progress} @click=${this._buttonTapped} > <slot></slot> </mwc-button> ${this.progress?i.dy`<div class="progress"> <ha-circular-progress size="small" active></ha-circular-progress> </div>`:""} `}},{kind:"method",key:"actionSuccess",value:function(){this._tempClass("success")}},{kind:"method",key:"actionError",value:function(){this._tempClass("error")}},{kind:"method",key:"_tempClass",value:function(e){this._button.classList.add(e),setTimeout((()=>{this._button.classList.remove(e)}),1e3)}},{kind:"method",key:"_buttonTapped",value:function(e){this.progress&&e.stopPropagation()}},{kind:"get",static:!0,key:"styles",value:function(){return i.iv` :host { outline: none; display: inline-block; position: relative; } mwc-button { transition: all 1s; } mwc-button.success { --mdc-theme-primary: white; background-color: var(--success-color); transition: none; } mwc-button[raised].success { --mdc-theme-primary: var(--success-color); --mdc-theme-on-primary: white; } mwc-button.error { --mdc-theme-primary: white; background-color: var(--error-color); transition: none; } mwc-button[raised].error { --mdc-theme-primary: var(--error-color); --mdc-theme-on-primary: white; } .progress { bottom: 0; margin-top: 4px; position: absolute; text-align: center; top: 0; width: 100%; } `}}]}}),i.oi)},22098:(e,t,r)=>{"use strict";var i=r(15652);function n(){n=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!a(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,n[o])(a)||a);e=c.element,this.addElementPlacement(e,t),c.finisher&&i.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=d(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:l(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=l(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function o(e){var t,r=d(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function s(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function a(e){return e.decorators&&e.decorators.length}function c(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function l(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function d(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}!function(e,t,r,i){var l=n();if(i)for(var d=0;d<i.length;d++)l=i[d](l);var p=t((function(e){l.initializeInstanceElements(e,u.elements)}),r),u=l.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if(c(o.descriptor)||c(n.descriptor)){if(a(o)||a(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(a(o)){if(a(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}s(o,n)}else t.push(o)}return t}(p.d.map(o)),e);l.initializeClassElements(p.F,u.elements),l.runClassFinishers(p.F,u.finishers)}([(0,i.Mo)("ha-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,i.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,i.Cb)({type:Boolean,reflect:!0})],key:"outlined",value:()=>!1},{kind:"get",static:!0,key:"styles",value:function(){return i.iv` :host { background: var( --ha-card-background, var(--card-background-color, white) ); border-radius: var(--ha-card-border-radius, 4px); box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12) ); color: var(--primary-text-color); display: block; transition: all 0.3s ease-out; position: relative; } :host([outlined]) { box-shadow: none; border-width: var(--ha-card-border-width, 1px); border-style: solid; border-color: var( --ha-card-border-color, var(--divider-color, #e0e0e0) ); } .card-header, :host ::slotted(.card-header) { color: var(--ha-card-header-color, --primary-text-color); font-family: var(--ha-card-header-font-family, inherit); font-size: var(--ha-card-header-font-size, 24px); letter-spacing: -0.012em; line-height: 48px; padding: 12px 16px 16px; display: block; margin-block-start: 0px; margin-block-end: 0px; font-weight: normal; } :host ::slotted(.card-content:not(:first-child)), slot:not(:first-child)::slotted(.card-content) { padding-top: 0px; margin-top: -8px; } :host ::slotted(.card-content) { padding: 16px; } :host ::slotted(.card-actions) { border-top: 1px solid var(--divider-color, #e8e8e8); padding: 5px 16px; } `}},{kind:"method",key:"render",value:function(){return i.dy` ${this.header?i.dy`<h1 class="card-header">${this.header}</h1>`:i.dy``} <slot></slot> `}}]}}),i.oi)},99282:(e,t,r)=>{"use strict";var i=r(52039),n=r(55317);class o extends i.C{connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.path="ltr"===window.getComputedStyle(this).direction?n.zrb:n.gAv}),100)}}customElements.define("ha-icon-next",o)},91810:(e,t,r)=>{"use strict";r.d(t,{YJ:()=>i,ID:()=>n,Kk:()=>o,$c:()=>s,WI:()=>a,vY:()=>c,uZ:()=>l,cC:()=>d,e8:()=>p,Jl:()=>u,Lm:()=>h,ol:()=>f});const i=["ProtocolInfo","Probe","WakeUp","ManufacturerSpecific1","NodeInfo","NodePlusInfo","ManufacturerSpecific2","Versions","Instances","Static","CacheLoad","Associations","Neighbors","Session","Dynamic","Configuration","Complete"],n=["driverAllNodesQueried","driverAllNodesQueriedSomeDead","driverAwakeNodesQueried"],o=["starting","started","Ready","driverReady"],s=["Offline","stopped","driverFailed","driverReset","driverRemoved","driverAllNodesOnFire"],a=function(e){if(!e)return;const t=e.identifiers.find((e=>"ozw"===e[0]));if(!t)return;const r=t[1].split(".");return{node_id:parseInt(r[1]),ozw_instance:parseInt(r[0])}},c=e=>e.callWS({type:"ozw/get_instances"}),l=(e,t)=>e.callWS({type:"ozw/network_status",ozw_instance:t}),d=(e,t)=>e.callWS({type:"ozw/network_statistics",ozw_instance:t}),p=(e,t)=>e.callWS({type:"ozw/get_nodes",ozw_instance:t}),u=(e,t,r)=>e.callWS({type:"ozw/node_status",ozw_instance:t,node_id:r}),h=(e,t,r)=>e.callWS({type:"ozw/node_metadata",ozw_instance:t,node_id:r}),f=(e,t,r)=>e.callWS({type:"ozw/get_config_parameters",ozw_instance:t,node_id:r})},28575:(e,t,r)=>{"use strict";r.d(t,{Vc:()=>i});const i="not_found"},26765:(e,t,r)=>{"use strict";r.d(t,{Ys:()=>s,g7:()=>a,D9:()=>c});var i=r(47181);const n=()=>Promise.all([r.e(8941),r.e(879),r.e(6372),r.e(6547),r.e(6509),r.e(7230)]).then(r.bind(r,1281)),o=(e,t,r)=>new Promise((o=>{const s=t.cancel,a=t.confirm;(0,i.B)(e,"show-dialog",{dialogTag:"dialog-box",dialogImport:n,dialogParams:{...t,...r,cancel:()=>{o(!!(null==r?void 0:r.prompt)&&null),s&&s()},confirm:e=>{o(!(null==r?void 0:r.prompt)||e),a&&a(e)}}})})),s=(e,t)=>o(e,t),a=(e,t)=>o(e,t,{confirmation:!0}),c=(e,t)=>o(e,t,{prompt:!0})},11052:(e,t,r)=>{"use strict";r.d(t,{I:()=>o});var i=r(76389),n=r(47181);const o=(0,i.o)((e=>class extends e{fire(e,t,r){return r=r||{},(0,n.B)(r.node||this,e,t,r)}}))},88165:(e,t,r)=>{"use strict";var i=r(15652),n=r(81471);function o(){o=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!c(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,n[o])(a)||a);e=c.element,this.addElementPlacement(e,t),c.finisher&&i.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=p(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:d(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=d(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function s(e){var t,r=p(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function a(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function c(e){return e.decorators&&e.decorators.length}function l(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function d(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function p(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}!function(e,t,r,i){var n=o();if(i)for(var d=0;d<i.length;d++)n=i[d](n);var p=t((function(e){n.initializeInstanceElements(e,u.elements)}),r),u=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if(l(o.descriptor)||l(n.descriptor)){if(c(o)||c(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(c(o)){if(c(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}a(o,n)}else t.push(o)}return t}(p.d.map(s)),e);n.initializeClassElements(p.F,u.elements),n.runClassFinishers(p.F,u.finishers)}([(0,i.Mo)("ha-config-section")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,i.Cb)()],key:"isWide",value:()=>!1},{kind:"method",key:"render",value:function(){return i.dy` <div class="content ${(0,n.$)({narrow:!this.isWide})}" > <div class="header"><slot name="header"></slot></div> <div class="together layout ${(0,n.$)({narrow:!this.isWide,vertical:!this.isWide,horizontal:this.isWide})}" > <div class="intro"><slot name="introduction"></slot></div> <div class="panel flex-auto"><slot></slot></div> </div> </div> `}},{kind:"get",static:!0,key:"styles",value:function(){return i.iv` :host { display: block; } .content { padding: 28px 20px 0; max-width: 1040px; margin: 0 auto; } .layout { display: flex; } .horizontal { flex-direction: row; } .vertical { flex-direction: column; } .flex-auto { flex: 1 1 auto; } .header { font-family: var(--paper-font-headline_-_font-family); -webkit-font-smoothing: var( --paper-font-headline_-_-webkit-font-smoothing ); font-size: var(--paper-font-headline_-_font-size); font-weight: var(--paper-font-headline_-_font-weight); letter-spacing: var(--paper-font-headline_-_letter-spacing); line-height: var(--paper-font-headline_-_line-height); opacity: var(--dark-primary-opacity); } .together { margin-top: 32px; } .intro { font-family: var(--paper-font-subhead_-_font-family); -webkit-font-smoothing: var( --paper-font-subhead_-_-webkit-font-smoothing ); font-weight: var(--paper-font-subhead_-_font-weight); line-height: var(--paper-font-subhead_-_line-height); width: 100%; max-width: 400px; margin-right: 40px; opacity: var(--dark-primary-opacity); font-size: 14px; padding-bottom: 20px; } .panel { margin-top: -24px; } .panel ::slotted(*) { margin-top: 24px; display: block; } .narrow.content { max-width: 640px; } .narrow .together { margin-top: 20px; } .narrow .intro { padding-bottom: 20px; margin-right: 0; max-width: 500px; } `}}]}}),i.oi)},47465:(e,t,r)=>{"use strict";r.d(t,{B:()=>o});var i=r(47181);const n=()=>Promise.all([r.e(6372),r.e(3822),r.e(4148)]).then(r.bind(r,54210)),o=(e,t)=>{(0,i.B)(e,"show-dialog",{dialogTag:"dialog-ozw-refresh-node",dialogImport:n,dialogParams:t})}}}]); //# sourceMappingURL=chunk.07887fd1117e655def19.js.map
import { Fragment } from 'react'; import './SupportPopupInput.css'; const SupportPopupInput = (props) =>{ //set onChange method to use debounce maybe. return( <Fragment> <input className="support__input" type="number" value={props.amount} onChange={e => {props.setAmountToSendHandler(e.target.value)}} required autoFocus></input> </Fragment> ) }; export default SupportPopupInput; //TODO Validator //Must be a number //Must be <= balance //Support Button is disabled until user inputs proper value
"use strict";(self.webpackChunkgatsby_portfolio=self.webpackChunkgatsby_portfolio||[]).push([[170],{4170:function(e,o,c){c.r(o),c.d(o,{theme:function(){return t}});var t="{\n --deckgo-highlight-code-carbon-background: #2a2734;\n --deckgo-highlight-code-carbon-color: #eeebff;\n --deckgo-highlight-code-token-atrule: #ffcc99;\n --deckgo-highlight-code-token-comment: #6c6783;\n --deckgo-highlight-code-token-comment-rgb: 108, 103, 131;\n --deckgo-highlight-code-token-function: #eeebff;\n --deckgo-highlight-code-token-operator: #ffad5c;\n --deckgo-highlight-code-token-property: #9a86fd;\n --deckgo-highlight-code-token-punctuation: #6c6783;\n --deckgo-highlight-code-token-selector: #eeebff;\n --deckgo-highlight-code-token-regex: #ffb870;\n}"}}]); //# sourceMappingURL=170-1a44b69e0f632a1de704.js.map
var status = 0; var itemType = 0; // 1 = Equip, 2 = Scrolls, 3 = Misc // Type 1 : Equips items_sel1 = [1004031, 1442298, 1102399, 1703999]; items_name1 = ["Monster Energy Cap (Hat)", "Monster Energy Can (Polearm)", "WRS Wings (Cape)", "WRS Scythe (Polearm)"]; items_amount1 = [1, 1, 1, 1]; items_price1 = [15, 15, 100, 100]; // Type 2 : Scrolls items_sel2 = [2049406, 2049303, 2049303, 5062005, 5062005, 2450039, 2022918, 2022913, 2340000, 2340000]; items_name2 = ["Special Potential Scroll 100%", "Adv Equip Enhance Scroll (2)", "Adv Equip Enhance Scroll (20)", "Enlighten Miracle Cube (3)", "Enlighten Miracle Cube (30)", "1.5 EXP Coupon", "1.5 DROP Coupon", "Virtue Blessing (3)", "White Scroll (1)", "White Scroll (3)"]; items_amount2 = [1, 2, 20, 3, 30, 1, 1, 3, 1, 3]; items_price2 = [12, 1, 9, 1, 9, 21, 30, 1, 5, 13]; // Type 3 : Misc items_sel3 = [4007099]; items_name3 = ["Wiz Coins (5)"]; items_amount3 = [5]; items_price3 = [1]; function start() { status = -1; action(1, 0, 0); } function action(mode, type, selection) { if (mode == -1) { cm.dispose(); } else { if (mode == 0 && status == 0) { cm.dispose(); return; } if (mode == 1) status++; else status--; if (status == 0) { if (cm.getPlayer().getVPoints() >= 1) { cm.sendSimple("Hello and Welcome to the #eWizStory Vote Shop#n.\r\nYou have #r" + cm.getPlayer().getVPoints() + "#k Vote Points.\r\nWhat would you like to purchase?\r\n" + "\r\n#L1##rEquips#k" + "\r\n#L2##bScrolls#k" + "\r\n#L3##gMisc.#k"); } else { cm.sendOk("Hello and Welcome to the #eWizStory Vote Shop#n.\r\nYou have #r" + cm.getPlayer().getVPoints() + "#k Vote Points.\r\nWhat would you like to purchase?\r\n\r\n\r\n#b#ePlease Vote at least once to unlock the categories.#k#n"); cm.dispose(); } } else if (status == 1) { if (selection == 1) { itemType = 1; var selStr = "Which piece of equipment would you like to buy?:\r\n"; for (var i = 0; i < items_sel1.length; i++){ selStr += "\r\n#b#L" + i + "##v" + items_sel1[i] + "# - " + items_name1[i] + " (" + items_price1[i] + " Vote Points)#l#k"; } cm.sendSimple(selStr); } else if (selection == 2) { itemType = 2; var selStr = "Which type of scroll would you like to buy?:\r\n"; for (var i = 0; i < items_sel2.length; i++){ selStr += "\r\n#b#L" + i + "##v" + items_sel2[i] + "# - " + items_name2[i] + " (" + items_price2[i] + " Vote Points)#l#k"; } cm.sendSimple(selStr); } else if (selection == 3) { itemType = 3; var selStr = "Which kind of misc items would you like to buy?:\r\n"; for (var i = 0; i < items_sel3.length; i++){ selStr += "\r\n#b#L" + i + "##v" + items_sel3[i] + "# - " + items_name3[i] + " (" + items_price3[i] + " Vote Points)#l#k"; } cm.sendSimple(selStr); } } else if (status == 2) { if (itemType == 1) { if (cm.canHold(items_sel1[selection]) && cm.getPlayer().getVPoints() >= items_price1[selection]) { cm.gainItem(items_sel1[selection], items_amount1[selection]); cm.getPlayer().gainVotePoints(-items_price1[selection]); cm.sendOk("Here is your #v" + items_sel1[selection] + "# - #b" + items_name1[selection] + "#k that you wanted."); cm.dispose(); } else { cm.sendOk("You don't have enough #rVote Points#k, or your #binventory#k is full."); cm.dispose(); } } else if (itemType == 2) { if (cm.canHold(items_sel2[selection]) && cm.getPlayer().getVPoints() >= items_price2[selection]) { cm.gainItem(items_sel2[selection], items_amount2[selection]); cm.getPlayer().gainVotePoints(-items_price2[selection]); cm.sendOk("Here is your #v" + items_sel2[selection] + "# - #b" + items_name2[selection] + "#k that you wanted."); cm.dispose(); } else { cm.sendOk("You don't have enough #rVote Points#k, or your #binventory#k is full."); cm.dispose(); } } else if (itemType == 3) { if (cm.canHold(items_sel3[selection]) && cm.getPlayer().getVPoints() >= items_price3[selection]) { cm.gainItem(items_sel3[selection], items_amount3[selection]); cm.getPlayer().gainVotePoints(-items_price3[selection]); cm.sendOk("Here is your #v" + items_sel3[selection] + "# - #b" + items_name3[selection] + "#k that you wanted."); cm.dispose(); } else { cm.sendOk("You don't have enough #rVote Points#k, or your #binventory#k is full."); cm.dispose(); } } } } }
var NAVTREEINDEX175 = { "classv8_1_1internal_1_1_representation.html#a8bdd97567badb1040967d90910c76c54":[2,0,4,3,1289,8], "classv8_1_1internal_1_1_representation.html#a8ebdb3d2ad2e45a01e769410bd620a3f":[2,0,4,3,1289,11], "classv8_1_1internal_1_1_representation.html#a9da652c4a0d3e474f8b63d50708b46ba":[2,0,4,3,1289,10], "classv8_1_1internal_1_1_representation.html#aa3102b9e553dd413919e704a5b87a94b":[2,0,4,3,1289,1], "classv8_1_1internal_1_1_representation.html#aa620b108401d1d5396ca2cf81e85614f":[2,0,4,3,1289,9], "classv8_1_1internal_1_1_representation.html#aa84e9e08d7aa134ade62588b6353aaeb":[2,0,4,3,1289,4], "classv8_1_1internal_1_1_representation.html#abaef99a9456e8483a633fe11f44120a1":[2,0,4,3,1289,2], "classv8_1_1internal_1_1_representation.html#ac049ab6968c584b7f4ba9c658cced439":[2,0,4,3,1289,33], "classv8_1_1internal_1_1_representation.html#ac7156db1ebfc0f35ccb1a4124eb737ba":[2,0,4,3,1289,37], "classv8_1_1internal_1_1_representation.html#ac8a2cfb3dfcc3de350878d2053ead07b":[2,0,4,3,1289,17], "classv8_1_1internal_1_1_representation.html#ad712acda7da188fb61f4dc29b1e2e84e":[2,0,4,3,1289,36], "classv8_1_1internal_1_1_representation.html#ae0d986f552a5162d65e3911fed62dea7":[2,0,4,3,1289,32], "classv8_1_1internal_1_1_representation.html#ae358bed6c0e672849eed8ae0dd4b1a7a":[2,0,4,3,1289,7], "classv8_1_1internal_1_1_representation.html#aec17726683c80ceb7ae27020989fe387":[2,0,4,3,1289,27], "classv8_1_1internal_1_1_representation.html#aed9c45adb3ed57098d2da98d58a1067f":[2,0,4,3,1289,29], "classv8_1_1internal_1_1_representation.html#af33b7e6c44778cfbf6bb44e4474d5444":[2,0,4,3,1289,30], "classv8_1_1internal_1_1_representation.html#af4a7edff455a74353207a4c2adfb81eb":[2,0,4,3,1289,16], "classv8_1_1internal_1_1_representation.html#af521417e0f8585ea25bb1355f3d1280e":[2,0,4,3,1289,19], "classv8_1_1internal_1_1_restore_registers_state_stub.html":[2,0,4,3,1290], "classv8_1_1internal_1_1_restore_registers_state_stub.html#a3c1b86a983b78ea56d2e1fb9631a3671":[2,0,4,3,1290,2], "classv8_1_1internal_1_1_restore_registers_state_stub.html#a3c1b86a983b78ea56d2e1fb9631a3671":[2,0,4,3,1290,0], "classv8_1_1internal_1_1_restore_registers_state_stub.html#a3c1b86a983b78ea56d2e1fb9631a3671":[2,0,4,3,1290,1], "classv8_1_1internal_1_1_restore_registers_state_stub.html#a3c1b86a983b78ea56d2e1fb9631a3671":[2,0,4,3,1290,3], "classv8_1_1internal_1_1_restore_registers_state_stub.html#a3c1b86a983b78ea56d2e1fb9631a3671":[2,0,4,3,1290,4], "classv8_1_1internal_1_1_restore_registers_state_stub.html#a713ec890992c39eb89c6334070f5dbe4":[2,0,4,3,1290,14], "classv8_1_1internal_1_1_restore_registers_state_stub.html#a713ec890992c39eb89c6334070f5dbe4":[2,0,4,3,1290,12], "classv8_1_1internal_1_1_restore_registers_state_stub.html#a713ec890992c39eb89c6334070f5dbe4":[2,0,4,3,1290,10], "classv8_1_1internal_1_1_restore_registers_state_stub.html#a713ec890992c39eb89c6334070f5dbe4":[2,0,4,3,1290,11], "classv8_1_1internal_1_1_restore_registers_state_stub.html#a713ec890992c39eb89c6334070f5dbe4":[2,0,4,3,1290,13], "classv8_1_1internal_1_1_restore_registers_state_stub.html#a9751fda44f5e25eefca3f6760f3c8918":[2,0,4,3,1290,18], "classv8_1_1internal_1_1_restore_registers_state_stub.html#a9751fda44f5e25eefca3f6760f3c8918":[2,0,4,3,1290,16], "classv8_1_1internal_1_1_restore_registers_state_stub.html#a9751fda44f5e25eefca3f6760f3c8918":[2,0,4,3,1290,17], "classv8_1_1internal_1_1_restore_registers_state_stub.html#a9751fda44f5e25eefca3f6760f3c8918":[2,0,4,3,1290,15], "classv8_1_1internal_1_1_restore_registers_state_stub.html#a9751fda44f5e25eefca3f6760f3c8918":[2,0,4,3,1290,19], "classv8_1_1internal_1_1_restore_registers_state_stub.html#ad6078d999bf4bc05859c3383b8b806f1":[2,0,4,3,1290,8], "classv8_1_1internal_1_1_restore_registers_state_stub.html#ad6078d999bf4bc05859c3383b8b806f1":[2,0,4,3,1290,9], "classv8_1_1internal_1_1_restore_registers_state_stub.html#ad6078d999bf4bc05859c3383b8b806f1":[2,0,4,3,1290,6], "classv8_1_1internal_1_1_restore_registers_state_stub.html#ad6078d999bf4bc05859c3383b8b806f1":[2,0,4,3,1290,7], "classv8_1_1internal_1_1_restore_registers_state_stub.html#ad6078d999bf4bc05859c3383b8b806f1":[2,0,4,3,1290,5], "classv8_1_1internal_1_1_resume_generator_descriptor.html":[2,0,4,3,1291], "classv8_1_1internal_1_1_return_statement.html":[2,0,4,3,1292], "classv8_1_1internal_1_1_return_statement.html#a4a6dd3b6b6300344a70d2d34a2dd091b":[2,0,4,3,1292,4], "classv8_1_1internal_1_1_return_statement.html#a51e5aae604a084b317ebe70c202b7213":[2,0,4,3,1292,2], "classv8_1_1internal_1_1_return_statement.html#a5a3b494130c4fd631d6faf3663df2487":[2,0,4,3,1292,0], "classv8_1_1internal_1_1_return_statement.html#a891568d43de201e4df67bdde91e11221":[2,0,4,3,1292,1], "classv8_1_1internal_1_1_return_statement.html#a8d587c8ad3515ff6433eb83c578e795f":[2,0,4,3,1292,3], "classv8_1_1internal_1_1_reverse_zone_chunk_list_iterator.html":[2,0,4,3,1293], "classv8_1_1internal_1_1_reverse_zone_chunk_list_iterator.html#a3448a344227e8fac9d00e37168dfb318":[2,0,4,3,1293,5], "classv8_1_1internal_1_1_reverse_zone_chunk_list_iterator.html#a36a36b8c0bd74e79d71770798d5f2a92":[2,0,4,3,1293,7], "classv8_1_1internal_1_1_reverse_zone_chunk_list_iterator.html#a6e3c9b845a0d9c051579af49885f52ef":[2,0,4,3,1293,0], "classv8_1_1internal_1_1_reverse_zone_chunk_list_iterator.html#a7fe954e20c8258bb429726849acf1c23":[2,0,4,3,1293,1], "classv8_1_1internal_1_1_reverse_zone_chunk_list_iterator.html#a8dae8d7c555cae31637404d17280fba1":[2,0,4,3,1293,6], "classv8_1_1internal_1_1_reverse_zone_chunk_list_iterator.html#abcb17401b05718f1df2b3aacbbf15a59":[2,0,4,3,1293,4], "classv8_1_1internal_1_1_reverse_zone_chunk_list_iterator.html#ac1803ae3f2069d0092794e3f2fedf296":[2,0,4,3,1293,2], "classv8_1_1internal_1_1_reverse_zone_chunk_list_iterator.html#ac3b44cd30495e7670c185c665bca9af8":[2,0,4,3,1293,3], "classv8_1_1internal_1_1_rewritable_expression.html":[2,0,4,3,1294], "classv8_1_1internal_1_1_rewritable_expression.html#a244c4f442fa983c0c88f4eeda74e381d":[2,0,4,3,1294,3], "classv8_1_1internal_1_1_rewritable_expression.html#a2744f514c195a457042541d64562ef50":[2,0,4,3,1294,6], "classv8_1_1internal_1_1_rewritable_expression.html#a59ae0e3ee6af36f097ecad45bc843ea5":[2,0,4,3,1294,1], "classv8_1_1internal_1_1_rewritable_expression.html#a88ff6c6975549f12cc5e0042e349d46d":[2,0,4,3,1294,8], "classv8_1_1internal_1_1_rewritable_expression.html#a8d587c8ad3515ff6433eb83c578e795f":[2,0,4,3,1294,7], "classv8_1_1internal_1_1_rewritable_expression.html#aca4c3679041d58021c38da0b73d9c96b":[2,0,4,3,1294,5], "classv8_1_1internal_1_1_rewritable_expression.html#ad4f7a87e8a2f648eb66b91a46f1f0d03":[2,0,4,3,1294,2], "classv8_1_1internal_1_1_rewritable_expression.html#ae9db2104adced6d17d8c56f0326532b9":[2,0,4,3,1294,4], "classv8_1_1internal_1_1_rewritable_expression_1_1_is_rewritten_field.html":[2,0,4,3,1294,0], "classv8_1_1internal_1_1_rewriter.html":[2,0,4,3,1295], "classv8_1_1internal_1_1_rewriter.html#a6988dcedbc6c2adadf310f7802ebd3ce":[2,0,4,3,1295,0], "classv8_1_1internal_1_1_rewriter.html#af9c4c58fb19a6a5bb4ef7b2dd819f830":[2,0,4,3,1295,1], "classv8_1_1internal_1_1_root_index_map.html":[2,0,4,3,1299], "classv8_1_1internal_1_1_root_index_map.html#a0f3fe203b3cf5fbd0d8add808f8954a1":[2,0,4,3,1299,3], "classv8_1_1internal_1_1_root_index_map.html#a5d37f5877736681ac5aaef61eb0aa4a6":[2,0,4,3,1299,2], "classv8_1_1internal_1_1_root_index_map.html#a9536a6e36f64916b6af65519b9a5a34c":[2,0,4,3,1299,0], "classv8_1_1internal_1_1_root_index_map.html#ac5e798dc77b929f93f0bb9eeb0ac03bb":[2,0,4,3,1299,1], "classv8_1_1internal_1_1_root_index_map.html#afdb0b26d103c9b1a216c397eef4b2036":[2,0,4,3,1299,4], "classv8_1_1internal_1_1_root_marking_visitor.html":[2,0,4,3,1300], "classv8_1_1internal_1_1_root_marking_visitor.html#a0b3260ab3505983f7f52676c17c3b07c":[2,0,4,3,1300,1], "classv8_1_1internal_1_1_root_marking_visitor.html#a1a5183388b56f8b1621b60d99371bfe2":[2,0,4,3,1300,2], "classv8_1_1internal_1_1_root_marking_visitor.html#a21e6234aa950a518f1203def466b282f":[2,0,4,3,1300,0], "classv8_1_1internal_1_1_root_marking_visitor.html#a4a8ecb699b8539527b8c522fd230d856":[2,0,4,3,1300,4], "classv8_1_1internal_1_1_root_marking_visitor.html#ad2dfe31ddf24c16c5c487097e67058fa":[2,0,4,3,1300,3], "classv8_1_1internal_1_1_root_marking_visitor.html#adbc5085dc2b381b96d026711301819d2":[2,0,4,3,1300,5], "classv8_1_1internal_1_1_roots_references_extractor.html":[2,0,4,3,1301], "classv8_1_1internal_1_1_roots_references_extractor.html#a004387f9540cabce47f012a85a4ee995":[2,0,4,3,1301,2], "classv8_1_1internal_1_1_roots_references_extractor.html#a1648fc0aeda45c93c1dacf2da30fa7c4":[2,0,4,3,1301,6], "classv8_1_1internal_1_1_roots_references_extractor.html#a1a7039b973b111225846657f3aa56b31":[2,0,4,3,1301,4], "classv8_1_1internal_1_1_roots_references_extractor.html#a1da9887407b871a2f36b19df9da52b8f":[2,0,4,3,1301,8], "classv8_1_1internal_1_1_roots_references_extractor.html#a4237eeeb566916510350ada117372a89":[2,0,4,3,1301,3], "classv8_1_1internal_1_1_roots_references_extractor.html#a4bffc460538c9fbbd6f15287525d7cce":[2,0,4,3,1301,5], "classv8_1_1internal_1_1_roots_references_extractor.html#a665fc601c7e49d3c422667a6d2c54d4b":[2,0,4,3,1301,11], "classv8_1_1internal_1_1_roots_references_extractor.html#a72b077dd04d0f341dc7b47d82a7bd1cd":[2,0,4,3,1301,10], "classv8_1_1internal_1_1_roots_references_extractor.html#a8a469f4dd6faa17eb183aa6f3db9105a":[2,0,4,3,1301,7], "classv8_1_1internal_1_1_roots_references_extractor.html#aa308690325e06f682cfb79f3279b7ef6":[2,0,4,3,1301,1], "classv8_1_1internal_1_1_roots_references_extractor.html#ad55d37e87230023a8496c93bf9e522d2":[2,0,4,3,1301,9], "classv8_1_1internal_1_1_runtime.html":[2,0,4,3,1308], "classv8_1_1internal_1_1_runtime.html#a0992be0188c64085327b7dfbadb43b5b":[2,0,4,3,1308,11], "classv8_1_1internal_1_1_runtime.html#a10d124df53f096f5ae5190f8bfa23c33":[2,0,4,3,1308,5], "classv8_1_1internal_1_1_runtime.html#a15cd342f4d259e6ca8751f01bf7915be":[2,0,4,3,1308,13], "classv8_1_1internal_1_1_runtime.html#a160c8a6a276c94cdc522483e36c2347b":[2,0,4,3,1308,9], "classv8_1_1internal_1_1_runtime.html#a1fb4256645450f73e9ee39d4f38f3d58":[2,0,4,3,1308,7], "classv8_1_1internal_1_1_runtime.html#a258472be83131d3137616a91f3a8f383":[2,0,4,3,1308,10], "classv8_1_1internal_1_1_runtime.html#a4306a0f19fefa0f2f97dd220dc9d7345":[2,0,4,3,1308,12], "classv8_1_1internal_1_1_runtime.html#a4894a14ef5a1474a7a736c55770fbee3":[2,0,4,3,1308,4], "classv8_1_1internal_1_1_runtime.html#a80bc0fbf6603396cf71c90d7f40b4ece":[2,0,4,3,1308,3], "classv8_1_1internal_1_1_runtime.html#a80bc0fbf6603396cf71c90d7f40b4ecea0f262676652fd5e860964cbc41ae98b7":[2,0,4,3,1308,3,0], "classv8_1_1internal_1_1_runtime.html#a80bc0fbf6603396cf71c90d7f40b4ecea2475d27026d03058e313f8759ca6bdeb":[2,0,4,3,1308,3,7], "classv8_1_1internal_1_1_runtime.html#a80bc0fbf6603396cf71c90d7f40b4ecea2f096ec214305c884fa26f55154f3be6":[2,0,4,3,1308,3,1], "classv8_1_1internal_1_1_runtime.html#a80bc0fbf6603396cf71c90d7f40b4ecea3644178b0ac36b52358f5b0cef3623c0":[2,0,4,3,1308,3,3], "classv8_1_1internal_1_1_runtime.html#a80bc0fbf6603396cf71c90d7f40b4ecea3fa0a75df9f8471116500732c1a7c8b4":[2,0,4,3,1308,3,8], "classv8_1_1internal_1_1_runtime.html#a80bc0fbf6603396cf71c90d7f40b4ecea5ba6e1c0addba3c224cdd99d419e820b":[2,0,4,3,1308,3,5], "classv8_1_1internal_1_1_runtime.html#a80bc0fbf6603396cf71c90d7f40b4ecea859de430ab8185f8087051d7afd9e8b4":[2,0,4,3,1308,3,4], "classv8_1_1internal_1_1_runtime.html#a80bc0fbf6603396cf71c90d7f40b4ecead859a9098cd14847a274424398cbed80":[2,0,4,3,1308,3,9], "classv8_1_1internal_1_1_runtime.html#a80bc0fbf6603396cf71c90d7f40b4eceadb150fe46550ea536aed52891dafaa2e":[2,0,4,3,1308,3,2], "classv8_1_1internal_1_1_runtime.html#a80bc0fbf6603396cf71c90d7f40b4eceadbd3d179cdccf84c1357ae06109d4ff2":[2,0,4,3,1308,3,6], "classv8_1_1internal_1_1_runtime.html#a80bc0fbf6603396cf71c90d7f40b4eceafbd936974f4b7f05b871c4b79bbe1eb1":[2,0,4,3,1308,3,10], "classv8_1_1internal_1_1_runtime.html#a82e21040bb88fd62e811b273d9592b62":[2,0,4,3,1308,6], "classv8_1_1internal_1_1_runtime.html#a9794fd24ae9e4731fe6679eca11fef02":[2,0,4,3,1308,2], "classv8_1_1internal_1_1_runtime.html#a9794fd24ae9e4731fe6679eca11fef02a231f985561c8f611c46039d680f7e1a1":[2,0,4,3,1308,2,1], "classv8_1_1internal_1_1_runtime.html#a9794fd24ae9e4731fe6679eca11fef02a90a8bcb2a3d229248affb95972dfe6dd":[2,0,4,3,1308,2,0], "classv8_1_1internal_1_1_runtime.html#abc83b23b198d9aa173abb13a25a7b670":[2,0,4,3,1308,1], "classv8_1_1internal_1_1_runtime.html#abc83b23b198d9aa173abb13a25a7b670a4b250fab00a790faa0647aee634ebc62":[2,0,4,3,1308,1,0], "classv8_1_1internal_1_1_runtime.html#afa94bb5dc5507bd0ee93dc9a6f6bfd5a":[2,0,4,3,1308,8], "classv8_1_1internal_1_1_runtime_call_counter.html":[2,0,4,3,1309], "classv8_1_1internal_1_1_runtime_call_counter.html#a034316a1effc903cfdc879346120aec5":[2,0,4,3,1309,6], "classv8_1_1internal_1_1_runtime_call_counter.html#a209f13b0f66fd27c7c67b8fbbfdfd4b7":[2,0,4,3,1309,9], "classv8_1_1internal_1_1_runtime_call_counter.html#a48c6a05b717e56fd43adfc010a3302d6":[2,0,4,3,1309,11], "classv8_1_1internal_1_1_runtime_call_counter.html#a5286a92165de8924b590c27a297992a8":[2,0,4,3,1309,10], "classv8_1_1internal_1_1_runtime_call_counter.html#a8e1fda9c575d7f6d1cd346ae0e955f5d":[2,0,4,3,1309,1], "classv8_1_1internal_1_1_runtime_call_counter.html#a917668c08bc5ae20336fe6fa0e0bb339":[2,0,4,3,1309,5], "classv8_1_1internal_1_1_runtime_call_counter.html#aa99f6280e0ffc577c15b50d1619cf567":[2,0,4,3,1309,8], "classv8_1_1internal_1_1_runtime_call_counter.html#aaf750c3b15af87b2af841f75dbaa46c9":[2,0,4,3,1309,7], "classv8_1_1internal_1_1_runtime_call_counter.html#ac978b473b5542a9b0ab654995eac681c":[2,0,4,3,1309,4], "classv8_1_1internal_1_1_runtime_call_counter.html#ae5e6920c0135add28d04027b34923536":[2,0,4,3,1309,3], "classv8_1_1internal_1_1_runtime_call_counter.html#ae6fd918d026a8906f964a0c35c000634":[2,0,4,3,1309,0], "classv8_1_1internal_1_1_runtime_call_counter.html#aefcce919931873d73c67587d5452ebd1":[2,0,4,3,1309,2], "classv8_1_1internal_1_1_runtime_call_helper.html":[2,0,4,3,1310], "classv8_1_1internal_1_1_runtime_call_helper.html#a21d0ed8460dc804f5bbad201c754d910":[2,0,4,3,1310,3], "classv8_1_1internal_1_1_runtime_call_helper.html#a5b1a2f7263e26c9f9dd4b23b7fe2c85c":[2,0,4,3,1310,1], "classv8_1_1internal_1_1_runtime_call_helper.html#a7daf7a8b51c777609629263eff426bf3":[2,0,4,3,1310,0], "classv8_1_1internal_1_1_runtime_call_helper.html#ad81012450b2fd3bf223fb08dd3901277":[2,0,4,3,1310,2], "classv8_1_1internal_1_1_runtime_call_helper.html#afc71ce25a9a0f2cbef7e14b9d25bebb5":[2,0,4,3,1310,4], "classv8_1_1internal_1_1_runtime_call_stat_entries.html":[2,0,4,3,1311], "classv8_1_1internal_1_1_runtime_call_stat_entries.html#a149ab440d33ed89a34548c342e86682e":[2,0,4,3,1311,3], "classv8_1_1internal_1_1_runtime_call_stat_entries.html#a1ae3b28f101bbb4800b6a9b04e2d942e":[2,0,4,3,1311,1], "classv8_1_1internal_1_1_runtime_call_stat_entries.html#a83b50921e62d21aaeab9b78b8a623843":[2,0,4,3,1311,2], "classv8_1_1internal_1_1_runtime_call_stat_entries.html#ab69d909cbeb80396cc7de4f249dbfff7":[2,0,4,3,1311,5], "classv8_1_1internal_1_1_runtime_call_stat_entries.html#ad91ba707c910c5200a1b5f885387a0e4":[2,0,4,3,1311,4], "classv8_1_1internal_1_1_runtime_call_stat_entries_1_1_entry.html":[2,0,4,3,1311,0], "classv8_1_1internal_1_1_runtime_call_stat_entries_1_1_entry.html#a1000e45a41319a6baae3d0c2b7cdfc69":[2,0,4,3,1311,0,8], "classv8_1_1internal_1_1_runtime_call_stat_entries_1_1_entry.html#a15032e568e2a3f097a214c7d2d69dc24":[2,0,4,3,1311,0,7], "classv8_1_1internal_1_1_runtime_call_stat_entries_1_1_entry.html#a2dba5b56d5bb9c0e48357768bb45459b":[2,0,4,3,1311,0,3], "classv8_1_1internal_1_1_runtime_call_stat_entries_1_1_entry.html#a58f3fce4257495435232b83fdc1be916":[2,0,4,3,1311,0,2], "classv8_1_1internal_1_1_runtime_call_stat_entries_1_1_entry.html#a6616bbc770bfc8402c9d30f141b883bc":[2,0,4,3,1311,0,4], "classv8_1_1internal_1_1_runtime_call_stat_entries_1_1_entry.html#ab82c161218904762a605a58c7c144699":[2,0,4,3,1311,0,6], "classv8_1_1internal_1_1_runtime_call_stat_entries_1_1_entry.html#ac645b93689148bba7fc42f160eaaa4a1":[2,0,4,3,1311,0,1], "classv8_1_1internal_1_1_runtime_call_stat_entries_1_1_entry.html#ae0820b8e276f79a103ff38bf2b7d60dd":[2,0,4,3,1311,0,5], "classv8_1_1internal_1_1_runtime_call_stat_entries_1_1_entry.html#aeb266e95c5a69b6de8906e852e0b9757":[2,0,4,3,1311,0,0], "classv8_1_1internal_1_1_runtime_call_stats.html":[2,0,4,3,1312], "classv8_1_1internal_1_1_runtime_call_stats.html#a0caa1985c73712d7e45190c4b2e5a0f4":[2,0,4,3,1312,9], "classv8_1_1internal_1_1_runtime_call_stats.html#a13295a5bf3d58ab08933503ba79acde3":[2,0,4,3,1312,5], "classv8_1_1internal_1_1_runtime_call_stats.html#a1aa3658677f11673b957dee8c023987c":[2,0,4,3,1312,14], "classv8_1_1internal_1_1_runtime_call_stats.html#a252181187593e10449b196fa2f455619":[2,0,4,3,1312,1], "classv8_1_1internal_1_1_runtime_call_stats.html#a3d81f01ffd85643d06f0f95fd0cce5ac":[2,0,4,3,1312,13], "classv8_1_1internal_1_1_runtime_call_stats.html#a4d1df8cba3e9c99393ce2e0be9b41ebd":[2,0,4,3,1312,7], "classv8_1_1internal_1_1_runtime_call_stats.html#a5ab1885fca546b455327d37684548af8":[2,0,4,3,1312,8], "classv8_1_1internal_1_1_runtime_call_stats.html#a659d61130dd2fdb77e0108baef5b632c":[2,0,4,3,1312,3], "classv8_1_1internal_1_1_runtime_call_stats.html#a9504593121f4cc0206c4768a9a055bb1":[2,0,4,3,1312,12], "classv8_1_1internal_1_1_runtime_call_stats.html#a9c1851ba664ce8878d40c2777d9bcc1b":[2,0,4,3,1312,4], "classv8_1_1internal_1_1_runtime_call_stats.html#ab058d39c32704ceb58055dbb3e81db58":[2,0,4,3,1312,10], "classv8_1_1internal_1_1_runtime_call_stats.html#ab677440177dddcf39917a2a0179c0752":[2,0,4,3,1312,6], "classv8_1_1internal_1_1_runtime_call_stats.html#ae51f989c1ed46b98bb92b62c970f859d":[2,0,4,3,1312,11], "classv8_1_1internal_1_1_runtime_call_stats.html#aef9856b5e2d6ef1b6bd62a1855cc852e":[2,0,4,3,1312,2], "classv8_1_1internal_1_1_runtime_call_stats.html#afde42e7790922a3d0efbb6b19fd2f5b5":[2,0,4,3,1312,0], "classv8_1_1internal_1_1_runtime_call_timer.html":[2,0,4,3,1313], "classv8_1_1internal_1_1_runtime_call_timer.html#a0ce39901320f3e8a9eda9c177f2430ff":[2,0,4,3,1313,14], "classv8_1_1internal_1_1_runtime_call_timer.html#a12d402530f324e001f7c3ece911bb10a":[2,0,4,3,1313,11], "classv8_1_1internal_1_1_runtime_call_timer.html#a28c59965e00446c32a0cd3f6c4d648ce":[2,0,4,3,1313,8], "classv8_1_1internal_1_1_runtime_call_timer.html#a2a9bf65370ce4d9ebc298661c7ec9d66":[2,0,4,3,1313,2], "classv8_1_1internal_1_1_runtime_call_timer.html#a51be5718ba4a60eb1c64ac3ba31731dc":[2,0,4,3,1313,6], "classv8_1_1internal_1_1_runtime_call_timer.html#a538f2357f3e47fe2d0c9df48d527aeba":[2,0,4,3,1313,16], "classv8_1_1internal_1_1_runtime_call_timer.html#a58c33415c0c7956e8a166f0b85e95448":[2,0,4,3,1313,1], "classv8_1_1internal_1_1_runtime_call_timer.html#a7324817011df759993447a92d53a6d45":[2,0,4,3,1313,9], "classv8_1_1internal_1_1_runtime_call_timer.html#a9919952ea2d52a9de0a90205280fe73f":[2,0,4,3,1313,7], "classv8_1_1internal_1_1_runtime_call_timer.html#aa98cb1932b21e6615fca4b57e2e72007":[2,0,4,3,1313,15], "classv8_1_1internal_1_1_runtime_call_timer.html#ab1ca5bf8d47c1a516324d12d69ad2ced":[2,0,4,3,1313,0], "classv8_1_1internal_1_1_runtime_call_timer.html#ab79975e763cd537259ecf6f264786c9f":[2,0,4,3,1313,5], "classv8_1_1internal_1_1_runtime_call_timer.html#ac1919ebae231974bffbfe0bce3b1c376":[2,0,4,3,1313,12], "classv8_1_1internal_1_1_runtime_call_timer.html#ac6d6044b1054c5cc149f8db80551717e":[2,0,4,3,1313,3], "classv8_1_1internal_1_1_runtime_call_timer.html#ad79fa0491fee61ec06d69724910479d4":[2,0,4,3,1313,4], "classv8_1_1internal_1_1_runtime_call_timer.html#adbf5c746af5c1bb144482ad3fe31769b":[2,0,4,3,1313,13], "classv8_1_1internal_1_1_runtime_call_timer.html#af11006ce3ef185eab342a1c5e73b2773":[2,0,4,3,1313,10], "classv8_1_1internal_1_1_runtime_call_timer_scope.html":[2,0,4,3,1314], "classv8_1_1internal_1_1_runtime_call_timer_scope.html#a0fd4028f98fa83a94e3acf1e2ea277f7":[2,0,4,3,1314,1], "classv8_1_1internal_1_1_runtime_call_timer_scope.html#a38986d9f8a7253e03e191c5ea4419295":[2,0,4,3,1314,4], "classv8_1_1internal_1_1_runtime_call_timer_scope.html#a4299110d2a7186c8546ec1a61353d845":[2,0,4,3,1314,3], "classv8_1_1internal_1_1_runtime_call_timer_scope.html#a496cec5ddec1ac4d8311e48ca77d9534":[2,0,4,3,1314,5], "classv8_1_1internal_1_1_runtime_call_timer_scope.html#a53f45ba6fccbc55b65831049a059fcec":[2,0,4,3,1314,6], "classv8_1_1internal_1_1_runtime_call_timer_scope.html#a9f7f6b7486ea3a1569ea9391f14c91bc":[2,0,4,3,1314,0], "classv8_1_1internal_1_1_runtime_call_timer_scope.html#acdd046d9b1d4a06740d9fe79c59c8de3":[2,0,4,3,1314,2], "classv8_1_1internal_1_1_runtime_profiler.html":[2,0,4,3,1315], "classv8_1_1internal_1_1_runtime_profiler.html#a12296988b9d6809b31c7f96fb774fee8":[2,0,4,3,1315,7], "classv8_1_1internal_1_1_runtime_profiler.html#a1953dfce58c78e2f4c9e136b08cbfa8d":[2,0,4,3,1315,0], "classv8_1_1internal_1_1_runtime_profiler.html#a294118034ac5c9e7664f188f6554a43e":[2,0,4,3,1315,11], "classv8_1_1internal_1_1_runtime_profiler.html#a3ca2e64852e116ab3324706f2096cd08":[2,0,4,3,1315,10], "classv8_1_1internal_1_1_runtime_profiler.html#a7042aad3e56791da1a2015e98fb1f25a":[2,0,4,3,1315,9], "classv8_1_1internal_1_1_runtime_profiler.html#a7b832e8d7112b3aabf3cf31eca112da6":[2,0,4,3,1315,5], "classv8_1_1internal_1_1_runtime_profiler.html#a89420d1ba12ed250fa01eaee98ad4bd4":[2,0,4,3,1315,2], "classv8_1_1internal_1_1_runtime_profiler.html#a9b44870acbaf140a44bb8261a055d592":[2,0,4,3,1315,8], "classv8_1_1internal_1_1_runtime_profiler.html#a9b971bcdc311199571e8b9ce2e9ee3e6":[2,0,4,3,1315,3], "classv8_1_1internal_1_1_runtime_profiler.html#ac23b0ae7d2d64582a66127b73dcf6366":[2,0,4,3,1315,6], "classv8_1_1internal_1_1_runtime_profiler.html#ac602108d337bcc51b050d300a78862c3":[2,0,4,3,1315,1], "classv8_1_1internal_1_1_runtime_profiler.html#ad2b997823bdf93e8a9aa02b523e2573d":[2,0,4,3,1315,4], "classv8_1_1internal_1_1_runtime_profiler.html#af6fdad5f51136a2be887f839b8899a9d":[2,0,4,3,1315,12], "classv8_1_1internal_1_1_runtime_state.html":[2,0,4,3,1316], "classv8_1_1internal_1_1_runtime_state.html#a0900a871ae77f8335ba2a6c03e426fc6":[2,0,4,3,1316,2], "classv8_1_1internal_1_1_runtime_state.html#a1a2246eae484a21797d253b65f0c7d11":[2,0,4,3,1316,9], "classv8_1_1internal_1_1_runtime_state.html#a236e4b62dd61be2092a2b1bba415136b":[2,0,4,3,1316,3], "classv8_1_1internal_1_1_runtime_state.html#a31df14139578311cfae033cf351fa3be":[2,0,4,3,1316,10], "classv8_1_1internal_1_1_runtime_state.html#a56f5f84f2cdad0b5b4332a27f8db60b6":[2,0,4,3,1316,5], "classv8_1_1internal_1_1_runtime_state.html#a572660fd6383cd2e7cdd7a6c7cf44dc0":[2,0,4,3,1316,8], "classv8_1_1internal_1_1_runtime_state.html#a6dd5a68c08900be611ad8ac2acd41d4e":[2,0,4,3,1316,0], "classv8_1_1internal_1_1_runtime_state.html#a93ae0cde56b5f23a3efdb4ad7d12ef23":[2,0,4,3,1316,4], "classv8_1_1internal_1_1_runtime_state.html#aba4f0964bdacf2bbf62cf876e5d28d0a":[2,0,4,3,1316,6], "classv8_1_1internal_1_1_runtime_state.html#af3d14e26ba8af9e6cc5a32aad8446de7":[2,0,4,3,1316,7], "classv8_1_1internal_1_1_runtime_state.html#af811c9fa78fcea5b370d6b229d068517":[2,0,4,3,1316,1], "classv8_1_1internal_1_1_s_c_table_reference.html":[2,0,4,3,1342], "classv8_1_1internal_1_1_s_c_table_reference.html#a24ed0ed0695568aae6c7cae653e35c27":[2,0,4,3,1342,1], "classv8_1_1internal_1_1_s_c_table_reference.html#a3d27c68aadf4366d32e8391634559250":[2,0,4,3,1342,0], "classv8_1_1internal_1_1_s_c_table_reference.html#a9dd0864bf7d020620606b5f3e1a0452f":[2,0,4,3,1342,2], "classv8_1_1internal_1_1_s_c_table_reference.html#adda6883a1d47763a5ba23dda0edf6e4f":[2,0,4,3,1342,3], "classv8_1_1internal_1_1_s_i_instruction.html":[2,0,4,3,1369], "classv8_1_1internal_1_1_s_i_instruction.html#a1d096b82577a730a6842334f665f229e":[2,0,4,3,1369,2], "classv8_1_1internal_1_1_s_i_instruction.html#a6f4d771b25dd6928997c5a581953cae0":[2,0,4,3,1369,0], "classv8_1_1internal_1_1_s_i_instruction.html#a7c9bea0a3b95b1f0a660a21469da9b52":[2,0,4,3,1369,1], "classv8_1_1internal_1_1_s_i_instruction.html#aee4d4b264f2e1e535476800c3d1c7ada":[2,0,4,3,1369,3], "classv8_1_1internal_1_1_s_i_l_instruction.html":[2,0,4,3,1370], "classv8_1_1internal_1_1_s_i_l_instruction.html#a07acb906c257e59b6328015c04dcd2c0":[2,0,4,3,1370,1], "classv8_1_1internal_1_1_s_i_l_instruction.html#a574b4db9fe6bc125dd10fb1367fc0836":[2,0,4,3,1370,0], "classv8_1_1internal_1_1_s_i_l_instruction.html#a661e9a75251321b728e205cba3a159f2":[2,0,4,3,1370,2], "classv8_1_1internal_1_1_s_i_l_instruction.html#aac7e17d8ce5143c1c1c881da98675423":[2,0,4,3,1370,3], "classv8_1_1internal_1_1_s_i_y_instruction.html":[2,0,4,3,1377], "classv8_1_1internal_1_1_s_i_y_instruction.html#a203f04ba91159b11c5176020de36119d":[2,0,4,3,1377,0], "classv8_1_1internal_1_1_s_i_y_instruction.html#a26d8e826e8f0b00c148fbeff65c32939":[2,0,4,3,1377,1], "classv8_1_1internal_1_1_s_i_y_instruction.html#aecfe00b46e51ce260d5ccd6879cf6d48":[2,0,4,3,1377,3], "classv8_1_1internal_1_1_s_i_y_instruction.html#af6730b803d5eab823cd4b40121b08ba7":[2,0,4,3,1377,2], "classv8_1_1internal_1_1_s_s_instruction.html":[2,0,4,3,1405], "classv8_1_1internal_1_1_s_s_instruction.html#a750d3d7833863b90a4ce2b51400ec6fb":[2,0,4,3,1405,1], "classv8_1_1internal_1_1_s_s_instruction.html#a7c31c65767f458ade9869830a3d4f90f":[2,0,4,3,1405,3], "classv8_1_1internal_1_1_s_s_instruction.html#aa8ba55ac7531e140a49128c39a2f454b":[2,0,4,3,1405,4], "classv8_1_1internal_1_1_s_s_instruction.html#ac39352f4d10ce07a84e3feb58dc829ee":[2,0,4,3,1405,0], "classv8_1_1internal_1_1_s_s_instruction.html#ae56ecc570de5fa89909efe17c686bb98":[2,0,4,3,1405,2] };
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* 'Super' model which is extended for individual models. */ /* */ /* Assumes table names are identical to model names, and primary key names are table name + 'Id'. */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ import Debug from 'debug'; // small debugging utility const debug = Debug('app:db'); // debug db updates import Db from '../lib/mysqldb.js'; import ModelError from './modelerror.js'; class SuperModel { /** * Returns object details (convenience wrapper for single object details). * * @param {string} model - Model / table name. * @param {number} id - Object id. * @returns {Object} Object details or undefined if not found. */ static async get(model, id) { const sql = `Select * From ${model} Where ${model}Id = :id`; const [ [ object ] ] = await Db.execute(sql, { id }); return object; } /** * Returns Objects with given field matching given value (convenience wrapper for simple filter); * note any sorting would have to be done in JavaScript. * * @param {string} model - Model / table name. * @param {string} field - Field to be matched. * @param {string!number} value - Value to match against field. * @returns {Object[]} Object's details. */ static async getBy(model, field, value) { try { const sql = `Select * From ${model} Where ${field} = :${field}`; const [ objects ] = await Db.execute(sql, { [field]: value }); return objects; } catch (e) { switch (e.code) { case 'ER_BAD_FIELD_ERROR': // 1054 unknown column throw new ModelError(403, `Unrecognised ${model} field ${field}`); default: console.error(`${model}.getBy`, e); throw new ModelError(500, e.message); } } } /** * Creates new record. * * @param {string} model - Model / table name. * @param {Object} values - Object details. * @param {Object} [connection] - Connection to use (e.g. within transaction); otherwise from pool. * @returns {number} New object id. * @throws Error on validation or referential integrity errors. */ static async insert(model, values, connection=undefined) { debug(`${model}.insert`, Object.keys(values).join(', ').slice(0, 48)+(Object.keys(values).join(', ').length>48?'...':'')); try { const [ result ] = await Db.query(`Insert Into ${model} Set ?`, [ values ], connection); // TODO: use execute once available: https://github.com/sidorares/node-mysql2/issues/756 return result.insertId; } catch (e) { switch (e.code) { // just use default MySQL messages for now case 'ER_BAD_NULL_ERROR': // 1048 column cannot be null case 'ER_NO_REFERENCED_ROW': // 1216 foreign key constraint fails case 'ER_NO_REFERENCED_ROW_2': // 1452 foreign key constraint fails case 'ER_NO_DEFAULT_FOR_FIELD': // 1364 field doesn't have a default value throw new ModelError(403, e.message); // Forbidden case 'ER_DUP_ENTRY': // 1062 duplicate entry throw new ModelError(409, e.message); // Conflict case 'ER_BAD_FIELD_ERROR': // 1054 unknown column throw new ModelError(500, e.message); // Internal Server Error for programming errors default: console.error(`${model}.insert`, e); throw new ModelError(500, e.message); // Internal Server Error for uncaught exception } } } /** * Replaces record or inserts new record. * * @param {string} model - Model / table name. * @param {Object} values - Object details. * @param {Object} [connection] - Connection to use (e.g. within transaction); otherwise from pool. * @returns {number} New object id. * @throws Error on validation or referential integrity errors. */ static async replace(model, values, connection=undefined) { debug(`${model}.value`, Object.keys(values).join(', ').slice(0, 48)+(Object.keys(values).join(', ').length>48?'...':'')); try { const [ result ] = await Db.query(`Replace Into ${model} Set ?`, [ values ], connection); // TODO: use execute once available: https://github.com/sidorares/node-mysql2/issues/756 return result.insertId; } catch (e) { switch (e.code) { // just use default MySQL messages for now case 'ER_BAD_NULL_ERROR': // 1048 column cannot be null case 'ER_NO_REFERENCED_ROW': // 1216 foreign key constraint fails case 'ER_NO_REFERENCED_ROW_2': // 1452 foreign key constraint fails case 'ER_NO_DEFAULT_FOR_FIELD': // 1364 field doesn't have a default value throw new ModelError(403, e.message); // Forbidden case 'ER_BAD_FIELD_ERROR': // 1054 unknown column throw new ModelError(500, e.message); // Internal Server Error for programming errors default: console.error(`${model}.value`, e); throw new ModelError(500, e.message); // Internal Server Error for uncaught exception } } } /** * Update Object details. * * @param {string} model - Model / table name. * @param {number} id - Object id. * @param {Object} values - Object details. * @param {Object} [connection] - Connection to use (e.g. within transaction); otherwise from pool. * @throws Error on validation or referential integrity errors. */ static async update(model, id, values, connection=undefined) { debug(`${model}.update`, id, Object.keys(values).join(', ').slice(0, 48)+(Object.keys(values).join(', ').length>48?'...':'')); try { await Db.query(`Update ${model} Set ? Where ${model}Id = ?`, [ values, id ], connection); // TODO: use execute once available: https://github.com/sidorares/node-mysql2/issues/756 } catch (e) { switch (e.code) { // just use default MySQL messages for now case 'ER_BAD_NULL_ERROR': // 1048 column cannot be null case 'ER_DUP_ENTRY': // 1062 duplicate entry case 'ER_NO_REFERENCED_ROW': // 1216 foreign key constraint fails case 'ER_ROW_IS_REFERENCED': // 1217 foreign key constraint fails case 'ER_ROW_IS_REFERENCED_2': // 1451 foreign key constraint fails case 'ER_NO_REFERENCED_ROW_2': // 1452 foreign key constraint fails throw new ModelError(403, `‘${model}’ ${e.message}`); // Forbidden case 'ER_BAD_FIELD_ERROR': throw new ModelError(500, `‘${model}’ ${e.message}`); // Internal Server Error for programming errors default: console.error(`${model}.update`, e); throw new ModelError(500, `‘${model}’ ${e.message}`); // Internal Server Error for uncaught exception } } } /** * Delete Object record. * * @param {string} model - Model / table name. * @param {number} id - Object id. * @param {Object} [connection] - Connection to use (e.g. within transaction); otherwise from pool. * @throws Error on referential integrity errors. */ static async delete(model, id, connection=undefined) { debug(`${model}.delete`, id); try { await Db.execute(`Delete From ${model} Where ${model}Id = :id`, { id }, connection); return true; // helps tests! } catch (e) { switch (e.code) { case 'ER_ROW_IS_REFERENCED': // 1217 foreign key constraint fails case 'ER_ROW_IS_REFERENCED_2': // 1451 foreign key constraint fails throw new ModelError(403, `${model} has dependent record(s)`); // Forbidden default: console.error(`${model}.delete`, e); throw new ModelError(500, e.message); // Internal Server Error } } } /** * Delete Object record on specified condition - useful for deleting related (1:n) records. * * @param {string} model - Model / table name. * @param {string} field - Field condition is to be applied to. * @param {number} id - Object id. * @param {Object} [connection] - Connection to use (e.g. within transaction); otherwise from pool. * @throws Error on referential integrity errors. */ static async deleteWhere(model, field, id, connection=undefined) { debug(`${model}.deleteWhere`, field, id); try { await Db.execute(`Delete From ${model} Where ${field} = :id`, { id }, connection); return true; // helps tests! } catch (e) { switch (e.code) { case 'ER_ROW_IS_REFERENCED': // 1217 foreign key constraint fails case 'ER_ROW_IS_REFERENCED_2': // 1451 foreign key constraint fails throw new ModelError(403, `${model} has dependent record(s)`); // Forbidden default: console.error(`${model}.delete`, e); throw new ModelError(500, e.message); // Internal Server Error } } } } // Note errors 1451:ER_ROW_IS_REFERENCED_2 & 1452:ER_NO_REFERENCED_ROW_2 replaced errors // 1216:ER_NO_REFERENCED_ROW & 1217:ER_ROW_IS_REFERENCED in MySQL 5.0.14 (2005) /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ export default SuperModel;
import { select as d3_select } from 'd3-selection'; import { geoMetersToLat, geoMetersToLon } from '@id-sdk/math'; import { utilArrayIntersection, utilArrayUnion, utilDeepMemberSelector, utilEntityOrDeepMemberSelector, utilEntitySelector, utilGetAllNodes } from '@id-sdk/util'; import { t } from '../core/localizer'; import { actionAddMidpoint } from '../actions/add_midpoint'; import { actionDeleteRelation } from '../actions/delete_relation'; import { actionMove } from '../actions/move'; import { actionScale } from '../actions/scale'; import { behaviorBreathe } from '../behavior/breathe'; import { behaviorHover } from '../behavior/hover'; import { behaviorLasso } from '../behavior/lasso'; import { behaviorPaste } from '../behavior/paste'; import { behaviorSelect } from '../behavior/select'; import { operationMove } from '../operations/move'; import { prefs } from '../core/preferences'; import { geoChooseEdge } from '../geo'; import { modeBrowse } from './browse'; import { modeDragNode } from './drag_node'; import { modeDragNote } from './drag_note'; import { osmNode, osmWay } from '../osm'; import * as Operations from '../operations/index'; import { uiCmd } from '../ui/cmd'; import { utilKeybinding, utilTotalExtent } from '../util'; export function modeSelect(context, selectedIDs) { var mode = { id: 'select', button: 'browse' }; var keybinding = utilKeybinding('select'); var _breatheBehavior = behaviorBreathe(context); var _modeDragNode = modeDragNode(context); var _selectBehavior; var _behaviors = []; var _operations = []; var _newFeature = false; var _follow = false; // `_focusedParentWayId` is used when we visit a vertex with multiple // parents, and we want to remember which parent line we started on. var _focusedParentWayId; var _focusedVertexIds; function singular() { if (selectedIDs && selectedIDs.length === 1) { return context.hasEntity(selectedIDs[0]); } } function selectedEntities() { return selectedIDs.map(function(id) { return context.hasEntity(id); }).filter(Boolean); } function checkSelectedIDs() { var ids = []; if (Array.isArray(selectedIDs)) { ids = selectedIDs.filter(function(id) { return context.hasEntity(id); }); } if (!ids.length) { context.enter(modeBrowse(context)); return false; } else if ((selectedIDs.length > 1 && ids.length === 1) || (selectedIDs.length === 1 && ids.length > 1)) { // switch between single- and multi-select UI context.enter(modeSelect(context, ids)); return false; } selectedIDs = ids; return true; } // find the parent ways for nextVertex, previousVertex, and selectParent function parentWaysIdsOfSelection(onlyCommonParents) { var graph = context.graph(); var parents = []; for (var i = 0; i < selectedIDs.length; i++) { var entity = context.hasEntity(selectedIDs[i]); if (!entity || entity.geometry(graph) !== 'vertex') { return []; // selection includes some non-vertices } var currParents = graph.parentWays(entity).map(function(w) { return w.id; }); if (!parents.length) { parents = currParents; continue; } parents = (onlyCommonParents ? utilArrayIntersection : utilArrayUnion)(parents, currParents); if (!parents.length) { return []; } } return parents; } // find the child nodes for selected ways function childNodeIdsOfSelection(onlyCommon) { var graph = context.graph(); var childs = []; for (var i = 0; i < selectedIDs.length; i++) { var entity = context.hasEntity(selectedIDs[i]); if (!entity || !['area', 'line'].includes(entity.geometry(graph))){ return []; // selection includes non-area/non-line } var currChilds = graph.childNodes(entity).map(function(node) { return node.id; }); if (!childs.length) { childs = currChilds; continue; } childs = (onlyCommon ? utilArrayIntersection : utilArrayUnion)(childs, currChilds); if (!childs.length) { return []; } } return childs; } function checkFocusedParent() { if (_focusedParentWayId) { var parents = parentWaysIdsOfSelection(true); if (parents.indexOf(_focusedParentWayId) === -1) _focusedParentWayId = null; } } function parentWayIdForVertexNavigation() { var parentIds = parentWaysIdsOfSelection(true); if (_focusedParentWayId && parentIds.indexOf(_focusedParentWayId) !== -1) { // prefer the previously seen parent return _focusedParentWayId; } return parentIds.length ? parentIds[0] : null; } mode.selectedIDs = function(val) { if (!arguments.length) return selectedIDs; selectedIDs = val; return mode; }; mode.zoomToSelected = function() { context.map().zoomToEase(selectedEntities()); }; mode.newFeature = function(val) { if (!arguments.length) return _newFeature; _newFeature = val; return mode; }; mode.selectBehavior = function(val) { if (!arguments.length) return _selectBehavior; _selectBehavior = val; return mode; }; mode.follow = function(val) { if (!arguments.length) return _follow; _follow = val; return mode; }; function loadOperations() { _operations.forEach(function(operation) { if (operation.behavior) { context.uninstall(operation.behavior); } }); _operations = Object.values(Operations) .map(function(o) { return o(context, selectedIDs); }) .filter(function(o) { return o.id !== 'delete' && o.id !== 'downgrade' && o.id !== 'copy'; }) .concat([ // group copy/downgrade/delete operation together at the end of the list Operations.operationCopy(context, selectedIDs), Operations.operationDowngrade(context, selectedIDs), Operations.operationDelete(context, selectedIDs) ]).filter(function(operation) { return operation.available(); }); _operations.forEach(function(operation) { if (operation.behavior) { context.install(operation.behavior); } }); // remove any displayed menu context.ui().closeEditMenu(); } mode.operations = function() { return _operations; }; mode.enter = function() { if (!checkSelectedIDs()) return; context.features().forceVisible(selectedIDs); _modeDragNode.restoreSelectedIDs(selectedIDs); loadOperations(); if (!_behaviors.length) { if (!_selectBehavior) _selectBehavior = behaviorSelect(context); _behaviors = [ behaviorPaste(context), _breatheBehavior, behaviorHover(context).on('hover', context.ui().sidebar.hoverModeSelect), _selectBehavior, behaviorLasso(context), _modeDragNode.behavior, modeDragNote(context).behavior ]; } _behaviors.forEach(context.install); keybinding .on(t('inspector.zoom_to.key'), mode.zoomToSelected) .on(['[', 'pgup'], previousVertex) .on([']', 'pgdown'], nextVertex) .on(['{', uiCmd('⌘['), 'home'], firstVertex) .on(['}', uiCmd('⌘]'), 'end'], lastVertex) .on(uiCmd('⇧←'), nudgeSelection([-10, 0])) .on(uiCmd('⇧↑'), nudgeSelection([0, -10])) .on(uiCmd('⇧→'), nudgeSelection([10, 0])) .on(uiCmd('⇧↓'), nudgeSelection([0, 10])) .on(uiCmd('⇧⌥←'), nudgeSelection([-100, 0])) .on(uiCmd('⇧⌥↑'), nudgeSelection([0, -100])) .on(uiCmd('⇧⌥→'), nudgeSelection([100, 0])) .on(uiCmd('⇧⌥↓'), nudgeSelection([0, 100])) .on(utilKeybinding.plusKeys.map((key) => uiCmd('⇧' + key)), scaleSelection(1.05)) .on(utilKeybinding.plusKeys.map((key) => uiCmd('⇧⌥' + key)), scaleSelection(Math.pow(1.05, 5))) .on(utilKeybinding.minusKeys.map((key) => uiCmd('⇧' + key)), scaleSelection(1/1.05)) .on(utilKeybinding.minusKeys.map((key) => uiCmd('⇧⌥' + key)), scaleSelection(1/Math.pow(1.05, 5))) .on(['\\', 'pause'], focusNextParent) .on(uiCmd('⌘↑'), selectParent) .on(uiCmd('⌘↓'), selectChild) .on('⎋', esc, true); d3_select(document) .call(keybinding); context.ui().sidebar .select(selectedIDs, _newFeature); context.history() .on('change.select', function() { loadOperations(); // reselect after change in case relation members were removed or added selectElements(); }) .on('undone.select', checkSelectedIDs) .on('redone.select', checkSelectedIDs); context.map() .on('drawn.select', selectElements) .on('crossEditableZoom.select', function() { selectElements(); _breatheBehavior.restartIfNeeded(context.surface()); }); context.map().doubleUpHandler() .on('doubleUp.modeSelect', didDoubleUp); selectElements(); if (_follow) { var extent = utilTotalExtent(selectedIDs, context.graph()); var loc = extent.center(); context.map().centerEase(loc); // we could enter the mode multiple times, so reset follow for next time _follow = false; } function nudgeSelection(delta) { return function() { // prevent nudging during low zoom selection if (!context.map().withinEditableZoom()) return; var moveOp = operationMove(context, selectedIDs); if (moveOp.disabled()) { context.ui().flash .duration(4000) .iconName('#iD-operation-' + moveOp.id) .iconClass('operation disabled') .label(moveOp.tooltip)(); } else { context.perform(actionMove(selectedIDs, delta, context.projection), moveOp.annotation()); context.validator().validate(); } }; } function scaleSelection(factor) { return function() { // prevent scaling during low zoom selection if (!context.map().withinEditableZoom()) return; let nodes = utilGetAllNodes(selectedIDs, context.graph()); let isUp = factor > 1; // can only scale if multiple nodes are selected if (nodes.length <= 1) return; let extent = utilTotalExtent(selectedIDs, context.graph()); // These disabled checks would normally be handled by an operation // object, but we don't want an actual scale operation at this point. function scalingDisabled() { const allowLargeEdits = prefs('rapid-internal-feature.allowLargeEdits') === 'true'; if (tooSmall()) { return 'too_small'; } else if (!allowLargeEdits && extent.percentContainedIn(context.map().extent()) < 0.8) { return 'too_large'; } else if (someMissing() || selectedIDs.some(incompleteRelation)) { return 'not_downloaded'; } else if (selectedIDs.some(context.hasHiddenConnections)) { return 'connected_to_hidden'; } return false; function tooSmall() { if (isUp) return false; let dLon = Math.abs(extent.max[0] - extent.min[0]); let dLat = Math.abs(extent.max[1] - extent.min[1]); return dLon < geoMetersToLon(1, extent.max[1]) && dLat < geoMetersToLat(1); } function someMissing() { if (context.inIntro()) return false; let osm = context.connection(); if (osm) { let missing = nodes.filter(function(n) { return !osm.isDataLoaded(n.loc); }); if (missing.length) { missing.forEach(function(loc) { context.loadTileAtLoc(loc); }); return true; } } return false; } function incompleteRelation(id) { let entity = context.entity(id); return entity.type === 'relation' && !entity.isComplete(context.graph()); } } const disabled = scalingDisabled(); if (disabled) { let multi = (selectedIDs.length === 1 ? 'single' : 'multiple'); context.ui().flash .duration(4000) .iconName('#iD-icon-no') .iconClass('operation disabled') .label(t('operations.scale.' + disabled + '.' + multi))(); } else { const pivot = context.projection(extent.center()); const annotation = t('operations.scale.annotation.' + (isUp ? 'up' : 'down') + '.feature', { n: selectedIDs.length }); context.perform(actionScale(selectedIDs, pivot, factor, context.projection), annotation); context.validator().validate(); } }; } function didDoubleUp(d3_event, loc) { if (!context.map().withinEditableZoom()) return; var target = d3_select(d3_event.target); var datum = target.datum(); var entity = datum && datum.properties && datum.properties.entity; if (!entity) return; if (entity instanceof osmWay && target.classed('target')) { var choice = geoChooseEdge(context.graph().childNodes(entity), loc, context.projection); var prev = entity.nodes[choice.index - 1]; var next = entity.nodes[choice.index]; context.perform( actionAddMidpoint({ loc: choice.loc, edge: [prev, next] }, osmNode()), t('operations.add.annotation.vertex') ); context.validator().validate(); } else if (entity.type === 'midpoint') { context.perform( actionAddMidpoint({ loc: entity.loc, edge: entity.edge }, osmNode()), t('operations.add.annotation.vertex') ); context.validator().validate(); } } function selectElements() { if (!checkSelectedIDs()) return; var surface = context.surface(); surface.selectAll('.selected-member') .classed('selected-member', false); surface.selectAll('.selected') .classed('selected', false); surface.selectAll('.related') .classed('related', false); // reload `_focusedParentWayId` based on the current selection checkFocusedParent(); if (_focusedParentWayId) { surface.selectAll(utilEntitySelector([_focusedParentWayId])) .classed('related', true); } if (context.map().withinEditableZoom()) { // Apply selection styling if not in wide selection surface .selectAll(utilDeepMemberSelector(selectedIDs, context.graph(), true /* skipMultipolgonMembers */)) .classed('selected-member', true); surface .selectAll(utilEntityOrDeepMemberSelector(selectedIDs, context.graph())) .classed('selected', true); } } function esc() { if (context.container().select('.combobox').size()) return; context.enter(modeBrowse(context)); } function firstVertex(d3_event) { d3_event.preventDefault(); var entity = singular(); var parentId = parentWayIdForVertexNavigation(); var way; if (entity && entity.type === 'way') { way = entity; } else if (parentId) { way = context.entity(parentId); } _focusedParentWayId = way && way.id; if (way) { context.enter( mode.selectedIDs([way.first()]) .follow(true) ); } } function lastVertex(d3_event) { d3_event.preventDefault(); var entity = singular(); var parentId = parentWayIdForVertexNavigation(); var way; if (entity && entity.type === 'way') { way = entity; } else if (parentId) { way = context.entity(parentId); } _focusedParentWayId = way && way.id; if (way) { context.enter( mode.selectedIDs([way.last()]) .follow(true) ); } } function previousVertex(d3_event) { d3_event.preventDefault(); var parentId = parentWayIdForVertexNavigation(); _focusedParentWayId = parentId; if (!parentId) return; var way = context.entity(parentId); var length = way.nodes.length; var curr = way.nodes.indexOf(selectedIDs[0]); var index = -1; if (curr > 0) { index = curr - 1; } else if (way.isClosed()) { index = length - 2; } if (index !== -1) { context.enter( mode.selectedIDs([way.nodes[index]]) .follow(true) ); } } function nextVertex(d3_event) { d3_event.preventDefault(); var parentId = parentWayIdForVertexNavigation(); _focusedParentWayId = parentId; if (!parentId) return; var way = context.entity(parentId); var length = way.nodes.length; var curr = way.nodes.indexOf(selectedIDs[0]); var index = -1; if (curr < length - 1) { index = curr + 1; } else if (way.isClosed()) { index = 0; } if (index !== -1) { context.enter( mode.selectedIDs([way.nodes[index]]) .follow(true) ); } } function focusNextParent(d3_event) { d3_event.preventDefault(); var parents = parentWaysIdsOfSelection(true); if (!parents || parents.length < 2) return; var index = parents.indexOf(_focusedParentWayId); if (index < 0 || index > parents.length - 2) { _focusedParentWayId = parents[0]; } else { _focusedParentWayId = parents[index + 1]; } var surface = context.surface(); surface.selectAll('.related') .classed('related', false); if (_focusedParentWayId) { surface.selectAll(utilEntitySelector([_focusedParentWayId])) .classed('related', true); } } function selectParent(d3_event) { d3_event.preventDefault(); var currentSelectedIds = mode.selectedIDs(); var parentIds = _focusedParentWayId ? [_focusedParentWayId] : parentWaysIdsOfSelection(false); if (!parentIds.length) return; context.enter( mode.selectedIDs(parentIds) ); // set this after re-entering the selection since we normally want it cleared on exit _focusedVertexIds = currentSelectedIds; } function selectChild(d3_event) { d3_event.preventDefault(); var currentSelectedIds = mode.selectedIDs(); var childIds = _focusedVertexIds ? _focusedVertexIds.filter(id => context.hasEntity(id)) : childNodeIdsOfSelection(true); if (!childIds || !childIds.length) return; if (currentSelectedIds.length === 1) _focusedParentWayId = currentSelectedIds[0]; context.enter( mode.selectedIDs(childIds) ); } }; mode.exit = function() { // we could enter the mode multiple times but it's only new the first time _newFeature = false; _focusedVertexIds = null; _operations.forEach(function(operation) { if (operation.behavior) { context.uninstall(operation.behavior); } }); _operations = []; _behaviors.forEach(context.uninstall); d3_select(document) .call(keybinding.unbind); context.ui().closeEditMenu(); context.history() .on('change.select', null) .on('undone.select', null) .on('redone.select', null); var surface = context.surface(); surface .selectAll('.selected-member') .classed('selected-member', false); surface .selectAll('.selected') .classed('selected', false); surface .selectAll('.highlighted') .classed('highlighted', false); surface .selectAll('.related') .classed('related', false); context.map().on('drawn.select', null); context.ui().sidebar.hide(); context.features().forceVisible([]); var entity = singular(); if (_newFeature && entity && entity.type === 'relation' && // no tags Object.keys(entity.tags).length === 0 && // no parent relations context.graph().parentRelations(entity).length === 0 && // no members or one member with no role (entity.members.length === 0 || (entity.members.length === 1 && !entity.members[0].role)) ) { // the user added this relation but didn't edit it at all, so just delete it var deleteAction = actionDeleteRelation(entity.id, true /* don't delete untagged members */); context.perform(deleteAction, t('operations.delete.annotation.relation')); context.validator().validate(); } }; return mode; }
import React from 'react' import ScheduledWorkshop from './scheduled-workshop' import get from 'lodash/get' import {css} from '@emotion/core' function UpcomingWorkshops({events, headline}) { return ( <div> {events.length ? ( <div css={css` margin-top: -30px; position: relative; z-index: 5; `} > {headline && ( <h1 css={css` margin-bottom: 45px; `} > {headline} </h1> )} {events.map(event => { const discount = get(event, 'discounts.early', false) return ( <ScheduledWorkshop buttonText={discount ? 'Secure a Discount' : 'Secure Your Seat'} tech={event.tech} waitlistUrl={event.url} description={event.description} title={event.title} imageUrl={event.logo.url} date={event.date} spotsRemaining={event.remaining} bookUrl={discount ? discount.url : event.url} url={event.workshopSlug} soldOut={event.remaining === 0} key={event.slug} startTime={event.startTime} endTime={event.endTime} location={event.location} discount={discount} /> ) })} </div> ) : null} </div> ) } export default UpcomingWorkshops
(function (Math) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var Hasher = C_lib.Hasher; var C_algo = C.algo; // Reusable object var W = []; var K = []; // ROTATE: function(a, n) { return a << n | (a >>> (32 - n)) } // for ( var i = 0; 16 > i; i++) T_00_63[i] = ROTATE(0x79CC4519, i); // for ( var i = 16; 64 > i; i++) T_00_63[i] = ROTATE(0x7A879D8A, i); var T_00_63 = [ //ROTATE(0x79CC4519, [0..15]) 2043430169, -208106958, -416213915, -832427829, -1664855657, 965255983, 1930511966, -433943364, -867886727, -1735773453, 823420391, 1646840782, -1001285732, -2002571463, 289824371, 579648742, //ROTATE(0x7A879D8A, [16..63]) -1651869049, 991229199, 1982458398, -330050500, -660100999, -1320201997, 1654563303, -985840690, -1971681379, 351604539, 703209078, 1406418156, -1482130984, 1330705329, -1633556638, 1027854021, 2055708042, -183551212, -367102423, -734204845, -1468409689, 1358147919, -1578671458, 1137624381, -2019718534, 255530229, 511060458, 1022120916, 2044241832, -206483632, -412967263, -825934525, -1651869049, 991229199, 1982458398, -330050500, -660100999, -1320201997, 1654563303, -985840690, -1971681379, 351604539, 703209078, 1406418156, -1482130984, 1330705329, -1633556638, 1027854021]; /** * SM3 hash algorithm. */ var SM3 = C_algo.SM3 = Hasher.extend({ _doReset: function () { this._hash = new WordArray.init([ 1937774191, 1226093241, 388252375, -628488704, -1452330820, 372324522, -477237683, -1325724082 ]); }, _doProcessBlock: function (M, offset) { // Shortcut var H = this._hash.words; // Working variables var H0 = []; for (var i = 0; i < H.length; i++) { H0.push(H[i]); } for (var i = 0; 16 > i; i++) { W[i] = M[offset + i] | 0; } // Computation var P1; for (var i = 16; 68 > i; i++) { // ROTATE: function(a, n) { return a << n | (a >>> (32 - n)) } // P1: function(a) { return a ^ ROTATE(a, 15) ^ ROTATE(a, 23) } // W[i] = P1(W[i - 16] ^ W[i - 9] ^ (W[i - 3] << 15 | (W[i - 3] >>> 17))) ^ (W[i - 13] << 7 | (W[i - 13] >>> 25)) ^ W[i - 6]; P1 = W[i - 16] ^ W[i - 9] ^ (W[i - 3] << 15 | (W[i - 3] >>> 17)); P1 = P1 ^ (P1 << 15 | (P1 >>> 17)) ^ (P1 << 23 | (P1 >>> 9)); W[i] = P1 ^ (W[i - 13] << 7 | (W[i - 13] >>> 25)) ^ W[i - 6]; } for (var i = 0; 64 > i; i++) { K[i] = W[i] ^ W[i + 4]; } var g, f; //roateLeft for (var i = 0; 16 > i; i++) { g = H0[0] << 12 | (H0[0] >>> 20); f = (((g + H0[4]) & 4294967295) + T_00_63[i]) & 4294967295; f = f << 7 | (f >>> 25); g ^= f; g = ((((((H0[0] ^ H0[1] ^ H0[2]) + H0[3]) & 4294967295) + g) & 4294967295) + K[i]) & 4294967295; f = ((((((H0[4] ^ H0[5] ^ H0[6]) + H0[7]) & 4294967295) + f) & 4294967295) + W[i]) & 4294967295; H0[3] = H0[2]; H0[2] = H0[1] << 9 | (H0[1] >>> 23); H0[1] = H0[0]; H0[0] = g; H0[7] = H0[6]; H0[6] = H0[5] << 19 | (H0[5] >>> 13); H0[5] = H0[4]; H0[4] = f ^ (f << 9 | (f >>> 23)) ^ (f << 17 | (f >>> 15)); } for (var i = 16; 64 > i; i++) { g = H0[0] << 12 | (H0[0] >>> 20); f = (((g + H0[4]) & 4294967295) + T_00_63[i]) & 4294967295; f = f << 7 | (f >>> 25); g ^= f; g = ((((((H0[0] & H0[1] | H0[0] & H0[2] | H0[1] & H0[2]) + H0[3]) & 4294967295) + g) & 4294967295) + K[i]) & 4294967295; f = ((((((H0[4] & H0[5] | ~H0[4] & H0[6]) + H0[7]) & 4294967295) + f) & 4294967295) + W[i]) & 4294967295; H0[3] = H0[2]; H0[2] = H0[1] << 9 | (H0[1] >>> 23); H0[1] = H0[0]; H0[0] = g; H0[7] = H0[6]; H0[6] = H0[5] << 19 | (H0[5] >>> 13); H0[5] = H0[4]; H0[4] = f ^ (f << 9 | (f >>> 23)) ^ (f << 17 | (f >>> 15)); } // Intermediate hash value for (var i = 0; i < 8; i++) { H[i] ^= H0[i]; } }, _doFinalize: function () { // Shortcuts var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 4294967296); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal & 4294967295; data.sigBytes = dataWords.length * 4; // Hash final blocks this._process(); // Return final computed hash return this._hash; }, clone: function () { var clone = Hasher.clone.call(this); clone._hash = this._hash.clone(); return clone; } }); /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SM3('message'); * var hash = CryptoJS.SM3(wordArray); */ C.SM3 = Hasher._createHelper(SM3); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSM3(message, key); */ C.HmacSM3 = Hasher._createHmacHelper(SM3); }(Math));
import React from "react"; import { Fragment } from "react/cjs/react.production.min"; function Post(props) { return ( <Fragment> <div> <div className="post"> <div className="card-avatar"> <div className="card-avatar-left"> <img src={props.avatar} alt="Avatar" /> </div> <div className="card-avatar-right"> <h6>{props.name}</h6> <p> {props.time} <i className="far fa-clock" /> </p> </div> <div className="card-avatar-more"> <i className="fas fa-ellipsis-h" /> </div> </div> <div className="post-title"> {props.title} </div> <div className="post-body"> <img src={props.image} alt="Title" /> <div className="row reaction"> <div className="col-md-3"> <i className="far fa-heart" /> {props.like} </div> <div className="col-md-6" /> </div> </div> </div> </div> </Fragment> ); } export default Post;
/* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html version: 3.1.1 build: 47 */ YUI.add("lang/datatype-date-format_it",function(A){A.Intl.add("datatype-date-format","it",{"a":["dom","lun","mar","mer","gio","ven","sab"],"A":["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],"b":["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],"B":["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],"c":"%a %d %b %Y %H.%M.%S %Z","p":["M.","P."],"P":["m.","p."],"x":"%d/%m/%y","X":"%H.%M.%S"});},"3.1.1");
(function() { 'use strict'; angular .module('nonoApp') .controller('InstructionsController', InstructionsController); /** @ngInject */ function InstructionsController($stateParams, $http) { var vm = this; var type = $stateParams.type; var collectionMode = $stateParams.collectionMode; switch (type) { // case '1': // vm.title = '0元投资计划说明书'; // vm.template = 'assets/templates/0yjh.instructions.html'; // break; case '2': vm.title = '诺诺精选投资计划说明书'; vm.template = 'assets/templates/jxjh.instructions.html'; break; case '3': vm.title = '懒人计划说明书'; vm.template = 'assets/templates/lrjh.instructions.html'; break; case '11': vm.title = '贴心计划说明书'; vm.template = 'assets/templates/txjh.instructions.html'; break; case '1': vm.title = '新客投资计划说明书'; vm.template = 'assets/templates/jxjh.instructions.html'; vm.mode = collectionMode; break; case '6': vm.title = '债权转让说明书'; vm.template = 'assets/templates/debt.instructions.html'; break; case '7': vm.title = '诺诺镑客注册协议'; $http.get('https://m.nonobank.com/agreements/nono/template/service.html') .success(function(data, status, headers, config) { vm.template = data; }) // vm.template = 'assets/templates/reg.instructions.html'; break; } } })();
import React from "react" import "./footer.css"; import { Link } from "gatsby" export default function MainFooter(props) { return( <div> © {new Date().getFullYear()} <Link href={props.homepagelink}> {props.companyname}</Link> </div> ) }
// @flow /* global window, localStorage */ import type {LocaleNameType} from './const'; import {localeConst} from './const'; export type SetLocaleType = {| +type: 'locale__set-locale', +payload: {| +localeName: LocaleNameType, |}, |}; export function setLocale(localeName: LocaleNameType): SetLocaleType { if (typeof window !== 'undefined') { console.log('---> write to localStorage', localeConst.key.localStorage.localeName, localeName); localStorage.setItem(localeConst.key.localStorage.localeName, localeName); } return { type: localeConst.action.type.setLocale, payload: { localeName, }, }; }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Custom JavaScript code in the MarkDown docs */ // Enable language-specific code tabs function codeTabs() { var counter = 0; var langImages = { "scala": "img/scala-sm.png", "python": "img/python-sm.png", "java": "img/java-sm.png" }; $("div.codetabs").each(function () { $(this).addClass("tab-content"); // Insert the tab bar var tabBar = $('<ul class="nav nav-tabs" data-tabs="tabs"></ul>'); $(this).before(tabBar); // Add each code sample to the tab bar: var codeSamples = $(this).children("div"); codeSamples.each(function () { $(this).addClass("tab-pane"); var lang = $(this).data("lang"); var image = $(this).data("image"); var label = $(this).data("label"); var notabs = $(this).data("notabs"); if (label == null) { var capitalizedLang = lang.substr(0, 1).toUpperCase() + lang.substr(1); label = capitalizedLang; } lang = lang.replace(/ /g, ''); var id = "tab_" + label.replace(/ /g, '_') + "_" + counter; $(this).attr("id", id); if (image != null && langImages[lang]) { var buttonLabel = "<img src='" + langImages[lang] + "' alt='" + label + "' />"; } else if (notabs == null) { var buttonLabel = "<b>" + label + "</b>"; } else { var buttonLabel = "" } tabBar.append( '<li><a href="#' + id + '">' + buttonLabel + '</a></li>' ); }); codeSamples.first().addClass("active"); tabBar.children("li").first().addClass("active"); counter++; }); $("ul.nav-tabs a").click(function (e) { // Toggling a tab should switch all tabs corresponding to the same language // while retaining the scroll position e.preventDefault(); var scrollOffset = $(this).offset().top - $(document).scrollTop(); $(this).tab('show'); $(document).scrollTop($(this).offset().top - scrollOffset); }); $("table").each(function () { $(this).addClass("table table-bordered"); }); } // A script to fix internal hash links because we have an overlapping top bar. // Based on https://github.com/twitter/bootstrap/issues/193#issuecomment-2281510 function maybeScrollToHash() { if (window.location.hash && $(window.location.hash).length) { var newTop = $(window.location.hash).offset().top - 57; $(window).scrollTop(newTop); } } $(function () { codeTabs(); // Display anchor links when hovering over headers. For documentation of the // configuration options, see the AnchorJS documentation. anchors.options = { placement: 'left' }; anchors.add(); $(window).bind('hashchange', function () { maybeScrollToHash(); }); // Scroll now too in case we had opened the page on a hash, but wait a bit because some browsers // will try to do *their* initial scroll after running the onReady handler. $(window).load(function () { setTimeout(function () { maybeScrollToHash(); }, 25); }); });
module.exports = function() { return process.env.NODE_ENV + ':' + process.env.FOO; };
class Triangle { g; size; p1; p2; p3; center; color; lineThickness; hitArea; flip; fill; curD; targetD; curV; targetV; a; maxSpeed; target; radius; freq; curRadius; curFreq; radius; circleVector; circleTick; constructor(x = 0, y = 0, size = 100, stage, color = 0xFFFF00, lineThickness = 1, flip = false, fill = false, rX = 0, rY = 0, freq = 0) { this.g = new PIXI.Graphics(); stage.addChild(this.g); this.g.interactive = true; this.g.buttonMode = true; this.flip = flip; this.fill = fill; this.size = size; this.freq = freq; this.radius = ({x: rX, y: rY}); this.curFreq = freq; this.curRadius = this.radius; this.circleTick = 0; this.center = ({x : x, y : y}); this.curD = ({x : 0, y : 0}); this.d = ({x : 0, y : 0}); this.target = this.center; this.color = color; this.lineThickness = lineThickness; this.curV = 0; this.setVelocity(0); this.setAccel(0); this.setDirection(0, 0); this.updateCircle(); } setBehavior(f) { this.g.click = f; } updateCircle() { this.curFreq = this.smooth(this.freq, this.curFreq, 0.001 / 60); this.curRadius.x = this.smooth(this.radius.x, this.curRadius.x, 0.001 / 60); this.curRadius.y = this.smooth(this.radius.y, this.curRadius.y, 0.001 / 60); let angle = Math.PI * 2 * this.curFreq * (this.circleTick / 60); let vX = Math.cos(angle) * this.curRadius.x; let vY = Math.sin(angle) * this.curRadius.y; this.circleVector = ({x : vX, y : vY}); this.circleTick = this.circleTick + 1; } updateSize(size) { this.size = size; this.updatePoints() } updatePoints() { let l = Math.sqrt(Math.pow(this.size, 2) - Math.pow(0.5 * this.size, 2)); let curCenter = ({ x : (this.center.x + this.circleVector.x), y : (this.center.y + this.circleVector.y) }); this.p1 = { x : curCenter.x, y : curCenter.y - (l / 2) }; if (this.flip) { this.p1.y = curCenter.y + (l / 2) } let yPos = 0; if (this.flip) { yPos = this.p1.y - l; } else { yPos = this.p1.y + l; } this.p2 = { x: this.p1.x - (this.size / 2), y: yPos }; this.p3 = { x: this.p1.x + (this.size / 2), y: yPos }; this.g.hitArea = new PIXI.Polygon(this.p1.x, this.p1.y, this.p2.x, this.p2.y, this.p3.x, this.p3.y) return curCenter; } setDirection(x, y) { let denominator = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)); x = x / denominator; y = y / denominator; this.targetD = ({x : x, y : y}); } setVelocity(vel) { this.targetV = vel / 60; } setAccel(accel) { this.a = accel / 60; } setRadius(radius) { this.radius = radius; } setFreq(freq) { this.freq = freq; } setTarget(x, y) { this.target.x = x; this.target.y = y; } smooth (t, c, s) { if (c < t) { c = c + s; } if (c > t) { c = c - s; } return c; } move() { this.curV = this.smooth(this.targetV, this.curV, this.a); this.curD.x = this.smooth(this.targetD.x, this.curD.x, this.a); this.curD.y = this.smooth(this.targetD.y, this.curD.y, this.a); let deltaX = (this.curD.x * this.curV); let deltaY = (this.curD.y * this.curV); this.center = ({x : deltaX + this.center.x, y : deltaY + this.center.y}); this.updateCircle(); this.updatePoints(); this.draw(); } draw() { this.g.clear(); this.g.lineStyle(this.lineThickness, this.color); if (this.fill) { this.g.beginFill(0x000000, 1); } this.g.moveTo(this.p1.x, this.p1.y); this.g.lineTo(this.p2.x, this.p2.y); this.g.lineTo(this.p3.x, this.p3.y); this.g.lineTo(this.p1.x, this.p1.y); if (this.fill) { this.g.endFill(); } } } class TriText extends Triangle { text; fontAdjust; constructor (x = 0, y = 0, size = 100, stage, color = 0xFFFF00, lineThickness = 1, flip = false, fill = false, rX = 0, rY = 0, freq = 0, string = "default", fontFamily = 'Major Mono Display, monospace', fontSize = 0.3, align = "center", textColor = "white", fontAdjust = 0.15) { super(x, y, size, stage, color, lineThickness, flip, fill, rX, rY, freq) this.fontAdjust = fontAdjust; let textStyle = new PIXI.TextStyle({ align: "center", fill: textColor, stroke: textColor, fontFamily: fontFamily, fontSize: fontSize * this.size, wordWrap: true, wordWrapWidth: (0.5 * this.size), }); this.text = new PIXI.Text(string, textStyle); this.text.anchor.x = 0.5; this.text.anchor.y = 0.5; stage.addChild(this.text); this.updatePoints(); this.draw(); } updateSize(size) { this.text.style.fontSize = this.fontSize * size; this.updatePoints(this.center.x, this.center.y) } updatePoints() { let curCenter = super.updatePoints(); this.positionText(curCenter.x, curCenter.y); } positionText(x, y) { this.text.x = x; if (this.flip) { this.text.y = y - (this.size * this.fontAdjust); } else { this.text.y = y + (this.size * this.fontAdjust); } } setText(string) { this.text.text = string } } class TriImage extends Triangle { sprite; constructor (x = 0, y = 0, size = 100, stage, color = 0xFFFF00, lineThickness = 1, flip = false, fill = false, rX = 0, rY = 0, freq = 0, img) { super(x, y, size, stage, color, lineThickness, flip, fill, rX, rY, freq); var texture = PIXI.Texture.fromImage(img); this.sprite = new PIXI.Sprite(texture); this.sprite.anchor.x = 0.5; this.sprite.anchor.y = 0.5; stage.addChild(this.sprite); this.updateSize(size); this.updatePoints(); this.draw(); } updateSize(size) { this.size = size; this.sprite.width = size * 0.5; this.sprite.height = size * 0.5; this.updatePoints(this.center.x, this.center.y) } updatePoints() { let curCenter = super.updatePoints(); this.positionImg(curCenter.x, curCenter.y + (this.sprite.height / 4)); } setImage (img) { var texture = PIXI.Texture.fromImage(img); this.sprite.texture = texture; this.updateSize(this.size); } positionImg(x, y) { this.sprite.x = x; this.sprite.y = y; } } class TriGroup { triArr; points; pixiContainer; topPoints; flipPoints; color; constructor(x, y, size, depth, stage, color, radius = 0, freq = 0, fontFamily = 'Major Mono Display, monospace' , fontSize = 0.1, align = "center", textColor = "white") { this.pixiContainer = new PIXI.Container(); stage.addChild(this.pixiContainer); this.triArr = []; this.points = new Set(); this.topPoints = []; this.flipPoints = new Set(); this.color = color; let thisSize = size / depth; let l = Math.sqrt(Math.pow(thisSize, 2) - Math.pow(0.5 * thisSize, 2)); this.collectPoints(x, y - (l / 2), l, thisSize, depth, 1); this.makeTriangles(thisSize, this.points, false, l, radius, freq, fontFamily, fontSize, align, textColor); // this.drawLine(0, app.view.width, this.triArr[0].p2, this.triArr[0].p1); // this.drawLine(0, app.view.width, this.triArr[0].p1, this.triArr[0].p3); this.collectFlipPoints(); this.makeTriangles(thisSize, this.flipPoints, true, l, radius, freq, fontFamily, fontSize, align, textColor); } getY (x, p1, p2) { let m = (p2.y - p1.y) / (p2.x - p1.x); return m * (x - p1.x) + p1.y; } drawLine (x1, x2, p1, p2) { let graphics = new PIXI.Graphics(); app.stage.addChild(graphics); graphics.lineStyle(1, 0xFFF00); graphics.moveTo(x1, this.getY(x1, p1, p2)); graphics.lineTo(x2, this.getY(x2, p1, p2)); } notOnLine(point, p1, p2) { let m = (p2.y - p1.y) / (p2.x - p1.x); let y = m * (point.x - p1.x)+ p1.y; let roundingError = 50; let lowerBound = y >= point.y - roundingError; let upperBound = y <= point.y + roundingError; let bool = !(lowerBound && upperBound); return bool; } addFlipPoint(point) { let notOnLine1 = this.notOnLine(point, this.triArr[0].p2, this.triArr[0].p1); let notOnLine2 = this.notOnLine(point, this.triArr[0].p1, this.triArr[0].p3); if (notOnLine1 && notOnLine2) { this.flipPoints.add(point); } } collectPoints(x, y, l, size, depth, curDepth) { if (depth >= curDepth) { let point = {x : x, y : y}; this.points.add(point); this.collectPoints(x + (size / 2), y + l, l, size, depth, curDepth + 1); this.collectPoints(x - (size / 2), y + l, l, size, depth, curDepth + 1); } } collectFlipPoints() { for (let tri of this.triArr) { this.addFlipPoint(tri.p1); this.addFlipPoint(tri.p2); this.addFlipPoint(tri.p3); } } makeTriangles(size, points, flip, l, radius, freq, fontFamily, fontSize, align, textColor) { let deltaY = -1 * (l / 2); for (let point of points) { this.triArr.push(new TriText(point.x, point.y + deltaY, size, this.pixiContainer, this.color, 1, flip, true, radius, freq, "test", fontFamily, fontSize, align, textColor)) } } moveTriangles(deltaX, deltaY) { for (let tri of this.triArr) { tri.updatePoints(tri.p1.x + deltaX, tri.p1.y + deltaY); } this.drawTriangles(); } drawTriangles() { for (let tri of this.triArr) { tri.draw(); } } }
import React from 'react' import { render } from '@testing-library/react' import HvacStatusIcon from '../HvacStatusIcon' describe('<HvacStatusIcon />', () => { it('should render <HvacStatusIcon /> component', () => { expect(render(<HvacStatusIcon />)).not.toBeNull() }) })
import { obtainTerrain } from "@woosh/meep-engine/engine/ecs/terrain/util/obtainTerrain.js"; // import { seededRandom } from "@woosh/meep-engine/core/math/random/seededRandom.js"; import { EngineConfiguration } from "@woosh/meep-engine/engine/EngineConfiguration.js"; // import ScriptSystem from "@woosh/meep-engine/engine/ecs/systems/ScriptSystem.js"; // import PathFollowingSystem from "@woosh/meep-engine/engine/navigation/ecs/path_following/PathFollowingSystem.js"; // import TagSystem from "@woosh/meep-engine/engine/ecs/systems/TagSystem.js"; // import TimerSystem from "@woosh/meep-engine/engine/ecs/systems/TimerSystem.js"; // import TopDownCameraControllerSystem from "@woosh/meep-engine/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.js"; // import { TopDownCameraLanderSystem } from "@woosh/meep-engine/engine/graphics/ecs/camera/topdown/TopDownCameraLanderSystem.js"; // import { CameraSystem } from "@woosh/meep-engine/engine/graphics/ecs/camera/CameraSystem.js"; // import { MeshSystem } from "@woosh/meep-engine/engine/graphics/ecs/mesh/MeshSystem.js"; // import TerrainSystem from "@woosh/meep-engine/engine/ecs/terrain/ecs/TerrainSystem.js"; // import WaterSystem from "@woosh/meep-engine/engine/graphics/ecs/water/WaterSystem.js"; // import ViewportPositionSystem from "@woosh/meep-engine/engine/ecs/gui/position/ViewportPositionSystem.js"; // import { GridPosition2TransformSystem } from "@woosh/meep-engine/engine/grid/systems/GridPosition2TransformSystem.js"; // import { Transform2GridPositionSystem } from "@woosh/meep-engine/engine/grid/transform2grid/Transform2GridPositionSystem.js"; // import SynchronizePositionSystem from "@woosh/meep-engine/engine/ecs/systems/SynchronizePositionSystem.js"; // import GridObstacleSystem from "@woosh/meep-engine/engine/grid/systems/GridObstacleSystem.js"; // import GridPositionSystem from "@woosh/meep-engine/engine/grid/systems/GridPositionSystem.js"; // import InputControllerSystem from "@woosh/meep-engine/engine/input/ecs/systems/InputControllerSystem.js"; // import { InputSystem } from "@woosh/meep-engine/engine/input/ecs/systems/InputSystem.js"; // import MeshHighlightSystem from "@woosh/meep-engine/engine/graphics/ecs/highlight/system/MeshHighlightSystem.js"; // import LightSystem from "@woosh/meep-engine/engine/graphics/ecs/light/LightSystem.js"; // import RenderSystem from "@woosh/meep-engine/engine/ecs/systems/RenderSystem.js"; // import { makeEngineOptionsModel } from "@woosh/meep-engine/../model/game/options/makeEngineOptionsModel.js"; // import { enableEditor } from "@woosh/meep-engine/editor/enableEditor.js"; import { EngineHarness } from "./demo/EngineHarness.js"; // import { EngineHarness } from "@woosh/meep-engine/engine/EngineHarness.js"; import Vector2 from "@woosh/meep-engine/core/geom/Vector2.js"; import Vector3 from "@woosh/meep-engine/core/geom/Vector3.js"; // import { buildCanvasViewFromTexture } from "@woosh/meep-engine/engine/graphics/render/visibility/hiz/buildCanvasViewFromTexture.js"; // import EntityBuilder from "@woosh/meep-engine/engine/ecs/EntityBuilder.js"; // import ViewportPositionSystem from "@woosh/meep-engine/engine/ecs/gui/position/ViewportPositionSystem.js"; // import ViewportPosition from "@woosh/meep-engine/engine/ecs/gui/position/ViewportPosition.js"; // import GUIElement from "@woosh/meep-engine/engine/ecs/gui/GUIElement.js"; // import GUIElementSystem from "@woosh/meep-engine/engine/ecs/gui/GUIElementSystem.js"; // import {SerializationMetadata} from "@woosh/meep-engine/engine/ecs/components/SerializationMetadata.js"; import { TextureAssetLoader } from "@woosh/meep-engine/engine/asset/loaders/texture/TextureAssetLoader.js"; import { GameAssetType } from "@woosh/meep-engine/engine/asset/GameAssetType.js"; import { ImprovedNoise } from "three/examples/jsm/math/ImprovedNoise.js"; import { lerp } from "@woosh/meep-engine/core/math/lerp.js"; const eh = new EngineHarness(); /** * * @param {Engine} engine * @return {EngineConfiguration} */ function makeConfig(engine) { const r = new EngineConfiguration(); // configure engine here, add systems, loaders etc. r.addLoader(GameAssetType.Texture, new TextureAssetLoader()); return r; } /** * * @param {Terrain} terrain * @param {number} resolution * @param {number} heightMin * @param {number} heightMax */ async function buildRandomTerrainHeights({ terrain, resolution = 64, heightMin = -10, heightMax = 30 }) { const terrain_height = terrain.samplerHeight; terrain_height.resize(resolution, resolution); const noise = new ImprovedNoise(); let x, y; for (y = 0; y < resolution; y++) { for (x = 0; x < resolution; x++) { const u = x / (resolution - 1); const v = y / (resolution - 1); const noise_value = noise.noise(u * 13.456, v * 13.456, 0) * noise.noise(u * 3.71, v * 3.71, 0.8); const height_value = lerp(heightMin, heightMax, noise_value); terrain_height.set(x, y, [height_value]); } } await terrain.updateWorkerHeights(); terrain.updateHeightTexture(); terrain.buildLightMap(); terrain.tiles.rebuild(); } /** * * @param {Engine} engine */ async function main(engine) { await EngineHarness.buildBasics({ engine, // heightMap = "data/textures/utility/black_pixel.png", // heightRange = "data/textures/utility/white_pixel.png", enableWater: false, terrainResolution: 4, terrainSize: new Vector2(64, 64), focus: new Vector3(64, 0, 54), yaw: 0, pitch: 0.909, distance: 169 }); /** * * @type {EntityComponentDataset} */ const ecd = engine.entityManager.dataset; /** * * @type {Terrain|null} */ const terrain = obtainTerrain(ecd); buildRandomTerrainHeights({ terrain: terrain }); } /** * * @param {EngineHarness} harness */ async function init(harness) { const engine = eh.engine; await makeConfig(engine).apply(engine); // enableEditor(engine); await eh.initialize(); main(engine); } init(eh);
module.exports = class Sample { constructor(param) { this.param = param; } };
var AppServer = require('../lib/AppServer'); var assert = require('assert'); describe('AppServer', function() { it('should be callable', function() { assert.equal(typeof AppServer, 'function'); }); });
import update from './update.js'; // even though Rollup is bundling all your files together, errors and // logs will still point to your original source modules console.log('if you have sourcemaps enabled in your devtools, click on main.js:5 -->'); update();
import React from 'react'; import { parse } from 'react-docgen'; import CodeExample from '../../../components/CodeExample'; import ComponentHeader from '../../../components/ComponentHeader'; import PropTypeDescription from '../../../components/PropTypeDescription'; import Demo from './Demo'; // eslint-disable-next-line import demoCode from '!raw-loader!./Demo'; // eslint-disable-next-line import componentCode from '!raw-loader!@ringcentral-integration/widgets/components/SettingsPanel'; const SettingsPanelPage = () => { const info = parse(componentCode); return ( <div> <ComponentHeader name="SettingsPanel" description={info.description} /> <CodeExample code={demoCode} title="SettingsPanel Example"> <Demo /> </CodeExample> <PropTypeDescription componentInfo={info} /> </div> ); }; export default SettingsPanelPage;
//============================================================================= // AutoTextFeed.js // ---------------------------------------------------------------------------- // Copyright (c) 2017 n2naokun(柊菜緒) // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php // ---------------------------------------------------------------------------- // Version // 1.0.1 2018/03/21 ウィンドウ非表示プラグインと連携 // 1.0.0 2018/03/21 初版 // ---------------------------------------------------------------------------- // [Twitter]: https://twitter.com/n2naokun/ // [GitHub] : https://github.com/n2naokun/ //============================================================================= /*: * @plugindesc テキスト自動送りプラグイン * @author n2naokun(柊菜緒) * * @help テキストウィンドウの表示が完了してから指定時間後 * 自動的に次のテキストを表示するプラグインです。 * * プラグインコマンド * 自動送りの開始 * AutoTextFeed Start 時間(×0.1秒) * 自動送りの停止 * AutoTextFeed Stop * * 使用例 * AutoTextFeed Start 10 * (0.1×10なので1秒待ち) * * * 利用規約: * 作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等) * についても制限はありません。 * このプラグインはもうあなたのものです。 */ // ESLint向けグローバル変数宣言 /*global */ "use strict";//厳格なエラーチェック var Imported = Imported || {}; Imported.AutoTextFeed = true; // 他のプラグインとの連携用シンボル (function (_global) { var nextMessageWait = 60, feedWaitCount = 0, messageAutoFeed = false; var Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; Game_Interpreter.prototype.pluginCommand = function (command, args) { Game_Interpreter_pluginCommand.apply(this, arguments); if (command == "AutoTextFeed") { if (args[0] == "Start") { var wait = Number(args[1]); if (!isNaN(wait)) { nextMessageWait = wait * 6; } else { nextMessageWait = 60; } messageAutoFeed = true; } else if (args[0] == "Stop") { messageAutoFeed = false; } } }; // 自動送りできるように拡張 var Window_Message_isTriggered = Window_Message.prototype.isTriggered; Window_Message.prototype.isTriggered = function () { return Window_Message_isTriggered.call(this) || this.autoFeed(); }; // 自動送りするかチェック Window_Message.prototype.autoFeed = function () { if (messageAutoFeed && (feedWaitCount >= nextMessageWait)) { this.feedWaitCountClear(); return true; } return false; }; var Window_Message_update = Window_Message.prototype.update; Window_Message.prototype.update = function () { if (Window_Message_isTriggered.call(this)) { this.feedWaitCountClear(); } Window_Message_update.call(this); // メッセージウィンドウ非表示プラグインが導入されている場合非表示時にウェイトを加算しない if (!this.isHidden) { if (this.updateInput()) feedWaitCount++; } else { if (this.updateInput() && !this.isHidden()) feedWaitCount++; } }; Window_Message.prototype.feedWaitCountClear = function () { feedWaitCount = 0; }; })(this);
const fs = require('fs'); const through = require('through2').obj; const PluginError = require('plugin-error'); const PLUGIN_NAME = 'gulp-inject-css'; module.exports = function () { 'use strict'; const PATTERN = /<\!--\s*inject-css\s*(.*?)\s*-->/gi; function styleInject(file, _enc, callback) { if (file.isNull()) { this.push(file); return callback(); } if (file.isStream()) { this.emit('error', new PluginError(PLUGIN_NAME, 'Stream not supported')); return callback(); } if (file.isBuffer()) { let contents = String(file.contents); contents = contents.replace(PATTERN, function (_match, src) { return ( '<style>\n' + fs.readFileSync(file.base + '/' + src) + '\n</style>' ); }); file.contents = Buffer.from(contents); this.push(file); return callback(); } return callback(); } return through(styleInject); };
import React from "react"; import ScrollTo from "./ScrollTo"; import SetActiveItem from "./SetActiveItem"; import logo_white from "../assets/images/halografix_light.svg"; import logo_dark from "../assets/images/halografix_primary.svg"; import menu_light from "../assets/images/menu-light.svg"; import menu_dark from "../assets/images/menu-dark.svg"; class Navbar extends React.Component { constructor() { super(); this.state = { isOpen: false, sticky: false, section: { home: "active", videography: "", livestream: "", addons: "", contact: "" } } } componentDidMount() { window.addEventListener("scroll", this.handleScroll); } componentWillUnmount() { window.removeEventListener("scroll", this.handleScroll); } handleScroll = () => { if (window.scrollY > 0) { this.setState({ sticky: true }); } else { this.setState({ sticky: false }); } if (SetActiveItem("home", 0)) { this.setState({ section: { home: "active" } }); } if (SetActiveItem("videography", 150)) { this.setState({ section: { videography: "active" } }); } if (SetActiveItem("livestream", 150)) { this.setState({ section: { livestream: "active" } }); } if (SetActiveItem("addons", 150)) { this.setState({ section: { addons: "active" } }); } if (SetActiveItem("contact", 300)) { this.setState({ section: { contact: "active" } }); } } handleToggle = () => { this.setState({ isOpen: !this.state.isOpen }); } handleClick = (event) => { let section = document.querySelector(event.target.name); ScrollTo(section, 1250, 125); this.handleToggle(); } render() { return ( <div className={this.state.sticky ? "navbar sticky" : "navbar"} id="navbar"> <div className="container"> <header> <div className="logo"> <a href="https://www.halografix.com"><img src={logo_white} className="logo-light" alt="logo" /></a> <a href="https://www.halografix.com"><img src={logo_dark} className="logo-dark hidden" alt="logo" /></a> </div> <div className="nav-btn"> <button type="button" className="nav-btn-light" onClick={this.handleToggle}> <img src={menu_light} alt="open navigation" /> </button> <button type="button" className="nav-btn-dark hidden" onClick={this.handleToggle}> <img src={menu_dark} alt="open navigation" /> </button> </div> </header> <nav> <ul className={this.state.isOpen ? "nav-links show-nav" : "nav-links"}> <li className={this.state.section.home}><button name="#home" onClick={this.handleClick}>home</button></li> <li className={this.state.section.videography}><button name="#videography" onClick={this.handleClick}>videography</button></li> <li className={this.state.section.livestream}><button name="#livestream" onClick={this.handleClick}>live stream</button></li> <li className={this.state.section.addons}><button name="#addons" onClick={this.handleClick}>add-ons</button></li> <li className={this.state.section.contact}><button name="#contact" onClick={this.handleClick}>contact</button></li> </ul> </nav> </div> </div> ); } } export default Navbar;
import styled from "styled-components"; import Colors from "theme/Colors"; // import tw, {theme} from "twin.macro"; export const Container = styled.div` background: #ffffff 0% 0% no-repeat padding-box; border-radius: 10px; -webkit-border-radius: 10px; box-shadow: 0px 3px 6px #00000029; overflow: hidden; max-width: 22rem; margin: 1rem; `; export const Form = styled.form` display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 2.19rem; & > .classInput { margin-bottom: 1.69rem; position: relative; & > label { display: inline-block; margin-bottom: 5px; } } `; export const StyledError = styled.div` color: ${Colors.redColor}; font-weight: 800; margin: 0 0 40px 0; `; export const StyleRedirect = styled.div` display: flex; justify-content: center; padding: 1rem 0 0 0; & > a { text-decoration: none; color: ${Colors.darkOrange}; margin: 0 0 0 0.2rem; } & > a:hover { color: ${Colors.darkBlue}; } `; export const StyleNotificationSuccess = styled.div` display: inline-flex; padding-top: 14px; padding-left: 11px; position: absolute; z-index: 0; margin-top: 32px; margin-left: 938px; width: 307px; height: 61px; background: #317126 0% 0% no-repeat padding-box; box-shadow: 0px 3px 6px #00000086; border-radius: 6px; opacity: 1; padding-left: 8px; `; /*Original export const StyleNotificationError = styled.div` display: inline-flex; padding-top: 14px; padding-left: 11px; position: absolute; z-index: 0; margin-top: 32px; margin-left: 938px; width: 307px; height: 61px; //background: #bc3434 0% 0% no-repeat padding-box; box-shadow: 0px 3px 6px #00000086; border-radius: 6px; opacity: 1; padding-left: 8px; `; */ /* Responsive version export const StyledNotificationContainer = styled.div` display: flex; justify-content: center; width: 100%; @media (min-width: 767px) { justify-content: flex-end; } `; */ /*Responsive version export const StyleNotificationError = styled.div` display: flex; flex-direction: row; justify-content: center; align-items: center; padding: 0rem 1rem 0rem 1rem; width: min(17rem); height: 4rem; border-radius: 6px; background: #bc3434; z-index: 10; position: absolute; margin-top: 6.5rem; margin-right: 0; @media (min-width: 768px) { margin-top: 1rem; margin-right: min(2%); } @media (min-width: 931px) { margin-right: min(10%); } `; */ //responsive with tw export const StyledNotificationContainer = styled.div.attrs({ className: "flex justify-center w-full md:justify-end", })``; //responsive with tw export const StyleNotificationError = styled.div.attrs({ className: "absolute flex flex-row justify-center items-center h-16 py-0 px-1 z-10 mr-0", })` width: min(17rem); border-radius: 6px; background: #bc3434; margin-top: 6.5rem; margin-left: 1rem; @media (min-width: 768px) { margin-top: 1rem; margin-right: min(2%); } @media (min-width: 931px) { margin-right: min(10%); } `; export const StyleNotificationMessage = styled.div` color: white; font: Helvetica-neue; font-size: 12px; letter-spacing: 0px; opacity: 1; line-height: 1.2; padding-left: 15px; `;
'use strict' const usuarios = require('./usuarios.js') const sesiones = require('./sesiones.js') const maestros = require('./maestros.js') const movimientos = require('./movimientos.js') module.exports = (app) => { usuarios(app, '/api/pub/usuarios') sesiones(app, '/api/pub/sesiones') maestros(app, '/api/pub/maestros') movimientos(app, '/api/priv/movimientos','/api/priv/saldos') }
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); require('../styles/scss/video-react.scss'); var _index = require('./index'); Object.keys(_index).forEach(function(key) { if (key === 'default' || key === '__esModule') return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _index[key]; } }); });
/*! * enquire.js v2.1.2 - Awesome Media Queries in JavaScript * Copyright (c) 2014 Nick Williams - http://wicky.nillia.ms/enquire.js * License: MIT (http://www.opensource.org/licenses/mit-license.php) */ ! function(a, b, c) { var d = window.matchMedia; "undefined" != typeof module && module.exports ? module.exports = c(d) : "function" == typeof define && define.amd ? define(function() { return b[a] = c(d) }) : b[a] = c(d) }("enquire", this, function(a) { "use strict"; function b(a, b) { var c, d = 0, e = a.length; for (d; e > d && (c = b(a[d], d), c !== !1); d++); } function c(a) { return "[object Array]" === Object.prototype.toString.apply(a) } function d(a) { return "function" == typeof a } function e(a) { this.options = a, !a.deferSetup && this.setup() } function f(b, c) { this.query = b, this.isUnconditional = c, this.handlers = [], this.mql = a(b); var d = this; this.listener = function(a) { d.mql = a, d.assess() }, this.mql.addListener(this.listener) } function g() { if (!a) throw new Error("matchMedia not present, legacy browsers require a polyfill"); this.queries = {}, this.browserIsIncapable = !a("only all").matches } return e.prototype = { setup: function() { this.options.setup && this.options.setup(), this.initialised = !0 }, on: function() { !this.initialised && this.setup(), this.options.match && this.options.match() }, off: function() { this.options.unmatch && this.options.unmatch() }, destroy: function() { this.options.destroy ? this.options.destroy() : this.off() }, equals: function(a) { return this.options === a || this.options.match === a } }, f.prototype = { addHandler: function(a) { var b = new e(a); this.handlers.push(b), this.matches() && b.on() }, removeHandler: function(a) { var c = this.handlers; b(c, function(b, d) { return b.equals(a) ? (b.destroy(), !c.splice(d, 1)) : void 0 }) }, matches: function() { return this.mql.matches || this.isUnconditional }, clear: function() { b(this.handlers, function(a) { a.destroy() }), this.mql.removeListener(this.listener), this.handlers.length = 0 }, assess: function() { var a = this.matches() ? "on" : "off"; b(this.handlers, function(b) { b[a]() }) } }, g.prototype = { register: function(a, e, g) { var h = this.queries, i = g && this.browserIsIncapable; return h[a] || (h[a] = new f(a, i)), d(e) && (e = { match: e }), c(e) || (e = [e]), b(e, function(b) { d(b) && (b = { match: b }), h[a].addHandler(b) }), this }, unregister: function(a, b) { var c = this.queries[a]; return c && (b ? c.removeHandler(b) : (c.clear(), delete this.queries[a])), this } }, new g });
import React from 'react'; import { useConnection } from './ConnectionProvider'; function ConnectOverlay() { const { connectWallet } = useConnection() return ( <div className="blur-bg"> <button className="clickable center" onClick={connectWallet}>Connect</button> </div> ); } export default ConnectOverlay;
import { Link } from 'react-router-dom'; import styled from 'styled-components'; export const PricingSection = styled.div` padding: 100px 0 160px; display: flex; flex-direction: column; justify-content: center; background: #4b59f7; `; export const PricingWrapper = styled.div` display: flex; flex-direction: column; align-items: center; margin: 0 auto; @media screen and (max-width: 960px) { margin: 0 30px; display: flex; flex-direction: column; align-items: center; } `; export const PricingHeading = styled.h1` color: #fff; font-size: 48px; margin-bottom: 24px; `; export const PricingContainer = styled.div` display: flex; justify-content: center; align-items: center; @media screen and (max-width: 960px) { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; } `; export const PricingCard = styled(Link)` background: #242424; box-shadow: 0 6px 20px rgba(56, 125, 255, 0.2); width: 280px; height: 500px; text-decoration: none; border-radius: 4px; &:nth-child(2) { margin: 24px; } &:hover { transform: scale(1.06); transition: all 0.3s ease-out; color: #1c2237; } @media screen and (max-width: 960px) { width: 90%; &:hover { transform: none; } } `; export const PricingCardInfo = styled.div` display: flex; flex-direction: column; height: 500px; padding: 24px; align-items: center; color: #fff; `; export const PricingCardIcon = styled.div` margin: 24px 0; `; export const PricingCardPlan = styled.h3` margin-bottom: 5px; font-size: 24px; `; export const PricingCardCost = styled.h4` font-size: 40px; `; export const PricingCardLength = styled.p` font-size: 14px; margin-bottom: 24px; `; export const PricingCardFeatures = styled.ul` margin: 16px 0 32px; list-style: none; display: flex; flex-direction: column; align-items: center; color: #a9b3c1; `; export const PricingCardFeature = styled.li` margin-bottom: 10px; `;
/** * @fileOverview interval shapes * @author dxq613@gmail.com * @author sima.zhang1990@gmail.com * @author huangtonger@aliyun.com */ var Util = require('../../util'); var Shape = require('./shape'); var PathUtil = require('../util/path'); var GPathUtil = require('@antv/g').PathUtil; var Global = require('../../global'); // 获取柱状图的几个点 function getRectPoints(cfg, isPyramid) { var x = cfg.x; var y = cfg.y; var y0 = cfg.y0; // 0 点的位置 var width = cfg.size; // 有3种情况, // 1. y,x都不是数组 // 2. y是数组,x不是 // 3. x是数组,y不是 var ymin = y0; var ymax = y; if (Util.isArray(y)) { ymax = y[1]; ymin = y[0]; } var xmin = void 0; var xmax = void 0; if (Util.isArray(x)) { xmin = x[0]; xmax = x[1]; } else { xmin = x - width / 2; xmax = x + width / 2; } var points = []; points.push({ x: xmin, y: ymin }, { x: xmin, y: ymax }); if (isPyramid) { points.push({ x: xmax, y: (ymax + ymin) / 2 }); } else { points.push({ x: xmax, y: ymax }, { x: xmax, y: ymin }); } return points; } function getRectPath(points) { var path = []; for (var i = 0; i < points.length; i++) { var point = points[i]; if (point) { var action = i === 0 ? 'M' : 'L'; path.push([action, point.x, point.y]); } } var first = points[0]; path.push(['L', first.x, first.y]); path.push(['z']); return path; } function getLinePoints(cfg) { var x = cfg.x; var y = cfg.y; var y0 = cfg.y0; // 0 点的位置 var points = []; if (Util.isArray(y)) { Util.each(y, function (yItem, idx) { points.push({ x: Util.isArray(x) ? x[idx] : x, y: yItem }); }); } else { points.push({ x: x, y: y }, { x: x, y: y0 }); } return points; } function getTickPoints(cfg) { var x = cfg.x; var y = Util.isArray(cfg.y) ? cfg.y[1] : cfg.y; var y0 = Util.isArray(cfg.y) ? cfg.y[0] : cfg.y0; var barWidth = cfg.size; var points = []; points.push({ x: x - barWidth / 2, y: y }, { x: x + barWidth / 2, y: y }, { x: x, y: y }, { x: x, y: y0 }, { x: x - barWidth / 2, y: y0 }, { x: x + barWidth / 2, y: y0 }); return points; } function getTickPath(points) { var path = []; path.push(['M', points[0].x, points[0].y], ['L', points[1].x, points[1].y], ['M', points[2].x, points[2].y], ['L', points[3].x, points[3].y], ['M', points[4].x, points[4].y], ['L', points[5].x, points[5].y]); return path; } function getFillAttrs(cfg) { var defaultAttrs = Global.shape.interval; var attrs = Util.mix({}, defaultAttrs, { fill: cfg.color, stroke: cfg.color, fillOpacity: cfg.opacity }, cfg.style); return attrs; } function getLineAttrs(cfg) { var defaultAttrs = Global.shape.hollowInterval; var attrs = Util.mix({}, defaultAttrs, { stroke: cfg.color, strokeOpacity: cfg.opacity }, cfg.style); return attrs; } function getFunnelPath(cfg, isFunnel) { var path = []; var points = cfg.points; var nextPoints = cfg.nextPoints; if (!Util.isNil(nextPoints)) { path.push(['M', points[0].x, points[0].y], ['L', points[1].x, points[1].y], ['L', nextPoints[1].x, nextPoints[1].y], ['L', nextPoints[0].x, nextPoints[0].y], ['Z']); } else if (isFunnel) { path.push(['M', points[0].x, points[0].y], ['L', points[1].x, points[1].y], ['L', points[2].x, points[2].y], ['L', points[3].x, points[3].y], ['Z']); } else { path.push(['M', points[0].x, points[0].y], ['L', points[1].x, points[1].y], ['L', points[2].x, points[2].y], ['L', points[2].x, points[2].y], ['Z']); } return path; } function getThetaCfg(point, coord) { var r = coord.getRadius(); var inner = coord.innerRadius; var startAngle = void 0; var endAngle = void 0; var ir = r * inner; var startPoint = void 0; var endPoint = void 0; if (!Util.isArray(point.x) && Util.isArray(point.y)) { point.x = [point.x, point.x]; // 如果x是一个值,y是数组,将x转成数组 } if (Util.isArray(point.x)) { startPoint = { x: point.x[0], y: point.y[0] }; endPoint = { x: point.x[1], y: point.y[1] }; startAngle = PathUtil.getPointAngle(coord, startPoint); endAngle = PathUtil.getPointAngle(coord, endPoint); if (endAngle <= startAngle) { // 考虑占比百分百的情形 endAngle = endAngle + Math.PI * 2; } } else { endPoint = point; startAngle = coord.startAngle; endAngle = PathUtil.getPointAngle(coord, endPoint); } return { r: r, ir: ir, startAngle: startAngle, endAngle: endAngle }; } // 获取选中时的样式,当前仅支持饼图 function _getSelectedCfg(type, cfg) { var geom = cfg.geom; var coord = geom.get('coord'); var point = cfg.point; var r = 7.5; var selectedCfg = void 0; if (coord && coord.type === 'theta') { var thetaCfg = getThetaCfg(point, coord); var middleAngle = (thetaCfg.endAngle - thetaCfg.startAngle) / 2 + thetaCfg.startAngle; var x = r * Math.cos(middleAngle); var y = r * Math.sin(middleAngle); selectedCfg = { transform: [['t', x, y]] }; } return Util.mix({}, selectedCfg); } var Interval = Shape.registerFactory('interval', { defaultShapeType: 'rect', getActiveCfg: function getActiveCfg(type, cfg) { if (!type || Util.inArray(['rect', 'funnel', 'pyramid'], type)) { // 透明度降低 0.15 var fillOpacity = cfg.fillOpacity || cfg.opacity || 1; return { fillOpacity: fillOpacity - 0.15 }; } var lineWidth = cfg.lineWidth || 0; return { lineWidth: lineWidth + 1 }; }, getDefaultPoints: function getDefaultPoints(pointInfo) { return getRectPoints(pointInfo); }, getSelectedCfg: function getSelectedCfg(type, cfg) { return _getSelectedCfg(type, cfg); } }); // 默认柱状图 Shape.registerShape('interval', 'rect', { draw: function draw(cfg, container) { var attrs = getFillAttrs(cfg); var path = getRectPath(cfg.points); path = this.parsePath(path); return container.addShape('path', { attrs: Util.mix(attrs, { path: path }) }); }, getMarkerCfg: function getMarkerCfg(cfg) { var rectCfg = getFillAttrs(cfg); var isInCircle = cfg.isInCircle; return Util.mix({ symbol: isInCircle ? 'circle' : 'square', radius: isInCircle ? 4.5 : 4 }, rectCfg); } }); // 空心柱状图 Shape.registerShape('interval', 'hollowRect', { draw: function draw(cfg, container) { var attrs = getLineAttrs(cfg); var path = getRectPath(cfg.points); path = this.parsePath(path); return container.addShape('path', { attrs: Util.mix(attrs, { path: path }) }); }, getMarkerCfg: function getMarkerCfg(cfg) { var rectCfg = getLineAttrs(cfg); var isInCircle = cfg.isInCircle; return Util.mix({ symbol: isInCircle ? 'circle' : 'square', radius: isInCircle ? 4.5 : 4 }, rectCfg); } }); // 线形柱状图 Shape.registerShape('interval', 'line', { getPoints: function getPoints(pointInfo) { return getLinePoints(pointInfo); }, draw: function draw(cfg, container) { var attrs = getLineAttrs(cfg); attrs.lineWidth = cfg.size || 1; // size 就是线的宽度 var path = getRectPath(cfg.points); path = this.parsePath(path); return container.addShape('path', { attrs: Util.mix(attrs, { path: path }) }); }, getMarkerCfg: function getMarkerCfg(cfg) { var lineCfg = getLineAttrs(cfg); return Util.mix({ symbol: 'line', radius: 5 }, lineCfg); } }); // 钉子形的柱状图 Shape.registerShape('interval', 'tick', { getPoints: function getPoints(pointInfo) { return getTickPoints(pointInfo); }, draw: function draw(cfg, container) { var attrs = getLineAttrs(cfg); var path = getTickPath(cfg.points); path = this.parsePath(path); return container.addShape('path', { attrs: Util.mix(attrs, { path: path }) }); }, getMarkerCfg: function getMarkerCfg(cfg) { var lineCfg = getLineAttrs(cfg); return Util.mix({ symbol: 'tick', radius: 5 }, lineCfg); } }); // 漏斗图 Shape.registerShape('interval', 'funnel', { getPoints: function getPoints(pointInfo) { pointInfo.size = pointInfo.size * 2; // 漏斗图的 size 是柱状图的两倍 return getRectPoints(pointInfo); }, draw: function draw(cfg, container) { var attrs = getFillAttrs(cfg); var path = getFunnelPath(cfg, true); path = this.parsePath(path); return container.addShape('path', { attrs: Util.mix(attrs, { path: path }) }); }, getMarkerCfg: function getMarkerCfg(cfg) { var funnelCfg = getFillAttrs(cfg); return Util.mix({ symbol: 'square', radius: 4 }, funnelCfg); } }); // 金字塔图 Shape.registerShape('interval', 'pyramid', { getPoints: function getPoints(pointInfo) { pointInfo.size = pointInfo.size * 2; // 漏斗图的 size 是柱状图的两倍 return getRectPoints(pointInfo, true); }, draw: function draw(cfg, container) { var attrs = getFillAttrs(cfg); var path = getFunnelPath(cfg, false); path = this.parsePath(path); return container.addShape('path', { attrs: Util.mix(attrs, { path: path }) }); }, getMarkerCfg: function getMarkerCfg(cfg) { var funnelCfg = getFillAttrs(cfg); return Util.mix({ symbol: 'square', radius: 4 }, funnelCfg); } }); // 水波图 /** * 用贝塞尔曲线模拟正弦波 * Using Bezier curves to fit sine wave. * There is 4 control points for each curve of wave, * which is at 1/4 wave length of the sine wave. * * The control points for a wave from (a) to (d) are a-b-c-d: * c *----* d * b * * | * ... a * .................. * * whose positions are a: (0, 0), b: (0.5, 0.5), c: (1, 1), d: (PI / 2, 1) * * @param {number} x x position of the left-most point (a) * @param {number} stage 0-3, stating which part of the wave it is * @param {number} waveLength wave length of the sine wave * @param {number} amplitude wave amplitude * @return {Array} 正弦片段曲线 */ function getWaterWavePositions(x, stage, waveLength, amplitude) { if (stage === 0) { return [[x + 1 / 2 * waveLength / Math.PI / 2, amplitude / 2], [x + 1 / 2 * waveLength / Math.PI, amplitude], [x + waveLength / 4, amplitude]]; } else if (stage === 1) { return [[x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 2), amplitude], [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 1), amplitude / 2], [x + waveLength / 4, 0]]; } else if (stage === 2) { return [[x + 1 / 2 * waveLength / Math.PI / 2, -amplitude / 2], [x + 1 / 2 * waveLength / Math.PI, -amplitude], [x + waveLength / 4, -amplitude]]; } return [[x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 2), -amplitude], [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 1), -amplitude / 2], [x + waveLength / 4, 0]]; } /** * 获取水波路径 * @param {number} radius 半径 * @param {number} waterLevel 水位 * @param {number} waveLength 波长 * @param {number} phase 相位 * @param {number} amplitude 震幅 * @param {number} cx 圆心x * @param {number} cy 圆心y * @return {Array} path 路径 * @reference http://gitlab.alipay-inc.com/datavis/g6/blob/1.2.0/src/graph/utils/path.js#L135 */ function getWaterWavePath(radius, waterLevel, waveLength, phase, amplitude, cx, cy) { var curves = Math.ceil(2 * radius / waveLength * 4) * 2; var path = []; // map phase to [-Math.PI * 2, 0] while (phase < -Math.PI * 2) { phase += Math.PI * 2; } while (phase > 0) { phase -= Math.PI * 2; } phase = phase / Math.PI / 2 * waveLength; var left = cx - radius + phase - radius * 2; /** * top-left corner as start point * * draws this point * | * \|/ * ~~~~~~~~ * | | * +------+ */ path.push(['M', left, waterLevel]); /** * top wave * * ~~~~~~~~ <- draws this sine wave * | | * +------+ */ var waveRight = 0; for (var c = 0; c < curves; ++c) { var stage = c % 4; var pos = getWaterWavePositions(c * waveLength / 4, stage, waveLength, amplitude); path.push(['C', pos[0][0] + left, -pos[0][1] + waterLevel, pos[1][0] + left, -pos[1][1] + waterLevel, pos[2][0] + left, -pos[2][1] + waterLevel]); if (c === curves - 1) { waveRight = pos[2][0]; } } /** * top-right corner * * ~~~~~~~~ * 3. draws this line -> | | <- 1. draws this line * +------+ * ^ * | * 2. draws this line */ path.push(['L', waveRight + left, cy + radius]); path.push(['L', left, cy + radius]); path.push(['L', left, waterLevel]); return path; } /** * 添加水波 * @param {number} x 中心x * @param {number} y 中心y * @param {number} level 水位等级 0~1 * @param {number} waveCount 水波数 * @param {number} colors 色值 * @param {number} group 图组 * @param {number} clip 用于剪切的图形 * @param {number} radius 绘制图形的高度 */ function addWaterWave(x, y, level, waveCount, colors, group, clip, radius) { var bbox = clip.getBBox(); var width = bbox.maxX - bbox.minX; var height = bbox.maxY - bbox.minY; var duration = 5000; var delayDiff = 300; for (var i = 0; i < waveCount; i++) { var wave = group.addShape('path', { attrs: { path: getWaterWavePath(radius, bbox.minY + height * level, width / 4, 0, width / 64, x, y), fill: colors[i], clip: clip } }); wave.animate({ transform: [['t', width / 2, 0]], repeat: true }, duration - i * delayDiff); } } Shape.registerShape('interval', 'liquid-fill-gauge', { draw: function draw(cfg, container) { var self = this; var cy = 0.5; var sumX = 0; var minX = Infinity; Util.each(cfg.points, function (p) { if (p.x < minX) { minX = p.x; } sumX += p.x; }); var cx = sumX / cfg.points.length; var cp = self.parsePoint({ x: cx, y: cy }); var minP = self.parsePoint({ x: minX, y: 0.5 }); var xWidth = cp.x - minP.x; var radius = Math.min(xWidth, minP.y); var attrs = getFillAttrs(cfg); var clipCircle = container.addShape('circle', { attrs: { x: cp.x, y: cp.y, r: radius } }); addWaterWave(cp.x, cp.y, cfg.y / (2 * cp.y), 1, [attrs.fill], container, clipCircle, radius * 4); return container.addShape('circle', { attrs: Util.mix(getLineAttrs(cfg), { x: cp.x, y: cp.y, r: radius + radius / 8 }) }); } }); var pathMetaCache = {}; Shape.registerShape('interval', 'liquid-fill-path', { draw: function draw(cfg, container) { var self = this; var attrs = Util.mix({}, getFillAttrs(cfg)); var path = cfg.shape[1]; var cy = 0.5; var sumX = 0; var minX = Infinity; Util.each(cfg.points, function (p) { if (p.x < minX) { minX = p.x; } sumX += p.x; }); var cx = sumX / cfg.points.length; var cp = self.parsePoint({ x: cx, y: cy }); var minP = self.parsePoint({ x: minX, y: 0.5 }); var xWidth = cp.x - minP.x; var radius = Math.min(xWidth, minP.y); var pathMeta = void 0; if (pathMetaCache[path]) { pathMeta = pathMetaCache[path]; } else { var segments = GPathUtil.parsePathString(path); pathMetaCache[path] = pathMeta = { segments: segments }; } var transform = []; if (attrs.rotate) { transform.push(['r', attrs.rotate / 180 * Math.PI]); delete attrs.rotate; } var shape = container.addShape('path', { attrs: Util.mix(attrs, { fillOpacity: 0, path: pathMeta.segments }) }); var bbox = Util.cloneDeep(shape.getBBox()); var rangeX = bbox.maxX - bbox.minX; var rangeY = bbox.maxY - bbox.minY; var range = Math.max(rangeX, rangeY); var scale = radius * 2 / range; shape.transform(transform.concat([['s', scale, scale]])); var dw = scale * rangeX / 2; // (bbox.maxX - bbox.minX) / 2; var dh = scale * rangeY / 2; // (bbox.maxY - bbox.minY) / 2; shape.transform([['t', cp.x - dw, cp.y - dh]]); addWaterWave(cp.x, cp.y, cfg.y / (2 * cp.y), 1, [attrs.fill], container, shape, minP.y * 4); var keyShape = container.addShape('path', { attrs: Util.mix(getLineAttrs(cfg), { path: pathMeta.segments }) }); keyShape.transform(transform.concat([['s', scale, scale], ['t', cp.x - dw, cp.y - dh]])); return keyShape; } }); Shape.registerShape('interval', 'top-line', { draw: function draw(cfg, container) { var attrs = getFillAttrs(cfg); var style = cfg.style || {}; var linePath = [['M', cfg.points[1].x, cfg.points[1].y], ['L', cfg.points[2].x, cfg.points[2].y]]; var lineAttrs = { stroke: style.stroke || 'white', lineWidth: style.lineWidth || 1, path: this.parsePath(linePath) }; var path = getRectPath(cfg.points); path = this.parsePath(path); delete attrs.stroke; // 不在柱子上绘制线 var rectShape = container.addShape('path', { attrs: Util.mix(attrs, { zIndex: 0, path: path }) }); container.addShape('path', { zIndex: 1, attrs: lineAttrs }); return rectShape; }, getMarkerCfg: function getMarkerCfg(cfg) { var rectCfg = getFillAttrs(cfg); var isInCircle = cfg.isInCircle; return Util.mix({ symbol: isInCircle ? 'circle' : 'square', radius: isInCircle ? 4.5 : 4 }, rectCfg); } }); module.exports = Interval;
import React from 'react'; import { Link } from 'react-router-dom'; import logo from '../Images/favicon.svg'; import PropTypes from 'prop-types'; import './EmptyPagePlaceholder.css'; export default function EmptyPagePlaceholder({ msg, linkTo, linkToMsg }) { return ( <div className="placeholder-container"> <img className="placeholder-logo" src={logo} alt="Kitty Friends Logo" /> <span className="placeholder-msg">{msg}</span> <Link className="btn btn-primary placeholder-link" to={linkTo}> {linkToMsg} </Link> </div> ); } EmptyPagePlaceholder.propTypes = { msg: PropTypes.string, linkTo: PropTypes.string, linkToMsg: PropTypes.string, };
window.common = (function({ $, common = { init: [] }}) { const stepClass = '.challenge-step'; const prevBtnClass = '.challenge-step-btn-prev'; const nextBtnClass = '.challenge-step-btn-next'; const actionBtnClass = '.challenge-step-btn-action'; const finishBtnClass = '.challenge-step-btn-finish'; const submitBtnId = '#challenge-step-btn-submit'; const submitModalId = '#challenge-step-modal'; function getPreviousStep($challengeSteps) { var $prevStep = false; var prevStepIndex = 0; $challengeSteps.each(function(index) { var $step = $(this); if (!$step.hasClass('hidden')) { prevStepIndex = index - 1; } }); $prevStep = $challengeSteps[prevStepIndex]; return $prevStep; } function getNextStep($challengeSteps) { var length = $challengeSteps.length; var $nextStep = false; var nextStepIndex = 0; $challengeSteps.each(function(index) { var $step = $(this); if ( !$step.hasClass('hidden') && index + 1 !== length ) { nextStepIndex = index + 1; } }); $nextStep = $challengeSteps[nextStepIndex]; return $nextStep; } function handlePrevStepClick(e) { e.preventDefault(); var prevStep = getPreviousStep($(stepClass)); $(this) .parent() .parent() .removeClass('slideInLeft slideInRight') .addClass('animated fadeOutRight fast-animation') .delay(250) .queue(function(prev) { $(this).addClass('hidden'); if (prevStep) { $(prevStep) .removeClass('hidden') .removeClass('fadeOutLeft fadeOutRight') .addClass('animated slideInLeft fast-animation') .delay(500) .queue(function(prev) { prev(); }); } prev(); }); } function handleNextStepClick(e) { e.preventDefault(); var nextStep = getNextStep($(stepClass)); $(this) .parent() .parent() .removeClass('slideInRight slideInLeft') .addClass('animated fadeOutLeft fast-animation') .delay(250) .queue(function(next) { $(this).addClass('hidden'); if (nextStep) { $(nextStep) .removeClass('hidden') .removeClass('fadeOutRight fadeOutLeft') .addClass('animated slideInRight fast-animation') .delay(500) .queue(function(next) { next(); }); } next(); }); } function handleActionClick(e) { var props = common.challengeSeed[0] || { stepIndex: [] }; var $el = $(this); var index = +$el.attr('id'); var propIndex = props.stepIndex.indexOf(index); if (propIndex === -1) { return $el.parent() .find('.disabled') .removeClass('disabled'); } // an API action // prevent link from opening e.preventDefault(); var prop = props.properties[propIndex]; var api = props.apis[propIndex]; if (common[prop]) { return $el.parent() .find('.disabled') .removeClass('disabled'); } return $.post(api) .done(function(data) { // assume a boolean indicates passing if (typeof data === 'boolean') { return $el.parent() .find('.disabled') .removeClass('disabled'); } // assume api returns string when fails return $el.parent() .find('.disabled') .replaceWith('<p>' + data + '</p>'); }) .fail(function() { console.log('failed'); }); } function handleFinishClick(e) { e.preventDefault(); $(submitModalId).modal('show'); $(submitModalId + '.modal-header').click(); $(submitBtnId).click(handleSubmitClick); } function handleSubmitClick(e) { e.preventDefault(); $('#submit-challenge') .attr('disabled', 'true') .removeClass('btn-primary') .addClass('btn-warning disabled'); var $checkmarkContainer = $('#checkmark-container'); $checkmarkContainer.css({ height: $checkmarkContainer.innerHeight() }); $('#challenge-checkmark') .addClass('zoomOutUp') .delay(1000) .queue(function(next) { $(this).replaceWith( '<div id="challenge-spinner" ' + 'class="animated zoomInUp inner-circles-loader">' + 'submitting...</div>' ); next(); }); $.ajax({ url: '/completed-challenge/', type: 'POST', data: JSON.stringify({ id: common.challengeId, name: common.challengeName, challengeType: +common.challengeType }), contentType: 'application/json', dataType: 'json' }) .success(function(res) { if (res) { window.location = '/challenges/next-challenge?id=' + common.challengeId; } }) .fail(function() { window.location.replace(window.location.href); }); } common.init.push(function($) { if (common.challengeType !== '7') { return null; } $(prevBtnClass).click(handlePrevStepClick); $(nextBtnClass).click(handleNextStepClick); $(actionBtnClass).click(handleActionClick); $(finishBtnClass).click(handleFinishClick); return null; }); return common; }(window));
const { GraphQLServer } = require("graphql-yoga"); const { Query } = require("./resolvers/Query"); const { Mutation } = require("./resolvers/Mutation"); const resolvers = { Query, Mutation }; const titles = [ { id: `title-0`, title: "new post" } ]; const server = new GraphQLServer({ typeDefs: "./src/schema.graphql", resolvers }); // const PORT = ""; server.start(_ => console.log(`your server is running on http://localhost:4000`) ); module.exports = { titles };
'use strict'; const Express = require('express'); const Axios = require('axios'); const NodeCache = require('node-cache'); const LAUNCHER_META_ENDPOINT = 'https://launchermeta.mojang.com'; const VERSION_MANIFEST_URI = `${LAUNCHER_META_ENDPOINT}/mc/game/version_manifest.json`; const CACHE_MANIFEST = 'versionManifest'; const CACHE_DESCRIPTOR = 'descriptor'; const cache = new NodeCache({ stdTTL: parseInt(process.env.CACHE_TTL || 600) }); const client = Axios.create(); const app = Express(); async function getVersionManifest() { const cached = cache.get(CACHE_MANIFEST); if (cached) { return cached; } const manifest = (await client.get(VERSION_MANIFEST_URI))?.data; if (!manifest) { throw new Error('Null manifest!'); } cache.set(CACHE_MANIFEST, manifest); return manifest; } async function getVersionDescriptor(version) { const cached = cache.get(`${CACHE_DESCRIPTOR}${version}`); if (cached) { return cached; } const manifest = await getVersionManifest(); const descriptorUrl = manifest.versions.find(current => current.id === version)?.url; if (!descriptorUrl) { throw new Error(`Unknown version ${version}`); } const descriptor = (await client.get(descriptorUrl))?.data; if (!descriptor) { throw new Error('Null descriptor!'); } cache.set(`${CACHE_DESCRIPTOR}${version}`, descriptor); return descriptor; } app.get('/minecraft/version/:version', async (request, response) => { let version; if (['release', 'snapshot'].includes(request.params.version)) { const manifest = await getVersionManifest(); if (request.params.version === 'release') { version = manifest.latest.release; } else if (request.params.version === 'snapshot') { version = manifest.latest.release; } } else { version = request.params.version; } const descriptor = await getVersionDescriptor(version); if (!descriptor) { response.status(404); response.send(`No such version '${request.params.version}'`); return; } response.json(descriptor); }); app.get('/minecraft/version/:version/download/:download', async (request, response) => { const manifest = await getVersionManifest(); let version; switch (request.params.version) { case 'release': version = manifest.latest.release; break; case 'snapshot': version = manifest.latest.release; break; default: version = request.params.version; } const descriptor = await getVersionDescriptor(version); const downloadUrl = descriptor.downloads[request.params.download]?.url; if (!downloadUrl) { response.status(404); response.send(`No such download '${request.params.download}'`); return; } response.redirect(downloadUrl); }); app.listen(process.env.PORT || 3000);
// This example adds a search box to a map, using the Google Place Autocomplete // feature. People can enter geographical searches. The search box will return a // pick list containing a mix of places and predicted search terms. // This example requires the Places library. Include the libraries=places // parameter when you first load the API. For example: // <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places"> let userMap; function initAutocomplete() { const map = new google.maps.Map(document.getElementById("map"), { center: { lat: 40.730610, lng: -73.935242 }, zoom: 11, mapTypeId: "roadmap", }); // Create the search box and link it to the UI element. const input = document.getElementById("userMap"); const searchBox = new google.maps.places.SearchBox(input); map.controls[google.maps.ControlPosition.TOP_LEFT].push(input); // Bias the SearchBox results towards current map's viewport. map.addListener("bounds_changed", () => { searchBox.setBounds(map.getBounds()); }); let markers = []; // Listen for the event fired when the user selects a prediction and retrieve // more details for that place. searchBox.addListener("places_changed", () => { const places = searchBox.getPlaces(); userMap = document.getElementById("userMap").value console.log(userMap) if (places.length == 0) { return; } // Clear out the old markers. markers.forEach((marker) => { marker.setMap(null); }); markers = []; // For each place, get the icon, name and location. const bounds = new google.maps.LatLngBounds(); places.forEach((place) => { if (!place.geometry || !place.geometry.location) { console.log("Returned place contains no geometry"); return; } const icon = { url: place.icon, size: new google.maps.Size(71, 71), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(17, 34), scaledSize: new google.maps.Size(25, 25), }; // Create a marker for each place. markers.push( new google.maps.Marker({ map, icon, title: place.name, position: place.geometry.location, }) ); if (place.geometry.viewport) { // Only geocodes have viewport. bounds.union(place.geometry.viewport); } else { bounds.extend(place.geometry.location); } }); map.fitBounds(bounds); }); console.log("map.js loaded"); }
import React from 'react'; import clsx from 'clsx'; import Layout from '@theme/Layout'; import Link from '@docusaurus/Link'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import useBaseUrl from '@docusaurus/useBaseUrl'; import styles from './styles.module.css'; const features = [ { title: 'Simple and Effective', imageUrl: 'img/hand.svg', description: ( <> RTK Query is a <b>simple to use data fetching and caching library</b> that solves the majority of use cases, with advanced configuration options to fit your needs </> ), }, { title: 'Built on Redux', imageUrl: 'img/redux.svg', description: ( <> RTK Query is <b>built on top of Redux Toolkit</b>, so it integrates with the Redux ecosystem and DevTools </> ), }, { title: 'Framework Agnostic', imageUrl: 'img/checklist.svg', description: ( <> RTK Query <b>runs anywhere Redux runs</b> and isn't limited to React. RTK Query <b>provides React Hooks</b> for convenience, and it's a breeze to <b>integrate with Svelte, Vue, or any other framework of your choice</b>. </> ), }, { title: 'Developer Experience', imageUrl: 'img/brain.svg', description: ( <> RTK Query is <b>built entirely with TypeScript</b>, giving TS and JS users a first-class experience out of the box, and comes with opinionated defaults for common patterns. </> ), }, ]; function Feature({ imageUrl, title, description }) { const imgUrl = useBaseUrl(imageUrl); return ( <div className={clsx('col col--3 text--center', styles.feature)}> {imgUrl && ( <div className="text--center"> <img className={styles.featureImage} src={imgUrl} alt={title} /> </div> )} <h2>{title}</h2> <p>{description}</p> </div> ); } const featuresToPaths = { 'Supports any protocol': null, 'Declarative API definitions': '/api/createApi#createapi', Caching: '/concepts/queries#avoiding-unnecessary-requests', 'Automatic re-fetching': '/concepts/mutations#advanced-mutations-with-revalidation', Polling: '/concepts/polling', 'Parallel queries': '', 'Dependent queries': '/concepts/conditional-fetching', 'Paginated queries': '/concepts/pagination', 'Skip queries': '/concepts/conditional-fetching', 'Lagged queries': '/concepts/conditional-fetching', 'Automatic garbage collection': '/api/createApi#keepunuseddatafor', Prefetching: '/concepts/prefetching', 'Optimistic Updates': '/concepts/optimistic-updates', 'Auto-generated React Hooks': '/api/createApi#auto-generated-hooks', 'Runs on every framework': null, 'Built with TypeScript': null, }; const Checkmark = () => { return ( <svg className={styles.checkmark} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52"> <circle className={styles.checkmark__circle} cx="26" cy="26" r="25" fill="none" /> <path className={styles.checkmark__check} fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8" /> </svg> ); }; function LibFeature({ title, link }) { return ( <div className={clsx('col col--3 text--left', styles.feature)}> <p> <Checkmark /> {link ? <Link to={link}>{title}</Link> : title} </p> </div> ); } function Home() { const context = useDocusaurusContext(); const { siteConfig = {} } = context; return ( <Layout title={`${siteConfig.title} - ${siteConfig.tagline}`} description="RTK Query is an advanced data fetching and caching tool, designed to simplify common cases for loading data in a web application." > <header className={clsx('hero hero--primary', styles.heroBanner)}> <div className="container"> <h1 className="hero__title">{siteConfig.title}</h1> <h2 className="hero__subtitle">{siteConfig.tagline}</h2> <p className="hero__subtitle"> Caching and network request management can be hard. RTK Query simplifies data fetching so you can focus on building your product. </p> <div className={styles.buttons}> <Link className={clsx('button button--secondary button--lg', styles.getStarted)} to={useBaseUrl('introduction/getting-started')} > Get Started </Link> </div> </div> </header> <main> {features && features.length > 0 && ( <section className={styles.features}> <div className="container"> <div className="row"> {features.map((props, idx) => ( <Feature key={idx} {...props} /> ))} </div> </div> </section> )} <section className={`${styles.features} ${styles.grayBg}`}> <div className="container"> <div> <h2 className="text--center">Features</h2> </div> <div className={`row text--center`}> {Object.entries(featuresToPaths).map(([title, link], idx) => ( <LibFeature key={idx} title={title} link={link} /> ))} </div> </div> </section> </main> </Layout> ); } export default Home;
'use strict'; const path = require('path'); const confusingBrowserGlobals = require('confusing-browser-globals'); module.exports = { extends: path.join(__dirname, 'index.js'), env: { node: false, browser: true, }, rules: { 'no-restricted-globals': [ 'error', ...confusingBrowserGlobals, ], }, };
'use strict'; var grunt = require('grunt'); /* ======== A Handy Little Nodeunit Reference ======== https://github.com/caolan/nodeunit Test methods: test.expect(numAssertions) test.done() Test assertions: test.ok(value, [message]) test.equal(actual, expected, [message]) test.notEqual(actual, expected, [message]) test.deepEqual(actual, expected, [message]) test.notDeepEqual(actual, expected, [message]) test.strictEqual(actual, expected, [message]) test.notStrictEqual(actual, expected, [message]) test.throws(block, [error], [message]) test.doesNotThrow(block, [error], [message]) test.ifError(value) */ exports.daedlink = { setUp: function(done) { // setup here if necessary done(); }, default_options: function(test) { test.expect(1); var actual = grunt.file.read('tmp/default_options'); var expected = grunt.file.read('test/expected/default_options'); test.equal(actual, expected, 'should describe what the default behavior is.'); test.done(); }, custom_options: function(test) { test.expect(1); var actual = grunt.file.read('tmp/custom_options'); var expected = grunt.file.read('test/expected/custom_options'); test.equal(actual, expected, 'should describe what the custom option(s) behavior is.'); test.done(); }, };
import './index.scss'; import $ from 'jquery'; import assets from './assets'; import header from '../partials/header'; import footer from '../partials/footer'; function Ecosystem(router, api) { this.router = router; this.templateIndex = require('./index.html'); } Ecosystem.prototype = { index: function () { let self = this; $('title').html('Mixin Official Website'); $('body').attr('class', 'ecosystem layout'); let wallets = [ { logo: assets.mixin_logo, cover: assets.mixin, name: "ecosystem.messenger.name", description: "ecosystem.messenger.description", address: "/messenger", }, { class: "revert", logo: assets.fennec_log, cover: assets.fennec, name: "ecosystem.fennec.name", description: "ecosystem.fennec.description", address: "https://github.com/fox-one/fennec", }, ]; let defi = [ { logo: assets.foxswap, name: "ecosystem.4swap.name", description: "ecosystem.4swap.description", }, { logo: assets.leaf, name: "ecosystem.leaf.name", description: "ecosystem.leaf.description", }, { logo: assets.rings, name: "ecosystem.rings.name", description: "ecosystem.rings.description", }, { logo: assets.mixswap, name: "ecosystem.mixswap.name", description: "ecosystem.mixswap.description", }, { logo: assets.exinlocal_defi, name: "ecosystem.exinlocal.name", description: "ecosystem.exinlocal.description", }, { logo: assets.optiondance, name: "ecosystem.optiondance.name", description: "ecosystem.optiondance.description", }, ]; let datas = [0, 0, 0 , 0, 0]; let partners = [ { class: "brands", data: datas.fill([ { logo: assets.links, name: "Links", }, { logo: assets.poolin, name: "Poolin", }, { logo: assets.exinone, name: "Exin", }, { logo: assets.fox, name: "Fox", }, { logo: assets.quorum, name: "Quorum", }, { logo: assets.bigone, name: "BigONE", }, ]).flat(), }, { class: "ecosystems", data: datas.fill([ { logo: assets.exinearn, name: "ExinEarn", }, { logo: assets.coinview, name: "CoinView", }, { logo: assets.pando, name: "Pando", }, { logo: assets.blockchair, name: "BlockChair", }, ]).flat(), }, { class: "coins", data: datas.fill([ { logo: assets.tron, name: "Tron", }, { logo: assets.hzn, name: "Horizen", }, { logo: assets.dot, name: "Polkadot", }, { logo: assets.mob, name: "MobileCoin", }, { logo: assets.vcash, name: "VCash", }, ]).flat(), } ] let apps = [ { logo: assets.links, type: "ecosystem.links.type", name: "ecosystem.links.name", description: "ecosystem.links.description", }, { logo: assets.exinearn, type: "ecosystem.exinearn.type", name: "ecosystem.exinearn.name", description: "ecosystem.exinearn.description", }, { logo: assets.exinone, type: "ecosystem.exinone.type", name: "ecosystem.exinone.name", description: "ecosystem.exinone.description", }, { logo: assets.blockchair, type: "ecosystem.blockchair.type", name: "ecosystem.blockchair.name", description: "ecosystem.blockchair.description", }, { logo: assets.bwatch, type: "ecosystem.bwatch.type", name: "ecosystem.bwatch.name", description: "ecosystem.bwatch.description", }, { logo: assets.exinlocal, type: "ecosystem.exinlocal.type", name: "ecosystem.exinlocal.name", description: "ecosystem.exinlocal.description", }, { logo: assets.oceanone, type: "ecosystem.oceanone.type", name: "ecosystem.oceanone.name", description: "ecosystem.oceanone.description", }, { logo: assets.bigdex, type: "ecosystem.bigdex.type", name: "ecosystem.bigdex.name", description: "ecosystem.bigdex.description", }, { logo: assets.coinview, type: "ecosystem.coinview.type", name: "ecosystem.coinview.name", description: "ecosystem.coinview.description", }, ]; let index = self.templateIndex({ slogan: 'ecosystem.slogan', wallets: wallets, partners: partners, defi: defi, apps: apps, ...header, ...footer }); $('#layout-container').html(index); self.router.updatePageLinks(); $('.ic_down').click(function() { $([document.documentElement, document.body]).animate({ scrollTop: $(".wallets").offset().top }, 1000); }); }, }; export default Ecosystem;
import { combineReducers } from 'redux'; import user from './reducers/user'; import auth from './reducers/auth'; import events from './reducers/events'; import loading from './reducers/loading.reducer'; import error from './reducers/error.reducer'; import event from './reducers/event.reducer'; export default combineReducers({ user, auth, events, event, error, loading });
var createScene = function (engine, canvas) { var scene = new BABYLON.Scene(engine); // Setup camera var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 10, BABYLON.Vector3.Zero(), scene); camera.setPosition(new BABYLON.Vector3(-10, 10, 0)); camera.attachControl(canvas, true); // Lights var light0 = new BABYLON.PointLight("Omni0", new BABYLON.Vector3(0, 10, 0), scene); var light1 = new BABYLON.PointLight("Omni1", new BABYLON.Vector3(0, -10, 0), scene); var light2 = new BABYLON.PointLight("Omni2", new BABYLON.Vector3(10, 0, 0), scene); var light3 = new BABYLON.DirectionalLight("Dir0", new BABYLON.Vector3(1, -1, 0), scene); var material = new BABYLON.StandardMaterial("kosh", scene); var sphere = BABYLON.Mesh.CreateSphere("Sphere", 16, 3, scene); // Creating light sphere var lightSphere0 = BABYLON.Mesh.CreateSphere("Sphere0", 16, 0.5, scene); var lightSphere1 = BABYLON.Mesh.CreateSphere("Sphere1", 16, 0.5, scene); var lightSphere2 = BABYLON.Mesh.CreateSphere("Sphere2", 16, 0.5, scene); lightSphere0.material = new BABYLON.StandardMaterial("red", scene); lightSphere0.material.diffuseColor = new BABYLON.Color3(0, 0, 0); lightSphere0.material.specularColor = new BABYLON.Color3(0, 0, 0); lightSphere0.material.emissiveColor = new BABYLON.Color3(1, 0, 0); lightSphere1.material = new BABYLON.StandardMaterial("green", scene); lightSphere1.material.diffuseColor = new BABYLON.Color3(0, 0, 0); lightSphere1.material.specularColor = new BABYLON.Color3(0, 0, 0); lightSphere1.material.emissiveColor = new BABYLON.Color3(0, 1, 0); lightSphere2.material = new BABYLON.StandardMaterial("blue", scene); lightSphere2.material.diffuseColor = new BABYLON.Color3(0, 0, 0); lightSphere2.material.specularColor = new BABYLON.Color3(0, 0, 0); lightSphere2.material.emissiveColor = new BABYLON.Color3(0, 0, 1); // Sphere material material.diffuseColor = new BABYLON.Color3(1, 1, 1); sphere.material = material; // Lights colors light0.diffuse = new BABYLON.Color3(1, 0, 0); light0.specular = new BABYLON.Color3(1, 0, 0); light1.diffuse = new BABYLON.Color3(0, 1, 0); light1.specular = new BABYLON.Color3(0, 1, 0); light2.diffuse = new BABYLON.Color3(0, 0, 1); light2.specular = new BABYLON.Color3(0, 0, 1); light3.diffuse = new BABYLON.Color3(1, 1, 1); light3.specular = new BABYLON.Color3(1, 1, 1); // Animations var alpha = 0; scene.beforeRender = function () { light0.position = new BABYLON.Vector3(10 * Math.sin(alpha), 0, 10 * Math.cos(alpha)); light1.position = new BABYLON.Vector3(10 * Math.sin(alpha), 0, -10 * Math.cos(alpha)); light2.position = new BABYLON.Vector3(10 * Math.cos(alpha), 0, 10 * Math.sin(alpha)); lightSphere0.position = light0.position; lightSphere1.position = light1.position; lightSphere2.position = light2.position; alpha += 0.01; }; return scene; } var renderCanvas = document.getElementById('renderCanvas'); var engine = new BABYLON.Engine(renderCanvas); var scene = createScene(engine, renderCanvas); // Do not render. // engine.runRenderLoop(function() { // scene.render(); // });
import React, { useRef, useEffect } from 'react'; import { graphql } from 'gatsby'; import PropTypes from 'prop-types'; import { Helmet } from 'react-helmet'; import styled from 'styled-components'; import { srConfig } from '@config'; import sr from '@utils/sr'; import { Layout } from '@components'; import { Icon } from '@components/icons'; const StyledTableContainer = styled.div` margin: 100px -20px; @media (max-width: 768px) { margin: 50px -10px; } table { width: 100%; border-collapse: collapse; .hide-on-mobile { @media (max-width: 768px) { display: none; } } tbody tr { &:hover, &:focus { background-color: var(--light-navy); } } th, td { padding: 10px; text-align: left; &:first-child { padding-left: 20px; @media (max-width: 768px) { padding-left: 10px; } } &:last-child { padding-right: 20px; @media (max-width: 768px) { padding-right: 10px; } } svg { width: 20px; height: 20px; } } tr { cursor: default; td:first-child { border-top-left-radius: var(--border-radius); border-bottom-left-radius: var(--border-radius); } td:last-child { border-top-right-radius: var(--border-radius); border-bottom-right-radius: var(--border-radius); } } td { &.year { padding-right: 20px; @media (max-width: 768px) { padding-right: 10px; font-size: var(--fz-sm); } } &.title { padding-top: 15px; padding-right: 20px; color: var(--lightest-slate); font-size: var(--fz-xl); font-weight: 600; line-height: 1.25; } &.company { font-size: var(--fz-lg); white-space: nowrap; } &.tech { font-size: var(--fz-xxs); font-family: var(--font-mono); line-height: 1.5; .separator { margin: 0 5px; } span { display: inline-block; } } &.links { min-width: 100px; div { display: flex; align-items: center; a { ${({ theme }) => theme.mixins.flexCenter}; flex-shrink: 0; } a + a { margin-left: 10px; } } } } } `; const ArchivePage = ({ location, data }) => { const projects = data.allMarkdownRemark.edges; const revealTitle = useRef(null); const revealTable = useRef(null); const revealProjects = useRef([]); useEffect(() => { sr.reveal(revealTitle.current, srConfig()); sr.reveal(revealTable.current, srConfig(200, 0)); revealProjects.current.forEach((ref, i) => sr.reveal(ref, srConfig(i * 10))); }, []); return ( <Layout location={location}> <Helmet title="Archive" /> <main> <header ref={revealTitle}> <h1 className="big-heading">Archive</h1> <p className="subtitle">A big list of things I’ve worked on</p> </header> <StyledTableContainer ref={revealTable}> <table> <thead> <tr> <th>Year</th> <th>Title</th> <th className="hide-on-mobile">Made at</th> <th className="hide-on-mobile">Built with</th> <th>Link</th> </tr> </thead> <tbody> {projects.length > 0 && projects.map(({ node }, i) => { const { date, github, external, ios, android, title, tech, company } = node.frontmatter; return ( <tr key={i} ref={el => (revealProjects.current[i] = el)}> <td className="overline year">{`${new Date(date).getFullYear()}`}</td> <td className="title">{title}</td> <td className="company hide-on-mobile"> {company ? <span>{company}</span> : <span>—</span>} </td> <td className="tech hide-on-mobile"> {tech.length > 0 && tech.map((item, i) => ( <span key={i}> {item} {''} {i !== tech.length - 1 && <span className="separator">&middot;</span>} </span> ))} </td> <td className="links"> <div> {external && ( <a href={external} aria-label="External Link"> <Icon name="External" /> </a> )} {github && ( <a href={github} aria-label="GitHub Link"> <Icon name="GitHub" /> </a> )} {ios && ( <a href={ios} aria-label="Apple App Store Link"> <Icon name="AppStore" /> </a> )} {android && ( <a href={android} aria-label="Google Play Store Link"> <Icon name="PlayStore" /> </a> )} </div> </td> </tr> ); })} </tbody> </table> </StyledTableContainer> </main> </Layout> ); }; ArchivePage.propTypes = { location: PropTypes.object.isRequired, data: PropTypes.object.isRequired, }; export default ArchivePage; export const pageQuery = graphql` { allMarkdownRemark( filter: { fileAbsolutePath: { regex: "/projects/" } } sort: { fields: [frontmatter___date], order: DESC } ) { edges { node { frontmatter { date title tech github external ios android company } html } } } } `;
var pageNumber = 0; var hasAppend = false; var hasMoreContent = true; $("#simplePostList").scroll(function(){ viewH =$(this).height(),//可见高度 contentH =$("#simplePostUl").height(),//内容高度 scrollTop =$(this).scrollTop();//滚动高度 //if(contentH - viewH - scrollTop <= 100) { //到达底部100px时,加载新内容 if(scrollTop/(contentH-viewH)>0.99 && !hasAppend && hasMoreContent){ hasAppend = true; getPage(++pageNumber); } }); function getPage(pageNumber) { var load = '<li class="simplePost loading">\ <p align="center" style="color:green; font-family:consolas;font-size:20px;">loading...</p>\ <li>'; $("#simplePostUl").append(load); $.ajax({ type: "POST", url: hostname+'/course/discussion/get-simple-page', data: {pageNumber:pageNumber}, dataType : 'text', success: function (data) { if(data.length<5) hasMoreContent = false; $(".loading").remove(); $("#simplePostUl").append(data); hasAppend = false; }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert(XMLHttpRequest.statusText); } }); } function show() { viewH =$("#simplePostList").height(),//可见高度 contentH =$("#simplePostUl").height(),//内容高度 scrollTop =$("#simplePostList").scrollTop();//滚动高度 alert("contentH="+contentH+",viewH="+viewH+",scrollTop"+scrollTop); }
const express = require("express"); const router = express.Router(); const Register = require("./controllers/register"); const Login = require("./controllers/login"); const PatientControllers = require("./controllers/patient-controllers"); const ProfessionalControllers = require("./controllers/professional-controllers"); //account creation routes router.get("/", Register.test); router.get("/get_code", Register.getCode); router.get("/verify", Register.verify); router.post("/register", Register.register); //login routes router.get("/login", Login.signIn); //patient data routes router.get("/patient/get_profile", PatientControllers.getProfile); router.get("/patient/view", PatientControllers.viewFile); router.post("/patient/upload_file", PatientControllers.uploadFile); router.post("/patient/delete_file", PatientControllers.deleteFile); router.post("/patient/change_filename", PatientControllers.changeFileName); router.post("/patient/process_request", PatientControllers.processRequest); router.post("/patient/ban_professional", PatientControllers.banProfessional); router.get( "/patient/get_unprocessed_requests", PatientControllers.getUnprocessedRequests ); router.get( "/patient/get_authorized_professionals", PatientControllers.getAuthorizedProfessionals ); //professonal data routes router.get("/professional/get_profile", ProfessionalControllers.getProfile); router.get( "/professional/view_patient_file", ProfessionalControllers.viewPatientFile ); router.post( "/professional/request_access", ProfessionalControllers.requestAccess ); router.get( "/professional/get_pending_requests", ProfessionalControllers.getPendingRequests ); module.exports = router;
window._ = require('lodash'); try { require('bootstrap'); } catch (e) {} /** * We'll load the axios HTTP library which allows us to easily issue requests * to our Laravel back-end. This library automatically handles sending the * CSRF token as a header based on the value of the "XSRF" token cookie. */ window.axios = require('axios'); const token = `Bearer${localStorage.getItem('token')}`; window.axios.defaults.headers.common['Authorization'] = token; window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; /** * Echo exposes an expressive API for subscribing to channels and listening * for events that are broadcast by Laravel. Echo and event broadcasting * allows your team to easily build robust real-time web applications. */ import Echo from 'laravel-echo'; window.Pusher = require('pusher-js'); window.Echo = new Echo({ broadcaster: 'pusher', key: "c5ff732d880f53a023ff", cluster: "eu", forceTLS: true, auth:{ headers:{ Authorization : token } } });
import React, {useEffect, useState, useRef} from "react"; import {useDispatch, useSelector} from "react-redux"; import {connect} from "./redux/blockchain/blockchainActions"; import {fetchData} from "./redux/data/dataActions"; import * as s from "./styles/globalStyles"; import styled from "styled-components"; import './styles/evolution-apez.webflow-v1.css' import Particles from "react-tsparticles"; // import './styles/cube.css' import logo from './images/logo.png' const truncate = (input, len) => input.length > len ? `${input.substring(0, len)}...` : input; export const StyledButton = styled.button` padding: 10px; border-radius: 50px; border: none; background-color: var(--secondary); padding: 10px; font-weight: bold; color: var(--secondary-text); width: 100px; cursor: pointer; box-shadow: 0px 6px 0px -2px rgba(250, 250, 250, 0.3); -webkit-box-shadow: 0px 6px 0px -2px rgba(250, 250, 250, 0.3); -moz-box-shadow: 0px 6px 0px -2px rgba(250, 250, 250, 0.3); :active { box-shadow: none; -webkit-box-shadow: none; -moz-box-shadow: none; } `; export const StyledRoundButton = styled.button` padding: 10px; border-radius: 30%; border: none; background-color: var(--primary); padding: 10px; font-weight: bold; font-size: 24px; fontStyle: "Ubuntu" color: var(--primary-text); width: 30px; height: 30px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0px 4px 0px -2px rgba(250, 250, 250, 0.3); -webkit-box-shadow: 0px 4px 0px -2px rgba(250, 250, 250, 0.3); -moz-box-shadow: 0px 4px 0px -2px rgba(250, 250, 250, 0.3); :active { box-shadow: none; -webkit-box-shadow: none; -moz-box-shadow: none; } `; export const ResponsiveWrapper = styled.div` display: flex; flex: 1; flex-direction: column; justify-content: stretched; align-items: stretched; width: 100%; @media (min-width: 1087px) { flex-direction: row; } z-index: 5; `; export const StyledLogo = styled.img` width: 200px; @media (min-width: 767px) { width: 300px; } transition: width 0.5s; transition: height 0.5s; z-index: 5; `; export const StyledImg = styled.img` box-shadow: 0px 5px 11px 2px rgba(0, 0, 0, 0.7); border: 4px solid var(--secondary); background-color: var(--accent); border-radius: 100%; width: 200px; @media (max-width: 600px) { display: none; } @media (min-width: 1000px) { width: 300px; } transition: width 0.5s; `; export const StyledLink = styled.a` color: var(--secondary); text-decoration: none; `; function App() { const dispatch = useDispatch(); const particleState = 'links' // links || circle || polygon const blockchain = useSelector((state) => state.blockchain); const data = useSelector((state) => state.data); const [claimingNft, setClaimingNft] = useState(false); const [feedback, setFeedback] = useState(`Click 'MINT' to adopt your Billionaire Babies!`); const [mintAmount, setMintAmount] = useState(1); const [CONFIG, SET_CONFIG] = useState({ CONTRACT_ADDRESS: "", SCAN_LINK: "", NETWORK: { NAME: "", SYMBOL: "", ID: 0, }, NFT_NAME: "", SYMBOL: "", MAX_SUPPLY: 2100, WEI_COST: 0, DISPLAY_COST: 0, GAS_LIMIT: 0, MARKETPLACE: "", MARKETPLACE_LINK: "", SHOW_BACKGROUND: false, }); const [count, setCount] = useState(1) const minus_handle = () => { if (count !== 0) setCount(count - 1) } const positive_handle = () => { setCount(count + 1) } const claimNFTs = () => { let cost = CONFIG.WEI_COST; let gasLimit = CONFIG.GAS_LIMIT; let totalCostWei = String(cost * mintAmount); let totalGasLimit = String(gasLimit * mintAmount); console.log("Cost: ", totalCostWei); console.log("Gas limit: ", totalGasLimit); setFeedback(`Minting your Billionaire Baby...`); setClaimingNft(true); blockchain.smartContract.methods .mint(blockchain.account, mintAmount) .send({ gasLimit: String(totalGasLimit), to: CONFIG.CONTRACT_ADDRESS, from: blockchain.account, value: totalCostWei, }) .once("error", (err) => { console.log(err); setFeedback("Sorry, something went wrong please try again later."); setClaimingNft(false); }) .then((receipt) => { console.log(receipt); setFeedback( `Yay! You're now a happy parent! Head over to https://opensea.io/collection/billionairebabyclubnftofficial to view it!` ); setClaimingNft(false); dispatch(fetchData(blockchain.account)); }); }; const decrementMintAmount = () => { let newMintAmount = mintAmount - 1; if (newMintAmount < 1) { newMintAmount = 1; } setMintAmount(newMintAmount); }; const incrementMintAmount = () => { let newMintAmount = mintAmount + 1; if (newMintAmount > 20) { newMintAmount = 20; } setMintAmount(newMintAmount); }; const getData = () => { if (blockchain.account !== "" && blockchain.smartContract !== null) { dispatch(fetchData(blockchain.account)); } }; const getConfig = async () => { const configResponse = await fetch("/config/config.json", { headers: { "Content-Type": "application/json", Accept: "application/json", }, }); const config = await configResponse.json(); SET_CONFIG(config); }; useEffect(() => { getConfig(); }, []); useEffect(() => { getData(); }, [blockchain.account]); return ( <div style={{width: '100%', height: '100%'}}> <Particles style={{zIndex: -1}} options={{ background: { color: { value: "#010c1f", }, }, fpsLimit: 30, particles: { size: { value: particleState === 'links' ? 3 : particleState === 'circle' ? 3 : 71, }, color: { value: particleState === 'links' ? '#FFFFFF' : particleState === 'circle' ? '#FFFFFF' : "#2C2E43", }, collisions: { enable: true, }, line_linked: { "enable": particleState === 'links' && true, "distance": 300, "color": "#ffffff", "opacity": 0.4, "width": 2 }, move: { direction: "none", enable: true, outMode: "bounce", random: false, speed: 1, straight: false, }, number: { density: { enable: true, area: 800, }, value: particleState === 'links' ? 30 : particleState === 'circle' ? 30 : 3, }, opacity: { value: 0.5, }, shape: { type: particleState === 'links' ? 'circle' : particleState === 'snow' ? 'circle' : 'polygon', }, }, detectRetina: true, }} /> <div style={{display: 'flex', flexDirection: 'column', padding: 30}}> <img src={logo} style={{margin: '20px auto', zIndex: 5, width: 250}}/> <div className="row"> <div className="col-xl-6 col-lg-6 col-md-12 col-sm-12 col-xs-12" style={{padding:10 ,backgroundColor: '#010C1F', zIndex: 5}}> <div style={{ width: "100%", border: '4px solid white', padding: "70px 20px", textAlign: 'center', borderRadius: 12 }} > <p style={{fontSize: 40, fontWeight: 700}}>PRE-SALE</p> <p style={{fontSize: 35, fontWeight: 700, margin: "10px 0"}}><span style={{color: '#61D6C8'}}>{Number(data.totalSupply) == 0 ? ("X" + "/" + CONFIG.MAX_SUPPLY) : ("" + data.totalSupply + "/" + CONFIG.MAX_SUPPLY)}</span> MINTED </p> <a target={'_black'} style={{textDecoration: 'none', color: '#61D6C8', fontSize: 14}} href={CONFIG.SCAN_LINK}>{truncate(CONFIG.CONTRACT_ADDRESS, 15)}</a> {Number(data.totalSupply) >= CONFIG.MAX_SUPPLY ? ( <> <s.TextTitle style={{textAlign: "center", color: "var(--accent-text)"}} > The sale has ended. </s.TextTitle> <s.TextDescription style={{textAlign: "center", color: "var(--accent-text)"}} > You can still find {CONFIG.NFT_NAME} on </s.TextDescription> <s.SpacerSmall/> <StyledLink target={"_blank"} href={CONFIG.MARKETPLACE_LINK}> {CONFIG.MARKETPLACE} </StyledLink> </> ) : ( <> <p style={{margin: '20px 0', fontSize: 20}}>{CONFIG.DISPLAY_COST} ETH<span style={{color: '#61D6C8'}}>Ξ</span> Billionaire Baby</p> <p style={{marginBottom: 10}}>excluding gas fees</p> {blockchain.account === "" || blockchain.smartContract === null ? ( <> <p style={{marginBottom: 10}}>Connect to the {CONFIG.NETWORK.NAME} network</p> <button onClick={(e) => { e.preventDefault(); dispatch(connect()); getData(); }} className={'mint-btn'}>Connect </button> {blockchain.errorMsg !== "" ? ( <> <p style={{ margin: '10px 0', textAlign: "center", color: "white", }} > {blockchain.errorMsg} </p> </> ) : null} </> ) : ( <> <div style={{width: '100%', display: 'flex'}}> <div style={{display: 'flex', margin: '20px auto'}}> <div className={'minus-controller'} onClick={decrementMintAmount}> <p>-</p> </div> <div className={'coin-num'}><p>{mintAmount}</p></div> <div className={'plus-controller'} onClick={incrementMintAmount}> <p>+</p> </div> <button disabled={claimingNft ? 1 : 0} onClick={(e) => { e.preventDefault(); claimNFTs(); getData(); }} className={'mint-btn'}>{claimingNft ? "BUSY" : "MINT"} </button> </div> </div> <p style={{fontSize: 17, fontWeight: 700}}>Total | {CONFIG.DISPLAY_COST * mintAmount} ETH</p> </> )} </> )} </div> </div> <div className="col-xl-6 col-lg-6 col-md-12 col-sm-12 col-xs-12" style={{height: 500, padding: 10}}> <div id="w-node-_7091a729-31c6-d62d-5b76-ecf964dc09cd-eecfd6cf" data-w-id="7091a729-31c6-d62d-5b76-ecf964dc09cd" className="cube-animation-section wf-section"> <div className="demo-container"> <div className="demo-wrapper"> <div className="_3d-wrapper"> <div data-w-id="7091a729-31c6-d62d-5b76-ecf964dc09d9" className="cube-wrapper"> <div className="cube-front"></div> <div className="cube-right"></div> <div className="cube-left"></div> <div className="cube-bottom"></div> <div className="cube-top"></div> <div className="cube-back"></div> </div> </div> </div> </div> </div> </div> </div> </div> <div style={{display: 'flex'}}> <div style={{zIndex: 5, margin: '0 auto', width: '65%'}}> <p style={{zIndex: 5, color: 'white', textAlign: 'center', marginBottom: 20}}>Please make sure you are connected to the right network ( {CONFIG.NETWORK.NAME} Mainnet) and the correct address. Please note: Once you make the purchase, you cannot undo this action.</p> <p style={{zIndex: 5, color: 'white', textAlign: 'center'}}>We have set the gas limit to {CONFIG.GAS_LIMIT} for the contract to successfully mint your NFT. We recommend that you don't lower the gas limit.</p> </div> </div> </div> ); } export default App; {/* <s.Container jc={"center"} ai={"center"} style={{width: "70%"}}> <s.TextDescription style={{ textAlign: "center", color: "var(--primary-text)", }} > Please make sure you are connected to the right network ( {CONFIG.NETWORK.NAME} Mainnet) and the correct address. Please note: Once you make the purchase, you cannot undo this action. </s.TextDescription> <s.SpacerSmall/> <s.TextDescription style={{ textAlign: "center", color: "var(--primary-text)", }} > We have set the gas limit to {CONFIG.GAS_LIMIT} for the contract to successfully mint your NFT. We recommend that you don't lower the gas limit. </s.TextDescription> <s.SpacerSmall/> </s.Container>*/ }
/** * Mnemonist Typed Array Helpers * ============================== * * Miscellaneous helpers related to typed arrays. */ /** * When using an unsigned integer array to store pointers, one might want to * choose the optimal word size in regards to the actual numbers of pointers * to store. * * This helpers does just that. * * @param {number} size - Expected size of the array to map. * @return {TypedArray} */ var MAX_8BIT_INTEGER = Math.pow(2, 8) - 1, MAX_16BIT_INTEGER = Math.pow(2, 16) - 1, MAX_32BIT_INTEGER = Math.pow(2, 32) - 1; var MAX_SIGNED_8BIT_INTEGER = Math.pow(2, 7) - 1, MAX_SIGNED_16BIT_INTEGER = Math.pow(2, 15) - 1, MAX_SIGNED_32BIT_INTEGER = Math.pow(2, 31) - 1; exports.getPointerArray = function(size) { var maxIndex = size - 1; if (maxIndex <= MAX_8BIT_INTEGER) return Uint8Array; if (maxIndex <= MAX_16BIT_INTEGER) return Uint16Array; if (maxIndex <= MAX_32BIT_INTEGER) return Uint32Array; throw new Error('mnemonist: Pointer Array of size > 4294967295 is not supported.'); }; exports.getSignedPointerArray = function(size) { var maxIndex = size - 1; if (maxIndex <= MAX_SIGNED_8BIT_INTEGER) return Int8Array; if (maxIndex <= MAX_SIGNED_16BIT_INTEGER) return Int16Array; if (maxIndex <= MAX_SIGNED_32BIT_INTEGER) return Int32Array; return Float64Array; }; /** * Function returning the minimal type able to represent the given number. * * @param {number} value - Value to test. * @return {TypedArrayClass} */ exports.getNumberType = function(value) { // <= 32 bits itnteger? if (value === (value | 0)) { // Negative if (Math.sign(value) === -1) { if (value <= 127 && value >= -128) return Int8Array; if (value <= 32767 && value >= -32768) return Int16Array; return Int32Array; } else { if (value <= 255) return Uint8Array; if (value <= 65535) return Uint16Array; return Uint32Array; } } // 53 bits integer & floats // NOTE: it's kinda hard to tell whether we could use 32bits or not... return Float64Array; }; /** * Function returning the minimal type able to represent the given array * of JavaScript numbers. * * @param {array} array - Array to represent. * @param {function} getter - Optional getter. * @return {TypedArrayClass} */ var TYPE_PRIORITY = { Uint8Array: 1, Int8Array: 2, Uint16Array: 3, Int16Array: 4, Uint32Array: 5, Int32Array: 6, Float32Array: 7, Float64Array: 8 }; // TODO: make this a one-shot for one value exports.getMinimalRepresentation = function(array, getter) { var maxType = null, maxPriority = 0, p, t, v, i, l; for (i = 0, l = array.length; i < l; i++) { v = getter ? getter(array[i]) : array[i]; t = exports.getNumberType(v); p = TYPE_PRIORITY[t.name]; if (p > maxPriority) { maxPriority = p; maxType = t; } } return maxType; }; /** * Function returning whether the given value is a typed array. * * @param {any} value - Value to test. * @return {boolean} */ exports.isTypedArray = function(value) { return typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView(value); }; /** * Function used to concat byte arrays. * * @param {...ByteArray} * @return {ByteArray} */ exports.concat = function() { var length = 0, i, o, l; for (i = 0, l = arguments.length; i < l; i++) length += arguments[i].length; var array = new (arguments[0].constructor)(length); for (i = 0, o = 0; i < l; i++) { array.set(arguments[i], o); o += arguments[i].length; } return array; }; /** * Function used to initialize a byte array of indices. * * @param {number} length - Length of target. * @return {ByteArray} */ exports.indices = function(length) { var PointerArray = exports.getPointerArray(length); var array = new PointerArray(length); for (var i = 0; i < length; i++) array[i] = i; return array; };
const path = require("path"), webpack = require("webpack"), HtmlWebpackPlugin = require("html-webpack-plugin"), AutoDllPlugin = require("autodll-webpack-plugin") module.exports = { entry: { app: [path.resolve(__dirname, "src/index.tsx")], vendor: ["react", "react-dom"], }, output: { filename: "[name].bundle.js", path: path.resolve(__dirname, "dist"), publicPath: "/", }, resolve: { extensions: [".js", ".jsx", ".json", ".ts", ".tsx"], }, optimization: { removeAvailableModules: false, removeEmptyChunks: false, splitChunks: false, }, module: { rules: [ { test: /\.(ts|tsx)$/, loader: "awesome-typescript-loader", }, { test: /\.(glb|mtl|png|jpe?g|gif|hdr|exr)$/, use: [ { loader: "file-loader", options: {}, }, ], }, ], }, plugins: [ new HtmlWebpackPlugin({ template: path.resolve(__dirname, "src/index.html"), }), new webpack.HotModuleReplacementPlugin(), new AutoDllPlugin({ inject: true, // will inject the DLL bundle to index.html filename: "[name].dll.js", entry: { vendor: ["react", "react-dom"], }, }), ], devtool: "source-map" }
var express = require('express'); var vfutils = require('./utils/utils.js'); var MyLog = require('./utils/MyLog.js'); var redis = require('redis'); var app = express(); var bodyParser = require('body-parser'); app.use(bodyParser.json({limit: '50mb'})); app.use(bodyParser.urlencoded({limit: '50mb', extended: true})); //session公式: var session = require('express-session'); //模板引擎 app.set("view engine", "ejs"); //静态服务 app.use(express.static("./public")); app.use(session({ secret: 'keyboard cat', resave: true, // 即使 session 没有被修改,也保存 session 值,默认为 true cookie: {maxAge: 35 * 60 * 1000}, //session和相应的cookie失效过期 saveUninitialized: true, rolling: true //add 刷新页面 session 过期时间重置 })); //socket.io公式: var http = require('http').Server(app); var io = require('socket.io')(http, { // below are engine.IO options pingInterval: 5000, pingTimeout: 3000, cookie: false, reconnection: true }); global.vfglobal = { // 在线用户 allUser: [], //所有的 token : user token_Map: {}, //保存所有的 user :socket 连接 socket_Map: {}, //前端是否登录 isLogin: -1, //util util: vfutils, MyLog:MyLog, //io io : io, redis:redis, }; require('./router/router.js')(app); require('./router/chat.js')(io); //监听 http.listen(3000);
mycallback( {"CONTRIBUTOR OCCUPATION": "MD", "CONTRIBUTION AMOUNT (F3L Bundled)": "500", "ELECTION CODE": "G2010", "MEMO CODE": "", "CONTRIBUTOR EMPLOYER": "Self-Employed", "DONOR CANDIDATE STATE": "", "CONTRIBUTOR STREET 1": "4033 3rd Avenue", "CONTRIBUTOR MIDDLE NAME": "", "DONOR CANDIDATE FEC ID": "", "DONOR CANDIDATE MIDDLE NAME": "", "CONTRIBUTOR STATE": "CA", "DONOR CANDIDATE FIRST NAME": "", "CONTRIBUTOR FIRST NAME": "Jerrold", "BACK REFERENCE SCHED NAME": "", "DONOR CANDIDATE DISTRICT": "", "CONTRIBUTION DATE": "20101018", "DONOR COMMITTEE NAME": "", "MEMO TEXT/DESCRIPTION": "", "Reference to SI or SL system code that identifies the Account": "", "FILER COMMITTEE ID NUMBER": "C00344671", "DONOR CANDIDATE LAST NAME": "", "CONTRIBUTOR LAST NAME": "Glassman", "_record_type": "fec.version.v7_0.SA", "CONDUIT STREET2": "", "CONDUIT STREET1": "", "DONOR COMMITTEE FEC ID": "", "CONTRIBUTION PURPOSE DESCRIP": "", "CONTRIBUTOR ZIP": "921032117", "CONTRIBUTOR STREET 2": "", "CONDUIT CITY": "", "ENTITY TYPE": "IND", "CONTRIBUTOR CITY": "San Diego", "CONTRIBUTOR SUFFIX": "", "TRANSACTION ID": "A-C66969", "DONOR CANDIDATE SUFFIX": "", "DONOR CANDIDATE OFFICE": "", "CONTRIBUTION PURPOSE CODE": "", "ELECTION OTHER DESCRIPTION": "", "_src_file": "2011/20110504/727421.fec_1.yml", "CONDUIT STATE": "", "CONTRIBUTOR ORGANIZATION NAME": "", "BACK REFERENCE TRAN ID NUMBER": "", "DONOR CANDIDATE PREFIX": "", "CONTRIBUTOR PREFIX": "Dr.", "CONDUIT ZIP": "", "CONDUIT NAME": "", "CONTRIBUTION AGGREGATE F3L Semi-annual Bundled": "1250", "FORM TYPE": "SA11ai"}); mycallback( {"CONTRIBUTOR OCCUPATION": "MD", "CONTRIBUTION AMOUNT (F3L Bundled)": "500", "ELECTION CODE": "G2010", "MEMO CODE": "", "CONTRIBUTOR EMPLOYER": "Self-Employed", "DONOR CANDIDATE STATE": "", "CONTRIBUTOR STREET 1": "4033 3rd Avenue", "CONTRIBUTOR MIDDLE NAME": "", "DONOR CANDIDATE FEC ID": "", "DONOR CANDIDATE MIDDLE NAME": "", "CONTRIBUTOR STATE": "CA", "DONOR CANDIDATE FIRST NAME": "", "CONTRIBUTOR FIRST NAME": "Jerrold", "BACK REFERENCE SCHED NAME": "", "DONOR CANDIDATE DISTRICT": "", "CONTRIBUTION DATE": "20101018", "DONOR COMMITTEE NAME": "", "MEMO TEXT/DESCRIPTION": "", "Reference to SI or SL system code that identifies the Account": "", "FILER COMMITTEE ID NUMBER": "C00344671", "DONOR CANDIDATE LAST NAME": "", "CONTRIBUTOR LAST NAME": "Glassman", "_record_type": "fec.version.v7_0.SA", "CONDUIT STREET2": "", "CONDUIT STREET1": "", "DONOR COMMITTEE FEC ID": "", "CONTRIBUTION PURPOSE DESCRIP": "", "CONTRIBUTOR ZIP": "921032117", "CONTRIBUTOR STREET 2": "", "CONDUIT CITY": "", "ENTITY TYPE": "IND", "CONTRIBUTOR CITY": "San Diego", "CONTRIBUTOR SUFFIX": "", "TRANSACTION ID": "A-C66969", "DONOR CANDIDATE SUFFIX": "", "DONOR CANDIDATE OFFICE": "", "CONTRIBUTION PURPOSE CODE": "", "ELECTION OTHER DESCRIPTION": "", "_src_file": "2011/20110504/727421.fec_1.yml", "CONDUIT STATE": "", "CONTRIBUTOR ORGANIZATION NAME": "", "BACK REFERENCE TRAN ID NUMBER": "", "DONOR CANDIDATE PREFIX": "", "CONTRIBUTOR PREFIX": "Dr.", "CONDUIT ZIP": "", "CONDUIT NAME": "", "CONTRIBUTION AGGREGATE F3L Semi-annual Bundled": "1250", "FORM TYPE": "SA11ai"});
import React from "react"; import { mount } from "enzyme"; import Description from "./Description"; describe("<Description />", () => { it("renders description", () => { const wrapper = mount(<Description description="Hello world"/>) expect(wrapper.find('Description').text()).toBe("Hello world") }); });
/* * forgerock-sample-web-react * * index.js * * Copyright (c) 2021 ForgeRock. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ import React, { useEffect } from 'react'; import { NativeModules } from 'react-native'; import { SafeAreaProvider } from 'react-native-safe-area-context'; import Navigation from './navigation'; const { FRAuthSampleBridge } = NativeModules; export default function App() { useEffect(() => { /* ******************************************************************* * NATIVE BRIDGE SDK INTEGRATION * Summary: Call Start Early! * ------------------------------------------------------------------- * Details: It's important to start the FR SDK at the root level! * Start is needed to be called and resolved before * any other Native methods can be used * * use `start` as early on as possible! * * ********************************************************************/ async function start() { await FRAuthSampleBridge.start(); } start(); }, []); return ( <SafeAreaProvider> <Navigation /> </SafeAreaProvider> ); }
/** * Created by xingo on 2017/02/18. */ let socketIO = require('socket.io'); let wsController = require('../wsController'); function startSocketIO(server) { let ws = socketIO(server); ws = ws .of('/ws'); wsController.setWebSocket(ws); } module.exports = startSocketIO;
var searchData= [ ['da_145',['da',['../structieee80211__mgmt.html#a4c18dc4a47a10b48ae9df9efa44958a1',1,'ieee80211_mgmt']]], ['deauth_146',['deauth',['../structieee80211__mgmt.html#a28550d689526a864c41436d63c212450',1,'ieee80211_mgmt']]], ['delay_5fbound_147',['delay_bound',['../structwmm__tspec__element.html#a07d9a5fe619e495d6eee03bb25fb3fa2',1,'wmm_tspec_element']]], ['dialog_5ftoken_148',['dialog_token',['../structieee80211__mgmt.html#a0ce2b96cf424fe90297821d5ecf9fc49',1,'ieee80211_mgmt::dialog_token()'],['../structrrm__link__measurement__request.html#acaa49c7012b96ea55291a827b97e5fda',1,'rrm_link_measurement_request::dialog_token()'],['../structrrm__link__measurement__report.html#a9b574a2cea60d3577d03bdcc5a8078bb',1,'rrm_link_measurement_report::dialog_token()']]], ['dialogtoken_149',['dialogtoken',['../structieee80211__mgmt.html#ad68bccc1e49aadfed2688ea7c54f11e3',1,'ieee80211_mgmt']]], ['disassoc_150',['disassoc',['../structieee80211__mgmt.html#a633afc17060734b47a6083888229f086',1,'ieee80211_mgmt']]], ['disassoc_5ftimer_151',['disassoc_timer',['../structieee80211__mgmt.html#a596316929f5d58129ba74f0851c3f6fb',1,'ieee80211_mgmt']]], ['distrib_5fadhoc_152',['distrib_adhoc',['../ieee80211_8h.html#abc350cc49eb1bdab375a1edecee042f2a4dc00f196cf793e78d51fe83c100934a',1,'ieee80211.h']]], ['distrib_5ffrom_153',['distrib_from',['../ieee80211_8h.html#abc350cc49eb1bdab375a1edecee042f2a2136ac8f33e97426d642dfffe8db2b4e',1,'ieee80211.h']]], ['distrib_5finter_154',['distrib_inter',['../ieee80211_8h.html#abc350cc49eb1bdab375a1edecee042f2aec6d0b70962e419f6a7b2214da920f52',1,'ieee80211.h']]], ['distrib_5fto_155',['distrib_to',['../ieee80211_8h.html#abc350cc49eb1bdab375a1edecee042f2aa20a16e0ac0e224a9fabaec6b4fc99ce',1,'ieee80211.h']]], ['distrib_5funknown_156',['distrib_unknown',['../ieee80211_8h.html#abc350cc49eb1bdab375a1edecee042f2a25cc3adab3f906c4589a4c7c87a2a4b2',1,'ieee80211.h']]], ['dpp_5fcc_5fie_5fvendor_5ftype_157',['DPP_CC_IE_VENDOR_TYPE',['../ieee802__11__defs_8h.html#ac65fbbf2bc32599a6feda09552ae0cd4',1,'ieee802_11_defs.h']]], ['dpp_5fcc_5foui_5ftype_158',['DPP_CC_OUI_TYPE',['../ieee802__11__defs_8h.html#a29e8307f621f0539c9e88b0b41e131c9',1,'ieee802_11_defs.h']]], ['dpp_5foui_5ftype_159',['DPP_OUI_TYPE',['../ieee802__11__defs_8h.html#ac04537383cbec536309932678995c5b6',1,'ieee802_11_defs.h']]], ['dsss_5fofdm_160',['dsss_ofdm',['../struct____attribute____.html#a043f55f8b0079050d93ee85b21972414',1,'__attribute__']]], ['duration_161',['duration',['../structieee80211__mgmt.html#a25f4df07ae3081d7d37726b059aa6a0e',1,'ieee80211_mgmt::duration()'],['../structrrm__measurement__beacon__request.html#a89010e942bb68b7778dc4c68f530a624',1,'rrm_measurement_beacon_request::duration()'],['../structrrm__measurement__beacon__report.html#afb1c2fb1f9f8c65ed06936d673cf6502',1,'rrm_measurement_beacon_report::duration()']]], ['duration_5fid_162',['duration_id',['../structieee80211__hdr.html#a883cea9e3a20c49fe57dd636bbc62ae7',1,'ieee80211_hdr']]] ];
//from system import React, { Component } from 'react'; import { connect } from 'react-redux'; import { Grid, Row, Glyphicon } from 'react-bootstrap'; import {URL_BASE} from '../../helper/constant' import { history } from '../../route/history'; import DashboardHeader from '../../components/DashboardHeader'; import Footer from '../../components/Footer'; class BlogContainer extends Component { constructor(props) { super(props); this.state = { blogs: [ { userName: "Sejal Chougule", userInfo: "Creator at tocstack.com", date: "6 Jan", blogTitle: "How to make your on CI server", blogBannerImg: "../../../assets/travisci.png", permaLink: `${URL_BASE}/blog/ci-sever`, content: `<p> Prior to using Jenkins, we used well-known Continuous Integration/ Continuous Delivery (CI/CD) providers such as Travis CI, Bitrise, Circle CI, etc. Unfortunately, using emulators on these platforms always remained a struggle. The main bottleneck is that the standard container instances specs are usually too limited. For instance, none of the aforementioned providers offers x86 emulator to enable hardware acceleration.</p>` }, { userName: "Sejal Chougule", userInfo: "Creator at tocstack.com", date: "6 Jan", blogTitle: "How to make your on CI server", permaLink: `${URL_BASE}/blog/ci-sever`, blogBannerImg: "https://cdn-images-1.medium.com/max/1000/1*lX-Ognzk3oFDDi4nTAjGcw.png", content: `<p> Prior to using Jenkins, we used well-known Continuous Integration/ Continuous Delivery (CI/CD) providers such as Travis CI, Bitrise, Circle CI, etc. Unfortunately, using emulators on these platforms always remained a struggle. The main bottleneck is that the standard container instances specs are usually too limited. For instance, none of the aforementioned providers offers x86 emulator to enable hardware acceleration.</p>` } ] } } rawMarkup = (raw) => { return { __html: raw } } componentDidMount() { } componentWillReceiveProps(nextProps) { } componentWillUnmount() { } render() { return ( <div> <DashboardHeader /> <div style={{ minHeight: "100vh"}}> <Grid style={{marginBottom:50}}> <Row> { this.state.blogs.map((blog, index) => { return ( <div className="blog-card" key={index}> <div className="blog-avatar"> <img className="blog-avatar-img" src="../../../assets/android.png" /> <div className="blog-avatar-user"> <h5>{blog.userName}</h5> <h6>{blog.userInfo}</h6> <h6>{blog.date}</h6> </div> </div> <h1 className="blog-card-title">{blog.blogTitle}</h1> <div className="blog-card-banner"> <img src={blog.blogBannerImg} /> </div> <div dangerouslySetInnerHTML={blog.content.length < 300 ? this.rawMarkup(blog.content) : this.rawMarkup(blog.content.slice(0, 400)+" ......")} > </div> { blog.content.length > 300 ? <div style={{textAlign:"center"}}> <button className="border-button" onClick={() => { console.log(blog.permaLink) }}> ... Read</button> </div> : null } <hr style={{ borderColor: "#d8d7d7", width: "80%" }} /> </div> ) }) } </Row> </Grid> <div style={{ textAlign: "center" }}> <button className="border-button" onClick={() => { console.log(this.state) }}><Glyphicon glyph="menu-left" /> Prev</button> <button className="border-button" onClick={() => { console.log(this.state) }}><Glyphicon glyph="menu-right" /> Next</button> </div> </div> <footer> <Footer /> </footer> </div> ) } } const mapStateToProps = state => ({ }); const mapDispatchToProps = dispatch => ({ }); export default connect(mapStateToProps, mapDispatchToProps, null, { pure: false })(BlogContainer);
const { day09_1, day09_2 } = require("./index"); describe.skip("Day 09 Part 1", () => {}); describe.skip("Day 09 Part 2", () => {});
const calculateWeightedResults = ( runSimulation, simulationCount, doorsCount, ) => { let games = [] for (let i = 0; i < simulationCount; i++) { games.push(runSimulation(doorsCount)) } const totalResults = games.reduce((totalResults, gameResult) => [ totalResults[0] + gameResult[0], totalResults[1] + gameResult[1], totalResults[2] + gameResult[2] ], [0, 0, 0]) const PRECISION = 1000 return totalResults.map(result => 100 * Math.round(result * PRECISION / simulationCount) / PRECISION) } const getBoundedRandom = (max) => Math.round(Math.random() * max) const getRandomArrayElement = (array) => array[getBoundedRandom(array.length - 1)] const generateDoors = (totalDoorsCount) => [...Array(totalDoorsCount).keys()] const printSimulationResults = ( simulationTitle, simulation, TOTAL_GAMES_COUNT, TOTAL_DOORS_COUNT, ) => { console.log('\n', simulationTitle) const simulationResults = calculateWeightedResults( simulation, TOTAL_GAMES_COUNT, TOTAL_DOORS_COUNT ) console.log(`Same decision won: ${simulationResults[0]}%`) console.log(`Changed decision won: ${simulationResults[1]}%`) console.log(`Always random decision won: ${simulationResults[2]}%`) } module.exports = { getBoundedRandom, getRandomArrayElement, generateDoors, printSimulationResults, };
import React from "react"; import "@testing-library/jest-dom/extend-expect"; import { render } from "@testing-library/react"; import { App } from "./App"; it("render content", () => { const filter = { category: "Categoria", year: "Año" }; const { asFragment } = render(<App filter={filter} />); expect(asFragment()).toMatchSnapshot(); });
"use strict"; const stringUtils = require("ember-cli-string-utils"); const useTestFrameworkDetector = require("../test-framework-detector"); module.exports = useTestFrameworkDetector({ description: "Generates a mixin unit test.", locals: function(options) { let projectName = options.inRepoAddon ? options.inRepoAddon : options.project.name(); let dasherizedModulePrefix = options.inRepoAddon ? projectName : stringUtils.dasherize(options.project.config().modulePrefix); return { dasherizedModulePrefix, projectName, friendlyTestName: ["Unit", "Mixin", options.entity.name].join(" | ") }; } });
define( "dojo/cldr/nls/en-au/currency", //begin v1.x content { "AUD_symbol": "$", "USD_symbol": "US$" } //end v1.x content );
const gutil = require('gulp-util'); const webpack = require('webpack'); const _ = require('lodash'); const { scripts: scriptsConfig } = require('./../config.js'); const handleError = require('./../utils/handleError.js'); const { browserSync } = require('./browserSync'); const scriptsTask = function scripts(done) { const webpackConfig = _.omit(scriptsConfig(), 'babelConfig'); webpack(webpackConfig, (err, stats) => { if (err) { handleError.call(this, err); } // if errors, print these if (stats.toJson().errors.length) { const gErr = new gutil.PluginError({ plugin: 'webpack', message: stats.toJson().errors[0], }); handleError.call(this, gErr); } else { // otherwise print bundle stats gutil.log(stats.toString({ colors: gutil.colors.supportsColor, chunks: false, errors: false, })); // end reload browserSync.reload(); } done(); }); }; module.exports = { scriptsTask, };
import React, { useState, useEffect} from "react"; import api from 'services/api' import "./styles.css"; function App() { const [repositories, setRepositories ] = useState([]) useEffect(() => { api.get('repositories').then(response => { setRepositories(response.data) }) }, []) async function handleAddRepository() { const response = await api.post( 'repositories', { title : `Repo github ${Math.floor(Math.random() * 100) + 1} `, url : "https://github.com/teste_repo2", techs: ["reactJS","NodeJS"] }) const repositorie = response.data; setRepositories([...repositories, repositorie]) } async function handleRemoveRepository(id) { await api.delete( `repositories/${id}`) setRepositories( repositories.filter((repositorie) => repositorie.id !== id) ) } return ( <div> <ul data-testid="repository-list"> {repositories.map(repositorie => <li key={ repositorie.id}>{repositorie.title} <button onClick={() => handleRemoveRepository(repositorie.id)}> Remover </button> </li> )} </ul> <button onClick={handleAddRepository}>Adicionar</button> </div> ); } export default App;
module.exports = { name: 'avatar', aliases: ['icon', 'pfp'], description: 'Get profile picture of a user', args: true, usage: '<user>', execute(message, args) { if (!message.mentions.users.size) { return message.channel.send( `Your avatar: ${message.author.displayAvatarURL}` ); } const avatarList = message.mentions.users.map(user => { return `${user.toString()}'s avatar: ${user.displayAvatarURL}`; }); // send the entire array of strings as a message // by default, discord.js will `.join()` the array with `\n` message.channel.send(avatarList); } };
var fs = require('fs') var crunchify = require('.') fs.readFile('./test.css', 'utf8', function (err, css) { if (err) return console.error(err) console.log('original:\n' + css) console.log('crunchy:\n' + crunchify(css)) })
// Create function for Data plotting (Bar, gauge, bubble) function getdata(tm) { d3.json("Resources/basketball_table.json").then(function (nbaData) { // console.log(nbaData); // var trying = Object.values(nbaData); // // console.log(trying); // var code = nbaData.value(); // console.log(code); var grouped = Object.fromEntries(Object.entries(nbaData).filter(([k,v]) => v="tm")); // console.log(grouped); //this creates a list of unique teams let teamnames = new Set; let teamStats = new Set; for (var i = 0; i < nbaData.length - 1; i++) { console.log(nbaData[i]); teamnames.add(nbaData[i]['tm']); teamStats.add(nbaData[i]); } console.log(teamnames); teamnames = [...teamnames] console.log(teamnames) teamStats = [...teamStats]; console.log(teamStats); let tmlist = Array.from(teamnames); console.log(tmlist); var filtered = nbaData.filter(a => a.tm == tm); console.log(filtered); var salary_test = filtered.filter(s => s.yr2019_20.toString()==s.yr2019_20); console.log(salary_test); var player_list = salary_test.map(data => data.Player); console.log(player_list); var points = salary_test.map(data => data.pts); console.log(points); var difTeam = nbaData.map(data=> data.tm)[1]; console.log(difTeam) var per = salary_test.map(data => data.PER); console.log(per); var salary = salary_test.map(data => data.yr2019_20); // var salary = salary.toString(); console.log(salary); var salary1 = [... new Set(salary)]; console.log(salary1); var colors = {"ATL" : "Red", "BRK": "Black", "BOS":"Green", "CHO":"purple", "CHI": "red", "CLE": "maroon", "DAL": "blue", "DEN": "navy", "DET": "blue", "GSW": "yellow", "HOU": "red", "IND": "blue", "LAC": "Red", "LAL": "Purple","MEM": "blue", "MIA": "maroon", "MIL": "green", "MIN": "navy", "NOP": "blue", "NYK": "FF7F03", "OKC": "light blue", "ORL": "blue", "PHI": "blue", "PHO": "FF7F03", "POR": "red", "SAC": "purple", "SAS": "gray", "TOR": "red", "UTA": "yellow", "WAS": "red"}; console.log(colors); var teamList = salary_test.map(data=>data.tm)[0]; console.log(teamList); testing2 = colors[teamList]; console.log(testing2); for (i = 1; i < player_list.length; i++) { if(player_list[0] == player_list[i]){ player_list = player_list.slice(0,i); salary = salary.slice(0, i); console.log(player_list); console.log(player_list); } } var trace = { x: salary, y: player_list, type: "bar", text: player_list, orientation: "h", marker: {color: testing2}, }; var data = [trace]; var layout = { title: "NBA Salary by Team", xaxis:{ type:'category-unique' }, margin: { l: 100, r: 100, t: 100, b: 10 }, }; Plotly.newPlot("bar", data, layout); let trace1 = { x: salary, y: points, text: player_list, mode: 'markers', marker: { color: salary, size: per }, } let data1 = [trace1]; var layout1 = { title: "NBA Salary" } Plotly.newPlot("bubble", data1, layout1) var data2 = [{ values: salary, labels: player_list, type: "pie" }]; var layout1 = { height: 400, width: 500 }; Plotly.newPlot('gauge', data2, layout1); }); } function getMoney(tm) { d3.json("Resources/basketball_table.json").then((data)=> { console.log(data) let teamnames = new Set; let teamStats = new Set; for (var i = 0; i < data.length - 1; i++) { //console.log(data[i]); teamnames.add(data[i]['tm']); teamStats.add(data[i]); } // console.log(teamnames); teamnames = [...teamnames] // console.log(teamnames) teamStats = [...teamStats]; console.log(teamStats); var filtered_tm = data.filter(a => a.tm === tm); console.log(filtered_tm); var salary_test = filtered_tm.filter(s => s.yr2019_20.toString()==s.yr2019_20); console.log(salary_test); var player_list = salary_test.map(data => data.Player); console.log(player_list) var salary = salary_test.map(data => data.yr2019_20); for (i = 1; i < player_list.length; i++) { if(player_list[0] == player_list[i]){ player_list = player_list.slice(0,i); salary = salary.slice(0, i); console.log(player_list); console.log(salary); } } var salaryInfo = d3.select("#salary-prediction"); // empty player salary before getting new salary based on team selected salaryInfo.html(""); for (var prop in filtered_tm){ salaryInfo.append("h5").text(filtered_tm[prop].Player + ": $" + filtered_tm[prop].yr2019_20); console.log(filtered_tm[prop].Player, filtered_tm[prop].yr2019_20); } }); } function optionChanged(tm) { getdata(tm); getMoney(tm); } function init() { let dropdown = d3.select("#selDataset"); d3.json("Resources/basketball_table.json").then((data) => { console.log(data) let teamnames = new Set; let teamStats = new Set; for (var i = 0; i < data.length - 1; i++) { //console.log(data[i]); teamnames.add(data[i]['tm']); teamStats.add(data[i]); } // console.log(teamnames); teamnames = [...teamnames] // console.log(teamnames) teamStats = [...teamStats]; // console.log(teamStats); teamnames.forEach(function (team) { dropdown.append("option").text(team).property("value") console.log(team) }) getdata(teamnames[0]); getMoney(teamnames[0]); }) } init();
import { Icon } from 'antd'; import React from 'react'; import styles from './ThemeColor.less'; const Tag = ({ color, check, ...rest }) => { return ( <div {...rest} style={{ backgroundColor: color, }} > {check ? <Icon type="check" /> : ''} </div> ); }; const ThemeColor = ({ colors, title, value, onChange }) => { let colorList = colors; if (!colors) { colorList = [ '#F5222D', '#FA541C', '#FAAD14', '#13C2C2', '#52C41A', '#1890FF', '#2F54EB', '#722ED1', ]; } return ( <div className={styles.themeColor}> <h3 className={styles.title}>{title}</h3> <div className={styles.content}> {colorList.map(color => { return ( <Tag className={styles.colorBlock} key={color} color={color} check={value === color} onClick={() => onChange && onChange(color)} /> ); })} </div> </div> ); }; export default ThemeColor;
'use strict'; // YOU KNOW WHAT TO DO // /** * each: Designed to loop over a collection, Array or Object, and applies the * action Function to each value in the collection. * * @param {Array or Object} collection: The collection over which to iterate. * @param {Function} action: The Function to be applied to each value in the * collection */ function each(collection, action) { if(Array.isArray(collection)) { for(var i = 0; i < collection.length; i++) { action(collection[i], i, collection); } } else { for (var key in collection) { action(collection[key], key, collection); } } } module.exports.each = each; /** * identity: takes a value and returns it without any changes to that value. * * @param {*} value: The value to be returned. * * @return {*}: the value to be returned. * */ function identity(value){ return value; } module.exports.identity = identity; /** * typeOf: takes a value and returns the data type of the value as a string. * * @param {*} value: the value we seek the data type of. * * @return {*}: the data type of the value parameter passed in as a string. * */ function typeOf (value){ if(Array.isArray(value)){ return 'array'; } else if (value === null){ return 'null'; } return typeof value; } module.exports.typeOf = typeOf; /** * first: takes an array and number and returns the first 'number(s)' in the array. If no array, return an empty array. If the number is not a number, return the first element in the array. * * @param {Array} collection: the collection which to iterate over and return the <number> of elements within this array. * @param {number} value: The value that determines how many beginning elements in the <array> to return. * * @return {Array}: Depending on the value in the <number> parameter, return the first <number> of elements in the array. * If no array is given in the collection, return an empty array. If the number is not a number, return just the first element in the <array> parameter. */ function first (arr, num){ var newArray = []; if(!Array.isArray(arr)){ return []; } if (num === undefined || typeof num !== 'number' ){ return arr[0]; } else if (num > arr.length) { return arr; } else { for (var i = 0; i < num; i++){ newArray.push(arr[i]); } } return newArray; } module.exports.first = first; /** * last: takes an array and number and returns the last <number(s)> in the array. If no array, return an empty array. If the number is not a number, return the last element in the array. * * @param {Array} collection: the collection which to iterate over and return the <number> of elements within this array. * @param {number} value: The value that determines how many ending elements in the <array> to return. * * @return {Array}: Depending on the value in the <number> parameter, return the last <number(s)> of elements in the array. * If no array is given in the collection, return an empty array. If the number is not a number, return just the last element in the <array> parameter. */ function last (arr, num){ var newArray = []; if(!Array.isArray(arr)){ return []; } if (num === undefined || typeof num !== 'number' ){ return arr[arr.length - 1]; } else if (num > arr.length) { return arr; } else { for (var i = arr.length - num; i < arr.length; i++){ newArray.push(arr[i]); } } return newArray; } module.exports.last = last; /** * indexOf: Iterates over an <array> and searches for a match to the <value> paramater. If there is a match, return the index of that match. If there is no match, return -1 * * @param {Array} collection: the collection which to iterate over and return the index of the <value> found inside the <array> * @param {value}: The value used to match the elements inside of the given <array>. * * @return {number} index value: if the <value> is found withing the given <array> return the index of that <value> within the <array>. * if the <value> is not found inside the given <array>, return -1. */ function indexOf (arr, value){ var newArray = []; for (var i = 0; i < arr.length; i++){ if (arr[i] === value){ newArray.push(i); } } if(newArray.length > 0){ return newArray[0]; } else { return -1; } } module.exports.indexOf = indexOf; /** * contains: Iterates over an <array> and searches for a match to the <value> paramater. If there is a match, return true. If not, return false. * * @param {Array} collection: the collection which to iterate over and return true if the <value> is found inside the <array> * @param {value}: The value used to match the elements inside of the given <array>. * * @return {boolean}: if the <value> is found withing the given <array> return true. If not, return false. * */ function contains (arr, value){ var input = indexOf(arr, value); return true ? input >= 0 : false; } module.exports.contains = contains; /** * unique: Iterates over an <array> and removes dupicate data types. * * @param {Array} collection: the collection which to iterate over and remove duplicates. * * * @return {Array}: returns a new array after removing duplicates from the <array> input/parameter. * */ function unique (arr){ var newArray = []; for (var i = 0; i < arr.length; i++){ if(contains(newArray, arr[i]) ){ newArray.push(arr[i]); } } return newArray; } module.exports.unique = unique; /** * filter: iterates over an <array> and calls <function> when an element within the <array> returns true for that <function>. returns a new array of elements that proved true for the called <function>. * * @param {Array} collection: the collection which to iterate over and call the <function> on. * @param {function} action: function used to iterate over the array for elements that return true for the function. * * @return {Array}: returns a new array of elements that returned true for the call <function>. * */ function filter (arr, func){ var newArray = []; for (var i = 0; i < arr.length; i++){ if(func(arr[i], i, arr) === true){ newArray.push(arr[i]); } } return newArray; } module.exports.filter = filter; /** * reject: iterates over an <array> and calls <function> when an element within the <array> returns false for that <function>. returns a new array of elements that proved false for the called <function>. * * @param {Array} collection: the collection which to iterate over and call the <function> on. * @param {function} action: function used to iterate over the array for elements that return false for the function. * * @return {Array}: returns a new array of elements that returned false for the call <function>. * */ function reject (arr, func){ var newArray = []; for (var i = 0; i < arr.length; i++){ if(!func(arr[i], i, arr) === true){ newArray.push(arr[i]); } } return newArray; } module.exports.reject = reject; /** * partition: iterates over an <array> and calls <function> when an element within the <array> returns something truthy or falsy for that <function>. returns two new arrays within an array. the first array is of elements that proved something truthy for the called <function>. * the second array is of elements that proved something falsy for the called <function> * * @param {Array} collection: the collection which to iterate over and call the <function> on. * @param {function} action: function used to iterate over the array for elements that returns two new arrays with truthy elements in one array and falsy elements in the other array. * * @return {Array}: Returns two arrays within an array. The first array will contain elements that returned something truthy when the function is called. * The second array will contain elements that returned something falsy when the function is called. */ function partition (arr, func){ var output = [[] , []]; for (var i = 0; i < arr.length; i++){ if(func(arr[i], i, arr)){ output[0].push(arr[i]); } else { output[1].push(arr[i]); } } return output; } module.exports.partition = partition; /** * map: iterates over a collection and calls the <function> for each element within the collection. * * * @param {Array or Object} collection: the collection which to iterate over and call the <function> on. * @param {function} action: function used to iterate over each element in the collection. The function's output will fill a new array. * * @return {Array}: returns a new array that contains the output elements after the <function> is called on the elements within the input/parameter collection. * */ function map (coll, func){ var newArray = []; if (Array.isArray(coll)){ for (var i = 0; i < coll.length; i++){ newArray.push(func(coll[i], i, coll)); } } else { for (var k in coll) newArray.push(func(coll[k], k, coll)); } return newArray; } module.exports.map = map; /** * pluck: iterates over an array of objects and returns a new array with the value of the <property> parameter. * * * @param {Array of Objects} collection: the collection which to iterate over and find the values of the given <property> parameter. * @param {property} key: the string given to represent the key in the objects housed in the array. * * @return {Array}: returns a new array that contains the value of the <property> parameter within each object within the array of objects. * */ function pluck (arrObj, prop){ var newArray = []; for(var i = 0; i < arrObj.length; i++){ newArray.push(arrObj[i][prop]); } return newArray; } module.exports.pluck = pluck; /** * every: tests if the collection is an array or object then iterates over a collection and tests the elements in the collection using a given function. * * * @param {Array or Object} collection: the collection which to iterate over and call the <function> on. * @param {function} action: function used to iterate over each element in the collection. The function's output will return true or false. * * @return {boolean}: Returns true if every element in the collection returns true for the called function. returns false if just one element in the collection returns false for the called function. * */ function every (coll, func){ var results = []; var falsy = [false, null, undefined, NaN, 0, -0, ""]; if (typeof func !== "function"){ let counter = 0; for(let i = 0; i < coll.length; i++){ for(let j = 0; j < coll.length; j++){ if(coll[i] === falsy[j]){ counter++; } } } if(counter > 1){ return false; } else { return true; } } else { if(Array.isArray(coll)){ for (var i = 0; i < coll.length; i++){ results[i] = func(coll[i], i, coll); } } else { let k =0; for(var prop in coll){ results[k] = func(coll[prop], prop, coll); k++; } } if(results.length > 0){ if (contains(results, false)){ results = false; } else { results = true; } } else { results = false; } } return results; } module.exports.every = every; /** * some: tests if the collection is an array or object then iterates over a collection and tests the elements in the collection using a given function. * * * @param {Array or Object} collection: the collection which to iterate over and call the <function> on. * @param {function} action: function used to iterate over each element in the collection. The function's output will return true or false. * * @return {boolean}: Returns true if at least one element in the collection returns true for the called function. returns false if every element in the collection returns false for the called function. * */ function some (coll, func){ var results = []; var falsy = [false, null, undefined, NaN, 0, -0, ""]; if (typeof func !== "function"){ let counter = 0; for(let i = 0; i < coll.length; i++){ for(let j = 0; j < coll.length; j++){ if(coll[i] === !falsy[j]){ counter++; } } } if(counter > 1){ return true; } else { return false; } } else { if(Array.isArray(coll)){ for (var i = 0; i < coll.length; i++){ results[i] = func(coll[i], i, coll); } } else { let k =0; for(var prop in coll){ results[k] = func(coll[prop], prop, coll); k++; } } if(results.length > 0){ if (contains(results, true)){ results = true; } else { results = false; } } else { results = true; } } return results; } module.exports.some = some; /** * reduce: iterates over an array and calls the function for every element in the array starting with the seed. If no seed is given, use the first element within the array as the initial value. * * * @param {Array}: the array which to iterate over and call the <function> on. * @param {function} action: function used to iterate over each element in the array. * @param {value} seed: a value given/or not given that represents the "previous result" of the function. also known as the initial value. * * @return {value}: Returns the return value of the final function call after iterating over the entire array. * */ function reduce (arr, action, seed){ // we have two routes // if the seed/initial value is given if(seed !== undefined){ //if seed value passed, create a new var called result and initialize it to the seed value let result = seed; //loop through the array starting at index 0 with the each function each(arr, function(element, index, array){ //assign the result of passing each element to the action function to the result var result = action(result, element, index); }); return result; //return result to the next iteration } else { //if the seed/initial value is NOT given //create new result variable and initialize it to the first element in the input array let result = arr[0]; //with a loop for (let i = 1) //loop through the array starting at index 0 with the each function each(arr, function(element, index, array){ if(index !== 0){ result = action(result, element, index); //assign the result of passing each element to the action function to the result variable. } }); return result; } } module.exports.reduce = reduce; /** * extend: Takes the input objects and copies all properties to the first input object. * * * @param {Object} collection: the collection that will take in the newly copied properties * @param {Object} collection: the collection(s) that will be copied from and moved to the first input object. * * @return {Object}: Returns the updated Object that has all the other object's properties copied. * */ function extend (...obj){ return Object.assign(...obj); } module.exports.extend = extend;