hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a1a684682c42a85e43b1633266ad5fae7a27ac9a | 128 | js | JavaScript | public/ziplookup/db/us/524.js | dieseltravis/ziplookup | 4653fa77b365316ad194d28da48e6cc18f2d2728 | [
"Apache-2.0"
] | null | null | null | public/ziplookup/db/us/524.js | dieseltravis/ziplookup | 4653fa77b365316ad194d28da48e6cc18f2d2728 | [
"Apache-2.0"
] | null | null | null | public/ziplookup/db/us/524.js | dieseltravis/ziplookup | 4653fa77b365316ad194d28da48e6cc18f2d2728 | [
"Apache-2.0"
] | 1 | 2016-02-03T03:23:29.000Z | 2016-02-03T03:23:29.000Z | __zl([{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"97":0,"98":0,"99":0},["Cedar Rapids"],["IA|Iowa"]]); | 128 | 128 | 0.421875 |
a1a7cc68e8c2b4d5c32b12146143548bb9bd888e | 606 | js | JavaScript | docs/search/searchdata.js | benthie/wearables-praktikum | 14c9240fd1dc078deb714e9e38269c2feed1d795 | [
"MIT"
] | 3 | 2017-03-04T11:10:10.000Z | 2020-04-06T11:23:55.000Z | docs/search/searchdata.js | benthie/wearables-praktikum | 14c9240fd1dc078deb714e9e38269c2feed1d795 | [
"MIT"
] | null | null | null | docs/search/searchdata.js | benthie/wearables-praktikum | 14c9240fd1dc078deb714e9e38269c2feed1d795 | [
"MIT"
] | null | null | null | var indexSectionsWithContent =
{
0: "abcdeghilmnoprstuwx",
1: "abcpsu",
2: "abcpsu",
3: "abcdeghimnoprsuw",
4: "abcdeghilmnprstuwx",
5: "c",
6: "bcu",
7: "bcu",
8: "abcdeghilmnoprstuwx",
9: "s"
};
var indexSectionNames =
{
0: "all",
1: "classes",
2: "files",
3: "functions",
4: "variables",
5: "typedefs",
6: "enums",
7: "enumvalues",
8: "properties",
9: "pages"
};
var indexSectionLabels =
{
0: "All",
1: "Classes",
2: "Files",
3: "Functions",
4: "Variables",
5: "Typedefs",
6: "Enumerations",
7: "Enumerator",
8: "Properties",
9: "Pages"
};
| 14.093023 | 30 | 0.559406 |
a1a7e91571bb6c82af5f7a366e218f33996a83b9 | 5,423 | js | JavaScript | src/handleHighlight.js | MissingNotes/dauber | 8af58d855612b57a340ecc6d54096e758a522d1b | [
"MIT"
] | 1 | 2019-08-05T10:00:40.000Z | 2019-08-05T10:00:40.000Z | src/handleHighlight.js | MissingNotes/dauber | 8af58d855612b57a340ecc6d54096e758a522d1b | [
"MIT"
] | 2 | 2016-11-15T06:19:19.000Z | 2018-01-07T14:08:39.000Z | src/handleHighlight.js | MissingNotes/dauber | 8af58d855612b57a340ecc6d54096e758a522d1b | [
"MIT"
] | null | null | null | import styles from './handlehighlight.css'
let currentValue
export default function handlehighlight(state) {
let previousValue = currentValue
let highlightTextsAdd = {}
let highlightTextsDelete = {}
if (state.highlight.toolbarOn === 1) {
currentValue = state.highlight.highlightMap
if (previousValue !== currentValue) {
if (previousValue === undefined) {
highlightTextsAdd = currentValue
} else {
localStorage.setItem('highlightMap', JSON.stringify(currentValue))
let keysPre = Object.keys(previousValue)
let keysCur = Object.keys(currentValue)
keysPre.filter((item) => {
if (!(keysCur.indexOf(item) > -1)) {
highlightTextsDelete[item] = previousValue[item]
}
})
keysCur.filter((item) => {
if (!(keysPre.indexOf(item) > -1)) {
highlightTextsAdd[item] = currentValue[item]
}
})
}
// 渲染新增加的highlightText
if (Object.keys(highlightTextsAdd).length !== 0) {
const highlightTextsArray = Object.values(highlightTextsAdd)
highlightTextsArray.forEach(function(highlight) {
let id = highlight.id
highlight.texts.forEach(function(highlightText) {
// 找到高亮的数据所在的highlightText的父节点
let selectorArray = highlight.cacSelector.concat(highlightText.subSelector)
let highlightTextSelector = ''
for (var i = 0; i < selectorArray.length; i++) {
highlightTextSelector = highlightTextSelector + selectorArray[i].nodeName
if (selectorArray[i].id) {
highlightTextSelector = highlightTextSelector + "#" + selectorArray[i].id
}
if (selectorArray[i].classes) {
selectorArray[i].classes.forEach((className) => highlightTextSelector = highlightTextSelector + "." + className)
}
highlightTextSelector = highlightTextSelector + '>'
// highlightTextSelector = highlightTextSelector + ':nth-of-type(' + selectorArray[i].nthOfType + ')>'
}
let nodes = document.querySelectorAll(highlightTextSelector.slice(0, highlightTextSelector.length - 1))
let text = highlightText.text
let startOffset = highlightText.startOffset
let endOffset = highlightText.endOffset
let identicalContentNodes = []
let hightlightTextNode
for (var i = 0; i < nodes.length; i++) {
let node = nodes[i]
for (var j = 0; j < node.childNodes.length; j++) {
if (node.childNodes[j].nodeType === Node.TEXT_NODE) {
if (node.childNodes[j].nodeValue.slice(startOffset, endOffset) === text) {
identicalContentNodes.push(node.childNodes[j])
}
}
}
}
for (var i = 0; i < identicalContentNodes.length; i++) {
if (identicalContentNodes[i].parentNode.classList === undefined) {
hightlightTextNode = identicalContentNodes[i]
break
}
else {
var classes = Array.prototype.slice.call(identicalContentNodes[i].parentNode.classList)
if( classes.indexOf('node_' + id) === -1) {
hightlightTextNode = identicalContentNodes[i]
break
}
}
}
let selectBF = document.createTextNode(hightlightTextNode.nodeValue.slice(0, startOffset))
let selectAF = document.createTextNode(hightlightTextNode.nodeValue.slice(endOffset))
let span = document.createElement('span')
span.innerHTML = text
span.classList.add(styles.highlightNote)
span.classList.add('node_' + id)
let fragment = document.createDocumentFragment()
fragment.appendChild(selectBF)
fragment.appendChild(span)
fragment.appendChild(selectAF)
hightlightTextNode.parentNode.replaceChild(fragment, hightlightTextNode)
// if (hightlightNode.nodeType === Node.ELEMENT_NODE) {
// hightlightNode.innerHTML = hightlightNode.innerHTML.replace(text, '<span class="' + styles.highlightNote + ' node_' + id + '">' + text + '</span>')
// }
})
})
}
// 删除高亮数据
if (Object.keys(highlightTextsDelete).length !== 0) {
const deleteTextsArray = Object.values(highlightTextsDelete)
const deleteTexts = deleteTextsArray[0]
// let deleteTextsInNode = document.body.querySelector(".node_" + deleteTexts.id)
deleteTexts.texts.forEach(function(deleteText) {
let deleteNode = document.body.querySelector(".node_" + deleteTexts.id)
let commonAncestorNode = deleteNode.parentNode
let text = deleteText.text
let startOffset = deleteText.startOffset
if (commonAncestorNode.nodeType === Node.ELEMENT_NODE) {
// commonAncestorNode.removeChild(deleteNode)
commonAncestorNode.innerHTML = commonAncestorNode.innerHTML.replace(deleteNode.outerHTML, text)
// commonAncestorNode.innerHTML = commonAncestorNode.innerHTML.slice(0, startOffset) + content + commonAncestorNode.innerHTML.slice(startOffset)
}
})
}
}
}
}
| 42.367188 | 162 | 0.602987 |
a1a8c6624913232c5d0c25d2a6c4da1522d2c701 | 278 | js | JavaScript | packages/framework/src/Resources/scripts/admin/components/select2.js | machicek/shopsys | bd0ccc5acafbfa7b16ba3a24303480fd3c09269f | [
"PostgreSQL"
] | null | null | null | packages/framework/src/Resources/scripts/admin/components/select2.js | machicek/shopsys | bd0ccc5acafbfa7b16ba3a24303480fd3c09269f | [
"PostgreSQL"
] | 1 | 2019-12-17T19:45:10.000Z | 2019-12-17T19:47:54.000Z | packages/framework/src/Resources/scripts/admin/components/select2.js | machicek/shopsys | bd0ccc5acafbfa7b16ba3a24303480fd3c09269f | [
"PostgreSQL"
] | null | null | null | (function ($) {
Shopsys = window.Shopsys || {};
Shopsys.register.registerCallback(function ($container) {
$container.filterAllNodes('select').select2({
minimumResultsForSearch: 5,
width: 'computedstyle'
});
});
})(jQuery);
| 21.384615 | 61 | 0.57554 |
a1a9b2369c1f7b802831836eb1dff35eb75d0981 | 522 | js | JavaScript | test/getIp.js | renzhezhilu/mini-node-web-server | 4739ff1e454e98a98ed763afdfe524bdcac9da20 | [
"Apache-2.0"
] | null | null | null | test/getIp.js | renzhezhilu/mini-node-web-server | 4739ff1e454e98a98ed763afdfe524bdcac9da20 | [
"Apache-2.0"
] | null | null | null | test/getIp.js | renzhezhilu/mini-node-web-server | 4739ff1e454e98a98ed763afdfe524bdcac9da20 | [
"Apache-2.0"
] | null | null | null | var os = require('os');
var interfaces = os.networkInterfaces();
console.log(interfaces.en0[1].address);
// for (item in interfaces) {
// console.log('Network interface name: ' + item);
// for (att in interfaces[item]) {
// var address = interfaces[item][att];
// console.log('Family: ' + address.family);
// console.log('IP Address: ' + address.address);
// console.log('Is Internal: ' + address.internal);
// console.log('');
// }
// console.log('==================================');
// } | 30.705882 | 55 | 0.56705 |
a1a9cae68a67adae224ac60a2aedce732428e8af | 2,442 | js | JavaScript | www/scripts/service-worker.js | romainDavaze/devfest-conferences | 63218cfbc1bb474ab8ea89e88f4200e8bb1ed930 | [
"MIT"
] | null | null | null | www/scripts/service-worker.js | romainDavaze/devfest-conferences | 63218cfbc1bb474ab8ea89e88f4200e8bb1ed930 | [
"MIT"
] | null | null | null | www/scripts/service-worker.js | romainDavaze/devfest-conferences | 63218cfbc1bb474ab8ea89e88f4200e8bb1ed930 | [
"MIT"
] | null | null | null | importScripts("../vendors/js/localforage.js");
const FILES_TO_CACHE = [
'../home.html',
'../views/note.html',
'../views/session-detail.html',
'../views/sessions.html',
'../views/speaker-detail.html',
'../views/speakers.html',
'home.js',
'service-worker.js',
'cache-service.js',
'note.js',
'session-detail.js',
'sessions.js',
'speaker-detail.js',
'speakers.js',
'utils.js',
'../styles/about-device.css',
'../styles/home.css',
'../styles/note.css',
'../styles/session-detail.css',
'../styles/sessions.css',
'../styles/speaker-detail.css',
'../styles/speakers.css',
'../vendors/css/material-icons.css',
'../vendors/css/materialize.css',
'../vendors/js/jquery.min.js',
'../vendors/js/localforage.js',
'../vendors/js/materialize.js',
'../vendors/fonts/roboto/Roboto-Regular.woff2',
'../assets/logo-devfest.jpg',
'../assets/default-note-pic.png',
'../assets/default-speaker-pic.png',
'../assets/follow-button.png'
];
const STATIC_CACHE_NAME = 'devfest-conferences-pages';
self.addEventListener('install', event => {
console.log('Installing Service Worker...');
console.log('Putting resources in cache');
event.waitUntil(
Promise.all([
caches.open(STATIC_CACHE_NAME)
.then(cache => cache.addAll(FILES_TO_CACHE))
])
);
});
self.skipWaiting();
self.addEventListener('activate', event => {
console.log('Activating Service Worker...');
})
self.addEventListener('fetch', event => {
console.log('Fetching:', event.request.url);
event.respondWith(
caches.match(event.request)
.then(response => {
if (response) {
console.log(event.request.url, ' served by cache');
return response;
}
console.log(event.request.url, ' served by internet');
return fetch(event.request);
})
.then(function (response) {
return caches.open(STATIC_CACHE_NAME).then(cache => {
if (event.request.url.indexOf('.json') < 0) {
cache.put(event.request.url, response.clone());
}
return response;
})
})
.catch(error => console.error("Error while getting " + event.request))
);
});
| 27.438202 | 82 | 0.555283 |
a1aa78fdc983b150008625ebb32a41142d0d710e | 1,002 | js | JavaScript | rollup.config.js | ramiel/mikro-orm-cache-adapter-redis | e98e226f38bec2ae3d5810cecdc131b9d9754a20 | [
"MIT"
] | 9 | 2021-01-30T06:59:41.000Z | 2022-03-19T15:18:42.000Z | rollup.config.js | ramiel/mikro-orm-cache-adapter-redis | e98e226f38bec2ae3d5810cecdc131b9d9754a20 | [
"MIT"
] | 2 | 2022-02-24T06:39:10.000Z | 2022-03-19T19:29:54.000Z | rollup.config.js | ramiel/mikro-orm-cache-adapter-redis | e98e226f38bec2ae3d5810cecdc131b9d9754a20 | [
"MIT"
] | 2 | 2021-11-05T02:38:45.000Z | 2022-03-19T02:04:11.000Z | /* eslint-env node */
// import { nodeResolve } from '@rollup/plugin-node-resolve';
// import commonjs from 'rollup-plugin-commonjs';
// import resolve from 'rollup-plugin-node-resolve';
import pkg from './package.json';
import typescript from 'typescript';
import typescriptPlugin from 'rollup-plugin-typescript2';
const isProd = process.env.NODE_ENV === 'production';
const externalDepsRegexp = Object.keys(pkg.peerDependencies || {}).map(
(dep) => new RegExp(`${dep}(/.+)?`),
);
export default [
{
input: 'src/index.ts',
external: (id) => {
// We consider external any dep in peerDependecies or a sub import
// e.g. reakit, reakit/Portal
return externalDepsRegexp.reduce((acc, regexp) => {
return acc || regexp.test(id);
}, false);
},
plugins: [
typescriptPlugin({
clean: isProd,
typescript,
}),
],
output: [
{ file: pkg.module, format: 'es' },
{ file: pkg.main, format: 'cjs' },
],
},
];
| 27.081081 | 72 | 0.612774 |
a1ac057e1ffdc64e3000c60a4285332819c3ba14 | 6,361 | js | JavaScript | apps/js/StudentApp.js | ThaumicMekanism/examtool-web | d1617539582e17a57fa8ae819b9d7a9a20dd31e9 | [
"MIT"
] | null | null | null | apps/js/StudentApp.js | ThaumicMekanism/examtool-web | d1617539582e17a57fa8ae819b9d7a9a20dd31e9 | [
"MIT"
] | null | null | null | apps/js/StudentApp.js | ThaumicMekanism/examtool-web | d1617539582e17a57fa8ae819b9d7a9a20dd31e9 | [
"MIT"
] | null | null | null | import React, { useEffect, useState } from "react";
import {
Col, Container, Form, Navbar, Row,
} from "react-bootstrap";
import EndModal from "./EndModal";
import Exam from "./Exam";
import ExamContext from "./ExamContext";
import InternetDown from "./InternetDown";
import PasswordDecryptor from "./PasswordDecryptor";
import ExamDownloader from "./ExamDownloader";
import GoogleSignInButton from "./GoogleSignInButton";
import post from "./post";
import Timer from "./Timer";
export default function StudentApp() {
const [username, setUsername] = useState("");
const [examList, setExamList] = useState([]);
const [selectedExam, setSelectedExam] = useState("");
const [publicGroup, setPublicGroup] = useState(null);
const [encryptedGroups, setEncryptedGroups] = useState(null);
const [savedAnswers, setSavedAnswers] = useState(null);
const [deadline, setDeadline] = useState(null);
const [decryptedGroups, setDecryptedGroups] = useState(null);
const [examLocked, setExamLocked] = useState(false);
const [examEnded, setExamEnded] = useState(false);
const [showInternetError, setShowInternetError] = useState(false);
useEffect(() => {
const go = async () => {
setExamList(await (await post("list_exams")).json());
};
go();
}, []);
const handleExamSelect = (e) => {
setSelectedExam(e.target.value);
setEncryptedGroups(null);
};
const handleReceiveExam = ({
// eslint-disable-next-line no-shadow
exam, publicGroup, privateGroups, answers, deadline, timestamp,
}) => {
setSavedAnswers(answers);
setSelectedExam(exam);
setPublicGroup(publicGroup);
setEncryptedGroups(privateGroups);
setDeadline(deadline - Math.round(timestamp) + Math.round(new Date().getTime() / 1000) - 2);
};
const handleLock = () => setExamLocked(true);
const handleEnd = () => setExamEnded(true);
return (
<>
<Navbar bg="dark" variant="dark" sticky="top">
<Navbar.Brand href="#">CS 61A Exam Runner</Navbar.Brand>
{deadline && <Timer target={deadline} onLock={handleLock} onEnd={handleEnd} />}
</Navbar>
<Container>
<br />
<Row>
<Col>
<h1>Final Exam</h1>
</Col>
</Row>
<Row>
<Col>
<GoogleSignInButton
onSuccess={setUsername}
/>
</Col>
</Row>
{(username && !encryptedGroups) && (
<>
<br />
<Row>
<Col>
<Form>
<Form.Group controlId="exampleForm.SelectCustom">
<Form.Label>Now, choose your exam:</Form.Label>
<Form.Control
as="select"
value={selectedExam}
onChange={handleExamSelect}
custom
>
<option hidden disabled selected value="">Select an exam</option>
{examList.map((exam) => <option>{exam}</option>)}
</Form.Control>
</Form.Group>
</Form>
</Col>
</Row>
</>
)}
{(selectedExam && !encryptedGroups) && (
<Row>
<Col>
<p>
You have selected the exam
{" "}
<b>{selectedExam}</b>
. If this does not look correct, please re-select your exam.
</p>
<p>
Otherwise, click the button to generate your exam.
You can do this before the exam starts.
</p>
<ExamDownloader
exam={selectedExam}
onReceive={handleReceiveExam}
/>
</Col>
</Row>
)}
{(encryptedGroups && !decryptedGroups) && (
<>
<br />
<Row>
<Col>
<p>
The
{" "}
<b>{selectedExam}</b>
{" "}
exam has successfully been downloaded!
Enter the password distributed by course staff to decrypt it
and start the exam.
</p>
<PasswordDecryptor
encryptedExam={encryptedGroups}
onDecrypt={setDecryptedGroups}
/>
</Col>
</Row>
</>
)}
<br />
<ExamContext.Provider value={{
exam: selectedExam,
savedAnswers,
locked: examLocked,
onInternetError: () => setShowInternetError(true),
}}
>
<Exam publicGroup={publicGroup} groups={decryptedGroups} ended={examEnded} />
</ExamContext.Provider>
{examLocked && <EndModal />}
{showInternetError && <InternetDown onHide={() => setShowInternetError(false)} /> }
</Container>
</>
);
}
| 38.319277 | 109 | 0.407798 |
a1ac3a0c96866a560407ee5fab75e9b50af80936 | 614 | js | JavaScript | ui/v1/local/master.js | jsxcad/JSxCAD | fa788d9ddbd196fa591d91977ba20dc7ec645db5 | [
"MIT"
] | 32 | 2019-03-06T05:44:53.000Z | 2022-01-02T15:21:40.000Z | ui/v1/local/master.js | jsxcad/JSxCAD | fa788d9ddbd196fa591d91977ba20dc7ec645db5 | [
"MIT"
] | 85 | 2019-03-18T01:13:31.000Z | 2022-03-24T10:26:50.000Z | ui/v1/local/master.js | jsxcad/JSxCAD | fa788d9ddbd196fa591d91977ba20dc7ec645db5 | [
"MIT"
] | 11 | 2019-03-18T05:35:13.000Z | 2021-09-27T08:14:12.000Z | /* global location */
import { installUi } from './jsxcad-ui-v1.js';
document.onreadystatechange = () => {
if (document.readyState === 'complete') {
const bootstrap = async () => {
const booting = document.createElement('center');
booting.innerText = `Booting sha`;
document.getElementById('loading').appendChild(booting);
const hash = location.hash.substring(1);
const [project, source] = hash.split('@');
await installUi({ document, project, source, sha: 'master' });
document.body.removeChild(document.getElementById('loading'));
};
bootstrap();
}
};
| 32.315789 | 68 | 0.640065 |
a1ac519547151527d16a62e05d15aa6a42bb3c58 | 386 | js | JavaScript | lib/fetcher.js | Keshavdulal/dogstudio-next-starter | b5f72a80123313c7119aeb9d18781285983bcb30 | [
"MIT"
] | null | null | null | lib/fetcher.js | Keshavdulal/dogstudio-next-starter | b5f72a80123313c7119aeb9d18781285983bcb30 | [
"MIT"
] | null | null | null | lib/fetcher.js | Keshavdulal/dogstudio-next-starter | b5f72a80123313c7119aeb9d18781285983bcb30 | [
"MIT"
] | null | null | null | const WORDPRESS_GRAPHQL_ENDPOINT = process.env.WORDPRESS_GRAPHQL_ENDPOINT;
async function fetcher(query, { variables } = {}) {
const res = await fetch(WORDPRESS_GRAPHQL_ENDPOINT, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ query, variables })
});
const json = await res.json();
return json;
}
export default fetcher;
| 25.733333 | 74 | 0.699482 |
a1ac756f27de4d3752dcb9581d08577dde5868c3 | 741 | js | JavaScript | modules/productlists/server/routes/productlists.server.routes.js | mob35/ecommerce-server | 37b33fa0db7e36f6d4f1d2a9f603aa14c4706a36 | [
"MIT"
] | null | null | null | modules/productlists/server/routes/productlists.server.routes.js | mob35/ecommerce-server | 37b33fa0db7e36f6d4f1d2a9f603aa14c4706a36 | [
"MIT"
] | null | null | null | modules/productlists/server/routes/productlists.server.routes.js | mob35/ecommerce-server | 37b33fa0db7e36f6d4f1d2a9f603aa14c4706a36 | [
"MIT"
] | null | null | null | 'use strict';
/**
* Module dependencies
*/
var productlistsPolicy = require('../policies/productlists.server.policy'),
productlists = require('../controllers/productlists.server.controller');
module.exports = function(app) {
// Productlists Routes
app.route('/api/productlists') //.all(productlistsPolicy.isAllowed)
.get(productlists.read, productlists.listproduct);
// .post(productlists.create);
// app.route('/api/productlists/:productlistId').all(productlistsPolicy.isAllowed)
// .get(productlists.read)
// .put(productlists.update)
// .delete(productlists.delete);
// Finish by binding the Productlist middleware
// app.param('productlistId', productlists.productlistByID);
}; | 33.681818 | 86 | 0.703104 |
a1ac7ece018a6e2c45c647613aa108de728cb61a | 9,867 | js | JavaScript | js/main.js | 3t13nn3/-S5-TP1-Dev-Web | bd46ce0f6ae1b7c6113dba491114ccf3fb66147e | [
"MIT"
] | null | null | null | js/main.js | 3t13nn3/-S5-TP1-Dev-Web | bd46ce0f6ae1b7c6113dba491114ccf3fb66147e | [
"MIT"
] | null | null | null | js/main.js | 3t13nn3/-S5-TP1-Dev-Web | bd46ce0f6ae1b7c6113dba491114ccf3fb66147e | [
"MIT"
] | null | null | null | /*Etienne PENAULT */
/*TODO - Fix Speed in size function */
/*TODO - Add some generic picture detection */
window.addEventListener("load", event => {
main();
});
const main = event => {
let canvas = new Gallery();
canvas.createImage();
canvas.loop();
}
class Gallery {
/*To create a canvas*/
constructor() {
this.canvas = document.createElement("canvas");
this.context = this.canvas.getContext("2d");
this.canvas.width = window.innerWidth;
this.canvas.height = window.innerHeight;
document.body.appendChild(this.canvas);
console.log("Canvas: " + window.innerWidth + " " + window.innerWidth);
/*Initialize variables*/
this.randomNumber = 0;
this.nbOfImages = 5;
this.images = [];
this.imageIndex = 0;
this.lastFrame = Date.now();
this.delta = 0;
this.speed = 0;
this.bounceSpeed = 0;
this.animationOn = false;
this.maxIterationsWidth = 0;
this.maxIterationsHeight = 0;
this.squareWidth = 0;
this.squareHeight = 0;
this.previousIndex = 0;
this.clickX = 0;
this.clickY = 0;
this.shadowffset = 3;
this.transparency = 0.75;
this.offset = 1;
this.selectedAnimation = 0;
this.distanceBeetweenSquaresAndClick = [];
this.event();
}
/*Handle resize*/
resize(){
window.onresize = ()=>{
this.canvas.width = window.innerWidth;
this.canvas.height = window.innerHeight;
};
}
/*Drawing our images & our transition if our transition's boolean is as true*/
draw(){
this.context.drawImage(this.images[(this.imageIndex)],0,0,this.canvas.width,this.canvas.height);
if(this.animationOn == true){
if(this.selectedAnimation == 0)
this.squareClickAnimation()
else if(this.selectedAnimation == 1)
this.squareAnimation()
}
}
/*Graphic loop*/
loop(){
/*Kind of swapframebuffer*/
let swap = this;
window.requestAnimationFrame(()=>{swap.loop()});
this.delta = Date.now() - this.lastFrame;
this.draw();
this.lastFrame = Date.now();
}
/*Fill our vector of images*/
createImage(){
for(let i =0; i<this.nbOfImages; ++i){
this.images[i] = new Image();
this.images[i].src = "media/" + (i+1).toString() + ".jpg";
}
}
/*Hanlde previous and next option to change image*/
changeImage(direction){
/*Reset our value that we will nedd for our animation*/
if(this.selectedAnimation == 0)
this.randomNumber = Math.floor(Math.random() * 40) + 10;
else if(this.selectedAnimation == 1)
this.randomNumber = Math.floor(Math.random() * 20) + 2;
this.speed = 0;
this.bounceSpeed = 0;
this.animationOn = true;
this.setSquareDimensions();
this.calculateDistance();
if(direction == "next"){
this.imageIndex++
this.previousIndex = (((this.imageIndex)-1) >= 0) ? ((this.imageIndex)-1) : this.nbOfImages-1;
}
else if(direction == "prev"){
this.imageIndex--;
this.previousIndex = (((this.imageIndex)+1) >= 0) ? ((this.imageIndex)+1) : this.nbOfImages-1;
}
if(this.imageIndex < 0)
this.imageIndex = this.nbOfImages-1;
else if(this.imageIndex > this.nbOfImages-1)
this.imageIndex = 0;
}
/*Event handler*/
event(){
/*MOUSE*/
this.canvas.addEventListener("click", event => {
this.clickX = event.clientX;
this.clickY = event.clientY;
this.selectedAnimation = 0;
this.changeImage("next");
});
/*KEYBOARD*/
document.addEventListener("keydown", event => {
/*Right & Up*/
if(event.keyCode == 39 || event.keyCode == 38) {
this.selectedAnimation = 1;
this.changeImage("next");
}
/*Left & Down*/
else if(event.keyCode == 37 || event.keyCode == 40) {
this.selectedAnimation = 1;
this.changeImage("prev");
}
});
this.resize();
}
/*To keep some square form, add some squares if height or width is increase */
/*And trying to keep a rationnal speed with any size of canvas */
setSquareDimensions(){
let minimumNumberOfSquareOnTheSmallerAxe = this.randomNumber;
this.maxIterationsWidth = minimumNumberOfSquareOnTheSmallerAxe;
this.maxIterationsHeight = minimumNumberOfSquareOnTheSmallerAxe;
this.squareWidth = (this.canvas.width/this.maxIterationsWidth);
this.squareHeight = (this.canvas.height/this.maxIterationsHeight);
if(this.canvas.width > this.canvas.height){
this.maxIterationsWidth = Math.floor(this.maxIterationsWidth*(this.canvas.width/this.canvas.height))
this.squareWidth = (this.canvas.width/this.maxIterationsWidth);
}else{
this.maxIterationsHeight = Math.floor(this.maxIterationsHeight*(this.canvas.height/this.canvas.width))
this.squareHeight = (this.canvas.height/this.maxIterationsHeight);
}
}
/*Useful for our clicked animation, calculate the distance beetween our click and every squares*/
calculateDistance(){
for(let i = 0; i < this.maxIterationsWidth; ++i){
this.distanceBeetweenSquaresAndClick[i] = [];
for(let j = 0; j < this.maxIterationsHeight; ++j){
this.distanceBeetweenSquaresAndClick[i][j] = (Math.sqrt(
Math.pow(this.clickX - (this.squareWidth*i + this.squareWidth/2), 2) +
Math.pow(this.clickY - (this.squareHeight*j + this.squareHeight/2), 2)
)/500) + 1;
}
}
}
/*Method that create our square animation in function of time*/
squareAnimation(){
/*Image variables*/
let imageForEffect = this.images[this.previousIndex];
/*SPPED*/
if(this.canvas.width > this.canvas.height){
this.speed += this.delta/(this.maxIterationsWidth);
}else{
this.speed += this.delta/(this.maxIterationsHeight);
}
this.bounceSpeed += this.delta/60;
/*Drawing and moving our squares*/
for(let i = 0; i < this.maxIterationsWidth; ++i){
for(let j = 0; j < this.maxIterationsHeight; ++j){
if(this.squareHeight > this.speed*2 && this.squareWidth> this.speed*2){
this.context.globalAlpha = this.transparency;
this.context.fillRect(this.squareWidth*i +this.speed + this.shadowffset,
this.squareHeight*j +this.speed + this.shadowffset + 25*Math.sin(this.bounceSpeed),
this.squareWidth -(this.speed*2) + this.shadowffset + this.offset,
this.squareHeight -(this.speed*2) + this.shadowffset + this.offset
);
this.context.globalAlpha = 1;
this.context.drawImage(imageForEffect,
imageForEffect.naturalWidth/this.maxIterationsWidth*i,
imageForEffect.naturalHeight/this.maxIterationsHeight*j,
imageForEffect.naturalWidth/this.maxIterationsWidth,
imageForEffect.naturalHeight/this.maxIterationsHeight,
this.squareWidth*i +this.speed ,
this.squareHeight*j +this.speed + 25*Math.sin(this.bounceSpeed),
this.squareWidth -(this.speed*2) + this.offset,
this.squareHeight -(this.speed*2) + this.offset);
}
else{
this.animationOn = false;
return
}
}
}
}
/*Method that create our square animation in function of time & click coordinates*/
squareClickAnimation(){
/*Image variables*/
let imageForEffect = this.images[this.previousIndex];
/*SPPED*/
if(this.canvas.width > this.canvas.height){
this.speed += this.delta/(this.maxIterationsWidth);
}else{
this.speed += this.delta/(this.maxIterationsHeight);
}
/*Drawing and moving our squares*/
for(let i = 0; i < this.maxIterationsWidth; ++i){
for(let j = 0; j < this.maxIterationsHeight; ++j){
if(this.squareHeight > this.speed*this.distanceBeetweenSquaresAndClick[i][j]*2 && this.squareWidth> this.speed*this.distanceBeetweenSquaresAndClick[i][j]*2){
this.context.globalAlpha = this.transparency;
this.context.fillRect(this.squareWidth*i +this.speed*this.distanceBeetweenSquaresAndClick[i][j] + this.shadowffset,
this.squareHeight*j +this.speed*this.distanceBeetweenSquaresAndClick[i][j] + this.shadowffset,
this.squareWidth -this.speed*this.distanceBeetweenSquaresAndClick[i][j]*2 + this.shadowffset + this.offset,
this.squareHeight -this.speed*this.distanceBeetweenSquaresAndClick[i][j]*2 + this.shadowffset + this.offset
);
this.context.globalAlpha = 1;
this.context.drawImage(imageForEffect,
imageForEffect.naturalWidth/this.maxIterationsWidth*i,
imageForEffect.naturalHeight/this.maxIterationsHeight*j,
imageForEffect.naturalWidth/this.maxIterationsWidth,
imageForEffect.naturalHeight/this.maxIterationsHeight,
this.squareWidth*i +this.speed*this.distanceBeetweenSquaresAndClick[i][j] ,
this.squareHeight*j +this.speed*this.distanceBeetweenSquaresAndClick[i][j],
this.squareWidth -this.speed*this.distanceBeetweenSquaresAndClick[i][j]*2 + this.offset,
this.squareHeight -this.speed*this.distanceBeetweenSquaresAndClick[i][j]*2 + this.offset);
}else if(this.squareHeight <= this.speed && this.squareWidth<= this.speed){
this.animationOn = false;
return
}
}
}
}
} | 36.010949 | 162 | 0.610419 |
a1ad24fcdc480d892ead4a89456250f2e55c4a6c | 19,735 | js | JavaScript | bitrix/components/bitrix/forum.topic.reviews/templates/.default/script.js | Poulhouse/dev_don360 | 9e7b60e38cdd8be47d31a0080c9cdfabe22215ce | [
"Apache-2.0"
] | null | null | null | bitrix/components/bitrix/forum.topic.reviews/templates/.default/script.js | Poulhouse/dev_don360 | 9e7b60e38cdd8be47d31a0080c9cdfabe22215ce | [
"Apache-2.0"
] | null | null | null | bitrix/components/bitrix/forum.topic.reviews/templates/.default/script.js | Poulhouse/dev_don360 | 9e7b60e38cdd8be47d31a0080c9cdfabe22215ce | [
"Apache-2.0"
] | null | null | null | this.BX = this.BX || {};
this.BX.Forum = this.BX.Forum || {};
(function (exports,main_core,main_core_events) {
'use strict';
var Form = /*#__PURE__*/function () {
babelHelpers.createClass(Form, null, [{
key: "makeQuote",
value: function makeQuote(formId, _ref) {
var entity = _ref.entity,
messageId = _ref.messageId,
text = _ref.text;
if (Form.instances[formId]) {
Form.instances[formId].quote({
entity: entity,
messageId: messageId,
text: text
});
}
}
}, {
key: "makeReply",
value: function makeReply(formId, _ref2) {
var entity = _ref2.entity,
messageId = _ref2.messageId,
text = _ref2.text;
if (Form.instances[formId]) {
Form.instances[formId].reply({
entity: entity,
messageId: messageId,
text: text
});
}
}
}, {
key: "create",
value: function create(_ref3) {
var formId = _ref3.formId,
editorId = _ref3.editorId,
formNode = _ref3.formNode,
useAjax = _ref3.useAjax;
if (!Form.instances[formId]) {
Form.instances[formId] = new Form({
formId: formId,
editorId: editorId,
formNode: formNode,
useAjax: useAjax
});
}
return Form.instances[formId];
}
}]);
function Form(_ref4) {
var formId = _ref4.formId,
editorId = _ref4.editorId,
formNode = _ref4.formNode,
useAjax = _ref4.useAjax;
babelHelpers.classCallCheck(this, Form);
this.formId = formId;
this.editorId = editorId;
this.currentEntity = {
entity: null,
messageId: null
};
this.init = this.init.bind(this);
main_core_events.EventEmitter.subscribe('OnEditorInitedAfter', this.init);
this.useAjax = useAjax === true;
this.formNode = formNode;
this.formNode.addEventListener('submit', this.submit.bind(this));
this.container = this.formNode.parentNode;
this.onSuccess = this.onSuccess.bind(this);
this.onFailure = this.onFailure.bind(this);
}
babelHelpers.createClass(Form, [{
key: "init",
value: function init(_ref5) {
var target = _ref5.target;
if (target.id !== this.editorId) {
return;
}
this.editor = target;
target.insertImageAfterUpload = true;
main_core_events.EventEmitter.unsubscribe('OnEditorInitedAfter', this.init);
BX.bind(BX('post_message_hidden'), "focus", function () {
target.Focus();
});
}
}, {
key: "submit",
value: function submit(event) {
var text = '';
if (this.getLHE().editorIsLoaded) {
this.getLHE().oEditor.SaveContent();
text = this.getLHE().oEditor.GetContent();
}
var error = [];
if (text.length <= 0) {
error.push(main_core.Loc.getMessage('JERROR_NO_MESSAGE'));
} else if (text.length > Form.maxMessageLength) {
error.push(main_core.Loc.getMessage('JERROR_MAX_LEN').replace(/#MAX_LENGTH#/gi, Form.maxMessageLength).replace(/#LENGTH#/gi, text.length));
} else if (this.isOccupied()) {
error.push('Occupied');
}
if (error.length <= 0) {
this.occupy();
if (!this.useAjax) {
return true;
}
this.send();
} else {
alert(error.join(''));
}
event.stopPropagation();
event.preventDefault();
return false;
}
}, {
key: "isOccupied",
value: function isOccupied() {
return this.busy === true;
}
}, {
key: "occupy",
value: function occupy() {
this.busy = true;
this.formNode.querySelectorAll("input[type=submit]").forEach(function (input) {
input.disabled = true;
});
}
}, {
key: "release",
value: function release() {
this.busy = false;
this.formNode.querySelectorAll("input[type=submit]").forEach(function (input) {
input.disabled = false;
});
}
}, {
key: "send",
value: function send() {
var secretNode = document.createElement('input');
secretNode.type = 'hidden';
secretNode.name = 'dataType';
secretNode.value = 'json';
this.formNode.appendChild(secretNode);
BX.ajax.submitAjax(this.formNode, {
method: 'POST',
url: this.formNode.action,
dataType: 'json',
onsuccess: this.onSuccess,
onfailure: this.onFailure
});
this.formNode.removeChild(secretNode);
}
}, {
key: "onSuccess",
value: function onSuccess(_ref6) {
var status = _ref6.status,
action = _ref6.action,
data = _ref6.data,
errors = _ref6.errors;
this.release();
if (status !== 'success') {
return this.showError(data.errorHtml, errors);
} else if (action === 'preview') {
return this.showPreview(data.previewHtml);
} else if (action === 'add') {
// Legacy sake for
main_core_events.EventEmitter.emit('onForumCommentAJAXPost', [data, this.formNode]);
main_core_events.EventEmitter.emit(this.currentEntity.entity, 'onForumCommentAdded', data);
return this.clear();
}
this.showError('There is nothing');
}
}, {
key: "onFailure",
value: function onFailure() {
this.release();
this.showError('<b class="error">Some error with response</b>');
}
}, {
key: "showError",
value: function showError(errorHTML) {
var errorNode = this.container.querySelector('div[data-bx-role=error]');
errorNode.innerHTML = errorHTML;
this.container.setAttribute('data-bx-status', 'errored');
errorNode.style.display = 'block';
}
}, {
key: "hideError",
value: function hideError() {
var errorNode = this.container.querySelector('div[data-bx-role=error]');
errorNode.innerHTML = '';
this.container.removeAttribute('data-bx-status', 'errored');
errorNode.style.display = 'none';
}
}, {
key: "showPreview",
value: function showPreview(previewHTML) {
var previewNode = this.container.querySelector('div[data-bx-role=preview]');
previewNode.innerHTML = previewHTML;
this.container.setAttribute('data-bx-status', 'preview');
previewNode.style.display = 'block';
}
}, {
key: "hidePreview",
value: function hidePreview() {
var previewNode = this.container.querySelector('div[data-bx-role=preview]');
previewNode.innerHTML = '';
this.container.setAttribute('data-bx-status', 'preview');
previewNode.style.display = 'none';
}
}, {
key: "isFormReady",
value: function isFormReady(_ref7) {
var entity = _ref7.entity,
messageId = _ref7.messageId;
if (this.currentEntity.entity === null || this.currentEntity.entity === entity) {
return true;
}
return window.confirm("Do you want to miss all changes?");
}
}, {
key: "parseText",
value: function parseText(text) {
var editor = this.getLHE().oEditor;
var tmpTxt = text;
if (tmpTxt.length > 0 && editor.GetViewMode() === "wysiwyg") {
var reg = /^\[USER\=(\d+)\](.+?)\[\/USER\]/i;
if (reg.test(tmpTxt)) {
tmpTxt = tmpTxt.replace(reg, function () {
var userId = parseInt(arguments[1]);
var userName = main_core.Text.encode(arguments[2]);
var result = "<span>".concat(userName, "</span>");
if (userId > 0) {
var tagId = editor.SetBxTag(false, {
tag: "postuser",
params: {
value: userId
}
});
result = "<span id=\"".concat(tagId, "\" class=\"bxhtmled-metion\">").concat(userName, "</span>");
}
return result;
}.bind(this));
}
}
return tmpTxt;
}
}, {
key: "reply",
value: function reply(_ref8) {
var _this = this;
var entity = _ref8.entity,
messageId = _ref8.messageId,
text = _ref8.text;
this.show({
entity: entity,
messageId: messageId
}).then(function () {
if (text !== '') {
var editor = _this.getLHE().oEditor;
var tmpText = _this.parseText(text);
editor.action.Exec("insertHTML", tmpText);
}
});
}
}, {
key: "quote",
value: function quote(_ref9) {
var _this2 = this;
var entity = _ref9.entity,
messageId = _ref9.messageId,
text = _ref9.text;
this.show({
entity: entity,
messageId: messageId
}).then(function () {
var editor = _this2.getLHE().oEditor;
if (!editor.toolbar.controls.Quote) {
return;
}
var tmpText = _this2.parseText(text);
if (editor.action.actions.quote.setExternalSelectionFromRange) {
editor.action.actions.quote.setExternalSelection(tmpText);
}
editor.action.Exec("quote");
});
}
}, {
key: "clear",
value: function clear() {
this.hideError();
this.hidePreview();
this.editor.CheckAndReInit('');
if (this.editor.fAutosave && this.editor.pEditorDocument) {
this.editor.pEditorDocument.addEventListener('keydown', this.editor.fAutosave.Init.bind(this.editor.fAutosave));
}
this.formNode.querySelectorAll('.reviews-preview').forEach(function (node) {
node.parentNode.removeChild(node);
});
this.formNode.querySelectorAll('input[type="file"]').forEach(function (node) {
var newNode = node.cloneNode();
newNode.value = '';
node.parentNode.replaceChild(newNode, node);
});
var visibilityCheckbox = this.formNode.querySelector('[data-bx-role="attach-visibility"]');
if (visibilityCheckbox) {
visibilityCheckbox.checked = false;
}
var captchaWord = this.formNode.querySelector('input[name="captcha_word"]');
if (captchaWord) {
captchaWord.value = '';
var captchaCode = this.formNode.querySelector('input[name="captcha_code"]');
var captchaImage = this.formNode.querySelector('img[name="captcha_image"]');
BX.ajax.getCaptcha(function (result) {
captchaCode.value = result['captcha_sid'];
captchaImage.src = '/bitrix/tools/captcha.php?captcha_code=' + result['captcha_sid'];
});
}
var subscribeCheckbox = this.formNode.querySelector('input[name="TOPIC_SUBSCRIBE"]');
if (subscribeCheckbox && subscribeCheckbox.checked) {
subscribeCheckbox.disabled = true;
}
}
}, {
key: "show",
value: function show(_ref10) {
var _this3 = this;
var entity = _ref10.entity,
messageId = _ref10.messageId;
return new Promise(function (resolve, reject) {
if (!_this3.isFormReady({
entity: entity,
messageId: messageId
})) {
return reject();
}
var loaded = !!_this3.getLHE() && !!_this3.getLHE().editorIsLoaded;
if (loaded && _this3.currentEntity.entity === entity && _this3.currentEntity.messageId === messageId) {
_this3.getLHE().oEditor.Focus();
return resolve();
}
_this3.currentEntity.entity = entity;
_this3.currentEntity.messageId = messageId;
_this3.container.style.display = 'block';
main_core_events.EventEmitter.emit(_this3.currentEntity.entity, 'onForumCommentFormShow', []);
main_core_events.EventEmitter.emit(_this3.getLHEEventNode(), 'OnShowLHE', ['show']);
if (loaded !== true) {
_this3.getLHE().exec(function () {
_this3.show({
entity: entity,
messageId: messageId
}).then(resolve, reject);
});
} else {
resolve();
}
});
}
}, {
key: "getLHE",
value: function getLHE() {
return LHEPostForm.getHandlerByFormId(this.formId);
}
}, {
key: "getLHEEventNode",
value: function getLHEEventNode() {
if (!this.handlerEventNode && this.getLHE()) {
this.handlerEventNode = this.getLHE().eventNode;
}
return this.handlerEventNode;
}
}]);
return Form;
}();
babelHelpers.defineProperty(Form, "maxMessageLength", 64000);
babelHelpers.defineProperty(Form, "instances", {});
var Entity = /*#__PURE__*/function () {
function Entity(_ref) {
var formId = _ref.formId,
container = _ref.container,
preorder = _ref.preorder,
ajaxPost = _ref.ajaxPost;
babelHelpers.classCallCheck(this, Entity);
this.formId = formId;
this.container = container;
this.preorder = preorder === true;
this.ajaxPost = ajaxPost === true;
this.reply = this.reply.bind(this);
this.quote = this.quote.bind(this);
this.parseResponse = this.parseResponse.bind(this);
this.init();
}
babelHelpers.createClass(Entity, [{
key: "init",
value: function init() {
var _this = this;
this.container.querySelectorAll("[data-bx-role=add-new-message]").forEach(function (node) {
node.addEventListener('click', function () {
_this.reply({
node: null
});
});
});
this.bindMessages();
this.bindNavigation();
main_core_events.EventEmitter.subscribe(this, 'onForumCommentAdded', this.parseResponse);
main_core_events.EventEmitter.subscribeOnce(this, 'onForumCommentFormShow', function () {
this.container.querySelectorAll("[data-bx-role=add-new-message]").forEach(function (node) {
node.parentNode.removeChild(node);
});
}.bind(this));
}
}, {
key: "bindMessages",
value: function bindMessages() {
var _this2 = this;
this.container.querySelectorAll('table').forEach(function (node) {
node.querySelectorAll('a[data-bx-act]').forEach(function (actNode) {
var action = actNode.dataset.bxAct;
if (action === 'reply') {
main_core.Event.bind(actNode, 'click', function (event) {
_this2.reply({
node: node
});
});
} else if (action === 'quote') {
main_core.Event.bind(actNode, 'click', function (event) {
_this2.quote({
node: node
});
});
} else if (action === 'hide' || action === 'show') {
main_core.Event.bind(actNode, 'click', function (event) {
_this2.moderate({
node: node,
action: action,
actNode: actNode
});
event.stopPropagation();
event.preventDefault();
});
} else if (action === 'del') {
main_core.Event.bind(actNode, 'click', function (event) {
_this2.delete({
node: node
});
event.stopPropagation();
event.preventDefault();
});
}
});
});
}
}, {
key: "bindNavigation",
value: function bindNavigation() {
var _this3 = this;
if (!this.ajaxPost) {
return;
}
this.container.querySelector('div[data-bx-role=navigation-container-top]').querySelectorAll('a').forEach(function (node) {
main_core.Event.bindOnce(node, 'click', function (event) {
_this3.navigate({
node: node
});
event.stopPropagation();
event.preventDefault();
});
});
this.container.querySelector('div[data-bx-role=navigation-container-bottom]').querySelectorAll('a').forEach(function (node) {
main_core.Event.bind(node, 'click', function (event) {
_this3.navigate({
node: node
});
event.stopPropagation();
event.preventDefault();
});
});
}
}, {
key: "parseResponse",
value: function parseResponse(_ref2) {
var data = _ref2.data;
main_core.Runtime.html(this.container.querySelector('div[data-bx-role=messages-container]'), data.messages);
main_core.Runtime.html(this.container.querySelector('div[data-bx-role=navigation-container-top]'), data.navigationTop);
main_core.Runtime.html(this.container.querySelector('div[data-bx-role=navigation-container-bottom]'), data.navigationBottom);
setTimeout(function (messageId) {
this.bindMessages();
this.bindNavigation();
if (messageId > 0) {
BX.scrollToNode(this.container.querySelector('table[id=message' + messageId + ']'));
}
}.bind(this), 0, data.messageId);
}
}, {
key: "getPlaceholder",
value: function getPlaceholder()
/*messageId*/
{
return this.container.querySelector("[data-bx-role=placeholder]");
}
}, {
key: "navigate",
value: function navigate(_ref3) {
var node = _ref3.node;
return BX.ajax({
'method': 'GET',
'dataType': 'json',
'url': main_core.Uri.addParam(node.href, {
ajax: 'y'
}),
'onsuccess': this.parseResponse
});
}
}, {
key: "reply",
value: function reply(_ref4) {
var node = _ref4.node;
var text = node !== null ? "[USER=".concat(node.dataset.bxAuthorId, "]").concat(node.dataset.bxAuthorName, "[/USER], ") : '';
Form.makeReply(this.formId, {
entity: this,
messageId: 0,
text: text
});
}
}, {
key: "quote",
value: function quote(_ref5) {
var node = _ref5.node;
var text = ["[USER=".concat(node.dataset.bxAuthorId, "]").concat(node.dataset.bxAuthorName, "[/USER]<br>"), node.querySelector('div[data-bx-role=text]').innerHTML].join('');
Form.makeQuote(this.formId, {
entity: this,
messageId: 0,
text: text
});
}
}, {
key: "moderate",
value: function moderate(_ref6) {
var node = _ref6.node,
actNode = _ref6.actNode;
main_core.ajax.runComponentAction('bitrix:forum.topic.reviews', actNode.dataset.bxAct + 'Message', {
mode: 'class',
data: {
id: node.dataset.bxMessageId
}
}).then(function (_ref7) {
var data = _ref7.data;
actNode.dataset.bxAct = data.APPROVED === 'Y' ? 'hide' : 'show';
if (data.APPROVED === 'Y') {
node.classList.remove('reviews-post-hidden');
} else {
node.classList.add('reviews-post-hidden');
}
});
}
}, {
key: "delete",
value: function _delete(_ref8) {
var node = _ref8.node;
main_core.ajax.runComponentAction('bitrix:forum.topic.reviews', 'deleteMessage', {
mode: 'class',
data: {
id: node.dataset.bxMessageId
}
}).then(function () {
node.parentNode.removeChild(node);
});
}
}]);
return Entity;
}();
exports.Entity = Entity;
exports.Form = Form;
}((this.BX.Forum.Reviews = this.BX.Forum.Reviews || {}),BX,BX.Event));
//# sourceMappingURL=script.js.map
| 30.787832 | 180 | 0.555359 |
a1ad45bf5e364ec99dad1dc54d9fefcc0b95fe33 | 381 | js | JavaScript | Overview/app.js | Brevering/WebAppsWithNodeJS | e3145a0c0e0c8cfb0692cf188002b62595c2b89b | [
"MIT"
] | null | null | null | Overview/app.js | Brevering/WebAppsWithNodeJS | e3145a0c0e0c8cfb0692cf188002b62595c2b89b | [
"MIT"
] | null | null | null | Overview/app.js | Brevering/WebAppsWithNodeJS | e3145a0c0e0c8cfb0692cf188002b62595c2b89b | [
"MIT"
] | null | null | null | /*globals require */
const fs = require('fs');
var contents = fs.readFileSync('app.js', 'utf8');
//console.log(contents);
/* variant 1
const SuperheroModule = require('./models/superhero.js');
const Superhero = SuperheroModule.Superhero;
var batman = new Superhero('Batman', 'Bruce Wayne', 'Utility Belt');
console.log(batman); */
const ModelsFactory = require('./models'); | 22.411765 | 68 | 0.700787 |
a1ad8bebaba397353e40acbb3f1176e934b90746 | 183 | js | JavaScript | src/utils/chrono.js | navikt/podlet-vta-situasjon | 328a35339df32510e93b040b5bef8af19dfa3897 | [
"MIT"
] | null | null | null | src/utils/chrono.js | navikt/podlet-vta-situasjon | 328a35339df32510e93b040b5bef8af19dfa3897 | [
"MIT"
] | 1 | 2021-02-15T06:33:46.000Z | 2021-02-15T06:33:46.000Z | src/utils/chrono.js | navikt/podlet-vta-situasjon | 328a35339df32510e93b040b5bef8af19dfa3897 | [
"MIT"
] | null | null | null | const chrono = {
iDag: null,
};
export const setFastTidspunktForIDag = (iDag) => {
chrono.iDag = iDag;
};
export const hentIDag = () => {
return chrono.iDag || new Date();
};
| 15.25 | 50 | 0.617486 |
a1ade83b98b985f896e57861258bf0ffe1f9e11d | 998 | js | JavaScript | src/data/types/ExerciseQuestionItem.js | champentrustz/react-ge | d547dd5faa71349889fbf32c35088ad916810722 | [
"MIT"
] | null | null | null | src/data/types/ExerciseQuestionItem.js | champentrustz/react-ge | d547dd5faa71349889fbf32c35088ad916810722 | [
"MIT"
] | null | null | null | src/data/types/ExerciseQuestionItem.js | champentrustz/react-ge | d547dd5faa71349889fbf32c35088ad916810722 | [
"MIT"
] | null | null | null | import {
GraphQLObjectType as ObjectType,
GraphQLInt as Integer,
GraphQLList as List,
GraphQLString as StringType,
GraphQLNonNull as NonNull,
GraphQLFloat as Float,
} from 'graphql';
import ExerciseItem from '../types/ExerciseItem';
import Exercise from '../models/Exercise';
import ExerciseQuestionChoiceItem from '../types/ExerciseQuestionChoiceItem';
import ExerciseQuestionChoice from '../models/ExerciseQuestionChoice';
import sequelize from '../sequelize';
const ExerciseQuestionItem = new ObjectType({
name: 'ExerciseQuestionItem',
fields: {
id: {type: Integer},
exercise_id: {type: Integer},
question: {type: StringType},
score: {type: Float},
exercise_question_choice_id : {type : new List(ExerciseQuestionChoiceItem), resolve(parent){
return sequelize.sync().then(() => ExerciseQuestionChoice.findAll({
where : {
exercise_question_id : parent.id,
},
}))
},},
},
});
export default ExerciseQuestionItem;
| 27.722222 | 96 | 0.710421 |
a1ae323e56cd5377d6bcefce7aa9134e9cf2a860 | 1,261 | js | JavaScript | dist/skylark-selectize/contrib/MicroPlugin.js | skylark-integration/skylark-selectize | f60f447f2da6982f67ecdd063749e05e1eafef03 | [
"MIT"
] | null | null | null | dist/skylark-selectize/contrib/MicroPlugin.js | skylark-integration/skylark-selectize | f60f447f2da6982f67ecdd063749e05e1eafef03 | [
"MIT"
] | 1 | 2022-03-02T07:04:44.000Z | 2022-03-02T07:04:44.000Z | dist/skylark-selectize/contrib/MicroPlugin.js | skylark-integration/skylark-selectize | f60f447f2da6982f67ecdd063749e05e1eafef03 | [
"MIT"
] | null | null | null | /**
* skylark-selectize - A version of jquery.appendgrid that ported to running on skylarkjs ui.
* @author Hudaokeji, Inc.
* @version v0.9.0
* @link https://github.com/skylark-integration/skylark-selectize/
* @license MIT
*/
define([],function(){var n={mixin:function(n){n.plugins={},n.prototype.initializePlugins=function(n){var i,e,s,t=[];if(this.plugins={names:[],settings:{},requested:{},loaded:{}},Array.isArray(n))for(i=0,e=n.length;i<e;i++)"string"==typeof n[i]?t.push(n[i]):(this.plugins.settings[n[i].name]=n[i].options,t.push(n[i].name));else if(n)for(s in n)n.hasOwnProperty(s)&&(this.plugins.settings[s]=n[s],t.push(s));for(;t.length;)this.require(t.shift())},n.prototype.loadPlugin=function(i){var e=this.plugins,s=n.plugins[i];if(!n.plugins.hasOwnProperty(i))throw new Error('Unable to find "'+i+'" plugin');e.requested[i]=!0,e.loaded[i]=s.fn.apply(this,[this.plugins.settings[i]||{}]),e.names.push(i)},n.prototype.require=function(n){var i=this.plugins;if(!this.plugins.loaded.hasOwnProperty(n)){if(i.requested[n])throw new Error('Plugin has circular dependency ("'+n+'")');this.loadPlugin(n)}return i.loaded[n]},n.define=function(i,e){n.plugins[i]={name:i,fn:e}}}};return n});
//# sourceMappingURL=../sourcemaps/contrib/MicroPlugin.js.map
| 126.1 | 967 | 0.706582 |
a1aff824ae6758761a703295c2fdee3e49d8fa68 | 5,879 | js | JavaScript | src/routes/link.js | danilovilhena/whatsapp-redirect | 7cd0ecbe8d3625ca54400c17f92cff05b0a37cfe | [
"MIT"
] | 1 | 2021-10-10T01:54:05.000Z | 2021-10-10T01:54:05.000Z | src/routes/link.js | danilovilhena/whatsapp-redirect | 7cd0ecbe8d3625ca54400c17f92cff05b0a37cfe | [
"MIT"
] | 2 | 2021-10-14T20:36:09.000Z | 2021-10-16T00:56:07.000Z | src/routes/link.js | danilovilhena/whatsapp-redirect | 7cd0ecbe8d3625ca54400c17f92cff05b0a37cfe | [
"MIT"
] | 1 | 2021-10-10T01:54:05.000Z | 2021-10-10T01:54:05.000Z | const express = require('express')
const { Deta } = require('deta')
const { sanitizeLink } = require('../helper.js')
const router = new express.Router()
const deta = Deta('b0t6xspl_PfV5pfhncSNXq84EkMki2FtjUrXMH57R')
const db = deta.Base('whatsapp')
// READ - Get/redirect to current link
router.get('/:key', async (req, res) => {
const key = req.params.key
const redirect = req.query.redirect || false
const user = await db.get(key)
if(user){
// Increase user count
await db.update({'count': db.util.increment(1)}, key)
.then(() => {})
.catch(error => res.status(400).send({error}))
if(user.links.length == 0) return res.status(400).send({error: "There aren't any links added to this user."})
// Find first link not full
let currentLink = user.links.find(el => !el.full)
// Increment link counter
currentLink.count += 1
// Check if link counter passed limit after increment, if so change it to full
if(currentLink.count >= (user.limit || 255) + (currentLink.additional || 0)) currentLink.full = true
// Update the database
user.links[user.links.indexOf(currentLink)] = currentLink
await db.update({'links': user.links}, key)
.then(() => {})
.catch(error => res.status(400).send({error}))
// Redirect or send link inside JSON
return redirect ? res.redirect(currentLink.link) : res.status(200).send({ link: currentLink.link })
}
else res.status(404).send({error: 'User not found.'})
})
// UPDATE - Add link to user
router.post('/:key/add', async (req, res) => {
const key = req.params.key
const user = await db.get(key)
if(user){
let link = req.query.link || req.body.link
if(!link) return res.status(400).send({error: 'Group link was not passed.'})
link = sanitizeLink(link)
if(user.links.some(el => el.link === link)) return res.status(400).send({error: 'Group link is already included.'})
let linkObj = { id: user.links.length, link, count: 0, full: false, additional: 0 }
const updates = { 'links': db.util.append(linkObj) }
await db.update(updates, key)
.then(() => res.status(200).send({message: `New link added successfully! This was the added link: ${link}`}))
.catch(error => res.status(400).send({error}))
} else res.status(404).send({error: 'User not found.'})
})
// UPDATE - Update link to full
router.post('/:key/full', async (req, res) => {
const key = req.params.key
const user = await db.get(key)
if(user){
let link = req.query.link || req.body.link
if(!link) return res.status(400).send({error: 'Group link was not passed.'})
link = sanitizeLink(link)
if(user.links.some(el => el.link === link)){
let index = user.links.findIndex((el) => el.link == link)
user.links[index].full = true
const updates = { 'links': user.links }
await db.update(updates, key)
.then(() => res.status(200).send({message: `Link ${link} updated to full!`}))
.catch(error => res.status(400).send({error}))
}
else return res.status(400).send({error: 'Group link is not included.'})
} else res.status(404).send({error: 'User not found.'})
})
// UPDATE - Add additional clicks to link
router.post('/:key/additional', async (req, res) => {
const key = req.params.key
const user = await db.get(key)
if(user){
let link = req.query.link || req.body.link
if(!link) return res.status(400).send({error: 'Group link was not passed.'})
link = sanitizeLink(link)
if(user.links.some(el => el.link === link)){
const amount = req.query.amount || req.body.amount
if(!amount) return res.status(400).send({error: 'Additional amount was not passed.'})
let index = user.links.findIndex((el) => el.link == link)
user.links[index].amount += +amount
const updates = { 'links': user.links }
await db.update(updates, key)
.then(() => res.status(200).send({message: `Added ${amount} additional clicks to the link: ${link}.`}))
.catch(error => res.status(400).send({error}))
}
else return res.status(400).send({error: 'Group link is not included.'})
} else res.status(404).send({error: 'User not found.'})
})
// DELETE - Delete link from user
router.delete('/:key/remove', async (req, res) => {
const key = req.params.key
const user = await db.get(key)
if(user){
let link = req.query.link || req.body.link
if(!link) return res.status(400).send({error: 'Group link was not passed.'})
link = sanitizeLink(link)
if(user.links.some(el => el.link === link)){
const updates = { 'links': user.links.filter((el) => el.link != link) }
await db.update(updates, key)
.then(() => res.status(200).send({message: `Link removed successfully! This was the removed link: ${link}`}))
.catch(error => res.status(400).send({error}))
}
else return res.status(400).send({error: 'Group link is not included.'})
} else res.status(404).send({error: 'User not found.'})
})
// DELETE - Delete all links from user
router.delete('/:key/removeall', async (req, res) => {
const key = req.params.key
const user = await db.get(key)
if(user){
const updates = { 'links': [] }
await db.update(updates, key)
.then(() => res.status(200).send({message: 'All links removed successfully!'}))
.catch(error => res.status(400).send({error}))
} else res.status(404).send({error: 'User not found.'})
})
module.exports = router | 38.933775 | 125 | 0.587515 |
a1b03caba496f07938114bf88f7404da47a7d674 | 280 | js | JavaScript | src/controls/questionBubble.js | XaveScor/chat-builder | 2957050291766e350167b87e420b8bcfafbf1ab1 | [
"MIT"
] | null | null | null | src/controls/questionBubble.js | XaveScor/chat-builder | 2957050291766e350167b87e420b8bcfafbf1ab1 | [
"MIT"
] | 9 | 2019-06-27T14:30:07.000Z | 2021-09-01T07:26:34.000Z | src/controls/questionBubble.js | XaveScor/conforms | 2957050291766e350167b87e420b8bcfafbf1ab1 | [
"MIT"
] | null | null | null | // @flow
import * as React from 'react'
import { createBubble } from '../createBubble'
type ComponentProps = {
question: string,
}
const component = ({ question }) => <p className='robot'>{question}</p>
export const questionBubble = createBubble<ComponentProps>({ component })
| 25.454545 | 73 | 0.707143 |
a1b1b77735ef2c36d7a46b0c93fa120ee82db6fe | 5,463 | js | JavaScript | src/js/components/chatInterface/interfaceFooter.js | ShiningZeng/EasyChat | 1940b679496e816f61c31e527c56aceb677c339a | [
"MIT"
] | 1 | 2016-10-10T08:04:57.000Z | 2016-10-10T08:04:57.000Z | src/js/components/chatInterface/interfaceFooter.js | ShiningZeng/EasyChat | 1940b679496e816f61c31e527c56aceb677c339a | [
"MIT"
] | null | null | null | src/js/components/chatInterface/interfaceFooter.js | ShiningZeng/EasyChat | 1940b679496e816f61c31e527c56aceb677c339a | [
"MIT"
] | null | null | null | import React, { Component } from 'react';
import {socket, NAME, PHOTO} from '../../main';
export class InterfaceFooter extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.showFile();
this.hideEmoji();
this.initEmoji();
//初始化表情点击事件
const emoji = this.refs.emoji;
this.showHideEmoji = this.showHideEmoji.bind(this);
emoji.addEventListener('click', this.showHideEmoji,false);
//初始化表情点击事件
const emojiContainer = this.refs.emojiContainer;
this.chooseEmoji = this.chooseEmoji.bind(this);
emojiContainer.addEventListener('click', this.chooseEmoji,false);
//初始化文件选取事件
const choseFile = this.refs.choseFile;
this.showFile = this.showFile.bind(this);
choseFile.addEventListener('click', this.showFile,false);
//初始化发送消息事件
const sendMsg = this.refs.sendMsg;
this.sendMessage = this.sendMessage.bind(this);
sendMsg.addEventListener('click', this.sendMessage, false);
//初始化发送文件事件
const uploadFile = this.refs.uploadFile;
this.uploadFileClick = this.uploadFileClick.bind(this);
uploadFile.addEventListener('click', this.uploadFileClick, false);
//初始化inputarea相关事件
const inputarea = this.refs.inputarea;
this.quicksend = this.quicksend.bind(this);
this.hideEmoji = this.hideEmoji.bind(this);
this.hideFile = this.hideFile.bind(this);
inputarea.addEventListener('click', this.hideEmoji, false);
inputarea.addEventListener('keydown', this.quicksend, false);
inputarea.addEventListener('click', this.hideFile, false);
emoji.addEventListener('click', this.hideFile,false);
choseFile.addEventListener('click', this.hideEmoji,false);
}
quicksend(e){
if(e.ctrlKey && (e.keyCode == 13)) {
this.sendMessage();
}
}
showFile() {
const fileContainer = this.refs.fileContainer;
if(fileContainer.style.display == "none")
fileContainer.style.display = "";
else
fileContainer.style.display = "none";
}
initEmoji() {
let emojiContainer = document.getElementById('emoji-container');
let emojiFrag = document.createDocumentFragment();
for (var i = 16; i > 0; i--) {
let emojiItem = document.createElement('img');
emojiItem.src = 'img/emoji/' + i + '.gif';
emojiFrag.appendChild(emojiItem);
};
emojiContainer.appendChild(emojiFrag);
}
uploadFileClick(e) {
const files = this.refs.files;
if(files.files[0].size <= 1*1024*1024) {
const data = new FormData();
const that = this;
data.append("files", files.files[0]);
const xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304) {
let data = JSON.parse(xhr.responseText);
const {users:{current}} = that.props;
const msg = {
fileName: data.fileName,
filePath: data.filePath
}
socket.emit('postMsg', {
source:NAME,
message: msg,
room: current,
imgsrc: PHOTO
});
} else {
console.log("upload failed!");
}
}
}
xhr.open("post", "/upload", true);
xhr.send(data);
} else {
alert("请上传1M以内大小文件")
}
}
sendMessage() {
document.getElementById('chatUl').style.bottom= "0px";
const inputarea = this.refs.inputarea;
let msg = inputarea.innerHTML;
msg = msg.replace(/&/g,'&')
.replace(/<div>/g, '')
.replace(/<\/div>/g, '')
.replace(/<br>/g, '')
.replace(/>/g, '>')
.replace(/</g, '<')
.replace(/ /g, ' ');
if(msg.length) {
const {users, users:{current}} = this.props;
socket.emit('postMsg', {
source:NAME,
message: msg,
room: current,
imgsrc: PHOTO
});
}
inputarea.innerHTML = '';
}
chooseEmoji(e) {
e = e || window.event;//这一行及下一行是为兼容IE8及以下版本
var target = e.target || e.srcElement;
if(e.target && e.target.nodeName == 'IMG') {
const inputarea = this.refs.inputarea;
inputarea.appendChild(e.target.cloneNode());
this.hideEmoji();
}
}
showHideEmoji() {
const emojiContainer = this.refs.emojiContainer;
if(emojiContainer.style.display == "none")
emojiContainer.style.display = "";
else
emojiContainer.style.display = "none";
}
showEmoji() {
const emojiContainer = this.refs.emojiContainer;
if(emojiContainer.style.display == "none")
emojiContainer.style.display = "";
}
hideEmoji() {
const emojiContainer = this.refs.emojiContainer;
if(emojiContainer.style.display != "none")
emojiContainer.style.display = "none";
}
hideFile() {
const fileContainer = this.refs.fileContainer;
if(fileContainer.style.display != "none")
fileContainer.style.display = "none";
}
render() {
return (<div id='interface-footer'>
<div className='file-container' ref = 'fileContainer'>
<input type='file' ref='files' />
<button ref='uploadFile'>发送</button>
</div>
<div className='interface-footer-multiFunc'>
<ul>
<li>
<i className='icon iconfont icon-iconfontemoji' ref='emoji'></i>
</li>
<li ref='choseFile'>
<i className='icon iconfont icon-folder'></i>
</li>
<li>
<i className='icon iconfont icon-shear'></i>
</li>
</ul>
</div>
<div className="emoji-container" id='emoji-container' ref='emojiContainer'></div>
<div contentEditable='true' className="chat-inputarea" ref='inputarea'>
</div>
<div className='interface-footer-send' ref='sendMsg'>发送</div>
</div>)
}
} | 30.519553 | 86 | 0.647996 |
a1b1f3de70acee78d5ef01d3196698d02a934fb3 | 6,703 | js | JavaScript | 1945/lib/javascript/game.js | austinkao91/austinkao91.github.io | 17fd2e9e01f86c2f8f1da599f75c72e9cf98bf37 | [
"CC-BY-3.0"
] | null | null | null | 1945/lib/javascript/game.js | austinkao91/austinkao91.github.io | 17fd2e9e01f86c2f8f1da599f75c72e9cf98bf37 | [
"CC-BY-3.0"
] | null | null | null | 1945/lib/javascript/game.js | austinkao91/austinkao91.github.io | 17fd2e9e01f86c2f8f1da599f75c72e9cf98bf37 | [
"CC-BY-3.0"
] | null | null | null | (function(root) {
if(typeof Asteroids === "undefined") {
root.Asteroids = {};
}
var Game = Asteroids.Game = function(width, height) {
this.width = width;
this.height = height;
this.asteroids = [];
this.bullets = [];
this.explosions = [];
this.addAsteroids();
this.battleship = new Asteroids.Battleship(this.shipPosition());
this.spawn = true;
this.navyShipSpawn = true;
this.gameOver = false;
this.score = 0;
this.currentTime = 0;
this.lives = 3;
};
Game.prototype.shoot = function() {
this.asteroids.forEach(function(enemy) {
enemy.fireBullet.call(enemy);
});
};
Game.prototype.spawnPlayer = function() {
this.battleship = new Asteroids.Battleship(this.shipPosition());
};
Game.prototype.handleLifeLost = function() {
this.lives -=1;
var bgAudio = document.getElementById("playerExplosion");
bgAudio.play();
if(!this.checkState()) {
var options = {
'url': 'lib/sprites/sprites.png',
'pos': this.battleship.pos,
'spritePos': [0,117],
'spriteSize': [39,50],
'speed': 10,
'frames': [12],
'once': true
};
this.battleship = [];
this.explosions.push(new Sprite(options));
setTimeout(this.spawnPlayer.bind(this), 2500);
}
};
Game.prototype.checkState = function() {
if(this.lives <= 0) {
this.gameOver = true;
return true;
}
return false;
};
Game.prototype.enableSpawn = function() {
this.spawn = true;
};
Game.prototype.addAsteroids = function(rand) {
if(rand < 1 - Math.pow(0.99, this.currentTime)) {
this.asteroids.push(new Asteroids.Asteroid(this.randomPosition()));
}
};
Game.prototype.addNavyShip = function(rand) {
if(rand < 1 - Math.pow(0.99, this.currentTime/8)) {
this.asteroids.push(new Asteroids.NavyShip(this.randomPosition()));
}
};
Game.prototype.addEnemies = function(time) {
this.currentTime += time/5;
this.addAsteroids(Math.random());
this.addNavyShip(Math.random());
};
Game.prototype.enableNavyShipSpawn = function() {
this.navyShipSpawn = true;
};
Game.prototype.outofBounds = function(pos) {
return (pos[0] < 0 || pos[0] > this.width || pos[1] < 0 || pos[1] > this.height);
};
Game.prototype.shipPosition = function() {
var canvasPos = [this.width*0.5, this.height*0.8];
var shipImg = new Sprite('lib/sprites/sprites.png', [0, 120], canvasPos, [39, 50], 10, [0,1,2,3,4,5,6,7,8,9,10,11,12],'horizontal', true);
// var shipImg = new Sprite('lib/airplane.png',
// [400,400], [200,200], 5, [0,1]);
return {
"pos": canvasPos,
"game": this,
"health": 3
};
};
Game.prototype.randomPosition = function(){
return {
"pos": [Math.random()*this.width, 0],
"game": this
};
};
Game.prototype.remove = function(object) {
if(object.constructor === Asteroids.Asteroid ||
object.constructor === Asteroids.NavyShip) {
this.asteroids.splice(this.asteroids.indexOf(object),1);
}
if(object.constructor === Asteroids.Bullet ||
object.constructor === Asteroids.EnemyBullet) {
this.bullets.splice(this.bullets.indexOf(object),1);
}
if(object.constructor === Asteroids.Battleship) {
this.battleship = [];
}
};
Game.NUM_ASTEROIDS = 10;
Game.prototype.backgroundInfo = function(ctx) {
var livetext = "LIVES: " + this.lives;
var scoretext = "SCORE: " + this.score;
var pauseText = "Click to toggle pause";
ctx.font="30px Verdana";
ctx.fillStyle='yellow';
ctx.fillText( livetext, 10,50);
ctx.fillText( scoretext, 10,100);
ctx.font="20px Verdana";
ctx.fillText(pauseText, this.width*0.05, this.height*0.95);
};
Game.prototype.draw = function(ctx){
ctx.drawImage(Asteroids.img, 202,245, 20,20, 0, 0, this.width,this.height);
this.allObjects().forEach(function(asteroid){
asteroid.draw(ctx);
});
this.backgroundInfo(ctx);
};
Game.prototype.moveObjects = function(time){
this.allObjects().forEach(function(asteroid){
asteroid.move(time);
asteroid.update(time);
});
};
Game.prototype.wrap = function(pos){
if (pos[0] < 0 || pos[0] > this.width || pos[1] < 0 || pos[1] > this.height){
return [this.width - pos[0], this.height - pos[1]];
}else{
return pos;
}
};
Game.prototype.boundary = function(pos) {
if( pos[0] < 0) {
pos[0] = 0;
} else if(pos[0] > this.width) {
pos[0] = this.width;
}
if( pos[1] < 0) {
pos[1] = 0;
} else if(pos[1] > this.height) {
pos[1] = this.height;
}
return pos;
};
Game.prototype.checkCollisions = function() {
for(var k = 0; k < this.explosions.length; k++) {
if(this.explosions[k].done) {
this.explosions.splice(k,1);
k--;
}
}
for(var i = 0; i < this.allObjects().length; i++) {
for(var j = 0; j < this.allObjects().length; j++) {
if (i!==j){
if(typeof this.allObjects()[i] !== "undefined" ) {
this.allObjects()[i].isCollidedWith(this.allObjects()[j]);
}
}
}
}
};
Game.prototype.checkCollisionsHash = function() {
var xSize = this.width/ 10;
var ySize = this.height/ 10;
};
Game.prototype.hashObjects = function(width, height) {
hash = {};
this.allObjects().forEach(function(object){
var x = Math.floor(object.pos[0]/width);
var y = Math.floor(object.pos[1]/width);
if(!hash.hasOwnProperty(x+"_"+y)) {
hash[x+"_"+y] = {bullet: [], ships: [], bulletRadius: 0, shipRadius: 0};
}
});
};
Game.prototype.insertIntoHash = function(hash, object) {
if(object.constructor === Bullet || object.constructor === EnemyBullet) {
hash[bullet].push(object);
if(hash[bulletRadius] < object.radius) {
hash[bulletRadius] = object.radius;
}
} else if (object.constructor === Asteroid || object.constructor === Battleship ||
object.constructor === NavyShip) {
hash[ships].push(object);
if(hash[shipRadius] < object.radius) {
hash[shipRadius] = object.radius;
}
}
};
Game.prototype.vectorToShip = function(pos) {
var vx;
var vy;
if(this.battleship.pos) {
vx = this.battleship.pos[0] - pos[0];
vy = this.battleship.pos[1] - pos[1];
} else {
vy = 5;
vx = 0;
}
return [vx,vy];
};
Game.prototype.allObjects = function() {
return this.asteroids.concat(this.explosions).concat(this.bullets).concat(this.battleship);
};
})(this);
| 26.389764 | 142 | 0.586006 |
a1b221a57d3db91c30d1f2a1f4a0446ebf9b3d74 | 679 | js | JavaScript | src/client/schema/index.js | yoo2001818/IoTLogic-server | 91a2887b8f41fc6d21898dce20af9d9a9ed1ee44 | [
"MIT"
] | null | null | null | src/client/schema/index.js | yoo2001818/IoTLogic-server | 91a2887b8f41fc6d21898dce20af9d9a9ed1ee44 | [
"MIT"
] | null | null | null | src/client/schema/index.js | yoo2001818/IoTLogic-server | 91a2887b8f41fc6d21898dce20af9d9a9ed1ee44 | [
"MIT"
] | null | null | null | // This is client's schema: used internally by frontend. If you're looking for
// server's DB schema, you should look /db/index.js instead.
import { Schema, arrayOf } from 'normalizr';
export const User = new Schema('users', {
idAttribute: entity => {
if (entity.username) return entity.username.toLowerCase();
return entity.id;
}
});
export const Device = new Schema('devices', {
idAttribute: device => {
if (device.name) return device.name;
return device.id;
}
});
export const Document = new Schema('documents');
User.define({
});
Device.define({
documents: arrayOf(Document)
});
Document.define({
user: User,
devices: arrayOf(Device)
});
| 20.575758 | 78 | 0.677467 |
a1b3c6a72219c1e5e11396a289debb085820eeb4 | 1,385 | js | JavaScript | home.js | henrycii97/uploadbackendlazadahome | ba8b2d15311a87763bb2db3a0a77616d87323bb9 | [
"MIT"
] | null | null | null | home.js | henrycii97/uploadbackendlazadahome | ba8b2d15311a87763bb2db3a0a77616d87323bb9 | [
"MIT"
] | null | null | null | home.js | henrycii97/uploadbackendlazadahome | ba8b2d15311a87763bb2db3a0a77616d87323bb9 | [
"MIT"
] | null | null | null | $(document).ready(function () {
$('.icon').click(function (e) {
e.preventDefault();
$('.ads').hide();
});
$('li.app').click(function (e) {
e.preventDefault();
$('.content-app-all').toggleClass('visible');
$('.customer-care.mp').removeClass('visible');
$('.content-order-check').removeClass('visible');
$('.content-link-language').removeClass('visible');
});
$('li.customer-carer').click(function (e) {
e.preventDefault();
$('.customer-care.mp').toggleClass('visible');
$('.content-app-all').removeClass('visible');
$('.content-order-check').removeClass('visible');
$('.content-link-language').removeClass('visible');
});
$('li.order-check').click(function (e) {
e.preventDefault();
$('.content-order-check').toggleClass('visible');
$('.customer-care.mp').removeClass('visible');
$('.content-app-all').removeClass('visible');
$('.content-link-language').removeClass('visible');
});
$('li.language').click(function (e) {
e.preventDefault();
$('.content-link-language').toggleClass('visible');
$('.content-order-check').removeClass('visible');
$('.customer-care.mp').removeClass('visible');
$('.content-app-all').removeClass('visible');
});
}); | 31.477273 | 57 | 0.548014 |
a1b3d1e560076fd24fe4c12eb7806597d0096195 | 172 | js | JavaScript | .huskyrc.js | eliduty/libs | 04199b2ec43b10bd09333d3403dc6aee51f0b2c8 | [
"MIT"
] | 3 | 2022-01-14T13:02:57.000Z | 2022-03-22T10:10:12.000Z | .huskyrc.js | eliduty/libs | 04199b2ec43b10bd09333d3403dc6aee51f0b2c8 | [
"MIT"
] | null | null | null | .huskyrc.js | eliduty/libs | 04199b2ec43b10bd09333d3403dc6aee51f0b2c8 | [
"MIT"
] | null | null | null | module.exports = {
hooks: {
'pre-commit': 'npx @ls-lint/ls-lint && npx lint-staged --allow-empty',
'commit-msg': 'npx --no-install commitlint --edit $1',
},
};
| 24.571429 | 74 | 0.587209 |
a1b3d2a64bf70f7aaf1f4d6d2313b02f09a5f899 | 3,402 | js | JavaScript | gulpfile.js | davidsekar/jQuery-UI-ScrollTab | 1fe60282c6a8bec477e15f11b6c007725565b623 | [
"MIT"
] | 9 | 2017-08-26T07:04:24.000Z | 2021-11-19T07:57:56.000Z | gulpfile.js | davidsekar/jQuery-UI-ScrollTab | 1fe60282c6a8bec477e15f11b6c007725565b623 | [
"MIT"
] | null | null | null | gulpfile.js | davidsekar/jQuery-UI-ScrollTab | 1fe60282c6a8bec477e15f11b6c007725565b623 | [
"MIT"
] | 3 | 2021-03-10T21:28:32.000Z | 2022-01-22T19:53:29.000Z | var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
var typeScript = require('gulp-typescript');
var sourcemaps = require('gulp-sourcemaps');
var tsProject = typeScript.createProject("tsconfig.json");
var rimraf = require('rimraf');
var header = require('gulp-header');
var typedoc = require("gulp-typedoc");
var paths = {
deps: ['deps/js/**/*.js', 'deps/css/**/*'],
html: ['src/**/*.html'],
scss: ['src/scss/**/*.scss'],
ts: ['src/ts/**/*.ts'],
typeDef: ['src/ts/**/*.d.ts'],
docs: ['index.html', '.nojekyll', 'docs/**/*']
};
var dest = {
root: 'dist/',
js: 'dist/js',
css: 'dist/css',
typeDocOut: 'dist/docs/options'
};
function refreshBrowserSync(done) {
browserSync.reload();
done();
}
// using data from package.json
var pkg = require('./package.json');
var banner = ['/*! <%= pkg.name %>',
' * v<%= pkg.version %>',
' * <%= pkg.homepage %>',
' * @license <%= pkg.license %> */\n'
].join(' | ');
gulp.task('ts', function () {
return tsProject.src()
.pipe(sourcemaps.init())
.pipe(tsProject()).js
.pipe(header(banner, {
pkg: pkg
}))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(dest.js));
});
gulp.task('html', function () {
return gulp.src(paths.html)
.pipe(gulp.dest(dest.root));
});
gulp.task('ts-watch', ['ts'], refreshBrowserSync);
gulp.task('html-watch', ['html'], refreshBrowserSync);
gulp.task('scss', function () {
return gulp.src(paths.scss)
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(dest.css));
});
gulp.task('scss-watch', ['scss'], refreshBrowserSync);
gulp.task('copy-dependency', function () {
return gulp.src(paths.deps, {
base: './deps'
})
.pipe(gulp.dest(dest.root));
});
gulp.task('clean', function () {
return rimraf('dist/**', function () {
// console.log('completed');
});
});
gulp.task('github-pages', function () {
return gulp.src(paths.docs, {
base: '.'
})
.pipe(gulp.dest(dest.root));
});
gulp.task("typedoc", function () {
return gulp
.src(paths.typeDef)
.pipe(typedoc({
// TypeScript options (see typescript docs)
module: "commonjs",
target: "es5",
includeDeclarations: true,
// Output options (see typedoc docs)
out: dest.typeDocOut,
excludeExternals: true,
readme: 'none',
mode: 'file',
// TypeDoc options (see typedoc docs)
name: pkg.name,
theme: "minimal",
ignoreCompilerErrors: false,
version: true,
}));
});
var taskList = ['copy-dependency', 'scss', 'ts', 'html', 'github-pages', 'typedoc'];
// create a task that ensures the `js` task is complete before
// reloading browsers
gulp.task('watch', taskList, function (done) {
// Serve files from the root of this project
browserSync.init({
ui: {
port: 8080
},
server: {
baseDir: "./dist",
index: "index.html"
}
});
// add browserSync.reload to the tasks array to make
// all browsers reload after tasks are complete.
gulp.watch(paths.ts, ['ts-watch']);
gulp.watch(paths.scss, ['scss-watch']);
gulp.watch(paths.html, ['html-watch']);
gulp.watch(paths.docs, ['github-pages']);
gulp.watch(paths.typeDef, ['typedoc']);
});
gulp.task('deploy-files', taskList);
// use default task to launch Browsersync and watch JS files
gulp.task('default', taskList);
| 24.47482 | 84 | 0.604056 |
a1b55e379aa2b7afb56b77b8d92a8528cf495aed | 5,894 | js | JavaScript | src/bitset.js | Andrew-He/geom2d | 8c393c54f972b2185e0cb408328d78192254544b | [
"Apache-2.0"
] | null | null | null | src/bitset.js | Andrew-He/geom2d | 8c393c54f972b2185e0cb408328d78192254544b | [
"Apache-2.0"
] | 1 | 2022-03-24T08:13:40.000Z | 2022-03-24T08:13:40.000Z | src/bitset.js | Andrew-He/geom2d | 8c393c54f972b2185e0cb408328d78192254544b | [
"Apache-2.0"
] | null | null | null | /**
* @file Bitset.js
* @author andrew he
* @reference http://www.cplusplus.com/reference/bitset/
*/
export default class Bitset {
constructor(value) {
if (typeof value === 'number') {
this.value = new Number(value).valueOf();
if (this.value === Infinity) {
throw new RangeError('Invalid Constructor Argument: Initialized Argument Cannot Be Infinity');
}
} else if (typeof value === 'string') {
this.value = parseInt(value, 2);
if (isNaN(this.value)) {
throw new RangeError('Invalid Constructor Argument: Initialized Argument Cannot Be NaN');
}
} else {
throw new TypeError('Invalid Constructor Argument: Accept String (ex. 11001010) or Unsigned Integer only');
}
}
/*
* Returns whether all of the bits in the bitset are set (to one).
*
* @returns {boolean} true if all of the bits in the bitset are set (to one), and false otherwise.
*/
all() {
return this.value === this._allone(this.value);
}
/*
* Returns whether any of the bits is set (i.e., whether at least one bit in the bitset is set to one).
*
* @returns {boolean} true if any of the bits in the bitset is set (to one), and false otherwise.
*/
any() {
return this.value > 0;
}
/*
* Returns whether none of the bits is set (i.e., whether all bits in the bitset have a value of zero).
* opposite of Bitset::any
*
* @returns {boolean} true if none of the bits in the bitset is set (to one), and false otherwise.
*/
none() {
return this.value === 0;
}
/*
* Returns the number of bits in the bitset that are set (i.e., that have a value of one).
*
* @returns {integer} The number of bits set.
*/
count() {
return this.cardinality();
}
/*
* Flips bit values converting zeros into ones and ones into zeros
* @param pos {integer} Order position of the bit whose value is flipped. if pos is null or negative, flip all
*
* @returns {object} *this
*/
flip(pos) {
this._checkIfOutOfRange(pos);
this.value = (pos > 0) ? (this.value ^ (0b1 << pos)) : (this.value ^ this._allone(this.value));
return this;
}
/*
* modify order position of bit
* @param pos {unsigned integer} Order position of the bit whose value is modified
* @param value {integer} zero or one binary
*
* @returns {boolean} *this
*/
set(pos, value = true) {
this._checkIfOutOfRange(pos);
if (pos < 0) {
return this;
}
this.value = value ? this.value | 1 << pos : this.value & ~(1 << pos);
return this;
}
/*
* Resets bits to zero
* @param pos {unsigned integer} order position of the bit
*
* @returns {boolean} *this
*/
reset(pos = -1) {
if (pos > 0) {
this.value = this.value & ~(1 << pos);
}
this.value = 0;
return this;
}
/*
* Returns whether the bit at position pos is set (i.e., whether it is one).
* @param pos {unsigned integer} Order position of the bit
*
* @returns {boolean} true if the bit at position pos is set, and false if it is not set.
*/
test(pos) {
this._checkIfOutOfRange(pos);
return !!(this.value & 0b1 << pos);
}
/*
* Returns the number of bits in the bitset.
*
* @returns {unsigned integer} The number of bits in the bitset
*/
size() {
return Math.log2(Number.MAX_SAFE_INTEGER);
}
cardinality() {
return this.toString().match(/(1)/g).length;
}
equal(other) {
const otherCopy = this._convertIfNot(other);
return this.value === otherCopy.valueOf();
}
notEqual(other) {
const otherCopy = this._convertIfNot(other);
return this.value !== otherCopy.valueOf();
}
and(other) {
const otherCopy = this._convertIfNot(other);
this.value &= otherCopy.valueOf();
return this;
}
or(other) {
const otherCopy = this._convertIfNot(other);
this.value |= otherCopy.valueOf();
return this;
}
not() {
const allone = this._allone(this.value);
this.value ^= allone;
return this;
}
xor(other) {
this.value = this.copy().or(other).and(this.copy().and(other).not()).valueOf();
return this;
}
nor(other) {
this.or(other).not();
return this;
}
nand(other) {
this.and(other).not();
return this;
}
shiftLeft(nBits) {
this.value <<= nBits;
return this;
}
shiftRight(nBits) {
this.value >>= nBits;
return this;
}
// @override
toString() {
return this.value.toString(2);
}
// @override
valueOf() {
return this.value;
}
toArray() {
return [...this.toString()];
}
clone() {
return new Bitset(this.value);
}
copy() {
return this.clone();
}
// return number of bits in current value
length() {
return (Math.floor(Math.log2(this.value)) + 1) || 0;
}
_checkIfOutOfRange(pos) {
const nBits = this.length();
if (pos >= nBits) {
throw new RangeError(`flip out of range, pos must between 0 to ${nBits}`);
}
return;
}
_allone(n) {
let ones = 1;
let iter = 0;
while (++iter < this.length(n)) {
ones <<= 1;
ones |= 1;
}
return ones;
}
_convertIfNot(other) {
if (!(other instanceof Bitset)) {
return new Bitset(other);
}
return other;
}
} | 25.188034 | 119 | 0.537326 |
a1b5a9174fe98e396db492290fed84d077c61234 | 5,248 | js | JavaScript | site/web/app/plugins/dhl-for-woocommerce/dhlpwoocommerce/assets/js/dhlpwc.parcelshop.select.js | Giannisduke/loukia-v2 | cef4ab03249ab1601768a70fa3dd4ed75727555c | [
"RSA-MD"
] | null | null | null | site/web/app/plugins/dhl-for-woocommerce/dhlpwoocommerce/assets/js/dhlpwc.parcelshop.select.js | Giannisduke/loukia-v2 | cef4ab03249ab1601768a70fa3dd4ed75727555c | [
"RSA-MD"
] | null | null | null | site/web/app/plugins/dhl-for-woocommerce/dhlpwoocommerce/assets/js/dhlpwc.parcelshop.select.js | Giannisduke/loukia-v2 | cef4ab03249ab1601768a70fa3dd4ed75727555c | [
"RSA-MD"
] | null | null | null | jQuery(document).ready(function ($) {
var dhlpwc_parcelshop_selector_timeout = null;
var dhlpwc_shipping_input_name = '_unavailable_option_';
if ($('[id^=shipping_method_][id$=_dhlpwc-parcelshop]').length > 0) {
dhlpwc_shipping_input_name = $('[id^=shipping_method_][id$=_dhlpwc-parcelshop]').attr('name')
.replace(/(:|\.|\[|\])/g, '\\$1');
}
$(document.body).on('click', '.dhlpwc-parcelshop-option-change', function (e) {
e.preventDefault();
if ($('[id^=shipping_method_][id$=_dhlpwc-parcelshop]').is(':checked')) {
var container = $('.dhlpwc-parcelshop-option-list');
$(document).mouseup(function (e) {
if (!container.is(e.target) && container.has(e.target).length === 0) {
container.hide();
}
});
container.toggle();
$(document.body).trigger('dhlpwc:show_parcelshop_selector_refresh');
}
}).on('click', '.dhlpwc-parcelshop-option-list-item', function (e) {
e.preventDefault();
if ($('[id^=shipping_method_][id$=_dhlpwc-parcelshop]').is(':checked')) {
var dhlpwc_selected_parcelshop_id = $(this).attr('data-parcelshop-id');
var parcelshop_type = $(this).attr('data-parcelshop-type');
var country_code = $('.dhlpwc-shipping-method-parcelshop-option').data('country-code');
if (typeof parcelshop_type !== 'undefined' && parcelshop_type === 'packStation' && country_code === 'DE') {
var dhlpwc_additional_parcelshop_id = prompt("Add your 'postnumber' for delivery at a DHL Packstation:");
if (dhlpwc_additional_parcelshop_id != null && dhlpwc_additional_parcelshop_id != '') {
dhlpwc_selected_parcelshop_id += '|' + dhlpwc_additional_parcelshop_id;
$(document.body).trigger("dhlpwc:parcelshop_selection_sync", [dhlpwc_selected_parcelshop_id, country_code]);
$('.dhlpwc-parcelshop-option-list').hide();
}else{
alert("'postnumber' is required");
}
} else {
$(document.body).trigger('dhlpwc:parcelshop_selection_sync', [dhlpwc_selected_parcelshop_id, country_code]);
$('.dhlpwc-parcelshop-option-list').hide();
}
}
}).on('keyup keypress', '.dhlpwc-parcelshop-option-list-search input', function (e) {
// Prevent ENTER key from doing anything
var keyCode = e.keyCode || e.which;
if (keyCode === 13) {
e.preventDefault();
return false;
}
}).on('keyup', '.dhlpwc-parcelshop-option-list-search input', function (e) {
if ($('[id^=shipping_method_][id$=_dhlpwc-parcelshop]').is(':checked')) {
clearTimeout(dhlpwc_parcelshop_selector_timeout);
dhlpwc_parcelshop_selector_timeout = setTimeout(function () {
$(document.body).trigger('dhlpwc:show_parcelshop_selector_refresh');
}, 500)
}
}).on('dhlpwc:show_parcelshop_selector_refresh', function () {
var url = dhlpwc_parcelshop_selector.servicepoint_url + $('.dhlpwc-shipping-method-parcelshop-option')
.data('country-code') +
'?limit=' + dhlpwc_parcelshop_selector.limit + '&fuzzy=' + encodeURI($('.dhlpwc-parcelshop-option-list-search input')
.val())
$.get(url, function (data) {
// Remove existing elements from list before appending
$('.dhlpwc-parcelshop-option-list-item.parcelshop-option').remove();
data.forEach(function (parcelShop) {
var parcelShopLocation = (parcelShop.address.countryCode === 'FR' ? parcelShop.address.number + ' ' + parcelShop.address.street : parcelShop.address.street + ' ' + parcelShop.address.number) +
', ' + parcelShop.address.zipCode + ', ' + parcelShop.address.city;
$('.dhlpwc-parcelshop-option-list')
.append('<div class="dhlpwc-parcelshop-option-list-item parcelshop-option" data-parcelshop-type="' + parcelShop.shopType + '" data-parcelshop-id="' + parcelShop.id + '">' +
'<strong>' + parcelShop.name + '</strong><br>' +
'<span>' + parcelShopLocation + '</span></div>')
});
}, 'json')
}).on('dhlpwc:parcelshop_selection_sync', function (e, parcelshop_id, country_code) {
// Due to the cart page not having an actual form, we will temporarily remember the selection as a shadow selection.
// The actual checkout form will always have priority, this is just backup logic.
var data = {
'action': 'dhlpwc_parcelshop_selection_sync',
'parcelshop_id': parcelshop_id,
'country_code': country_code
};
$.post(dhlpwc_parcelshop_selector.ajax_url, data, function (response) {
/* Cart page */
$(document.body).trigger("wc_update_cart");
/* Checkout page */
$(document.body).trigger("update_checkout");
});
})
});
| 53.010101 | 208 | 0.580412 |
a1b6afaa57fbac3f7da9afc4b5de6fc49606a7b1 | 315 | js | JavaScript | scripts/webpack.js | thesaikot/xde | 9570cd4e198ff33c81e54c45ade7a16ab715970a | [
"MIT"
] | 879 | 2017-03-25T08:48:47.000Z | 2021-11-15T09:48:43.000Z | scripts/webpack.js | thesaikot/xde | 9570cd4e198ff33c81e54c45ade7a16ab715970a | [
"MIT"
] | 93 | 2017-03-27T06:10:14.000Z | 2018-07-10T11:30:33.000Z | scripts/webpack.js | joss12/xde | 5ed22972afbdc7b0ecdc4d2eaa9f5e3bc3e8b088 | [
"MIT"
] | 148 | 2017-04-09T14:52:27.000Z | 2020-08-24T13:42:01.000Z | let path = require('path');
let execSync = require('child_process').execSync;
if (process.env.HOT) {
execSync('npm run webpack-hot', {
cwd: path.join(__dirname, '..'),
stdio: 'inherit',
});
} else {
execSync('npm run webpack-dev', {
cwd: path.join(__dirname, '..'),
stdio: 'inherit',
});
}
| 21 | 49 | 0.596825 |
a1b6b6b7716cea12c434fe84a09b30a3d50361a9 | 810 | js | JavaScript | register_commands.js | web-tech-tw/discord-manager | ca069c1f2f06ab596e40f7bd46a8253fe747626c | [
"MIT"
] | null | null | null | register_commands.js | web-tech-tw/discord-manager | ca069c1f2f06ab596e40f7bd46a8253fe747626c | [
"MIT"
] | null | null | null | register_commands.js | web-tech-tw/discord-manager | ca069c1f2f06ab596e40f7bd46a8253fe747626c | [
"MIT"
] | null | null | null | 'use strict'
require('dotenv').config()
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const commands = [
{
name: 'ping',
description: 'Replies with Pong!'
},
{
name: 'user_id',
description: 'Replies with Pong!'
},
{
name: 'clear',
description: 'Replies with Pong!'
}
];
const client = new REST({ version: '9' });
client.setToken(process.env.DISCORD_BOT_TOKEN);
(async () => {
try {
console.log('Started refreshing application (/) commands.');
await client.put(
Routes.applicationGuildCommands(process.env.DISCORD_APP_ID, process.env.GUILD_ID),
{ body: commands },
);
console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
})(); | 20.769231 | 88 | 0.624691 |
a1b72d2eb14dc9c63bcb232c28a960bac889fce8 | 122,379 | js | JavaScript | quickui/libs/js/graphical/map_data/china/province/heilongjiang.js | tengge1/quickui-trail | 258faea9ab55fc4959f0723f16ba80d38525aeba | [
"Apache-2.0"
] | 2 | 2018-08-22T01:09:05.000Z | 2020-08-16T03:58:15.000Z | quickui/libs/js/graphical/map_data/china/province/heilongjiang.js | tengge1/quickui-trail | 258faea9ab55fc4959f0723f16ba80d38525aeba | [
"Apache-2.0"
] | null | null | null | quickui/libs/js/graphical/map_data/china/province/heilongjiang.js | tengge1/quickui-trail | 258faea9ab55fc4959f0723f16ba80d38525aeba | [
"Apache-2.0"
] | 2 | 2018-08-22T01:09:07.000Z | 2022-01-18T03:48:57.000Z | var heilongjiangMapConfig = {
base: {
'fontSize': 12,
'point': 3.5
},
viewBox: [1185.0861642873883, -1435.9087566254907, 680.9449423479143, 618.3772597960831],
shapes: {
"c2311":"M1390.3797655818084,-1137.3229146350443L1390.3268891236778,-1140.0252769281378L1392.2251701489672,-1145.8454867891712L1391.6770148149085,-1148.4349604578279L1390.2880247374642,-1150.0783054511182L1391.9621165632693,-1151.9823172129727L1391.9113117932338,-1154.6761547927576L1394.2421515693065,-1155.9458366716938L1397.4600917405296,-1155.4690422620872L1399.7850024294153,-1156.740784575165L1400.1021617346025,-1155.2586022809433L1404.4752588351778,-1154.2655569997287L1405.7306534852075,-1155.6915510632875L1406.5797804438275,-1158.9755909894163L1407.991396193609,-1159.6679144612442L1407.84964920528,-1162.7309862922575L1406.6961456076247,-1163.2568670972319L1407.5295258641422,-1164.2119505437058L1406.6330041767305,-1165.9556723877477L1407.638573248407,-1168.490736645185L1407.077993653229,-1171.0812163021567L1407.9894601172477,-1171.6659367583802L1407.5901464789808,-1173.5091305259439L1406.4389091809699,-1174.0344727865413L1406.1334677684572,-1177.8407598936953L1404.1745512279647,-1179.7328353471555L1404.4249295224736,-1180.9482612400286L1402.546098368723,-1182.477483695994L1403.376695201819,-1183.423900948073L1402.562797200605,-1184.7959451945992L1402.6574943515502,-1186.7510896031517L1401.6694451748504,-1186.5376338483973L1399.710637668623,-1188.429126372414L1398.311719916197,-1187.7480741434133L1396.769149839081,-1190.1164811697554L1397.0242995279687,-1191.331401867755L1398.5798195323289,-1191.279532834444L1400.1247323960017,-1188.9052172736099L1401.047106231622,-1191.8118123271606L1400.2503658813257,-1195.4997833919876L1399.1048999130192,-1196.0257418638917L1399.6119650160686,-1198.4548288066624L1399.134704325615,-1200.663984670448L1396.846583485356,-1201.7161284038052L1399.4761647593373,-1203.829678564083L1398.1789626683076,-1205.0879448430303L1399.158246542287,-1205.299625055262L1398.998574483412,-1206.0378947425415L1397.0494523188636,-1207.9347665223477L1397.3815393046402,-1208.7790774567218L1395.3513721296576,-1211.0374907800212L1397.3160796242187,-1211.4617034410023L1397.3239917960402,-1213.7805996693994L1399.5382623030328,-1215.4187069345799L1398.729222886147,-1216.7809120098375L1397.0979304692692,-1217.1998243922753L1397.9190933713812,-1218.149791664076L1399.5502178118263,-1217.7312420025385L1400.856684071205,-1218.7872642034306L1397.5995419563067,-1219.6248105971588L1397.2800258824404,-1221.099666398586L1396.2215901414174,-1221.2494576850484L1397.6219200658682,-1224.2544761844422L1398.916913932132,-1222.9916461213782L1399.166499582044,-1224.2038002479853L1401.1251113831486,-1224.6297776944227L1398.7661673884938,-1226.0465510278689L1401.0527912964628,-1227.3158680690938L1400.7331900959366,-1228.7829169807508L1403.0133852582496,-1230.052184283691L1402.2026911666012,-1231.4187380646722L1403.2608552361116,-1231.2640122700386L1402.289256357467,-1233.3669086864206L1403.026338753038,-1234.6784773935492L1402.7042488826478,-1236.151219575106L1404.8989486072228,-1237.7892122853407L1404.3301572095102,-1238.0502869669501L1405.1447591432363,-1239.0004702889917L1404.4161152503154,-1239.9908533494254L1405.2302057217175,-1240.9409334109976L1404.580967761937,-1241.569845480134L1404.8262819234947,-1242.780724449114L1403.5284452488172,-1244.0384832380707L1403.7736500466908,-1245.249047003478L1406.5290250615894,-1244.311981226053L1404.989828582923,-1246.6658532134013L1405.96395962393,-1246.8800759357448L1405.802112831734,-1247.6156330289907L1408.232371219622,-1248.151105858617L1408.800094681416,-1250.2044582177882L1410.1787104319133,-1250.8948153353838L1410.0160508067993,-1251.63001488058L1411.5515672159759,-1253.8909741606278L1412.6871714391682,-1253.3717351590115L1412.9286242891976,-1254.5821353979482L1415.0275848046022,-1256.5912867896518L1414.7821553726253,-1257.6933467980361L1411.6989768208514,-1264.7018230311594L1412.4193876317863,-1266.0179620449449L1412.6589774447152,-1267.227123844198L1410.479779799803,-1267.898015569693L1410.7195768638103,-1269.1068415139507L1409.1860866098064,-1269.144308361448L1409.0231468671805,-1269.8783605605265L1410.7113097681504,-1271.4087998781736L1412.4091785299745,-1270.6314054927982L1411.9186362664432,-1272.8329029871857L1413.3707283688022,-1273.1567257944541L1414.0884535742177,-1274.4723634242403L1413.3588632889341,-1275.4646715690408L1415.1310912485812,-1276.6240073065758L1413.8359268645318,-1277.8745284212825L1415.76969046787,-1278.307291262765L1416.07435170954,-1281.4557695003534L1416.886422174137,-1280.0978886806229L1417.9351616819697,-1279.9482939214606L1416.9581370199471,-1282.0390814504813L1418.8899723273382,-1282.47328925905L1418.1612864164358,-1283.4574113255003L1421.536328243671,-1284.2178455049273L1422.6487613681288,-1286.009372310117L1422.234671461947,-1287.8408182363917L1424.6460759276447,-1288.3867701970696L1426.0729897776137,-1291.013731835683L1431.138241353126,-1291.0123859698263L1439.6180964927155,-1287.1914258047293L1459.0163519922135,-1293.2416381575206L1460.4259992113227,-1295.8885878746394L1461.5205889531621,-1297.6900578369034L1466.712913315627,-1295.0596218076803L1473.9594054903455,-1285.9822822077626L1477.2871300207903,-1284.8442963094717L1476.9317716966061,-1282.0601820646855L1477.5434739952207,-1279.4996205242626L1482.7195719345734,-1274.9431432827337L1482.848335346076,-1272.2720534379937L1481.266506638663,-1270.3450538660297L1481.0838525072347,-1266.8247209478754L1482.006468081297,-1265.1095486273994L1484.6022005115688,-1264.9566389065008L1485.612647648532,-1262.88221079197L1484.3733066112384,-1259.4863582392531L1484.810275045004,-1257.660956908441L1488.5167258412246,-1255.0619068791827L1498.6235604141934,-1253.6299395403407L1499.0695415508992,-1247.5372031025076L1496.9907167729357,-1241.2200227142139L1497.6518110245604,-1236.3397768402206L1500.3143062442546,-1233.875912706865L1501.773534623056,-1225.6952482913136L1503.7750493872165,-1223.8470941921591L1509.0181452490042,-1223.5707487126995L1510.6677151697766,-1218.9227509784457L1512.7649741479813,-1216.7098936247269L1516.2421169454014,-1215.2233033792709L1518.8284173237812,-1213.1379440746741L1522.4408344249152,-1213.2453041246886L1524.5335234424101,-1215.3181028616027L1531.230900793288,-1213.4666789672997L1535.8252420601802,-1213.8353991907068L1539.780999356825,-1216.7644785779332L1542.5969185391516,-1215.9097461525193L1544.2159243610022,-1219.8256484467915L1550.882692399504,-1222.2865542844063L1558.8744175037023,-1221.5843814725336L1560.3663975135953,-1223.916543359179L1563.3729894893,-1222.342899329985L1561.2780070028123,-1218.300576360388L1561.7458044144366,-1216.4675604163876L1563.4003883989333,-1216.1090604033218L1566.9442542232118,-1218.5788747731365L1570.937723023137,-1217.2610653393097L1573.8803464675216,-1218.019654280382L1578.5221600036139,-1212.1968525805141L1581.0679512408299,-1212.4656431686658L1584.1341530326094,-1216.7760864973766L1586.2829098535553,-1216.5540224672L1588.135699617647,-1215.4800525993376L1587.8363888329025,-1214.6192533094506L1585.5910203502604,-1215.2069858749321L1583.694485875326,-1210.4095240022189L1584.4551510815477,-1207.4840342288358L1589.2189687032944,-1201.2937105633598L1589.8718674102622,-1196.7712724850292L1593.6852337878988,-1194.2476862767899L1600.2787362126953,-1195.192445392137L1601.050223714643,-1192.2587783144154L1602.9040552333602,-1189.2241956343082L1606.055268672966,-1189.2703170375166L1605.65830952621,-1188.7732516388132L1606.4425287607748,-1187.8032350526792L1605.7449325700413,-1186.4421368498172L1607.2154003845137,-1184.8753163967851L1604.8337919668586,-1181.8930565210267L1604.421976609549,-1179.4373127209647L1600.8658682236855,-1178.8960665790835L1598.7796533342284,-1176.7805519475871L1598.6836300522198,-1177.1477606896674L1597.2940873634436,-1176.3923592683705L1596.595584532166,-1175.033180405431L1597.3740362362757,-1174.0593741541145L1597.0747085578564,-1173.1965980579578L1593.8142376423064,-1173.5240882254611L1593.1140888170708,-1172.1653151709938L1597.3266570065214,-1168.168404276316L1596.5256850500493,-1167.174881370566L1596.2006790365194,-1164.3502840028698L1592.91925378589,-1162.7132075918735L1590.2044617232762,-1158.8784362285126L1589.5467459949602,-1153.22166999138L1590.306114871386,-1150.277430822511L1589.285384212182,-1148.051594614909L1590.470411632548,-1147.578923123084L1588.5502056129062,-1144.7289241296755L1589.2131753127414,-1142.1510557968552L1588.5916224211355,-1140.4277782562194L1589.7538233974267,-1137.97753032682L1587.349838137348,-1136.9676022422288L1587.230678815801,-1135.3733838925075L1585.6381274207092,-1135.3510358444369L1583.1021579543662,-1139.021087507614L1581.7617847043066,-1142.2039089860014L1579.5124200570592,-1144.7688795157324L1576.5234645680741,-1144.0075509246892L1573.002732681888,-1141.1525590112017L1567.792945907451,-1138.6596050572261L1564.7993027164966,-1127.332564465572L1566.1315102220094,-1124.1431685447517L1565.9078227211849,-1122.9100854617595L1561.9007093868265,-1121.907648428623L1559.3555900605331,-1119.3119496655602L1558.9014292233637,-1116.852641925197L1557.670286875595,-1115.369945449255L1556.4869595786668,-1115.8606958175899L1555.437911606307,-1113.6395903112727L1550.3727455410167,-1114.7405339949L1546.4955357892832,-1111.0422335448159L1545.852717782604,-1109.316385462753L1547.130984791315,-1108.4538719318164L1548.6270498318943,-1104.5149078405263L1546.8894373413036,-1102.912006030591L1547.0691606326386,-1102.178843471271L1545.6015629169415,-1099.4663290284361L1546.5539668882038,-1097.7383120802635L1542.4551886661338,-1090.4690169222154L1540.3996195998118,-1092.3222922974353L1539.0867627754365,-1095.5252903860523L1537.4877635268022,-1095.5292030749754L1529.2411141682824,-1087.6655870730046L1525.0286553467486,-1087.4394668383163L1522.3490681565377,-1085.231973401518L1516.2002092130908,-1084.161565134889L1508.145469305039,-1077.5684083509284L1502.1472838054224,-1078.121230694661L1498.9510038076028,-1075.810532844926L1497.9464101031967,-1073.2356856892338L1494.0778649953154,-1069.2079640072504L1493.6617779355288,-1066.379144107704L1492.9030887434878,-1065.029755111258L1491.6298947886273,-1065.9103441795307L1489.246615876461,-1073.9551217901449L1491.777171829995,-1074.538823622907L1490.3286566992374,-1078.5003083688239L1491.2472945833138,-1081.4504106912723L1490.9897830194668,-1082.5641690975463L1488.7874822383174,-1085.1765738631939L1490.7875629124833,-1090.3235511132818L1489.1568548101245,-1097.3653887398784L1487.0581835687976,-1097.2706682637129L1488.223271909901,-1099.1030805465166L1487.7098316459906,-1101.3214222648103L1490.1431190509509,-1102.2760641413595L1487.109082599709,-1103.9169854982847L1485.5079355717273,-1106.2736040666748L1484.1587499038276,-1107.5239026516765L1481.5618407907373,-1107.3153572808474L1478.5543208091565,-1104.281309221773L1475.9514664465546,-1104.075112877763L1474.1958135658042,-1102.5026499526004L1473.1036123569684,-1102.643632947272L1472.1725980035033,-1106.7240440876426L1470.1572939878258,-1108.5985065433254L1467.9809041333594,-1108.883446875784L1460.1072306539108,-1106.321301886516L1455.5851348353713,-1107.6434873359906L1453.7431452714513,-1106.4510354669785L1453.582810772391,-1109.5259355571789L1448.8120665221848,-1109.6286690332588L1444.4056010083877,-1117.5981979799099L1444.6569684835824,-1118.8150082822926L1442.6686372819029,-1123.044006318091L1439.2452983308776,-1121.895577209064L1438.91833881009,-1123.3725796208187L1439.5055003554328,-1125.4480448008487L1441.3380355426502,-1124.298069878069L1443.6744519847748,-1125.5957044083739L1445.5178299825727,-1129.119820861292L1446.0139542442266,-1129.2305789958777L1445.1057022755217,-1130.9663823359167L1448.0230141179934,-1134.3424545119608L1449.935498010071,-1135.1605066966154L1449.6859760898951,-1136.2718577236492L1447.6941868223983,-1138.1523564159543L1447.4451025533176,-1139.2635576031287L1445.1984137708728,-1139.9273828612602L1443.0398750291183,-1142.548924238202L1439.6372049571728,-1143.734183851249L1439.2202418309835,-1140.920235980996L1435.5564534064085,-1138.5595141909378L1431.3295451124186,-1141.116347541594L1430.7576028303347,-1143.7099742298492L1426.3405109236355,-1140.019198265831L1424.4153287728427,-1136.8782336762235L1424.400344834106,-1134.550971455833L1422.31914910547,-1134.4850762196784L1418.791774657634,-1129.0628343917497L1416.7085752002854,-1128.9997538300395L1416.0281994473062,-1127.2986589288694L1414.2094900265765,-1128.45940477019L1409.54867870534,-1128.225246841927L1408.3081337479666,-1129.1237326970042L1408.0462652930692,-1127.9027598214482L1406.468813364008,-1127.9529932586786L1405.912506692106,-1130.55131449073L1402.940285972929,-1132.2375166234967L1404.198549442273,-1133.6705882846134L1402.905283514439,-1137.2742692852685L1397.8374986167269,-1136.5820595473322L1393.873054294691,-1138.0609185487226Z",
"c2327":"M1461.5205889531621,-1297.6900578369034L1460.4259992113227,-1295.8885878746394L1459.0163519922135,-1293.2416381575206L1439.6180964927155,-1287.1914258047293L1431.138241353126,-1291.0123859698263L1426.0729897776137,-1291.013731835683L1424.6460759276447,-1288.3867701970696L1422.234671461947,-1287.8408182363917L1422.6487613681288,-1286.009372310117L1421.536328243671,-1284.2178455049273L1418.1612864164358,-1283.4574113255003L1418.4791979799581,-1284.2988915087287L1418.5616476996831,-1283.9324606573985L1418.9450773183487,-1286.7134841095478L1419.9099380486095,-1286.9309360193934L1418.2152131684102,-1287.7038381820068L1417.3266641805417,-1289.4210913502375L1417.7090937876403,-1292.200655174984L1415.1397464025445,-1292.3921158519374L1415.9400988066586,-1293.3343610646384L1413.7667826666257,-1294.000045281761L1414.2483760378825,-1294.1081439533448L1413.684618000228,-1294.366198504461L1413.8373662646122,-1295.938749189644L1413.1916834230053,-1296.5628797781035L1411.5166958888622,-1295.0338849862578L1410.144233276591,-1296.6490858576494L1408.0599023074324,-1296.9521819978959L1408.3747566171564,-1297.7842026165308L1405.4755746601852,-1301.7486255189228L1402.0349448285197,-1301.360582094782L1401.5474693812034,-1303.5566848891804L1398.5010832446405,-1305.9529302491094L1397.5365948012482,-1308.0354712015883L1395.2934991853672,-1309.0747106589733L1393.7748642659085,-1311.418186666832L1390.9745499568385,-1312.7192070927176L1390.572371556711,-1314.5480255266398L1385.7030589224773,-1318.4555300158438L1380.527507145704,-1321.5320215918612L1379.0933183949837,-1323.5172272036282L1376.865278600662,-1322.2673485515113L1375.0356345564492,-1323.7776606521052L1368.827327815652,-1322.4375611284272L1367.9559905991705,-1324.1631690030235L1366.0400134718543,-1321.4565004366864L1365.9519927071547,-1319.5315512813588L1367.4541694222733,-1317.174714886974L1367.370370507326,-1315.2498686001684L1361.612320000329,-1311.7235719844443L1361.9239820783391,-1310.258804219969L1363.4280744001194,-1307.906044618072L1362.1482115622741,-1306.867851106083L1361.4064784417533,-1303.2707827697348L1357.4127558118203,-1303.1837810497757L1356.1243418766478,-1302.1529506506288L1356.0345202148653,-1300.2195032918173L1351.6139210961614,-1297.3755777816898L1347.0794071915554,-1299.8724038366686L1346.6749675120898,-1299.405322381289L1344.6027205060852,-1299.7390263837492L1343.9457585437563,-1298.0717439940763L1342.101596443748,-1297.3062567662614L1342.8610420706782,-1293.6434903705328L1342.2778170961603,-1291.608630701817L1339.390732349696,-1291.0117572626482L1339.1634407709416,-1292.1130952893982L1337.717934967135,-1291.8150367911414L1332.5589328761503,-1294.95659420024L1328.7110346388624,-1294.169893717453L1326.6807657931301,-1291.8442768788898L1322.829991677621,-1291.0630140846501L1320.645596187585,-1289.4814275458186L1315.9823206485876,-1292.7404025285591L1314.128855018751,-1291.986464319348L1310.7299659338807,-1293.9741295354627L1309.5077912476877,-1292.5913322851557L1309.3919167587774,-1290.6581408306206L1308.5741254087625,-1289.7312689446173L1308.4573633079276,-1287.7976495982848L1305.640463774221,-1286.85659127287L1305.8576119347017,-1285.76029918222L1304.482603386094,-1285.1060978085318L1300.6299953700018,-1284.3462310426253L1300.3642428076103,-1283.1478643499422L1298.3605772117733,-1283.1363784396963L1297.132437617703,-1281.7496844313441L1295.539528857265,-1282.2020568147536L1293.004192521169,-1279.7976648552146L1286.4307960582596,-1282.7228070993817L1286.0900500050598,-1281.8934904008543L1282.4313304883326,-1282.708160958463L1280.0872294809833,-1281.876432055829L1277.5260428419247,-1284.8198697206578L1277.657911167793,-1286.7453642638927L1274.4167329180823,-1288.0331019032453L1274.066052061482,-1289.8726119903258L1273.0318318902785,-1290.05680171408L1271.7891565050227,-1291.3381377042635L1272.3327863381103,-1293.7282921074448L1271.1597066953443,-1294.6482709146983L1271.7726939881402,-1296.66997977849L1269.4995833442904,-1298.1355222403677L1269.9725178232475,-1300.8914268457393L1268.252300826567,-1302.0808539529671L1264.6031123265177,-1308.2335366665864L1263.5737730423043,-1308.4193782714149L1264.0471871587965,-1311.1718250916465L1261.44127230853,-1314.4755264136281L1261.025581905088,-1316.67818697073L1259.8613100610733,-1317.5920500280176L1260.8127556367122,-1320.4319700302394L1259.5096379406923,-1322.0859778109998L1259.1649386470626,-1323.9136313617291L1257.2523050784553,-1323.553363109066L1255.2678211040134,-1328.8695295107473L1254.1750548473794,-1329.4235817626595L1254.647852577946,-1332.1692676065372L1253.8277847208815,-1333.9057623522708L1257.5006516168341,-1335.3560896795216L1259.0568973248687,-1337.5475168359703L1257.8890167687439,-1341.1135778678558L1259.109303508148,-1342.4824530679568L1258.5639880753026,-1342.7584707700469L1254.691349829185,-1342.4063958646882L1252.9934990542233,-1343.596637390088L1250.2740912244908,-1342.3350278538476L1244.6385777923765,-1343.5504787458372L1244.501129516686,-1346.9347700555154L1242.1246942150533,-1349.1375033666832L1240.838961925987,-1348.141702851633L1240.1602823520866,-1349.1520252227263L1238.0565238845302,-1349.8988811806223L1235.3524690452132,-1353.9350410046557L1230.6766307253852,-1352.6983108007037L1228.248435680618,-1355.2736355557827L1227.6984800781609,-1352.910981202343L1225.8609304293286,-1349.550438805534L1226.468035402809,-1348.9109997767077L1224.290795226304,-1347.3808343685043L1225.0318901311787,-1346.0016715306988L1221.6131362518104,-1340.4706426164648L1221.4714247917493,-1338.552439926752L1217.2530282541998,-1337.4163690372382L1212.0997254880992,-1338.767345546665L1210.7560652879583,-1340.7983385355653L1208.4021160592602,-1343.0212691572026L1208.553145656721,-1344.9385225788308L1207.213612612846,-1346.9624971062722L1204.429561745526,-1346.092718799766L1203.2847998315383,-1347.0247703095665L1201.927095291719,-1346.4080946909548L1200.1148200679836,-1348.356930004818L1196.6638141639578,-1348.5087088459898L1195.9340143038066,-1349.885163472555L1193.371465424134,-1350.5718025022081L1191.501358797567,-1352.8895511823703L1189.4797061561353,-1353.294202138433L1187.1690672095883,-1352.5178702761486L1185.0861642873883,-1353.2844227668006L1188.847209934245,-1356.9510021187475L1189.8849579811008,-1359.3939267127614L1193.0722729475488,-1360.6952065115001L1195.4033621743438,-1364.119378965639L1195.8986858595295,-1366.8388845335535L1200.4535218458482,-1371.4097525244852L1201.0770507445206,-1373.3978505098764L1200.1529624123712,-1375.8729237371758L1202.2502795781625,-1377.7511376111074L1203.569212442994,-1383.999152874731L1206.1964375247783,-1385.596945710529L1207.0221278626996,-1389.1337317182204L1204.8198274104534,-1390.6160575014806L1205.0906715090705,-1391.7936207358225L1203.2293481289594,-1394.0961654218017L1201.8192599772542,-1393.8452983414509L1199.086735992742,-1395.610756101851L1199.233401146855,-1397.517216061952L1198.7822429596572,-1400.0624905608356L1196.3109735458079,-1400.3770402355124L1190.2588646201466,-1404.5655158641246L1194.2163641985426,-1406.7640111641176L1197.9762064267638,-1410.0585241895205L1200.3775059793627,-1410.1098428831147L1205.062320690469,-1413.569775703075L1214.9408198852254,-1414.9786500652076L1216.677116438489,-1418.6767627639813L1220.943736489307,-1419.0819854777335L1224.2079218917165,-1422.3063375769432L1228.6733570901392,-1419.0048391059945L1235.8653414711976,-1421.849816087808L1246.1888229583988,-1423.4219336139429L1254.417404704202,-1428.3744978711086L1258.281456110472,-1428.366837820902L1263.0187955068318,-1433.7949115535773L1270.8107644457564,-1433.4444844390787L1272.1656437496138,-1431.4517603998995L1273.16846762249,-1431.2726908553009L1273.4911690444578,-1432.089569611917L1272.345677334205,-1432.9935275619875L1272.5968495525121,-1434.1726251211896L1273.3143201489931,-1435.4367967795501L1275.528077526375,-1433.9983535939166L1274.4223830631809,-1432.2733490050848L1275.0312313000422,-1431.640315881764L1276.2804510487806,-1432.6407166109618L1276.2435171793477,-1435.269729886789L1277.567320316104,-1435.9087566254907L1280.1051655730635,-1435.28324320427L1282.006610490827,-1433.0249014424687L1290.124949881259,-1433.521281201239L1294.968344986412,-1431.1125220269741L1296.3406393474174,-1429.1270538927652L1298.666069590659,-1429.5992682320477L1301.6551275058,-1426.817894498174L1306.8727055868353,-1429.773635832504L1310.8019122675946,-1427.1834187352094L1313.0184798598912,-1423.4914428341785L1315.1100405710908,-1422.7901280099936L1316.417848596946,-1421.1776245031142L1320.4460858261987,-1420.5020385845648L1327.3645672863013,-1422.3277717404246L1328.99357246926,-1421.535112601724L1329.5261870630734,-1419.0046146005334L1334.7322170051966,-1419.7252195362778L1336.825400555256,-1416.760257017483L1337.9964239329513,-1418.1453679269093L1336.7608619794667,-1421.6632619246896L1340.5709363040764,-1424.3679270643072L1346.93667756803,-1426.489818684497L1349.8861321470063,-1426.3679655593417L1355.2457384191955,-1424.1246395538737L1363.334654507089,-1422.8550937446967L1363.880674065937,-1422.5953813454719L1364.434689101006,-1420.0677654406882L1365.0605052731494,-1419.4459920390434L1366.9934603590495,-1421.7679742768344L1369.249012397731,-1422.6372833311016L1370.8958801146919,-1419.59120017592L1373.164520411323,-1418.1939570235497L1375.6554238811818,-1417.9930837086551L1375.1221129984197,-1415.975422390753L1375.9107806488173,-1414.630480169447L1373.1199341408221,-1411.7398590003986L1374.3086571048555,-1408.581953398369L1378.423642081632,-1412.1547687701072L1380.758862328798,-1412.6743995293723L1381.8561506425776,-1412.1586325171672L1382.179352948902,-1410.7097175637166L1385.7116003081637,-1408.0824768333323L1388.393501315651,-1404.8777529114318L1389.4123785517888,-1404.7257253432122L1390.6352215782754,-1408.0457278998847L1394.3185344526037,-1406.972680406021L1394.5640107056856,-1405.8858184515843L1391.913567499496,-1404.5335389077404L1394.0554453698905,-1401.5886102426273L1393.8313902713578,-1400.3953148291162L1390.630288939069,-1399.3012481718806L1390.0167821236355,-1397.6399500945495L1391.0561378629009,-1395.206271133822L1393.9753041646804,-1393.2014166064803L1395.0557994454925,-1394.9624615111773L1395.9956041228456,-1395.1743808032325L1402.059021381258,-1392.3590325638102L1402.2236794787973,-1391.63350864127L1402.026190064606,-1388.1620425772664L1402.57920392171,-1387.9058740358862L1405.8697413330974,-1388.6536665243882L1410.3191522968946,-1384.3305249302L1410.8998622908002,-1381.7894816453772L1409.8153766972673,-1380.0206904320298L1410.6186235155496,-1378.6757436008531L1415.5817040854229,-1378.6652674615284L1415.8317276058788,-1377.5758662778887L1414.332672636105,-1377.6143580739513L1411.1399128176333,-1374.2155683936312L1410.6922090525081,-1371.8197934311966L1420.0227973954677,-1370.1389556653485L1423.2743908156378,-1368.9749385426032L1422.7252313377555,-1362.72987819145L1420.1321618987226,-1360.9917256520082L1420.3827340779853,-1359.9005078750288L1421.8323803868789,-1357.9356365615913L1421.7746270280259,-1356.014009147655L1424.0911012334034,-1354.6310588910756L1430.9306003521629,-1346.6386409660727L1433.1703251919043,-1345.6229121968333L1433.592634684379,-1343.802142437852L1436.6125421121465,-1343.736044533353L1437.257922961839,-1343.1184833221241L1437.288906780013,-1340.8290855741889L1438.2738792520463,-1338.7542763297536L1438.0517635357762,-1337.550390831426L1436.482330321827,-1335.6562673280541L1436.7361929135213,-1334.5628940603253L1444.816098240479,-1332.226309692132L1443.2314330749307,-1326.0958722835578L1443.9646776821933,-1325.1132762390218L1449.6455208337343,-1324.5196281939932L1450.3761847005098,-1323.5368286400853L1450.9742701272212,-1320.9903174860474L1447.7143503534933,-1319.8412027410864L1446.9320559004618,-1318.88855661923L1446.7943897788618,-1317.3169475773961L1447.8689865227489,-1314.8806066434915L1449.6439735579502,-1313.755812856992L1451.6467610337804,-1313.8401407804538L1451.6976797277573,-1315.777500177071L1449.9182365443623,-1316.900180479034L1449.577687632987,-1318.3531747774132L1453.7100440954514,-1320.0938999513126L1454.3098122130116,-1317.5468470324647L1452.5152618431157,-1314.4291266969983L1452.4160736349986,-1310.5611892485056L1455.512476523421,-1301.6676711029236L1458.8268904125566,-1300.519343056047Z",
"c2301":"M1484.4956298459415,-914.9923729488521L1486.8700446306075,-916.6910575714508L1488.6941395774286,-915.9233112442369L1490.7072203626526,-916.7644814801399L1491.9248131176623,-916.2490335963537L1493.4366859765746,-919.333059171649L1492.9344135942372,-921.5810823349643L1494.5084586706223,-921.9330557364742L1494.2797552805646,-925.414989643949L1496.8120258197205,-926.3761350134691L1495.699611253656,-928.8799693728081L1497.2070522999463,-931.9647894116506L1498.1649842753,-932.5736706979146L1502.9381179493594,-930.9038436829092L1503.6479920416518,-932.6311585850667L1510.4418183686244,-934.1742618584608L1509.7596138677288,-937.1673938965985L1513.148596207738,-936.7602774730583L1511.520686442926,-941.4976454304228L1511.7817852752294,-942.7379474845256L1510.485727218604,-943.6223022872277L1510.7572930372469,-947.2185061209198L1508.7699554853962,-948.731598403433L1506.875698793262,-952.2257865788388L1503.5832609569454,-952.2627131426473L1498.586210794374,-957.4121844207725L1501.2689728758655,-957.6274592064271L1502.1400561737978,-958.6116128288058L1501.4497755020934,-959.2409762855755L1505.7779040726991,-959.440100773616L1506.913345568953,-961.6582293906849L1510.198513362867,-961.630869873617L1511.1549899952768,-964.5960506722968L1510.8976567797008,-965.7167121131245L1516.694492066534,-973.7309904237002L1517.300755418985,-978.1899978464476L1516.5241679958508,-981.541746878923L1518.3305232741582,-983.1402641288641L1517.984041711627,-984.6325425922L1519.9646738582971,-987.8380602785012L1521.6833380901676,-987.4592241687258L1521.8540103695314,-989.0647192577226L1523.9214656192046,-989.5475195410102L1525.366549609279,-994.990566195308L1530.0842797967593,-998.0653936584849L1531.7910689888831,-1000.041076436009L1531.8683408829677,-1002.0185902466956L1534.7792749804953,-1003.4938327381049L1537.9231950901274,-1008.559726131054L1541.5206181311448,-1009.4171499551737L1544.6715216597581,-1012.1379791961092L1547.3271524109603,-1012.3816723798091L1551.5523140201608,-1010.6506764000853L1553.1150797352484,-1008.665637225766L1554.7959670559992,-1003.9598074423602L1557.5470747953423,-1003.8372628456234L1567.4091824557445,-1012.5336941364972L1568.8928916429472,-1010.9268833291719L1573.002641314662,-1011.9358344668194L1576.1172100427534,-1010.34492684055L1582.4152586482785,-1009.1419732620811L1584.4291763324336,-1012.0085142588318L1585.734900354396,-1011.1498665555896L1586.5785144967244,-1012.1488382654302L1586.023470969673,-1014.3773959250959L1587.8908695672155,-1015.6246971009048L1594.2309535767372,-1016.4296064214914L1594.8869832300745,-1018.1656910911681L1594.6071864294843,-1019.2792224073601L1597.308551595199,-1021.5374762522167L1601.2707241219691,-1020.9588911858116L1603.280026140519,-1019.4934211183622L1608.408307389294,-1020.7952481754514L1609.7117571440463,-1019.9493994444192L1611.032884545431,-1014.7626775358028L1614.3425936606764,-1016.7852723844001L1617.1008450506358,-1016.7007127898282L1617.329368219431,-1017.9448931842821L1618.9978969302063,-1019.9538199252886L1625.8174210300635,-1018.9429527896064L1627.233040612436,-1024.0538117210133L1629.664068096669,-1023.1021151011407L1631.5231862783046,-1024.3757803169035L1633.1532817074885,-1024.4042110577248L1632.48019042803,-1026.9904366499647L1633.408679049252,-1027.6276974554496L1633.757556981195,-1030.4870781643745L1638.1913572551352,-1034.4073623766415L1641.1363808373833,-1033.6046506289752L1642.7388829638207,-1031.6516453239765L1646.024826122493,-1033.7039977547367L1651.626731197023,-1033.2055581578343L1652.9445943102585,-1032.3670551916173L1653.2371544889652,-1031.2639015766845L1655.6735722929234,-1030.3265336207828L1659.3519405101317,-1030.9093481373416L1665.336608743363,-1039.238260597096L1667.1678069198317,-1038.5413769644538L1669.4905850210132,-1036.0027343419613L1670.9402130665596,-1038.7643513853907L1672.5686864077977,-1038.807387073593L1672.7803730076114,-1040.0538295508843L1673.1655437972254,-1036.5970801361382L1672.1342517319665,-1034.336448613227L1677.7411544471565,-1033.869163095126L1675.1241601099757,-1039.4982445074063L1676.6628394146198,-1041.8975556904363L1677.5841281119906,-1042.5439898444483L1677.852293602543,-1035.4857495671386L1679.8648659046469,-1030.0885170544652L1679.1409134111732,-1028.7021324211487L1679.2319658533745,-1026.3535831832185L1676.768764858833,-1025.2906412104608L1676.6554237634182,-1023.6732124974087L1674.7225018324903,-1024.7383341407303L1669.7973039946787,-1022.6200638398418L1671.9327733782352,-1020.8142110959457L1674.6932744917656,-1020.7637679821246L1680.5902269668686,-1015.2274275062832L1682.9414453076333,-1014.6729564049526L1684.5709540617984,-1012.7325154582331L1689.3702665485532,-1009.2776045232608L1684.7181840014448,-1004.050774746431L1685.4192862211128,-1001.4603809750406L1686.0034236933482,-997.2562833734219L1687.2206674156096,-994.8047371969703L1683.9092436815208,-992.7253368543579L1682.0622803503034,-993.4117958725067L1679.7816799637953,-991.613823193263L1676.999816905004,-991.6611355169848L1673.3328949449456,-995.0386376159877L1671.6899380984978,-994.9962693526447L1670.4378007654793,-993.4713160912443L1671.547575612466,-991.3861161681821L1671.2042743236725,-988.5232218553685L1670.0715898120159,-988.6182138192075L1666.5306632652655,-985.2952410594335L1664.6884742103946,-985.9970410827837L1663.9485284051088,-984.6106112905418L1662.2048082756362,-984.9426718252162L1661.7854534410355,-984.4350568657001L1662.6951480505838,-983.0885652595907L1661.757936396296,-982.4440615111989L1662.5679026343291,-981.4750200666103L1662.8620152255714,-980.3623802931725L1659.7297623195625,-977.5518748757142L1659.0839411690831,-975.7947925382905L1656.398867125864,-975.4855626844039L1656.9818342340593,-973.2656415005554L1654.0636388351659,-971.7069997333026L1654.5496898655924,-969.8508863643945L1655.360575217912,-968.8731507081111L1653.5777671532126,-967.2235984371457L1653.9318646986121,-963.7457201743694L1650.2593801243252,-960.8113362420836L1646.6622731556815,-961.8519388980556L1644.5819832068466,-961.3123192696057L1644.449859340802,-959.6991779468613L1645.5432261142478,-957.6030951717253L1646.584260874183,-957.8730072042667L1648.2041322879286,-955.913567145684L1648.317814947526,-951.1899754455842L1649.8411228661657,-949.6088027185099L1652.1154612391986,-949.4062814725428L1653.120602557882,-947.683567412942L1652.9857015018085,-946.0609599343063L1648.6812511314765,-943.3634569878561L1648.0218009756757,-941.6055288373855L1649.259190957054,-941.1322611570813L1649.8371817657278,-938.9008685008466L1652.210870218551,-938.3328157377405L1654.0087586241848,-939.983475634154L1655.0131949096185,-938.2670004300228L1656.2523394074235,-937.7954553918767L1656.3101842122328,-935.4282047975521L1654.7037378127852,-933.0324604091409L1654.0837779157732,-933.26848837025L1652.7615182623074,-929.7492998667387L1652.9543479913518,-929.0052125270529L1655.6273927600837,-927.3233546052495L1653.7239686347314,-926.0354164279922L1652.7339188910894,-923.396552773756L1649.495405914211,-922.956728276926L1652.7416600184329,-919.037707307079L1652.2685541848664,-916.5327297735769L1654.5166286590922,-914.3408788023955L1654.9981233839078,-912.4793567194295L1653.3246139068642,-912.4440084694604L1649.2704863966608,-908.6262952594143L1647.596148052687,-908.5930994397434L1646.8773180996593,-904.8348878566524L1647.4488764563323,-902.6060450961629L1644.0507581968611,-900.5448414879247L1644.3365302996463,-899.4266885193874L1642.1800346398063,-896.8909302074417L1643.9530054109869,-896.5491706413395L1643.8993800533895,-894.5572414174947L1641.8296374649888,-891.6471533506681L1639.3828588493357,-890.2308836750522L1633.6369370609796,-890.7598599714142L1631.277617363239,-888.9736957785931L1627.3951702529464,-888.7900720483576L1628.2989246106179,-887.4301552138909L1626.992261088099,-885.9188105884339L1627.311130831455,-882.4278204947209L1624.0131042085359,-877.6414091612246L1622.8254398073584,-873.3772941239542L1624.350556417344,-871.7811755297591L1623.0384838804027,-870.2634296994311L1621.8750446853815,-863.6321318807552L1618.5057973311075,-863.5890175652917L1616.726400394046,-863.9415598492458L1615.9458283409504,-862.5583377978935L1617.742751945158,-859.8365181570005L1619.5235993859694,-859.4842271463579L1618.668357604655,-856.0979989225314L1619.9181965846326,-855.6139768916555L1620.819642596897,-854.2572915852372L1620.5651247756464,-853.0036255539865L1620.9357854050556,-851.5080121563328L1619.9627121324863,-850.8701038152929L1622.2086250929551,-848.655532368256L1620.6312325527056,-845.8832826673088L1615.5819091800456,-843.4462719325443L1614.3469187283476,-841.5623965596826L1612.3076258416945,-840.6647198693217L1610.8741770076037,-841.8928852323627L1607.8565018246618,-840.3680992267341L1605.1738232598564,-842.08562341429L1602.470850511997,-848.5570067707044L1601.5087895810343,-845.5474310193677L1599.4535266843266,-847.0300064897592L1598.4825342430465,-846.3978325602409L1596.1565313021601,-849.0046965954407L1597.3940649901363,-850.8829400779466L1596.3164323458298,-852.9994211159374L1588.0412791817873,-859.3037339823502L1588.3776271267202,-862.5533322204051L1585.7169753490855,-864.2807366360676L1585.0860126639293,-866.9004705294574L1585.9676063252546,-867.9048013193044L1588.6171669486018,-868.544406453509L1589.316745084038,-870.2976148922196L1588.3353968361998,-872.0329878775876L1580.0189269967418,-873.9876353816055L1579.0482403696208,-873.3589188137091L1574.1011719362543,-872.966368226681L1574.0174957061047,-870.9681551873416L1572.9611703183236,-870.7161926701453L1572.162963481685,-871.7128052094133L1571.721641561281,-871.21206839464L1571.4541679914805,-872.3351472260772L1570.216818391507,-872.8245574168793L1569.2450803387899,-872.1979384255292L1567.7481908554205,-869.0809924149185L1565.978419372799,-869.4525723687764L1565.3647503411937,-867.3298743691805L1564.0371691597409,-865.8295989360515L1563.0638517158686,-867.5770329354241L1563.2409195375058,-869.200577572597L1561.1219250763118,-875.8025706850674L1558.8305304982005,-878.4243146785639L1556.8028355351003,-882.2867080372339L1557.6799155427618,-888.0184085780663L1560.5806365082578,-889.889415545797L1559.6144130051389,-891.6366050232023L1560.137772100276,-891.7604498002563L1552.3141775701192,-898.9853446577918L1550.7322716244498,-903.3444430272875L1545.9075500369802,-902.6069514787087L1545.0335797642722,-901.612976385132L1544.244095150647,-902.612499380539L1542.925413345112,-901.1204117651514L1541.9617680509484,-902.8688581027443L1540.6511269570526,-903.747138117807L1535.6539601735822,-903.7689953651125L1534.6080862827362,-905.8861177714475L1531.8935447878011,-905.6520808126099L1530.494546282983,-906.906252403438L1524.6160592725653,-903.5813418305311L1523.9174476631392,-904.2095201469947L1521.0038484136896,-900.0016744680029L1519.0658271300522,-898.7708715268061L1518.2822773229113,-899.7747103178747L1518.1818351938518,-897.7810541281519L1517.131689533712,-897.5419565878858L1516.4174554235826,-895.8029409933265L1513.6137016498637,-895.9546799910515L1512.8130053778973,-894.5910157159717L1508.4256703790445,-894.3876311752153L1508.9535128169978,-894.506688001715L1508.1720504160141,-895.5123670367539L1506.5044236174704,-895.5305816520581L1504.4824776418627,-894.6819629071126L1504.31401043785,-895.4318965228047L1494.9608683813321,-897.6641831443981L1494.0159963512463,-899.4220119464176L1492.0237286146034,-900.9397312441347L1490.525605103392,-900.2135489550005L1490.1927704468803,-901.7138075231062L1488.9725041689544,-902.2302321765983L1488.723158756779,-903.3553930556266L1487.5082470035786,-903.8732011784223L1487.0397762651767,-908.4831453102433L1485.0762675970982,-912.3679687042579L1485.3530467704413,-913.6090728682539L1484.3017704334507,-913.3764826606248Z",
"c2302":"M1390.3797655818084,-1137.3229146350443L1393.873054294691,-1138.0609185487226L1397.8374986167269,-1136.5820595473322L1402.905283514439,-1137.2742692852685L1404.198549442273,-1133.6705882846134L1402.940285972929,-1132.2375166234967L1405.912506692106,-1130.55131449073L1406.468813364008,-1127.9529932586786L1408.0462652930692,-1127.9027598214482L1408.3081337479666,-1129.1237326970042L1409.54867870534,-1128.225246841927L1414.2094900265765,-1128.45940477019L1416.0281994473062,-1127.2986589288694L1416.7085752002854,-1128.9997538300395L1418.791774657634,-1129.0628343917497L1422.31914910547,-1134.4850762196784L1424.400344834106,-1134.550971455833L1424.4153287728427,-1136.8782336762235L1426.3405109236355,-1140.019198265831L1430.7576028303347,-1143.7099742298492L1431.3295451124186,-1141.116347541594L1435.5564534064085,-1138.5595141909378L1439.2202418309835,-1140.920235980996L1439.6372049571728,-1143.734183851249L1443.0398750291183,-1142.548924238202L1445.1984137708728,-1139.9273828612602L1447.4451025533176,-1139.2635576031287L1447.6941868223983,-1138.1523564159543L1449.6859760898951,-1136.2718577236492L1449.935498010071,-1135.1605066966154L1448.0230141179934,-1134.3424545119608L1445.1057022755217,-1130.9663823359167L1446.0139542442266,-1129.2305789958777L1445.5178299825727,-1129.119820861292L1443.6744519847748,-1125.5957044083739L1441.3380355426502,-1124.298069878069L1439.5055003554328,-1125.4480448008487L1438.91833881009,-1123.3725796208187L1439.2452983308776,-1121.895577209064L1442.6686372819029,-1123.044006318091L1444.6569684835824,-1118.8150082822926L1444.4056010083877,-1117.5981979799099L1448.8120665221848,-1109.6286690332588L1453.582810772391,-1109.5259355571789L1453.7431452714513,-1106.4510354669785L1455.5851348353713,-1107.6434873359906L1460.1072306539108,-1106.321301886516L1467.9809041333594,-1108.883446875784L1470.1572939878258,-1108.5985065433254L1472.1725980035033,-1106.7240440876426L1473.1036123569684,-1102.643632947272L1474.1958135658042,-1102.5026499526004L1475.9514664465546,-1104.075112877763L1478.5543208091565,-1104.281309221773L1481.5618407907373,-1107.3153572808474L1484.1587499038276,-1107.5239026516765L1485.5079355717273,-1106.2736040666748L1487.109082599709,-1103.9169854982847L1490.1431190509509,-1102.2760641413595L1487.7098316459906,-1101.3214222648103L1488.223271909901,-1099.1030805465166L1487.0581835687976,-1097.2706682637129L1489.1568548101245,-1097.3653887398784L1490.7875629124833,-1090.3235511132818L1488.7874822383174,-1085.1765738631939L1490.9897830194668,-1082.5641690975463L1491.2472945833138,-1081.4504106912723L1490.3286566992374,-1078.5003083688239L1491.777171829995,-1074.538823622907L1489.246615876461,-1073.9551217901449L1491.6298947886273,-1065.9103441795307L1492.9030887434878,-1065.029755111258L1492.8375096497261,-1058.366759012846L1493.5988193074656,-1057.3675610995608L1492.6710545842643,-1056.762294598963L1492.927889689551,-1055.6467622647947L1491.0707657389796,-1049.7447204374541L1441.4532591698594,-1032.0232245454574L1438.4677991714143,-1038.3923249455336L1427.6594037411114,-1036.4510380170914L1424.852924700624,-1042.0869966222845L1415.596134481139,-1035.4415684305823L1414.8888773479173,-1033.7315056413745L1408.3160103331777,-1026.8934045911858L1406.778413649121,-1026.5713516724757L1405.367388771604,-1028.2263474716844L1400.2478359274583,-1027.1592940075304L1399.9371456581066,-1028.654263038308L1398.1249632862412,-1027.108499126025L1398.9429765343693,-1025.718657212254L1397.2336014831517,-1021.0825816450617L1397.3145634470575,-1012.9164487709552L1390.3548248299746,-1010.3151244018402L1389.1208592258615,-1008.5098799554135L1388.264522622303,-1004.8251570610055L1385.9387842011838,-1000.4583644845725L1383.8050900497478,-1000.4149506444478L1383.517356991198,-999.1866553648999L1383.5316494745798,-996.4666006407042L1383.0156083494758,-996.3620590057953L1383.3950049653276,-994.4887145302248L1381.5616817837604,-992.9477223887009L1380.8424340462032,-988.518899306765L1382.4689746281406,-988.4571270362344L1382.2547676623021,-986.8533151233416L1385.6551772889102,-985.987503903579L1385.4415950808889,-984.3832783545895L1387.1459456647226,-983.9482179530448L1386.490805295875,-981.8638815699599L1383.6265366164257,-977.3886429003057L1381.186106932299,-976.1162960438003L1380.4461490223541,-977.1382658002885L1379.4016195950157,-979.6527675748434L1378.7329825460656,-980.2988048228212L1377.5538263626854,-978.118412574144L1377.5617925671315,-975.3886101797091L1376.3862275880526,-973.2021676733257L1380.5466711019276,-968.5785893115667L1380.108678327722,-965.3746398813876L1381.449263094837,-964.0818009324264L1381.155363830491,-962.8514225698748L1382.4199826200143,-961.9408758542347L1382.276692178827,-959.9594804169794L1383.3926287090662,-959.7930545913034L1385.0313211127548,-957.0048743063023L1384.2211850908602,-955.6700642740984L1386.012048839048,-952.1304771187226L1385.2008402115866,-950.7951895332756L1383.642578253603,-947.7473103958864L1375.0103286379126,-944.8535448500702L1373.21845150134,-942.9431181835453L1369.720253456517,-944.1975356121145L1367.8571179247817,-942.6661155407592L1365.2456606651,-942.1530842112516L1363.3817636362417,-940.6166086815722L1362.1162697424431,-941.5403696478145L1359.3637028120731,-941.7768807340999L1356.981779401523,-942.8745906030686L1354.2170531643465,-940.3869321672032L1349.3323051785414,-946.068876255481L1347.104814627538,-946.420073293405L1346.743160328218,-948.3005971948594L1344.0807516850914,-950.9017551707952L1341.9587138583233,-956.3355895314292L1341.615815060632,-960.9398241508727L1343.551832564116,-962.0909069926008L1343.5659056932627,-964.8216320429935L1345.3374337117416,-963.9934813107852L1349.3451807345118,-965.5471383232853L1351.2683912741286,-963.9707332410001L1354.0165077077063,-966.4541880645982L1353.4327459904623,-969.4522373197242L1368.0926866773812,-974.2819032036598L1368.979229766562,-977.9609137584807L1368.4505583482442,-983.3082925417473L1365.7187111364524,-983.546136063648L1367.4908310107921,-985.4570201201618L1366.3074171116043,-986.0018854571849L1365.8624877694008,-988.2454265895078L1364.2372294658567,-988.3131778215297L1364.9783937382817,-984.569069602336L1364.6836265316415,-983.341236075958L1362.0264117567885,-983.2061586192608L1360.8434231825079,-983.752519082775L1360.3999798360087,-986.0035700476901L1361.2127457167448,-990.0536409129561L1361.2851638881991,-992.4058351876663L1356.714502752865,-991.1161191914414L1354.505506513988,-991.4618848972739L1351.9271093349482,-993.6765440697225L1350.3779828508718,-993.3740718974332L1350.3051028591765,-991.0233721633306L1353.4001867808547,-991.6278853685344L1355.6057252636833,-988.5611523304015L1355.9734616037053,-986.6852658228247L1354.3483557793197,-984.0364615766193L1349.2506919930545,-982.6530731203106L1349.2434515582158,-979.9247368844099L1347.4659390632544,-978.0286782740975L1347.083606486612,-974.4482542688706L1340.1907815233371,-971.1793696048119L1337.9924233209397,-974.2563814701218L1335.1124010939175,-975.2634309387531L1333.7949325871282,-976.5624436451574L1333.0788161703272,-980.3188601915256L1331.6867118042724,-981.9927171057711L1332.0613091207874,-982.8424652318608L1331.4173927721959,-986.2222799186204L1327.4975503039689,-984.3100274978428L1326.0373003768536,-986.3606610447314L1326.4310409612135,-989.936263703612L1327.4599021283136,-990.1314174252764L1328.1366814792377,-992.2048702893828L1325.7917978438895,-993.3085105530272L1321.0068847453667,-993.1817906413726L1316.3165491818154,-995.4100359706804L1314.9338758338165,-997.08717464135L1312.5940505877434,-998.2039441281527L1309.622441976654,-1002.6930874680663L1303.8124923495193,-1008.2083851604668L1307.6669432865133,-1013.1880138686142L1308.0199716530494,-1019.8457787320433L1309.000051242852,-1023.1266902055597L1317.1550671228485,-1030.4752888698588L1320.022930594461,-1034.9001632748696L1333.3897770878907,-1045.2122897513884L1336.0138258534585,-1050.7602384513132L1337.324568270528,-1057.6058849521335L1348.7706866728413,-1066.4448581363217L1354.8008120532845,-1078.496320398619L1366.7165450167436,-1097.561292881851L1373.4001030393501,-1105.9032165478184L1376.2956025255903,-1104.559078403363L1376.9843999824097,-1101.2156562611003L1378.3761315420907,-1099.5619751375702L1377.7500510683262,-1097.4991866827706L1379.0659226233965,-1096.2176471932069L1378.714956458688,-1095.3688229575648L1379.9095011716015,-1092.1277083863918L1384.9461845803116,-1088.1266755641502L1385.760560335938,-1086.7413655534365L1385.2123287336876,-1084.2963570010618L1388.551035992236,-1083.4415641244552L1388.199840882726,-1082.5912434260322L1388.938214076084,-1081.5785535900222L1387.2270653240357,-1079.6684889720218L1387.8061793688366,-1079.399876214067L1387.105427351939,-1077.706694776297L1390.6894282162098,-1080.776585148917L1391.3090764618646,-1082.8494522286842L1390.1464494864003,-1083.3847260914897L1392.362773407935,-1090.4403299772998L1390.6141336096243,-1091.2409365234757L1391.1575551127257,-1093.6857517378603L1389.332577894944,-1094.8588707973706L1388.7905546621214,-1097.4579129836268L1387.6267578905806,-1097.9921472511994L1386.8907803285565,-1109.0843622727214L1385.2267529693077,-1109.513695079978L1386.3489256595565,-1111.6810923768314L1386.8516201530033,-1111.7860190255283L1388.0018192281848,-1116.2952068895215L1387.493614833756,-1121.225562310916L1386.9503528674272,-1123.8200389488702L1388.409647589498,-1126.840922250963L1387.3647131178122,-1129.3292430224851L1389.0503950495172,-1131.2342895200027L1388.958642585214,-1136.6358780852784Z",
"c2310":"M1662.5679026343291,-981.4750200666103L1661.757936396296,-982.4440615111989L1662.6951480505838,-983.0885652595907L1661.7854534410355,-984.4350568657001L1662.2048082756362,-984.9426718252162L1663.9485284051088,-984.6106112905418L1664.6884742103946,-985.9970410827837L1666.5306632652655,-985.2952410594335L1670.0715898120159,-988.6182138192075L1671.2042743236725,-988.5232218553685L1671.547575612466,-991.3861161681821L1670.4378007654793,-993.4713160912443L1671.6899380984978,-994.9962693526447L1673.3328949449456,-995.0386376159877L1676.999816905004,-991.6611355169848L1679.7816799637953,-991.613823193263L1682.0622803503034,-993.4117958725067L1683.9092436815208,-992.7253368543579L1687.2206674156096,-994.8047371969703L1689.6803974052466,-993.8889443513067L1691.215330273719,-992.3182968977703L1691.3013612441346,-989.956949375455L1692.5341137615887,-989.5037839387237L1691.8017077326226,-988.1125221778254L1693.273335475103,-978.5870448777086L1695.7648775718021,-979.6535141359807L1696.1654807575615,-978.1787972713189L1698.7513254504786,-978.8820375849925L1700.4938475694846,-976.5720764771634L1702.966739300023,-975.6551024011512L1704.027756345061,-979.9240843591006L1704.7549011448025,-981.3167631619679L1710.1122234049851,-978.0101196910707L1711.2503158162276,-977.9248587500479L1712.2952425774877,-980.2029882069148L1714.55662371786,-978.0462581805232L1718.281021182277,-978.6766245543604L1718.8069072335452,-980.8063814395505L1719.3247464677631,-980.9497864534374L1720.1553441215779,-983.9681139170482L1721.1902740981986,-984.2552959184552L1723.8769963252414,-982.6116307118191L1723.0366813484375,-977.6043074025579L1724.0686050542213,-975.8985711771722L1723.85643237724,-974.6514622608622L1722.8192793030146,-974.3636633736426L1721.2617677376572,-971.9398214771963L1721.0411671644042,-968.6984416314433L1715.7118822758296,-959.6660727489282L1715.2816688184137,-957.1574862020827L1716.512905073438,-954.7139362496341L1715.551962201774,-950.0670706524579L1717.720134104387,-948.2783254978394L1714.8850292762688,-944.3128063289157L1716.6383311520556,-942.0105394725517L1719.8558675013842,-940.5014995727604L1723.2135497660777,-944.6147835511365L1727.0575087353438,-942.8842841782848L1729.7502151600393,-939.2485239248449L1732.655886980953,-936.8687927389915L1736.0113961084696,-940.9859346836029L1740.4959764125824,-941.0385083654767L1740.1802513101538,-940.1519602866797L1740.386990507959,-939.411246682524L1742.7861604064715,-938.8909892472909L1744.9715673310202,-935.1097438443992L1747.576447617841,-933.8496113433487L1747.0531569898828,-933.7029368948367L1747.572091508191,-931.8511211642333L1749.8739359175713,-931.6977575068961L1751.0148764076735,-929.6281113180357L1753.109823014918,-930.2170069780616L1754.2589213076358,-928.1425210861682L1754.887137215949,-927.9197140341191L1755.4085670072718,-926.0680624207093L1757.7053320874127,-923.9242929187271L1770.277674414406,-899.5113385041736L1778.6949994268696,-883.9015252347194L1776.8940167576507,-882.1886265194285L1776.6848502792861,-880.9276844735105L1777.1033455481765,-879.4513799581987L1776.9940129717784,-877.8181252858515L1778.5744687621764,-876.2631712484899L1779.2035234209168,-874.0450565785657L1778.234561249294,-867.367439182849L1779.9207382344769,-863.4371511633265L1780.8705335286522,-862.1104553185567L1780.5490024271337,-861.217919138352L1781.2908350961725,-860.6264697713107L1781.1792180413024,-858.9917940623898L1782.871936022738,-857.0737247697036L1782.7530283586782,-853.4325877629074L1784.0284593078256,-852.9921160068623L1783.8092097834008,-851.7346836653328L1783.171353563157,-851.9549280435026L1783.2605932670822,-847.5706873167619L1787.1898663119289,-845.8843489525041L1789.9624298946746,-846.2704945695289L1787.082093820674,-844.2498562446535L1785.472572828161,-841.7891502119116L1782.585963915789,-839.7779195748499L1777.808224775707,-842.4325299717709L1774.7264858100436,-843.1692898311187L1774.5053672135425,-841.9052111558019L1772.1475655939103,-840.0423980958101L1770.6387917699162,-837.2167053969345L1768.5056486167368,-836.6210604417886L1765.9700900775063,-839.5186860763886L1760.4644369528871,-842.7848775780822L1754.5137374008673,-843.5379910976674L1753.8991639492574,-845.7617340227062L1751.769969474237,-845.1738200799853L1748.266326295842,-845.4086780745165L1745.621472902583,-846.6814430333604L1743.6608931095013,-851.7342040053481L1741.6614102152384,-852.77770713635L1736.1335495548553,-860.4502155589521L1736.8870338760753,-861.8551450211901L1733.3218194092951,-864.4695387730908L1733.2915001662357,-870.8459576897915L1730.1634341499002,-865.6056042497155L1729.7082628941484,-863.085088065752L1727.5870725428879,-862.5083458931267L1725.5341121515219,-859.5551130320755L1725.7059085355893,-856.8134256319172L1724.6463175790916,-856.5265113490552L1724.6174098339102,-854.5219547783772L1723.3215703023143,-852.9736121485696L1720.1613650577947,-854.1172648959198L1719.027189173478,-856.2069714259924L1718.5581714260688,-860.0651922241757L1716.4617704014652,-861.4962216264432L1716.6927861124125,-862.7557441103945L1712.8104487404578,-864.4978397899949L1710.2252597777856,-861.4106892944005L1709.4942907413415,-862.0128670211952L1708.1666300119405,-858.4736443186002L1706.6698931993137,-857.6751133559828L1707.7610653410263,-853.5854507551912L1706.2625157172547,-852.786975051539L1706.0274386134183,-851.5276332096846L1694.3162026540338,-848.4246805755954L1689.2933327179676,-841.5312742536107L1686.9670358842786,-841.7191545560554L1685.6574741690733,-840.181325568908L1683.6706127976036,-841.2564310813311L1682.117373899952,-838.4611325731958L1684.5456416063366,-833.5227258713624L1683.7673241034493,-832.1245206426652L1686.0027745122075,-827.9319335450275L1686.1460575288115,-825.1865785224347L1677.1334851293389,-818.0675051370176L1673.3361290853281,-819.4786547597603L1670.409310903394,-817.5314968294076L1669.048344620093,-818.376993617532L1662.5303858685443,-828.2387964360164L1659.4764777005378,-829.0510661598596L1659.7862537636713,-832.306164161314L1656.4450488956309,-834.2395402132067L1655.4005714850648,-838.3421243519517L1653.078100183068,-838.5468990903507L1652.0710898134653,-840.2723300486502L1651.5967014715773,-842.1401834542942L1648.2692913310555,-844.0794005679236L1646.6967079485537,-848.0467130092234L1643.4372948589216,-851.9842974662711L1640.0197998330518,-854.3004059289103L1637.1705461227762,-861.1156138043184L1636.7892081586463,-869.3525288872524L1632.4506107482473,-875.3990641995113L1630.674477503871,-875.739131824547L1629.052093001628,-877.7130849096347L1624.350556417344,-871.7811755297591L1622.8254398073584,-873.3772941239542L1624.0131042085359,-877.6414091612246L1627.311130831455,-882.4278204947209L1626.992261088099,-885.9188105884339L1628.2989246106179,-887.4301552138909L1627.3951702529464,-888.7900720483576L1631.277617363239,-888.9736957785931L1633.6369370609796,-890.7598599714142L1639.3828588493357,-890.2308836750522L1641.8296374649888,-891.6471533506681L1643.8993800533895,-894.5572414174947L1643.9530054109869,-896.5491706413395L1642.1800346398063,-896.8909302074417L1644.3365302996463,-899.4266885193874L1644.0507581968611,-900.5448414879247L1647.4488764563323,-902.6060450961629L1646.8773180996593,-904.8348878566524L1647.596148052687,-908.5930994397434L1649.2704863966608,-908.6262952594143L1653.3246139068642,-912.4440084694604L1654.9981233839078,-912.4793567194295L1654.5166286590922,-914.3408788023955L1652.2685541848664,-916.5327297735769L1652.7416600184329,-919.037707307079L1649.495405914211,-922.956728276926L1652.7339188910894,-923.396552773756L1653.7239686347314,-926.0354164279922L1655.6273927600837,-927.3233546052495L1652.9543479913518,-929.0052125270529L1652.7615182623074,-929.7492998667387L1654.0837779157732,-933.26848837025L1654.7037378127852,-933.0324604091409L1656.3101842122328,-935.4282047975521L1656.2523394074235,-937.7954553918767L1655.0131949096185,-938.2670004300228L1654.0087586241848,-939.983475634154L1652.210870218551,-938.3328157377405L1649.8371817657278,-938.9008685008466L1649.259190957054,-941.1322611570813L1648.0218009756757,-941.6055288373855L1648.6812511314765,-943.3634569878561L1652.9857015018085,-946.0609599343063L1653.120602557882,-947.683567412942L1652.1154612391986,-949.4062814725428L1649.8411228661657,-949.6088027185099L1648.317814947526,-951.1899754455842L1648.2041322879286,-955.913567145684L1646.584260874183,-957.8730072042667L1645.5432261142478,-957.6030951717253L1644.449859340802,-959.6991779468613L1644.5819832068466,-961.3123192696057L1646.6622731556815,-961.8519388980556L1650.2593801243252,-960.8113362420836L1653.9318646986121,-963.7457201743694L1653.5777671532126,-967.2235984371457L1655.360575217912,-968.8731507081111L1654.5496898655924,-969.8508863643945L1654.0636388351659,-971.7069997333026L1656.9818342340593,-973.2656415005554L1656.398867125864,-975.4855626844039L1659.0839411690831,-975.7947925382905L1659.7297623195625,-977.5518748757142L1662.8620152255714,-980.3623802931725Z",
"c2312":"M1441.4532591698594,-1032.0232245454574L1491.0707657389796,-1049.7447204374541L1492.927889689551,-1055.6467622647947L1492.6710545842643,-1056.762294598963L1493.5988193074656,-1057.3675610995608L1492.8375096497261,-1058.366759012846L1492.9030887434878,-1065.029755111258L1493.6617779355288,-1066.379144107704L1494.0778649953154,-1069.2079640072504L1497.9464101031967,-1073.2356856892338L1498.9510038076028,-1075.810532844926L1502.1472838054224,-1078.121230694661L1508.145469305039,-1077.5684083509284L1516.2002092130908,-1084.161565134889L1522.3490681565377,-1085.231973401518L1525.0286553467486,-1087.4394668383163L1529.2411141682824,-1087.6655870730046L1537.4877635268022,-1095.5292030749754L1539.0867627754365,-1095.5252903860523L1540.3996195998118,-1092.3222922974353L1542.4551886661338,-1090.4690169222154L1546.5539668882038,-1097.7383120802635L1545.6015629169415,-1099.4663290284361L1547.0691606326386,-1102.178843471271L1546.8894373413036,-1102.912006030591L1548.6270498318943,-1104.5149078405263L1547.130984791315,-1108.4538719318164L1545.852717782604,-1109.316385462753L1546.4955357892832,-1111.0422335448159L1550.3727455410167,-1114.7405339949L1555.437911606307,-1113.6395903112727L1556.4869595786668,-1115.8606958175899L1557.670286875595,-1115.369945449255L1560.0469495986927,-1114.391566039946L1559.3176741433156,-1113.03322247481L1561.3809246583517,-1106.882448946851L1563.2971664708034,-1107.7519716768345L1565.7693264194745,-1106.4129181869334L1567.7778761151849,-1106.9148917893763L1571.31328915468,-1103.4804222017049L1571.4564392862783,-1100.773687241114L1570.1708042119212,-1101.630063514688L1568.756158079138,-1100.8832958043797L1569.0395759514413,-1095.4617871296462L1567.2055550322157,-1094.2184032546427L1569.6862312818862,-1092.8730537657048L1569.550735020742,-1091.2674784300948L1570.423701099874,-1089.9207658422272L1571.5265978555792,-1089.8033965992138L1571.2062538883893,-1088.9372729588108L1573.1360602400907,-1085.4961908413125L1571.7158259692028,-1084.7480461535063L1571.9491420388679,-1081.66128855862L1570.6150984825265,-1080.5421690143442L1574.2062077869873,-1079.0867557966842L1576.4623904744167,-1076.5049032875602L1577.5686778540437,-1076.388699493565L1578.2164560370745,-1073.8043659664606L1583.6502192507107,-1073.595674030468L1585.0883677001418,-1070.028907101351L1585.9166457753265,-1071.0250895399156L1586.5056487860275,-1075.1031808121602L1587.928173210376,-1075.856452198635L1588.5834308902984,-1073.2664075599016L1586.891109322148,-1069.3024451740412L1587.3582204260963,-1067.4515940015929L1588.1447502406488,-1066.4759502870975L1587.8760297423803,-1063.2575629317591L1583.2207580751196,-1058.1554070684244L1583.1764202628603,-1056.1752646278926L1581.0470586283793,-1056.0355804934636L1579.061012472532,-1053.1765579808682L1578.9198573258539,-1051.5734346482395L1573.364159307953,-1047.828744860328L1570.1245053496887,-1047.8135305011972L1568.7773899284873,-1046.693403329729L1566.3752618786314,-1047.674898438487L1564.7910604006338,-1045.3173040204993L1562.57185765172,-1045.5588757082328L1559.0361249715627,-1042.3392392658332L1557.0256545608613,-1039.4879247097756L1554.7458908542592,-1037.7524702869323L1553.0316121767992,-1038.1223572735098L1552.284214242332,-1036.760979508605L1555.286393048219,-1035.5308961706387L1556.1595356462583,-1034.16972696166L1559.0755828022345,-1033.306535612387L1563.560748670214,-1030.4741916228286L1572.4987501799162,-1022.8314686080662L1576.3045802389809,-1020.6256409060047L1578.0600063052295,-1017.9137166045784L1581.3647258823587,-1015.5784805065932L1587.8908695672155,-1015.6246971009048L1586.023470969673,-1014.3773959250959L1586.5785144967244,-1012.1488382654302L1585.734900354396,-1011.1498665555896L1584.4291763324336,-1012.0085142588318L1582.4152586482785,-1009.1419732620811L1576.1172100427534,-1010.34492684055L1573.002641314662,-1011.9358344668194L1568.8928916429472,-1010.9268833291719L1567.4091824557445,-1012.5336941364972L1557.5470747953423,-1003.8372628456234L1554.7959670559992,-1003.9598074423602L1553.1150797352484,-1008.665637225766L1551.5523140201608,-1010.6506764000853L1547.3271524109603,-1012.3816723798091L1544.6715216597581,-1012.1379791961092L1541.5206181311448,-1009.4171499551737L1537.9231950901274,-1008.559726131054L1534.7792749804953,-1003.4938327381049L1531.8683408829677,-1002.0185902466956L1531.7910689888831,-1000.041076436009L1530.0842797967593,-998.0653936584849L1525.366549609279,-994.990566195308L1523.9214656192046,-989.5475195410102L1521.8540103695314,-989.0647192577226L1521.6833380901676,-987.4592241687258L1519.9646738582971,-987.8380602785012L1517.984041711627,-984.6325425922L1518.3305232741582,-983.1402641288641L1516.5241679958508,-981.541746878923L1517.300755418985,-978.1899978464476L1516.694492066534,-973.7309904237002L1510.8976567797008,-965.7167121131245L1511.1549899952768,-964.5960506722968L1510.198513362867,-961.630869873617L1506.913345568953,-961.6582293906849L1505.7779040726991,-959.440100773616L1501.4497755020934,-959.2409762855755L1502.1400561737978,-958.6116128288058L1501.2689728758655,-957.6274592064271L1498.586210794374,-957.4121844207725L1503.5832609569454,-952.2627131426473L1506.875698793262,-952.2257865788388L1508.7699554853962,-948.731598403433L1510.7572930372469,-947.2185061209198L1510.485727218604,-943.6223022872277L1511.7817852752294,-942.7379474845256L1511.520686442926,-941.4976454304228L1513.148596207738,-936.7602774730583L1509.7596138677288,-937.1673938965985L1510.4418183686244,-934.1742618584608L1503.6479920416518,-932.6311585850667L1502.9381179493594,-930.9038436829092L1498.1649842753,-932.5736706979146L1497.2070522999463,-931.9647894116506L1495.699611253656,-928.8799693728081L1496.8120258197205,-926.3761350134691L1494.2797552805646,-925.414989643949L1494.5084586706223,-921.9330557364742L1492.9344135942372,-921.5810823349643L1493.4366859765746,-919.333059171649L1491.9248131176623,-916.2490335963537L1490.7072203626526,-916.7644814801399L1488.6941395774286,-915.9233112442369L1486.8700446306075,-916.6910575714508L1485.5412123952588,-922.6807942399562L1482.5350570943096,-926.3390204101363L1483.8549660100753,-927.8035410726213L1485.0677167427225,-927.2935322950505L1486.3081263354443,-929.1344378844633L1484.1545004720529,-931.407620122342L1481.815969120316,-932.0681639262025L1484.7037199039971,-933.8807143180948L1484.2875922010026,-935.7533426390257L1481.2366985102292,-934.6835185408961L1478.534527554535,-941.9357505106173L1465.731273950214,-937.944424497462L1458.855227820598,-954.47534397508L1452.6130195572296,-953.1222615776471L1450.4856988252086,-955.4003861136487L1448.7666896137414,-955.8139617913923L1447.2849411735554,-955.103220205184L1446.8823041368828,-956.9763976903589L1444.7997784861313,-956.5292658358296L1445.521527316621,-953.1639108502707L1448.728198475111,-953.4608114059502L1450.2497488099086,-951.4361614107099L1453.8934193696784,-952.2226671248486L1454.1364907990783,-951.0987869078936L1451.0555345452685,-947.6958356522669L1450.9420529097538,-945.7106527854489L1449.256938803691,-943.3874542811943L1447.3687616619368,-944.5506661162472L1446.3693791605087,-946.6888364210745L1440.6335845510941,-945.463215918978L1439.3116710639977,-944.0060539513952L1437.5860768678021,-944.4232402847331L1439.6341820664447,-947.5947760107806L1439.1553204058307,-949.8440792889564L1437.7983042388973,-951.122673779694L1437.6782741526274,-954.2243268798795L1439.442196832772,-956.1671602373253L1438.8416202660414,-956.4308909494112L1439.202457909448,-957.2913423712671L1442.6022168109894,-959.186026934864L1442.8015574378371,-960.7959136598661L1442.0006052714393,-964.5347778567411L1439.9215792624152,-964.0899051531217L1440.5603974590845,-966.184910714964L1438.1669994682304,-967.2398963740977L1440.6790280626565,-968.1685943035995L1436.929815197856,-970.4928391901522L1439.7184607753152,-972.655080811088L1439.757506398365,-975.0056179623482L1443.344966500691,-973.4330586879025L1442.4682949786948,-972.4614659845488L1445.0622003950357,-973.0191795839228L1445.898794150477,-971.6325822113606L1451.0014459512731,-973.1267018754625L1449.0404657675085,-974.6610859910438L1450.2718192565446,-976.4945892889968L1447.2818890035096,-977.799128034361L1446.406981598115,-976.8269094112538L1444.4488852512995,-978.3628224787285L1446.440511455712,-979.1839701031231L1448.3944705685972,-977.6479496718L1449.3498572020214,-978.2463867886752L1448.070771280029,-979.1446258857129L1448.345915266791,-980.3791066553451L1447.0203776723506,-984.0012912642812L1444.8264461531808,-986.6593862994782L1447.4399025658408,-989.5664473332654L1444.5688343877691,-992.8595848371015L1442.5029209474226,-992.4135201479248L1439.8796381237098,-994.5804025228604L1441.5366633835606,-996.8936924977497L1440.9737217931447,-999.5038406013946L1439.3508072866598,-999.5453095108705L1439.4591280329087,-1001.5244604096729L1440.9247612019185,-1002.2316329939151L1441.0991120448343,-1008.9113189408226L1442.6971014006103,-1013.9428179613806L1445.3435055175169,-1014.1261945278384L1441.889059881772,-1017.6705757502687L1442.4537869345415,-1022.4771994912185L1441.401686937259,-1027.3227759923848Z",
"c2307":"M1587.928173210376,-1075.856452198635L1586.5056487860275,-1075.1031808121602L1585.9166457753265,-1071.0250895399156L1585.0883677001418,-1070.028907101351L1583.6502192507107,-1073.595674030468L1578.2164560370745,-1073.8043659664606L1577.5686778540437,-1076.388699493565L1576.4623904744167,-1076.5049032875602L1574.2062077869873,-1079.0867557966842L1570.6150984825265,-1080.5421690143442L1571.9491420388679,-1081.66128855862L1571.7158259692028,-1084.7480461535063L1573.1360602400907,-1085.4961908413125L1571.2062538883893,-1088.9372729588108L1571.5265978555792,-1089.8033965992138L1570.423701099874,-1089.9207658422272L1569.550735020742,-1091.2674784300948L1569.6862312818862,-1092.8730537657048L1567.2055550322157,-1094.2184032546427L1569.0395759514413,-1095.4617871296462L1568.756158079138,-1100.8832958043797L1570.1708042119212,-1101.630063514688L1571.4564392862783,-1100.773687241114L1571.31328915468,-1103.4804222017049L1567.7778761151849,-1106.9148917893763L1565.7693264194745,-1106.4129181869334L1563.2971664708034,-1107.7519716768345L1561.3809246583517,-1106.882448946851L1559.3176741433156,-1113.03322247481L1560.0469495986927,-1114.391566039946L1557.670286875595,-1115.369945449255L1558.9014292233637,-1116.852641925197L1559.3555900605331,-1119.3119496655602L1561.9007093868265,-1121.907648428623L1565.9078227211849,-1122.9100854617595L1566.1315102220094,-1124.1431685447517L1564.7993027164966,-1127.332564465572L1567.792945907451,-1138.6596050572261L1573.002732681888,-1141.1525590112017L1576.5234645680741,-1144.0075509246892L1579.5124200570592,-1144.7688795157324L1581.7617847043066,-1142.2039089860014L1583.1021579543662,-1139.021087507614L1585.6381274207092,-1135.3510358444369L1587.230678815801,-1135.3733838925075L1587.349838137348,-1136.9676022422288L1589.7538233974267,-1137.97753032682L1588.5916224211355,-1140.4277782562194L1589.2131753127414,-1142.1510557968552L1588.5502056129062,-1144.7289241296755L1590.470411632548,-1147.578923123084L1589.285384212182,-1148.051594614909L1590.306114871386,-1150.277430822511L1589.5467459949602,-1153.22166999138L1590.2044617232762,-1158.8784362285126L1592.91925378589,-1162.7132075918735L1596.2006790365194,-1164.3502840028698L1596.5256850500493,-1167.174881370566L1597.3266570065214,-1168.168404276316L1593.1140888170708,-1172.1653151709938L1593.8142376423064,-1173.5240882254611L1597.0747085578564,-1173.1965980579578L1597.3740362362757,-1174.0593741541145L1596.595584532166,-1175.033180405431L1597.2940873634436,-1176.3923592683705L1598.6836300522198,-1177.1477606896674L1598.7796533342284,-1176.7805519475871L1600.8658682236855,-1178.8960665790835L1604.421976609549,-1179.4373127209647L1604.8337919668586,-1181.8930565210267L1607.2154003845137,-1184.8753163967851L1605.7449325700413,-1186.4421368498172L1606.4425287607748,-1187.8032350526792L1605.65830952621,-1188.7732516388132L1606.055268672966,-1189.2703170375166L1602.9040552333602,-1189.2241956343082L1601.050223714643,-1192.2587783144154L1600.2787362126953,-1195.192445392137L1593.6852337878988,-1194.2476862767899L1589.8718674102622,-1196.7712724850292L1589.2189687032944,-1201.2937105633598L1584.4551510815477,-1207.4840342288358L1583.694485875326,-1210.4095240022189L1585.5910203502604,-1215.2069858749321L1587.8363888329025,-1214.6192533094506L1588.135699617647,-1215.4800525993376L1591.8537821048299,-1215.2794236565444L1592.0562623338046,-1216.5067127542209L1590.895294721728,-1218.9344801062837L1591.3953915244235,-1221.0221306399064L1597.555745260711,-1221.4696013695816L1601.9320488253124,-1212.850185624462L1603.4974501791046,-1212.872695580927L1607.1285375116047,-1215.0115934423304L1609.281844215493,-1214.8007385703404L1610.7511183643744,-1213.2324004298648L1611.7250733006028,-1209.5786672432957L1613.0008039508557,-1208.7425173939782L1616.0427978148757,-1209.1630964059093L1617.221645201464,-1208.6941388029668L1617.7083111912918,-1204.9083752165668L1621.4417562115786,-1204.7321017414738L1621.8350092224614,-1203.2677254412922L1621.2419438196666,-1201.5455817593468L1621.93081166371,-1200.9453568311042L1626.751745447875,-1200.6715539132013L1629.017623447237,-1198.1477330726564L1637.2969730500129,-1194.8879603530136L1639.3673449346352,-1193.0988587570796L1647.5342463491936,-1198.0754885739016L1649.1082690838707,-1198.1140640828514L1651.3893002899513,-1195.6002224063836L1653.748738663771,-1196.6433692623734L1655.8087574851527,-1198.7862155547618L1658.8609924495534,-1199.2368615243017L1659.4687247674544,-1197.0428179645724L1657.9124407093434,-1193.0754621755727L1656.601226581082,-1180.518251471777L1657.3984875666206,-1179.555824927399L1661.2621164880559,-1179.0452271633783L1662.6766660605324,-1173.9246021184417L1663.4695071796814,-1172.9680409795983L1668.0155130162516,-1175.7973976112578L1669.209515494743,-1175.3402232289218L1670.2119282906929,-1173.6537506289303L1669.4369939069097,-1170.6770466821163L1673.0484349895073,-1165.374125823001L1672.359002362054,-1164.0055596872257L1670.868996361502,-1163.5918203524413L1669.3942158516845,-1161.2096737511654L1664.9253758679488,-1159.974344338031L1663.2442593209164,-1158.3274083878666L1661.0533051946277,-1158.5135827059894L1659.058019585323,-1159.9375291219696L1657.8727580015457,-1158.4293114437419L1656.677222874991,-1158.8903930131735L1656.9786113421976,-1157.789962740943L1655.4909700771723,-1157.382800783144L1655.2944513714401,-1156.1461391307093L1652.2133183143983,-1155.6992218931325L1651.0201978163984,-1154.1914727094484L1651.717912202448,-1153.593009911642L1650.5220235006416,-1152.091914794676L1651.7179181467834,-1151.6288482113985L1651.6205324177226,-1148.0535650261556L1652.8174105155526,-1147.590573910186L1652.1181268598916,-1146.2243032249048L1648.932712986708,-1146.1404921218943L1647.038220278162,-1143.2686242937252L1646.040099546951,-1142.9986022152177L1644.4482034636492,-1144.9264626002637L1639.571347339598,-1147.1581541722528L1637.2918145274612,-1149.689414888586L1632.9219393730427,-1152.0610088057488L1632.4108742422368,-1147.9866334216772L1629.7165580414282,-1146.0926459988493L1631.1066057687872,-1144.8886491224926L1632.4894115949824,-1141.7134879446164L1631.676633284127,-1138.7463748575958L1630.2659417483542,-1136.0068842207625L1630.9600410468715,-1135.411090376218L1631.635769190655,-1130.863275647476L1634.1265954883213,-1129.5640300956409L1632.51595514824,-1127.5582374377616L1629.5150536413046,-1126.7601621254544L1629.6128053953826,-1126.392084876322L1630.8944475702883,-1123.5870476746773L1632.594230053423,-1123.2506965366556L1632.582394404281,-1121.2766011211377L1632.8761395469091,-1120.1720708086143L1634.9764160790355,-1120.336892014927L1635.661315266981,-1117.7663386841496L1637.5601814116947,-1116.6951092346426L1638.0514116124318,-1114.8540012155354L1645.1538709921742,-1112.4211630817324L1645.241940245987,-1110.0836987033942L1647.3438543076293,-1108.2791375500572L1646.5189650860534,-1103.3269332496589L1647.314426745729,-1102.355563535422L1649.4283891891478,-1102.528070547251L1647.5120239380303,-1101.6187395266259L1646.80499943137,-1100.2444757220883L1647.6917808049072,-1096.9346912662977L1648.8936319833283,-1096.4668344480888L1648.086755468881,-1095.4605049084619L1649.5836836428002,-1093.8936874104863L1647.052395195064,-1091.240473832979L1648.0506752697672,-1089.5321343308692L1651.57013538937,-1088.5064936217398L1651.2624927028119,-1087.6335436949046L1651.5591291808566,-1086.5274101696123L1649.2328129443522,-1085.1138386311598L1652.1524548304217,-1084.314946629302L1650.8227714029126,-1081.1988531463949L1647.789721466503,-1080.3880956507373L1648.758389125527,-1074.7247458680738L1647.5324100810103,-1073.2119241787004L1648.3347250014558,-1072.2397674722677L1646.1937631397293,-1070.0956037819792L1647.781910746345,-1066.16910455561L1645.2266539811678,-1063.5204168345665L1641.8683854289038,-1061.8401560757748L1643.4674652894466,-1059.8912273002484L1643.3498256086602,-1058.2785739579172L1641.1236094241617,-1058.4808171320788L1641.5122294397506,-1057.0092734245566L1643.4301807110537,-1055.9345880701896L1643.311815679406,-1054.3215722537393L1645.5182114641657,-1052.1440270007006L1646.9088411502835,-1048.9521357527067L1649.4371641460054,-1047.6513027509168L1651.9828872450096,-1048.3275398064018L1653.1625664049968,-1043.8917510828824L1651.9236466009404,-1042.3822056241977L1648.4507555395198,-1041.065617288619L1647.5093549099888,-1038.4421123544384L1646.268714674773,-1036.9271656653618L1646.024826122493,-1033.7039977547367L1642.7388829638207,-1031.6516453239765L1641.1363808373833,-1033.6046506289752L1638.1913572551352,-1034.4073623766415L1633.757556981195,-1030.4870781643745L1633.408679049252,-1027.6276974554496L1632.48019042803,-1026.9904366499647L1633.1532817074885,-1024.4042110577248L1631.5231862783046,-1024.3757803169035L1629.664068096669,-1023.1021151011407L1627.233040612436,-1024.0538117210133L1625.8174210300635,-1018.9429527896064L1618.9978969302063,-1019.9538199252886L1617.329368219431,-1017.9448931842821L1617.1008450506358,-1016.7007127898282L1614.3425936606764,-1016.7852723844001L1611.032884545431,-1014.7626775358028L1609.7117571440463,-1019.9493994444192L1608.408307389294,-1020.7952481754514L1603.280026140519,-1019.4934211183622L1601.2707241219691,-1020.9588911858116L1597.308551595199,-1021.5374762522167L1594.6071864294843,-1019.2792224073601L1594.8869832300745,-1018.1656910911681L1594.2309535767372,-1016.4296064214914L1587.8908695672155,-1015.6246971009048L1581.3647258823587,-1015.5784805065932L1578.0600063052295,-1017.9137166045784L1576.3045802389809,-1020.6256409060047L1572.4987501799162,-1022.8314686080662L1563.560748670214,-1030.4741916228286L1559.0755828022345,-1033.306535612387L1556.1595356462583,-1034.16972696166L1555.286393048219,-1035.5308961706387L1552.284214242332,-1036.760979508605L1553.0316121767992,-1038.1223572735098L1554.7458908542592,-1037.7524702869323L1557.0256545608613,-1039.4879247097756L1559.0361249715627,-1042.3392392658332L1562.57185765172,-1045.5588757082328L1564.7910604006338,-1045.3173040204993L1566.3752618786314,-1047.674898438487L1568.7773899284873,-1046.693403329729L1570.1245053496887,-1047.8135305011972L1573.364159307953,-1047.828744860328L1578.9198573258539,-1051.5734346482395L1579.061012472532,-1053.1765579808682L1581.0470586283793,-1056.0355804934636L1583.1764202628603,-1056.1752646278926L1583.2207580751196,-1058.1554070684244L1587.8760297423803,-1063.2575629317591L1588.1447502406488,-1066.4759502870975L1587.3582204260963,-1067.4515940015929L1586.891109322148,-1069.3024451740412L1588.5834308902984,-1073.2664075599016Z",
"c2308":"M1646.024826122493,-1033.7039977547367L1646.268714674773,-1036.9271656653618L1647.5093549099888,-1038.4421123544384L1648.4507555395198,-1041.065617288619L1651.9236466009404,-1042.3822056241977L1653.1625664049968,-1043.8917510828824L1651.9828872450096,-1048.3275398064018L1649.4371641460054,-1047.6513027509168L1646.9088411502835,-1048.9521357527067L1645.5182114641657,-1052.1440270007006L1643.311815679406,-1054.3215722537393L1643.4301807110537,-1055.9345880701896L1641.5122294397506,-1057.0092734245566L1641.1236094241617,-1058.4808171320788L1643.3498256086602,-1058.2785739579172L1643.4674652894466,-1059.8912273002484L1641.8683854289038,-1061.8401560757748L1645.2266539811678,-1063.5204168345665L1647.781910746345,-1066.16910455561L1646.1937631397293,-1070.0956037819792L1648.3347250014558,-1072.2397674722677L1647.5324100810103,-1073.2119241787004L1648.758389125527,-1074.7247458680738L1647.789721466503,-1080.3880956507373L1650.8227714029126,-1081.1988531463949L1652.1524548304217,-1084.314946629302L1653.2631388473412,-1084.217638691954L1654.966574478691,-1081.9147721848265L1656.4803395640208,-1082.3217571408686L1659.1009104191453,-1080.6545587285773L1664.5558973704399,-1080.5530355739972L1666.263277314695,-1078.2455073612348L1666.2561205640188,-1076.2646925336742L1669.5889802998383,-1074.0090088994218L1677.2813692876575,-1073.7282336142382L1678.5962638274893,-1074.8800717553584L1677.6906909561246,-1076.216858926025L1677.2875078491854,-1077.6909646949227L1678.1952633487656,-1078.3354462182313L1677.995351457319,-1079.0656967052446L1681.7384104523123,-1081.2806126975154L1684.2682209164357,-1080.0024974081355L1688.206936388537,-1083.4593206749075L1688.404160389671,-1086.6842386738913L1689.8189147501853,-1087.4721453070313L1682.0335189018947,-1094.0220125286944L1686.6681203706664,-1096.8864928592125L1688.686653839396,-1095.4650594864415L1693.2298722770147,-1094.7456644574024L1700.7780813214138,-1098.8353573340453L1702.0018454665305,-1096.4099820043823L1702.7125396735023,-1095.8161497443398L1701.9198461094045,-1092.8178781633724L1709.200436276677,-1092.0934134279578L1710.6987846063485,-1094.492795088973L1712.608923682855,-1095.4292105577679L1720.5009825367592,-1094.4986771461442L1722.688074332015,-1098.2914269982055L1724.8896580840942,-1100.111515010572L1725.4775581163162,-1101.868322266747L1731.033235501428,-1101.4750013624744L1736.9680545682209,-1103.582240698386L1739.7446855626802,-1107.168058565291L1745.8036058516277,-1106.9395722075592L1749.7174129752611,-1108.478637353346L1750.4781723807791,-1111.4784210276953L1749.5136183563038,-1114.7761809116892L1749.587146965223,-1116.3885721522063L1752.4542881557825,-1119.6079707306374L1757.5319832075327,-1122.6930040747511L1759.1051404723528,-1124.7488265226125L1760.417006654185,-1129.5062618613167L1762.332662961488,-1134.045574642954L1762.572693650811,-1136.9018847110376L1763.4171567190538,-1139.5326970127212L1762.0530216531458,-1142.3095213986346L1763.2195854301083,-1143.8498280168146L1764.1740160732284,-1146.115745044196L1766.1642061300722,-1146.7093562321163L1767.223403365323,-1148.617098182009L1765.697348205534,-1153.7226983052662L1767.8662997209158,-1159.1373931582432L1765.7808237397303,-1162.4818881673518L1766.833562960381,-1164.387860351816L1771.3500519816373,-1163.7561981434326L1773.2221699721244,-1164.7178090783452L1774.4889339050526,-1169.4758713371352L1779.2781344761936,-1173.305583561336L1780.202772000504,-1179.1493537590911L1782.2332594824977,-1181.3588390085679L1787.1697591353245,-1182.866108206186L1791.678884554252,-1182.2575378439133L1794.7997036371905,-1184.4115629246783L1801.3274471011516,-1186.028223607714L1802.5843294277154,-1187.2143810504783L1802.60215914708,-1192.3922573998452L1807.7522520474881,-1193.196474266962L1808.5521841668415,-1195.8371356543785L1807.872487925425,-1198.0162426060463L1808.2539318197016,-1198.5264948906256L1813.3217264628074,-1201.3070864619851L1815.5868201228147,-1204.409793253875L1818.0464387552493,-1205.1833849722905L1819.7023108143815,-1208.489172785021L1824.2353687176173,-1209.5229940980082L1825.2767176493596,-1213.0439982211055L1826.6344865305668,-1213.873726805982L1832.3706391458045,-1214.5019928954212L1836.4617371559953,-1218.6032329825728L1847.2311340493513,-1222.0664706292057L1852.2002212014388,-1220.0774868078233L1854.1766823926234,-1222.3174113183832L1855.080238443075,-1226.2013295470658L1856.1910458157686,-1227.7619298145516L1860.8253268610986,-1228.4736002163238L1862.7774660564733,-1229.11184522341L1862.675336383118,-1231.078129746339L1864.6153792067466,-1230.1136678946918L1864.71807829663,-1228.147199536007L1865.0709798407258,-1227.0699222413004L1862.3579790239708,-1223.7821551875534L1856.7020062312758,-1219.5467154644932L1854.6988614867003,-1215.6974999947483L1850.0106059829354,-1211.7817827627855L1852.2274851601971,-1204.9153435774294L1849.2640526542434,-1195.5696024375877L1849.938311689778,-1191.793917945418L1853.2177823883114,-1190.0482645556547L1853.9160790258597,-1187.8793987745491L1857.342549932508,-1187.3829159195823L1859.3561751915001,-1182.835332599267L1864.478948527735,-1180.4937851445256L1866.0311066353026,-1177.3904391500655L1863.3340284308633,-1170.5145495649392L1864.2692719466263,-1167.6177779274255L1861.089853626373,-1162.1920188955075L1861.6441741554688,-1158.7634020745963L1858.8644958492507,-1155.473425516191L1852.5187552484801,-1153.0430287377005L1851.7889510171826,-1153.6113261296741L1849.26882508345,-1151.2066198283817L1848.5393874588904,-1151.7755098809691L1842.2933973410536,-1159.3843922527283L1842.2572542512191,-1157.772330221623L1840.0803150305658,-1154.2893488280522L1836.028446326894,-1155.0028305499823L1833.8857819668146,-1153.1352250348687L1827.844095711917,-1153.2299970487402L1824.5904468648998,-1151.4126517792524L1820.4961645308952,-1150.5351762123546L1818.347024709297,-1148.6753486485748L1817.6655305423456,-1142.0788828126406L1811.3430473408903,-1141.313892108541L1809.747571765493,-1137.6345499074905L1809.7052519403821,-1132.4370323236578L1807.3796333507184,-1129.3262776976744L1809.783230736908,-1123.280897938657L1808.6128999535447,-1121.7306367644203L1808.0638713148462,-1112.7801755133557L1809.9071522194877,-1112.1454624017072L1810.1288891466152,-1111.4213438291536L1808.7323790206058,-1110.5943425841263L1809.291220323044,-1108.7670880729847L1808.289682472211,-1108.4609073203683L1809.123376861469,-1107.5167953140603L1810.1297062965734,-1107.8245676844479L1810.0736868876522,-1106.2086415985366L1808.9598564626099,-1106.2678193887104L1809.791808448275,-1105.330306487284L1807.7825010267427,-1104.7165484109316L1808.3976234248357,-1104.5046652003637L1807.8367066891967,-1102.7347815257738L1808.5636215002323,-1102.1572183028807L1808.7291690237205,-1099.8094287861209L1805.4253164805086,-1098.0108405666344L1803.2921170777884,-1094.1656495545376L1801.8887651567215,-1093.3404801106565L1801.9362910684758,-1091.3641426361814L1798.6262577203443,-1089.5637505521688L1798.7888929038106,-1087.2156011313905L1797.556851149106,-1087.6428498518464L1796.481707628199,-1085.7206742934063L1796.0403237679498,-1087.185645277283L1793.29676552533,-1087.1587625495813L1790.6167648399726,-1088.7424483976495L1787.9159984232322,-1086.742292434418L1786.2941868045573,-1086.6562309970282L1784.2034231969112,-1084.4350552116236L1782.0752736071759,-1084.1996736193132L1780.4108500008876,-1086.0910726223026L1777.272320507664,-1085.5570709119702L1776.0812157803934,-1084.006949029603L1777.0577834329195,-1080.7133720311342L1776.55609283489,-1080.564648703298L1773.8074068918838,-1080.5486726423785L1771.7512914724982,-1081.9351070646003L1769.220359037787,-1081.1883261485295L1767.3841623177727,-1081.8362842256804L1766.1963295556209,-1085.8714413608643L1767.4593585668515,-1089.0263753862364L1765.9084828034927,-1090.5620079475877L1756.9809168674067,-1091.120512843239L1751.0301505440389,-1088.9855569313108L1747.921260389657,-1086.4969146675714L1748.98679886718,-1082.825553615619L1750.3188005496336,-1082.0179387842063L1746.7800506465367,-1080.9915520569016L1746.5673393471825,-1081.7260431556965L1745.554970516595,-1081.4329844429499L1744.1693322249535,-1078.6515815347748L1743.6407319333882,-1080.4815836998048L1735.0402072836375,-1078.0064569579172L1732.0080113638478,-1086.67351379618L1732.17815556968,-1089.8953309530048L1719.0065275949041,-1078.6058152499268L1715.9716633438316,-1077.7477820674264L1716.283269862638,-1076.6441681885944L1713.247046126459,-1075.788023692426L1712.834478834635,-1077.2530932075526L1708.9819611202752,-1077.3610349051505L1706.661151363564,-1073.9387615221467L1704.130212947589,-1073.230936399173L1702.9214764700073,-1071.7028146183968L1703.2356930571486,-1068.615195030401L1702.4236614384513,-1067.602219476421L1702.5313508465802,-1065.250603045806L1701.2076670011197,-1066.0729232572087L1699.6919013351314,-1063.6670775242242L1696.3424023241057,-1061.9445477306754L1697.8714006499624,-1056.4220525355968L1699.598388380081,-1056.1066209091673L1701.1262218292497,-1054.5525717487135L1701.4331205414019,-1053.446587824107L1702.5543572466963,-1053.360783337057L1702.0467801622788,-1049.2560414053535L1703.578447263343,-1047.6952862063138L1705.4136537748768,-1048.9996311572459L1708.3696208850386,-1048.2335676930088L1710.709052191459,-1049.6810571001172L1713.0578582356127,-1049.1455968173761L1716.5375870892049,-1044.5623424315809L1718.9868741154821,-1043.666344098523L1719.6080292166255,-1041.4546722817572L1721.5550909535953,-1040.4109088270764L1722.5827142965964,-1038.7182087686365L1726.259692858273,-1039.356471110894L1729.4356132056444,-1037.8659509551253L1731.2716325854865,-1039.1818183900057L1732.6026251956894,-1038.364857010544L1733.5319843509985,-1037.0359546296886L1732.825421067307,-1035.648366397445L1731.2908446258903,-1035.2136403038658L1731.4051105838073,-1032.8572575425455L1730.9025734254744,-1030.7244225370207L1727.426263758997,-1029.3450018567123L1728.048024362087,-1027.139013370295L1728.6644917218666,-1026.9146956082195L1727.2419312598975,-1024.1252476380564L1728.1683790757945,-1022.8008129698258L1729.824625538479,-1018.8872388254424L1728.3880453353106,-1018.0845680165867L1728.6976150069165,-1016.9842777232247L1728.193579203663,-1012.8602326499588L1723.2672896302374,-1010.6827471306499L1720.9002554315612,-1011.2154864017803L1716.073561017238,-1008.6767055001858L1715.865013285796,-1007.4321187943171L1713.1885392040192,-1007.0871809232046L1713.7024312578874,-1003.2504926937288L1707.8399483008468,-1004.4145179954508L1705.6853486579275,-1006.1996630155018L1700.4512057603977,-1007.146269928568L1698.8134825152188,-1009.0821409319553L1692.3461163410668,-1008.4989889684462L1689.3702665485532,-1009.2776045232608L1684.5709540617984,-1012.7325154582331L1682.9414453076333,-1014.6729564049526L1680.5902269668686,-1015.2274275062832L1674.6932744917656,-1020.7637679821246L1671.9327733782352,-1020.8142110959457L1669.7973039946787,-1022.6200638398418L1674.7225018324903,-1024.7383341407303L1676.6554237634182,-1023.6732124974087L1676.768764858833,-1025.2906412104608L1679.2319658533745,-1026.3535831832185L1679.1409134111732,-1028.7021324211487L1679.8648659046469,-1030.0885170544652L1677.852293602543,-1035.4857495671386L1677.5841281119906,-1042.5439898444483L1676.6628394146198,-1041.8975556904363L1675.1241601099757,-1039.4982445074063L1677.7411544471565,-1033.869163095126L1672.1342517319665,-1034.336448613227L1673.1655437972254,-1036.5970801361382L1672.7803730076114,-1040.0538295508843L1672.5686864077977,-1038.807387073593L1670.9402130665596,-1038.7643513853907L1669.4905850210132,-1036.0027343419613L1667.1678069198317,-1038.5413769644538L1665.336608743363,-1039.238260597096L1659.3519405101317,-1030.9093481373416L1655.6735722929234,-1030.3265336207828L1653.2371544889652,-1031.2639015766845L1652.9445943102585,-1032.3670551916173L1651.626731197023,-1033.2055581578343Z",
"c2303":"M1723.8769963252414,-982.6116307118191L1725.3221561481225,-983.4122454054316L1727.4953531690585,-983.6195187218157L1727.8017853853164,-984.5020313251789L1729.2496938017082,-983.3122257815426L1731.009447447263,-984.9999726954329L1730.694249388694,-988.1002819533303L1733.4866670752097,-990.0716389107008L1735.7573513223576,-987.9262147608524L1738.5504205544137,-987.9147692959202L1740.9220455318218,-989.3812479837268L1742.3732481174918,-988.1957961539786L1743.1935627636917,-989.2254751893458L1744.5409388541593,-988.4100284014226L1747.5329277921473,-989.6571455985104L1747.8473693032192,-988.5493678188934L1749.0891374272783,-988.11117498198L1750.1996509085484,-994.0064323574979L1748.9635630122937,-994.445424803459L1749.1599890759744,-995.6983037826062L1750.8035002093504,-997.762484304368L1754.8197977149666,-999.3086048427281L1751.6933995853135,-1004.3932765225686L1753.225923749184,-1006.8265222849711L1753.5133439912745,-1009.6945579023445L1755.4654230716033,-1010.6532783496202L1755.3447822915994,-1013.012788226793L1757.290450819047,-1013.970909461543L1760.174260062148,-1013.6038954102132L1762.0175536772244,-1014.9339672190099L1762.957171842305,-1013.6085088679581L1765.8231179400464,-1015.2359318180597L1768.1687205324663,-1007.1365772907059L1769.79553584944,-1009.205890120043L1771.038573758851,-1008.7677021306263L1771.2991375333438,-1013.6298942990773L1772.0010262682424,-1015.0324383332795L1776.2638049970822,-1011.8867128388026L1778.3159932710503,-1012.4859225392609L1784.2344032218678,-1017.0112298693557L1787.019201037841,-1017.0307770094232L1786.477389613614,-1018.8705650759307L1788.1214561935008,-1018.9551688946592L1788.714010900296,-1020.7295796170185L1788.5756136757345,-1023.0880683814742L1787.117608772183,-1024.2499105073941L1787.7088656061587,-1026.023706559304L1786.7620938925256,-1027.3434565051377L1787.862087296671,-1029.2602047976302L1787.9395467475267,-1030.8822790091324L1789.289946776902,-1030.0822265032127L1795.9695909524455,-1030.0712278574977L1796.7750839624312,-1031.1109527648084L1798.9305183715373,-1036.9468581063188L1800.4644889466938,-1037.4050692112364L1800.5003214463472,-1041.009266701292L1802.4290369508828,-1041.9868206179547L1802.1694180890092,-1044.7097112209613L1804.277796596608,-1046.9355706548997L1806.8685555263564,-1045.7209334918307L1807.8161497045303,-1044.405193541123L1809.2369230186055,-1045.2334451474412L1811.6106809252321,-1044.748550105485L1814.4012301785963,-1048.3950638866252L1814.7517626725398,-1050.896445586618L1814.3274704002938,-1055.9654207741414L1814.9642847991745,-1059.3614159046333L1814.4097754423321,-1061.1873230865062L1813.2814345677004,-1061.2450823982965L1815.832612803358,-1065.6228772854677L1814.8808067747532,-1066.927125877613L1815.6845504526361,-1071.5745634295822L1817.4253274429343,-1071.3047738869602L1820.3526587041326,-1072.5992831999606L1820.6358426856802,-1073.4866550562908L1819.5709176003033,-1075.1553576208837L1819.2423649641598,-1079.8511015569545L1822.614135843375,-1083.286686743876L1824.356970708892,-1083.021512177166L1825.1959531288906,-1082.078298208657L1825.0298395024215,-1080.8331893910763L1825.6440335859636,-1080.6216330567518L1827.7817763664768,-1080.8792685864414L1828.5135353637106,-1080.3037055613745L1831.2075887250057,-1082.3368959295453L1833.1244942816163,-1079.7241939789294L1834.1861105057064,-1081.6555381753733L1838.3438933595487,-1082.544254982178L1839.5209772550738,-1084.1126829835055L1843.6270808370093,-1083.3869755597138L1845.8095446980606,-1085.2714762414246L1849.0680555548527,-1085.488964658091L1849.9172620521117,-1084.5515840878425L1849.5899784986623,-1082.0491913112705L1850.6684611935564,-1080.3809107882253L1852.8082542873724,-1080.6505941127239L1855.745186817221,-1078.369346256622L1855.8126009778803,-1076.3833499309276L1853.5122332106978,-1074.858472637196L1853.4634831577741,-1073.237613133352L1855.2142262893299,-1072.9838365493345L1856.109164188674,-1073.6662672520047L1856.1782555831694,-1071.6878115024765L1857.4844868704024,-1069.2872606624055L1857.3257559776268,-1068.032721358203L1855.2945993770072,-1067.3955646255413L1855.7508935509375,-1065.9397899074045L1855.3074601559438,-1063.7931596136302L1853.215309818223,-1065.1458474407852L1853.1135814161205,-1061.9022220426348L1849.1089431244197,-1058.65295615596L1849.5647451426046,-1057.1892709287426L1850.64375025348,-1055.5181310293644L1853.477605015199,-1053.59835504533L1853.1433806456882,-1051.0846414953585L1852.41004726021,-1048.052350708212L1853.039655219165,-1044.2322688838992L1850.0946497533807,-1042.9150709243925L1849.9229714652558,-1041.6643981234301L1850.8887044563958,-1040.3578918708201L1850.042102877227,-1037.6855721120003L1847.429657094954,-1038.8837693196392L1846.1274814274843,-1037.6778361598956L1846.4674509019746,-1036.5785135187498L1845.956049084619,-1036.4203930938834L1846.633722606328,-1034.228174422692L1845.7235669892723,-1033.5454273854907L1846.2896457850727,-1031.7127052010883L1848.1654814844162,-1031.0877750710317L1848.27883528196,-1030.7212351153883L1846.7425411361232,-1030.2464228332617L1847.193406297937,-1028.786713354016L1847.9322490846505,-1028.2117812964957L1846.734551335492,-1026.6371347541651L1846.279480523315,-1024.4888253162633L1849.1784422334229,-1024.1787937450733L1850.1425838530843,-1022.8772939568964L1848.543256383795,-1020.7765070175903L1849.909485490143,-1019.993205052562L1847.4604284870236,-1018.8358339675601L1848.3629620592685,-1015.907817359941L1846.7085721963365,-1015.7998714471307L1845.2218389615489,-1013.3342810984827L1840.8693344479475,-1009.1954515619461L1839.8401742325734,-1008.8805664462991L1839.9524682547774,-1008.5133964505396L1838.65979805205,-1001.7014815479115L1840.0721493289632,-998.9199755608231L1839.0827758054068,-996.617584610349L1839.9349305985072,-995.6726174552041L1839.3552121086257,-993.889476635836L1839.866842570525,-994.0454026033824L1839.3985433013174,-991.894615887448L1840.1370283173069,-991.3236227146047L1839.956222426754,-990.0636006699797L1841.6572597464422,-988.1718226357839L1844.7077120886545,-981.8773598883633L1843.1591661916166,-981.4052247213237L1840.9443691775593,-977.5242646523736L1840.9848668296622,-975.5277236667546L1839.027182766046,-974.5316924134731L1838.1381093179052,-971.8591701284015L1833.1089776426302,-973.5440299447635L1788.876252197428,-974.423877774429L1784.607797558494,-975.5729400140617L1782.4975175365091,-978.9597590340638L1780.9479654185739,-978.5091585382108L1779.410529703183,-976.0626641154433L1778.6220662471012,-971.0412245598397L1779.2633959964462,-968.8267160042674L1776.3516974291147,-969.184434570021L1773.9684434168953,-967.6965834426951L1773.5828558004239,-963.1935170183895L1775.3506757100638,-962.9030041360886L1776.4032412740487,-961.2065108057673L1771.1386000702985,-952.1070468643043L1768.9602963204832,-949.8834225439916L1769.9049278784341,-948.5540235185076L1763.333592525914,-947.877657400345L1761.255222515769,-945.2877819024436L1761.5685660254355,-944.1848443357762L1760.5270411785905,-941.8904216728104L1759.277294829705,-942.3354341450984L1757.3973731175256,-941.0036324340886L1756.5609179683343,-941.9659243281737L1754.2671800562405,-942.1169104710439L1752.2820598972862,-941.1573620652805L1751.5546082821118,-939.7538721120843L1752.598617212898,-938.0502764726214L1747.576447617841,-933.8496113433487L1744.9715673310202,-935.1097438443992L1742.7861604064715,-938.8909892472909L1740.386990507959,-939.411246682524L1740.1802513101538,-940.1519602866797L1740.4959764125824,-941.0385083654767L1736.0113961084696,-940.9859346836029L1732.655886980953,-936.8687927389915L1729.7502151600393,-939.2485239248449L1727.0575087353438,-942.8842841782848L1723.2135497660777,-944.6147835511365L1719.8558675013842,-940.5014995727604L1716.6383311520556,-942.0105394725517L1714.8850292762688,-944.3128063289157L1717.720134104387,-948.2783254978394L1715.551962201774,-950.0670706524579L1716.512905073438,-954.7139362496341L1715.2816688184137,-957.1574862020827L1715.7118822758296,-959.6660727489282L1721.0411671644042,-968.6984416314433L1721.2617677376572,-971.9398214771963L1722.8192793030146,-974.3636633736426L1723.85643237724,-974.6514622608622L1724.0686050542213,-975.8985711771722L1723.0366813484375,-977.6043074025579Z",
"c2305":"M1852.5187552484801,-1153.0430287377005L1850.7631205859223,-1151.6823019683616L1849.9630403936949,-1149.0245193660353L1850.0409150454718,-1147.053924137504L1846.978821388991,-1142.877577686992L1847.4818352669283,-1137.8374340668645L1852.4754543086808,-1134.2200167835576L1853.5916969894254,-1128.970431787012L1850.3215553200382,-1127.1319743722117L1849.7806884127433,-1125.3577140001428L1850.1585036459292,-1120.674851143736L1849.233373823735,-1118.3784384964506L1850.4194009992766,-1116.355118357224L1850.3247190601653,-1107.9130371379558L1852.8678953905292,-1105.1132387842717L1852.1623943263905,-1102.0831346640803L1853.6111029304811,-1095.7275845607803L1850.2227887966665,-1090.6575374049971L1850.58516884274,-1085.9645810503168L1849.9172620521117,-1084.5515840878425L1849.0680555548527,-1085.488964658091L1845.8095446980606,-1085.2714762414246L1843.6270808370093,-1083.3869755597138L1839.5209772550738,-1084.1126829835055L1838.3438933595487,-1082.544254982178L1834.1861105057064,-1081.6555381753733L1833.1244942816163,-1079.7241939789294L1831.2075887250057,-1082.3368959295453L1828.5135353637106,-1080.3037055613745L1827.7817763664768,-1080.8792685864414L1825.6440335859636,-1080.6216330567518L1825.0298395024215,-1080.8331893910763L1825.1959531288906,-1082.078298208657L1824.356970708892,-1083.021512177166L1822.614135843375,-1083.286686743876L1819.2423649641598,-1079.8511015569545L1819.5709176003033,-1075.1553576208837L1820.6358426856802,-1073.4866550562908L1820.3526587041326,-1072.5992831999606L1817.4253274429343,-1071.3047738869602L1815.6845504526361,-1071.5745634295822L1814.8808067747532,-1066.927125877613L1815.832612803358,-1065.6228772854677L1813.2814345677004,-1061.2450823982965L1814.4097754423321,-1061.1873230865062L1814.9642847991745,-1059.3614159046333L1814.3274704002938,-1055.9654207741414L1814.7517626725398,-1050.896445586618L1814.4012301785963,-1048.3950638866252L1811.6106809252321,-1044.748550105485L1809.2369230186055,-1045.2334451474412L1807.8161497045303,-1044.405193541123L1806.8685555263564,-1045.7209334918307L1804.277796596608,-1046.9355706548997L1802.1694180890092,-1044.7097112209613L1802.4290369508828,-1041.9868206179547L1800.5003214463472,-1041.009266701292L1800.4644889466938,-1037.4050692112364L1798.9305183715373,-1036.9468581063188L1796.7750839624312,-1031.1109527648084L1795.9695909524455,-1030.0712278574977L1789.289946776902,-1030.0822265032127L1787.9395467475267,-1030.8822790091324L1787.862087296671,-1029.2602047976302L1786.7620938925256,-1027.3434565051377L1787.7088656061587,-1026.023706559304L1787.117608772183,-1024.2499105073941L1788.5756136757345,-1023.0880683814742L1788.714010900296,-1020.7295796170185L1788.1214561935008,-1018.9551688946592L1786.477389613614,-1018.8705650759307L1787.019201037841,-1017.0307770094232L1784.2344032218678,-1017.0112298693557L1778.3159932710503,-1012.4859225392609L1776.2638049970822,-1011.8867128388026L1772.0010262682424,-1015.0324383332795L1771.2991375333438,-1013.6298942990773L1771.038573758851,-1008.7677021306263L1769.79553584944,-1009.205890120043L1768.1687205324663,-1007.1365772907059L1765.8231179400464,-1015.2359318180597L1765.8052822764146,-1017.2199056087657L1767.1277402270625,-1018.4018765753144L1769.13747944946,-1022.9787225039067L1770.0534956243632,-1023.6373300858777L1768.6040275959808,-1024.8127894102872L1768.7676154805768,-1028.0545336311739L1767.93587235985,-1029.0029156567568L1762.3277391731563,-1025.386736892467L1760.3637375673736,-1026.414813938163L1758.6198822457459,-1026.7017366035507L1756.9382767046006,-1030.6045633886533L1757.5389433233815,-1032.366292543963L1756.4955565232242,-1034.0592977169285L1753.7294128569454,-1034.0591060414938L1752.918001140141,-1033.027929058682L1751.9823848304702,-1034.3535833928597L1748.4050690319418,-1033.3258662569556L1745.8324017329492,-1034.5741576174144L1742.4637017786868,-1032.8212763135439L1737.2266759724096,-1035.7035855569618L1734.5643945015638,-1035.3453022434705L1734.4597948205371,-1035.7138070315361L1734.6592653983203,-1036.9577639994238L1733.5319843509985,-1037.0359546296886L1732.6026251956894,-1038.364857010544L1731.2716325854865,-1039.1818183900057L1729.4356132056444,-1037.8659509551253L1726.259692858273,-1039.356471110894L1722.5827142965964,-1038.7182087686365L1721.5550909535953,-1040.4109088270764L1719.6080292166255,-1041.4546722817572L1718.9868741154821,-1043.666344098523L1716.5375870892049,-1044.5623424315809L1713.0578582356127,-1049.1455968173761L1710.709052191459,-1049.6810571001172L1708.3696208850386,-1048.2335676930088L1705.4136537748768,-1048.9996311572459L1703.578447263343,-1047.6952862063138L1702.0467801622788,-1049.2560414053535L1702.5543572466963,-1053.360783337057L1701.4331205414019,-1053.446587824107L1701.1262218292497,-1054.5525717487135L1699.598388380081,-1056.1066209091673L1697.8714006499624,-1056.4220525355968L1696.3424023241057,-1061.9445477306754L1699.6919013351314,-1063.6670775242242L1701.2076670011197,-1066.0729232572087L1702.5313508465802,-1065.250603045806L1702.4236614384513,-1067.602219476421L1703.2356930571486,-1068.615195030401L1702.9214764700073,-1071.7028146183968L1704.130212947589,-1073.230936399173L1706.661151363564,-1073.9387615221467L1708.9819611202752,-1077.3610349051505L1712.834478834635,-1077.2530932075526L1713.247046126459,-1075.788023692426L1716.283269862638,-1076.6441681885944L1715.9716633438316,-1077.7477820674264L1719.0065275949041,-1078.6058152499268L1732.17815556968,-1089.8953309530048L1732.0080113638478,-1086.67351379618L1735.0402072836375,-1078.0064569579172L1743.6407319333882,-1080.4815836998048L1744.1693322249535,-1078.6515815347748L1745.554970516595,-1081.4329844429499L1746.5673393471825,-1081.7260431556965L1746.7800506465367,-1080.9915520569016L1750.3188005496336,-1082.0179387842063L1748.98679886718,-1082.825553615619L1747.921260389657,-1086.4969146675714L1751.0301505440389,-1088.9855569313108L1756.9809168674067,-1091.120512843239L1765.9084828034927,-1090.5620079475877L1767.4593585668515,-1089.0263753862364L1766.1963295556209,-1085.8714413608643L1767.3841623177727,-1081.8362842256804L1769.220359037787,-1081.1883261485295L1771.7512914724982,-1081.9351070646003L1773.8074068918838,-1080.5486726423785L1776.55609283489,-1080.564648703298L1777.0577834329195,-1080.7133720311342L1776.0812157803934,-1084.006949029603L1777.272320507664,-1085.5570709119702L1780.4108500008876,-1086.0910726223026L1782.0752736071759,-1084.1996736193132L1784.2034231969112,-1084.4350552116236L1786.2941868045573,-1086.6562309970282L1787.9159984232322,-1086.742292434418L1790.6167648399726,-1088.7424483976495L1793.29676552533,-1087.1587625495813L1796.0403237679498,-1087.185645277283L1796.481707628199,-1085.7206742934063L1797.556851149106,-1087.6428498518464L1798.7888929038106,-1087.2156011313905L1798.6262577203443,-1089.5637505521688L1801.9362910684758,-1091.3641426361814L1801.8887651567215,-1093.3404801106565L1803.2921170777884,-1094.1656495545376L1805.4253164805086,-1098.0108405666344L1808.7291690237205,-1099.8094287861209L1808.5636215002323,-1102.1572183028807L1807.8367066891967,-1102.7347815257738L1808.3976234248357,-1104.5046652003637L1807.7825010267427,-1104.7165484109316L1809.791808448275,-1105.330306487284L1808.9598564626099,-1106.2678193887104L1810.0736868876522,-1106.2086415985366L1810.1297062965734,-1107.8245676844479L1809.123376861469,-1107.5167953140603L1808.289682472211,-1108.4609073203683L1809.291220323044,-1108.7670880729847L1808.7323790206058,-1110.5943425841263L1810.1288891466152,-1111.4213438291536L1809.9071522194877,-1112.1454624017072L1808.0638713148462,-1112.7801755133557L1808.6128999535447,-1121.7306367644203L1809.783230736908,-1123.280897938657L1807.3796333507184,-1129.3262776976744L1809.7052519403821,-1132.4370323236578L1809.747571765493,-1137.6345499074905L1811.3430473408903,-1141.313892108541L1817.6655305423456,-1142.0788828126406L1818.347024709297,-1148.6753486485748L1820.4961645308952,-1150.5351762123546L1824.5904468648998,-1151.4126517792524L1827.844095711917,-1153.2299970487402L1833.8857819668146,-1153.1352250348687L1836.028446326894,-1155.0028305499823L1840.0803150305658,-1154.2893488280522L1842.2572542512191,-1157.772330221623L1842.2933973410536,-1159.3843922527283L1848.5393874588904,-1151.7755098809691L1849.26882508345,-1151.2066198283817L1851.7889510171826,-1153.6113261296741Z",
"c2306":"M1441.4532591698594,-1032.0232245454574L1441.401686937259,-1027.3227759923848L1442.4537869345415,-1022.4771994912185L1441.889059881772,-1017.6705757502687L1445.3435055175169,-1014.1261945278384L1442.6971014006103,-1013.9428179613806L1441.0991120448343,-1008.9113189408226L1440.9247612019185,-1002.2316329939151L1439.4591280329087,-1001.5244604096729L1439.3508072866598,-999.5453095108705L1440.9737217931447,-999.5038406013946L1441.5366633835606,-996.8936924977497L1439.8796381237098,-994.5804025228604L1442.5029209474226,-992.4135201479248L1444.5688343877691,-992.8595848371015L1447.4399025658408,-989.5664473332654L1444.8264461531808,-986.6593862994782L1447.0203776723506,-984.0012912642812L1448.345915266791,-980.3791066553451L1448.070771280029,-979.1446258857129L1449.3498572020214,-978.2463867886752L1448.3944705685972,-977.6479496718L1446.440511455712,-979.1839701031231L1444.4488852512995,-978.3628224787285L1446.406981598115,-976.8269094112538L1447.2818890035096,-977.799128034361L1450.2718192565446,-976.4945892889968L1449.0404657675085,-974.6610859910438L1451.0014459512731,-973.1267018754625L1445.898794150477,-971.6325822113606L1445.0622003950357,-973.0191795839228L1442.4682949786948,-972.4614659845488L1443.344966500691,-973.4330586879025L1439.757506398365,-975.0056179623482L1439.7184607753152,-972.655080811088L1436.929815197856,-970.4928391901522L1440.6790280626565,-968.1685943035995L1438.1669994682304,-967.2398963740977L1440.5603974590845,-966.184910714964L1439.9215792624152,-964.0899051531217L1442.0006052714393,-964.5347778567411L1442.8015574378371,-960.7959136598661L1442.6022168109894,-959.186026934864L1439.202457909448,-957.2913423712671L1438.8416202660414,-956.4308909494112L1439.442196832772,-956.1671602373253L1437.6782741526274,-954.2243268798795L1437.7983042388973,-951.122673779694L1439.1553204058307,-949.8440792889564L1439.6341820664447,-947.5947760107806L1437.5860768678021,-944.4232402847331L1439.3116710639977,-944.0060539513952L1440.6335845510941,-945.463215918978L1446.3693791605087,-946.6888364210745L1447.3687616619368,-944.5506661162472L1449.256938803691,-943.3874542811943L1450.9420529097538,-945.7106527854489L1451.0555345452685,-947.6958356522669L1454.1364907990783,-951.0987869078936L1453.8934193696784,-952.2226671248486L1450.2497488099086,-951.4361614107099L1448.728198475111,-953.4608114059502L1445.521527316621,-953.1639108502707L1444.7997784861313,-956.5292658358296L1446.8823041368828,-956.9763976903589L1447.2849411735554,-955.103220205184L1448.7666896137414,-955.8139617913923L1450.4856988252086,-955.4003861136487L1452.6130195572296,-953.1222615776471L1458.855227820598,-954.47534397508L1465.731273950214,-937.944424497462L1478.534527554535,-941.9357505106173L1481.2366985102292,-934.6835185408961L1484.2875922010026,-935.7533426390257L1484.7037199039971,-933.8807143180948L1481.815969120316,-932.0681639262025L1484.1545004720529,-931.407620122342L1486.3081263354443,-929.1344378844633L1485.0677167427225,-927.2935322950505L1483.8549660100753,-927.8035410726213L1482.5350570943096,-926.3390204101363L1485.5412123952588,-922.6807942399562L1486.8700446306075,-916.6910575714508L1484.4956298459415,-914.9923729488521L1480.7391862641616,-914.5560782973491L1479.049362593371,-912.2182332390728L1476.1458296316441,-910.4013526664021L1472.830488005656,-910.4620478389088L1474.2926538674978,-908.816294065753L1472.351576873867,-907.606087010924L1470.4580857295132,-903.662995624921L1466.8135511207947,-905.2293698299759L1467.2205736461115,-903.3526919363055L1464.869525113895,-904.0222867909797L1461.4296365167497,-902.1005827779538L1459.245739802504,-902.0232399384929L1458.514465816375,-900.2946354732774L1456.9329098513972,-899.9551608208947L1456.3691391057905,-902.5838989764541L1454.6323619208492,-902.9972680318901L1453.5444826295268,-905.506315348111L1454.3562756373458,-906.8582080220554L1448.9363545453234,-906.4856942775598L1447.245642462467,-909.2590465974961L1445.9416882293438,-905.0637442385616L1446.947011024768,-902.9218415309526L1446.1309258138485,-901.5779765022121L1444.3125412285806,-902.3630489625357L1441.9191671616327,-900.6864084571964L1440.9969213550858,-902.4469892561297L1439.210495089027,-900.500492625735L1437.0228591135137,-900.4327395438709L1435.1538983576056,-898.87042740692L1432.2875802313147,-899.4403531391501L1432.6004592182583,-897.943542408826L1431.2534399503834,-896.4851907071002L1426.33550433972,-898.9846719013199L1423.4860944549382,-896.832232199328L1420.678212513816,-899.7737812098956L1420.7392721527872,-902.1388275652207L1420.5076205252922,-903.2599869928033L1416.2200904866622,-902.7681745502391L1414.862103323653,-904.0568204665115L1415.0023945910368,-906.0451863583783L1412.743479291304,-906.3580678336027L1412.8841984259689,-908.3461209483232L1410.4884457092635,-906.6798594828053L1408.8323097261934,-906.7331447700751L1408.0756209243293,-907.7539231374212L1408.2179530503026,-909.741617689506L1407.0890813799788,-909.9029329323055L1407.3095531750282,-911.5075333896164L1405.6600648740182,-911.5628500755975L1404.8279447904906,-912.959881449063L1403.2507895512797,-912.63904648632L1404.1492068020953,-913.6049247928274L1403.9961796466007,-914.3569503876199L1400.618756959697,-914.8455271764683L1399.7898461358343,-916.2363279620233L1402.6309408455313,-918.3790202150881L1400.674057100291,-919.938758760991L1402.0207247621786,-921.3795992925213L1400.8848131356756,-924.2800196635787L1397.514630631615,-924.7703205491212L1395.935063583705,-927.1824909628092L1395.5549154052137,-929.0617823396774L1397.4215662626589,-930.6135152311574L1396.071182718185,-931.8976249620139L1398.454850713506,-933.5547176015568L1395.9093999470274,-935.3853924203763L1396.2039620839078,-936.6185271197746L1395.2256010311269,-938.759774870234L1395.5959727438603,-939.6170247258535L1394.2464099340427,-940.9077949833459L1395.0628366697097,-942.2463590525529L1393.4198237596415,-942.3045333730506L1391.7690997297443,-945.0912715811191L1392.5849953140614,-946.429114658315L1391.3135486329948,-947.344665014768L1390.7075994149363,-950.3420060349983L1389.6695682671043,-950.1322797946195L1389.0054526822296,-948.0441037373319L1388.4838072751816,-947.9389289084752L1387.878243973447,-950.9432950284431L1385.2008402115866,-950.7951895332756L1386.012048839048,-952.1304771187226L1384.2211850908602,-955.6700642740984L1385.0313211127548,-957.0048743063023L1383.3926287090662,-959.7930545913034L1382.276692178827,-959.9594804169794L1382.4199826200143,-961.9408758542347L1381.155363830491,-962.8514225698748L1381.449263094837,-964.0818009324264L1380.108678327722,-965.3746398813876L1380.5466711019276,-968.5785893115667L1376.3862275880526,-973.2021676733257L1377.5617925671315,-975.3886101797091L1377.5538263626854,-978.118412574144L1378.7329825460656,-980.2988048228212L1379.4016195950157,-979.6527675748434L1380.4461490223541,-977.1382658002885L1381.186106932299,-976.1162960438003L1383.6265366164257,-977.3886429003057L1386.490805295875,-981.8638815699599L1387.1459456647226,-983.9482179530448L1385.4415950808889,-984.3832783545895L1385.6551772889102,-985.987503903579L1382.2547676623021,-986.8533151233416L1382.4689746281406,-988.4571270362344L1380.8424340462032,-988.518899306765L1381.5616817837604,-992.9477223887009L1383.3950049653276,-994.4887145302248L1383.0156083494758,-996.3620590057953L1383.5316494745798,-996.4666006407042L1383.517356991198,-999.1866553648999L1383.8050900497478,-1000.4149506444478L1385.9387842011838,-1000.4583644845725L1388.264522622303,-1004.8251570610055L1389.1208592258615,-1008.5098799554135L1390.3548248299746,-1010.3151244018402L1397.3145634470575,-1012.9164487709552L1397.2336014831517,-1021.0825816450617L1398.9429765343693,-1025.718657212254L1398.1249632862412,-1027.108499126025L1399.9371456581066,-1028.654263038308L1400.2478359274583,-1027.1592940075304L1405.367388771604,-1028.2263474716844L1406.778413649121,-1026.5713516724757L1408.3160103331777,-1026.8934045911858L1414.8888773479173,-1033.7315056413745L1415.596134481139,-1035.4415684305823L1424.852924700624,-1042.0869966222845L1427.6594037411114,-1036.4510380170914L1438.4677991714143,-1038.3923249455336Z",
"c2304":"M1632.9219393730427,-1152.0610088057488L1637.2918145274612,-1149.689414888586L1639.571347339598,-1147.1581541722528L1644.4482034636492,-1144.9264626002637L1646.040099546951,-1142.9986022152177L1647.038220278162,-1143.2686242937252L1648.932712986708,-1146.1404921218943L1652.1181268598916,-1146.2243032249048L1652.8174105155526,-1147.590573910186L1651.6205324177226,-1148.0535650261556L1651.7179181467834,-1151.6288482113985L1650.5220235006416,-1152.091914794676L1651.717912202448,-1153.593009911642L1651.0201978163984,-1154.1914727094484L1652.2133183143983,-1155.6992218931325L1655.2944513714401,-1156.1461391307093L1655.4909700771723,-1157.382800783144L1656.9786113421976,-1157.789962740943L1656.677222874991,-1158.8903930131735L1657.8727580015457,-1158.4293114437419L1659.058019585323,-1159.9375291219696L1661.0533051946277,-1158.5135827059894L1663.2442593209164,-1158.3274083878666L1664.9253758679488,-1159.974344338031L1669.3942158516845,-1161.2096737511654L1670.868996361502,-1163.5918203524413L1672.359002362054,-1164.0055596872257L1673.0484349895073,-1165.374125823001L1675.2338605865075,-1165.1930044122585L1676.4432961614334,-1162.7736090851206L1676.0619493319393,-1160.298246997871L1674.8791019837752,-1158.791660004618L1674.2919726447733,-1157.0490081238213L1675.0050078185448,-1154.4828714391508L1672.1421768343878,-1149.3518566379112L1672.0498980505758,-1147.7465919757312L1674.7635077995358,-1143.7651105759041L1676.9584880475772,-1143.5836894904724L1677.8632216669143,-1142.261403979746L1683.9752040067165,-1139.614367360326L1687.4916567514458,-1136.648773930271L1690.0118144286275,-1133.404826480959L1693.2727735107983,-1125.6180179133066L1695.7903165110774,-1124.3516289660622L1701.794841710664,-1126.0417684670579L1705.4694475857527,-1130.2430410677716L1711.5702212556475,-1131.5799898281603L1713.7535428201672,-1133.3917210443421L1719.460266864455,-1134.2318067585663L1721.8261464223892,-1129.7618328175618L1723.9292826571636,-1129.9694462884072L1727.4793921655123,-1134.5562225878716L1733.215883345956,-1133.4450599939485L1735.8928049565782,-1135.4133676935785L1739.3144606022715,-1134.8210382996556L1740.2076887962387,-1135.4786780498882L1741.3492026675597,-1138.9821159281864L1744.5559812153078,-1139.1260368973094L1749.3306113059057,-1141.3225880403895L1751.9300325968695,-1141.6908543941267L1753.170912599772,-1144.8392372201956L1754.9454065921723,-1146.158765407857L1764.1740160732284,-1146.115745044196L1763.2195854301083,-1143.8498280168146L1762.0530216531458,-1142.3095213986346L1763.4171567190538,-1139.5326970127212L1762.572693650811,-1136.9018847110376L1762.332662961488,-1134.045574642954L1760.417006654185,-1129.5062618613167L1759.1051404723528,-1124.7488265226125L1757.5319832075327,-1122.6930040747511L1752.4542881557825,-1119.6079707306374L1749.587146965223,-1116.3885721522063L1749.5136183563038,-1114.7761809116892L1750.4781723807791,-1111.4784210276953L1749.7174129752611,-1108.478637353346L1745.8036058516277,-1106.9395722075592L1739.7446855626802,-1107.168058565291L1736.9680545682209,-1103.582240698386L1731.033235501428,-1101.4750013624744L1725.4775581163162,-1101.868322266747L1724.8896580840942,-1100.111515010572L1722.688074332015,-1098.2914269982055L1720.5009825367592,-1094.4986771461442L1712.608923682855,-1095.4292105577679L1710.6987846063485,-1094.492795088973L1709.200436276677,-1092.0934134279578L1701.9198461094045,-1092.8178781633724L1702.7125396735023,-1095.8161497443398L1702.0018454665305,-1096.4099820043823L1700.7780813214138,-1098.8353573340453L1693.2298722770147,-1094.7456644574024L1688.686653839396,-1095.4650594864415L1686.6681203706664,-1096.8864928592125L1682.0335189018947,-1094.0220125286944L1689.8189147501853,-1087.4721453070313L1688.404160389671,-1086.6842386738913L1688.206936388537,-1083.4593206749075L1684.2682209164357,-1080.0024974081355L1681.7384104523123,-1081.2806126975154L1677.995351457319,-1079.0656967052446L1678.1952633487656,-1078.3354462182313L1677.2875078491854,-1077.6909646949227L1677.6906909561246,-1076.216858926025L1678.5962638274893,-1074.8800717553584L1677.2813692876575,-1073.7282336142382L1669.5889802998383,-1074.0090088994218L1666.2561205640188,-1076.2646925336742L1666.263277314695,-1078.2455073612348L1664.5558973704399,-1080.5530355739972L1659.1009104191453,-1080.6545587285773L1656.4803395640208,-1082.3217571408686L1654.966574478691,-1081.9147721848265L1653.2631388473412,-1084.217638691954L1652.1524548304217,-1084.314946629302L1649.2328129443522,-1085.1138386311598L1651.5591291808566,-1086.5274101696123L1651.2624927028119,-1087.6335436949046L1651.57013538937,-1088.5064936217398L1648.0506752697672,-1089.5321343308692L1647.052395195064,-1091.240473832979L1649.5836836428002,-1093.8936874104863L1648.086755468881,-1095.4605049084619L1648.8936319833283,-1096.4668344480888L1647.6917808049072,-1096.9346912662977L1646.80499943137,-1100.2444757220883L1647.5120239380303,-1101.6187395266259L1649.4283891891478,-1102.528070547251L1647.314426745729,-1102.355563535422L1646.5189650860534,-1103.3269332496589L1647.3438543076293,-1108.2791375500572L1645.241940245987,-1110.0836987033942L1645.1538709921742,-1112.4211630817324L1638.0514116124318,-1114.8540012155354L1637.5601814116947,-1116.6951092346426L1635.661315266981,-1117.7663386841496L1634.9764160790355,-1120.336892014927L1632.8761395469091,-1120.1720708086143L1632.582394404281,-1121.2766011211377L1632.594230053423,-1123.2506965366556L1630.8944475702883,-1123.5870476746773L1629.6128053953826,-1126.392084876322L1629.5150536413046,-1126.7601621254544L1632.51595514824,-1127.5582374377616L1634.1265954883213,-1129.5640300956409L1631.635769190655,-1130.863275647476L1630.9600410468715,-1135.411090376218L1630.2659417483542,-1136.0068842207625L1631.676633284127,-1138.7463748575958L1632.4894115949824,-1141.7134879446164L1631.1066057687872,-1144.8886491224926L1629.7165580414282,-1146.0926459988493L1632.4108742422368,-1147.9866334216772Z",
"c2309":"M1689.3702665485532,-1009.2776045232608L1692.3461163410668,-1008.4989889684462L1698.8134825152188,-1009.0821409319553L1700.4512057603977,-1007.146269928568L1705.6853486579275,-1006.1996630155018L1707.8399483008468,-1004.4145179954508L1713.7024312578874,-1003.2504926937288L1713.1885392040192,-1007.0871809232046L1715.865013285796,-1007.4321187943171L1716.073561017238,-1008.6767055001858L1720.9002554315612,-1011.2154864017803L1723.2672896302374,-1010.6827471306499L1728.193579203663,-1012.8602326499588L1728.6976150069165,-1016.9842777232247L1728.3880453353106,-1018.0845680165867L1729.824625538479,-1018.8872388254424L1728.1683790757945,-1022.8008129698258L1727.2419312598975,-1024.1252476380564L1728.6644917218666,-1026.9146956082195L1728.048024362087,-1027.139013370295L1727.426263758997,-1029.3450018567123L1730.9025734254744,-1030.7244225370207L1731.4051105838073,-1032.8572575425455L1731.2908446258903,-1035.2136403038658L1732.825421067307,-1035.648366397445L1733.5319843509985,-1037.0359546296886L1734.6592653983203,-1036.9577639994238L1734.4597948205371,-1035.7138070315361L1734.5643945015638,-1035.3453022434705L1737.2266759724096,-1035.7035855569618L1742.4637017786868,-1032.8212763135439L1745.8324017329492,-1034.5741576174144L1748.4050690319418,-1033.3258662569556L1751.9823848304702,-1034.3535833928597L1752.918001140141,-1033.027929058682L1753.7294128569454,-1034.0591060414938L1756.4955565232242,-1034.0592977169285L1757.5389433233815,-1032.366292543963L1756.9382767046006,-1030.6045633886533L1758.6198822457459,-1026.7017366035507L1760.3637375673736,-1026.414813938163L1762.3277391731563,-1025.386736892467L1767.93587235985,-1029.0029156567568L1768.7676154805768,-1028.0545336311739L1768.6040275959808,-1024.8127894102872L1770.0534956243632,-1023.6373300858777L1769.13747944946,-1022.9787225039067L1767.1277402270625,-1018.4018765753144L1765.8052822764146,-1017.2199056087657L1765.8231179400464,-1015.2359318180597L1762.957171842305,-1013.6085088679581L1762.0175536772244,-1014.9339672190099L1760.174260062148,-1013.6038954102132L1757.290450819047,-1013.970909461543L1755.3447822915994,-1013.012788226793L1755.4654230716033,-1010.6532783496202L1753.5133439912745,-1009.6945579023445L1753.225923749184,-1006.8265222849711L1751.6933995853135,-1004.3932765225686L1754.8197977149666,-999.3086048427281L1750.8035002093504,-997.762484304368L1749.1599890759744,-995.6983037826062L1748.9635630122937,-994.445424803459L1750.1996509085484,-994.0064323574979L1749.0891374272783,-988.11117498198L1747.8473693032192,-988.5493678188934L1747.5329277921473,-989.6571455985104L1744.5409388541593,-988.4100284014226L1743.1935627636917,-989.2254751893458L1742.3732481174918,-988.1957961539786L1740.9220455318218,-989.3812479837268L1738.5504205544137,-987.9147692959202L1735.7573513223576,-987.9262147608524L1733.4866670752097,-990.0716389107008L1730.694249388694,-988.1002819533303L1731.009447447263,-984.9999726954329L1729.2496938017082,-983.3122257815426L1727.8017853853164,-984.5020313251789L1727.4953531690585,-983.6195187218157L1725.3221561481225,-983.4122454054316L1723.8769963252414,-982.6116307118191L1721.1902740981986,-984.2552959184552L1720.1553441215779,-983.9681139170482L1719.3247464677631,-980.9497864534374L1718.8069072335452,-980.8063814395505L1718.281021182277,-978.6766245543604L1714.55662371786,-978.0462581805232L1712.2952425774877,-980.2029882069148L1711.2503158162276,-977.9248587500479L1710.1122234049851,-978.0101196910707L1704.7549011448025,-981.3167631619679L1704.027756345061,-979.9240843591006L1702.966739300023,-975.6551024011512L1700.4938475694846,-976.5720764771634L1698.7513254504786,-978.8820375849925L1696.1654807575615,-978.1787972713189L1695.7648775718021,-979.6535141359807L1693.273335475103,-978.5870448777086L1691.8017077326226,-988.1125221778254L1692.5341137615887,-989.5037839387237L1691.3013612441346,-989.956949375455L1691.215330273719,-992.3182968977703L1689.6803974052466,-993.8889443513067L1687.2206674156096,-994.8047371969703L1686.0034236933482,-997.2562833734219L1685.4192862211128,-1001.4603809750406L1684.7181840014448,-1004.050774746431Z"
},
names: {
"c2311":"黑河市",
"c2327":"大兴安岭地区",
"c2301":"哈尔滨市",
"c2302":"齐齐哈尔市",
"c2310":"牡丹江市",
"c2312":"绥化市",
"c2307":"伊春市",
"c2308":"佳木斯市",
"c2303":"鸡西市",
"c2305":"双鸭山市",
"c2306":"大庆市",
"c2304":"鹤岗市",
"c2309":"七台河市"
},
coordinate: {
"c2311":[1493.027638420726,-1166.313401974779,1493.027638420726,-1186.313401974779],
"c2327":[1315.7559948652656,-1332.8581166495303,1315.7559948652656,-1352.8581166495303],
"c2301":[1580.2230644202655,-950.6373010849445,1595.2230644202655,-930.6373010849445],
"c2302":[1399.894476567532,-1058.21377192575,1399.894476567532,-1044.21377192575],
"c2310":[1693.1849337425742,-888.2161162419809,1693.1849337425742,-908.2161162419809],
"c2312":[1490.8690890381042,-1000.6629003533183,1512.8690890381042,-1013.6629003533183],
"c2307":[1608.2749566622063,-1100.9944569689872,1608.2749566622063,-1119.9944569689872],
"c2308":[1798.4502941265396,-1163.078023165752,1788.4502941265396,-1143.078023165752],
"c2303":[1800.875993634046,-999.6318089744996,1815.875993634046,-1017.6318089744996],
"c2305":[1832.3006490411237,-1109.6731714492512,1832.3006490411237,-1096.6731714492512],
"c2306":[1412.1542526432265,-980.0267345636366,1427.1542526432265,-968.0267345636366],
"c2304":[1700.435565261481,-1113.2181839622335,1669.435565261481,-1118.2181839622335],
"c2309":[1720.7405461350033,-998.6289900445761,1740.7405461350033,-1011.6289900445761]
}
};
| 2,266.277778 | 12,662 | 0.892433 |
a1b8c3cddd8e85726bb40d271c1fae952cc3bd33 | 13,491 | js | JavaScript | src/jquery-bootstrap-popover.js | FCOO/fcoo-bootstrap | 8c7133bc34e9ab370dbe8b07206638828cc6c364 | [
"MIT"
] | null | null | null | src/jquery-bootstrap-popover.js | FCOO/fcoo-bootstrap | 8c7133bc34e9ab370dbe8b07206638828cc6c364 | [
"MIT"
] | 7 | 2020-02-07T16:56:02.000Z | 2021-01-05T14:58:08.000Z | src/jquery-bootstrap-popover.js | FCOO/jquery-bootstrap | f8fe0b950900a26bbbdcd75f793d1d428aa4d770 | [
"MIT"
] | null | null | null | /****************************************************************************
jquery-bootstrap-popover.js,
(c) 2017, FCOO
https://github.com/fcoo/jquery-bootstrap
https://github.com/fcoo
****************************************************************************/
(function ($, window/*, document, undefined*/) {
"use strict";
/**********************************************************
To sequre that all popovers are closed when the user click or
tap outside the popover the following event are added
**********************************************************/
var popoverClassName = 'has-popover',
popoverCloseOnClick = 'popover-close-on-click',
no_popoverCloseOnClick = 'no-' + popoverCloseOnClick;
$.bsPopover_closeAll = function( checkFunc ){
$('.'+popoverClassName).each(function () {
var $this = $(this);
if (!checkFunc || checkFunc($this))
$this.popover('hide');
});
};
$('body')
.on("touchstart.jbs.popover mousedown.jbs.popover", function( event ){
$.bsPopover_closeAll( function( $this ){
// hide any open popover when the click is not inside the body of a popover
// return (!$this.is(event.target) && (!$this.has(event.target) || $this.has(event.target).length === 0) && (!$('.popover').has(event.target) || $('.popover').has(event.target).length === 0));
return (!$this.is(event.target) && $this.has(event.target).length === 0 && $('.popover').has(event.target).length === 0);
});
})
//Close all popover on esc
.on('keydown', function( event ){
if (event.altKey || event.ctrlKey || event.metaKey)
return;
if (event.keyCode === 27)
$.bsPopover_closeAll();
});
/***********************************************************
Extend the $.fn.popover.Constructor.prototype.setContent to
also construct footer
***********************************************************/
var Selector = {
FOOTER: '.popover-footer'
};
$.fn.popover.Constructor.prototype.setContent = function (setContent) {
return function () {
//Add footer content
var $tip = $(this.getTipElement());
this.setElementContent($tip.find(Selector.FOOTER), this.config.footer);
//Original function/method
setContent.apply(this, arguments);
};
} ($.fn.popover.Constructor.prototype.setContent);
/**********************************************************
bsPopover( options ) - create a Bootstrap-popover
options
header : See jquery-bootstrap-header.js
close : [Boolean] - show close cross in header
trigger : [String] 'click' How popover is triggered - click | hover | focus | manual
vertical : [Boolean]
closeOnClick: [Boolean] false - if true the popover will close when it is clicked
placement : [String] "top", "bottom", "left", "right". Default = 'right' for vertical: false and 'top' for vertical:true
content : The content (function, DOM-element, jQuery-object)
footer : {icon, text, link, title} or [] of {icon, text, link, title}
**********************************************************/
$.fn.bsPopover = function( options ){
options = $._bsAdjustOptions( options );
var $this = $(this),
$header = '',
$footer = '';
//Add header (if any)
if (options.header || options.close){
options.icons = options.icons || {};
options.headerClassName = 'popover-header-content';
if (options.close)
options.icons.close = {
onClick: function(){ $this.popover('hide'); }
};
$header =
$('<div/>')
.addClass( no_popoverCloseOnClick )
._bsHeaderAndIcons( options );
}
if (options.footer)
$footer =
$('<div/>')
.addClass( 'w-100 ' + no_popoverCloseOnClick )
._bsAddHtml( options.footer );
//If trigger == 'context' or 'contextmenu' use 'manual' and add event
if ((options.trigger == 'context') || (options.trigger == 'contextmenu')){
options.trigger = 'manual';
this.on('contextmenu.jbs.popover', function(){
$this.popover('show');
return false;
});
}
var popoverOptions = {
trigger : options.trigger || 'click', //or 'hover' or 'focus' ORIGINAL='click'
toggle : options.toggle || 'popover',
html : true,
placement: options.placement || (options.vertical ? 'top' : 'right'),
container: 'body',
template : '<div class="popover ' + (options.small ? ' popover-sm' : '') + ' ' + (options.closeOnClick ? popoverCloseOnClick : no_popoverCloseOnClick) + '" role="tooltip">'+
'<div class="popover-header"></div>' +
'<div class="popover-body"></div>' +
'<div class="popover-footer"></div>' +
'<div class="arrow"></div>' +
'</div>',
title : $header,
content : options.content,
footer : $footer
};
if (options.delay)
popoverOptions.delay = options.delay;
return this.each(function() {
var $this = $(this);
$this.addClass( popoverClassName );
//This event fires immediately when the show instance method is called.
$this.on('show.bs.popover', popover_onShow );
//This event is fired when the popover has been made visible to the user (will wait for CSS transitions to complete).
$this.on('shown.bs.popover', popover_onShown );
//This event is fired immediately when the hide instance method has been called.
$this.on('hide.bs.popover', popover_onHide );
//This event is fired when the popover has finished being hidden from the user (will wait for CSS transitions to complete).
$this.on('hidden.bs.popover', popover_onHidden );
$this.data('popover_options', options);
$this.popover( popoverOptions );
if (options.postCreate)
options.postCreate( options.content );
});
};
function popover_onShow(){
//If popover is opened by hover => close all other popover
var $this = $(this),
thisPopoverId = $this.attr('aria-describedby');
if ($this.data('popover_options').trigger == 'hover')
$.bsPopover_closeAll( function( $this2 ){
return $this2.attr('aria-describedby') != thisPopoverId;
});
}
function popover_onShown(){
//Find the popover-element. It has id == aria-describedby
var $this = $(this),
popoverId = $this.attr('aria-describedby'),
options = $this.data('popover_options'),
popover = $this.data('bs.popover');
this._$popover_element = popoverId ? $('#' + popoverId) : null;
if (this._$popover_element){
//Translate content
this._$popover_element.localize();
//On click: Check if the popover needs to close.
this._$popover_element.on('click.jbs.popover', function(event){
//Find first element with class 'popover-close-on-click' or 'no-popover-close-on-click'
var $elem = $(event.target);
while ($elem.length){
if ($elem.hasClass(popoverCloseOnClick)){
$this.popover('hide');
break;
}
if ($elem.hasClass(no_popoverCloseOnClick))
break;
$elem = $elem.parent();
}
});
//If the popover was opened by hover => prevent it from closing when hover the popover itself
if (options.trigger == 'hover'){
var _clearTimeout = function(){
//Stop the hide by timeout
if (popover._timeout){
window.clearTimeout(popover._timeout);
popover._timeout = 0;
}
};
$this.on('mouseenter.jbs.popover', _clearTimeout );
this._$popover_element.on('mouseenter.jbs.popover', _clearTimeout );
this._$popover_element.on('mouseleave.jbs.popover', function(){
//If not delay is given => close popover
if (!popover.config.delay || !popover.config.delay.hide) {
popover.hide();
return;
}
//Else: Set timeout to close popover
popover._timeout = window.setTimeout(
function(){ popover.hide(); },
popover.config.delay.hide
);
});
}
}
}
function popover_onHide(){
$(this).off('mouseenter.jbs.popover');
if (this._$popover_element)
this._$popover_element.off('click.jbs.popover mousedown.jbs.popover mouseenter.jbs.popover mouseleave.jbs.popover');
}
function popover_onHidden(){
//Reset this._$popover_element
this._$popover_element = null;
}
//adjustItemOptionsForPopover - Adjust class-name for buttons/items in a popover
function adjustItemOptionsForPopover(options, listId){
var result = $.extend({}, options);
$.each(options[listId], function(index, itemOptions){
var closeOnClickClass = '';
//If item has individuel clickOnClick => use it
if ($.type(itemOptions.closeOnClick) == 'boolean')
closeOnClickClass = itemOptions.closeOnClick ? popoverCloseOnClick : no_popoverCloseOnClick;
else
if (!itemOptions.id && !itemOptions.list)
closeOnClickClass = no_popoverCloseOnClick;
itemOptions.class = itemOptions.class || '';
itemOptions.class = (itemOptions.class ? itemOptions.class + ' ' : '') + closeOnClickClass;
//Adjust child-list (if any)
result[listId][index] = adjustItemOptionsForPopover(itemOptions, listId);
});
return result;
}
/**********************************************************
bsButtonGroupPopover( options ) - create a Bootstrap-popover with buttons
**********************************************************/
$.fn.bsButtonGroupPopover = function( options, isSelectList ){
//Setting bsButton.options.class based on bsPopover.options.closeOnClick
if (!isSelectList){
options = adjustItemOptionsForPopover(options, 'buttons');
options.returnFromClick = true;
}
var $content = isSelectList ? $.bsSelectList( options ) : $.bsButtonGroup( options );
if (isSelectList)
this.data('popover_radiogroup', $content.data('selectlist_radiogroup') );
return this.bsPopover( $.extend( options, { content: $content }) );
};
/**********************************************************
bsRadioButtonPopover( options ) - create a Bootstrap-popover with radio-buttons
Default is closeOnClick = true
**********************************************************/
$.fn.bsSelectListPopover = function( options ){
return this.bsButtonGroupPopover( $.extend(
{ closeOnClick: true },
options,
{
postOnChange : $.proxy( selectListPopover_postOnChange, this ),
postCreate : $.proxy( selectListPopover_postCreate, this ),
}), true );
};
function selectListPopover_postCreate( content ){
//Update this with the selected items html
$.proxy( selectListPopover_postOnChange, this )( content.children('.active') );
}
function selectListPopover_postOnChange( $item ){
var options = this.data('popover_options');
if ($item && $item.length && options && options.syncHtml)
//Update owner html to be equal to $item
this.html( $item.html() );
}
/**********************************************************
bsMenuPopover( options ) - create a Bootstrap-popover with a bsMenu
**********************************************************/
$.fn.bsMenuPopover = function( options ){
options = adjustItemOptionsForPopover(options, 'list');
options.content = $.bsMenu(options);
this.data('popover_menu', options.content);
return this.bsPopover( options );
};
$.fn.bsMenuPopover_getValues = function(){
return this.data('popover_menu')._bsMenu_getValues();
};
$.fn.bsMenuPopover_setValues = function( values ){
this.data('popover_menu')._bsMenu_setValues(values);
};
}(jQuery, this, document)); | 40.032641 | 207 | 0.512712 |
a1ba07f708f6455c2faa8166c1c0a5fc931f667f | 831 | js | JavaScript | sagas/todos.test.js | pmdarrow/react-todo | 94532d44434826cf1917f5f2422e534e24061ea8 | [
"MIT"
] | 4 | 2017-08-01T07:42:31.000Z | 2019-02-20T10:47:08.000Z | sagas/todos.test.js | pmdarrow/react-todo | 94532d44434826cf1917f5f2422e534e24061ea8 | [
"MIT"
] | null | null | null | sagas/todos.test.js | pmdarrow/react-todo | 94532d44434826cf1917f5f2422e534e24061ea8 | [
"MIT"
] | null | null | null | import { call, put } from 'redux-saga/effects';
import { addTodoSucceeded, addTodoFailed } from '../actions/todos';
import { addTodo } from './todos';
import api from '../services/api';
describe('todos sagas', () => {
it('should call the addTodo API function succesfully', () => {
const gen = addTodo();
expect(gen.next().value).toEqual(call([api, api.addTodo]));
expect(gen.next('mockId').value).toEqual(
put(addTodoSucceeded({ id: 'mockId' }))
);
expect(gen.next().done).toBe(true);
});
it('should call the addTodo API function and handle failure', () => {
const gen = addTodo();
expect(gen.next().value).toEqual(call([api, api.addTodo]));
expect(gen.throw('mock error').value).toEqual(
put(addTodoFailed('mock error'))
);
expect(gen.next().done).toBe(true);
});
});
| 33.24 | 71 | 0.629362 |
a1babd380e13b60de7e225b7bbf5d67be19172a7 | 475 | js | JavaScript | bin/store/startup.js | rayk/criticli | b0ae3b9e2b93061a5df42c796840171f2618da5b | [
"MIT"
] | null | null | null | bin/store/startup.js | rayk/criticli | b0ae3b9e2b93061a5df42c796840171f2618da5b | [
"MIT"
] | null | null | null | bin/store/startup.js | rayk/criticli | b0ae3b9e2b93061a5df42c796840171f2618da5b | [
"MIT"
] | null | null | null | /**
* Startup Module
*/
const env = require('../env/config');
const pkg = require('../../package');
/**
* Returns the state object found in the current work path.
*
* Startup functions have and transforms between version.
* @param version
*/
const maybeConfig = async version => {
return await env
.getConfig(process.cwd())
.then(result => {
return result;
})
.catch(err => {
return err;
});
};
module.exports = {
maybeConfig
};
| 16.964286 | 59 | 0.606316 |
a1bad4e268095324992aa7f30f51b0463f57c0d5 | 1,303 | js | JavaScript | commands/moderation/clear.js | sadnothappy/test | b6ef25def7fbc24a1524c3ee7b5c9c72c6443e45 | [
"Apache-2.0"
] | 5 | 2021-05-16T13:51:29.000Z | 2021-12-21T20:54:10.000Z | commands/moderation/clear.js | sadnothappy/test | b6ef25def7fbc24a1524c3ee7b5c9c72c6443e45 | [
"Apache-2.0"
] | null | null | null | commands/moderation/clear.js | sadnothappy/test | b6ef25def7fbc24a1524c3ee7b5c9c72c6443e45 | [
"Apache-2.0"
] | 3 | 2021-03-20T19:54:25.000Z | 2021-05-23T20:27:11.000Z | const Discord = require("discord.js");
module.exports = {
name: "clear",
aliases: ["purge"],
description: "Delete messages from a chat",
category: "Moderation",
usage: "clear <amount>",
cooldown: 3,
run: async (client, message, args) => {
if(!message.member.hasPermission("MANAGE_MESSAGES"))
return message.channel.send("<:HBminus:783351288515657728> | You don't have `MANAGE_MESSAGES` permission!")
if(!message.guild.me.permissions.has("MANAGE_MESSAGES"))
return message.channel.send('<:HBminus:783351288515657728> | I need `MANAGE_MESSAGES` permission!');
try {
let deleteAmount;
if(isNaN(args[0]) || parseInt(args[0]) <= 0) return message.channel.send("<:HBminus:783351288515657728> | Please enter a number");
if(parseInt(args[0]) > 100) return message.channel.send("<:HBminus:783351288515657728> |The amount cannot be more than 100");
deleteAmount = parseInt(args[0]);
message.channel.bulkDelete(deleteAmount + 1, true);
message.channel.send(`<:HBchecked:783351288171593728> | Successfully Deleted **${deleteAmount}** Messages!`).then(x => x.delete({timeout: 5000}));
} catch (err) {
message.channel.send(`<:HBwarning:783351287944970251> | Due to discord limitations, I cannot delete messages that are more than 14 days old`).then(x => x.delete({timeout: 5000}));
}
}
} | 36.194444 | 181 | 0.720645 |
a1baf7b3d5233c43cfb4abf3c55f15deba8b409b | 130 | js | JavaScript | auth0-variables.js | JasonBao-BB/Lovoco-Life | 2cde403d3e5d58be572370849e2cf64193f47db3 | [
"MIT"
] | null | null | null | auth0-variables.js | JasonBao-BB/Lovoco-Life | 2cde403d3e5d58be572370849e2cf64193f47db3 | [
"MIT"
] | null | null | null | auth0-variables.js | JasonBao-BB/Lovoco-Life | 2cde403d3e5d58be572370849e2cf64193f47db3 | [
"MIT"
] | null | null | null | var AUTH0_CLIENT_ID='aVaEKNo1bNVQe8AGde1LdY4YIPMPJw9S';
var AUTH0_DOMAIN='lovoco.auth0.com';
var AUTH0_CALLBACK_URL=location.href; | 43.333333 | 55 | 0.861538 |
a1bba3523cbf213b0abc50af3e23ed3be4173f69 | 224 | js | JavaScript | polymath-apps/packages/polymath-ui/src/images/icons/Play.js | Morpheuslabs-io/sto-as-service-app-ref | 54c92e24f2368d2e8dfe85f07eae2e59948bcc62 | [
"MIT"
] | 17 | 2018-09-22T15:40:13.000Z | 2021-09-21T13:49:35.000Z | polymath-apps/packages/polymath-ui/src/images/icons/Play.js | Morpheuslabs-io/sto-as-service-app-ref | 54c92e24f2368d2e8dfe85f07eae2e59948bcc62 | [
"MIT"
] | 169 | 2018-09-19T16:30:52.000Z | 2020-09-30T20:44:45.000Z | polymath-apps/packages/polymath-ui/src/images/icons/Play.js | Morpheuslabs-io/sto-as-service-app-ref | 54c92e24f2368d2e8dfe85f07eae2e59948bcc62 | [
"MIT"
] | 13 | 2018-09-18T16:55:45.000Z | 2021-08-29T13:33:47.000Z | import React from 'react';
const SvgPlay = props => (
<svg width="1em" height="1em" {...props}>
<path d="M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zM5 11V5l6.6 3L5 11z" />
</svg>
);
export default SvgPlay;
| 22.4 | 87 | 0.598214 |
a1bc2c65e2816a277af0259a4a009c2ded13b56f | 355 | js | JavaScript | models/firm.js | dkapper01/TitanHub | ed7e238319f16022cb2d7f2b7586d428182556a9 | [
"CC0-1.0"
] | null | null | null | models/firm.js | dkapper01/TitanHub | ed7e238319f16022cb2d7f2b7586d428182556a9 | [
"CC0-1.0"
] | null | null | null | models/firm.js | dkapper01/TitanHub | ed7e238319f16022cb2d7f2b7586d428182556a9 | [
"CC0-1.0"
] | null | null | null | var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var FirmSchema = new Schema({
name: {type: String, required: true, min: 3, max: 100}
});
// Virtual for this firm instance URL.
FirmSchema
.virtual('url')
.get(function () {
return '/data/firm/'+this._id;
});
// Export model.
module.exports = mongoose.model('Firm', FirmSchema);
| 19.722222 | 58 | 0.673239 |
a1bcc38b7fc93aa4d7bd412ab67b93d04c225e36 | 2,323 | js | JavaScript | src/playground.js | justinobney/redux-learning-1 | 9ffbb84f673976190534918118b7432494fd8698 | [
"MIT"
] | null | null | null | src/playground.js | justinobney/redux-learning-1 | 9ffbb84f673976190534918118b7432494fd8698 | [
"MIT"
] | null | null | null | src/playground.js | justinobney/redux-learning-1 | 9ffbb84f673976190534918118b7432494fd8698 | [
"MIT"
] | null | null | null | import React, {Component} from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {Row, Col} from 'react-bootstrap';
class Playground extends Component {
displayName = 'Playground component'
renderOtherDdl() {
const state = this.props.playgroundState;
if (state.newOpts.length) {
return (
<select>
{state.newOpts.map(
(opt)=><option key={opt.id} value={opt.id}>
{opt.name}
</option>
)}
</select>
);
}
}
render() {
const state = this.props.playgroundState;
const formOptions = this.props.formOptions;
return (
<Row>
<Col xs={12}>
<h1>{state.title}</h1>
<select value={state.ddl1} onChange={formOptions.HANDLE_OPTIONS1_CHANGE}>
{state.options1.map(
(opt)=><option key={opt.id} value={opt.id}>
{opt.name}
</option>
)}
</select>
{this.renderOtherDdl()}
</Col>
</Row>
);
}
}
const initialState = {
title: 'This is kitten sparta!',
ddl1: null,
ddl2: null,
options1: [
{id: 1, name: 'Option 1'},
{id: 2, name: 'Option 2'},
{id: 3, name: 'Option 3'},
{id: 4, name: 'Option 4'}
],
options2: {
1: {options: [{id: 1, name: '1 - Option 1'}]},
2: {options: [{id: 2, name: '2 - Option 2'}]},
3: {options: [{id: 3, name: '3 - Option 3'}]},
4: {options: [{id: 4, name: '4 - Option 4'}]}
},
newOpts: []
};
let OPTIONS1_CHANGE = 'OPTIONS1_CHANGE';
function mapStateToProps(reducers) {
return {playgroundState: reducers.playgroundState};
}
function mapDispatchToProps(dispatch) {
return {
formOptions: bindActionCreators({HANDLE_OPTIONS1_CHANGE}, dispatch)
};
}
function HANDLE_OPTIONS1_CHANGE(e) {
let {value} = e.target;
return {type: OPTIONS1_CHANGE, payload: value};
}
export function playgroundState(state = initialState, action) {
const {type} = action;
switch (type) {
case OPTIONS1_CHANGE:
state.ddl1 = action.payload;
let newOpts = state.options2[action.payload].options;
return Object.assign({}, state, {newOpts});
default:
return state;
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Playground);
| 24.978495 | 83 | 0.586741 |
a1bdafb3ff2a2517bf2ef7c62ba5fbb088269250 | 264 | js | JavaScript | src/components/Banner.js | ajscholz/madison-hills-website | c54a6d55c515d25c5f3ed9608bd1ad32444d6fac | [
"MIT"
] | null | null | null | src/components/Banner.js | ajscholz/madison-hills-website | c54a6d55c515d25c5f3ed9608bd1ad32444d6fac | [
"MIT"
] | 14 | 2020-04-22T21:15:51.000Z | 2022-02-28T02:56:26.000Z | src/components/Banner.js | ajscholz/madison-hills-website | c54a6d55c515d25c5f3ed9608bd1ad32444d6fac | [
"MIT"
] | null | null | null | import styled from 'styled-components';
export default styled.h1`
font-size: 2.25rem;
font-weight: bold;
color: var(--white);
text-align: center;
padding: 0 5vw;
max-width: 700px;
margin: 0;
@media (min-width: 400px) {
font-size: 3rem;
}
`;
| 17.6 | 39 | 0.643939 |
a1bdfdf3a343b30c0772972e1def0c21341dc1e1 | 2,056 | js | JavaScript | generators/scaffold/index.js | ericmcgregor/generator-meteorstarter | c67f9a35788817e2877eb0ffd8d982723602342d | [
"Apache-2.0"
] | null | null | null | generators/scaffold/index.js | ericmcgregor/generator-meteorstarter | c67f9a35788817e2877eb0ffd8d982723602342d | [
"Apache-2.0"
] | null | null | null | generators/scaffold/index.js | ericmcgregor/generator-meteorstarter | c67f9a35788817e2877eb0ffd8d982723602342d | [
"Apache-2.0"
] | null | null | null | 'use strict';
const Generator = require('yeoman-generator');
const chalk = require('chalk');
const yosay = require('yosay');
module.exports = class extends Generator {
setup() {
this.props = this.options.props;
console.log(this.props)
const startupPath = 'imports/startup/server'
const dbPath = 'imports/db'
const reducerPath = 'imports/redux/reducers/index.js'
//UPDATE REGISTER APIS
if( !this.fs.exists(this.destinationPath(startupPath+'/register-api.js')) ) {
this.fs.copyTpl(
this.templatePath('register-api.js'),
this.destinationPath(startupPath+'/register-api.js'),
{
collectionName: this.props.collectionName,
collectionVariable:this.props.collectionVariable
}
);
}
//UPDATE REGISTER LINKS
if( !this.fs.exists( this.destinationPath(dbPath+'/Links.js') ) ) {
this.fs.copyTpl(
this.templatePath('_db/Links.js'),
this.destinationPath(dbPath+'/Links.js'),
{
collectionName: this.props.collectionName,
collectionVariable:this.props.collectionVariable
}
);
}
//UPDATE REGISTER EXPOSURES
if( !this.fs.exists( this.destinationPath(dbPath+'/Exposures.js') ) ) {
this.fs.copyTpl(
this.templatePath('_db/Exposures.js'),
this.destinationPath(dbPath+'/Exposures.js'),
{
collectionName: this.props.collectionName,
collectionVariable:this.props.collectionVariable
}
);
}
if(this.props.redux) {
//UPDATE REDUCERS
if( !this.fs.exists( this.destinationPath(reducerPath) ) ) {
console.log('scaffolding reducer')
this.fs.copyTpl(
this.templatePath('_reducers/index.js'),
this.destinationPath(reducerPath),
{
collectionName: this.props.collectionName,
collectionVariable:this.props.collectionVariable
}
);
}
}
}
install() {
}
};
| 27.052632 | 81 | 0.598735 |
a1be34732c2abccc5e89f868e0d81a03f584b6f4 | 1,024 | js | JavaScript | src/apps/crm/db/migrations/20191016194120_create_enrollments.js | ccetc/mahaplatform.com | 6e8610fe6e835e071492784655dbb5502863d031 | [
"MIT"
] | null | null | null | src/apps/crm/db/migrations/20191016194120_create_enrollments.js | ccetc/mahaplatform.com | 6e8610fe6e835e071492784655dbb5502863d031 | [
"MIT"
] | 52 | 2019-10-28T15:38:35.000Z | 2022-02-28T04:23:48.000Z | src/apps/crm/db/migrations/20191016194120_create_enrollments.js | mahaplatform/mahaplatform.com | a96d8f7b12288c7cb01b036077182238c77d5b03 | [
"MIT"
] | null | null | null | const CreateEnrollment = {
databaseName: 'maha',
up: async (knex) => {
await knex.schema.createTable('crm_enrollments', (table) => {
table.increments('id').primary()
table.integer('team_id').unsigned()
table.foreign('team_id').references('maha_teams.id')
table.integer('workflow_id').unsigned()
table.foreign('workflow_id').references('crm_workflows.id')
table.integer('sms_campaign_id').unsigned()
table.foreign('sms_campaign_id').references('crm_sms_campaigns.id')
table.integer('voice_campaign_id').unsigned()
table.foreign('voice_campaign_id').references('crm_voice_campaigns.id')
table.integer('contact_id').unsigned()
table.foreign('contact_id').references('crm_contacts.id')
table.string('code')
table.specificType('actions', 'jsonb[]')
table.boolean('was_converted')
table.timestamps()
})
},
down: async (knex) => {
await knex.schema.dropTable('crm_enrollments')
}
}
export default CreateEnrollment
| 32 | 77 | 0.677734 |
a1beb8e5a1d1d3f484104f74c7d6188ccf6bc646 | 4,073 | js | JavaScript | src/components/periods/PeriodSelect.js | dhis2/maps-app | 3c1d09393aada129c73c96d228e0c92a51111337 | [
"BSD-3-Clause"
] | 12 | 2018-02-07T05:08:44.000Z | 2021-06-16T05:06:21.000Z | src/components/periods/PeriodSelect.js | dhis2/maps-app | 3c1d09393aada129c73c96d228e0c92a51111337 | [
"BSD-3-Clause"
] | 1,217 | 2018-04-24T07:48:35.000Z | 2022-03-25T07:08:52.000Z | src/components/periods/PeriodSelect.js | dhis2/maps-app | 3c1d09393aada129c73c96d228e0c92a51111337 | [
"BSD-3-Clause"
] | 7 | 2018-03-20T09:07:26.000Z | 2021-02-24T16:55:28.000Z | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import i18n from '@dhis2/d2-i18n';
import {
Button,
Tooltip,
IconChevronLeft24,
IconChevronRight24,
} from '@dhis2/ui';
import cx from 'classnames';
import { SelectField } from '../core';
import { getFixedPeriodsByType, filterFuturePeriods } from '../../util/periods';
import { getYear } from '../../util/time';
import styles from './styles/PeriodSelect.module.css';
class PeriodSelect extends Component {
static propTypes = {
periodType: PropTypes.string,
period: PropTypes.shape({
id: PropTypes.string.isRequired,
startDate: PropTypes.string,
}),
onChange: PropTypes.func.isRequired,
className: PropTypes.string,
errorText: PropTypes.string,
};
state = {
year: null,
periods: null,
};
componentDidMount() {
this.setPeriods();
}
componentDidUpdate(prevProps, prevState) {
const { periodType, period, onChange } = this.props;
const { year, periods } = this.state;
if (periodType !== prevProps.periodType) {
this.setPeriods();
} else if (periods && !period) {
onChange(filterFuturePeriods(periods)[0] || periods[0]); // Autoselect most recent period
}
// Change period if year is changed (but keep period index)
if (period && prevState.periods && year !== prevState.year) {
const periodIndex = prevState.periods.findIndex(
item => item.id === period.id
);
onChange(periods[periodIndex]);
}
}
render() {
const {
periodType,
period,
onChange,
className,
errorText,
} = this.props;
const { periods } = this.state;
if (!periods) {
return null;
}
const value =
period && periods.some(p => p.id === period.id) ? period.id : null;
return (
<div className={cx(styles.periodSelect, className)}>
<SelectField
label={i18n.t('Period')}
items={periods}
value={value}
onChange={onChange}
errorText={!value && errorText ? errorText : null}
className={styles.select}
/>
{periodType && (
<div className={styles.stepper}>
<Tooltip content={i18n.t('Previous year')}>
<Button
secondary
icon={<IconChevronLeft24 />}
onClick={this.previousYear}
/>
</Tooltip>
<Tooltip content={i18n.t('Next year')}>
<Button
secondary
icon={<IconChevronRight24 />}
onClick={this.nextYear}
/>
</Tooltip>
</div>
)}
</div>
);
}
setPeriods() {
const { periodType, period } = this.props;
const year = this.state.year || getYear(period && period.startDate);
let periods;
if (periodType) {
periods = getFixedPeriodsByType(periodType, year);
} else if (period) {
periods = [period]; // If period is loaded in favorite
}
this.setState({ periods, year });
}
nextYear = () => {
this.changeYear(1);
};
previousYear = () => {
this.changeYear(-1);
};
changeYear = change => {
const { periodType } = this.props;
const year = this.state.year + change;
this.setState({
year,
periods: getFixedPeriodsByType(periodType, year),
});
};
}
export default PeriodSelect;
| 29.302158 | 101 | 0.486865 |
a1c044c4c6f3ffe5516008ff2f5d9fdb6d1b7b3c | 5,742 | js | JavaScript | demo/internal/expReport.js | mathieulagrange/paperBandwidthExtension | 4e4c1f57acba66a8b121369f0f3176b665ec03ca | [
"MIT"
] | 2 | 2020-05-06T14:13:04.000Z | 2020-05-08T19:50:43.000Z | demo/internal/expReport.js | mathieulagrange/paperBandwidthExtension | 4e4c1f57acba66a8b121369f0f3176b665ec03ca | [
"MIT"
] | null | null | null | demo/internal/expReport.js | mathieulagrange/paperBandwidthExtension | 4e4c1f57acba66a8b121369f0f3176b665ec03ca | [
"MIT"
] | 1 | 2020-05-06T14:13:06.000Z | 2020-05-06T14:13:06.000Z | // app.js
angular.module('sortApp', [])
.controller('mainController', function($scope, $http, $timeout) {
var context = new AudioContext();
var source = null;
$scope.selectedSetting = 0;
$scope.fileId = 0;
$scope.playing = false;
$scope.playRandom = false;
$scope.audioFileNames = data.audioFileNames;
$scope.fileName = [];
$scope.hasData = function(indexTable, index=-1) {
var hasAudio = false
$scope.selectedTable = indexTable;
if (index>-1) {
hasAudio = $scope.audioFileNames[indexTable][index].length>0;
}
else {
for (var i = 0; i < $scope.audioFileNames[indexTable].length; i++) {
if ($scope.audioFileNames[indexTable][i].length>0) {
hasAudio=true;
}
}
}
return hasAudio;
}
$scope.setSetting = function(indexTable, row) {
$scope.selectedSetting = $scope.tables[indexTable].rows.indexOf(row);
console.log($scope.selectedSetting);
$scope.selectedTable = indexTable;
$scope.fileName[indexTable] = $scope.audioFileNames[indexTable][$scope.selectedSetting][$scope.fileId];
$scope.playAudio(indexTable);
}
$scope.setRandom = function(indexTable) {
$scope.playRandom[indexTable] = !$scope.playRandom[indexTable];
}
$scope.selectAudioFile = function(indexTable, forward=true) {
$scope.selectedTable = indexTable;
if ($scope.playRandom) {
$scope.fileId = Math.floor(Math.random()*$scope.audioFileNames[$scope.selectedTable][$scope.selectedSetting].length);
}
else {
if (forward) {
if ($scope.fileId<$scope.audioFileNames[$scope.selectedTable][$scope.selectedSetting].length-1) {
$scope.fileId++;
}
}
else {
if ($scope.fileId>0) {
$scope.fileId--;
}
}
}
$scope.fileName[indexTable] = $scope.audioFileNames[$scope.selectedTable][$scope.selectedSetting][$scope.fileId];
}
$scope.playAudio = function(tableIndex) {
$scope.playing[tableIndex] = !$scope.playing[tableIndex];
if ($scope.playing[tableIndex]) {
console.log('play audio');
window.fetch('audio/'+$scope.fileName[tableIndex])
.then(response => response.arrayBuffer())
.then(arrayBuffer => context.decodeAudioData(arrayBuffer))
.then(audioBuffer => {
source = context.createBufferSource();
source.buffer = audioBuffer;
source.connect(context.destination);
source.start();
});
}
else {
source.stop();
}
}
$scope.tables = data.tables;
$scope.title = data.title;
document.title = $scope.title;
$scope.showTex = -1;
$scope.author = data.author;
$scope.date = data.date;
$scope.report = report.split("\n");
$scope.selectedTable = 0;
$scope.sortType = [];
$scope.sortReverse = [];
$scope.playRandom = [];
$scope.playing = [];
for (var i = 0; i < $scope.tables.length; i++) {
$scope.sortType.push(''); // set the default sort type
$scope.sortReverse.push(false); // set the default sort order
$scope.playRandom.push(false); // set the default sort order
$scope.playing.push(false); // set the default sort order
$scope.fileName.push($scope.audioFileNames[i][0][0]); // set the default sort order
}
console.log(data);
comments.forEach(function(comment, index){
if (index < $scope.tables.length)
$scope.tables[index].comment = comment.split("\n");
})
$scope.tables.forEach(function(table) {
table.tex = table.tex.join("\n");
})
$scope.showTable = function(index) {
if (!$scope.tables[index].visibleHeight || $scope.tables[index].visibleHeight=="0px") {
var content = document.getElementById("table-"+index+"-content");
$scope.tables[index].visibleHeight = window.getComputedStyle(content).height;
} else {
$scope.tables[index].visibleHeight="0px";
}
//$scope.tables[index].show = !$scope.tables[index].show;
}
$scope.showTables = function(){
for (var i = 0; i < $scope.tables.length; i++) {
$scope.showTable(i);
}
}
$scope.showTexFile = function(index) {
if ($scope.showTex == -1)
$scope.showTex = index;
else
$scope.showTex = -1;
console.log($scope.showTex);
}
$scope.sortCell = function(a) {
// console.log($scope.sortType);
// console.log($scope.selectedTable);
// console.log($scope.sortType[$scope.selectedTable]);
na = Number.parseFloat(a[$scope.sortType[$scope.selectedTable]]);
if (Number.isNaN(na)) return a[$scope.sortType[$scope.selectedTable]];
else return na;
}
$scope.copyToClipBoard = function(index) {
var copyTextarea = document.querySelector('.texData');
copyTextarea.select();
try {
var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';
console.log('Copying text command was ' + msg);
} catch (err) {
console.log('Oops, unable to copy');
}
$scope.showTex = -1;
}
$scope.setSortType = function (tableIndex, col) {
$scope.selectedTable = tableIndex;
$scope.sortType[tableIndex] = col;
$scope.sortReverse[tableIndex] = !$scope.sortReverse[tableIndex];
}
var noSortColumns = [""];
$scope.isBest = function (table, col, val) {
var v = Number.parseFloat(val);
if (Number.isNaN(v)) return false;
if (noSortColumns.find(function(c){return col==c;})) return false;
for (var i=0, l=table.rows.length; i<l; i++)
if (Number.parseFloat(table.rows[i][col]) > v) return false;
return true;
}
$scope.stopEvent = function(e) {
if (e.stopPropagation) e.stopPropagation();
else e.cancelBubble = true;
if (e.preventDefault) e.preventDefault();
}
// reportName = location.pathname.substring(1, location.pathname.length-5).replace(/^.*\//, "");
$timeout(function(){$scope.showTables();}, 200);
});
| 30.062827 | 117 | 0.648729 |
a1c18b53592f4f352c1150a5344b8f1055bf23f3 | 657 | js | JavaScript | __mocks__/child_process.js | Satyam/cra-dotenv | bbfb5ba5c4b9839d435aaaff3e9d3e92e32d2c22 | [
"MIT"
] | null | null | null | __mocks__/child_process.js | Satyam/cra-dotenv | bbfb5ba5c4b9839d435aaaff3e9d3e92e32d2c22 | [
"MIT"
] | null | null | null | __mocks__/child_process.js | Satyam/cra-dotenv | bbfb5ba5c4b9839d435aaaff3e9d3e92e32d2c22 | [
"MIT"
] | null | null | null | const mockSpawn = require('spawn-mock').mockSpawn;
const child_process = require.requireActual('child_process');
const REACT_APP = /^REACT_APP_/i;
const spawn = mockSpawn(function(cp) {
// the command (cmd) and the arguments (args) that the returned function
// has bene called wth
const { cmd, args } = cp;
console.log('newSpawn', { cmd, args });
// end the child process
child_process.__env__ = Object.keys(process.env)
.filter(key => REACT_APP.test(key) || key === 'NODE_ENV')
.reduce((acc, key) => Object.assign(acc, { [key]: process.env[key] }), {});
cp.end();
});
child_process.spawn = spawn;
module.exports = child_process;
| 31.285714 | 79 | 0.677321 |
a1c1d60d6589a200ef8cec249598257de91ad04c | 653 | js | JavaScript | cli-tools/cli-lib/modules/tt-tags.js | alexdinari/aofl | f8a7977459cb90fefcb6f0ee89da1909495c36ef | [
"MIT"
] | 29 | 2018-08-28T17:20:48.000Z | 2022-01-07T23:09:47.000Z | cli-tools/cli-lib/modules/tt-tags.js | alexdinari/aofl | f8a7977459cb90fefcb6f0ee89da1909495c36ef | [
"MIT"
] | 9 | 2018-12-27T05:09:40.000Z | 2021-06-14T20:38:22.000Z | cli-tools/cli-lib/modules/tt-tags.js | alexdinari/aofl | f8a7977459cb90fefcb6f0ee89da1909495c36ef | [
"MIT"
] | 10 | 2018-10-30T20:19:51.000Z | 2021-12-22T00:56:03.000Z | const uuidv4 = require('uuid/v4');
const uniki = require('uniki');
const translationRegex = /(\._[_c]\()[^`'"{]*[`'"{)](?!<tt-.*?>)/g;
class TtTag {
static addIds(str) {
let matches = translationRegex.exec(str);
let pivot = 0;
let out = '';
while (matches !== null) {
const ttTag = `'<tt-${uniki(uuidv4())}>', `;
const matchGroup = matches[1];
const offset = matchGroup.length;
out += str.slice(pivot, matches.index + offset) + ttTag;
pivot = matches.index + offset;
matches = translationRegex.exec(str);
}
out += str.slice(pivot);
return out;
}
}
module.exports.TtTag = TtTag;
| 22.517241 | 67 | 0.574273 |
a1c38aa5bf8d66d2d8a4b8acf4b50befba3ec3ec | 8,943 | js | JavaScript | implementation/test/DepositFactoryTest.js | aliatiia/tbtc | 00c38c8b71ed76a5e6e5c2af0cb569ff8d918bf9 | [
"MIT"
] | 2 | 2021-01-08T16:56:12.000Z | 2021-01-08T17:41:25.000Z | implementation/test/DepositFactoryTest.js | aliatiia/tbtc | 00c38c8b71ed76a5e6e5c2af0cb569ff8d918bf9 | [
"MIT"
] | null | null | null | implementation/test/DepositFactoryTest.js | aliatiia/tbtc | 00c38c8b71ed76a5e6e5c2af0cb569ff8d918bf9 | [
"MIT"
] | null | null | null | import deployTestDeposit from './helpers/deployTestDeposit'
import expectThrow from './helpers/expectThrow'
import BN from 'bn.js'
import utils from './utils'
import chai, { expect } from 'chai'
import bnChai from 'bn-chai'
chai.use(bnChai(BN))
const ECDSAKeepStub = artifacts.require('ECDSAKeepStub')
const Deposit = artifacts.require('Deposit')
const TestDeposit = artifacts.require('TestDeposit')
const TBTCSystem = artifacts.require('TBTCSystem')
contract('DepositFactory', () => {
const openKeepFee = new BN('123456') // set in ECDAKeepFactory
const fullBtc = 100000000
describe('createDeposit()', async () => {
let depositFactory
let ecdsaKeepFactoryStub
before(async () => {
// To properly test createDeposit, we deploy the real Deposit contract and
// make sure we don't get hit by the ACL hammer.
({
depositFactory,
} = await deployTestDeposit([], { 'TestDeposit': Deposit }))
})
it('creates new clone instances', async () => {
const blockNumber = await web3.eth.getBlockNumber()
await depositFactory.createDeposit(
fullBtc,
{ value: openKeepFee }
)
await depositFactory.createDeposit(
fullBtc,
{ value: openKeepFee }
)
const eventList = await depositFactory.getPastEvents('DepositCloneCreated', { fromBlock: blockNumber, toBlock: 'latest' })
assert.equal(eventList.length, 2)
assert(web3.utils.isAddress(eventList[0].returnValues.depositCloneAddress))
assert(web3.utils.isAddress(eventList[1].returnValues.depositCloneAddress))
assert.notEqual(eventList[0].returnValues.depositCloneAddress, eventList[1].returnValues.depositCloneAddress, 'clone addresses should not be equal')
})
it('correctly forwards value to keep factory', async () => {
// Use real TBTCSystem contract to validate value forwarding:
// DepositFactory -> Deposit -> TBTCSystem -> ECDSAKeepFactory
({
ecdsaKeepFactoryStub,
depositFactory,
} = await deployTestDeposit([], { 'TestDeposit': Deposit, 'TBTCSystemStub': TBTCSystem }))
await depositFactory.createDeposit(
fullBtc,
{ value: openKeepFee }
)
expect(
await web3.eth.getBalance(ecdsaKeepFactoryStub.address),
'Factory did not correctly forward value on Deposit creation'
).to.eq.BN(openKeepFee)
})
it('reverts if insufficient fee is provided', async () => {
const badOpenKeepFee = openKeepFee.sub(new BN(1))
await expectThrow(
depositFactory.createDeposit(
fullBtc,
{ value: badOpenKeepFee }
),
'Insufficient value for new keep creation'
)
})
})
describe('clone state', async () => {
let mockRelay
let tbtcSystemStub
let tbtcToken
let tbtcDepositToken
let testDeposit
let depositFactory
const publicKey = '0xd4aee75e57179f7cd18adcbaa7e2fca4ff7b1b446df88bf0b4398e4a26965a6ee8bfb23428a4efecb3ebdc636139de9a568ed427fff20d28baa33ed48e9c44e1'
before(async () => {
({
mockRelay,
tbtcSystemStub,
tbtcToken,
tbtcDepositToken,
testDeposit,
depositFactory,
} = await deployTestDeposit([]))
})
it('is not affected by state changes to other clone', async () => {
const keep1 = await ECDSAKeepStub.new()
const keep2 = await ECDSAKeepStub.new()
const blockNumber = await web3.eth.getBlockNumber()
await depositFactory.createDeposit(
fullBtc,
{ value: openKeepFee }
)
await depositFactory.createDeposit(
fullBtc,
{ value: openKeepFee }
)
const eventList = await depositFactory.getPastEvents('DepositCloneCreated', { fromBlock: blockNumber, toBlock: 'latest' })
const clone1 = eventList[0].returnValues.depositCloneAddress
const clone2 = eventList[1].returnValues.depositCloneAddress
const deposit1 = await TestDeposit.at(clone1)
const deposit2 = await TestDeposit.at(clone2)
await deposit1.setKeepAddress(keep1.address)
await deposit2.setKeepAddress(keep2.address)
const currentDifficulty = 6353030562983
const _version = '0x01000000'
const _txInputVector = `0x01913e39197867de39bff2c93c75173e086388ee7e8707c90ce4a02dd23f7d2c0d0000000000ffffffff`
const _txOutputVector = '0x012040351d0000000016001486e7303082a6a21d5837176bc808bf4828371ab6'
const _fundingOutputIndex = 0
const _txLocktime = '0x4ec10800'
const _txIndexInBlock = 129
const _bitcoinHeaders = '0x00e0ff3fd877ad23af1d0d3e0eb6a700d85b692975dacd36e47b1b00000000000000000095ba61df5961d7fa0a45cd7467e11f20932c7a0b74c59318e86581c6b509554876f6c65c114e2c17e42524d300000020994d3802da5adf80345261bcff2eb87ab7b70db786cb0000000000000000000003169efc259f6e4b5e1bfa469f06792d6f07976a098bff2940c8e7ed3105fdc5eff7c65c114e2c170c4dffc30000c020f898b7ea6a405728055b0627f53f42c57290fe78e0b91900000000000000000075472c91a94fa2aab73369c0686a58796949cf60976e530f6eb295320fa15a1b77f8c65c114e2c17387f1df00000002069137421fc274aa2c907dbf0ec4754285897e8aa36332b0000000000000000004308f2494b702c40e9d61991feb7a15b3be1d73ce988e354e52e7a4e611bd9c2a2f8c65c114e2c1740287df200000020ab63607b09395f856adaa69d553755d9ba5bd8d15da20a000000000000000000090ea7559cda848d97575cb9696c8e33ba7f38d18d5e2f8422837c354aec147839fbc65c114e2c175cf077d6000000200ab3612eac08a31a8fb1d9b5397f897db8d26f6cd83a230000000000000000006f4888720ecbf980ff9c983a8e2e60ad329cc7b130916c2bf2300ea54e412a9ed6fcc65c114e2c17d4fbb88500000020d3e51560f77628a26a8fad01c88f98bd6c9e4bc8703b180000000000000000008e2c6e62a1f4d45dd03be1e6692df89a4e3b1223a4dbdfa94cca94c04c22049992fdc65c114e2c17463edb5e'
const _merkleProof = '0x886f7da48f4ccfe49283c678dedb376c89853ba46d9a297fe39e8dd557d1f8deb0fb1a28c03f71b267f3a33459b2566975b1653a1238947ed05edca17ef64181b1f09d858a6e25bae4b0e245993d4ea77facba8ed0371bb9b8a6724475bcdc9edf9ead30b61cf6714758b7c93d1b725f86c2a66a07dd291ef566eaa5a59516823d57fd50557f1d938cc2fb61fe0e1acee6f9cb618a9210688a2965c52feabee66d660a5e7f158e363dc464fca2bb1cc856173366d5d20b5cd513a3aab8ebc5be2bd196b783b8773af2472abcea3e32e97938283f7b454769aa1c064c311c3342a755029ee338664999bd8d432080eafae3ca86b52ad2e321e9e634a46c1bd0d174e38bcd4c59a0f0a78c5906c015ef4daf6beb0500a59f4cae00cd46069ce60db2182e74561028e4462f59f639c89b8e254602d6ad9c212b7c2af5db9275e48c467539c6af678d6f09214182df848bd79a06df706f7c3fddfdd95e6f27326c6217ee446543a443f82b711f48c173a769ae8d1e92a986bc76fca732f088bbe049'
// const _outputValue = 490029088;
await keep1.setPublicKey(publicKey)
await keep2.setPublicKey(publicKey)
await deposit1.retrieveSignerPubkey()
await deposit2.retrieveSignerPubkey()
await mockRelay.setCurrentEpochDifficulty(currentDifficulty)
await mockRelay.setPrevEpochDifficulty(currentDifficulty)
await deposit2.provideBTCFundingProof(_version, _txInputVector, _txOutputVector, _txLocktime, _fundingOutputIndex, _merkleProof, _txIndexInBlock, _bitcoinHeaders)
// deposit1 should be AWAITING_BTC_FUNDING_PROOF (2)
// deposit2 should be ACTIVE (5)
const deposit1state = await deposit1.getCurrentState()
const deposit2state = await deposit2.getCurrentState()
expect(deposit1state, 'Deposit 1 should be in AWAITING_BTC_FUNDING_PROOF').to.eq.BN(utils.states.AWAITING_BTC_FUNDING_PROOF)
expect(deposit2state, 'Deposit 2 should be in ACTIVE').to.eq.BN(utils.states.ACTIVE)
})
it('is not affected by state changes to master', async () => {
const keep = await ECDSAKeepStub.new()
await testDeposit.createNewDeposit(
tbtcSystemStub.address,
tbtcToken.address,
tbtcDepositToken.address,
utils.address0,
utils.address0,
1,
1,
fullBtc,
{ value: openKeepFee }
)
await testDeposit.setKeepAddress(keep.address)
await keep.setPublicKey(publicKey)
await testDeposit.retrieveSignerPubkey()
// master deposit should now be in AWAITING_BTC_FUNDING_PROOF
const masterState = await testDeposit.getCurrentState()
const blockNumber = await web3.eth.getBlockNumber()
await depositFactory.createDeposit(
fullBtc,
{ value: openKeepFee }
)
const eventList = await depositFactory.getPastEvents('DepositCloneCreated', { fromBlock: blockNumber, toBlock: 'latest' })
const cloneNew = eventList[0].returnValues.depositCloneAddress
const depositNew = await TestDeposit.at(cloneNew)
// should be behind Master, at AWAITING_SIGNER_SETUP
const newCloneState = await depositNew.getCurrentState()
expect(masterState, 'Master deposit should be in AWAITING_BTC_FUNDING_PROOF').to.eq.BN(utils.states.AWAITING_BTC_FUNDING_PROOF)
expect(newCloneState, 'New clone should be in AWAITING_SIGNER_SETUP').to.eq.BN(utils.states.AWAITING_SIGNER_SETUP)
})
})
})
| 44.272277 | 1,154 | 0.76093 |
a1c41eddc7937ce2b501a32f5fa45a0d6ee5da3e | 1,916 | js | JavaScript | api/marketplace/customer/customer.controller.js | williamlagos/boxer | e96edbc309139e7398915635bdecead21c35f605 | [
"MIT"
] | null | null | null | api/marketplace/customer/customer.controller.js | williamlagos/boxer | e96edbc309139e7398915635bdecead21c35f605 | [
"MIT"
] | 1 | 2020-04-24T22:36:22.000Z | 2020-04-24T22:36:22.000Z | api/marketplace/customer/customer.controller.js | efforia/boxer | e96edbc309139e7398915635bdecead21c35f605 | [
"MIT"
] | null | null | null | /**
* @license MIT
* @version 1.1.0
* @author M.A.R.S. Labs
* @description Customer controller.
*/
// --------------- Module Imports
const Customer = require("../customer/customer.model");
const Order = require("../order/order.model");
// --------------- Module Controller
const CustomerCtrl = module.exports = {
addFavorite: async function (user, merchant) {
let favorites = (await Customer.findOneAndUpdate({ _id: user._id }, { $addToSet: { favoriteMerchants: merchant } }, { upsert: true, new: true }) // Adds it to the favorites list
.populate("favoriteMerchants")).favoriteMerchants; // Populates the favorites list
return favorites; // Returns the updated list
},
removeFavorite: async function (user, merchant) {
let favorites = (await Customer.findOneAndUpdate({ _id: user._id }, { $pull: { favoriteMerchants: merchant } }, { new: true }) // Adds it to the favorites list
.populate("favoriteMerchants")).favoriteMerchants; // Populates the favorites list
return favorites; // Returns the updated list
},
getFavorites: async function (user) {
let favorites = (await Customer.findOne({ _id: user._id })).favoriteMerchants; // Gets the favorites list
return favorites; // Returns the list
},
updateRating: async function (id) {
let orders = await (Order.find({ customer: id, merchantRate: { $ne: null } }, '-_id merchantRate')); // Gets merchant orders
let ratingsTotal = 0; // Initializes rating count
orders.map((order) => { ratingsTotal += order.merchantRate; }); // Calculates the rating amount
let rating = (ratingsTotal / orders.length); // Divides it by the ratings number
let customer = await Customer.findOneAndUpdate({ _id: id }, { rating: rating }); // Updates it on the the merchant
return customer; // Returns the updated merchant
}
};
| 47.9 | 185 | 0.650835 |
a1c431b2f8d1becee439e466a22b940a9419c1e6 | 533 | js | JavaScript | js/directives.js | silvaaraujo/weather-forecast-spa | 8ee8ca48374acb25b1dc36e71f5bc4368c1edba7 | [
"MIT"
] | null | null | null | js/directives.js | silvaaraujo/weather-forecast-spa | 8ee8ca48374acb25b1dc36e71f5bc4368c1edba7 | [
"MIT"
] | null | null | null | js/directives.js | silvaaraujo/weather-forecast-spa | 8ee8ca48374acb25b1dc36e71f5bc4368c1edba7 | [
"MIT"
] | null | null | null | weatherApp.directive('temperatureReport', function() {
return {
templateUrl: 'directives/temperatureReport.html',
restrict: 'E',
scope: {
weather: '='
},
link: function(scope, element, attrs) {
scope.kelvinToCelcius = function(degreeKelvin) {
return Math.round(degreeKelvin - 273.15);
}
scope.toDate = function(dt) {
return new Date(dt * 1000);
}
}
}
}); | 26.65 | 60 | 0.476548 |
a1c488835ce9cc6e8ea13c2ba062cb381e35fc02 | 24,582 | js | JavaScript | server.js | xrysanthopoulos/Trivia | b705b377c838ed5cdd23bc2fc58ddbc41cc9952b | [
"Unlicense"
] | null | null | null | server.js | xrysanthopoulos/Trivia | b705b377c838ed5cdd23bc2fc58ddbc41cc9952b | [
"Unlicense"
] | null | null | null | server.js | xrysanthopoulos/Trivia | b705b377c838ed5cdd23bc2fc58ddbc41cc9952b | [
"Unlicense"
] | null | null | null | const express = require('express');
const bodyParser = require('body-parser');
const request = require('request');
const axios = require('axios');
const MongoClient = require('mongodb').MongoClient;
const PAGE_ACCESS_TOKEN = process.env.PAGE_ACCESS_TOKEN;
const PORT = process.env.PORT;
const VERIFY_TOKEN = process.env.VERIFY_TOKEN;
const MONGODB_URI = process.env.MONGODB_URI;
const DB_NAME = process.env.DB_NAME;
const questCount = 10;
const points = 5;
const app = express().use(bodyParser.json());
app.set("port", PORT || 8000);
app.get('/setup', async function (req, res) {
await setupGetStartedButton(res);
await setupPersistentMenu(res);
await setupGreetingText(res);
});
/// Set up Messenger settings for "Persistent Menu", "Greeting Text", "Get Started Button".
async function setupPersistentMenu(res) {
var messageData =
{
"persistent_menu": [{
"locale": "default",
"composer_input_disabled": true,
"call_to_actions": [
{
"title": 'Νέο παιχνίδι 🎮',
"type": "postback",
"payload": "start"
},
{
"type": "postback",
"title": "Βγες από το παιχνίδι ❌",
"payload": "cancel"
},
{
"type": "postback",
"title": "Γενική βαθμολογία και score 🏆",
"payload": "score"
}
]
}
]
};
// Start the request
await request({
url: "https://graph.facebook.com/v5.0/me/messenger_profile?access_token=" + PAGE_ACCESS_TOKEN,
method: 'POST',
headers: { 'Content-Type': 'application/json' },
form: messageData
},
function (error, response, body) {
if (!error && response.statusCode === 200) {
// Print out the response body
res.send(body);
} else {
// TODO: Handle errors
res.send(body);
}
});
}
async function setupGreetingText(res) {
var messageData = {
"greeting": [
{
"locale": "default",
"text": "Hello {{user_full_name}} 👋 !! This is the Quiz Bot, a trivia game. Press 'Get Started' to start the game."
}
]
};
await request({
url: 'https://graph.facebook.com/v2.6/me/messenger_profile?access_token=' + PAGE_ACCESS_TOKEN,
method: 'POST',
headers: { 'Content-Type': 'application/json' },
form: messageData
},
function (error, response, body) {
if (!error && response.statusCode === 200) {
// Print out the response body
res.send(body);
} else {
// TODO: Handle errors
res.send(body);
}
});
}
async function setupGetStartedButton(res) {
var messageData = {
"get_started": {
"payload": "getstarted"
}
};
// Start the request
await request({
url: "https://graph.facebook.com/v2.6/me/messenger_profile?access_token=" + PAGE_ACCESS_TOKEN,
method: 'POST',
headers: { 'Content-Type': 'application/json' },
form: messageData
},
function (error, response, body) {
if (!error && response.statusCode === 200) {
// Print out the response body
res.send(body);
} else {
// TODO: Handle errors
res.send(body);
}
});
}
/// Database actions
// Set random with query questions in user collection in "moreCategoryQuestion" field.
async function setQuestionsUserDB(psid) {
const client = new MongoClient(MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true
});
try {
await client.connect();
const db = client.db(DB_NAME);
const colQuest = db.collection('questions');
const colUser = db.collection('users');
let userFind = { user: psid };
let dataUser = await colUser.findOne(userFind);
let query;
let dataQuest;
// in case random difficult/category make random query
if (dataUser.difficult === "random" && dataUser.category === "random") {
dataQuest = await colQuest.aggregate([{ $sample: { size: 10 } }]).toArray();
} else {
// make query from User details
if (dataUser.difficult === "random") {
query = { category: dataUser.category }
} else if (dataUser.category === "random") {
query = { difficulty: dataUser.difficult }
} else {
query = { difficulty: dataUser.difficult, category: dataUser.category }
}
dataQuest = await colQuest.aggregate([{ $match: query }, { $sample: { size: 10 } }]).toArray();
}
if (dataUser.pastQuestions.length === 0) {
let updateValues = { $set: { moreCategoryQuestion: dataQuest } };
await colUser.findOneAndUpdate(userFind, updateValues);
} else if (dataUser.moreCategoryQuestion.length === 0) {
let updateValues = { $set: { moreCategoryQuestion: dataQuest, pastQuestions: [] } };
await colUser.findOneAndUpdate(userFind, updateValues);
}
} catch (err) {
console.log(err.stack);
}
client.close();
};
// Get data user from DB and return question for each question counter.
async function getQuestioFromUserDB(psid, id) {
const client = new MongoClient(MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true
});
try {
await client.connect();
const db = client.db(DB_NAME);
const colUser = db.collection('users');
let userFind = { user: psid };
let dataUser = await colUser.find(userFind).toArray();
let currentQuestion = dataUser[0].moreCategoryQuestion[dataUser[0].questCount]
let updateValues = { $set: { currentQuestion: currentQuestion.id, questCount: dataUser[0].questCount + 1, correctAnswer: currentQuestion.correct_answer } };
await colUser.findOneAndUpdate(userFind, updateValues);
return currentQuestion
} catch (err) {
console.log(err.stack);
}
client.close();
};
// Set past question in user collections *** not use currently
async function setPastQuestionUserDB(psid, id) {
const client = new MongoClient(MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true
});
try {
await client.connect();
const db = client.db(DB_NAME);
const colUser = db.collection('users');
let userFind = { user: psid };
let updateValues = { $push: { pastQuestions: id } };
await colUser.findOneAndUpdate(userFind, updateValues);
} catch (err) {
console.log(err.stack);
}
client.close();
};
// Initialize a new User in DB
async function addNewUserDB(psid) {
const client = new MongoClient(MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true
});
try {
await client.connect();
const db = client.db(DB_NAME);
const col = db.collection('users');
const getPersonDetails = async () => {
return axios.get("https://graph.facebook.com/" + psid + "?fields=first_name,last_name,profile_pic&access_token=" + PAGE_ACCESS_TOKEN)
.then((response) => {
return response.data;
})
.catch((error) => {
console.log(error);
});
}
let data = await getPersonDetails()
let userFind = { user: psid };
let user = { user: psid, personalDetails: [data], difficult: null, category: null, points: 0, score: 0, questCount: 0, pastQuestions: [], currentQuestion: [], moreCategoryQuestion: [], correctAnswer: null };
data = await col.findOne(userFind).then(result => {
if (result === null || result === undefined) {
col.insertOne(user);
}
})
} catch (err) {
console.log(err.stack);
}
client.close();
}
//Get data User from DB
async function getUserDataDB(psid) {
const client = new MongoClient(MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true
});
try {
await client.connect();
const db = client.db(DB_NAME);
const colUser = db.collection('users');
let userFind = { user: psid };
let data = await colUser.findOne(userFind);
return data
} catch (err) {
console.log(err.stack);
}
client.close();
}
// Update User details difficult/category.
async function updateUserDetailsDB(psid, payload) {
const client = new MongoClient(MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true
});
try {
await client.connect();
const db = client.db(DB_NAME);
const colUser = db.collection('users');
let userFind = { user: psid };
let updateValues;
let data = await colUser.findOne(userFind);
if (data.difficult === null) {
updateValues = { $set: { difficult: payload } };
await colUser.findOneAndUpdate(userFind, updateValues);
return false
} else if (data.category === null) {
updateValues = { $set: { category: payload } };
await colUser.findOneAndUpdate(userFind, updateValues);
return true
}
data = await colUser.findOne(userFind);
} catch (err) {
console.log(err.stack);
}
client.close();
}
// Update User score in DB.
async function updateUserScoreDB(psid) {
const client = new MongoClient(MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true
});
try {
await client.connect();
const db = client.db(DB_NAME);
const colUser = db.collection('users');
let userFind = { user: psid };
let data = await colUser.findOne(userFind);
let updateValues = { $set: { score: data.score + 1, points: data.points + points } };
await colUser.findOneAndUpdate(userFind, updateValues);
} catch (err) {
console.log(err.stack);
}
client.close();
}
// Initialize User fields in DB to start new round.
async function startNewRoundUserDB(psid) {
const client = new MongoClient(MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true
});
try {
await client.connect();
const db = client.db(DB_NAME);
const colUser = db.collection('users');
let userFind = { user: psid };
let updateValues = { $set: { difficult: null, category: null, score: 0, questCount: 0, pastQuestions: [], currentQuestion: [], moreCategoryQuestion: [], correctAnswer: null } };
await colUser.findOneAndUpdate(userFind, updateValues);
} catch (err) {
console.log(err.stack);
}
client.close();
}
/// Facebook Messenger webhook
app.get('/webhook', (req, res) => {
let mode = req.query['hub.mode'];
let token = req.query['hub.verify_token'];
let challenge = req.query['hub.challenge'];
// Checks if a token and mode is in the query string of the request
if (mode && token) {
// Checks the mode and token sent is correct
if (mode === 'subscribe' && token === VERIFY_TOKEN) {
// Responds with the challenge token from the request
console.log('WEBHOOK_VERIFIED');
// await getQuestionsForDB();
res.status(200).send(challenge);
} else {
// Responds with '403 Forbidden' if verify tokens do not match
res.sendStatus(403);
}
}
});
app.post('/webhook', (req, res) => {
// Parse the request body from the POST
let body = req.body;
// Check the webhook event is from a Page subscription
if (body.object === 'page') {
body.entry.forEach(function (entry) {
// Gets the body of the webhook event
let webhook_event = entry.messaging[0];
// console.log(webhook_event);
// Get the sender PSID
let sender_psid = webhook_event.sender.id;
// Check if the event is a message or postback and
// pass the event to the appropriate handler function
if (webhook_event.message) {
handleMessage(sender_psid, webhook_event.message);
} else if (webhook_event.postback) {
handlePostback(sender_psid, webhook_event.postback);
}
});
// Return a '200 OK' response to all events
res.status(200).send('EVENT_RECEIVED');
} else {
// Return a '404 Not Found' if event is not from a page subscription
res.sendStatus(404);
}
});
/// Display functions
const wellcomeGetStart = () => {
const msg = {
"text": `Γεια 👋\nΤο Quiz bot είναι ένα trivial game, δοκίμασε τις γνώσεις σου σε διαφορετικές κατηγορίες και επίπεδο δυσκολίας και με κάθε σωστή απάντηση αύξησε τη βαθμολογία σου.`
}
return msg
}
// const wellcomeGetStart = () => {
// const msg = {
// "attachment": {
// "type": "template",
// "payload": {
// "template_type": "button",
// "text": `Γεια 👋\nΤο Quiz bot είναι ένα trivial game, δοκίμασε τις γνώσεις σου σε διαφορετικές κατηγορίες και επίπεδο δυσκολίας και με κάθε σωστή απάντηση και αύξησε τη βαθμολογία σου.`,
// "buttons": [
// {
// "type": "postback",
// "payload": "start",
// "title": "Πάμε"
// }
// ]
// }
// }
// }
// return msg
// }
const tipsForGame = () => {
const msg = {
"attachment": {
"type": "template",
"payload": {
"template_type": "button",
"text": `Έχεις ${questCount} ερωτήσεις.\nΜε κάθε σωστή απάντηση κερδίζεις 1 πόντο και ${points} στη Γενική Βαθμολογία.\n\nΧρησιμοποίησε το Menu κάτω αριστερά για να "Ξεκινήσεις" ή να "Σταματήσεις" το παιχνίδι και να δεις την βαθμολογία σου`,
"buttons": [
{
"type": "postback",
"payload": "start",
"title": "Πάμε"
}
]
}
}
}
return msg
}
const displayStartGame = () => {
const msg = {
"attachment": {
"type": "template",
"payload": {
"template_type": "button",
"text": "Ξεκίνα να παίζεις 🎮",
"buttons": [
{
"type": "postback",
"payload": "start",
"title": "Ναι"
},
{
"type": "postback",
"payload": "no",
"title": "Οχι"
}
]
}
}
}
return msg
}
const chooseDifficult = () => {
const msg = {
"text": "Διάλεξε επίπεδο:",
"quick_replies": [
{
"title": "Τυχαίο",
"content_type": "text",
"payload": "random"
},
{
"title": "Εύκολο",
"content_type": "text",
"payload": "easy"
},
{
"title": "Μέτριο",
"content_type": "text",
"payload": "medium"
},
{
"title": "Δύσκολο",
"content_type": "text",
"payload": "hard"
}
]
}
return msg
}
const chooseCategory = () => {
let msg = {
"text": "Διάλεξε κατηγορία:",
"quick_replies": [
{
"title": "Τυχαίο",
"content_type": "text",
"payload": "random"
},
{
"title": "Αθλητισμός",
"content_type": "text",
"payload": "sports"
},
{
"title": "Ιστορία",
"content_type": "text",
"payload": "history"
},
{
"title": "Γεωγραφία",
"content_type": "text",
"payload": "geography"
},
{
"title": "Πολιτισμός",
"content_type": "text",
"payload": "culture"
},
{
"title": "Περιβάλλον",
"content_type": "text",
"payload": "environment"
},
// {
// "title": "Επιστήμη",
// "content_type": "text",
// "payload": "science"
// },
{
"title": "Γλώσσες",
"content_type": "text",
"payload": "language"
}
]
}
return msg
}
function shuffleArray(array) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
}
const scoreDisplay = async (psid) => {
let data = await getUserDataDB(psid);
let msg = {
"text": `Σκορ: ${data.score}\nΓενικοί πόντοι: ${data.points}`
}
return msg
}
const correctAsnwerDisplay = async (psid) => {
let data = await getUserDataDB(psid);
let msg = {
"text": `Σωστό! ✅\nΣκορ: ${data.score} ${data.score === 1 ? 'πόντος' : 'πόντοι'} σε ${data.questCount} ${data.questCount === 1 ? 'ερώτηση' : 'ερωτήσεις'}`
}
return msg
}
const incorrectAnswersDisplay = () => {
let msg = {
"text": "Χμμ.. λάθος απάντηση."
}
return msg
}
const unknowAnswersDisplay = () => {
let msg = {
"text": "Δεν το γνωρίζω αυτο.."
}
return msg
}
const getAnswers = (category, incorrectAnswers, correctAnswer) => {
let answers = [];
answers = incorrectAnswers.split("|");
answers.push(correctAnswer)
shuffleArray(answers);
let buttons = answers.map((answer) => {
return {
"type": "postback",
"payload": category,
"title": answer
}
})
return buttons
}
const displayQuestions = async (psid) => {
data = await getQuestioFromUserDB(psid);
const msg = {
"attachment": {
"type": "template",
"payload": {
"template_type": "button",
"text": data.question,
"buttons": getAnswers(data.category, data.incorrect_answers, data.correct_answer)
}
}
}
return msg
}
const displayQuestionWithImage = () => {
const msg = {
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
"elements": [
{
"title": data.question,
"image_url": data.image,
"buttons": getAnswers(data.category, data.incorrect_answers, data.correct_answer)
}
]
}
}
}
return msg
}
const startNewRound = async (sender_psid) => {
await startNewRoundUserDB(sender_psid);
let response = await chooseDifficult();
await callSendAPI(sender_psid, response);
}
const stopRound = async (sender_psid) => {
await startNewRoundUserDB(sender_psid);
let response = displayStartGame();
await callSendAPI(sender_psid, response);
}
const displayFinalScore = async (psid) => {
let data = await getUserDataDB(psid);
let msg = {
"text": `Τέλος γύρου!\nΣκορ: ${data.score}`
}
return msg
}
const displayExit = async () => {
let msg = {
"text": `Τα λέμε την επόμενη φορά! 👋`
}
return msg
}
async function handleMessage(sender_psid, received_message) {
let response;
// if (received_message.text || received_message.attachments) {
// response = await unknowAnswersDisplay();
// await callSendAPI(sender_psid, response);
// }
if (received_message.text === "score") {
response = await scoreDisplay(sender_psid);
await callSendAPI(sender_psid, response);
}
if (received_message.quick_reply != undefined) {
let payload = received_message.quick_reply.payload;
let status = await updateUserDetailsDB(sender_psid, payload);
await setQuestionsUserDB(sender_psid);
if (!status) {
response = await chooseCategory();
await callSendAPI(sender_psid, response);
} else if (status) {
response = await displayQuestions(sender_psid);
await callSendAPI(sender_psid, response);
}
}
}
const chechAnswer = async (sender_psid, userAnswer, correctAnswer, id) => {
let response;
if (userAnswer === correctAnswer) {
await updateUserScoreDB(sender_psid);
// await setPastQuestionUserDB(sender_psid, id);
response = await correctAsnwerDisplay(sender_psid);
} else if (userAnswer != correctAnswer) {
response = incorrectAnswersDisplay();
}
await callSendAPI(sender_psid, response);
}
async function handlePostback(sender_psid, received_postback) {
let response;
let payload = received_postback.payload;
if (received_postback.payload) {
switch (payload) {
case 'getstarted':
response = await wellcomeGetStart();
await callSendAPI(sender_psid, response);
response = await tipsForGame();
break;
case 'start':
await addNewUserDB(sender_psid);
response = await startNewRound(sender_psid);
break;
case 'cancel':
await stopRound(sender_psid);
break;
case 'no':
response = await displayExit();
break;
case 'score':
response = await scoreDisplay(sender_psid);
await callSendAPI(sender_psid, response);
break;
}
}
let data = await getUserDataDB(sender_psid);
if (payload != "score") {
if (data != null) {
if (data.currentQuestion.length != 0) {
await chechAnswer(sender_psid, received_postback.title, data.correctAnswer, data.currentQuestion);
if (data.questCount != questCount) {
response = await displayQuestions(sender_psid);
} else {
response = await displayFinalScore(sender_psid);
}
}
}
await callSendAPI(sender_psid, response);
if (data.questCount === questCount) {
response = stopRound(sender_psid);
await callSendAPI(sender_psid, response);
}
}
}
async function callSendAPI(sender_psid, response) {
let typing = {
"recipient": { "id": sender_psid },
"sender_action": "typing_on",
}
await request({
"uri": "https://graph.facebook.com/v3.3/me/messages",
"qs": { "access_token": PAGE_ACCESS_TOKEN },
"method": "POST",
"json": typing
}, (err, res, body) => {
if (!err) {
// console.log('message sent!')
} else {
console.error("Unable to send message:" + err);
}
});
let request_body = {
"recipient": { "id": sender_psid },
"message": response
}
await request({
"uri": "https://graph.facebook.com/v3.3/me/messages",
"qs": { "access_token": PAGE_ACCESS_TOKEN },
"method": "POST",
"json": request_body
}, (err, res, body) => {
if (!err) {
// console.log('message sent!')
} else {
console.error("Unable to send message:" + err);
}
});
}
app.listen(app.get("port"), () => {
// console.log(`Find the server at: http://localhost:${app.get("port")}/`); // eslint-disable-line no-console
});
| 29.796364 | 257 | 0.528842 |
a1c4d4e76961caf73447fff95f6672acbed669db | 435 | js | JavaScript | application/config/config.js | mirevsky/emeraldBuilder | 3c258b91dac30947f52855a2b0b93b8f0bd25e25 | [
"MIT"
] | null | null | null | application/config/config.js | mirevsky/emeraldBuilder | 3c258b91dac30947f52855a2b0b93b8f0bd25e25 | [
"MIT"
] | null | null | null | application/config/config.js | mirevsky/emeraldBuilder | 3c258b91dac30947f52855a2b0b93b8f0bd25e25 | [
"MIT"
] | null | null | null | export const Config = {
"version" : "0.0.1",
"name" : "emerald+",
"mode": "development",
"mod_rewrite": false,
"default":
{
"language": {
"name" : "English",
"code" : "en-us"
},
"currency" : {
"sign" : "USD",
"name" : "American Dollar"
},
"localization" : {
"timezone" : "America/Toronto",
"timedate_format" : "Y/m/d G:i:s",
"date_format" : "Y/m/d"
}
}
} | 18.913043 | 40 | 0.471264 |
a1c562c61350fde720756e0d56e8f9ea75072a9a | 360 | js | JavaScript | web/themes/custom/particle/apps/pl-default/pattern-lab/_patterns/01-atoms-demo/aaronpero-button/index.js | teodyseguin/aaronpero | aa5e899f60a5a72d3902c1d0dd5ec0e93a2211f7 | [
"MIT"
] | null | null | null | web/themes/custom/particle/apps/pl-default/pattern-lab/_patterns/01-atoms-demo/aaronpero-button/index.js | teodyseguin/aaronpero | aa5e899f60a5a72d3902c1d0dd5ec0e93a2211f7 | [
"MIT"
] | 6 | 2021-01-18T00:20:51.000Z | 2021-02-09T00:30:56.000Z | web/themes/custom/particle/apps/pl-default/pattern-lab/_patterns/01-atoms-demo/aaronpero-button/index.js | teodyseguin/aaronpero | aa5e899f60a5a72d3902c1d0dd5ec0e93a2211f7 | [
"MIT"
] | null | null | null | /**
* Demo of aaronpero-button. Pulls in aaronpero-button assets, and provides demo-only assets.
*
* (This file is NOT imported by the design system, but is included as part of
* a Pattern Lab app.)
*/
// Import component assets
import 'atoms/aaronpero-button';
// Import demo assets
import './aaronpero-buttons.twig';
import './aaronpero-buttons.yml';
| 25.714286 | 93 | 0.725 |
a1c596056d46b1759c32780479130abd01c541ff | 4,089 | js | JavaScript | src/EdgeSlice.js | BenjaminMichaelis/graph-sketchpad | f8fb1a34e7735ab0abc20117b6a6897170333150 | [
"MIT"
] | 1 | 2022-01-20T07:01:12.000Z | 2022-01-20T07:01:12.000Z | src/EdgeSlice.js | BenjaminMichaelis/graph-sketchpad | f8fb1a34e7735ab0abc20117b6a6897170333150 | [
"MIT"
] | 18 | 2022-01-26T18:19:56.000Z | 2022-03-31T18:20:19.000Z | src/EdgeSlice.js | BenjaminMichaelis/GraphSketchpad | f8fb1a34e7735ab0abc20117b6a6897170333150 | [
"MIT"
] | null | null | null | import React from "react";
import './Edge.css'
function EdgeSlice(props)
{
const {edge, onClick, offsetLeft, overlappingEdges} = props
const [start, end] = edge.endpoints
const isLoop = start === end;
const [x1, y1] = [start.position[0] - offsetLeft, start.position[1]]
const [x2, y2] = [end.position[0] - offsetLeft, end.position[1]]
const color = edge.color
const directedBool = edge.directedBool
let d;
// loop is determined if the start vertex is equal to the end vertex
if (isLoop)
{
const radii = 25 + (overlappingEdges * 10);
// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d
// M is (x, y)+
// a is (rx ry angle large-arc-flag sweep-flag dx dy)+
d = `M ${x1} ${y1}
A ${radii},${radii - 1} 1000 1 0 ${x1-1} ${y1-1}`
}
else
{
const magnitude = Math.sqrt(Math.pow(x1-x2, 2) + Math.pow(y1-y2, 2))
const [vx, vy] = [(y2-y1) / magnitude, -(x2-x1) / magnitude]
// -1 to keep alternating directions every time (left of central edge, then right, etc etc.)
const direction = Math.pow(-1, overlappingEdges) * (vx >= vy ? (vx === vy ? (x1 > x2 ? 1 : -1) : 1) : -1)
const distance = 25 * Math.ceil(overlappingEdges / 2)
const [midX, midY] = [(x1 + x2)/2, (y1 + y2)/2]
const [x3, y3] = [midX + (distance * direction * vx), midY + (distance * direction * vy)]
// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d
// M is (x, y)+
// Q is (x1,y1, x,y)+
d = `M ${x1} ${y1}
Q ${x3} ${y3} ${x2} ${y2}`
}
// function AngleBtw2Points()
// {
// const changeInX = x2 - x1
// const changeInY = y2 - y1
// let radians = (Math.atan2(changeInY,changeInX))
// let degrees = (radians * 180) / Math.PI - 90; // rotate
// console.log('angle to degree:',{changeInY,changeInX,radians,degrees})
// return degrees;
// }
// https://github.com/PimpTrizkit/PJs/wiki/12.-Shade,-Blend-and-Convert-a-Web-Color-(pSBC.js)#stackoverflow-archive-begin
// function shadeHexColor(shadeColor, percent)
// {
// var f=parseInt(shadeColor.slice(1),16),t=percent<0?0:255,p=percent<0?percent*-1:percent,R=f>>16,G=f>>8&0x00FF,B=f&0x0000FF;
// return "#"+(0x1000000+(Math.round((t-R)*p)+R)*0x10000+(Math.round((t-G)*p)+G)*0x100+(Math.round((t-B)*p)+B)).toString(16).slice(1);
// }
// function shadeRGBColor(shadeColor, percent)
// {
// var f=shadeColor.split(","),t=percent<0?0:255,p=percent<0?percent*-1:percent,R=parseInt(f[0].slice(4)),G=parseInt(f[1]),B=parseInt(f[2]);
// return "rgb("+(Math.round((t-R)*p)+R)+","+(Math.round((t-G)*p)+G)+","+(Math.round((t-B)*p)+B)+")";
// }
// var color1 = shade("rbg(63,131,163)", 0.5);
// var color2 = shade("#3f83a3", 0.5);
// function shade(shadeColor, percent)
// {
// if (shadeColor.length > 7 ) return shadeRGBColor(shadeColor,percent);
// else return shadeHexColor(shadeColor,percent);
// }
// var arrowColor = new shade(color, -.25)
if (directedBool)
{
return (
<svg>
<marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9.5" refY="2.625" orient="auto">
<polygon onMouseDown={onClick} fill='#F35347' points='0 0, 7.5 2.625, 0 5.25' />
</marker>
<path
marker-end='url(#arrowhead)'
onClick={onClick}
className='Edge-Slice'
fill='none'
stroke={color}
strokeWidth='3'
d={d}
/>
</svg>
)
}
else
{
return (
<path
onClick={onClick}
className='Edge-Slice'
fill='transparent'
stroke={color}
strokeWidth='3'
d={d}
/>
)
}
}
export default EdgeSlice; | 37.861111 | 148 | 0.523844 |
a1c638e5875efaec2ce76e8d23dd86fcee0d6400 | 101,478 | js | JavaScript | pc/js/app.2783ea08.js | renserve/music-pc | 0568926b85c122c6a6488704de79ae06a2426a22 | [
"MIT"
] | null | null | null | pc/js/app.2783ea08.js | renserve/music-pc | 0568926b85c122c6a6488704de79ae06a2426a22 | [
"MIT"
] | null | null | null | pc/js/app.2783ea08.js | renserve/music-pc | 0568926b85c122c6a6488704de79ae06a2426a22 | [
"MIT"
] | null | null | null | !function(t){function e(e){for(var a,r,s=e[0],c=e[1],u=e[2],l=0,p=[];l<s.length;l++)r=s[l],Object.prototype.hasOwnProperty.call(i,r)&&i[r]&&p.push(i[r][0]),i[r]=0;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(t[a]=c[a]);for(d&&d(e);p.length;)p.shift()();return o.push.apply(o,u||[]),n()}function n(){for(var t,e=0;e<o.length;e++){for(var n=o[e],a=!0,r=1;r<n.length;r++){var c=n[r];0!==i[c]&&(a=!1)}a&&(o.splice(e--,1),t=s(s.s=n[0]))}return t}var a={},r={app:0},i={app:0},o=[];function s(e){if(a[e])return a[e].exports;var n=a[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.e=function(t){var e=[];r[t]?e.push(r[t]):0!==r[t]&&{"chunk-041745da":1,"chunk-24ba7848":1,"chunk-27243663":1,"chunk-3545ba78":1,"chunk-3e295e7f":1,"chunk-465cfaa4":1,"chunk-59e7f854":1,"chunk-65c9cc8d":1,"chunk-66ebc058":1,"chunk-6fdf305e":1,"chunk-7076a988":1,"chunk-9966f012":1,"chunk-a17ab848":1,"chunk-bc5fe64c":1,"chunk-c4984362":1}[t]&&e.push(r[t]=new Promise((function(e,n){for(var a="css/"+({}[t]||t)+"."+{"chunk-041745da":"caae8205","chunk-24ba7848":"5b340c5b","chunk-27243663":"26da2421","chunk-3545ba78":"914985da","chunk-3e295e7f":"83300d6d","chunk-465cfaa4":"eadfae8d","chunk-59e7f854":"4b4dabbe","chunk-65c9cc8d":"f07865b8","chunk-66ebc058":"e2ca24ec","chunk-6fdf305e":"4df7bd3d","chunk-7076a988":"9df5c7ba","chunk-9966f012":"27807bff","chunk-a17ab848":"9c76c8bc","chunk-bc5fe64c":"bdf18c86","chunk-c4984362":"64bbc126"}[t]+".css",i=s.p+a,o=document.getElementsByTagName("link"),c=0;c<o.length;c++){var u=(d=o[c]).getAttribute("data-href")||d.getAttribute("href");if("stylesheet"===d.rel&&(u===a||u===i))return e()}var l=document.getElementsByTagName("style");for(c=0;c<l.length;c++){var d;if((u=(d=l[c]).getAttribute("data-href"))===a||u===i)return e()}var p=document.createElement("link");p.rel="stylesheet",p.type="text/css",p.onload=e,p.onerror=function(e){var a=e&&e.target&&e.target.src||i,o=new Error("Loading CSS chunk "+t+" failed.\n("+a+")");o.code="CSS_CHUNK_LOAD_FAILED",o.request=a,delete r[t],p.parentNode.removeChild(p),n(o)},p.href=i,document.getElementsByTagName("head")[0].appendChild(p)})).then((function(){r[t]=0})));var n=i[t];if(0!==n)if(n)e.push(n[2]);else{var a=new Promise((function(e,a){n=i[t]=[e,a]}));e.push(n[2]=a);var o,c=document.createElement("script");c.charset="utf-8",c.timeout=120,s.nc&&c.setAttribute("nonce",s.nc),c.src=function(t){return s.p+"js/"+({}[t]||t)+"."+{"chunk-041745da":"b86d5e2f","chunk-24ba7848":"98bbd028","chunk-27243663":"5cc7e038","chunk-3545ba78":"ee007d2c","chunk-3e295e7f":"55ac608f","chunk-465cfaa4":"7108f298","chunk-59e7f854":"bd69c38d","chunk-65c9cc8d":"956538f0","chunk-66ebc058":"7e0e143d","chunk-6fdf305e":"113158d1","chunk-7076a988":"11e11c7b","chunk-9966f012":"8a337272","chunk-a17ab848":"406f7f37","chunk-bc5fe64c":"1d0dffdc","chunk-c4984362":"559c591a"}[t]+".js"}(t);var u=new Error;o=function(e){c.onerror=c.onload=null,clearTimeout(l);var n=i[t];if(0!==n){if(n){var a=e&&("load"===e.type?"missing":e.type),r=e&&e.target&&e.target.src;u.message="Loading chunk "+t+" failed.\n("+a+": "+r+")",u.name="ChunkLoadError",u.type=a,u.request=r,n[1](u)}i[t]=void 0}};var l=setTimeout((function(){o({type:"timeout",target:c})}),12e4);c.onerror=c.onload=o,document.head.appendChild(c)}return Promise.all(e)},s.m=t,s.c=a,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)s.d(n,a,function(e){return t[e]}.bind(null,a));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="/",s.oe=function(t){throw t};var c=window.webpackJsonp=window.webpackJsonp||[],u=c.push.bind(c);c.push=e,c=c.slice();for(var l=0;l<c.length;l++)e(c[l]);var d=u;o.push([0,"chunk-vendors"]),n()}({0:function(t,e,n){t.exports=n("56d7")},"058a":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAJyklEQVR4Xu2dj9HWNgzGrQlaJihMUJigdILCBMAEpRMUJiidoDABMEFhgsIEhQlKJ1DvocpdMLbjxH8kJ87dewf3JU5s/SxLsi2Tm9elW4AuXftZeTcBuDgEE4AJwMVb4OLVnxpgAnDxFrh49acGmABcvAUuXv2pASYAF2+Bi1d/aoAJwPlbgJm/dc5975y7KT9U+q5X83fOuU/yw7/fExH+f+rrtBqAmX8SIUPQtw9K8YNz7o38Xp8RiFMBwMwQ9gPn3D3nHHp97eu5c+4VEb2uXbBWeacAgJkh9IcBtd6qXaEZnhDRi1Yv6FXu0ABIj/+tQMWXtjNA+IWIXpUWpPX8kACIUfeHqPq9bffROQfBLRcMvWW4gJH43d4CxUZ4RETrcg8U0/+R4QCQXv8yc4z/d2XEvSEiWPebFzPDaIQ9sfy+2Xzofw8C2gB2wjDXUAAwM9T944zWfeucWwy2YleOmWFUwsaAZ7F14b0Aofi9Wy+q8fchABCVD+FDCKkLRhmMsyaqmJkxRDwRTyP1HdA0P44AgXkARPh/bhh66PEQPHz25peAgJ7+Q+JlQ0BgGoBM4UPdPmsu9cALmBkaCe+O2QjmIbAOACz9mNqHNX8v17BrBYhoA7iBCDWHLtMQmAWAmdGzfo406ntY6FbGWNFUgCA2JCB6eL8VhCXlmgRArG64eqHLlPDXH8jMsAsQlQxdakNVChBzAIhK/Svi55sV/tLIzAxNEHMX72gPWT4MFgFAz4ff7V8Y829bUfuxXiXDAbyRkE3wjojulKjs2s+aAmBD9ZvrPQkIEC+A8RfyDkwNBdYA+Hu1YGPdvqYaLacXJmBGhPCWFU1mBgDxqeH2+RdW5hxd0JEjq2b3JOyBp0SEiKL6ZQmAWO8fRvX70hSDFvXyLzNawAQACXX5loj8tXvqvWbPByRcQ0wfq88cWgEg5j9jQqVLfH+PUPfcm9ACJjwCdQDEbfrnTGN/YCiIAQ5jsMnMZS6kFgCAzx+K+plQkbkNmbovMcSpezcWAIjF/G9YcZUqQQDDz48LYKl5KOhV45VZZVgAAGFf380b3vjLHQaISFUGqi9HIzEzB1A14ydndaOMmxJxDlU3VxUAWeCJ1T7+Nbz1H9AAcGdDdb2vuaxcG4CYAajaKzI69KFbLGo7bQAQDv3Vb03tcfGQdDMeYma4fP6+A9XhbgKQIbhatzAzglr+qiFVg9ciAB+JCNOpp7smAJ5ImTk0BKj2iJbUTQDyAPhERDdaCkKr7AlAHgDuxEZgyAZQjQZq2wBY8//VIpATA4BJLz9xxaW9gFhw5IyBIAg+NOt5aQBg7YdWzKhGx1rYCFajnqpDgMwFhGbJXhDR1k7gFnJqVmbE48H7VNcEWAAgtJHiAxHdaiYNhYIjHoB6zMMCAMFwsHbPqMlIYtWTuqazAADWAmBNgH+pGkeVAQh6O8459VVP6gCIHRCaJDnNMMDMoUUvqLr6qicrACDvD1LA+Jd6DynVBAnrX139o25WAIi5g8NrAWbGIpDQ3gYTrq4JAGQYiG2rHlYLJHq/uvW/aDZLAMSMQTPbqPYOB8wc2+5mBmozAIgWiG2gMJtiJQZFIsWNmd5vxgZYGlG2UQ2xrz6lDTbyHJia5zClAUQLxAJD+LOpxgtBIGlmYfiF0tWbsPzX320OAIEgNG+OP8EeAARZOX/3jtml92/kN0Le4pvWdjtZBQC9B8GhUIoVkxBIz8fahlgyC5NL3U0CIFogtlZg0QTwo01sHd9Q+/he9U2gMe1mFgCBIBZDX+qD/MBPS1V3yfPMjGSWsFtiR9SYG/fN2wDrD0zsqVtugxboflhD5qEVpoVvzg1M+NRbmgCPohf+3sPIyuj1+B7zwh8GgNVwkMrMvdgGuKc6CNLjkQEUoG1tXBlmKtu0DeBrBDG2EC2MZeZeP/L5xBDnHDaaHD69Q84fxCbWnKPo4Oo91Nztu9eeGQoA0QQwtiDcnONb1nYCbIXPp4MSEQ6Y+OoSwLB5E64cfnuydyCPMdLXq+b8OT0ASwVlpg0gHDnla287pe5Hr4c3onJoRWlFhtMAgWEBi0kwLuec7FXaXv7zOKPocckQU/uD9pY3NAASesVQAC+hVzpZ9Hj09uejqfsQHMMBsLLGF8NsL/RH78d5wZiWVs/uebQCQwMggkfUDSq/xcHQ6/ZBL4fBiN/n08NHVvMpYMxrgEqCX46LhYXuW+lwEdezi0jhethtrNk7e5RlFoACwS/HxSIGgEWlJiaMegjzyDtMAiAuHqZWtyJuS53Rw2GYZZ8PfKSxzviMKQCk1yNrWM75wOjp6OXPrC4QGQEYMwDs6PWLGwbBX2asbgWTCQBkdm0rkgbBI+hyKjeslWBzy1UHgJlTx8Mu9fhdwq2zx+dKNvM+NQAyF1RgggWzayYXgWa2senbVADIPBUcc/o5xqDpBk59nOwfQCgbsYnqaxhyGqY7ABnCx1iPadVT++/M7O+IVlnt3BWADOGbPxs4p1fl3BPJGdAdgm4ATOF/iQUzw64JrWzqCkEXADKEP8QCypyenXtPYAhYP9oNguYATOHHkUgcKomHumyL7wFALD8OKnm5nu/jsAEBhgnshWwW/2gKwEaQ5/LCX2DQhKAZAInMmLPnB0aFDQiw/OxRrn2x574mAGwkSDjtgRB7Gj507wYETdLKVAdgY4/8Zfz8ozBsQFB9i3kLAGJp0UwmSDgqqFbPideEKGgoRlA9bV5VABK+LYR/d07q5GGzkSup6r7DagAIuUiLFlqxazZBQp5I+t+VyDGIj6k2FNQEIJbibRp9B/lJpJrD2scfDxb7xWNVAEj0fqj+22fYQVOjsfeWIe2KYFBo/2OVgyZqARBL7VZ1vNrbgGe4P5EhpUogrRYAodOwptVficDImcMovTjdfDEAiaDP7P31AGh24EQNAGLGX5UxqlIbDl8MM4cO1yo+dLIGAKGM2O+JqNd27eGFm1OBRISwaBgoAkACFqFz/6bfnyPVHfckhtqi/MmlAFzm5M8dsmpya+LksaLOVgpA0P0769m/TSS7o9CIHVDkDpYCEDrmxdSBCDva1/ytLY6fLwUglNZ9hn4boRRZZFM0QzgBaCSsFsXGVlmVDLktAJgBoBbSd85ZBIADdZ0AXAiAUHRqAtAOAKTGe+kXrzkEhMLA1RYrNGrHYYuNrBQqMrpLbQCs/kFmjwfOOSRqQs7cmcGjIWJejmQkr0T+hMMbR4oAaFjPWXSnFpgAdGpoq6+ZAFiVTKfvmgB0amirr5kAWJVMp++aAHRqaKuvmQBYlUyn75oAdGpoq6+ZAFiVTKfvmgB0amirr5kAWJVMp++aAHRqaKuv+Q9SWAa9NOkGAwAAAABJRU5ErkJggg=="},"0828":function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return c})),n.d(e,"e",(function(){return u})),n.d(e,"c",(function(){return l})),n.d(e,"d",(function(){return d}));n("8e6e"),n("c5f6"),n("4917"),n("456d");var a=n("ade3"),r=(n("a481"),n("ac6a"),n("28a5"),n("41cb"));function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){Object(a.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.href;try{var n=e.split("?");if(!(n.length>1))return t?void 0:{};var a=n[1].split("&"),r={};return a.forEach((function(t){var e=t.split("=");r[e[0]]=decodeURI(e[1])})),t?r[t]:r}catch(e){return t?"":{}}}function c(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.href,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=s(void 0,e),i=e.split("?")[0];i=i.replace("#","");var c=o(o({},a),t),u=[];if(Object.keys(c).forEach((function(t){void 0!==c[t]&&""!==c[t]&&u.push("".concat(t,"=").concat(c[t]))})),!n)return"".concat(i,"?").concat(u.join("&"));r.a.push({path:u.length>0?"".concat(i,"?").concat(u.join("&")):i})}function u(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;return t.length>e?"".concat(t.substr(0,e-3),"..."):t}function l(t,e,n){var a=document.createElement("div");return a.innerHTML=t,a.innerHTML.split("\n").forEach((function(t){var a=t.match(/\[\d+:\d+.\d+\]/g);a&&a.forEach((function(r){var i=r.replace(/\[|\]/g,"").split(":"),o=t.replace(a.join(""),"").replace(/\/\//,"");if(o){var s=Number(6e4*i[0])+1e3*Number(i[1]);n[s]=n[s]||{},n[s][e]=o}}))})),n}var d=function(t){return t>1e7?"".concat(Number(t/1e6).toFixed(1),"m"):t>1e3?"".concat(Number(t/1e3).toFixed(1),"k"):t}},"091b":function(t,e,n){"use strict";n("87b6")},1353:function(t,e,n){},"3f0b":function(t,e,n){"use strict";n("6c7b"),n("a481");var a=n("4478"),r=(n("c5f6"),n("6b54"),n("42e1")),i=function(t){return(t=t.toString())[1]?t:"0".concat(t)},o=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,n=arguments.length>1?arguments[1]:void 0,o=e;try{if(n&&"string"==typeof n){for(var s=[],c=[["YYYY","YY"],["MM","M"],["DD","D"],["HH","H"],["mm","m"],["ss","s"]],u=0;u<8;)n.indexOf(c[u][0])>-1?s.push(Number(e.substr(n.indexOf(c[u][0]),c[u][0].length))):n.indexOf(c[u][1])>-1?(s.push(Number(e.substr(n.indexOf(c[u][1]),c[u][1].length))),"YY"===n.indexOf(c[u])&&(s[0]=Number("20"+e.substr(n.indexOf("YY"),2))),"yy"===n.indexOf(c[u])&&(s[0]=Number("20"+e.substr(n.indexOf("yy"),2)))):u+=6,u++;s[1]?s[1]--:s[1]=0,o=Object(a.a)(Date,s)}}catch(t){o=new Date}var l=new Date(o);return l.str=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"YYYY-MM-DD",e=t;return e=e.replace("YYYY",l.year).replace("yyyy",l.year).replace("YY",String(l.year).substr(-2)).replace("yy",String(l.year).substr(-2)).replace("MM",i(l.month)).replace("M",l.month).replace("DD",i(l.date)).replace("dd",i(l.date)).replace("D",l.date).replace("d",l.date).replace("HH",i(l.hour)).replace("H",l.hour).replace("mm",i(l.minute)).replace("m",l.minute).replace("ss",i(l.second)).replace("s",l.second)},l.to=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t(),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"str",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=e.time-l.time>0,o=e-l,s=[Object(r.a)(o/31536e6,0,i?-1:1),e.str()===l.str()?0:Object(r.a)(12*(e.year-l.year)+e.month-l.month+(e.date-l.date>0?.5:-.5),0,i?-1:1),Object(r.a)(o/864e5,0,i?-1:1),Object(r.a)(o/36e5,0,i?-1:1),Object(r.a)(o/6e4,0,i?-1:1),Object(r.a)(o/1e3,0,i?-1:1),o];if("str"===n){for(var c=a,u=["年","个月","天","小时","分钟","秒","毫秒"];void 0!==s[c];)s[c]&&(s="".concat(Math.abs(s[c])).concat(u[c]).concat(i?"后":"前"),c+=10),c+=1;"string"!=typeof s&&(s="刚刚")}else if("num"===n)return[s[a]]*(i?-1:1);return s},l.year=l.getFullYear(),l.month=l.getMonth()+1,l.date=l.getDate(),l.hour=l.getHours(),l.minute=l.getMinutes(),l.second=l.getSeconds(),l.time=l.getTime(),l.day=[{cn:"星期天",en:"Sunday",short:"日",value:0},{cn:"星期一",en:"Monday",short:"一",value:1},{cn:"星期二",en:"Tuesday",short:"二",value:2},{cn:"星期三",en:"Wednesday",short:"三",value:3},{cn:"星期四",en:"Thursday",short:"四",value:4},{cn:"星期五",en:"Friday",short:"五",value:5},{cn:"星期六",en:"Saturday",short:"六",value:6}][l.getDay()],l.todayStart=new Date(l.year,l.month-1,l.date).getTime(),l.todayEnd=new Date(l.year,l.month-1,l.date+1).getTime()-1,l.week=function(){var e=(l.date-l.day.value)/7;return e<=0?t([l.year,l.month,1]).from(-1).week():"".concat(l.str("yyyyMM")).concat(Math.round(e+.49))},l.dateObj=new Date(l.time),l.from=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"D",r=[l.year,l.month-1,l.date,l.hour,l.minute,l.second],i="YMDHms";return i.indexOf(n)<0?l:(r[i.indexOf(n)]+=e,t(Object(a.a)(Date,r)))},l};e.a=o},"41cb":function(t,e,n){"use strict";n("7f7f"),n("ac6a");var a=n("8bbf"),r=n.n(a),i=n("6389"),o=n.n(i),s=function(){return n.e("chunk-65c9cc8d").then(n.bind(null,"fddd"))};r.a.use(o.a);var c=new o.a({mode:"history",routes:[{path:"/simple",name:"simple",component:function(){return n.e("chunk-27243663").then(n.bind(null,"f138"))}},{path:"/singer",name:"singer",component:function(){return n.e("chunk-7076a988").then(n.bind(null,"7f43"))}},{path:"/recommend",name:"recommend",component:s},{path:"/comment",name:"comment",component:function(){return n.e("chunk-a17ab848").then(n.bind(null,"2d0c"))}},{path:"/",name:"home",component:function(){return n.e("chunk-9966f012").then(n.bind(null,"bb51"))}},{path:"/user/:uid?",name:"user",component:function(){return n.e("chunk-3545ba78").then(n.bind(null,"1511"))}},{path:"/playlist/detail",name:"playlistdetail",component:function(){return n.e("chunk-c4984362").then(n.bind(null,"c2f4"))},meta:{title:""}},{path:"/playlist",name:"playlist",component:s,meta:{title:"我的歌单"}},{path:"/search",name:"search",component:function(){return n.e("chunk-041745da").then(n.bind(null,"2d3b"))},meta:{title:"搜索"}},{path:"/album",name:"album",component:function(){return n.e("chunk-59e7f854").then(n.bind(null,"ee18"))}},{path:"/about",name:"About",component:function(){return n.e("chunk-6fdf305e").then(n.bind(null,"f820"))}},{path:"/download",name:"Download",component:function(){return n.e("chunk-3e295e7f").then(n.bind(null,"3971"))}},{path:"/mv",name:"Mv",component:function(){return n.e("chunk-24ba7848").then(n.bind(null,"c5fc"))}},{path:"/setting",name:"Setting",component:function(){return n.e("chunk-bc5fe64c").then(n.bind(null,"4ef5"))}},{path:"/feedback",name:"Feedback",component:function(){return n.e("chunk-66ebc058").then(n.bind(null,"6e7a"))}},{path:"/top",name:"Top",component:function(){return n.e("chunk-465cfaa4").then(n.bind(null,"ec27"))}}]});c.beforeEach((function(t,e,n){var a=window.VUE_APP;if(!a||!a.$store)return n();var r=a.$store.dispatch;switch(["Simple","Mv"].forEach((function(e){t.name!==e&&a.$store.getters.getMode===e.toLowerCase()&&r("updateMode","")})),t.name){case"user":case"Download":case"About":case"Mv":case"Feedback":case"Top":r("updateShowCover",!1);break;default:r("updateShowCover",!0)}n()})),e.a=c},"42e1":function(t,e,n){"use strict";n("c5f6");var a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t=Number(t||0);var a=.499999999;return Number((t+n*a).toFixed(e))};e.a=a},"4d80":function(t,e,n){"use strict";n("8e6e"),n("c5f6"),n("20d6"),n("ac6a"),n("456d");var a=n("ade3"),r=n("5880"),i=n("42e1");function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}var s={name:"Lyric",data:function(){return{lyricIndex:0,top:600,grab:!1,mouseY:0,mouseTop:0,mouseMove:0,protect:0,show:!1,centerTime:0,current:0}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){Object(a.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(r.mapGetters)({playNow:"getPlaying",percent:"getPlayingPercent"})),watch:{playNow:function(t){var e=t.lyricKeys,n=void 0===e?[]:e;this.protect=0,this.top=document.getElementsByClassName("lyric-content-container")[0].clientHeight/2-35,this.mouseTop=0,this.grab=!1,this.lyricIndex=n[0],this.mouseY=0},percent:function(){var t=this.playNow.lyric;if(t){var e=Object.keys(t),n=1e3*document.getElementsByClassName("played-audio")[0].currentTime,a=document.getElementsByClassName("lyric-content-container")[0].clientHeight,r=e.findIndex((function(t){return t-300>=n})),i=document.getElementsByClassName("lyric-item-now");this.current=n;var o=n;switch(r){case-1:o=e[e.length-1]||n;break;case 0:o=e[0];break;default:o=e[r-1]}this.lyricIndex=o,this.protect&&this.protect>=n-3e3||(this.protect=0,i&&i[0]&&!this.grab&&(this.top=a/2-i[0].offsetTop-35))}},top:function(t){var e=this,n=this.playNow,a=document.getElementsByClassName("lyric-content-container")[0];Object.keys(n.lyric||{}).forEach((function(n){var r=document.getElementsByClassName("lyric-item-".concat(n))[0];if(r){var i=r.offsetHeight,o=r.offsetTop+t-a.offsetHeight/2;o<0&&i+o>0&&(e.centerTime=Number(n/1e3))}}))}},created:function(){var t=this;setTimeout((function(){return t.show=!0}))},methods:{changeGrab:function(t){if(this.grab!==t){this.grab=t;var e=window.event.clientY;this.grab?(this.mouseY=e,this.mouseTop=this.top):(this.top+=this.mouseMove,this.mouseMove=0,this.protect=1e3*document.getElementsByClassName("played-audio")[0].currentTime)}},moveLyric:function(t){if(this.grab){var e=(t||window.event).clientY;this.top=this.mouseTop+e-this.mouseY}},formatTooltip:function(t){return"".concat(Object(i.a)(t/60,0,-1),":").concat(Object(i.a)(t%60,0)<10?"0".concat(Object(i.a)(t%60,0)):Object(i.a)(t%60,0))},playAtCenter:function(){var t=this;document.getElementsByClassName("played-audio")[0].currentTime=this.centerTime,this.grab=!1,setTimeout((function(){return t.protect=0}),200)}}},c=(n("552f"),n("2877")),u=Object(c.a)(s,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"lyric-content-container "+(t.show&&"show")},[n("div",{class:"lyric-list-container "+(t.grab?"grabbing":""),on:{mousedown:function(e){return t.changeGrab(!0)},mouseup:function(e){return t.changeGrab(!1)},mouseleave:function(e){return t.changeGrab(!1)},mousemove:t.moveLyric}},[t.playNow.lyric?n("div",{staticClass:"lyric-list",style:"top: "+t.top+"px;"},t._l(t.playNow.lyric,(function(e,a){return n("div",{class:"lyric-item lyric-item-"+a+" "+(a===t.lyricIndex?"lyric-item-now":"")},[n("div",{domProps:{innerHTML:t._s(e.str||"")}}),e.trans?n("div",{domProps:{innerHTML:t._s(e.trans)}}):t._e()])})),0):t._e()]),n("div",{directives:[{name:"show",rawName:"v-show",value:t.protect>0&&t.protect>=t.current-3e3||t.grab,expression:"protect > 0 && protect >= (current - 3000) || grab"}],staticClass:"play-line-center"},[n("hr"),n("div",{staticClass:"p-time-btn",on:{mouseover:function(e){return t.changeGrab(!0)},mouseleave:function(e){return t.changeGrab(!1)},click:t.playAtCenter}},[t._v("\n "+t._s(t.formatTooltip(t.centerTime))+"\n "),n("i",{staticClass:"iconfont icon-play"})])])])}),[],!1,null,null,null);e.a=u.exports},"552f":function(t,e,n){"use strict";n("83ea")},"56d7":function(t,e,n){"use strict";n.r(e);n("cadf"),n("551c"),n("f751"),n("097d");var a=n("8bbf"),r=n.n(a),i=(n("8e6e"),n("ac6a"),n("456d"),n("28a5"),n("4917"),n("ade3")),o=n("aa67"),s=(n("a481"),n("c5f6"),n("7f7f"),n("96cf"),n("1da1")),c=n("42e1"),u=n("5880"),l=n.n(u),d=n("ceb6"),p=n("0828"),f=n("53ca"),m=n("2909"),g={delDuplicate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[].concat(Object(m.a)(t),Object(m.a)(e)),a=[];return n.forEach((function(t){a.indexOf(t)<0&&a.push(t)})),a},delDuplicateObj:function(t,e){var n=[],a=[];return t.forEach((function(t){if("object"===Object(f.a)(t)){for(var r=t,i=0;i<e.length;i+=1)r=r[e[i]];-1===n.indexOf(r)&&(n.push(r),a.push(t))}})),a},objToArr:function(t){var e=[];return Object.keys(t).forEach((function(n){e.push(t[n])})),e},hasDuplicate:function(t,e){return 0!==g.getDuplicate(t,e).length},getDuplicate:function(t,e){var n=[];return t.forEach((function(t){e.indexOf(t)>-1&&n.push(t)})),n}},h=g,y=(n("6c7b"),n("34ef"),n("d4ec")),b=n("bee2"),w=function(){function t(){var e=this;Object(y.a)(this,t),Object(i.a)(this,"fftSize",256),Object(i.a)(this,"musicDataArray",new Uint8Array(0)),Object(i.a)(this,"otherData",{}),Object(i.a)(this,"drawMusicStyle","rect"),Object(i.a)(this,"drawMusicType",1);var n=document.getElementById("music-data-canvas");this.ctx=n.getContext("2d");var a=new(window.AudioContext||window.webkitAudioContext);this.actx=a,window.actx=a;var r=a.createAnalyser();this.playerAnalyser=r,r.fftSize=this.fftSize;var s=document.getElementById("m-player"),c=a.createMediaElementSource(s);if(s){c.connect(r),r.connect(a.destination),setTimeout((function(){return e.actx.resume()}),100),this.playerAnalyser=r,this.source=c;var u=r.frequencyBinCount;this.musicDataArray=new Uint8Array(u),this.drawType=o.a.get("drawMusicStyle"),this.quadraticCurve=this.quadraticCurve.bind(this)}}return Object(b.a)(t,[{key:"quadraticCurve",value:function(t){var e,n,a=t.x,r=void 0===a?[]:a,i=t.y,o=void 0===i?[]:i,s=t.strokeStyle,c=t.lineWidth,u=this.ctx,l=0,d=0,p=[],f=[];return u.beginPath(),u.strokeStyle=s,u.lineWidth=c,r.forEach((function(t,a){switch(e=(l+t)/2,n=(d+o[a])/2,a){case 0:break;case 1:u.beginPath(),u.moveTo(e,n);break;default:u.quadraticCurveTo(l,d,e,n)}l=t,d=o[a],e,n,e==e&&(p.push(e),f.push(n))})),u.stroke(),{x:p,y:f}}},{key:"drawLines",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.strokeStyle,a=e.lineWidth,r=this.ctx;t.forEach((function(t){var e=t.x,i=t.y,o=t.x1,s=t.y1,c=t.strokeStyle,u=t.lineWidth;r.strokeStyle=c||n,r.lineWidth=u||a,r.beginPath(),r.moveTo(e,i),r.lineTo(o,s),r.stroke()}))}},{key:"drawMusicRect",value:function(){var t,e=this,n=this.ctx,a=this.pageHeight;this.nowData.forEach((function(r,i){var o=e.getDrawData(i,["x","y","w","h"]),s=o.x,c=o.y,u=o.w,l=o.h;0===i&&((t=n.createLinearGradient(s,a,s,a/2)).addColorStop(0,"#409EFF33"),t.addColorStop(1,"#5cB87a33"),n.fillStyle=t),n.fillRect(s,c,u,l)}))}},{key:"drawMusicVoice",value:function(){var t,e=this,n=this.ctx,a=this.pageHeight;this.nowData.forEach((function(r,i){var o=e.getDrawData(i,["x","y","w","h"]),s=o.x,c=(o.y,o.w),u=o.h;(t=n.createLinearGradient(s,a,s,a/2)).addColorStop(0,"rgba(64,158,255,".concat(u/a/1.5+.1,")")),t.addColorStop(1,"rgba(92,184,122,".concat(u/a/10)),n.fillStyle=t,n.fillRect(s,0,c/.9,a)}))}},{key:"drawMusicParticle",value:function(){var t=this.otherData,e=this.nowData,n=this.pageWidth,a=this.pageHeight,r=this.fftSize,i=this.ctx;t.musicParticleList=t.musicParticleList||[];var o=t.musicParticleList;o.forEach((function(t){return t.move()})),e.map((function(t,e){t>0&&Math.random()<.02&&o.push(new v({pageWidth:n,pageHeight:a,fftSize:r,value:t,i:e,ctx:i}))})),t.musicParticleList=o.filter((function(t){return!t.disappear}))}},{key:"drawMusicLine",value:function(){var t=this,e=this.quadraticCurve,n=[],a=[],r=[],i=[];this.nowData.forEach((function(e,o){var s=t.getDrawData(o,["x","y1","y2"]),c=s.x,u=s.y,l=s.y1,d=s.y2;n.push(u),a.push(l),r.push(d),i.push(c)})),e({x:i,y:n,lineWidth:8,strokeStyle:"#409EFF33"}),e({x:i,y:a,lineWidth:3,strokeStyle:"#5cB87a33"}),e({x:i,y:r,lineWidth:5,strokeStyle:"#E6A23C33"})}},{key:"drawMusicCircle",value:function(){var t,e=this,n=this.nowData,a=this.pageWidth,r=this.pageHeight,i=this.ctx,o=this.fftSize,s=[];n.forEach((function(n,c){var u=e.getDrawData(c,["a","r","h"]),l=u.a,d=u.r,p=u.h;0===c&&((t=i.createRadialGradient(a/2,r/2,0,a/2,r/2,1.2*d)).addColorStop(0,"#409EFF00"),t.addColorStop(.5,"#409EFF66"),t.addColorStop(1,"#5cB87a66")),d*=.8,l>Math.PI||l<0||(s.push({x:a/2+Math.sin(l)*(d-10-p/20),y:r/2-Math.cos(l)*(d-10-p/20),x1:a/2+Math.sin(l)*(d+p/6),y1:r/2-Math.cos(l)*(d+p/6)}),l>0&&l<Math.PI&&s.push({x:a/2-Math.sin(l)*(d-10-p/20),y:r/2-Math.cos(l)*(d-10-p/20),x1:a/2-Math.sin(l)*(d+p/6),y1:r/2-Math.cos(l)*(d+p/6)}),l===Math.PI&&e.drawLines(s,{lineWidth:384/(o/2),strokeStyle:t}))}))}},{key:"drawMusicCircle2",value:function(){var t,e=this,n=this.nowData,a=this.fftSize,r=this.pageWidth,i=this.pageHeight,o=this.ctx,s=[];n.forEach((function(n,c){var u=e.getDrawData(c,["r","a","h"]),l=u.r,d=u.a;u.h;if(l*=.8*(1-c/(a/2))*(1-c/(a/2)),!((d*=4)>4*Math.PI||d<0)){if(d>0&&d<4*Math.PI){var p={x:r/2+Math.sin(d)*(l+2+n/256*l),y:i/2-Math.cos(d)*(l+2+n/256*l),x1:r/2+Math.sin(d)*l,y1:i/2-Math.cos(d)*l,lineWidth:Math.max(4*Math.PI*l/(a/2),1)};(t=o.createLinearGradient(p.x,p.y,p.x1,p.y1)).addColorStop(1,"#409EFF66"),t.addColorStop(0,"#5cB87a66"),p.strokeStyle=t,s.push(p)}d===4*Math.PI&&((t=o.createRadialGradient(r/2,i/2,0,r/2,i/2,1.5*l)).addColorStop(0,"#409EFF00"),t.addColorStop(.5,"#409EFF66"),t.addColorStop(1,"#5cB87a66"),e.drawLines(s,{strokeStyle:t}))}}))}},{key:"getDrawData",value:function(t,e){var n=this.fftSize/2,a=this.nowData[t],r=this.pageWidth,i=this.pageHeight,o=this.drawMusicType,s={},c=function(t,e){if(0===t)return 0;var n=t+30*Math.random()-e;return n<0?0:n>255?255:n};return e.forEach((function(e){switch(e){case"x":s[e]=r*t/n;break;case"y":s[e]=i-80-a/256*i/2;break;case"y1":s[e]=i-80-c(a,12)/256*i/2;break;case"y2":s[e]=i-80-c(a,18)/256*i/2;break;case"w":s[e]=.9*r/n;break;case"h":s[e]=a/256*i/2;break;case"a":var u=Math.PI/(n/4*3);s[e]={1:u*t,2:u*(t-n/8)}[o];break;case"r":s[e]=i/4}})),s}},{key:"draw",value:function(t){this.pageWidth=window.innerWidth,this.pageHeight=window.innerHeight;var e=this.ctx,n=this.pageWidth,a=this.pageHeight;if(t&&"0"!==o.a.get("showDrawMusic")){var r=this.musicDataArray;this.playerAnalyser.getByteFrequencyData(r);var i=o.a.get("drawMusicType"),s=o.a.get("drawMusicStyle");this.drawMusicType=i,this.drawMusicStyle!==s&&(this.drawMusicStyle=s,this.otherData={}),this.nowData=Object(m.a)(r);var c=this.nowData;2===Number(i)&&(this.nowData=[].concat(Object(m.a)(c.reverse()),Object(m.a)(c.reverse())).filter((function(t,e){return e%2}))),e.clearRect(0,0,n,a),this[{rect:"drawMusicRect",line:"drawMusicLine",circle:"drawMusicCircle",circle2:"drawMusicCircle2",particle:"drawMusicParticle",line2:"drawMusicLine2",voice:"drawMusicVoice"}[this.drawMusicStyle]||"drawMusicRect"]()}else e.clearRect(0,0,n,a)}}]),t}(),v=function(){function t(e){var n=e.pageWidth,a=e.pageHeight,r=e.fftSize,o=e.value,s=e.ctx,c=e.i;Object(y.a)(this,t),Object(i.a)(this,"disappear",!1),this.data={x:n*c/(r/2),y:a,r:5*Math.random()+o/256*7,t:o/256*100,vx:5*Math.random()-3,tx:Math.random()>.5,vy:2*Math.random()+2,type:"particle"},this.ctx=s,this.draw()}return Object(b.a)(t,[{key:"move",value:function(){var t=this.data;t.t<1||t.r<2?this.disappear=!0:(t.x+=t.vx,t.y-=t.vy,t.t=Math.min(t.t-.4,.99*t.t),t.r*=.99,Math.abs(t.vx)>3&&(t.tx=!t.tx),t.vx+=.1*(2*Number(t.tx)-1),this.draw())}},{key:"draw",value:function(){var t=this.ctx,e=this.data;t.lineCap="butt",t.beginPath(),t.arc(e.x,e.y,e.r,0,2*Math.PI),t.fillStyle="rgba(255,255,255,".concat(e.t/100,")"),t.fill()}}]),t}();function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function _(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach((function(e){Object(i.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var S,A={name:"PlayerPage",data:function(){return{playerDom:null,currentTime:0,volume:0,rate:1,stopUpdateCurrent:!1,showVolume:!1,showOrder:!1,showMore:!1,showRateSlider:!1,orderList:["suiji","danquxunhuan","liebiao"],orderType:o.a.get("orderType"),showControl:!Object(p.b)("hideControl"),playerInfo:{current:0,duration:0},playingId:0,playingPlatform:"",listId:0,keys:[],errorId:"",playingUrl:"",isUpdating:!1,openAudioCtx:!1,canUseAudioCtx:!1,moreList:[{key:"share",text:"分享"},{key:"down-lyric",text:"歌词"},{key:"home",text:"主页"},{key:"adjust",text:"倍速"}],vBind:{}}},computed:_(_({},Object(u.mapGetters)({playNow:"getPlaying",playing:"isPlaying",downloading:"isDownloading",loading:"isLoading",allSongs:"getAllSongs",radioInfo:"getRadioInfo",userList:"getUserList",allList:"getAllList",user:"getUser",playingListId:"getPlayingListId",isPersonFM:"isPersonFM",playingList:"getPlayingList",mode:"getMode",favSongMap:"getFavSongMap"})),{},{usingAudioContext:function(){return this.openAudioCtx&&this.canUseAudioCtx}}),watch:{playNow:(S=Object(s.a)(regeneratorRuntime.mark((function t(e){var n,a,r,i,u,l,p,f,m,g,h,y,b,w,v,O,_,S,A,k,L,E,P,I,C,x,j,M,D=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return");case 2:if(n=this.listId,a=this.playingId,r=this.playerInfo,i=this.isPersonFM,u=this.playingList,l=this.playingPlatform,p=this.isUpdating,f=this.pDom,m=e.id,g=e.lyric,h=e.name,y=e.comments,b=e.songid,w=e.br,v=e.pUrl,O=e.aId,_=e.al,S=void 0===_?{}:_,A=e.ar,k=void 0===A?[]:A,L=e.url,E=this.$store.dispatch,P=o.a.get("listenSize")||"128",!p){t.next=9;break}return t.abrupt("return");case 9:if("mediaSession"in navigator&&window.MediaMetadata&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:h,artist:k.map((function(t){return t.name})).join("/"),album:S.name,artwork:[{src:S.picUrl||"http://p2.music.126.net/ftPcA5oCeIQxhiNmEpmtKw==/109951163926974610.jpg",sizes:"96x96"},{src:S.picUrl||"http://p2.music.126.net/ftPcA5oCeIQxhiNmEpmtKw==/109951163926974610.jpg",sizes:"128x128"},{src:S.picUrl||"http://p2.music.126.net/ftPcA5oCeIQxhiNmEpmtKw==/109951163926974610.jpg",sizes:"192x192"},{src:S.picUrl||"http://p2.music.126.net/ftPcA5oCeIQxhiNmEpmtKw==/109951163926974610.jpg",sizes:"256x256"},{src:S.picUrl||"http://p2.music.126.net/ftPcA5oCeIQxhiNmEpmtKw==/109951163926974610.jpg",sizes:"384x384"},{src:S.picUrl||"http://p2.music.126.net/ftPcA5oCeIQxhiNmEpmtKw==/109951163926974610.jpg",sizes:"512x512"}]})),v===this.playingUrl&&this.playingUrl||!L){t.next=31;break}if(this.clearOldAudio(),E("setLoading",!0),this.isUpdating=!0,I={128:128e3,320:32e4,flac:96e4}[P],C=L,x=w,!(v&&Number(w)===I||"128"===P)){t.next=21;break}C=v||L,x=I,t.next=26;break;case 21:return t.next=23,Object(d.g)(O,P);case 23:j=t.sent,C=j.url||L,x=j.br;case 26:return this.isUpdating=!1,this.playingUrl=C,this.canUseAudioCtx=-1===C.indexOf("qq.com"),this.$nextTick(Object(s.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return window.pDom=document.getElementsByClassName("played-audio")[0],D.playerDom=window.pDom,D.audioBind(),f&&f.pause(),t.next=6,E("updateSongDetail",{pUrl:C,br:x,id:m,aId:O});case 6:D.playing&&D.playerDom.play();case 7:case"end":return t.stop()}}),t)})))),t.abrupt("return");case 31:if(this.playingUrl||setTimeout((function(){D.playingUrl||D.cutSong("playNext")}),1e3),i&&u.index>=u.raw.length-2&&this.getPersonFM(),String(m)!==String(a)){t.next=35;break}return t.abrupt("return");case 35:r.current>0&&"163"===l&&((M=("daily"===n?"":n)||"")||(M=this.allSongs["163_".concat(a)].al.id),Object(d.c)({api:"SCROBBLE",data:{id:a,sourceid:String(M).replace("".concat(l,"_"),""),time:Object(c.a)(r.current)}})),E("updatePlayingPercent",0),document.title=h,this.$nextTick((function(){window.pDom&&(window.pDom.playbackRate=D.rate),window.pDom&&(window.pDom.volume=o.a.get("volume")||1)})),this.currentTime=0,this.playingId=m,this.playingPlatform=e.platform||"163",this.listId=this.playingListId;try{document.getElementById("play-music-bg").src="".concat(this.allSongs[O].al.picUrl||"http://p2.music.126.net/ftPcA5oCeIQxhiNmEpmtKw==/109951163926974610.jpg","?param=1440y1440")}catch(t){document.getElementById("play-music-bg").src="http://p2.music.126.net/ftPcA5oCeIQxhiNmEpmtKw==/109951163926974610.jpg"}if(e.miguId&&this.playing&&setTimeout((function(){D.playerDom.play()}),1),g||Object(d.o)(O),y){t.next=54;break}t.t0=e.platform,t.next="qq"===t.t0?50:"migu"===t.t0?52:53;break;case 50:return Object(d.c)({api:"QQ_GET_COMMENT",data:{id:b}}).then((function(t){var e={hot:Object(d.k)(t.data.hotComment.commentlist),latest:Object(d.k)(t.data.comment.commentlist),total:t.data.comment.commenttotal,offset:20};E("updateSongDetail",{comments:e,aId:O})})).catch((function(){E("updateSongDetail",{comments:{hot:[],latest:[],total:0,offset:20},aId:O})})),t.abrupt("break",54);case 52:return t.abrupt("break",54);case 53:Object(d.c)({api:"MUSIC_COMMENTS",data:{offset:0,limit:20,id:m}}).then((function(t){var e={hot:t.hotComments||[],latest:t.comments||[],total:t.total,offset:20};E("updateSongDetail",{id:m,comments:e,aId:O})}));case 54:case"end":return t.stop()}}),t,this)}))),function(t){return S.apply(this,arguments)}),openAudioCtx:function(){var t=this;this.clearOldAudio(),this.$nextTick((function(){window.pDom=document.getElementsByClassName("played-audio")[0],t.playerDom=window.pDom,t.audioBind()}))}},mounted:function(){var t=this;window.UPDARE_PLAYING_STATUS=this.updatePlayingStatus,this.playerDom=document.getElementsByClassName("played-audio")[0],this.playerDom.volume=o.a.get("volume")||1,this.volume=100*(o.a.get("volume")||1),window.pDom=this.playerDom;var e=document.getElementsByClassName("el-slider__button el-tooltip")[0];if(window.onhashchange=function(){return t.showControl=!Object(p.b)("hideControl")},window.AudioContext||window.webkitAudioContext){this.drawMusic=new w;window.requestAnimationFrame((function e(){t.openAudioCtx="0"!==o.a.get("useAudioContext"),t.drawMusic&&t.drawMusic.draw(t.usingAudioContext),window.requestAnimationFrame(e)}))}e&&(e.onmousedown=function(){return t.stopUpdateCurrent=!0}),window.onkeydown=function(e){var n=e.keyCode,a=e.target,r=e.ctrlKey,i=e.altKey,s=e.shiftKey;if(!(["textarea","input"].indexOf(a.nodeName.toLowerCase())>-1)){var u=o.a.get("key_code_map",!0),l=[];r&&l.push("ctrl"),i&&l.push("alt"),s&&l.push("shiftKey"),-1===[16,17,18].indexOf(n)&&l.push(n);var d=100*o.a.get("volume");switch(l.join("-")){case u.VOLUME_DOWN:return d=Math.max(d-5,0),t.changeVolume(d),t.$message.info("音量调至".concat(Object(c.a)(d,0),"%")),!1;case u.VOLUME_UP:return d=Math.min(d+5,100),t.changeVolume(d),t.$message.info("音量调至".concat(Object(c.a)(d,0),"%")),!1;case u.PLAY_PREV:return t.cutSong("playPrev"),!1;case u.PLAY_NEXT:return t.cutSong("playNext"),!1;case u.PLAY:return t.updatePlayingStatus(!t.playing),!1;case u.TO_SIMPLE||"ctrl-83":return t.$router.push("/simple"),!1;case u.QUIT_SIMPLE||"27":return"simple"===t.mode&&t.$router.push("/"),!1}}},window.onkeypress=window.onkeydown,window.onkeyup=function(e){var n=e.keyCode;t.keys=t.keys.filter((function(t){return t!==n}))}},methods:{clearOldAudio:function(){var t=window.pDom;t&&(t.muted=!0,t.onended=null,t.ontimeupdate=null,t.onerror=null,t.oncanplaythrough=null)},audioBind:function(){var t=this,e=this.$store.dispatch,n=window.pDom;n.muted=!1,n.oncanplaythrough=function(){t.playingUrl===t.playNow.pUrl&&(e("setLoading",!1),t.playing&&n.play()),t.playerInfo={duration:n.duration,current:0},e("updatePlayingPercent",0)},n.onerror=function(){var n=t.playNow,a=n.id,r=n.aId;if(a){if(t.errorId===a)return t.cutSong("playNext");switch(t.errorId=a,e("setLoading",!0),setTimeout((function(){window.pDom.error&&t.cutSong("playNext")}),5e3),t.playNow.platform){case"qq":case"migu":e("updateSongDetail",{id:a,purl:"",aId:r});break;default:Object(d.c)({api:"SONG_URL",data:{id:a}}).then((function(n){var i=n.data[0],o=i.url,s=i.br;if(!o)return t.cutSong("playNext");e("updateSongDetail",{url:o,br:s,id:a,pUrl:o,aId:r})}))}}},"mediaSession"in navigator&&(navigator.mediaSession.setActionHandler("play",(function(){return t.updatePlayingStatus(!0)})),navigator.mediaSession.setActionHandler("pause",(function(){return t.updatePlayingStatus(!1)})),navigator.mediaSession.setActionHandler("previoustrack",(function(){return t.cutSong("playPrev")})),navigator.mediaSession.setActionHandler("nexttrack",(function(){return t.cutSong("playNext")}))),n.onended=function(){"danquxunhuan"!==t.orderType?e("playNext"):n.play()},n.ontimeupdate=function(){!t.stopUpdateCurrent&&(t.currentTime=t.playNow.url?n.currentTime:0),t.playerInfo={current:t.currentTime,duration:n.duration},e("updatePlayingPercent",t.playerInfo.current/t.playerInfo.duration)}},formatTooltip:function(t){return"".concat(Object(c.a)(t/60,0,-1),":").concat(Object(c.a)(t%60,0)<10?"0".concat(Object(c.a)(t%60,0)):Object(c.a)(t%60,0))},changeVolume:function(t){this.playerDom.volume=t/100,this.volume=Object(c.a)(t,0),o.a.set("volume",t/100)},changeOrderType:function(t){this.orderType=t,o.a.set("orderType",t),this.$store.dispatch("updateRandomHistory")},updatePlayingStatus:function(t){"play"===t&&window.actx&&window.actx.resume(),this.playerDom[["pause","play"][Number(t)]](),this.$store.dispatch("updatePlayingStatus",t)},cutSong:function(t){window.actx&&window.actx.resume(),this.$store.dispatch(t)},down:d.e,likeMusic:d.m,goTo:function(t){this.$router.push(t.replace("#",""))},playlistTracks:function(t,e,n){window.event.stopPropagation(),this.$store.dispatch("setOperation",{data:{tracks:t,op:e},type:n})},goBack:function(){history.back(-1)},getPersonFM:function(t){var e=this;Object(d.h)().then((function(n){var a=n.map((function(t){return t.id}));e.$store.dispatch("setPersonFM",a),h.hasDuplicate(a,e.playingList.raw)&&!t&&e.getPersonFM(!0)}))},copyUrl:function(){document.getElementById("cp-share-input").select(),document.execCommand("Copy"),this.$message.success("复制链接成功,去分享吧")},changeUrlQuery:p.a,handleClickMore:function(t){var e=this.playNow;switch(t){case"share":this.copyUrl();break;case"down-lyric":Object(d.d)(e);break;case"home":window.location="/";break;case"adjust":this.showMore=!1,this.showRateSlider=!0}}}},k=(n("74c9"),n("2877")),L=Object(k.a)(A,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"player-container"},[t.showControl&&t.playNow&&t.playNow.id?n("div",[n("div",{staticClass:"control-btn"},[n("div",{staticClass:"inline-block"},[n("i",{staticClass:"icon-shangyishou1 iconfont",on:{click:function(e){return t.cutSong("playPrev")}}})]),t.playing?t._e():n("div",{staticClass:"inline-block"},[n("i",{staticClass:"iconfont icon-bofang",on:{click:function(e){return t.updatePlayingStatus(!0)}}})]),t.playing?n("div",{staticClass:"inline-block"},[n("i",{staticClass:"iconfont icon-zanting1",staticStyle:{"font-size":"34px"},on:{click:function(e){return t.updatePlayingStatus(!1)}}})]):t._e(),n("div",{staticClass:"inline-block"},[n("i",{staticClass:"icon-xiayishou1 iconfont",on:{click:function(e){return t.cutSong("playNext")}}})])]),n("div",{staticClass:"inline-block progress-container"},[n("div",{staticClass:"song-info"},[t.loading?n("i",{staticClass:"el-icon-loading mr_10"}):t._e(),n("span",{staticClass:"player-song-title pointer",on:{click:function(e){return t.goTo("#/")}}},[t._v(t._s(t.playNow.name))]),n("span",{staticClass:"player-song-singer pl_20 pointer"},t._l(t.playNow.ar,(function(e){return n("router-link",{key:e.id,attrs:{to:t.changeUrlQuery({id:e.id,mid:e.mid,from:t.playNow.platform},"#/singer",!1)}},[t._v(t._s(e.name)+" ")])})),1),t.favSongMap[t.playNow.platform]?n("span",{class:t.favSongMap[t.playNow.platform][t.playNow.aId]?"iconfont icon-like iconfont":"iconfont icon-unlike",staticStyle:{"margin-left":"25px",cursor:"pointer"},on:{click:function(e){return t.likeMusic(t.playNow.aId)}}}):t._e()]),n("div",{staticClass:"play-time"},[n("span",[t._v("\n "+t._s(t.formatTooltip(t.currentTime))+"\n /\n "+t._s(t.formatTooltip(t.playerInfo.duration))+"\n ")])]),n("div",{staticClass:"progress",attrs:{id:"player-progress"}},[n("el-slider",{attrs:{"format-tooltip":t.formatTooltip,max:t.playerInfo.duration||1},on:{change:function(e){return t.playerDom.currentTime=e}},model:{value:t.currentTime,callback:function(e){t.currentTime=e},expression:"currentTime"}})],1)]),n("div",{staticClass:"other-control inline-block"},[n("div",{staticClass:"volume-control",on:{mouseleave:function(e){t.showVolume=!1}}},[t.showVolume?n("div",{staticClass:"volume-slider-container",on:{mouseleave:function(e){t.showVolume=!1},mouseover:function(e){t.showVolume=!0}}},[n("div",{staticClass:"volume-slider"},[n("el-slider",{attrs:{vertical:!0,height:"80px",max:100},on:{input:t.changeVolume},model:{value:t.volume,callback:function(e){t.volume=e},expression:"volume"}})],1)]):t._e(),n("i",{staticClass:"iconfont icon-volume",on:{mouseover:function(e){t.showVolume=!0}}})]),n("div",{staticClass:"order-control",on:{mouseleave:function(e){t.showOrder=!1}}},[t.showOrder?n("div",{staticClass:"order-list-container",on:{mouseleave:function(e){t.showOrder=!1},mouseover:function(e){t.showOrder=!0}}},[n("div",{staticClass:"order-list"},t._l(t.orderList,(function(e){return t.orderType!==e?n("div",{key:"order-"+e,on:{click:function(n){return t.changeOrderType(e)}}},[n("i",{class:"iconfont icon-"+e})]):t._e()})),0)]):t._e(),n("div",{staticClass:"now-order-type",on:{mouseover:function(e){t.showOrder=!0}}},[n("i",{class:"iconfont icon-"+t.orderType})])]),n("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"下载",placement:"top"}},[n("div",{staticClass:"inline-block ml_5 pd_5"},[n("span",{on:{click:function(e){return t.down(t.playNow.aId)}}},[n("i",{staticClass:"iconfont icon-download ft_16 pointer"})])])]),n("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"添加到歌单",placement:"top"}},["migu"!==t.playNow.platform?n("div",{staticClass:"inline-block ml_5 pd_5"},[n("span",{on:{click:function(e){return t.playlistTracks(t.playNow.aId,"add","ADD_SONG_2_LIST")}}},[n("i",{staticClass:"iconfont icon-add ft_16 pointer"})])]):t._e()]),n("input",{attrs:{id:"cp-share-input"},domProps:{value:t.changeUrlQuery({shareId:t.playNow.id,from:t.playNow.platform,shareCid:t.playNow.cid},"http://music.renserve.com/",!1)}}),n("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"正在播放",placement:"top"}},[n("div",{staticClass:"inline-block ml_5 pd_5",on:{click:function(e){return t.goTo("#/playlist/detail?id=playing")}}},[n("span",[n("i",{staticClass:"iconfont icon-list ft_16 pointer"})])])]),n("div",{staticClass:"more-control",on:{mouseleave:function(e){t.showMore=!1}}},[t.showMore?n("div",{staticClass:"more-list-container",on:{mouseleave:function(e){t.showMore=!1},mouseover:function(e){t.showMore=!0}}},[n("div",{staticClass:"more-list"},t._l(t.moreList,(function(e){return n("div",{key:"more-key-"+e.key,on:{click:function(n){return t.handleClickMore(e.key)}}},[n("i",{class:"iconfont icon-"+e.key}),n("span",{staticStyle:{"padding-left":"5px"}},[t._v(t._s(e.text))])])})),0)]):t._e(),n("div",{staticClass:"ml_10",on:{mouseover:function(e){t.showMore=!0}}},[n("i",{staticClass:"iconfont icon-more"})]),t.showRateSlider?n("div",{staticClass:"rate-slider",on:{mouseleave:function(e){t.showRateSlider=!1}}},[n("el-slider",{attrs:{max:3,min:.3,step:.1},on:{input:function(e){return t.playerDom.playbackRate=e}},model:{value:t.rate,callback:function(e){t.rate=e},expression:"rate"}})],1):t._e()]),n("div",{staticClass:"back-container"},[n("router-link",{staticClass:"iconfont icon-feedback",attrs:{to:"/feedback"}}),n("div",{staticClass:"back-icon pointer",on:{click:t.goBack}},[n("i",{staticClass:"iconfont icon-arrow-left"}),t._v("\n BACK\n ")])],1)],1)]):t._e(),n("audio",{class:t.usingAudioContext&&"played-audio",attrs:{id:"m-player",crossOrigin:"anonymous",src:t.usingAudioContext&&t.playingUrl||"",controls:""}}),t.usingAudioContext?t._e():n("audio",t._b({class:!t.usingAudioContext&&"played-audio",attrs:{id:"v-player",src:t.playingUrl||"",controls:""}},"audio",t.vBind,!1))])}),[],!1,null,null,null).exports;function E(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}var P={name:"PageLeft",computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?E(Object(n),!0).forEach((function(e){Object(i.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(u.mapGetters)({user:"getUser",downloadInfo:"getDownloadInfo",mode:"getMode"})),created:function(){},methods:{goToUser:function(){if("simple"===this.mode)return this.$router.push("/");this.$router.push("/user")}}},I=(n("091b"),Object(k.a)(P,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"page-left-nav"},[a("div",{staticClass:"left-nav-bg"}),a("div",{staticClass:"avatar nav-line"},[t.user.avatarUrl?a("img",{staticClass:"avatar-img iconfont",attrs:{src:t.user.avatarUrl},on:{click:t.goToUser}}):t._e(),t.user.avatarUrl?t._e():a("img",{staticClass:"avatar-img iconfont",attrs:{src:n(t.$route.path.includes("simple")?"b6bc":"058a")},on:{click:t.goToUser}}),a("div",{staticClass:"icon-text",on:{click:t.goToUser}},[t._v(t._s(t.user.userId?t.user.nickname:"登录"))])]),a("div",{staticClass:"nav-line"},[a("router-link",{attrs:{to:"/search"}},[a("i",{staticClass:"iconfont icon-search"}),a("div",{staticClass:"icon-text"},[t._v("寻觅")])])],1),a("div",{staticClass:"nav-line"},[a("router-link",{attrs:{to:"/playlist"}},[a("i",{staticClass:"iconfont icon-playlist"}),a("div",{staticClass:"icon-text"},[t._v("歌单")])])],1),a("div",{staticClass:"nav-line"},[a("router-link",{attrs:{to:"/recommend"}},[a("i",{staticClass:"iconfont icon-recommend"}),a("div",{staticClass:"icon-text"},[t._v("推荐")])])],1),a("div",{staticClass:"nav-line"},[a("router-link",{attrs:{to:"/top"}},[a("i",{staticClass:"iconfont icon-top"}),a("div",{staticClass:"icon-text"},[t._v("榜单")])])],1),a("div",{staticClass:"nav-line"},[a("router-link",{attrs:{to:"/download"}},[a("el-badge",{staticClass:"item",attrs:{value:t.downloadInfo.count,hidden:0===t.downloadInfo.count}},[a("i",{staticClass:"iconfont icon-down"})]),a("div",{staticClass:"icon-text"},[t._v("下载")])],1)],1),a("div",{staticClass:"nav-line"},[a("router-link",{attrs:{to:"/setting"}},[a("i",{staticClass:"iconfont icon-setting"}),a("div",{staticClass:"icon-text"},[t._v("设置")])])],1),a("div",{staticClass:"nav-line"},[a("router-link",{attrs:{to:"/about"}},[a("i",{staticClass:"iconfont icon-version"}),a("div",{staticClass:"icon-text"},[t._v("关于")])])],1)])}),[],!1,null,null,null).exports),C=n("c36b");function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(Object(n),!0).forEach((function(e){Object(i.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var M,D={name:"Operation",data:function(){return{showDelSong:!1,showAddSong:!1,add2ListId:"",showList:{}}},computed:j({},Object(u.mapGetters)({operation:"getOperation",userList:"getUserList",qUserList:"getQUserList",allList:"getAllList",user:"getUser",allSongs:"getAllSongs"})),watch:{operation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.data,n=t.type;if(e){var a=this.allSongs[e.tracks].platform,r=this.user;switch(this.platform=a,a){case"qq":if("1"!==o.a.get("haveQCookie"))return this.$message.warning("请先去设置页设置好 Cookie");break;case"163":if(!r||!r.userId)return this.$message.warning("请先登录");break;default:return}switch(n){case"DEL_SONG":this.showDelSong=!0;break;case"ADD_SONG_2_LIST":this.showList=this.userList[a],this.showAddSong=!0}}}},methods:{clearOperation:function(){this.showDelSong=!1,this.showAddSong=!1,this.add2ListId="",this.$store.dispatch("setOperation",{})},handelPlayList:(M=Object(s.a)(regeneratorRuntime.mark((function t(e){var n,a,r,i,o,s,c,u,l,p,f,m,g=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.add2ListId=this.add2ListId||this.operation.data.pid,n=this.platform,a=this.add2ListId,r=this.operation,i=this.userList,o=this.allSongs,s=this.allList,c=r.type,u=r.data,e&&(l=j({},u),p="PLAYLIST_TRACKS","ADD_SONG_2_LIST"===c&&(l.pid=a),l.pid=l.pid.replace("".concat(n,"_"),""),l.tracks=l.tracks.replace("".concat(n,"_"),""),"qq"===n&&(p="ADD_SONG_2_LIST"===c?"QQ_SONG_LIST_ADD":"QQ_SONG_LIST_REMOVE",l.dirid=i.qq.obj["qq_".concat(l.pid)].dirid,l.mid=l.tracks,l.id=o[u.tracks].songid),f={qq:"操作失败",163:"操作失败:可能是歌曲下架了"}[n],m=function(){g.$message.success("操作成功!");var t=s[a]||[];"ADD_SONG_2_LIST"===r.type?t.unshift(r.data.tracks):"DEL_SONG"===r.type&&(t=t.filter((function(t){return t!==r.data.tracks}))),g.$store.dispatch("updateList",{songs:t,listId:a})},Object(d.c)({api:p,data:l}).then((function(t){return m()}),(function(t){var e=f;if("163"===n){if(t.data.body&&200===t.data.body.code)return m();e=t.data.message||t.data.body&&t.data.body.message||e}g.$message.error(e)}))),this.clearOperation();case 5:case"end":return t.stop()}}),t,this)}))),function(t){return M.apply(this,arguments)})}},N=(n("7e6d"),Object(k.a)(D,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"operation-dialog-container"},[n("el-dialog",{attrs:{title:"删除",visible:t.showDelSong,width:"30%"},on:{"update:visible":function(e){t.showDelSong=e}}},[n("span",[t._v("从歌单中删除?")]),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){return t.handelPlayList(!1)}}},[t._v("取 消")]),n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.handelPlayList(!0)}}},[t._v("确 定")])],1)]),n("el-dialog",{attrs:{title:"添加到 "+(t.add2ListId?t.showList.obj[t.add2ListId].name:""),visible:t.showAddSong,width:"30%"},on:{"update:visible":function(e){t.showAddSong=e}}},[n("div",{staticClass:"add-2-list hide-scroll"},t._l(t.showList.mine,(function(e,a){return n("div",{key:"list-"+a,class:"list-item "+(t.add2ListId===a&&"selected"),on:{click:function(e){t.add2ListId=a}}},[t._v("\n "+t._s(t.showList.obj[a].name)+"\n ")])})),0),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){return t.handelPlayList(!1)}}},[t._v("取 消")]),n("el-button",{attrs:{type:"primary",disabled:!t.add2ListId},on:{click:function(e){return t.handelPlayList(!0)}}},[t._v("确 定")])],1)])],1)}),[],!1,null,"4de05a01",null).exports),T=n("4d80"),U=n("f503");function Q(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}var R,G={name:"App",components:{Player:L,PageLeft:I,Playing:C.a,Operation:N,Lyric:T.a},data:function(){return{defaultActive:"/",pageWidth:window.innerWidth,pageHeight:window.innerHeight}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Q(Object(n),!0).forEach((function(e){Object(i.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(u.mapGetters)({allSongs:"getAllSongs",showCover:"isShowCoverImg",mode:"getMode",homeType:"getHomeType"})),created:function(){window.VUE_APP=this,window.QUERY_QQ_TIMES=1,o.a.set("haveQCookie","0");var t=document.cookie.match(/\suin=([^;]+)(;|$)/);t=t?t[1]:"";var e=window.location.href.match(/q=(\d+)/);t=e?e[1]:t,window.location.href.indexOf("q=")>-1&&(document.cookie="uin=".concat(t),window.location="http://".concat(window.location.host)),t&&"0"!==(o.a.get("openSetQCookie")||"0")&&Object(d.f)(t),Object(d.n)(),/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)&&this.$store.dispatch("updateMode","mobile"),this.defaultActive=window.location.hash.split("/")[1];navigator.userAgent.toLowerCase(),/macintosh|mac os x/i.test(navigator.userAgent);o.a.setDefault({listen_size:"size320",down_size:"high",down_high:"sizeflac",home_page:"PLAYING",volume:1,download_info:JSON.stringify({count:0,list:[]}),orderType:"liebiao",key_code_map:JSON.stringify({PLAY_NEXT:"39",PLAY_PREV:"37",VOLUME_UP:"38",VOLUME_DOWN:"40",PLAY:"32",QUIT_SIMPLE:"27",TO_SIMPLE:""}),openSetQCookie:0,showDrawMusic:"1",drawMusicType:1,downMusicName:"0",SHOW_SIMPLE_COVER:1,PLAY_MUSIC_FROM_PLAYLIST:"1",PLAY_MUSIC_FROM_LIST:"0"}),this.$store.dispatch("updateDownload",{status:"abortAll"}),Object(U.b)("newInfo")},mounted:function(){var t=this;window.onresize=function(){t.pageWidth=window.innerWidth,t.pageHeight=window.innerHeight}},methods:{}},B=(n("5c0b"),Object(k.a)(G,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{class:"mode-"+t.mode,attrs:{id:"app"}},[a("img",{staticClass:"app-bg",attrs:{src:n("a32f"),alt:""}}),a("img",{attrs:{id:"play-music-bg",alt:""}}),a("canvas",{attrs:{width:t.pageWidth,height:t.pageHeight,id:"music-data-canvas"}}),a("div",{staticClass:"main-container"},[t.showCover?a("div",{staticClass:"page-left-container"},["info"===t.homeType?a("Playing"):a("div",[a("Lyric")],1)],1):t._e(),a("router-view"),a("PageLeft"),a("Player"),a("Operation")],1)])}),[],!1,null,null,null).exports),Y=n("41cb"),F=n("5f72"),q=n.n(F),V=(n("8aa9"),{mode:"",allSongs:{},allList:{},user:{},userList:{},qUserList:{list:[],obj:{}},recommendList:{},search:{type:0,total:0,pageNo:1,keywords:"",platform:"163"},playingList:{raw:[],trueList:[],random:[],history:[],index:0,map:{}},playNow:{al:{},ar:[]},playingPercent:0,showCoverImg:!0,playingListId:"",heartMode:!1,operation:{},playing:!1,playerInfo:{duration:0,current:0,paused:!0},commentInfo:{type:0,id:0,val:"",title:"",open:!1},loading:!1,downloadInfo:o.a.get("download_info",!0,JSON.stringify({count:0,list:[]})),isPersonFM:!1,favSongMap:{163:{},qq:{}},topInfo:{platform:o.a.get("playlist_from")||"163","163id":"",qqid:"","163List":[],qqList:[]},homeType:o.a.get("showHomeType")||"info"}),H=(n("7514"),n("3b2b"),n("386d"),"SET_OPERATION"),W="SET_RECOMMEND_LIST",$="SET_LOADING",J="QUERY_163_LIST",z="UPDATE_LIST",K="SET_USER",X="SET_USER_LIST",Z="UPDATE_SEARCH",tt="UPDATE_PLAYING_LIST",et="UPDATE_RANDOM_LIST",nt="UPDATE_PLAYING_PERCENT",at="UPDATE_SHOW_COVER",rt="UPDATE_ALL_SONGS",it="UPDATE_RANDOM_HISTORY",ot="SET_DOWNLOADING",st="UPDATE_SONG_DETAIL",ct="PLAY_NEXT",ut="PLAY_PREV",lt="UPDATE_PLAYING_STATUS",dt="UPDATE_PLAY_NOW",pt="UPDATE_COMMENT_INFO",ft="UPDATE_DOWNLOAD",mt="PERSON_FM",gt="UPDATE_Q_USER_LIST",ht="UPDATE_MODE",yt="UPDATE_FAV_SONG_MAP",bt="UPDATE_TOP_INFO",wt="SET_HOME_TYPE";function vt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function Ot(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vt(Object(n),!0).forEach((function(e){Object(i.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var _t=(R={},Object(i.a)(R,H,(function(t,e){t.operation=e})),Object(i.a)(R,K,(function(t,e){t.user=e})),Object(i.a)(R,Z,(function(t,e){t.search=Ot(Ot({},t.search),e)})),Object(i.a)(R,nt,(function(t,e){t.playingPercent=e,t.downloading=!1})),Object(i.a)(R,J,(function(t,e){var n=t.allList,a=e.songs,r=void 0===a?[]:a,i=e.more,o=void 0!==i&&i,s=e.listId;s&&(n[s]=o?[].concat(Object(m.a)(n[s]),Object(m.a)(r)):r,t.allList=Ot({},n))})),Object(i.a)(R,z,(function(t,e){var n=t.allList,a=e.songs,r=void 0===a?[]:a,i=e.more,o=void 0!==i&&i,s=e.listId;s&&(n[s]=o?[].concat(Object(m.a)(n[s]),Object(m.a)(r)):r,t.allList=Ot({},n))})),Object(i.a)(R,X,(function(t,e){t.userList=Ot(Ot({},t.userList),e)})),Object(i.a)(R,W,(function(t,e){t.recommendList=Ot(Ot({},t.recommendList),e)})),Object(i.a)(R,"CHANGE_SEARCH_QUERY",(function(t,e){t.searchQuery=Ot(Ot({},t.searchQuery),e)})),Object(i.a)(R,"CHANGE_SHOW_COMMENT",(function(t){t.showComment=!t.showComment})),Object(i.a)(R,"UPDATE_SHOW_LIST",(function(t,e){e.more?t.showList=[].concat(Object(m.a)(t.showList),Object(m.a)(e.list)):t.showList=e.list,e.dissid&&(t.sysSongs[e.dissid]=t.showList)})),Object(i.a)(R,rt,(function(t,e){var n=t.playNow,a=void 0===n?{}:n,r=t.playingList,i=a.aId;t.allSongs=Ot(Ot({},t.allSongs),e),i&&JSON.stringify(a)!==JSON.stringify(t.allSongs[i])&&(t.playNow=t.allSongs[i]),h.hasDuplicate(Object.keys(e),r.raw.join(",").split(","))&&(r.trueList=r.raw.filter((function(e){return t.allSongs[e]&&t.allSongs[e].pUrl})),window.VUE_APP.$store.dispatch("updateRandomList"))})),Object(i.a)(R,"SEARCH_MUSIC",(function(t,e){var n=e.search,a=t.userList.selected.songs||[],r=new RegExp(n.replace(/\s/g,""),"i");t.showList=a.filter((function(t){return t.name.replace(/\s/g,"").match(r)||t.ar.map((function(t){return t.name})).join("").replace(/\s/g,"").match(r)||t.al.name.replace(/\s/g,"").match(r)}))})),Object(i.a)(R,ut,(function(t){var e=t.playingList,n=t.allSongs,a=t.playNow,r=e.history,i=e.index,s=e.trueList,c=e.random,u=a.aId,l=o.a.get("orderType");if(i>0){if(e.index-=1,!r[e.index]||!n[r[e.index]])return;return t.playNow=n[r[e.index]]}var d=0,p="suiji"===l?c:s;d=p.indexOf(u),-1===(d-=1)&&(d=p.length-1),p[d]&&n[p[d]]&&(t.playNow=n[p[d]],t.playingList.history.unshift(t.playNow.aId))})),Object(i.a)(R,ct,(function(t){var e=t.playingList,n=t.allSongs,a=t.playNow,r=void 0===a?{}:a,i=o.a.get("orderType"),s=e.history,c=e.index,u=e.trueList,l=e.random,d=r.aId;if(e.index+=1,c<s.length-1)return t.playNow=n[s[e.index]];d&&e.history[e.history.length-1]!==d&&e.history.push(d);var p=0;if(1===u.length)return window.VUE_APP.$message.info("还是这首!"),void window.pDom.play();switch(i){case"suiji":if(p=l.indexOf(d),(p+=1)===u.length&&(p=0),p!==u.length-1&&0!==p||window.VUE_APP.$store.dispatch("updateRandomList"),!n[l[p]])return;return t.playNow=n[l[p]];default:if(p=u.indexOf(d),(p+=1)===u.length&&(p=0),!n[u[p]])return;return t.playNow=n[u[p]]}})),Object(i.a)(R,it,(function(t,e){t.randomHistory=e||{list:[],index:-1}})),Object(i.a)(R,"UPDATE_PLAYER_INFO",(function(t,e){t.playerInfo=Ot(Ot({},t.playerInfo),e)})),Object(i.a)(R,ot,(function(t,e){t.downloading=e})),Object(i.a)(R,st,(function(t,e){var n=e.aId;t.allSongs[n]=Ot(Ot({},t.allSongs[n]||{}),e),t.playNow&&n!==t.playNow.aId||(t.playNow=t.allSongs[n]),t.allSongs=Ot({},t.allSongs),t.playingList.raw.indexOf(e)>-1&&(t.playingList.trueList=t.playingList.raw.filter((function(e){return t.allSongs[e].pUrl})),window.VUE_APP.$store.dispatch("updateRandomList"))})),Object(i.a)(R,lt,(function(t,e){t.playing=e})),Object(i.a)(R,dt,(function(t,e){var n=t.playingList,a=t.playNow;e&&e.aId&&(a.aId&&(n.history.push(a.aId),n.index+=1),t.playNow=e)})),Object(i.a)(R,tt,(function(t,e){var n=e.list,a=e.more,r=e.listId,i=e.heart,o=void 0!==i&&i,s=t.playingList,c=t.allSongs;a?s.raw=[].concat(Object(m.a)(s.raw),Object(m.a)(n)):(s.raw=n,s.history=[],s.index=0),t.isPersonFM=!1,t.playingListId=r,t.heartMode=o,s.raw=h.delDuplicate(s.raw),s.trueList=s.raw.filter((function(t){return c[t]&&c[t].pUrl})),window.VUE_APP.$store.dispatch("updateRandomList")})),Object(i.a)(R,et,(function(t){var e,n=t.playingList,a=t.playNow,r=Object(m.a)(n.trueList),i={};if(a){for(var o=r.length-1;o>1;o--){var s=Math.floor(Math.random()*o);e=r[s],r[s]=r[o],r[o]=e}r.forEach((function(t){return i[t]=!0}));var c=r.indexOf(a.aId);c>=0&&(e=r[0],r[0]=r[c],r[c]=e),n.random=Object(m.a)(r),n.map=i}})),Object(i.a)(R,at,(function(t,e){t.showCoverImg=e})),Object(i.a)(R,pt,(function(t,e){t.commentInfo=e})),Object(i.a)(R,ft,(function(t,e){if(e){var n=e.id,a=e.aId,r=e.p,i=e.l,s=e.t,u=e.ajax,l=e.status,d=e.errMsg,p=e.name,f=e.songId,m=e.br,g=e.from,h=e.songCid,y=e.song,b=t.downloadInfo,w=b.list.find((function(t){return n?t.id===n:t.songId===f})),v=(new Date).getTime();switch(l){case"init":b.list.unshift({status:l,from:g,aId:a,id:n,startTime:v,ajax:u,name:p,songId:f,songCid:h,br:m,song:y}),b.count++;break;case"initError":b.list.unshift({status:"error",from:g,aId:a,id:n,errMsg:d,name:p,song:y,songId:f,songCid:h,br:m,startTime:v,endTime:v});break;case"clickSuccess":w.status="clickSuccess",w.endTime=v,delete w.ajax,delete w.p,delete w.t,delete w.l;break;case"success":w.status="success",w.endTime=v,delete w.ajax,delete w.p,delete w.t,delete w.l;break;case"error":w.errMsg=d||"未知错误",w.endTime=v,delete w.ajax,delete w.p,delete w.t,delete w.l;break;case"progress":w.p=Object(c.a)(100*r,2),w.t=s,w.l=i,w.status="progress";break;case"clear":b.list=b.list.filter((function(t){return["init","progress"].indexOf(t.status)>0}));break;case"clearError":b.list=b.list.filter((function(t){return"error"!==t.status}));break;case"abort":w.ajax&&w.ajax.abort&&w.ajax.abort(),w.errMsg="主动结束",w.endTime=v,w.status="error",delete w.ajax,delete w.p,delete w.t,delete w.l;break;case"abortAll":b.list.forEach((function(t){["init","progress"].indexOf(t.status)>=0&&(t.ajax&&t.ajax.abort&&t.ajax.abort(),t.errMsg="主动结束",t.status="error",t.endTime=v,delete t.ajax,delete t.p,delete t.t,delete t.l)}))}b.count=b.list.filter((function(t){return["init","progress"].indexOf(t.status)>-1})).length,o.a.set("download_info",b,!0),t.downloadInfo=Ot({},b)}else{var O=o.a.get("download_info",!0);O.count=0,O.list.forEach((function(t){"progress"===t.status&&(t.status="error",t.errMsg="下载被中断了",delete t.ajax,delete t.p,delete t.t,delete t.l)})),t.downloadInfo=O}})),Object(i.a)(R,mt,(function(t,e){var n=t.playingList;if(t.isPersonFM){var a=h.delDuplicate(n.raw||[],e);n.raw=a,n.trueList=a,n.random=a}else n.raw=e,n.history=[],n.index=0,n.random=e,n.trueList=e;t.playingListId="",t.isPersonFM=!0})),Object(i.a)(R,gt,(function(t,e){t.qUserList=e})),Object(i.a)(R,ht,(function(t,e){t.mode=e})),Object(i.a)(R,$,(function(t,e){t.loading=e})),Object(i.a)(R,yt,(function(t,e){t.favSongMap=Ot(Ot({},t.favSongMap),e)})),Object(i.a)(R,bt,(function(t,e){t.topInfo=Ot(Ot({},t.topInfo),e)})),Object(i.a)(R,wt,(function(t,e){t.homeType=e})),R),St={setOperation:function(t,e){(0,t.commit)(H,e)},setRecommendList:function(t,e){(0,t.commit)(W,e)},setUser:function(t,e){(0,t.commit)(K,e)},query163List:function(t,e){(0,t.commit)(J,e)},updateList:function(t,e){(0,t.commit)(z,e)},setUserList:function(t,e){(0,t.commit)(X,e)},updateSearch:function(t,e){(0,t.commit)(Z,e)},updatePlayingList:function(t,e){(0,t.commit)(tt,e)},updateRandomList:function(t){(0,t.commit)(et)},updatePlayingPercent:function(t,e){(0,t.commit)(nt,e)},updateShowCover:function(t,e){(0,t.commit)(at,e)},updateDownSettingDialog:function(t,e){(0,t.commit)("SHOW_DOWN_SETTING",e)},updateRandomHistory:function(t,e){(0,t.commit)(it,e)},setDownLoading:function(t,e){(0,t.commit)(ot,e)},updateSongDetail:function(t,e){(0,t.commit)(st,e)},playPrev:function(t){(0,t.commit)(ut)},playNext:function(t){(0,t.commit)(ct)},updatePlayNow:function(t,e){(0,t.commit)(dt,e)},updateAllSongs:function(t,e){(0,t.commit)(rt,e)},updatePlayingStatus:function(t,e){(0,t.commit)(lt,e)},updateCommentInfo:function(t,e){(0,t.commit)(pt,e)},updateDownload:function(t,e){(0,t.commit)(ft,e)},setPersonFM:function(t,e){(0,t.commit)(mt,e)},updateQUserList:function(t,e){(0,t.commit)(gt,e)},updateMode:function(t,e){(0,t.commit)(ht,e)},setLoading:function(t,e){(0,t.commit)($,e)},updateFavSongMap:function(t,e){(0,t.commit)(yt,e)},updateTopInfo:function(t,e){(0,t.commit)(bt,e)},setHomeType:function(t,e){(0,t.commit)(wt,e)}};r.a.use(l.a);var At=new l.a.Store({state:V,mutations:_t,getters:{getMode:function(t){return t.mode},getQUserList:function(t){return t.qUserList},isHearMode:function(t){return t.heartMode},getPlayingList:function(t){return t.playingList},getPlayingListId:function(t){return t.playingListId},getOperation:function(t){return t.operation},getUser:function(t){return t.user},getUserList:function(t){return t.userList},getSearch:function(t){return t.search},getAllList:function(t){return t.allList},getRecommendList:function(t){return t.recommendList},getPlayingPercent:function(t){return t.playingPercent},getRadioInfo:function(t){return t.radioInfo},getAllSongs:function(t){return t.allSongs},isDownloading:function(t){return t.downloading},getPlaying:function(t){return t.playNow},isPlaying:function(t){return t.playing},isLoading:function(t){return t.loading},isShowCoverImg:function(t){return t.showCoverImg},getCommentInfo:function(t){return t.commentInfo},getDownloadInfo:function(t){return t.downloadInfo},isPersonFM:function(t){return t.isPersonFM},getFavSongMap:function(t){return t.favSongMap},getTopInfo:function(t){return t.topInfo},getHomeType:function(t){return t.homeType}},actions:St}),kt=null,Lt=function(t){kt&&kt.close(),kt=Object(F.Message)(t)};["error","success","info","warning"].forEach((function(t){Lt[t]=function(e){return"string"==typeof e&&(e={message:e}),e.type=t,Lt(e)}}));var Et=Lt;r.a.use(q.a,{size:"small"}),r.a.prototype.$message=Et,new r.a({store:At,router:Y.a,render:function(t){return t(B)}}).$mount("#app")},5880:function(t,e){t.exports=Vuex},"5c0b":function(t,e,n){"use strict";n("e332")},"5f72":function(t,e){t.exports=ELEMENT},6389:function(t,e){t.exports=VueRouter},"74c9":function(t,e,n){"use strict";n("1353")},"7e6d":function(t,e,n){"use strict";n("fc5b")},"83ea":function(t,e,n){},"87b6":function(t,e,n){},"89c0":function(t,e,n){"use strict";n("b443")},"8aa9":function(t,e,n){},"8bbf":function(t,e){t.exports=Vue},a32f:function(t,e,n){t.exports=n.p+"img/water-768745_1920.6e09db12.jpg"},aa67:function(t,e,n){"use strict";n("456d");var a=n("53ca"),r=(n("ac6a"),window.localStorage),i={get:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if("string"==typeof t){var a=r.getItem(t)||n;return e&&(a=JSON.parse(a)),a}var o={};return t.forEach((function(t){o[t]=i.get(t,e,n)})),o},set:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("object"===Object(a.a)(t))Object.keys(t).forEach((function(n){i.set(n,t[n],e)}));else if("string"==typeof t){var o=e;n&&(o=JSON.stringify(o)),r.setItem(t,o)}},setDefault:function(t,e){"object"===Object(a.a)(t)?Object.keys(t).forEach((function(e){return i.setDefault(e,t[e])})):"string"==typeof t&&(i.get(t)||i.set(t,e))}};e.a=i},b443:function(t,e,n){},b6bc:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAACfUlEQVRoQ+2YTYhOURjHf/8lFjasLFiQSNSkRimEsLIZu5GFItkxJSUxrJSvLJSFknws1EiNlcKShSgLZWnyVXY+yuqvU2f0et/7vvfOveeae+s923ue5zy/5+ue84iWL7XcfoYA8x3BYQSGEajogVpSyPZKYL+ksxXtyxVPDmD7AHARuN4qANsLgUvAkei2ydYA2N4Rjd/QEfN2ANg+DZzLSNZmA9heA1wBdveptOYC2D4I3MxpEc0DsL0YuAaETpO3mgVgew9wG1iaZ/lsFwK+AF+Bj8CMpM8FZQtvK/QfsH0BOFFYa/+NPyLQTEzBh5J+VtE7EMD2euAusK7KIQNkfwO3gGlJ02XO6Atg+3js7WX0lpF5DByV9GEuwj0AtpcA94Gdc1GUaO9b4LykB0X1/QNgexy4U1S4xn0nJYW6y11NBQiG75L0JI+gaSnUbe+IpNeDIJpUxFl2PpUULop913y30bwMCd8H1sP//pEVMbh7z3dgi6Q3WcKFAIJgiavE84wDVwHLSlBcljRRCSBCVL7M2V4ABJARYCuwDViRA/VJUiZ44Qh0HpD6Om17ExA8vG8AyJikqe7vpQBiNJI/aGwfAk4ByzNArko6lgxgVlHqJ6Xt1fGmurnL2ClJY8kBYjSSP+pt3wAOdxj8StLGWgAiRPKxiu0wGDsTjf4mqecxVboG+hVb6sGW7TAkm22hiyT96jw7OUCMRhgtjkuaLNHze0RsPwL2AmslvasdIIXRXW17FHgBbJf0rHUAMaqhHt5LutdKgAgxISnMX/+uWmogdQp1/HNGJb1sLUCWY1oVgSFAXbldRe8whap4L4XsMAIpvFhFR+sj8AdA0tIxq230ZgAAAABJRU5ErkJggg=="},c36b:function(t,e,n){"use strict";n("8e6e"),n("ac6a"),n("456d"),n("c5f6");var a=n("ade3"),r=n("5880"),i=n("0828");function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}var s={name:"Playing",computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){Object(a.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(r.mapGetters)({playNow:"getPlaying",percent:"getPlayingPercent",playing:"isPlaying",loading:"isLoading",allSongs:"getAllSongs"})),methods:{numberHandle:function(t){return t>1e3?"".concat(Number(t/1e3).toFixed(1),"k"):t},getBr:function(t){return t>32e4?"无损":"".concat(parseInt(t/1e3),"k")},changeUrlQuery:i.a}},c=(n("89c0"),n("2877")),u=Object(c.a)(s,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.playNow&&t.playNow.id?n("div",{staticClass:"playnow-container"},[t.playNow.al&&t.playNow.al.picUrl?n("div",{staticClass:"progress-container"},[n("el-progress",{staticStyle:{opacity:"0.5",position:"absolute",top:"10px",left:"10px"},attrs:{width:280,color:"#409EFFCC","stroke-width":10,type:"circle",percentage:100*(t.percent||0),"show-text":!1}}),n("el-image",{class:"progress-cover playing-"+(!t.loading&&t.playing),attrs:{src:t.playNow.al.picUrl}},[n("img",{attrs:{slot:"error",src:"http://p2.music.126.net/ftPcA5oCeIQxhiNmEpmtKw==/109951163926974610.jpg?param=300y300"},slot:"error"})])],1):t._e(),n("div",{staticClass:"song-info"},[n("div",{staticClass:"info-line"},[t._m(0),n("div",{staticClass:"info-val"},[t._v("\n "+t._s(t.playNow.name)+"\n "),t.playNow.br?n("span",{staticClass:"info-br"},[t._v(t._s(t.getBr(t.playNow.br)))]):t._e(),n("i",{class:"pl_10 iconfont icon-"+(t.playNow.platform||"163"),staticStyle:{"vertical-align":"-1px"}})])]),n("div",{staticClass:"info-line"},[t._m(1),n("div",{staticClass:"info-val"},t._l(t.playNow.ar,(function(e){return n("router-link",{key:e.id,attrs:{to:t.changeUrlQuery({id:e.id,from:t.playNow.platform,mid:e.mid},"#/singer",!1)}},[t._v(t._s(e.name)+" ")])})),1)]),t.playNow.al&&t.playNow.al.name?n("div",{staticClass:"info-line"},[t._m(2),n("div",{staticClass:"info-val"},[n("router-link",{attrs:{to:t.changeUrlQuery({id:t.playNow.al.id,mid:t.playNow.al.mid,from:t.playNow.platform},"#/album",!1)}},[t._v(t._s(t.playNow.al.name))])],1)]):t._e(),n("div",{staticClass:"btn-group"},[n("router-link",{staticClass:"btn-group-href",attrs:{to:"/"}},[n("i",{staticClass:"iconfont icon-lyric"})]),"migu"!==t.playNow.platform?n("router-link",{staticClass:"btn-group-href",attrs:{to:"/comment"}},[n("i",{staticClass:"iconfont icon-comment"}),t.playNow.comments?n("span",{staticClass:"pl_10 ft_12"},[t._v(t._s(t.numberHandle(t.playNow.comments.total)))]):t._e()]):t._e(),t.playNow.mvId?n("router-link",{staticClass:"btn-group-href",attrs:{to:t.changeUrlQuery({id:t.playNow.mvId,from:t.playNow.platform},"/mv",!1)}},[n("i",{staticClass:"iconfont icon-mv"})]):t._e()],1)])]):t._e()}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"info-label"},[e("i",{staticClass:"iconfont icon-song"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"info-label"},[e("i",{staticClass:"iconfont icon-singer"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"info-label"},[e("i",{staticClass:"iconfont icon-album"})])}],!1,null,"3a189566",null);e.a=u.exports},c5e1:function(t,e){t.exports=$},ceb6:function(t,e,n){"use strict";n.d(e,"n",(function(){return O})),n.d(e,"j",(function(){return S})),n.d(e,"a",(function(){return A})),n.d(e,"i",(function(){return L})),n.d(e,"p",(function(){return E})),n.d(e,"l",(function(){return I})),n.d(e,"m",(function(){return C})),n.d(e,"g",(function(){return x})),n.d(e,"e",(function(){return j})),n.d(e,"d",(function(){return M})),n.d(e,"h",(function(){return N})),n.d(e,"k",(function(){return T})),n.d(e,"f",(function(){return U})),n.d(e,"b",(function(){return Q})),n.d(e,"o",(function(){return R}));n("8e6e"),n("673e"),n("4917"),n("7514"),n("8615"),n("7f7f");var a=n("2909"),r=(n("c5f6"),n("3835")),i=(n("28a5"),n("6762"),n("2fdb"),n("ade3")),o=(n("ac6a"),n("456d"),n("a481"),n("96cf"),n("1da1")),s={SEARCH:"/apiMix/search",LYRIC:"/apiMix/lyric",ALBUM:"/apiMix/album",BATCH_URL:"/apiMix/url/batch",PLAYLIST:"/apiMix/playlist",USER_PLAYLIST:"/apiMix/playlist/user",DAILY_PLAYLIST:"/apiMix/playlist/daily",RECOMMEND_PLAYLIST:"/apiMix/playlist/recommend",SINGER_INFO:"/apiMix/singer",SINGER_ALBUM:"/apiMix/singer/album",SINGER_SIM:"/apiMix/singer/sim",SINGER_SONG:"/apiMix/singer/song",SONG_INFO:"/apiMix/song",SONG_RECORD:"/apiMix/song/record",SINGLE_URL:"/apiMix/url",SONG_FIND:"/apiMix/song/find",GET_HEART_MODE:"/apiMix/playlist/heart",MV:"/apiMix/mv",TOP_CATEGORY:"/apiMix/top/category",TOP_SONGS:"/apiMix/top","163_SEARCH":"/api/search","163_LOGIN_PHONE":"/api/login/cellphone","163_LOGOUT":"/api/logout","163_LOGIN_EMAIL":"/api/login",LOGIN_STATUS:"/api/login/status",USER_LIST:"/api/user/playlist",LIST_DETAIL:"/api/playlist/detail",SONG_DETAIL:"/api/song/detail",SONG_URL:"/api/song/url",GET_LYRIC:"/api/lyric",CAPTCH_SENT:"/api/captch/sent",CAPTCH_VERIFY:"/api/captch/verify",GET_USER_DETAIL:"/api/user/detail",MUSIC_COMMENTS:"/api/comment/music",GET_QQ_VKEY:"//u.y.qq.com/cgi-bin/musicu.fcg?callback=jQuery331015138042840240584_1544498679284&data=%7B%22req_0%22%3A%7B%22module%22%3A%22vkey.GetVkeyServer%22%2C%22method%22%3A%22CgiGetVkey%22%2C%22param%22%3A%7B%22guid%22%3A%225339940689%22%2C%22songmid%22%3A%5B%220039MnYb0qxYhV%22%5D%2C%22songtype%22%3A%5B0%5D%2C%22uin%22%3A%22%22%2C%22platform%22%3A%2220%22%7D%7D%7D&jsonpCallback=getQQMusicUrl&callback=getQQMusicUrl&_=1544498679292",DAILY_RECOMMEND_SONGS:"/api/recommend/songs",DAILY_RECOMMEND_LIST:"/api/recommend/resource",RECOMMEND_LIST:"/api/personalized",LIKE_MUSIC:"/api/like",LIKE_COMMENT:"/api/comment/like",PLAYLIST_TRACKS:"/api/playlist/tracks",GET_SINGER_DESC:"/api/artist/desc",GET_SINGER_SONGS:"/api/artists",GET_SINGER_ALBUMS:"/api/artist/album",GET_ALBUM:"/api/album",COMMENT:"/api/comment",SIMI_ARTIST:"/api/simi/artist",SCROBBLE:"/api/scrobble",GET_USER_RECORD:"/api/user/record",GET_FOLLOWS:"/api/user/follows",GET_FOLLOWEDS:"/api/user/followeds",GET_DJ_CATE_LIST:"/api/dj/catelist",GET_DJ_RECOMMEND:"/api/dj/recommend/type",GET_DJ_DETAIL:"/api/dj/detail",GET_DJ_SONGS:"api/dj/program",GET_PERSON_FM:"api/personal_fm",GET_MV_INFO:"api/mv/detail",GET_SIMI_MV:"api/simi/mv",SUBSCRIBE_PLAYLIST:"api/playlist/subscribe",QQ_SEARCH:"apiQ/search",QQ_VKEY:"apiQ/vkey",QQ_LYRIC:"apiQ/lyric",QQ_GET_COMMENT:"apiQ/comment",QQ_GET_URLS:"apiQ/song/urls",QQ_SONG_FIND:"apiQ/song/find",QQ_SONG_FINDS:"apiQ/song/finds",QQ_SET_COOKIE:"apiQ/user/setCookie",QQ_USER_DETAIL:"apiQ/user/detail",QQ_LIST_DETAIL:"apiQ/songlist",QQ_SINGER_DESC:"apiQ/singer/desc",QQ_SINGER_SIM:"apiQ/singer/sim",QQ_SINGER_SONGS:"apiQ/singer/songs",QQ_SINGER_ALBUMS:"apiQ/singer/album",QQ_ALBUM:"apiQ/album",QQ_ALBUM_SONGS:"apiQ/album/songs",QQ_SONG_DETAIL:"apiQ/song",QQ_MV_INFO:"apiQ/mv",QQ_MV_URL:"apiQ/mv/url",QQ_DOWN_URL:"apiQ/song/url",QQ_RECOMMEND_PLAYLIST:"apiQ/recommend/playlist",QQ_GET_COOKIE:"apiQ/user/getCookie",QQ_SONG_LIST_MAP:"apiQ/songlist/map",QQ_USER_SONG_LIST:"apiQ/user/songlist",QQ_SONG_LIST_ADD:"apiQ/songlist/add",QQ_SONG_LIST_REMOVE:"apiQ/songlist/remove",QQ_COMMENT_LIKE:"apiQ/comment/like",QQ_COMMENT_DELETE:"apiQ/comment/del",QQ_COMMENT_SEND:"apiQ/comment/send",QQ_COLLECTED_SONGLIST:"apiQ/user/collect/songlist",QQ_COLLECT_SONGLIST:"apiQ/songlist/collect",MIGU_SEARCH:"apiM/search",MIGU_URL_GET:"apiM/song/url",MIGU_LYRIC:"apiM/lyric",MIGU_SINGER_DESC:"apiM/singer/desc",MIGU_SINGER_SONGS:"apiM/singer/songs",MIGU_SINGER_ALBUMS:"apiM/singer/albums",MIGU_ALBUM:"apiM/album",MIGU_SONG_INFO:"apiM/song",MIGU_PLAYLIST:"apiM/playlist",MIGU_RECOMMEND_PLAYLIST:"apiM/recommend/playlist",COMMON_GET_FEEDBACK:"apiQ/feedback",COMMON_ADD_FEEDBACK:"apiQ/feedback/add",COMMON_DELETE_FEEDBACK:"apiQ/feedback/delete",QQ_SONG_INFO:"//u.y.qq.com/cgi-bin/musicu.fcg",QQ_LIST:"//c.y.qq.com/rsc/fcgi-bin/fcg_get_profile_homepage.fcg",QQ_RADIO_INFO:"//u.y.qq.com/cgi-bin/musicu.fcg"},c=n("aa67"),u=n("0828"),l=(n("34ef"),n("7907")),d=n.n(l),p=n("3f0b");function f(t,e){var n,a,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=window,c="application/octet-stream",u=r||c,l=t,m=t,g=document.createElement("a"),h=function(t){return String(t)},y=s.Blob||s.MozBlob||s.WebKitBlob||h,b=e||"download";y=y.call?y.bind(s):Blob;if("true"===String(this)&&(u=(l=[l,u])[0],l=l[1]),m&&m.length<2048&&(g.href=m,-1!==g.href.indexOf(m))){var w=new XMLHttpRequest;return w.open("GET",m,!0),w.responseType="arraybuffer",w.onload=function(t){if(200===t.currentTarget.status){var e=t.target.response;if(("163"!==i.platform||!i.qqId)&&i&&i.al&&i.al.picUrl)try{var n=new XMLHttpRequest;n.open("GET",i.al.picUrl.replace(/http(s|):\/\/y\.gtimg\.cn/,"http://".concat(window.location.host,"/qqImg")).replace("300x300","500x500"),!0),n.responseType="arraybuffer",n.onload=function(a){try{if(200===a.currentTarget.status){var r=new d.a(t.target.response);r.setFrame("TIT2",i.name).setFrame("TPE1",i.ar.map((function(t){return t.name}))).setFrame("TALB",i.al.name).setFrame("TRCK",i.trackNo||"").setFrame("APIC",{type:3,data:n.response,description:i.al.name}),i.publishTime&&r.setFrame("TYER",Object(p.a)(i.publishTime).str("YYYY")),r.addTag(),e=r.arrayBuffer}}catch(t){}setTimeout((function(){o.success&&o.success(),f(e,b,c)}),10)},n.send()}catch(t){o.success&&o.success(),f(e,b,c)}else o.success&&o.success(),f(e,b,c)}o.error&&o.error()},w.addEventListener("progress",(function(t){if(t.lengthComputable){var e=t.loaded/t.total;o.progress&&o.progress(e,t.loaded,t.total)}})),setTimeout((function(){w.send()}),0),o.init&&o.init(w),w}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(l)){if(!(l.length>2096103.424&&y!==h))return navigator.msSaveBlob?navigator.msSaveBlob(S(l),b):A(l);u=(l=S(l)).type||c}else if(/([\x80-\xff])/.test(l)){for(var v=0,O=new Uint8Array(l.length),_=O.length;v<_;++v)O[v]=l.charCodeAt(v);l=new y([O],{type:u})}function S(t){for(var e=t.split(/[:;,]/),n=e[1],a=("base64"==e[2]?atob:decodeURIComponent)(e.pop()),r=a.length,i=0,o=new Uint8Array(r);i<r;++i)o[i]=a.charCodeAt(i);return new y([o],{type:n})}function A(t,e){if("download"in g)return g.href=t,g.setAttribute("download",b),g.className="download-js-link",g.innerHTML="downloading...",g.style.display="none",document.body.appendChild(g),setTimeout((function(){g.click(),document.body.removeChild(g),!0===e&&setTimeout((function(){s.URL.revokeObjectURL(g.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(t)&&(t="data:"+t.replace(/^data:([\w\/\-\+]+)/,c)),window.open(t)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=t),!0;var n=document.createElement("iframe");document.body.appendChild(n),!e&&/^data:/.test(t)&&(t="data:"+t.replace(/^data:([\w\/\-\+]+)/,c)),n.src=t,setTimeout((function(){document.body.removeChild(n)}),333)}if(n=l instanceof y?l:new y([l],{type:u}),navigator.msSaveBlob)return navigator.msSaveBlob(n,b);if(s.URL)A(s.URL.createObjectURL(n),!0);else{if("string"==typeof n||n.constructor===h)try{return A("data:"+u+";base64,"+s.btoa(n))}catch(t){return A("data:"+u+","+encodeURIComponent(n))}(a=new FileReader).onload=function(t){A(this.result)},a.readAsDataURL(n)}return!0}var m=n("cebe"),g=n.n(m);function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){Object(i.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var b={},w={};g.a.interceptors.response.use(function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(e){var n,a,r,i,o,s,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.data||"error"!=e.data.status||e.data.code){t.next=2;break}return t.abrupt("return");case 2:if(!(e.data.code>9999)){t.next=16;break}if(n=e.config.url,a=n.replace(/([?|&])_t=[^&]*(&)?/g,""),w[a]++,r=b[a],i=r.url,o=r.data,"get"===b[a].method?(s=Object.keys(o).map((function(t){return"_t"===t&&(o[t]=(new Date).getTime()),"".concat(t,"=").concat(encodeURI(o[t]))})).join("&"),i+="?".concat(s)):i+="?_t="+(new Date).getTime(),!(w[a]<2)){t.next=15;break}return t.next=11,g()(y(y({},b[a]),{},{url:i}));case 11:return c=t.sent,t.abrupt("return",c);case 15:window.VUE_APP.$message.error("请求失败,请刷新重试");case 16:return t.abrupt("return",e);case 17:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),(function(t){if(String(t).indexOf("timeout")>-1)return window.VUE_APP.$message.error("请求超时,请刷新重试");var e=t.config&&t.config.url;return e?e.indexOf("/api/login/status")>-1?Promise.reject({}):e.indexOf("/api/user/record")>-1?window.VUE_APP.$message.warning("ta 不公开听歌排行哟"):e.indexOf("/api/simi/artist")>-1?window.VUE_APP.$message.warning("登录后可查看相似歌手"):Promise.reject(t.response?t.response.data:t):{code:500}}));var v=function(t,e){var n=t;"string"==typeof t&&(n={api:t});var a=n,r=a.method,i=void 0===r?"get":r,o=a.api,c=a.data,u=void 0===c?{}:c;u._t=t.cache?0:(new Date).getTime(),u._p=u._p||e;var l=s[o],d=s[o],f=(l+="get"===i?"?".concat(Object.keys(u).map((function(t){return"".concat(t,"=").concat(encodeURI(u[t]))})).join("&")):"?_t="+u._t).replace(/([?|&])_t=[^&]*(&)?/g,"");return b[f]={method:i,url:""+d,data:u,headers:{"Host-Check":btoa(Object(p.a)().str("YYYYMMDD"))},timeout:3e4},w[f]=0,g()(y(y({},b[f]),{},{url:l})).then((function(t){if(t.data=t.data||{},200===t.data.code||100===t.data.result)return t.data;if(400!==t.data.result)throw{data:t.data};window.VUE_APP.$message.error(t.data.data||t.data.errMsg)}),(function(t){delete w[f],delete b[f];var e=t.msg||t.message||"";e&&!e.includes("timeout")&&window.VUE_APP.$message.error(e)}))},O=function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(){var e,n,a,r,i,o,s,l,d,p,f,m,g,h,y,b;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=window.VUE_APP,n=e.$store.dispatch,a=Object(u.b)(),r=a.shareId,i=a.shareCid,o=a.from,s=void 0===o?"163":o,k(),r&&v({api:"SONG_INFO",data:{id:r,cid:i,_p:s}}).then((function(t){var e=t.data;return I([e])})).then((function(t){var a=e.$store.getters.getAllSongs;t[0]&&n("updatePlayNow",a[t[0]]),n("updatePlayingList",{list:t})})),t.prev=5,t.next=8,v("LOGIN_STATUS");case 8:l=t.sent,t.next=13;break;case 11:t.prev=11,t.t0=t.catch(5);case 13:if(p=function(){return v({api:"RECOMMEND_PLAYLIST",data:{login:0,_p:"qq"}}).then((function(t){return t&&t.data[0]&&L(t.data[0].id,"qq")}))},l&&l.profile&&(n("setUser",l.profile),d=l.profile.userId,c.a.set("uid",d),p=function(){return _("163")}),!l){t.next=39;break}return t.prev=17,t.next=20,p();case 20:f=t.sent,m=f.songs,g=f.listId,h=e.$store.getters.getAllSongs,r?m.unshift(r):n("updatePlayNow",h[m[0]]),n("updatePlayingList",{list:m,listId:g}),t.next=30;break;case 28:t.prev=28,t.t1=t.catch(17);case 30:return t.prev=30,t.next=33,S(d,"163");case 33:y=t.sent,t.next=38;break;case 36:t.prev=36,t.t2=t.catch(30);case 38:y&&(b=y.listIds)[0]&&L(b[0],"163");case 39:case"end":return t.stop()}}),t,null,[[5,11],[17,28],[30,36]])})));return function(){return t.apply(this,arguments)}}(),_=function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(e,n){var a,r,i,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=window.VUE_APP,r=a.$store.dispatch,t.prev=2,t.next=5,v("DAILY_PLAYLIST",e);case 5:if((i=t.sent).data){t.next=9;break}return n||_(e,!0),t.abrupt("return");case 9:return t.next=11,I(i.data);case 11:return t.t0=t.sent,t.t1="".concat(e,"_daily"),o={songs:t.t0,listId:t.t1},r("updateList",o),t.abrupt("return",o);case 18:return t.prev=18,t.t2=t.catch(2),t.abrupt("return",{songs:[],listId:"".concat(e,"_daily")});case 22:case"end":return t.stop()}}),t,null,[[2,18]])})));return function(e,n){return t.apply(this,arguments)}}(),S=function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(e,n){var a,r,i,o,s,u,l,d,p,f,m,g,h,b;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a="",r=0,i=window,o=i.VUE_APP,s=i.cookieObj,u=void 0===s?{}:s,t.t0=n,t.next="163"===t.t0?5:"qq"===t.t0?7:10;break;case 5:return a=c.a.get("uid"),t.abrupt("break",10);case 7:return a=u.uin||"",r=c.a.get("haveQCookie")||"0",t.abrupt("break",10);case 10:return l=String(a)===String(e),d=o.$store.getters.getUserList,p=o.$store.dispatch,t.prev=14,t.next=17,v({api:"USER_PLAYLIST",data:{ownCookie:r,id:e,_p:n}});case 17:f=t.sent,t.next=22;break;case 20:t.prev=20,t.t1=t.catch(14);case 22:if(!(m=f&&f.data)){t.next=29;break}return g={},h={},l&&(d[n]={list:[],favId:"",favAId:"",mine:{},sub:{},obj:{}}),b=m.map((function(t){return l&&(d[n].obj[t.listId]=t,h[t.listId]=1),String(t.userId)===a&&(g[t.listId]=1,delete h[t.listId]),t.listId})),l&&m[0]&&(d[n].list=b,d[n].favId=m[0].id,d[n].favListId=b[0],d[n].mine=g,d[n].sub=h,p("setUserList",y({},d))),t.abrupt("return",{list:m,listIds:b});case 29:case"end":return t.stop()}}),t,null,[[14,20]])})));return function(e,n){return t.apply(this,arguments)}}(),A=function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c.a.set("haveQCookie","0"),e={},document.cookie.split(";").forEach((function(t){var n=t.split("="),a=Object(r.a)(n,2),i=a[0],o=a[1];e[i.replace(/\s/g,"")]=o})),2===Number(e.login_type)&&(e.uin=e.wxuin),e.uin=(e.uin||"").replace(/\D/g,""),window.cookieObj=e,n=e.uin){t.next=9;break}return t.abrupt("return",{success:!1,message:"cookie 格式错误"});case 9:return t.prev=9,t.next=12,v({api:"QQ_SONG_LIST_MAP",data:{ownCookie:1}});case 12:return a=t.sent,c.a.set("qqId",n),c.a.set("haveQCookie","1"),t.abrupt("return",{success:!0,data:a});case 18:return t.prev=18,t.t0=t.catch(9),t.abrupt("return",{success:!1,data:t.t0.data});case 21:case"end":return t.stop()}}),t,null,[[9,18]])})));return function(){return t.apply(this,arguments)}}(),k=function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(){var e,n,a,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.a.get("qqId")){t.next=4;break}return c.a.set("haveQCookie","0"),t.abrupt("return");case 4:return t.next=6,A();case 6:n=t.sent,a=window.VUE_APP.$store.dispatch,n.success&&n.data.data&&(r={},Object.keys(n.data.data.mid||{}).forEach((function(t){return r["qq_".concat(t)]=1})),a("updateFavSongMap",{qq:r}),_("qq")),S(e,"qq");case 10:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),L=function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(e,n){var a,r,o,s,c,u,l,d;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=window,r=a.VUE_APP,o=r.$store.dispatch,s=r.$store.getters.getUserList,e=String(e).replace("".concat(n,"_"),""),t.next=6,v({api:"PLAYLIST",data:{id:e,_p:n}}).catch((function(){return{}}));case 6:return c=t.sent,u=c.data,l=void 0===u?{}:u,d={},t.next=12,I(l.list||[],(function(t){return d[t.aId]=1}));case 12:return l.songs=t.sent,l.listId="".concat(n,"_").concat(e),s[n]&&s[n].favListId===l.listId&&o("updateFavSongMap",Object(i.a)({},n,d)),o("updateList",l),t.abrupt("return",l);case 17:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),E=function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(e){var n,r,o,s,c,u,l,d,p,f,m,g,h,y,b;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.keywords,r=e.type,o=void 0===r?1:r,s=e.pageNo,c=void 0===s?1:s,u=e.platform,l=window.VUE_APP,d=l.$store.dispatch,n){t.next=5;break}return t.abrupt("return",d("updateSearch",{keywords:n,type:o,pageNo:c,loading:!1,songs:[],artists:[],total:0}));case 5:return t.prev=5,t.next=8,v({api:"SEARCH",data:{key:n,pageNo:c,type:o,_p:u}});case 8:if(f=t.sent,m=f.data,g=m.list,h=m.key,y=m.total,b=l.$store.getters.getSearch,Number(o)){t.next=20;break}return t.next=17,I(g);case 17:b.list=t.sent,t.next=21;break;case 20:b.list=g;case 21:c>1&&(b.list=[].concat(Object(a.a)(b["".concat(h,"s")]),Object(a.a)(b.list))),d("updateSearch",(p={loading:!1},Object(i.a)(p,"".concat(h,"s"),b.list),Object(i.a)(p,"total",y),p)),t.next=28;break;case 25:return t.prev=25,t.t0=t.catch(5),t.abrupt("return",l.$message.error("搜索出错"));case 28:case"end":return t.stop()}}),t,null,[[5,25]])})));return function(e){return t.apply(this,arguments)}}(),P=function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(e,n){var a,r,i,o,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v({api:"BATCH_URL",method:"post",data:{id:e,_p:n}}).catch((function(){}));case 2:a=t.sent,r={},i={},o=window.VUE_APP,s=o.$store.getters.getAllSongs,e.split(",").forEach((function(t){var e="".concat(n,"_").concat(t),a=s["".concat(n,"_").concat(t)];a&&(i[e]={key:"".concat(a.name.replace(/\(|\)|(|)/g," ")," ").concat(a.ar.map((function(t){return t.name})).join(" ")),id:e,duration:a.duration})})),Object.keys(a&&a.data||{}).forEach((function(t){var e="".concat(n,"_").concat(t);delete i[e],r[e]=y(y({},s[e]||{}),{},{br:128e3,url:a.data[t],pUrl:a.data[t]})})),Object.keys(i).length>0&&v({api:"SONG_FIND",method:"post",data:{list:Object.values(i),_p:n}}).then((function(t){var e={};Object.keys(t&&t.data||{}).forEach((function(n){var a=t.data[n],r=a.url,i=a.bId,o=a.bPlatform;e[n]=y(y({},s[n]||{}),{},{url:r,pUrl:r,bId:i,bPlatform:o,br:128e3})})),o.$store.dispatch("updateAllSongs",e)})),o.$store.dispatch("updateAllSongs",r);case 11:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),I=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0;return new Promise((function(n){var a=window.VUE_APP,r={},i=a.$store.getters.getAllSongs,o=[],s="";for(t.forEach((function(t){var n="".concat(t.platform,"_").concat(t.id);t.aId=n,e&&e(t),i[n]&&i[n].url||(r[n]=t,i[n]&&i[n].url||t.url?t.pUrl=i[n]&&i[n].pUrl||t.url:o.push(t.id),s=t.platform)})),a.$store.dispatch("updateAllSongs",r);o.length>0;)P(o.splice(-99).join(","),s||"163");n(t.map((function(t){return t.aId})))}))},C=function(t){window.event&&window.event.stopPropagation();var e=window.VUE_APP,n=e.$message,a=e.$store,r=a.getters,i=r.getFavSongMap,o=r.getAllList,s=r.getAllSongs,u=r.getUserList,l=r.getUser,d=s[t],p=d.mid,f=d.songid,m=d.id,g=d.platform,h=!Boolean(i[g][t]);if("migu"===g)return e.$message.error("咪咕音乐暂不支持!");var y=function(){var t=u[g].favListId;return v({api:"PLAYLIST_TRACKS",data:{tracks:m,pid:t.replace("".concat(g,"_"),""),op:h?"add":"del"}}).catch((function(t){if(t.data&&200===t.data.status)return t.data.body||t.data.data}))};if("qq"===g){if("1"!==c.a.get("haveQCookie"))return n.warning("没有 cookie !");y=function(){return v({api:h?"QQ_SONG_LIST_ADD":"QQ_SONG_LIST_REMOVE",data:{dirid:201,mid:p,id:f}})}}else if(!l.userId)return n.warning("没有登陆!");y().then((function(e){if("163"===g&&200!==e.code)return n.error("失败了!");var r=u[g].favListId,s=o[r];h?(n.success("爱上!"),i[g][t]=1,s&&(s.unshift(t),a.dispatch("updateList",{songs:s,listId:r})),a.dispatch("updateFavSongMap",i)):(n.success("爱过~"),i[g][t]=0,a.dispatch("updateFavSongMap",i),s&&a.dispatch("updateList",{songs:s.filter((function(e){return e!==t})),listId:r}))}))},x=function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(e,n,a){var r,i,o,s,c,u,l,d,p;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=window,i=r.VUE_APP,o=i.$store.getters.getAllSongs,(s=o[e]||a||{}).url){t.next=5;break}return t.abrupt("return","");case 5:return c=(s.bId||e||"").replace("".concat(s.platform,"_"),""),u=s.url,l=s.br||128e3,d="mp3",t.prev=7,t.next=10,v({api:"SINGLE_URL",data:{id:c,mediaId:s.mediaId,br:n,_p:s.bPlatform||s.platform}}).catch((function(){}));case 10:(p=t.sent).data&&p.data.url&&(u=p.data.url,(l=p.data.br)>32e4&&(d="flac")),t.next=17;break;case 14:t.prev=14,t.t0=t.catch(7);case 17:return u=u.replace("freetyst.nf.migu.cn","".concat(window.location.host,"/miguSongs")),a&&i.$store.dispatch("updateSongDetail",{url:u,br:l,aId:s.aId}),t.abrupt("return",{url:u,songEndType:d,br:l});case 20:case"end":return t.stop()}}),t,null,[[7,14]])})));return function(e,n,a){return t.apply(this,arguments)}}(),j=function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(e,n,a,r){var i,o,s,u,l,d,p,m,g,h,y,b,w,v,O,_,S;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(window.event&&window.event.stopPropagation(),i=window,o=i.VUE_APP,s=o.$store.getters.getAllSongs,u=r||s[e],l=o.$store.dispatch,u.url){t.next=7;break}return t.abrupt("return",o.$message.warning("没有这首歌呀"));case 7:return d=u.cId,t.next=10,x(e,c.a.get("downSize")||"flac",u);case 10:if(p=t.sent,m=p.url,g=p.songEndType,h=p.br,y="".concat((new Date).getTime()).concat(e),m.indexOf(".mp3")>-1?g="mp3":m.indexOf(".flac")>-1&&(g="flac"),b=".".concat(g),w=c.a.get(["repeatDown","download_info","downLyric"]),v=w.repeatDown,O=w.download_info,_=w.downLyric,b=n||D(u,b),O=JSON.parse(O),v||a){t.next=25;break}if(!(S=O.list.find((function(t){return t.songId===e})))){t.next=25;break}return o.$message.info("这首已经添加在下载列表了"),t.abrupt("return",l("updateDownload",{status:"initError",errMsg:"重复下载,自动过滤",from:S.from||"163",id:y,name:b,songId:e,songCid:d,br:h}));case 25:f(m,b,null,u,{init:function(t){m.indexOf("qq.com")>-1?o.$message.info("已添加到下载列表,受企鹅音乐跨域影响,需自行下载"):o.$message.success("加入下载中"),l("updateDownload",{status:"init",from:u.from||"163",id:y,ajax:t,name:b,songId:e,br:h,songCid:d,song:u})},success:function(){"1"===_&&M(u),l("updateDownload",{status:"success",id:y})},error:function(){return l("updateDownload",{status:"error",id:y})},progress:function(t,e,n){return l("updateDownload",{status:"progress",id:y,p:t,l:e,t:n})}});case 26:case"end":return t.stop()}}),t)})));return function(e,n,a,r){return t.apply(this,arguments)}}(),M=function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(e){var n,a,r,i,o,s,u,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=window,a=n.VUE_APP,t.next=3,R(e.aId);case 3:if(r=a.$store.getters.getAllSongs,i=r[e.aId]||e,o=i.rawLyric){t.next=8;break}return t.abrupt("return");case 8:"1"===c.a.get("downLyricTrans")&&i.rawTrans&&(s=o.split("\n"),u=i.rawTrans.split("\n"),l=[],s.forEach((function(t){l.push(t);var e=t.match(/\[\d+:\d+.\d+\]/);if(e){var n=u.find((function(t){return t.indexOf(e[0])>-1}));n&&l.push(n)}})),o=l.join("\n")),f(o,D(i,".lrc"));case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),D=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=(t.ar||[]).map((function(t){return t.name})).join("/"),a="";switch(c.a.get("downMusicName")){case"1":a="".concat(t.name,"-").concat(n).concat(e);break;case"2":a="".concat(t.name).concat(e);break;default:a="".concat(n,"-").concat(t.name).concat(e)}return a},N=function(){return v("GET_PERSON_FM").then((function(t){return I(t.data)}))},T=function(t){return(t||[]).map((function(t){return{commentId:t.commentid,content:t.middlecommentcontent?t.middlecommentcontent.map((function(t){return"回复 ".concat(t.replyednick,":").concat((t.subcommentcontent||"").replace(/\\n/g,"<br/>"))})).join(" //"):(t.rootcommentcontent||"").replace(/\\n/g,"<br/>"),time:1e3*t.time,canDelete:Boolean(t.enable_delete),liked:1===Number(t.ispraise),userId:t.encrypt_uin,beReplied:t.middlecommentcontent?[{content:(t.rootcommentcontent||"").replace(/\\n/g,"<br/>"),user:{avatarUrl:"",userId:t.rootcommentuin,nickname:(t.rootcommentnick||"").replace("@","")}}]:[],user:{userId:t.uin,nickname:t.nick,avatarUrl:t.avatarurl},likedCount:t.praisenum}}))},U=function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(e){var n,a,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=window,a=n.VUE_APP,c.a.set("qqId",e),(r=new Date).setTime(r.getTime()-1),document.cookie="login_type=1;expires="+r.toGMTString(),t.prev=5,t.next=8,v({api:"QQ_GET_COOKIE",data:{id:e}});case 8:i=t.sent,t.next=13;break;case 11:t.prev=11,t.t0=t.catch(5);case 13:if(!i||100!==i.result){t.next=18;break}return t.next=16,A();case 16:t.sent.success?a.$message.success("获取 Cookie 成功"):a.$message.error("Cookie 错误或过期");case 18:case"end":return t.stop()}}),t,null,[[5,11]])})));return function(e){return t.apply(this,arguments)}}(),Q=function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(e){var n,a,r,i,o,s,c,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.platform,a=e.id,r=e.listId,i=window,o=i.VUE_APP,window.event.stopPropagation(),(s=o.$store.getters.getUserList)[n]){t.next=6;break}return t.abrupt("return",o.$message.error("未登陆或没有Cookie"));case 6:c=Boolean(s[n].sub[r]),u=!1,t.t0=n,t.next="migu"===t.t0?11:"qq"===t.t0?13:"163"===t.t0?23:33;break;case 11:return o.$message.warning("咪咕音乐暂不支持!"),t.abrupt("return");case 13:return t.prev=13,t.next=16,v({api:"QQ_COLLECT_SONGLIST",data:{id:a,op:c?2:1}});case 16:u=!0,t.next=22;break;case 19:return t.prev=19,t.t1=t.catch(13),t.abrupt("return",o.$message.error("收藏失败"));case 22:return t.abrupt("break",33);case 23:return t.prev=23,t.next=26,v({api:"SUBSCRIBE_PLAYLIST",data:{id:a,t:Number(!c)}});case 26:u=!0,t.next=32;break;case 29:return t.prev=29,t.t2=t.catch(23),t.abrupt("return",o.$message.error("收藏失败"));case 32:return t.abrupt("break",33);case 33:u&&(o.$message.success("".concat(c?"取消":"收藏","成功!")),s[n].sub[r]=Number(!c),o.$store.dispatch("setUserList",y({},s)));case 34:case"end":return t.stop()}}),t,null,[[13,19],[23,29]])})));return function(e){return t.apply(this,arguments)}}(),R=function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(e){var n,a,r,i,o,s,c,l,d,p,f,m,g;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=window,a=n.VUE_APP,r=a.$store.getters.getAllSongs,i=r[e],o=i.id,s=i.mid,c=i.cId,l=i.platform,!i.lyricObj){t.next=6;break}return t.abrupt("return");case 6:return t.prev=6,t.next=9,v({api:"LYRIC",data:{id:{163:o,qq:s,migu:c}[l],_p:l}});case 9:d=t.sent,t.next=14;break;case 12:t.prev=12,t.t0=t.catch(6);case 14:p=d&&d.data||{lyric:"",trans:""},f=p.lyric,m=p.trans,g={},f&&Object(u.c)(f,"str",g),m&&Object(u.c)(m,"trans",g),!f&&!m&&(g={0:{str:"没有歌词哟,好好享受"}}),a.$store.dispatch("updateSongDetail",{lyric:g,aId:e,rawLyric:f,rawTrans:m});case 21:case"end":return t.stop()}}),t,null,[[6,12]])})));return function(e){return t.apply(this,arguments)}}();e.c=v},cebe:function(t,e){t.exports=axios},e332:function(t,e,n){},f503:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));n("c5f6");var a=n("aa67"),r=function(t){var e=[{content:"",time:""}];if("newInfo"!==t)a.a.get("notify-".concat(t))||(window.VUE_APP.$notify({0:{message:""}}[t]),a.a.set("notify-".concat(t),"1"));else{var n=Number(a.a.get("notify-new-index")||0);n<e.length-1&&(a.a.set("notify-new-index",e.length-1),window.VUE_APP.$notify({title:"更新记录!",message:e.slice(n+1).map((function(t){return"".concat(t.content," (").concat(t.time,")")})).slice(-3).join("<br/>"),duration:2e4*(e.length-n),dangerouslyUseHTMLString:!0}))}},i={playMusic:function(t){var e=t.id,n=t.arr,r=t.listId,i=t.isDetail,o=void 0!==i&&i,s=window.VUE_APP.$store.state,c=s.allSongs,u=s.allList,l=s.playingList,d=window.VUE_APP.$store.dispatch,p=c[e];if(p.url){var f,m=r?u[r]:n;r&&r.indexOf("playing")>-1&&(m=l.trueList),d("updatePlayNow",p),d("updatePlayingStatus",!0),f=o?Number(a.a.get("PLAY_MUSIC_FROM_PLAYLIST"))?{list:m,listId:r}:{list:[e],more:!0}:Number(a.a.get("PLAY_MUSIC_FROM_LIST"))?{list:m}:{list:[e],more:!0},setTimeout((function(){window.pDom.play()})),d("updatePlayingList",f)}},playList:function(t){var e=VUE_APP,n=e.$store,a=e.$message,r=(n.state,n.dispatch),i=n.state.allSongs,o=t.filter((function(t){return i[t].url}));if(!o.length)return a.warning("无可播放歌曲");r("updatePlayNow",i[o[0]]),r("updatePlayingList",{list:o}),r("updatePlayingStatus",!0)},addPlaying:function(t){var e=window.VUE_APP,n=e.$message,a=e.$store;window.event.stopPropagation(),a.dispatch("updatePlayingList",{list:[t],more:!0}),n.success("已加入播放列表!")},removePlaying:function(t){window.event.stopPropagation();var e=window.VUE_APP,n=e.$store,a=e.$message,r=n.state,i=n.dispatch,o=r.playingList,s=r.playNow;t===s.aId&&i("playNext"),i("updatePlayingList",{list:o.raw.filter((function(e){return e!==t}))}),a.success("移出播放列表!")}}},fc5b:function(t,e,n){}}); | 101,478 | 101,478 | 0.70365 |
a1c6cb97746e5502296c0b8eeac740c26fd0b944 | 856 | js | JavaScript | src/main/resources/static/plugins/jqueryvalidation/additional-methods.js | wangcl/admin-boot | df6c9280609bdd57fb548b366bdbfb4fb59f74a6 | [
"MIT"
] | null | null | null | src/main/resources/static/plugins/jqueryvalidation/additional-methods.js | wangcl/admin-boot | df6c9280609bdd57fb548b366bdbfb4fb59f74a6 | [
"MIT"
] | 1 | 2021-09-13T08:09:12.000Z | 2021-09-24T03:59:18.000Z | src/main/resources/static/plugins/jqueryvalidation/additional-methods.js | wangcl/admin-boot | df6c9280609bdd57fb548b366bdbfb4fb59f74a6 | [
"MIT"
] | null | null | null | /*
* 扩展自定义的 jQuery validation 校验规则
*/
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["jquery", "./jquery.validate.min-1.17.0"], factory);
} else if (typeof module === "object" && module.exports) {
module.exports = factory(require("jquery"));
} else {
factory(jQuery);
}
}(function ($) {
// 电话号码
jQuery.validator.addMethod("phone", function(value, element) {
var length = value.length;
var mobile = /^1\d{10}$/; // /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
var tel = /^(\d{3,4}-?)?\d{7,9}$/g;
return this.optional(element) || tel.test(value) || (length == 11 && mobile.test(value));
}, "请正确填写电话号码");
// 邮政编码
jQuery.validator.addMethod("zipcode", function(value, element) {
var zipCode = /^[0-9]{6}$/;
return this.optional(element) || (zipCode.test(value));
}, "请正确填写邮政编码");
}));
| 29.517241 | 91 | 0.595794 |
a1c781e854f8843925a8beec1449d54b85589c63 | 808 | js | JavaScript | src/redux/thunk.js | MR-liu/react-redux | 14bba5d4ba81f908ea61117e98e834f19844ef73 | [
"MIT"
] | null | null | null | src/redux/thunk.js | MR-liu/react-redux | 14bba5d4ba81f908ea61117e98e834f19844ef73 | [
"MIT"
] | null | null | null | src/redux/thunk.js | MR-liu/react-redux | 14bba5d4ba81f908ea61117e98e834f19844ef73 | [
"MIT"
] | null | null | null | const { applyMiddleware, createStore } = require("redux");
let thunk = store => next => action => {
if (typeof action === 'function') {
return action(next);
} else {
return next(action)
}
}
let store = applyMiddleware(thunk)(createStore)(counter);
store.dispatch(function(dispatch) {
setTimeout(() => {
dispatch({
type: 'add'
})
}, 3000)
})
store.subscribe(() => {
console.log(store.getState())
})
// ================
let isPromise = obj => obj.then;
let promise = store => next => action => {
if (isPromise(action)) {
action.then((data) => next(data))
}
next(action)
}
let store = applyMiddleware(promise)(createStore)(counter);
store.dispatch(new Promise((resolve, reject) => {
setTimeout(() => {
resolve({
type: 'add'
})
}, 3000)
})) | 17.955556 | 59 | 0.585396 |
a1c7b13ec2deff681dafa2ee06db7d0f2a20d165 | 12,055 | js | JavaScript | Album/static/js/upload/main.js | NeKoSaNnn/AICloudAlbum | 2ed6936bf6126f37eb4cca384ba8731850e98880 | [
"MIT"
] | 2 | 2021-04-10T14:03:08.000Z | 2021-08-31T09:39:43.000Z | Album/static/js/upload/main.js | NeKoSaNnn/AICloudAlbum | 2ed6936bf6126f37eb4cca384ba8731850e98880 | [
"MIT"
] | null | null | null | Album/static/js/upload/main.js | NeKoSaNnn/AICloudAlbum | 2ed6936bf6126f37eb4cca384ba8731850e98880 | [
"MIT"
] | 1 | 2021-08-15T10:25:46.000Z | 2021-08-15T10:25:46.000Z | var asyn_cnt = 0;
var syn_cnt = 0;
$.ajaxSetup({
beforeSend: function (xhr, settings) {
xhr.setRequestHeader("X-CSRFtoken", $.cookie("csrftoken"))
}
});
$(document).ready(function () {
var folder_fake_name = $("#now_folder_fake_name").val()
toastr.options = {
"closeButton": false,
"newestOnTop": true,
"progressBar": false,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"showDuration": "100",
"hideDuration": "1000",
"timeOut": "2500",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
var aryFiles = Array();
var GetCount = function () {
var cnt = syn_cnt;
if (cnt === 1) {
return cnt + ' picture uploaded successfully~'
}
return cnt + ' pictures uploaded successfully~';
};
var GetAsynCount = function () {
if (asyn_cnt === 1) {
return asyn_cnt + ' picture uploaded successfully~'
}
return asyn_cnt + ' pictures uploaded successfully~';
}
$('#upload-input').fileinput({
theme: "fas",
//browseClass:"btn btn-primary btn-block",
//language: 'zh', // 设置中文,需要引入locales/zh.js文件
uploadUrl: '/upload_upload_asyn/' + folder_fake_name + "/", // 上传路径 *****************************************
maxFileSize: 0, // 上传文件大小限制,触发 msgSizeTooLarge 提示
previewFileType: "image",
browseClass: "browser-btn-solid-lg",
browseLabel: "",
browseTitle: "Select Images",
browseIcon: "<i class=\"fa fa-image\"></i> ",
removeClass: "remove-btn-solid-lg",
removeLabel: "",
removeTitle: "Delete All Images",
//removeIcon: "<i class=\"fa fa-trash\"></i> ",
uploadClass: "upload-btn-solid-lg",
uploadLabel: "",
//uploadIcon: "<i class=\"fa fa-arrow-up\"></i> ",
uploadTitle: "Upload All Images",
cancelClass: "cancel-btn-solid-lg hidden",
cancelLabel: "",
cancelTitle: "Cancel Upload",
allowedFileExtensions: ['jpg', 'jpeg', 'jpe', 'gif', 'png', 'pns', 'bmp', 'png', 'tif', 'tiff', '.gif', '.webp', '.pjp', '.xbm', '.svg', '.ico'],
// {name}:将被上传的文件名替换,{size}:将被上传的文件大小替换,{maxSize}:将被maxFileSize参数替换。
//msgSizeTooLarge: '"{name}" ({size} KB) 超过允许的最大上传大小 {maxSize} KB。请重新上传!',
showPreview: true, // 展示预览
showBrowse: true,
showUpload: true, // 是否显示上传按钮
showRemove: true,
showCaption: true, // 是否显示文字描述
showClose: false, // 隐藏右上角×
uploadAsync: true, // 是否异步上传 ********************************************
//initialPreviewShowDelete: true, // 预览中的删除按钮
autoReplace: true, // 达到最大上传数时,自动替换之前的附件
required: true,
validateInitialCount: true,
maxFileCount: 20,
//enctype: 'multipart/form-data',
//uploadExtraData: function () { // uploadExtraData携带附加参数,上传时携带csrftoken
// return {csrfmiddlewaretoken: $.cookie('csrftoken'), doc_uuid: $('[name=doc_uuid]').val()}
//},
initialPreview: [], // 默认预览设置,回显时会用到
initialPreviewConfig: [], // 默认预览的详细配置,回显时会用到
}).on('fileclear', function () {
// 移除按钮触发的事件,用该事件批量删除
/*
return new Promise(function (resolve, reject) {
$.confirm({
title: 'Success!',
content: 'All images has been deleted~',
type: 'red',
buttons: {
ok: {
btnClass: 'btn-danger text-white',
keys: ['enter'],
action: function () {
resolve();
}
},
}
});
});
*/
}).on("filepredelete", function (e, key, jqXHR, data) {
// 预览中删除按钮,删除上传的文件触发的事件
}).on("fileloaded", function (e, file, previewId) {
// aryFile.length = 0;
// 加载预览后触发的事件,将所有文件名添加到全局变量 aryFiles 数组中
aryFiles.push(file.name);
}).on('fileuploaded', function (event, data, previewId, index, fileId) {//asyn
//console.log("status:" + data.response.status)
if (data.response.status === true) asyn_cnt += 1
}).on('filebatchuploadcomplete', function (event, preview, config, tags, extraData) {//asyn 和 syn 上传完成都会走
//console.log("e" + e + "\ndata:" + data.response.status + "\npreviewId:" + previewId + "\nindex:" + index);
//console.log("count:" + GetCount());
//console.log("event:" + event);
//console.log("asyn_cnt" + asyn_cnt);
//console.log("syn_cnt" + syn_cnt);
if (asyn_cnt === 0 && syn_cnt === 0) {//不是同步也不是异步上传
$('#upload-input').fileinput("clear");
return new Promise(function (resolve, reject) {
$.confirm({
title: 'Error!',
content: "Something wrong!",
type: 'red',
buttons: {
ok: {
btnClass: 'btn-danger text-white',
keys: ['enter'],
action: function () {
resolve();
window.location.href = "";
}
},
}
});
});
} else if (asyn_cnt > 0) {
return new Promise(function (resolve, reject) {
$.confirm({
title: 'Success!',
content: GetAsynCount(),
type: 'green',
buttons: {
continue: {
btnClass: 'btn-success text-white',
keys: ['enter'],
action: function () {
resolve();
$('#upload-input').fileinput("clear");
asyn_cnt = 0;
}
},
complete: {
btnClass: 'btn-primary text-white',
keys: ['enter'],
action: function () {
resolve();
window.location.href = "?t=i";
asyn_cnt = 0;
}
}
}
});
});
} else if (syn_cnt > 0) {
return new Promise(function (resolve, reject) {
$.confirm({
title: 'Success!',
content: GetCount(),
type: 'green',
buttons: {
continue: {
btnClass: 'btn-success text-white',
keys: ['enter'],
action: function () {
resolve();
$('#upload-input').fileinput("clear");
syn_cnt = 0;
}
},
complete: {
btnClass: 'btn-primary text-white',
keys: ['enter'],
action: function () {
resolve();
window.location.href = "?t=i";
syn_cnt = 0;
}
}
}
});
});
}
}).on("filebatchuploadsuccess ", function (e, data, previewId, index) {//syn
// 同步上传全部上传完触发的事件,异步上传会每上传一个都调用
//console.log("e" + e + "\ndata:" + data.response.status + "\npreviewId:" + previewId + "\nindex:" + index);
//console.log("count:" + GetCount());
//console.log("asyn_cnt" + asyn_cnt);
//console.log("status:" + data.response.status)
//console.log("asyn_cnt" + asyn_cnt);
//console.log("syn_cnt" + syn_cnt)
syn_cnt = $('#upload-input').fileinput('getFilesCount')
/*
if (data.response.status === false) {
$('#upload-input').fileinput("clear");
return new Promise(function (resolve, reject) {
$.confirm({
title: 'Error!',
content: "Something wrong!",
type: 'red',
buttons: {
ok: {
btnClass: 'btn-danger text-white',
keys: ['enter'],
action: function () {
resolve();
window.location.href = "";
}
},
}
});
});
} else if (data.response.status === true) {
return new Promise(function (resolve, reject) {
$.confirm({
title: 'Success!',
content: GetCount(),
type: 'green',
buttons: {
continue: {
btnClass: 'btn-success text-white',
keys: ['enter'],
action: function () {
resolve();
$('#upload-input').fileinput("clear");
}
},
complete: {
btnClass: 'btn-primary text-white',
keys: ['enter'],
action: function () {
resolve();
window.location.reload();
}
}
}
});
});
}
*/
}).on('fileuploaderror', function (event, data, msg) {
console.log("status:" + data.response.status)
if (data.response.status === false) {
return new Promise(function (resolve, reject) {
$.confirm({
title: 'Error!',
content: "Something wrong!",
type: 'red',
buttons: {
ok: {
btnClass: 'btn-danger text-white',
keys: ['enter'],
action: function () {
resolve();
$('#upload-input').fileinput("clear");
}
},
}
});
});
}
}).on('filebatchuploaderror', function (event, data, msg) {
console.log("status:" + data.response.status)
if (data.response.status === false) {
return new Promise(function (resolve, reject) {
$.confirm({
title: 'Error!',
content: "Something wrong!",
type: 'red',
buttons: {
ok: {
btnClass: 'btn-danger text-white',
keys: ['enter'],
action: function () {
resolve();
$('#upload-input').fileinput("clear");
syn_cnt = 0;
}
},
}
});
});
}
});
});
$("#upload_modal_close").on("click", function () {
$('#upload-input').fileinput("clear");
asyn_cnt = 0;
syn_cnt = 0;
}); | 39.52459 | 153 | 0.396433 |
a1c8e766dc286e12df4addeed623b31993da21c0 | 2,501 | js | JavaScript | src/core/Netop.js | appletjs/netop | 687a2c47704cd7c4df3d13ed604f2924436b9b0d | [
"MIT"
] | null | null | null | src/core/Netop.js | appletjs/netop | 687a2c47704cd7c4df3d13ed604f2924436b9b0d | [
"MIT"
] | null | null | null | src/core/Netop.js | appletjs/netop | 687a2c47704cd7c4df3d13ed604f2924436b9b0d | [
"MIT"
] | null | null | null | import Applet from 'applet';
import createError from './createError';
import createRequest from './createRequest';
import createThrowable from './createThrowable';
function cutoff(netop, flag) {
if (netop[flag] != null) {
throw createError(flag, netop.init);
}
}
export default class Netop extends Applet {
constructor(init = {}) {
super();
this.init = init;
this.used = null;
this.sent = null;
this.runtime = null;
}
use(...fns) {
cutoff(this, 'sent');
super.use(...fns);
return this;
}
with(url) {
cutoff(this, 'sent');
cutoff(this, 'used');
this.init.url = url;
// 收集运行时数据(config、request、response)
const gather = (name, value) => {
this.runtime[name] = value;
};
// init proxy
const used = new Applet(true);
used.onerror = createThrowable(this);
this.used = true;
this.use(function (config, next) {
const request = createRequest(config);
const handle = used.callback(() => request);
gather('config', config);
// 2、开始处理请求体
return handle(function (request) {
if (!(request instanceof Request)) {
throw createError(
'The request must be instance of Request',
config, request
);
}
gather('request', request);
// 3、向服务器发起请求
return config.adapter(request).then(function (response) {
const {validateStatus} = config;
const {status} = response;
gather('response', response);
// 4、开始处理响应实例
if (!status || !validateStatus || validateStatus(status)) {
return next().then(() => response);
}
throw createError(
'Request failed with status code ' + status,
config, request, response
);
});
});
});
// rewrite 'this.use'
this.use = function (...fns) {
cutoff(this, 'sent');
used.use(...fns);
return this;
};
return this;
}
send(body) {
cutoff(this, 'sent');
this.init.body = body;
// patch
if (!this.used) {
this.with();
}
// init proxy
this.sent = true;
// rewrite 'this.use'
this.use = function () {
cutoff(this, 'sent');
return this;
};
const config = this.init;
const handle = this.callback(() => config);
this.onerror = createThrowable(this);
this.runtime = {config};
// 1、开始处理配置信息
return handle(res => res);
}
}
| 21.016807 | 69 | 0.551379 |
a1c911517d4fe9e3915f5636c44f028dea75af46 | 209 | js | JavaScript | src/lib/copytext/index.js | david-szabo97/cpvault.com | 4d50dc61c438d3fe9342ef63786bf7e6c8af428e | [
"Apache-2.0"
] | 1 | 2017-08-15T19:28:22.000Z | 2017-08-15T19:28:22.000Z | src/lib/copytext/index.js | david-szabo97/cpvault.com | 4d50dc61c438d3fe9342ef63786bf7e6c8af428e | [
"Apache-2.0"
] | 20 | 2017-06-10T20:39:23.000Z | 2017-08-01T11:17:38.000Z | src/lib/copytext/index.js | david-szabo97/cpvault.com | 4d50dc61c438d3fe9342ef63786bf7e6c8af428e | [
"Apache-2.0"
] | null | null | null | import Clipboard from 'clipboard';
export default function copyText(text) {
const ele = document.createElement('a');
new Clipboard(ele, {
action: 'copy',
text: () => text
});
ele.click();
}
| 16.076923 | 42 | 0.631579 |
a1c954667b0e3462c4fdebb992e4c0da710428ee | 1,414 | js | JavaScript | src/javascriptintro.js | 142-Bupa-Acibadem-FullStack-Bootcamp/week-6-assignment-2-yahyaerdoan | 69b5e984ca058e01c5ec947f93795cc0bc3f5c15 | [
"MIT"
] | null | null | null | src/javascriptintro.js | 142-Bupa-Acibadem-FullStack-Bootcamp/week-6-assignment-2-yahyaerdoan | 69b5e984ca058e01c5ec947f93795cc0bc3f5c15 | [
"MIT"
] | null | null | null | src/javascriptintro.js | 142-Bupa-Acibadem-FullStack-Bootcamp/week-6-assignment-2-yahyaerdoan | 69b5e984ca058e01c5ec947f93795cc0bc3f5c15 | [
"MIT"
] | null | null | null | console.log("**----------- İntro ------**");
//Saf Javascript dosya bazlı bir yapıdır. Dosyalar yukarıdan aşağı taranır.
//Değişken tanımlar kullanılabilecek var let const
var number = 10;
var number = "Yahya"; //Var tip güvenli olmadığı için araya giren değeri okudu
console.log(number);
let student = { id: 2, name: "yahya" }; //object notation ** JSON ( JavaScript Object Notation )
console.log(student);
function save(puan = 10, ogrenci) {
//Default parametreyi herzaman sona yazmak gerekir. Eğer öne yazarsak atanmayan nesneyi bulamaz
console.log(ogrenci.name + " : " + puan);
}
save(undefined, student); //parametrenin başına değer verirsek sonucu almış oluruz fakat doğru işlem olmaz. Undefined göndermek gerekir. Doğru atama oldu ama default parametreyi yazdırır.
let person = ["Ali", "Veli", "Yahya"];
console.log(person);
let persons = [
person,
{ id: 1, name: "Ali" },
{ id: 2, name: "Veli" },
{ id: 3, name: "Yahya" },
{ id: 4, lastname: "Erdoğan" },
"Uşak",
];
console.log(persons);
// Rest Operatörü in JavaScript
// Params in C#
// VarArgs in Java
let showProducts = function name(id, ...products) { //...products hali hazırda veri tutan bir arraydır.
console.log(id)
console.log(products[0]) // arraya index no verirsek sadece o elamanı getirir.
}
showProducts(15, ["a", "b", "c"]) //parametre değerlerini yeniden array içine alabiliriz. Array içim-nde array olur. | 35.35 | 187 | 0.693777 |
a1c9a11b6d5f8f7ee3d21869301e677ac345de1b | 271 | js | JavaScript | build/translations/de.js | vistance/ckeditor5-build-default | 8fcb1e7a20ba84867565793ed921133dbcba3308 | [
"MIT"
] | null | null | null | build/translations/de.js | vistance/ckeditor5-build-default | 8fcb1e7a20ba84867565793ed921133dbcba3308 | [
"MIT"
] | null | null | null | build/translations/de.js | vistance/ckeditor5-build-default | 8fcb1e7a20ba84867565793ed921133dbcba3308 | [
"MIT"
] | null | null | null | (function(d){d['de']=Object.assign(d['de']||{},{a:"Kursiv",b:"Fett",c:"Unterstrichen",d:"Hochgestellt",e:"Tiefgestellt",f:"Rückgängig",g:"Wiederherstellen",h:"Rich Text Editor",i:"Rich-Text-Editor, %0"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); | 271 | 271 | 0.708487 |
a1c9fd167f625ddac13700ca9500a6e354e1af84 | 66 | js | JavaScript | src/components/EventDetail/index.js | junjchen/smarkets-events | 74ac9c409218261270ff6e2d44661ea85b573c0c | [
"MIT"
] | null | null | null | src/components/EventDetail/index.js | junjchen/smarkets-events | 74ac9c409218261270ff6e2d44661ea85b573c0c | [
"MIT"
] | null | null | null | src/components/EventDetail/index.js | junjchen/smarkets-events | 74ac9c409218261270ff6e2d44661ea85b573c0c | [
"MIT"
] | null | null | null | import EventDetail from './EventDetail'
export default EventDetail | 33 | 39 | 0.848485 |
a1cb0172fd7401e58b4c78ae8ebf3fae592740f7 | 282 | js | JavaScript | gulp/build/gulpfile.js | zhaobinglong/test | b26a32fa5304f322bcbf638cec4c03dc606b48ac | [
"MIT"
] | null | null | null | gulp/build/gulpfile.js | zhaobinglong/test | b26a32fa5304f322bcbf638cec4c03dc606b48ac | [
"MIT"
] | 1 | 2018-04-11T06:43:31.000Z | 2020-05-27T09:18:12.000Z | gulp/build/gulpfile.js | zhaobinglong/test | b26a32fa5304f322bcbf638cec4c03dc606b48ac | [
"MIT"
] | null | null | null | var gulp=require("gulp"),uglify=require("gulp-uglify"),jshint=require("gulp-jshint");gulp.task("compress",function(){gulp.src("*.js").pipe(uglify()).pipe(gulp.dest("build"))}),gulp.task("default",function(){gulp.run("compress"),gulp.watch("*.js",function(){gulp.run("compress")})}); | 282 | 282 | 0.695035 |
a1cb25422c987219c70c0741820983dfbef69ed0 | 237 | js | JavaScript | src/actions/index.js | chulinguy/tango-for-dummies | d188b4a0f6d0edee37a5fddbd08773fa5fc54ed2 | [
"MIT"
] | 2 | 2018-11-29T05:19:03.000Z | 2019-10-30T09:07:53.000Z | src/actions/index.js | chulinguy/tango-for-dummies | d188b4a0f6d0edee37a5fddbd08773fa5fc54ed2 | [
"MIT"
] | 1 | 2018-08-01T10:14:15.000Z | 2018-08-01T10:14:15.000Z | src/actions/index.js | chulinguy/tango-for-dummies | d188b4a0f6d0edee37a5fddbd08773fa5fc54ed2 | [
"MIT"
] | null | null | null | export const imgChange = value => ({
type: 'MOVE_CHANGE',
value
});
export const markFavMove = value => ({
type: 'MARK_MOVE_AS_FAV',
value
});
export const unmarkFavMove = value => ({
type: 'UNMARK_MOVE_AS_FAV',
value
});
| 15.8 | 40 | 0.64557 |
a1cb3ffa9620f3fe91150d892c9d193b5d407027 | 276 | js | JavaScript | app/containers/Signup/selectors.js | activedecay/musical-meme | 7c2fb1dd9edae019bf27365cc20656ac4b17cf28 | [
"MIT"
] | null | null | null | app/containers/Signup/selectors.js | activedecay/musical-meme | 7c2fb1dd9edae019bf27365cc20656ac4b17cf28 | [
"MIT"
] | 5 | 2020-07-17T11:17:36.000Z | 2022-03-02T04:33:26.000Z | app/containers/Signup/selectors.js | activedecay/musical-meme | 7c2fb1dd9edae019bf27365cc20656ac4b17cf28 | [
"MIT"
] | 1 | 2019-08-29T02:17:00.000Z | 2019-08-29T02:17:00.000Z | import { createSelector } from 'reselect';
const selectSignupDomain = () => (state) => state.get('signup');
const selectSignup = () => createSelector(
selectSignupDomain(),
(substate) => substate.toJS()
);
export default selectSignup;
export {
selectSignupDomain,
};
| 19.714286 | 64 | 0.695652 |
a1cbb7ef8b23a15a548b1998648798a3b43cb57c | 1,772 | js | JavaScript | test/setup/profile/secondInstance.js | ionnlab/ionn-backend | c0043206175937143c1c035eb93e214271dd89e2 | [
"MIT"
] | 1 | 2017-01-02T08:23:53.000Z | 2017-01-02T08:23:53.000Z | test/setup/profile/secondInstance.js | ionnlab/ionn-backend | c0043206175937143c1c035eb93e214271dd89e2 | [
"MIT"
] | null | null | null | test/setup/profile/secondInstance.js | ionnlab/ionn-backend | c0043206175937143c1c035eb93e214271dd89e2 | [
"MIT"
] | null | null | null | import connection from '../create/connection';
import createInstance from '../create/instance';
import createTestClasses from '../create/classes';
import createTestDataEndpoints from '../create/dataEndpoint';
import createTestScripts from '../create/scripts';
import createAPNSSocket from '../create/apnsSocket';
import createGCMSocket from '../create/gcmSocket';
import createAPNSDevices from '../create/apnsDevices';
import createGCMDevices from '../create/gcmDevices';
const secondInstance = () => {
const secondInstanceStructure = {};
return createInstance()
.then((instanceName) => {
secondInstanceStructure.instanceName = instanceName;
connection.setInstance(instanceName);
return createTestClasses(3);
})
.then((classNames) => {
secondInstanceStructure.classNames = classNames;
return createTestDataEndpoints(classNames[0], 2);
})
.then((dataEndpointsNames) => {
secondInstanceStructure.dataEndpointsNames = dataEndpointsNames;
return createTestScripts(1);
})
.then((scriptsNames) => {
secondInstanceStructure.scriptsNames = scriptsNames;
return createAPNSSocket();
})
.then((apnsSocketState) => {
secondInstanceStructure.apnsSocketState = apnsSocketState;
return createGCMSocket();
})
.then((gcmSocketState) => {
secondInstanceStructure.gcmSocketState = gcmSocketState;
return createAPNSDevices(1);
})
.then((apnsDevicesNames) => {
secondInstanceStructure.apnsDevicesNames = apnsDevicesNames;
return createGCMDevices(1);
})
.then((gcmDevicesNames) => {
secondInstanceStructure.gcmDevicesNames = gcmDevicesNames;
return secondInstanceStructure;
});
};
export default secondInstance;
| 29.533333 | 70 | 0.711061 |
a1cfd8771b047d74e8062d0cea072ee40f9e10b4 | 5,029 | js | JavaScript | src/pe.js | RichardMarks/firestarter-iii | 660aa1bf2eda32e37d3f494672a0b3b47f19295f | [
"MIT"
] | null | null | null | src/pe.js | RichardMarks/firestarter-iii | 660aa1bf2eda32e37d3f494672a0b3b47f19295f | [
"MIT"
] | null | null | null | src/pe.js | RichardMarks/firestarter-iii | 660aa1bf2eda32e37d3f494672a0b3b47f19295f | [
"MIT"
] | null | null | null | import {
point,
magnitude,
normalize,
dotProduct,
perpDotProduct
} from './vmath'
export const body = actor => {
const bodyInst = {
centerOfMass: point(0, 0),
mass: 10.0,
inertia: 0.0,
staticFrictionCoefficient: 0.7,
kineticFrictionCoefficient: 0.6,
coefficientOfRestitution: 0.4,
linearVelocity: point(0, 0),
orientation: 0.0,
angularVelocity: 0.0,
totalForce: point(0, 0),
totalTorque: 0.0,
frictionForce: point(0, 0),
totalImpulse: 0.0,
updatePosition (deltaTime) {
bodyInst.linearVelocity.x += (bodyInst.totalForce.x / bodyInst.mass) * deltaTime
bodyInst.linearVelocity.y += (bodyInst.totalForce.y / bodyInst.mass) * deltaTime
actor.x += bodyInst.linearVelocity.x * deltaTime
actor.y += bodyInst.linearVelocity.y * deltaTime
},
updateRotation (deltaTime) {
bodyInst.angularVelocity += (bodyInst.totalTorque / bodyInst.inertia) * deltaTime
bodyInst.orientation += bodyInst.angularVelocity * deltaTime
},
updateFriction (deltaTime) {
const friction = point(
(bodyInst.frictionForce.x / bodyInst.mass) * deltaTime,
(bodyInst.frictionForce.y / bodyInst.mass) * deltaTime)
// applies friction to linear velocity
// only if the body will not move by the integration
if (Math.abs(bodyInst.linearVelocity.x) >= Math.abs(friction.x)) {
bodyInst.linearVelocity.x += friction.x
} else {
bodyInst.linearVelocity.x = 0
}
if (Math.abs(bodyInst.linearVelocity.y) >= Math.abs(friction.y)) {
bodyInst.linearVelocity.y += friction.y
} else {
bodyInst.linearVelocity.y = 0
}
// apply damping
if (Math.abs(bodyInst.linearVelocity.x) <= 0.1) {
bodyInst.linearVelocity.x = 0
}
if (Math.abs(bodyInst.linearVelocity.y) <= 0.1) {
bodyInst.linearVelocity.y = 0
}
// damping for rotation since friction does not affect rotation
bodyInst.angularVelocity *= 0.995
},
update (deltaTime) {
bodyInst.updatePosition(deltaTime)
bodyInst.updateRotation(deltaTime)
bodyInst.updateFriction(deltaTime)
bodyInst.resetForces()
},
resetForces () {
bodyInst.totalTorque = 0.0
bodyInst.totalImpulse = 0.0
bodyInst.totalForce.x = 0.0
bodyInst.totalForce.y = 0.0
bodyInst.frictionForce.x = 0.0
bodyInst.frictionForce.y = 0.0
},
applyLinearForce (force) {
bodyInst.totalForce.x += force.x
bodyInst.totalForce.y += force.y
},
applyTorque (torque) {
bodyInst.totalTorque += torque
},
applyForce (force, pointOfContact) {
bodyInst.totalForce.x += force.x
bodyInst.totalForce.y += force.y
const arm = point(0, 0)
arm.x = pointOfContact.x - bodyInst.centerOfMass.x
arm.y = pointOfContact.y - bodyInst.centerOfMass.y
bodyInst.totalTorque += perpDotProduct(arm, force)
},
applyGravity (gravity = 9.8) {
bodyInst.applyLinearForce(point(0, gravity * bodyInst.mass))
},
applyFriction (gravity) {
let friction = null
if (magnitude(bodyInst.linearVelocity) < 1.0) {
friction = point(bodyInst.totalForce.x, bodyInst.totalForce.y)
normalize(friction)
const factor = -(bodyInst.mass * gravity) * bodyInst.staticFrictionCoefficient
friction.x *= factor
friction.y *= factor
} else {
friction = point(bodyInst.linearVelocity.x, bodyInst.linearVelocity.y)
normalize(friction)
const factor = -(bodyInst.mass * gravity) * bodyInst.kineticFrictionCoefficient
friction.x *= factor
friction.y *= factor
}
bodyInst.frictionForce.x += friction.x
bodyInst.frictionForce.y += friction.y
},
handleCollision (otherBody, collisionNormal) {
normalize(collisionNormal)
const relativeVelocity = point(
bodyInst.linearVelocity.x - otherBody.linearVelocity.x,
bodyInst.linearVelocity.y - otherBody.linearVelocity.y)
relativeVelocity.x *= -(1 + bodyInst.coefficientOfRestitution)
relativeVelocity.y *= -(1 + bodyInst.coefficientOfRestitution)
const invSumOfMass = (1 / bodyInst.mass) + (1 / otherBody.mass)
const impulseA = dotProduct(relativeVelocity, collisionNormal)
const impulseV = point(
collisionNormal.x * invSumOfMass,
collisionNormal.y * invSumOfMass)
const impulseB = dotProduct(collisionNormal, impulseV)
const impulse = impulseA / impulseB
const linearVelocityFactor = impulse / bodyInst.mass
const otherLinearVelocityFactor = impulse / otherBody.mass
bodyInst.linearVelocity.x += collisionNormal.x * linearVelocityFactor
bodyInst.linearVelocity.y += collisionNormal.y * linearVelocityFactor
otherBody.linearVelocity.x += collisionNormal.x * otherLinearVelocityFactor
otherBody.linearVelocity.y += collisionNormal.y * otherLinearVelocityFactor
}
}
return bodyInst
}
| 33.304636 | 87 | 0.662756 |
a1d13ab804f952547a2ab600dc6c5d08d7e76c2e | 5,136 | js | JavaScript | SuiteCommerce Advanced/SC_21.1_Live/LocalDistributionAdvanced/javascript/compiled/Cart.Item.Summary.View.js | Rudracool/MotherCareBackend- | 1e38dd4c839929b026b8565739fcc7879a9b79c3 | [
"MIT"
] | null | null | null | SuiteCommerce Advanced/SC_21.1_Live/LocalDistributionAdvanced/javascript/compiled/Cart.Item.Summary.View.js | Rudracool/MotherCareBackend- | 1e38dd4c839929b026b8565739fcc7879a9b79c3 | [
"MIT"
] | null | null | null | SuiteCommerce Advanced/SC_21.1_Live/LocalDistributionAdvanced/javascript/compiled/Cart.Item.Summary.View.js | Rudracool/MotherCareBackend- | 1e38dd4c839929b026b8565739fcc7879a9b79c3 | [
"MIT"
] | null | null | null | /*
© 2020 NetSuite Inc.
User may not copy, modify, distribute, or re-bundle or otherwise make available this code;
provided, however, if you are an authorized user with a NetSuite account or log-in, you
may use this code subject to the terms that govern your access and use.
*/
define("Cart.Item.Summary.View", ["require", "exports", "underscore", "cart_item_summary.tpl", "Profile.Model", "Cart.Promocode.List.Item.View", "Backbone.CollectionView", "Backbone.View"], function (require, exports, _, cart_item_summary_tpl, Profile_Model_1, CartPromocodeListItemView, BackboneCollectionView, BackboneView) {
"use strict";
return BackboneView.extend({
// @property {Function} template
template: cart_item_summary_tpl,
// @property {Object} events
events: {
'click [data-action="plus"]': 'addQuantity',
'click [data-action="minus"]': 'subQuantity'
},
// @method addQuantity Add 1 to the quantity field
// @param {jQuery.Event} e
// @return {Void}
addQuantity: function (e) {
e.preventDefault();
var $element = this.$(e.target);
var quantity_input = $element.parent().find('input');
var old_value = quantity_input.val();
var max_quantity = this.model.get('item').get('_maximumQuantity', true);
var new_val = parseFloat(old_value) + 1;
new_val = max_quantity ? Math.min(max_quantity, new_val) : new_val;
quantity_input.val(new_val);
quantity_input.change();
},
// @method subQuantity Subtract 1 from the quantity field
// @param {jQuery.Event} e
// @return {Void}
subQuantity: function (e) {
e.preventDefault();
var $element = this.$(e.target);
var quantity_input = $element.parent().find('input');
var old_value = quantity_input.val();
var new_val = parseFloat(old_value) - 1;
new_val = Math.max(this.model.get('item').get('_minimumQuantity', true), new_val);
quantity_input.val(new_val);
quantity_input.change();
},
childViews: {
PromocodeList: function () {
if (this.model.get('discounts_impact')) {
var discounts = _.filter(this.model.get('discounts_impact').discounts, function (discount) {
return !!discount.promotion_couponcode;
});
return new BackboneCollectionView({
collection: discounts,
viewsPerRow: 1,
childView: CartPromocodeListItemView,
childViewOptions: {
isReadOnly: true,
source: 'item_summary'
}
});
}
}
},
// @method getContext
// @return {Cart.Item.Summary.View.Context}
getContext: function () {
var minimum_quantity = this.model.get('item').get('_minimumQuantity', true) || 1;
var maximum_quantity = this.model.get('item').get('_maximumQuantity', true);
var price_container_object = this.model.getPrice();
// @class Cart.Item.Summary.View.Context
return {
// @property {Model} line
line: this.model,
// @property {String} lineId
lineId: this.model.get('internalid'),
// @property {Boolean} isMinusButtonDisabled
isMinusButtonDisabled: this.model.get('item').get('quantity') <= minimum_quantity ||
this.model.get('item').get('quantity') === 1,
// @property {Boolean} isPlusButtonDisabled
isPlusButtonDisabled: !!maximum_quantity && this.model.get('item').get('quantity') >= maximum_quantity,
// @property {Boolean} showQuantity
showQuantity: this.model.get('item').get('_itemType') === 'GiftCert',
// @property {Boolean} showComparePrice
showComparePrice: this.model.get('amount') > this.model.get('total'),
// @property {Boolean} showMinimumQuantity
showMinimumQuantity: minimum_quantity > 1,
// @property {Integer} minimumQuantity
minimumQuantity: minimum_quantity,
// @property {Boolean} showMaximumQuantity
showMaximumQuantity: !!maximum_quantity,
// @property {Integer} maximumQuantity
maximumQuantity: maximum_quantity,
// @property {Boolean} isPriceEnabled
isPriceEnabled: !Profile_Model_1.ProfileModel.getInstance().hidePrices(),
// @property {String} totalFormatted
totalFormatted: price_container_object.total_formatted || this.model.get('total_formatted') || ''
};
// @class Cart.Item.Summary.View
}
});
});
//# sourceMappingURL=Cart.Item.Summary.View.js.map
| 50.352941 | 327 | 0.567952 |
a1d153e97f692ccd5d8322a1197818e28b99273e | 6,636 | js | JavaScript | screens/Profile.js | austinbyersking/CryptoWallet | 82d7e5f23e510220fc9fc4cfb235ce8e8f21e4e4 | [
"MIT"
] | null | null | null | screens/Profile.js | austinbyersking/CryptoWallet | 82d7e5f23e510220fc9fc4cfb235ce8e8f21e4e4 | [
"MIT"
] | null | null | null | screens/Profile.js | austinbyersking/CryptoWallet | 82d7e5f23e510220fc9fc4cfb235ce8e8f21e4e4 | [
"MIT"
] | null | null | null | import React from 'react';
import {
View,
Text,
TouchableOpacity,
ScrollView,
Image,
Switch
} from 'react-native';
import { MainLayout } from "./";
import { HeaderBar } from "../components";
import { FONTS, COLORS, SIZES, dummyData, icons } from "../constants";
const SectionTitle = ({ title }) => {
return (
<View
style={{
marginTop: SIZES.padding
}}
>
<Text style={{ color: COLORS.lightGray3, ...FONTS.h4 }}>{title}</Text>
</View>
)
}
const Setting = ({ title, value, type, onPress }) => {
if (type == "button") {
return (
<TouchableOpacity
style={{
flexDirection: 'row',
height: 50,
alignItems: 'center'
}}
onPress={onPress}
>
<Text style={{ flex: 1, color: COLORS.white, ...FONTS.h3 }}>{title}</Text>
<View
style={{
flexDirection: 'row',
alignItems: 'center'
}}
>
<Text style={{ marginRight: SIZES.radius, color: COLORS.lightGray3, ...FONTS.h3 }}>{value}</Text>
<Image
source={icons.rightArrow}
style={{
height: 15,
width: 15,
tintColor: COLORS.white
}}
/>
</View>
</TouchableOpacity>
)
} else {
return (
<View
style={{
flexDirection: 'row',
height: 50,
alignItems: 'center'
}}
>
<Text style={{ flex: 1, color: COLORS.white, ...FONTS.h3 }}>{title}</Text>
<Switch
value={value}
onValueChange={(value) => onPress(value)}
/>
</View>
)
}
}
const Profile = () => {
const [faceId, setFaceId] = React.useState(true)
return (
<MainLayout>
<View
style={{
flex: 1,
//paddingHorizontal: SIZES.padding,
backgroundColor: COLORS.black
}}
>
{/* Header */}
<HeaderBar
title="Profile"
/>
{/* Details */}
<ScrollView
contentContainerStyle={{
paddingHorizontal: SIZES.radius
}}
>
{/* Email & User Id */}
<View
style={{
flexDirection: 'row',
marginTop: SIZES.radius
}}
>
{/* Email and ID */}
<View
style={{
flex: 1,
}}
>
<Text style={{ color: COLORS.white, ...FONTS.h3 }}>{dummyData.profile.email}</Text>
<Text style={{ color: COLORS.lightGray3, ...FONTS.body4 }}>ID: {dummyData.profile.id}</Text>
</View>
{/* Status */}
<View
style={{
flexDirection: 'row',
alignItems: 'center'
}}
>
<Image
source={icons.verified}
style={{
height: 25,
width: 25
}}
/>
<Text style={{ marginLeft: SIZES.base, color: COLORS.lightGreen, ...FONTS.body4 }}>Verified</Text>
</View>
</View>
{/* APP */}
<SectionTitle
title="APP"
/>
<Setting
title="Launch Screen"
value="Home"
type="button"
onPress={() => console.log("Pressed")}
/>
<Setting
title="Appearance"
value="Dark"
type="button"
onPress={() => console.log("Pressed")}
/>
{/* ACCOUNT */}
<SectionTitle
title="ACCOUNT"
/>
<Setting
title="Payment Currency"
value="USD"
type="button"
onPress={() => console.log("Pressed")}
/>
<Setting
title="Language"
value="English"
type="button"
onPress={() => console.log("Pressed")}
/>
{/* SECURITY */}
<SectionTitle
title="SECURITY"
/>
<Setting
title="FaceID"
value={faceId}
type="switch"
onPress={(value) => setFaceId(value)}
/>
<Setting
title="Password Settings"
value=""
type="button"
onPress={() => console.log("Pressed")}
/>
<Setting
title="Change Password"
value=""
type="button"
onPress={() => console.log("Pressed")}
/>
<Setting
title="2-Factor Authentication"
value=""
type="button"
onPress={() => console.log("Pressed")}
/>
</ScrollView>
</View>
</MainLayout>
)
}
export default Profile; | 31.15493 | 126 | 0.313894 |
a1d1e29cbd7c226926e8154e1880b2a728f6baee | 426 | js | JavaScript | src/retrieve.js | ElegastVZW/mock-xrm | 2bdf21246cd52bfad967da55831507b74ae69645 | [
"MIT"
] | 5 | 2020-09-02T14:47:31.000Z | 2022-03-17T03:07:27.000Z | src/retrieve.js | ElegastVZW/mock-xrm | 2bdf21246cd52bfad967da55831507b74ae69645 | [
"MIT"
] | 4 | 2020-09-13T03:27:21.000Z | 2020-12-16T19:54:49.000Z | src/retrieve.js | ElegastVZW/mock-xrm | 2bdf21246cd52bfad967da55831507b74ae69645 | [
"MIT"
] | 5 | 2020-09-04T05:00:58.000Z | 2021-11-29T15:48:10.000Z | import executeGet from "./utility/executeGet";
import retrieveMetadataWrapperMemo from './retrieveMetadataWrapperMemo';
const retrieve = async (entityLogicalName, id, options = '') => {
let meta = await retrieveMetadataWrapperMemo(entityLogicalName);
let result = await executeGet(`${meta.EntityMetadata.LogicalCollectionName}(${id})${options ? options : ''}`)();
return result.json();
}
export default retrieve; | 42.6 | 116 | 0.744131 |
a1d264db9f38bc24a982c6a19327c04a22079535 | 2,871 | js | JavaScript | data/js/modules/irclog/users-list.js | inexor-game/community-site-deprecated | 31b101f658b9506184c86621f1af258f4d8344b3 | [
"MIT"
] | 1 | 2015-02-01T12:44:49.000Z | 2015-02-01T12:44:49.000Z | data/js/modules/irclog/users-list.js | inexor-game/community-site | 31b101f658b9506184c86621f1af258f4d8344b3 | [
"MIT"
] | 8 | 2015-01-18T21:30:04.000Z | 2015-02-21T00:37:03.000Z | data/js/modules/irclog/users-list.js | inexor-game/community-site-deprecated | 31b101f658b9506184c86621f1af258f4d8344b3 | [
"MIT"
] | null | null | null | $(document).ready(function () {
var _check_irc_users_height = function () {
if ($(window).scrollTop() > topDistance) {
if(($(window).scrollTop() - topDistance - 10) < $('#log').height() - $('#user-list').height()) {
$('#user-list').css({
'margin-top': $(window).scrollTop() - topDistance + $('header').height(),
'max-height': window.innerHeight - $('header').height()
});
} else {
$('#user-list').css({
'margin-top': $('#log').height() - $('#user-list').height(),
'max-height': window.innerHeight
});
}
} else {
$('#user-list').css({
'margin-top': 0,
'max-height': 'none'
});
}
};
var ircActions = {
};
var i = 0;
var _userlist = $('#user-list');
$('.user_message, .user_connection, .user_renaming').each(function () { $(this).data('id', i); i++; });
$('.user-action').each(function () {
var _this = $(this);
ircActions[_this.parent().data('id')] = _this.data();
});
var topDistance = _userlist.offset().top;
$(window).scroll(_check_irc_users_height);
_check_irc_users_height();
$('.user_message, .user_connection, .user_renaming').mouseenter(function () {
var _this = $(this);
var users = {};
var id = _this.data('id');
var renamings = [];
var keys = [];
var users_v = {
ops : [],
voices : [],
normal : []
}
$('#irc_selected_triangle').remove();
$('#irc_selected').removeAttr('id');
_this.children().last().append('<span id="irc_selected_triangle"><span></span></span>');
_this.attr('id', 'irc_selected');
for(var i = id; i <= _this.siblings().length + 1; i++) {
if(ircActions[i] !== undefined)
{
if(ircActions[i].userList !== undefined)
{
users = ircActions[i].userList;
break;
} else if(ircActions[i].userRename !== undefined) {
renamings.push(ircActions[i].userRename);
}
}
}
for(var i = 0; i < renamings.length; i++) {
users[renamings[i][1]] = users[renamings[i][0]];
delete users[renamings[i][0]];
}
var _ul = $('#user-list > ul');
$('li', _ul).remove();
$(_ul).append('<li class="title"><sup></sup>at the selected message were online:</li>');
$.each(users, function (i, v) {
if(v == '@') users_v.ops.push(i);
else if(v == '+') users_v.voices.push(i);
else users_v.normal.push(i);
});
users_v.ops.sort();
users_v.voices.sort();
users_v.normal.sort();
for(var i = 0; i < users_v.ops.length; i++) {
_ul.append('<li class="timed">@' + users_v.ops[i] + '</li>');
}
for(var i = 0; i < users_v.voices.length; i++) {
_ul.append('<li class="timed">+' + users_v.voices[i] + '</li>');
}
for(var i = 0; i < users_v.normal.length; i++) {
_ul.append('<li class="timed">' + users_v.normal[i] + '</li>');
}
$('#user-list .users-count').text('(' + (users_v.ops.length + users_v.voices.length + users_v.normal.length) + ')');
_check_irc_users_height();
});
}); | 32.258427 | 118 | 0.574364 |
a1d27803c258659b00ccccc6b9ecb93b172abf90 | 2,916 | js | JavaScript | js/projects.js | frontendops/portfolio-alejandro-dev | 24dda3ca64fd72883fb0bc31afe21760ae0e8324 | [
"CC-BY-3.0"
] | null | null | null | js/projects.js | frontendops/portfolio-alejandro-dev | 24dda3ca64fd72883fb0bc31afe21760ae0e8324 | [
"CC-BY-3.0"
] | 1 | 2021-03-09T20:46:16.000Z | 2021-03-09T20:46:16.000Z | js/projects.js | frontendops/portfolio-alejandro-dev | 24dda3ca64fd72883fb0bc31afe21760ae0e8324 | [
"CC-BY-3.0"
] | null | null | null | export const projects = [
{
title: 'Speed Reader',
description: "Add any text and read it at a much faster rate.",
technology: 'javascript',
link: 'https://frontendops.github.io/speed-reader-js/',
img: 'images/speed-reader.jpg',
alt: 'computer productivity',
button: 'Try Demo'
},
{
title: 'Productivity Manager',
description: "Keep track of daily taks and see how much you have accomplished in a day.",
technology: 'vue',
link: 'https://vue-task-manager.herokuapp.com/',
img: 'images/tasks.jpg',
alt: 'computer productivity',
button: 'view site'
},
{
title: 'GardenU',
description: "Allowing gardeners, plant lovers, and students to create, update, and delete entire gardens with plant info. React/Redux front end with Node.js backend.",
technology: 'react',
link: 'https://evening-refuge-33971.herokuapp.com/',
img: 'images/garden-u.jpg',
alt: 'Orange tulip',
button: 'Try Demo'
},
{
title: 'Green Tech upstate',
description: "Showing customers the benefits of solar energy in their homes. Allowing customers to get quotes on solar, roofing and HVAC. In collaboration with Green Tech upstate.",
technology: 'wordpress',
link: 'https://www.greentechupstate.com',
img: 'images/foggy_forest.jpg',
alt: 'foggy rain forest',
button: 'view site'
},
{
title: 'Quizzly',
description: "App for students to create quizzes and study.",
technology: 'react',
link: 'https://quizzly-io.herokuapp.com',
img: 'images/library.jpeg',
alt: 'beautiful library',
button: 'Try Demo'
},
{
title: 'Matching game',
description: "Matching card game built with vanilla JavaScript.",
technology: 'javascript',
link: 'http://minimalmvnt.com/memory%20game%20v2/',
img: 'images/memory_photos.jpg',
alt: 'man holding photos',
button: 'Try Demo'
},
{
title: 'Neighborhood Map',
description: "Built with react js, this is a map of my city and some of the places i like to visit.",
technology: 'react',
link: 'https://github.com/frontendops/My-neighborhood-map',
img: 'images/map_imageW.jpg',
alt: 'maps on desk',
button: 'Learn more'
},
{
title: 'WordPress site Salon',
description: "Site for local hair salon built with wordpress.",
technology: 'wordpress',
link: 'http://www.salonexclusivo.com',
img: 'images/salon_outside.jpg',
alt: 'outside of shops',
button: 'view site'
},
{
title: 'Wordpress site blog',
description: "Blog for anime channel built with wordpress",
technology: 'wordpress',
link: 'http://www.easternenvoy.com',
img: 'images/anime_feels.jpg',
alt: 'tokyo night roads',
button: 'view site'
},
]
| 34.305882 | 187 | 0.621056 |
a1d312eb5779a79ef970b2ff22d88c947b435e96 | 149 | js | JavaScript | benchmarks/ssr-comparison/src/size-test/cssobj-server.js | theghostyced/fela | e58f5b722ae52acd08c1f5030c9b2549beb61b0e | [
"MIT"
] | 1 | 2020-04-08T17:05:23.000Z | 2020-04-08T17:05:23.000Z | benchmarks/ssr-comparison/src/size-test/cssobj-server.js | theghostyced/fela | e58f5b722ae52acd08c1f5030c9b2549beb61b0e | [
"MIT"
] | null | null | null | benchmarks/ssr-comparison/src/size-test/cssobj-server.js | theghostyced/fela | e58f5b722ae52acd08c1f5030c9b2549beb61b0e | [
"MIT"
] | null | null | null | import cssobjCore from 'cssobj-core'
import cssobjPluginLocalize from 'cssobj-plugin-localize'
import cssobjPluginGencss from 'cssobj-plugin-gencss'
| 37.25 | 57 | 0.845638 |
a1d3207cf2e5d4d195637733dd639a59a758bd2c | 3,676 | js | JavaScript | App.js | mositodrone/smart-brain-frontend | b4d5311df3e3cc1ab27a47e2b53794f5e97888fd | [
"Apache-2.0"
] | null | null | null | App.js | mositodrone/smart-brain-frontend | b4d5311df3e3cc1ab27a47e2b53794f5e97888fd | [
"Apache-2.0"
] | 1 | 2020-07-21T12:50:22.000Z | 2020-07-21T12:50:22.000Z | App.js | mositodrone/smart-brain-frontend | b4d5311df3e3cc1ab27a47e2b53794f5e97888fd | [
"Apache-2.0"
] | null | null | null | import React, { Component } from 'react';
import Particles from 'react-particles-js'
import Register from './components/Register/register.js'
import FaceRecognition from './components/FaceRecognition/FaceRecognition';
import Navigation from './components/Navigation/Navigation';
import { SignIn } from './components/signIn/signIn';
import Logo from './components/Logo/Logo';
import Rank from './components/Rank/Rank';
import ErrorCatcher from './components/errorCatcher/ErrorCatcher';
import ImageLinkForm from './components/ImageLinkForm/ImageLinkForm';
import './App.css';
const particleOptions = {
particles:{
number:{
value: 300,
density: {
enable: true,
value_area: 800
}
}
}
}
const initialState = {
input: '',
imageUrl: '',
box: {},
route: 'signin',
isSignedIn: false,
user: {
id: '',
name: '',
email: '',
entries: 0,
joined: ''
}
}
class App extends Component {
constructor() {
super();
this.state = initialState;
}
loadUser = (data) => {
this.setState({user: {
id: data.id,
name: data.name,
email: data.email,
entries: data.entries,
joined: data.joined
}
})
}
calculateFaceLocation = (data) => {
const clarifaiFace = data.outputs[0].data.regions[0].region_info.bounding_box;
const image = document.getElementById('inputImage');
const width = Number(image.width);
const height = Number(image.height);
return {
leftCol: clarifaiFace.left_col * width,
topRow: clarifaiFace.top_row * height,
rightCol:width - (clarifaiFace.right_col * width),
bottomRow: height - (clarifaiFace.bottom_row * height)
}
}
displayFaceCatch = (box) => {
console.log(box);
this.setState({box: box});
}
onInputChange = (event) => {
this.setState({input: event.target.value});
}
onButtonSubmit = () => {
this.setState({imageUrl: this.state.input});
fetch('http://localhost:3001/imageurl', {
method: 'post',
headers: {'content-type': 'application/json'},
body: JSON.stringify({
input: this.state.input
})
})
.then(response => response.json())
.then(response => {
if (response)
fetch('http://localhost:3001/image', {
method: 'put',
headers: {'content-type': 'application/json'},
body: JSON.stringify({
id: this.state.user.id
})
})
.then(response => response.json())
.then(count => {
this.setState(
Object.assign(this.state.user, { entries: count}))
})
.catch(console.log)
this.displayFaceCatch(this.calculateFaceLocation(response))
}
)
}
onRouteChange = (route) => {
if (route === 'signout') {
this.setState(initialState)
} else if (route === 'home') {
this.setState({isSignedIn: true})
}
this.setState({route: route});
}
render() {
const { isSignedIn, imageUrl, route, box,} = this.state;
return (
<div className="App">
<Particles className= 'particles'
params={{particleOptions}}
/>
<Navigation
isSignedIn={isSignedIn}
onRouteChange={this.onRouteChange}/>
<ErrorCatcher>
{
this.state.route === 'home'
?<div>
<Logo />
<Rank name={this.state.user.name} entries={this.state.user.entries} />
<ImageLinkForm onInputChange={this.onInputChange} onButtonSubmit={this.onButtonSubmit}/>
<FaceRecognition box={box} imageUrl={imageUrl}/>
</div>
: (
route === 'signin'
?<SignIn loadUser={this.loadUser} onRouteChange={this.onRouteChange} onError={this.Error}/>
:<Register loadUser={this.loadUser} onRouteChange={this.onRouteChange}/>
)
}
</ErrorCatcher>
</div>
);
}
}
export default App;
| 24.506667 | 100 | 0.635201 |
a1d44ef389d07a0b380996e9bf0ebaf1c389b329 | 326 | js | JavaScript | app/containers/Admin/actions.js | CaoThien96/DATN | 2c4306a529d13e1477ddf5e82b521a937e7ffa73 | [
"MIT"
] | 2 | 2021-07-09T15:35:55.000Z | 2021-11-23T08:21:38.000Z | app/containers/Admin/actions.js | CaoThien96/DATN | 2c4306a529d13e1477ddf5e82b521a937e7ffa73 | [
"MIT"
] | null | null | null | app/containers/Admin/actions.js | CaoThien96/DATN | 2c4306a529d13e1477ddf5e82b521a937e7ffa73 | [
"MIT"
] | 1 | 2019-12-21T12:59:22.000Z | 2019-12-21T12:59:22.000Z | import {
UPDATE_NEWS,
UPDATE_NEWS_SUCCESS,
UPDATE_NEWS_FAIL,
} from './constanst';
export const updateNews = () => ({
type: UPDATE_NEWS,
});
export const updateNewsSuccess = payload => ({
type: UPDATE_NEWS_SUCCESS,
payload,
});
export const updateNewsFail = err => ({
type: UPDATE_NEWS_FAIL,
payload: err,
});
| 19.176471 | 46 | 0.687117 |
a1d6ff55d90f026422c70d71b83618b1a0373654 | 2,004 | js | JavaScript | build/cjs/modules/functions/_common/plnFromRay.js | design-automation/mobius-sim-funcs | 8e7a8a7b0f7f4d0f3f28746a2127e24500475214 | [
"MIT"
] | null | null | null | build/cjs/modules/functions/_common/plnFromRay.js | design-automation/mobius-sim-funcs | 8e7a8a7b0f7f4d0f3f28746a2127e24500475214 | [
"MIT"
] | null | null | null | build/cjs/modules/functions/_common/plnFromRay.js | design-automation/mobius-sim-funcs | 8e7a8a7b0f7f4d0f3f28746a2127e24500475214 | [
"MIT"
] | null | null | null | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.plnFromRay = void 0;
const mobius_sim_1 = require("@design-automation/mobius-sim");
function plnFromRay(ray) {
// overloaded case
const ray_dep = (0, mobius_sim_1.getArrDepth)(ray);
if (ray_dep === 3) {
return ray.map((ray_one) => plnFromRay(ray_one));
}
// normal case
ray = ray;
const z_vec = (0, mobius_sim_1.vecNorm)(ray[1]);
let vec = [0, 0, 1];
if ((0, mobius_sim_1.vecDot)(vec, z_vec) === 1) {
vec = [1, 0, 0];
}
const x_axis = (0, mobius_sim_1.vecCross)(vec, z_vec);
const y_axis = (0, mobius_sim_1.vecCross)(x_axis, z_vec);
return [ray[0].slice(), x_axis, y_axis];
}
exports.plnFromRay = plnFromRay;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGxuRnJvbVJheS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9tb2R1bGVzL2Z1bmN0aW9ucy9fY29tbW9uL3BsbkZyb21SYXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsOERBQTJHO0FBQzNHLFNBQWdCLFVBQVUsQ0FBQyxHQUFrQjtJQUN6QyxrQkFBa0I7SUFDbEIsTUFBTSxPQUFPLEdBQVcsSUFBQSx3QkFBVyxFQUFDLEdBQUcsQ0FBQyxDQUFDO0lBQ3pDLElBQUksT0FBTyxLQUFLLENBQUMsRUFBRTtRQUNmLE9BQVEsR0FBYyxDQUFDLEdBQUcsQ0FBQyxDQUFDLE9BQU8sRUFBRSxFQUFFLENBQUMsVUFBVSxDQUFDLE9BQU8sQ0FBQyxDQUFhLENBQUM7S0FDNUU7SUFDRCxjQUFjO0lBQ2QsR0FBRyxHQUFHLEdBQVcsQ0FBQztJQUNsQixNQUFNLEtBQUssR0FBUyxJQUFBLG9CQUFPLEVBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDcEMsSUFBSSxHQUFHLEdBQVMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO0lBQzFCLElBQUksSUFBQSxtQkFBTSxFQUFDLEdBQUcsRUFBRSxLQUFLLENBQUMsS0FBSyxDQUFDLEVBQUU7UUFDMUIsR0FBRyxHQUFHLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQztLQUNuQjtJQUNELE1BQU0sTUFBTSxHQUFTLElBQUEscUJBQVEsRUFBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUM7SUFDMUMsTUFBTSxNQUFNLEdBQVMsSUFBQSxxQkFBUSxFQUFDLE1BQU0sRUFBRSxLQUFLLENBQUMsQ0FBQztJQUM3QyxPQUFPLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBVSxFQUFFLE1BQU0sRUFBRSxNQUFNLENBQUMsQ0FBQztBQUNwRCxDQUFDO0FBaEJELGdDQWdCQyJ9 | 87.130435 | 1,242 | 0.853792 |
a1d71a635eb4f4ab1227dc1c19d0255f4c0aa2d8 | 2,327 | js | JavaScript | UI/05_ChartedUI/web/public/assets/chartdata/boxplot/boxplot-multi.js | erhwenkuo/streaming-training | e49fa732b1a41519dfca7fe88463c10a36114f1e | [
"Apache-2.0"
] | 19 | 2018-03-31T06:20:16.000Z | 2021-04-08T16:04:33.000Z | WebContent/data/boxplot-multi.js | ultraN/project-luna | f114c23501f3db4b62f7ae36479b13f9cc38fc51 | [
"MIT"
] | null | null | null | WebContent/data/boxplot-multi.js | ultraN/project-luna | f114c23501f3db4b62f7ae36479b13f9cc38fc51 | [
"MIT"
] | 3 | 2018-04-10T14:02:41.000Z | 2020-11-17T06:40:19.000Z |
// Generate data.
data = [];
for (var seriesIndex = 0; seriesIndex < 5; seriesIndex++) {
var seriesData = [];
for (var i = 0; i < 18; i++) {
var cate = [];
for (var j = 0; j < 100; j++) {
cate.push(Math.random() * 200);
}
seriesData.push(cate);
}
data.push(echarts.dataTool.prepareBoxplotData(seriesData));
}
option = {
title: {
text: 'Multiple Categories',
left: 'center',
},
legend: {
y: '10%',
data: ['category0', 'category1', 'category2', 'category3']
},
tooltip: {
trigger: 'item',
axisPointer: {
type: 'shadow'
}
},
grid: {
left: '10%',
top: '20%',
right: '10%',
bottom: '15%'
},
xAxis: {
type: 'category',
data: data[0].axisData,
boundaryGap: true,
nameGap: 30,
splitArea: {
show: true
},
axisLabel: {
formatter: 'expr {value}'
},
splitLine: {
show: false
}
},
yAxis: {
type: 'value',
name: 'Value',
min: -400,
max: 600,
splitArea: {
show: false
}
},
dataZoom: [
{
type: 'inside',
start: 0,
end: 20
},
{
show: true,
height: 20,
type: 'slider',
top: '90%',
xAxisIndex: [0],
start: 0,
end: 20
}
],
series: [
{
name: 'category0',
type: 'boxplot',
data: data[0].boxData,
tooltip: {formatter: formatter}
},
{
name: 'category1',
type: 'boxplot',
data: data[1].boxData,
tooltip: {formatter: formatter}
},
{
name: 'category2',
type: 'boxplot',
data: data[2].boxData,
tooltip: {formatter: formatter}
}
]
};
function formatter(param) {
return [
'Experiment ' + param.name + ': ',
'upper: ' + param.data[0],
'Q1: ' + param.data[1],
'median: ' + param.data[2],
'Q3: ' + param.data[3],
'lower: ' + param.data[4]
].join('<br/>')
} | 21.348624 | 66 | 0.400516 |
a1d804149aa5a0ad60a0953095a50a985d63f163 | 677 | js | JavaScript | client/pages/index/config.js | lijunren/zfb-mini-program | 6ebcdd51ec3d13e5d5bf7b1b99779bfbbd0a15fc | [
"Apache-2.0"
] | null | null | null | client/pages/index/config.js | lijunren/zfb-mini-program | 6ebcdd51ec3d13e5d5bf7b1b99779bfbbd0a15fc | [
"Apache-2.0"
] | null | null | null | client/pages/index/config.js | lijunren/zfb-mini-program | 6ebcdd51ec3d13e5d5bf7b1b99779bfbbd0a15fc | [
"Apache-2.0"
] | null | null | null | export const config = {
title: '小程序 Serverless 快速入门',
subTitle: '以下展示小程序 Serverless 入门教程',
listItems1: [
{
title: '开通小程序 Serverless',
arrow: true,
url: '/pages/open/open'
},
],
listItems2: [
{
title: '上传文件',
arrow: true,
url: '/pages/upload/upload'
},
{
title: '前端操作数据库',
arrow: true,
url: '/pages/database/database'
},
{
title: '了解云函数',
arrow: true,
url: '/pages/functions/functions'
},
{
title: '了解云调用',
arrow: true,
url: '/pages/cloud/cloud'
}
],
footerText: '了解更多小程序 Serverless 内容,请前往小程序文档中心查看详细文档',
footerUrl: {
text: '阿里云文档中心',
url: 'https://help.aliyun.com/document_detail/122371.html'
}
}; | 17.815789 | 60 | 0.604136 |
a1da09d95874162ab6bdcfd879e6d8a8d89dd2a8 | 2,974 | js | JavaScript | src/js/main.js | strongfanfan/3D-carousel | 522989be994dd6d06691151b95775443ebf165ba | [
"MIT"
] | null | null | null | src/js/main.js | strongfanfan/3D-carousel | 522989be994dd6d06691151b95775443ebf165ba | [
"MIT"
] | null | null | null | src/js/main.js | strongfanfan/3D-carousel | 522989be994dd6d06691151b95775443ebf165ba | [
"MIT"
] | null | null | null | (function () {
var figureNode = document.getElementsByClassName('figure-carousel'),
wrapNode = document.getElementsByClassName('wrap-carousel')[0],
navNode=document.getElementsByClassName('nav-carousel')[0],
controllerNode=[],
count = carousel.count,
median = Math.floor((count + 1) / 2)-1,
angle = 360 / count,
distance = carousel.width / 2 / Math.tan(angle / 2 / 180 * Math.PI) + 50,
centerNum = 0,
transformAngle=0,
prefixs = ["Moz", "O", "Ms", "Webkit", ""];
function init() {
for (var i = 0, j = figureNode.length; i < j; i++) {
figureNode[i].tabIndex = i;
controllerNode[i]=document.createElement('span');
navNode.appendChild(controllerNode[i]);
controllerNode[i].tabIndex=i;
controllerNode[i].className='controller';
(function () {
prefixs.forEach(function (value) {
figureNode[i].style[value + 'transform'] = 'rotateY(' + angle * i + 'deg) translateZ(' + distance + 'px)';
})
})(i);
figureNode[i].addEventListener('click', function () {
render(centerNum, this.tabIndex);
centerNum=this.tabIndex;
controlerCheck()
});
controllerNode[i].addEventListener('click',function () {
render(centerNum,this.tabIndex);
centerNum=this.tabIndex;
controlerCheck()
})
}
}
function addTransformPrefix(node, value) {
prefixs.forEach(function (prefix) {
node.style[prefix + 'transform'] = 'rotateY(' + value + 'deg)'
});
transformAngle=value
}
function render(center, tabIndex) {
if (center <= median) {
if (tabIndex >= center && tabIndex - center <= median) {
addTransformPrefix(wrapNode, (tabIndex - center) * angle * -1+transformAngle)
} else if (tabIndex > center) {
addTransformPrefix(wrapNode, (count + center - tabIndex) * angle+transformAngle)
} else {
addTransformPrefix(wrapNode, (center - tabIndex) * angle+transformAngle)
}
} else {
if (tabIndex >= center) {
addTransformPrefix(wrapNode, (tabIndex - center) * angle*-1+transformAngle)
} else if (tabIndex < center && center - tabIndex > median) {
addTransformPrefix(wrapNode, (count + tabIndex - center) * angle * -1+transformAngle)
} else {
addTransformPrefix(wrapNode, (center - tabIndex) * angle+transformAngle)
}
}
}
function controlerCheck() {
for (var i=0,j=controllerNode.length;i<j;i++){
controllerNode[i].className="controller"
}
controllerNode[centerNum].className='controller checked'
}
init();
})(); | 38.623377 | 126 | 0.544385 |
a1da3543b3e80d8bb95605943de17550642f440d | 1,869 | js | JavaScript | src/components/Search/SearchResults.js | zenott/movie-browser | 11b377ce3746d02f0bc0b25f1c4036f9d3406e0d | [
"MIT"
] | 1 | 2020-05-21T19:33:53.000Z | 2020-05-21T19:33:53.000Z | src/components/Search/SearchResults.js | zenott/movie-browser | 11b377ce3746d02f0bc0b25f1c4036f9d3406e0d | [
"MIT"
] | null | null | null | src/components/Search/SearchResults.js | zenott/movie-browser | 11b377ce3746d02f0bc0b25f1c4036f9d3406e0d | [
"MIT"
] | null | null | null | import React, { Component } from 'react';
import axios from 'axios';
import { Container, Row, Col } from 'mdbreact';
import { bg } from '../Style/style.module.css';
import SearchResultsElem from './SearchResultsElem';
import { API_KEY } from '../../utils/resources';
import Loading from '../Misc/Loading';
import Error from '../Misc/Error';
export default class SearchResults extends Component {
constructor(props) {
super(props);
this.state = {
results: [],
isLoading: true,
error: null,
};
}
componentDidMount() {
const { match } = this.props;
console.log(match);
let url;
if (match.params.type === 'movie') {
url = 'https://api.themoviedb.org/3/search/movie';
} else if (match.params.type === 'tv') {
url = 'https://api.themoviedb.org/3/search/tv';
} else {
url = 'https://api.themoviedb.org/3/search/multi';
}
this.setState({ isLoading: true });
axios
.get(`${url}?query=${match.params.query}&api_key=${API_KEY}`)
.then(response => {
this.setState({ results: response.data, isLoading: false });
console.log(response.data);
})
.catch(error =>
this.setState({
error,
isLoading: false,
}),
);
}
render() {
const { results, error, isLoading } = this.state;
if (error) {
return <Error />;
}
if (isLoading) {
return <Loading />;
}
return (
<div className={bg}>
<Container className="text-white">
<Row className="justify-content-center">
<Col size="10">
<h3 className="mb-4">Search results:</h3>
{results.results.map(data => (
<SearchResultsElem key={data.id} data={data} />
))}
</Col>
</Row>
</Container>
</div>
);
}
}
| 26.323944 | 68 | 0.548957 |
a1dc9afdb13a9552202d7d3af162981521d93661 | 412 | js | JavaScript | src/App/ExpenseList/AddButton/AddExpenseListButton.js | dmcshehan/my-expenses | 899b8cad51d670e3be93899e53263b17411b2f70 | [
"MIT"
] | 3 | 2019-03-29T05:27:13.000Z | 2020-12-22T20:28:33.000Z | src/App/ExpenseList/AddButton/AddExpenseListButton.js | dmcshehan/my-expenses | 899b8cad51d670e3be93899e53263b17411b2f70 | [
"MIT"
] | 11 | 2020-08-05T04:49:49.000Z | 2022-02-26T16:00:13.000Z | src/App/ExpenseList/AddButton/AddExpenseListButton.js | dmcshehan/my-expenses | 899b8cad51d670e3be93899e53263b17411b2f70 | [
"MIT"
] | null | null | null | import React from "react";
import { useDispatch } from "react-redux";
import AddButton from "../../AddButton/AddButton";
import { showAddExpenseListForm } from "../../../store/actionCreators/expenseList";
export default function AddExpenseListButton() {
const dispatch = useDispatch();
function handleClick() {
dispatch(showAddExpenseListForm());
}
return <AddButton onClick={handleClick} />;
}
| 24.235294 | 83 | 0.720874 |
a1dcaa78c079b92498cff6b3858f342521b9f38e | 808 | js | JavaScript | src/core_plugins/metrics/server/lib/vis_data/request_processors/series/split_by_filters.js | IBMResearch/kibana-bluemix | a07267965791f2582a978e8c7190a2af8d43e159 | [
"Apache-2.0"
] | 2 | 2018-10-19T22:55:25.000Z | 2018-10-19T22:55:27.000Z | src/core_plugins/metrics/server/lib/vis_data/request_processors/series/split_by_filters.js | IBMResearch/kibana-bluemix | a07267965791f2582a978e8c7190a2af8d43e159 | [
"Apache-2.0"
] | 2 | 2020-07-17T10:03:57.000Z | 2021-05-09T15:42:13.000Z | src/core_plugins/metrics/server/lib/vis_data/request_processors/series/split_by_filters.js | IBMResearch/kibana-bluemix | a07267965791f2582a978e8c7190a2af8d43e159 | [
"Apache-2.0"
] | 1 | 2018-08-26T15:45:59.000Z | 2018-08-26T15:45:59.000Z | 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = splitByFilter;
var _lodash = require('lodash');
var _lodash2 = _interopRequireDefault(_lodash);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function splitByFilter(req, panel, series) {
return next => doc => {
if (series.split_mode === 'filters' && series.split_filters) {
series.split_filters.forEach(filter => {
_lodash2.default.set(doc, `aggs.${series.id}.filters.filters.${filter.id}.query_string.query`, filter.filter || '*');
_lodash2.default.set(doc, `aggs.${series.id}.filters.filters.${filter.id}.query_string.analyze_wildcard`, true);
});
}
return next(doc);
};
}
module.exports = exports['default'];
| 31.076923 | 125 | 0.678218 |
a1de4fa279c4fb35505033c930a8b4b5b1688f24 | 451 | js | JavaScript | tests/unit/utils/helpers/email-validator.spec.js | douglashsilva/challenge-accenture | e67a28acbed90c98b7cfcc42399b5e731319cbea | [
"MIT"
] | null | null | null | tests/unit/utils/helpers/email-validator.spec.js | douglashsilva/challenge-accenture | e67a28acbed90c98b7cfcc42399b5e731319cbea | [
"MIT"
] | null | null | null | tests/unit/utils/helpers/email-validator.spec.js | douglashsilva/challenge-accenture | e67a28acbed90c98b7cfcc42399b5e731319cbea | [
"MIT"
] | null | null | null | /* eslint-disable no-undef */
const EmailValidator = require("../../../../src/utils/helpers/email-validator")
const emailValidator = new EmailValidator()
describe('EmailValidator Helper', () => {
it('Should validate an valid email', () => {
expect(emailValidator.isValid("test@teste.com")).toBeTruthy()
})
it('Should validate an invalid email', () => {
expect(emailValidator.isValid("invalid_email")).toBeFalsy()
})
}) | 37.583333 | 79 | 0.654102 |
a1df86e15c26d99d622d11d22ba3127ab30f8101 | 5,163 | js | JavaScript | src/Collisions.js | chanibal/js13k-2021 | 4e623bec84994bc8e6655aad02dc4149119ed202 | [
"MIT"
] | null | null | null | src/Collisions.js | chanibal/js13k-2021 | 4e623bec84994bc8e6655aad02dc4149119ed202 | [
"MIT"
] | null | null | null | src/Collisions.js | chanibal/js13k-2021 | 4e623bec84994bc8e6655aad02dc4149119ed202 | [
"MIT"
] | 1 | 2021-09-13T15:57:41.000Z | 2021-09-13T15:57:41.000Z | import { Transform } from "./Transform.js";
/**
* Supported collider types:
* 1. no radius nor height - point
* 2. radius - sphere
* 3. both radius and height - vertical capsule
*/
export class Collider {
constructor(radius = 0, height = 0) {
this.radius = radius;
this.height = height;
this.collides = null;
}
}
export class CollisionSystem {
constructor(ecs) {
this.updateCollisionsSelector = ecs.select(Transform, Collider);
}
update(dt) {
window.stats.collisionsChecked = 0;
window.stats.collisions = 0;
// using broad and narrow phase makes large framerate improvements
// collisions ~1074332 -> 10000 (x107)
// time ~140000 -> 3000 (x46)
// Clear previous collisions
this.updateCollisionsSelector.iterate(entity => { entity.collides = null; });
// Broad phase
// indices are: y, x, z
const partitions = [];
this.updateCollisionsSelector.iterate(entity => {
let p = entity.get(Transform).position;
let c = entity.get(Collider);
let r = c.radius;
let h = c.height;
const dy = r+h;
const [x1,x2,y1,y2,z1,z2] = [p.x-r, p.x+r, p.y-dy, p.y+dy, p.z-r, p.z+r].map(Math.floor);
for (let y = y1; y <= y2; y++) {
if (!partitions[y]) partitions[y] = {};
for (let x = x1; x <= x2; x++) {
if (!partitions[y][x]) partitions[y][x] = {};
for (let z = z1; z <= z2; z++) {
if (!partitions[y][x][z]) partitions[y][x][z] = [];
partitions[y][x][z].push(entity);
}
}
}
});
// Narrow phase
for (let iy in partitions)
for (let ix in partitions[iy])
for (let iz in partitions[iy][ix]) {
const cell = partitions[iy][ix][iz];
for(let e1 = 0; e1 < cell.length; e1++)
for(let e2 = e1 + 1; e2 < cell.length; e2++) {
let entityA = cell[e1];
let entityB = cell[e2];
window.stats.collisionsChecked++;
let a = entityA.get(Transform);
let b = entityB.get(Transform);
// assure that center of a is always higher (or same height)
if (a.position.y < b.position.y)
[a, b] = [b, a];
let ca = entityA.get(Collider);
let cb = entityB.get(Collider);
// let distanceSqr = a.position.distanceToSquared(b.position);
let minDistToCollide = ca.radius + cb.radius;
// Point-point collisions are not used
if (minDistToCollide == 0)
return;
let ha = ca.height;
let hb = cb.height;
let pa = a.position;
let pb = b.position;
let dx = pa.x - pb.x;
let dy;
let dz = pa.z - pb.z;
// https://eli.thegreenplace.net/2008/08/15/intersection-of-1d-segments
// If heights intersect: (case for capsule colliders but also works on other)
if (((pa.y + ha) >= (pb.y - hb)) && ((pb.y + hb) >= (pa.y - ha))) {
// Check 2d collision of circles on ZX plane
// To do that, just flatten dy space
dy = 0;
}
else {
// Check 3d collision of spheres - just spheres if no collider is a capsule
// Using the fact, that pa.y >= pb.y and heights of capsules do not intersect only lower point of a and heigher point of b must be checked
dy = (pa.y - ha) - (pb.y + hb);
}
// else just use 3d collision
// Check 3d collision of closer spheres
if (dx * dx + dy * dy + dz * dz < minDistToCollide * minDistToCollide) {
// Collision found
ca.collides = b;
cb.collides = a;
window.stats.collisions++;
}
}
}
}
}
export class DestroyOnCollision {
/**
* @param {?function} onDestroy return false to cancel destruction
*/
constructor(onDestroy = null) {
this.onDestroy = onDestroy;
}
}
export class DestroyOnCollisionSystem {
constructor(ecs) {
this.destroyOnCollisionSelector = ecs.select(Collider, DestroyOnCollision);
}
update(dt) {
this.destroyOnCollisionSelector.iterate(entity => {
if (!entity.get(Collider).collides)
return;
let onDestroy = entity.get(DestroyOnCollision).onDestroy;
if (onDestroy) {
if(onDestroy(entity) === false) return;
}
entity.eject();
});
}
} | 34.885135 | 159 | 0.474337 |
a1df9fcecbcc079133f220b761873622c5844a9e | 59 | js | JavaScript | src/nor/norApp/controllers/norCtrl/index.js | sendanor/nor-app | 157ccab1260b5a0827f7763b75be2fca7ee8ad27 | [
"MIT"
] | 1 | 2020-08-28T08:22:05.000Z | 2020-08-28T08:22:05.000Z | src/nor/norApp/controllers/norCtrl/index.js | sendanor/nor-app | 157ccab1260b5a0827f7763b75be2fca7ee8ad27 | [
"MIT"
] | null | null | null | src/nor/norApp/controllers/norCtrl/index.js | sendanor/nor-app | 157ccab1260b5a0827f7763b75be2fca7ee8ad27 | [
"MIT"
] | null | null | null | "use strict";
module.exports = require('./controller.js');
| 19.666667 | 44 | 0.694915 |
a1e119d80c9fa479d284711239aaefae4a1c2b1a | 2,836 | js | JavaScript | tests/ArchiveTools.spec.js | perry-mitchell/buttercup-core-web | 40b6ff7ee4b04a085720dbb013782be8e921f864 | [
"MIT"
] | 8 | 2017-10-03T20:53:28.000Z | 2021-02-06T05:11:35.000Z | tests/ArchiveTools.spec.js | buttercup/buttercup-core-web | 40b6ff7ee4b04a085720dbb013782be8e921f864 | [
"MIT"
] | 5 | 2016-04-09T20:51:33.000Z | 2017-03-07T19:44:02.000Z | tests/ArchiveTools.spec.js | buttercup/buttercup-core-web | 40b6ff7ee4b04a085720dbb013782be8e921f864 | [
"MIT"
] | 1 | 2016-02-21T16:02:07.000Z | 2016-02-21T16:02:07.000Z | describe("ArchiveManager", function() {
"use strict";
var Buttercup = window.Buttercup;
var ButtercupWeb = window.Buttercup.Web,
ArchiveTools = ButtercupWeb.ArchiveTools;
describe("extractDomain", function() {
it("extracts from full URLs", function() {
expect(ArchiveTools.extractDomain(
"http://www.example.com/test-area/index.html"
)).to.equal("www.example.com");
expect(ArchiveTools.extractDomain(
"sub1.example.website.com/test-area/index.php?abc"
)).to.equal("sub1.example.website.com");
expect(ArchiveTools.extractDomain(
"https://abc.cn"
)).to.equal("abc.cn");
});
it("extracts from domains only", function() {
expect(ArchiveTools.extractDomain("www.site.com.au")).to.equal("www.site.com.au");
expect(ArchiveTools.extractDomain("example.org")).to.equal("example.org");
});
});
describe("getEntriesForURL", function() {
var archive;
beforeEach(function() {
archive = new Buttercup.Archive();
var group1 = archive.createGroup("Group 1"),
group2 = archive.createGroup("Group 2");
var entry1 = group1.createEntry("Entry 1"),
entry2 = group2.createEntry("Entry 2"),
entry3 = group1.createEntry("Entry 3"),
entry4 = group2.createEntry("Entry 3");
entry1.setProperty("username", "entry1");
entry1.setMeta("URL", "http://www.example.com/test-area/index.html");
entry2.setProperty("username", "entry2");
entry2.setMeta("URL", "www.example.com/test-area/");
entry3.setProperty("username", "entry3");
entry3.setMeta("URL", "https://login.amazing.com/entry-portal");
entry4.setProperty("username", "entry4");
entry4.setMeta("URL", "invalid");
});
it("fetches similar URLs", function() {
var currentURL = "http://www.example.com/test-area/index.html#testing",
entries = ArchiveTools.getEntriesForURL(archive, currentURL);
expect(entries.length).to.equal(2);
});
it("fetches a single URL", function() {
var currentURL = "https://login.amazing.com/entry-portal",
entries = ArchiveTools.getEntriesForURL(archive, currentURL);
expect(entries.length).to.equal(1);
expect(entries[0].getProperty("username")).to.equal("entry3");
});
it("ignores empty/non-matching URLs", function() {
var currentURL = "invalid",
entries = ArchiveTools.getEntriesForURL(archive, currentURL);
expect(entries.length).to.equal(0);
});
});
});
| 37.813333 | 94 | 0.573343 |
a1e1e2663eb4a77f9e3ca092443a9051e3f436f4 | 491 | js | JavaScript | index.js | steem-sdk/steem-utils | 2aa54015d0be15baa51a0f0cc0207bde7a4e5289 | [
"MIT"
] | null | null | null | index.js | steem-sdk/steem-utils | 2aa54015d0be15baa51a0f0cc0207bde7a4e5289 | [
"MIT"
] | 2 | 2022-02-10T20:31:18.000Z | 2022-02-26T21:21:12.000Z | index.js | steem-sdk/steem-utils | 2aa54015d0be15baa51a0f0cc0207bde7a4e5289 | [
"MIT"
] | null | null | null | 'use strict'
/* sort, format, parse, stats, validate */
var utils = require('./dist/lib/index.js')
var sort = require('./dist/lib/sort.js')
var format = require('./dist/lib/format.js')
var parse = require('./dist/lib/parse.js')
var stats = require('./dist/lib/stats.js')
var validate = require('./dist/lib/validate.js')
// if you wanted to export multiple modules...
module.exports = {
utils: utils,
sort: sort,
utils: utils,
parse: parse,
stats: stats,
validate: validate
}
| 22.318182 | 48 | 0.668024 |
a1e26cd36b9872fff4642b161a457ea551723d61 | 1,698 | js | JavaScript | mmv-dev/js/dxz_brand_titile.js | luwenshu1207/mmb | 476234abb1029e0fb858df753e09a6bf9a603b65 | [
"MIT"
] | null | null | null | mmv-dev/js/dxz_brand_titile.js | luwenshu1207/mmb | 476234abb1029e0fb858df753e09a6bf9a603b65 | [
"MIT"
] | null | null | null | mmv-dev/js/dxz_brand_titile.js | luwenshu1207/mmb | 476234abb1029e0fb858df753e09a6bf9a603b65 | [
"MIT"
] | null | null | null | $(function () {
mui('.mui-scroll-wrapper').scroll({
deceleration: 0.0005 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006
});
// 网络请求
$.ajax({
type: "get",
url: "http://58.218.199.45:14985/api/getbrandtitle",
// data: "data",
dataType: "json",
success: function (response) {
console.log(response);
console.log(response.result[1].brandTitle);
$('#jsbrand-title').html(template('tmpl-brand-title',{
result:response.result
}));
}
});
})
// window.onload = function () {
// $(function () {
// var a, t, n;
// a = {
// api: "http://58.218.199.45:14985/api/getbrandtitle",
// callback: function (a) {
// for (var t = a.result, n = [/电视/, /空调/, /播放器|影院/, /冰箱/, /洗衣机|热水/, /手机/, /相机/], e = $(".panel-body").children("ul"), l = 0; l < t.length; l++) {
// var r = document.createElement("li");
// (r = $("<li></li>")).html(t[l].brandTitle);
// var i = $("<a></a>");
// i.attr({
// href: "brand-content.html?brandtitleid=" + t[l].brandTitleId,
// "data-title-id": a.result.categoryId
// }), r.append(i[0]);
// for (var d = 0; d < n.length; d++) n[d].test(t[l].brandTitle) && e.eq(d).append(r)
// }
// }
// }, t = a.api || "", n = a.callback || function () {}, $.ajax({
// url: t,
// success: function (a) {
// n && n(a)
// }
// })
// })
// }; | 36.12766 | 162 | 0.402827 |
a1e2ff9d23d1d1c31a789cab056534eee75eec2a | 8,714 | js | JavaScript | src/Component/UserAccess/JobDetail.js | tansizheng89/ASDJPReactWebApp | 9116feed118f4e1b854ac3eb2214a3ccc170bf79 | [
"MIT"
] | null | null | null | src/Component/UserAccess/JobDetail.js | tansizheng89/ASDJPReactWebApp | 9116feed118f4e1b854ac3eb2214a3ccc170bf79 | [
"MIT"
] | null | null | null | src/Component/UserAccess/JobDetail.js | tansizheng89/ASDJPReactWebApp | 9116feed118f4e1b854ac3eb2214a3ccc170bf79 | [
"MIT"
] | null | null | null | import React, { Component } from "react";
import DataService from "../../Services/WebUserJobService";
import DataService1 from "../../Services/WebUserReviewService";
import '../../Css/JobDetail.css';
import { Link } from "react-router-dom";
import { ReactComponent as Logo } from '../../images/button_save.svg';
import Card from '@material-ui/core/Card';
import { Container, Divider } from "@material-ui/core";
import { withStyles } from "@material-ui/core/styles";
import Rating from '@material-ui/lab/Rating';
import CardMedia from '@material-ui/core/CardMedia';
import CardContent from '@material-ui/core/CardContent';
import Typography from '@material-ui/core/Typography';
import { Fab } from "@material-ui/core";
import CardActions from '@material-ui/core/CardActions';
import Button from '@material-ui/core/Button';
import BookmarkRoundedIcon from '@material-ui/icons/BookmarkRounded';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
import TableHead from '@material-ui/core/TableHead';
import TableRow from '@material-ui/core/TableRow';
import StarRatingComponent from 'react-star-rating-component';
const useStyles = theme => ({
header: {
marginTop: theme.spacing(10),
display: 'flex',
},
headerTable: {
marginTop: theme.spacing(5),
display: 'flex',
},
icon: {
marginRight: theme.spacing(2),
},
cardGrid: {
paddingTop: theme.spacing(8),
paddingBottom: theme.spacing(8),
},
card: {
height: '100%',
display: 'flex',
flexDirection: 'column',
// boxShadow: '0 3px 5px 2px rgba(117, 119, 119, .3)',
},
cardMedia: {
paddingTop: '20%', // 16:9
},
cardContent: {
flexGrow: 1,
},
paper: {
marginTop: theme.spacing(1),
display: 'flex',
flexDirection: 'column',
},
cardHeader: {
marginBottom: theme.spacing(-3)
},
button: {
marginLeft: theme.spacing(75),
display: 'flex',
},
fab: {
marginTop: theme.spacing(1),
marginLeft: theme.spacing(101),
display: 'flex',
}
});
class JobDetail extends Component {
constructor(props) {
super(props);
this.addBookmark = this.addBookmark.bind(this);
this.addViewJobEmail = this.addViewJobEmail.bind(this);
this.addViewJobURL = this.addViewJobURL.bind(this);
this.reviewListJCCatergory = this.reviewListJCCatergory.bind(this);
this.state = {
job: [],
reviews: [],
user: false,
};
}
componentDidMount() {
DataService.getJobDetail(this.props.match.params.id).then((res) => {
this.setState({ job: res.data });
}).catch(e => {
console.log(e);
});
DataService1.getReviewByJobandCompany(this.props.match.params.id2, this.props.match.params.id3).then((res) => {
this.setState({ reviews: res.data });
}).catch(e => {
console.log(e);
});
let status = localStorage.getItem("user")
this.setState( status===null ? {user:false}:{user:true});
}
addBookmark(id) {
DataService.saveBookmarkJob(id).then(response => {
console.log(response.data);
this.props.history.push('AllBookmarkJobList')
//window.location.reload();
}).catch(e => { console.log(e); });
}
addViewJobEmail(id) {
DataService.applyJobEmail(id)
.then(response => {
console.log(response.data);
this.props.history.push('AllViewedJobsList')
//window.location.reload();
})
.catch(e => {
console.log(e);
});
}
addViewJobURL(id) {
DataService.applyJobURL(id)
.then(response => {
console.log(response.data);
this.props.history.push('AllViewedJobsList')
//window.location.reload();
})
.catch(e => {
console.log(e);
});
}
reviewListJCCatergory(jobtitle, companyname) {
DataService1.getReviewByJobandCompany(jobtitle, companyname)
.then(response => {
console.log(response.data);
this.props.history.push('ApprovedReviewList')
//window.location.reload();
})
.catch(e => {
console.log(e);
});
}
render() {
const { job } = this.state;
const { reviews } = this.state;
const { classes } = this.props;
return (
<div>
<div className={classes.header}>
<Container maxWidth="md">
<Card>
<CardMedia
className={classes.cardMedia}
image="https://cdn.stocksnap.io/img-thumbs/960w/work-papers_FL8F0JKTMA.jpg"
title="Image title"
/>
{this.state.user?
<Fab
className={classes.fab}
aria-label="bookmark"
color="primary"
onClick={(e) => this.addBookmark(job.jobid)}>
<BookmarkRoundedIcon />
</Fab>
:""}
<CardContent className={classes.cardContent}>
<Typography gutterBottom variant="h5" component="h2">
{job.companyname} <StarRatingComponent
name="rate1"
editing={false}
renderStarIcon={() => <span>★</span>}
starCount={5}
value={job.companystarRating}
/>
</Typography>
<Typography gutterBottom variant="h5" component="h2">
{job.jobTitle}
<StarRatingComponent
name="rate1"
editing={false}
renderStarIcon={() => <span>★</span>}
starCount={5}
value={job.jobStarRating}
/>
</Typography>
<Divider />
<br />
<Typography gutterBottom variant="h6" component="h5">
Job Description: {job.jobDescription}
</Typography>
<Typography gutterBottom variant="h6" component="h5">
Job Qualification: {job.jobqualification}
</Typography>
<Typography gutterBottom variant="h6" component="h5">
Job Industry: {job.jobIndustry}
</Typography>
<Typography gutterBottom variant="h6" component="h5">
Autism Level: {job.autismLevel}
</Typography>
</CardContent>
{this.state.user?
<CardActions className={classes.button}>
<Button size="large" color="primary" onClick={(e) => this.addViewJobEmail(job.jobid)}>
Apply By Email
</Button>
<Button size="large" color="primary" onClick={(e) => this.addViewJobURL(job.jobid)}>
<Link to={{ pathname: job.jobPositionURL }} target="_blank"> Apply By URL</Link>
</Button>
</CardActions>
:""}
</Card>
</Container>
</div>
<div className={classes.headerTable}>
<Container maxWidth="md">
<Table stickyHeader className={classes.table} aria-label="simple table">
<TableHead>
<TableRow>
<TableCell variant="head"><Typography variant="h6" color="primary">Review Stars</Typography></TableCell>
<TableCell align="right" variant="head"><Typography variant="h6" color="primary">Review Description </Typography></TableCell>
<TableCell align="right" variant="head"><Typography variant="h6" color="primary">Review Date </Typography></TableCell>
</TableRow>
</TableHead>
<TableBody>
{this.state.reviews.map((review) => (
<TableRow key={review.id}>
<TableCell component="th" scope="row">
<Rating name="rate1" value={review.reviewstars} precision={0.1} readOnly />
</TableCell>
<TableCell align="right"><Typography variant="subtitle1">{review.reviewDescription}</Typography></TableCell>
<TableCell align="right"><Typography variant="subtitle1">{review.reviewDate}</Typography></TableCell>
</TableRow>
))}
</TableBody>
</Table>
</Container>
</div>
</div>
);
}
}
export default withStyles(useStyles, { withTheme: true })(JobDetail);
| 32.036765 | 148 | 0.56415 |
a1e58c8d6e44744f2e1172447dc511cf8f7fb155 | 1,534 | js | JavaScript | app/assets/javascripts/posts.js | ozgecokyasar/YumNoms | a4000e992c1b5d5cf280e0ea90b40e5ff5c96684 | [
"MIT"
] | null | null | null | app/assets/javascripts/posts.js | ozgecokyasar/YumNoms | a4000e992c1b5d5cf280e0ea90b40e5ff5c96684 | [
"MIT"
] | null | null | null | app/assets/javascripts/posts.js | ozgecokyasar/YumNoms | a4000e992c1b5d5cf280e0ea90b40e5ff5c96684 | [
"MIT"
] | null | null | null | $(function () {
$('#post_tag_list').selectize({
delimeter: ",",
persist: false,
create: function (input) {
return {
value: input,
text: input
}
}
});
})
(function($, window, document, undefined) {
"use strict";
var el= $('.readmore'),
clone= el.clone(),
originalHtml= clone.html(),
originalHeight= el.outerHeight(),
Trunc = {
moreLink: '<a href="#" class="readmore-toggle" data-read="more">Read More<span class="icon-arrow-bottom"</span></a>',
lessLink: '<a href="#" class="readmore-toggle" data-read="less">Moins <span class="icon-arrow-top"></span></a>',
addTrigger : function(){
$('.article-readmore').append(this.moreLink);
},
truncateText : function( textBlock ) {
while (textBlock.text().length > 20 ) {
textBlock.text(function(index, text) {
return text.replace(/\W*\s(\S)*$/, '...');
});
}
},
replaceText: function ( textBlock, original ){
return textBlock.html(original).height(originalHeight);
}
};
Trunc.addTrigger();
Trunc.truncateText(el);
$(document).on('click', '[data-read]', function(e){
e.preventDefault();
if ($(this).data('read') == 'more'){
Trunc.replaceText(el, originalHtml);
$(this).replaceWith(Trunc.lessLink);
} else if ($(this).data('read') == 'less') {
Trunc.truncateText(el);
$(this).replaceWith(Trunc.moreLink);
el.css('height', '100%');
}
});
})(jQuery, window, document, undefined);
| 26.912281 | 121 | 0.571708 |
a1e81f5c8b5a0d3c8295e4f90d71b9b081832335 | 1,442 | js | JavaScript | web/src/main/webapp/WEB-INF/js/ly-main.js | phylame/gradpro | 02f2d81e7369a034e7264287d5a0b7236fb9f986 | [
"Apache-2.0"
] | null | null | null | web/src/main/webapp/WEB-INF/js/ly-main.js | phylame/gradpro | 02f2d81e7369a034e7264287d5a0b7236fb9f986 | [
"Apache-2.0"
] | null | null | null | web/src/main/webapp/WEB-INF/js/ly-main.js | phylame/gradpro | 02f2d81e7369a034e7264287d5a0b7236fb9f986 | [
"Apache-2.0"
] | null | null | null | /*
* This file is part of Linyin, Peng Wan's graduation project in Haut.
* Copyright (C) 2016 Peng Wan <phylame@163.com>. All Rights Reserved.
*/
function notEmpty(s) {
return s != null && s.length > 0;
}
function lessThan(n) {
return function (s) {
return s != null && s.length < n;
}
}
function moreThan(n) {
return function (s) {
return s != null && s.length > n;
}
}
function inRange(min, max) {
return function (s) {
return s != null && s.length > min && s.length < max;
}
}
function validateField(field, validator, error, fallback) {
return validator(field.value) || (fallback && fallback(field, error)) || false;
}
String.prototype.format = function (args) {
if (arguments.length > 0) {
var result = this;
if (arguments.length == 1 && typeof (args) == "object") {
for (var key in args) {
var reg = new RegExp("({" + key + "})", "g");
result = result.replace(reg, args[key]);
}
} else {
for (var i = 0; i < arguments.length; i++) {
if (arguments[i] == undefined) {
return "";
} else {
var reg = new RegExp("({[" + i + "]})", "g");
result = result.replace(reg, arguments[i]);
}
}
}
return result;
} else {
return this;
}
};
| 26.218182 | 83 | 0.491678 |
a1ea5d2323e2c435774b369c5612220c46a9e910 | 499 | js | JavaScript | app/containers/App/index.js | zsajjad/MyStylingApp | 1ae5ae49c19ff077de7c7547231737efb2f44787 | [
"MIT"
] | 1 | 2019-03-28T06:43:10.000Z | 2019-03-28T06:43:10.000Z | app/containers/App/index.js | zsajjad/MyStylingApp | 1ae5ae49c19ff077de7c7547231737efb2f44787 | [
"MIT"
] | null | null | null | app/containers/App/index.js | zsajjad/MyStylingApp | 1ae5ae49c19ff077de7c7547231737efb2f44787 | [
"MIT"
] | 2 | 2020-06-16T14:35:47.000Z | 2021-11-24T16:37:33.000Z | /**
*
* App Container
*
*/
import React from 'react';
// import PropTypes from 'prop-types';
import { StatusBar } from 'react-native';
// import { translationMessages } from 'i18n';
import Router from 'router';
// import NoNetworkThumb from 'components/NoNetworkThumb';
export default class App extends React.PureComponent {
componentDidMount() {
StatusBar.setBarStyle('light-content', true);
}
render() {
return <Router />;
}
}
App.propTypes = {};
App.defaultProps = {};
| 17.206897 | 58 | 0.675351 |
a1eb048945cb2a4feb6498668a8f223e20703464 | 336 | js | JavaScript | script/nag.js | ffcafe-overlays/ffxiv-cmskin | d90cd3c1b789dbffd2d3f5c5b7a47e89a5da0820 | [
"MIT"
] | 75 | 2017-10-23T02:32:24.000Z | 2021-08-04T03:19:23.000Z | script/nag.js | ffcafe-overlays/ffxiv-cmskin | d90cd3c1b789dbffd2d3f5c5b7a47e89a5da0820 | [
"MIT"
] | 17 | 2017-10-23T16:25:59.000Z | 2022-03-08T23:39:00.000Z | script/nag.js | ffcafe-overlays/ffxiv-cmskin | d90cd3c1b789dbffd2d3f5c5b7a47e89a5da0820 | [
"MIT"
] | 32 | 2017-11-03T10:00:19.000Z | 2021-02-05T01:42:50.000Z | import _ from 'lodash';
export default () => {
const Input = process.argv.splice(2);
const newChangelog = _.compact(Input[2].split('|'));
let ngaChangelog = '[tr]';
newChangelog.forEach(item => ngaChangelog += `[td]${item}[/td]`);
ngaChangelog += '[/tr]';
console.log('');
console.log(ngaChangelog);
console.log('');
} | 28 | 66 | 0.625 |
a1eb631f7624a9824a6d4aa01892997c42ca250c | 3,116 | js | JavaScript | contracts/bootstrap/Bootstrap.js | freedomexio/rocketx-ssc | c869d67a4e609e7aa9e6d6cedef7f650b98ee998 | [
"MIT"
] | null | null | null | contracts/bootstrap/Bootstrap.js | freedomexio/rocketx-ssc | c869d67a4e609e7aa9e6d6cedef7f650b98ee998 | [
"MIT"
] | null | null | null | contracts/bootstrap/Bootstrap.js | freedomexio/rocketx-ssc | c869d67a4e609e7aa9e6d6cedef7f650b98ee998 | [
"MIT"
] | 1 | 2019-08-06T08:44:39.000Z | 2019-08-06T08:44:39.000Z | const { Base64 } = require('js-base64');
const fs = require('fs-extra');
const { Transaction } = require('../../libs/Transaction');
const BP_CONSTANTS = require('../../libs/BlockProduction.contants').CONSTANTS;
class Bootstrap {
static async getBootstrapTransactions(genesisSteemBlock) {
const transactions = [];
let contractCode;
let base64ContractCode;
let contractPayload;
const FORK_BLOCK_NUMBER = 33255083;
const SSC_STORE_PRICE = '0.001';
const SSC_STORE_QTY = '0.001';
// tokens contract
contractCode = await fs.readFileSync('./contracts/bootstrap/tokens.js');
contractCode = contractCode.toString();
contractCode = contractCode.replace(/'\$\{BP_CONSTANTS.UTILITY_TOKEN_PRECISION\}\$'/g, BP_CONSTANTS.UTILITY_TOKEN_PRECISION);
contractCode = contractCode.replace(/'\$\{BP_CONSTANTS.UTILITY_TOKEN_SYMBOL\}\$'/g, BP_CONSTANTS.UTILITY_TOKEN_SYMBOL);
contractCode = contractCode.replace(/'\$\{FORK_BLOCK_NUMBER\}\$'/g, FORK_BLOCK_NUMBER);
base64ContractCode = Base64.encode(contractCode);
contractPayload = {
name: 'tokens',
params: '',
code: base64ContractCode,
};
transactions.push(new Transaction(genesisSteemBlock, 0, 'rocketx', 'contract', 'deploy', JSON.stringify(contractPayload)));
// sscstore contract
contractCode = await fs.readFileSync('./contracts/bootstrap/sscstore.js');
contractCode = contractCode.toString();
contractCode = contractCode.replace(/'\$\{BP_CONSTANTS.UTILITY_TOKEN_PRECISION\}\$'/g, BP_CONSTANTS.UTILITY_TOKEN_PRECISION);
contractCode = contractCode.replace(/'\$\{BP_CONSTANTS.UTILITY_TOKEN_SYMBOL\}\$'/g, BP_CONSTANTS.UTILITY_TOKEN_SYMBOL);
contractCode = contractCode.replace(/'\$\{FORK_BLOCK_NUMBER\}\$'/g, FORK_BLOCK_NUMBER);
contractCode = contractCode.replace(/'\$\{SSC_STORE_PRICE\}\$'/g, SSC_STORE_PRICE);
contractCode = contractCode.replace(/'\$\{SSC_STORE_QTY\}\$'/g, SSC_STORE_QTY);
base64ContractCode = Base64.encode(contractCode);
contractPayload = {
name: 'sscstore',
params: '',
code: base64ContractCode,
};
transactions.push(new Transaction(genesisSteemBlock, 0, 'rocketx', 'contract', 'deploy', JSON.stringify(contractPayload)));
// bootstrap transactions
transactions.push(new Transaction(genesisSteemBlock, 0, 'null', 'tokens', 'create', `{ "name": "RocketX", "symbol": "ROX", "precision": 8, "maxSupply": ${Number.MAX_SAFE_INTEGER} }`));
transactions.push(new Transaction(genesisSteemBlock, 0, 'null', 'tokens', 'updateMetadata', '{"symbol":"ROX", "metadata": { "url":"https://freedomex.io", "icon": "https://steemitimages.com/p/2r8F9rTBenJQfQgENfxADE6EVYabczqmSF5KeWefV5WL9WEVrMmPXB4iSZohFEWpEyn59TtaBZ7DfzERwCqS77VC4s38kVvb2PsBg57eAb7PriX4wMGh6KFVw1c9rvVV8", "desc": "ROX is the native token for the RocketX platform" }}'));
transactions.push(new Transaction(genesisSteemBlock, 0, 'null', 'tokens', 'issue', '{ "symbol": "ROX", "to": "rocketx", "quantity": 1000000000, "isSignedWithActiveKey": true }'));
return transactions;
}
}
module.exports.Bootstrap = Bootstrap;
| 46.507463 | 392 | 0.715019 |
a1eb63638ee1cdc0a010c42d5e1a99cb5a168940 | 2,343 | js | JavaScript | tests/resources/genera/genera.post.test.js | farshiana/balcony-planner-api | 114944fb9c6eaa4fcd3171140e495d9dcb5006d7 | [
"MIT"
] | null | null | null | tests/resources/genera/genera.post.test.js | farshiana/balcony-planner-api | 114944fb9c6eaa4fcd3171140e495d9dcb5006d7 | [
"MIT"
] | 13 | 2020-12-13T06:43:17.000Z | 2022-03-28T05:54:56.000Z | tests/resources/genera/genera.post.test.js | farshiana/balcony-planner-api | 114944fb9c6eaa4fcd3171140e495d9dcb5006d7 | [
"MIT"
] | null | null | null | import request from 'supertest';
import faker from 'faker';
import app from '@/server';
import db from '@/models/models';
import { ROLE_ADMIN, CATEGORIES } from '@/constants';
import auth from '../../factories/auth.factory';
import createGenus from '../../factories/genus.factory';
const { Genus } = db;
const route = '/genera';
describe('Genera POST', () => {
let cookie;
let params;
beforeEach(async (done) => {
({ cookie } = await auth({ role: ROLE_ADMIN }));
params = {
name: faker.random.word().toLowerCase(),
category: CATEGORIES[1],
};
done();
});
describe('creates genus', () => {
it('with params', async () => {
const res = await request(app).post(route).set('Cookie', cookie).send(params);
const genus = await Genus.findByPk(res.body.id);
expect(res.body).toMatchObject(params);
expect(res.body).toEqual(JSON.parse(JSON.stringify(genus)));
expect(res.statusCode).toEqual(201);
});
});
describe('does not create genus', () => {
it('with unauthenticated user', async () => {
const res = await request(app).post(route).send(params);
expect(res.body.message).toEqual('Authentication is required');
expect(res.statusCode).toEqual(401);
});
it('with non admin user', async () => {
({ cookie } = await auth());
const res = await request(app).post(route).set('Cookie', cookie).send(params);
expect(res.body.message).toEqual('Admin role is required');
expect(res.statusCode).toEqual(403);
});
it('with existing name', async () => {
await createGenus(params);
const res = await request(app).post(route)
.set('Cookie', cookie).send(params);
expect(res.body.message).toEqual('Genus already exists');
expect(res.statusCode).toEqual(400);
});
it('with invalid category', async () => {
const res = await request(app).post(route)
.set('Cookie', cookie).send({ ...params, category: 'invalid' });
expect(res.body.message).toMatch('"category" must be one of [');
expect(res.statusCode).toEqual(400);
});
});
});
| 33.956522 | 90 | 0.559539 |
a1ebc3f4448c83f44249ece2cc6a3c714102b741 | 1,601 | js | JavaScript | server/public/javascripts/relems/marquee.js | fullrange-interactive/pmw | c9e23f6870b266eab8382f7825e5a159ff116c93 | [
"MIT"
] | null | null | null | server/public/javascripts/relems/marquee.js | fullrange-interactive/pmw | c9e23f6870b266eab8382f7825e5a159ff116c93 | [
"MIT"
] | null | null | null | server/public/javascripts/relems/marquee.js | fullrange-interactive/pmw | c9e23f6870b266eab8382f7825e5a159ff116c93 | [
"MIT"
] | null | null | null | var Marquee = rElem.extend({
destroyed: false,
load: function(callback) {
this.createDom();
this.type="Marquee";
this.textField = $('<p class="marqu">' + this.data.text + '</p>');
$(this.viewPort).append(this.textField);
$(this.textField).css({
position:'absolute',
top:'0',
left:$(this.viewPort).position().left - this.xPx + 'px',
height:'100%',
lineHeight:$(this.viewPort).height() + 'px',
textAlign:'center',
color:'#'+this.data.color,
fontSize:$(this.viewPort).height() + 'px',
fontFamily:this.data.font,
overvlow: 'visible',
whiteSpace: 'nowrap',
textShadow: this.data.shadowDistance + 'px ' + this.data.shadowDistance + 'px 0px #' + this.data.shadowColor
});
if ( this.data.light != true )
$(this.textField).pmwMarquee({speed: this.data.speed});
if ( this.data.flipped ){
if ( this.data.flipped == "false" )
this.data.flipped = false;
if ( this.data.flipped == "true" )
this.data.flipped = true;
}
if(this.data.flipped && this.data.flipped != "false")
this.textField.addClass("flipped");
callback();
},
waitUntilReady: function(callback) {
callback();
},
cleanup: function() {
// console.log("CLEAN");
if (!this.destroyed) {
$(this.textField).stopPmwMarquee();
this.destroyed = true;
}
}
});
| 34.06383 | 120 | 0.509681 |
a1ebfe3be9bcaf4f7b0cc17f7b3d6ddcf432b424 | 13,317 | js | JavaScript | common/entity/PlayerCharacter.js | homemadearcade/game | 752a956fc0e76801fe94dbe75e9700bf73c6f786 | [
"MIT"
] | null | null | null | common/entity/PlayerCharacter.js | homemadearcade/game | 752a956fc0e76801fe94dbe75e9700bf73c6f786 | [
"MIT"
] | null | null | null | common/entity/PlayerCharacter.js | homemadearcade/game | 752a956fc0e76801fe94dbe75e9700bf73c6f786 | [
"MIT"
] | null | null | null | import n from 'nengi'
let nengi = n
if(nengi.default) nengi = nengi.default
import WeaponSystem from '../WeaponSystem.js'
import SAT from 'sat'
import CollisionSystem from '../CollisionSystem.js'
class PlayerCharacter {
constructor({heroId}) {
this.heroId = heroId
this.x = 0
this.y = 0
this.rotation = 0
this.hitpoints = 100
this.isAlive = true
this.moveDirection = {
x: 0,
y: 0
}
this.speed = 400
this.weaponSystem = new WeaponSystem()
this.collider = new SAT.Circle(new SAT.Vector(this.x, this.y), 25)
}
fire() {
if (!this.isAlive) {
return false
}
return this.weaponSystem.fire()
}
processMove(command, obstacles) {
let unitX = 0
let unitY = 0
const upPressed = command.up
const downPressed = command.down
const leftPressed = command.left
const rightPressed = command.right
const keysDown = {}
const hero = GAME.heros[this.heroId]
if(!hero) return
if(hero.flags.paused) return
if((!GAME.gameState.started || hero.flags.isAdmin) && (keysDown['shift'] || keysDown['caps lock'])) {
if (upPressed) {
if(hero.tags.adminInch) hero.y -= 1
else hero.y -= GAME.grid.nodeSize
}
if (downPressed) {
if(hero.tags.adminInch) hero.y += 1
else hero.y += GAME.grid.nodeSize
}
if (leftPressed) {
if(hero.tags.adminInch) hero.x -= 1
else hero.x -= GAME.grid.nodeSize
}
if (rightPressed) {
if(hero.tags.adminInch) hero.x += 1
else hero.x += GAME.grid.nodeSize
}
hero._skipPosUpdate = true
hero._skipCorrections = true
return
}
/*
left arrow 'left'
up arrow 'up'
right arrow 'right'
down arrow 'down'
w 87
a 65
s 83
d 68
*/
/// DEFAULT GAME FX
if(hero.flags.paused || GAME.gameState.paused) return
const xSpeed = hero.mod().velocityInitial + (hero.mod().velocityInitialXExtra || 0)
const ySpeed = hero.mod().velocityInitial + (hero.mod().velocityInitialYExtra || 0)
if (upPressed && !hero.mod().tags.disableUpKeyMovement) {
if(hero.mod().arrowKeysBehavior === 'acc' || hero.mod().arrowKeysBehavior === 'acceleration') {
hero.accY -= (ySpeed) * delta;
} else if (hero.mod().arrowKeysBehavior === 'velocity') {
hero.velocityY -= (ySpeed) * delta;
}
}
if (downPressed && !hero.mod().tags.disableDownKeyMovement) {
if(hero.mod().arrowKeysBehavior === 'acc' || hero.mod().arrowKeysBehavior === 'acceleration') {
hero.accY += (ySpeed) * delta;
} else if (hero.mod().arrowKeysBehavior === 'velocity') {
hero.velocityY += (ySpeed) * delta;
}
}
if (leftPressed) {
if(hero.mod().arrowKeysBehavior === 'acc' || hero.mod().arrowKeysBehavior === 'acceleration') {
hero.accX -= (xSpeed) * delta;
} else if (hero.mod().arrowKeysBehavior === 'velocity') {
hero.velocityX -= (xSpeed) * delta;
}
}
if (rightPressed) {
if(hero.mod().arrowKeysBehavior === 'acc' || hero.mod().arrowKeysBehavior === 'acceleration') {
hero.accX += (xSpeed) * delta;
} else if (hero.mod().arrowKeysBehavior === 'velocity') {
hero.velocityX += (xSpeed) * delta;
}
}
if(hero.mod().arrowKeysBehavior === 'angleAndVelocity') {
if(typeof hero.angle !== 'number') hero.angle = 0
if(typeof hero.velocityAngle !== 'number') hero.velocityAngle = 0
if (upPressed && !hero.mod().tags.disableUpKeyMovement) {
hero.velocityAngle += (hero.mod().rotationSpeed || 100) * delta;
}
if (downPressed && !hero.mod().tags.disableDownKeyMovement) {
hero.velocityAngle -= (hero.mod().rotationSpeed || 100) * delta;
}
if (leftPressed) {
hero.angle -= 1 * delta;
}
if (rightPressed) {
hero.angle += 1 * delta
}
}
if(hero.mod().arrowKeysBehavior === 'skating') {
if(hero.inputDirection === 'up' && !hero.mod().tags.disableUpKeyMovement) {
hero.y -= Math.ceil(ySpeed * delta);
} else if(hero.inputDirection === 'down' && !hero.mod().tags.disableDownKeyMovement) {
hero.y += Math.ceil(ySpeed * delta);
} else if(hero.inputDirection === 'left') {
hero.x -= Math.ceil(xSpeed * delta);
} else if(hero.inputDirection === 'right') {
hero.x += Math.ceil(xSpeed * delta);
}
}
if(hero.mod().arrowKeysBehavior === 'angle') {
if(typeof hero.angle !== 'number') hero.angle = 0
if(typeof hero.velocityAngle !== 'number') hero.velocityAngle = 0
if (upPressed) {
hero.angle = angleTowardsDegree(hero.angle, global.degreesToRadians(0), delta)
}
if (downPressed) {
// console.log(hero.angle, global.degreesToRadians(180))
hero.angle = angleTowardsDegree(hero.angle, global.degreesToRadians(180), delta)
}
if (leftPressed) {
hero.angle = angleTowardsDegree(hero.angle, global.degreesToRadians(270), delta)
}
if (rightPressed) {
hero.angle = angleTowardsDegree(hero.angle, global.degreesToRadians(90), delta)
}
const angleCorrection = global.degreesToRadians(90)
hero.velocityX = hero.velocityAngle * Math.cos(hero.angle - angleCorrection)
hero.velocityY = hero.velocityAngle * Math.sin(hero.angle - angleCorrection)
}
function positionInput() {
if(hero.mod().arrowKeysBehavior === 'flatDiagonal') {
if (upPressed && !hero.mod().tags.disableUpKeyMovement) {
hero._flatVelocityY = -ySpeed
} else if (downPressed && !hero.mod().tags.disableDownKeyMovement) {
hero._flatVelocityY = ySpeed
} else {
hero._flatVelocityY = 0
}
if (leftPressed) {
hero._flatVelocityX = -xSpeed
} else if (rightPressed) {
hero._flatVelocityX = xSpeed
} else {
hero._flatVelocityX = 0
}
}
if(hero.mod().arrowKeysBehavior === 'advancedPlatformer') {
let lowestXVelocityAllowed = xSpeed
let lowestYVelocityAllowed = ySpeed
let normalDelta = (hero.mod().velocityDelta || global.advancedPlatformerDefaults.velocityDelta) * delta
let goalVelocity = hero.mod().velocityInputGoal || global.advancedPlatformerDefaults.velocityInputGoal
if (upPressed && hero.inputDirection == 'up' && !hero.mod().tags.disableUpKeyMovement) {
if(hero.velocityY > -lowestYVelocityAllowed) {
if(hero.velocityY < lowestYVelocityAllowed && hero.velocityY > 0) {
// moving in other direction
hero.velocityY -= normalDelta
return
} else if(hero.velocityY > lowestYVelocityAllowed) {
// moving VERY FAST in other direction
hero.velocityY -= normalDelta * 2
return
} else {
hero.velocityY = -lowestYVelocityAllowed
}
}
hero.velocityY -= normalDelta
if(hero.velocityY < -goalVelocity) hero.velocityY = -goalVelocity
return
}
if (downPressed && hero.inputDirection == 'down' && !hero.mod().tags.disableDownKeyMovement) {
if(hero.velocityY < lowestYVelocityAllowed) {
if(hero.velocityY > -lowestYVelocityAllowed && hero.velocityY < 0) {
// moving in other direction
hero.velocityY += normalDelta
return
} else if(hero.velocityY < -lowestYVelocityAllowed) {
// moving VERY FAST in other direction
hero.velocityY += normalDelta * 2
return
} else {
hero.velocityY = lowestYVelocityAllowed
}
}
hero.velocityY += normalDelta
if(hero.velocityY > goalVelocity) hero.velocityY = goalVelocity
return
}
if (leftPressed && hero.inputDirection == 'left') {
if(hero.velocityX > -lowestXVelocityAllowed) {
if(hero.velocityX < lowestXVelocityAllowed && hero.velocityX > 0) {
// moving in other direction
hero.velocityX -= normalDelta
hero._turningLeft = true
return
} else if(hero.velocityX > lowestXVelocityAllowed) {
// moving VERY FAST in other direction
hero.velocityX -= normalDelta * 2
return
} else if(!hero._turningLeft){
hero.velocityX = -lowestXVelocityAllowed
}
} else {
hero._turningLeft = false
}
hero.velocityX -= normalDelta
if(hero.velocityX < -goalVelocity) hero.velocityX = -goalVelocity
return
}
if (rightPressed && hero.inputDirection == 'right') {
if(hero.velocityX < lowestXVelocityAllowed) {
if(hero.velocityX > -lowestXVelocityAllowed && hero.velocityX < 0) {
// moving in other direction
hero.velocityX += normalDelta
hero._turningRight = true
return
} else if(hero.velocityX < -lowestXVelocityAllowed) {
// moving VERY FAST in other direction
hero.velocityX += normalDelta * 2
return
} else if(!hero._turningRight){
hero.velocityX = lowestXVelocityAllowed
}
} else {
hero._turningRight = false
}
hero.velocityX += normalDelta
if(hero.velocityX > goalVelocity) hero.velocityX = goalVelocity
return
}
hero._turningLeft = false
hero._turningRight = false
}
if(hero.mod().arrowKeysBehavior === 'flatRecent') {
hero._flatVelocityX = 0
if(!hero.mod().tags.disableUpKeyMovement) {
hero._flatVelocityY = 0
}
if (upPressed && hero.inputDirection == 'up' && !hero.mod().tags.disableUpKeyMovement) {
hero._flatVelocityY = -Math.ceil(ySpeed * delta) * 100
return
}
if (downPressed && hero.inputDirection == 'down' && !hero.mod().tags.disableDownKeyMovement) {
hero._flatVelocityY = Math.ceil(ySpeed * delta) * 100
return
}
if (leftPressed && hero.inputDirection == 'left') {
hero._flatVelocityX = -Math.ceil(xSpeed * delta) * 100
return
}
if (rightPressed && hero.inputDirection == 'right') {
hero._flatVelocityX = Math.ceil(xSpeed * delta) * 100
return
}
if (upPressed && !hero.mod().tags.disableUpKeyMovement) {
hero._flatVelocityY = -Math.ceil(ySpeed * delta) * 100
}
if (downPressed && !hero.mod().tags.disableDownKeyMovement) {
hero._flatVelocityY = Math.ceil(ySpeed * delta) * 100
}
if (leftPressed) {
hero._flatVelocityX = -Math.ceil(xSpeed * delta) * 100
}
if (rightPressed) {
hero._flatVelocityX = Math.ceil(xSpeed * delta) * 100
}
}
}
positionInput()
this.x = hero.x
this.y = hero.y
// // create forces from input
// if (command.forward) { unitY -= 1 }
// if (command.backward) { unitY += 1 }
// if (command.left) { unitX -= 1 }
// if (command.right) { unitX += 1 }
//
// // normalize
// const len = Math.sqrt(unitX * unitX + unitY * unitY)
// if (len > 0) {
// unitX = unitX / len
// unitY = unitY / len
// }
//
// this.moveDirection.x = unitX
// this.moveDirection.y = unitY
//
// this.x += this.moveDirection.x * this.speed * command.delta
// this.y += this.moveDirection.y * this.speed * command.delta
}
}
PlayerCharacter.protocol = {
x: { type: nengi.Float32, interp: true },
y: { type: nengi.Float32, interp: true },
rotation: { type: nengi.RotationFloat32, interp: true },
isAlive: nengi.Boolean,
hitpoints: nengi.UInt8,
heroId: nengi.String,
}
export default PlayerCharacter
| 35.512 | 115 | 0.525869 |
a1ecc0ff3560dd93578785214fdb61800cea59e2 | 1,378 | js | JavaScript | app/analytics.js | dankuck/bookstore | 08fbb831547481707c750c0bf5801e174b284fb7 | [
"MIT"
] | 2 | 2019-10-25T03:45:54.000Z | 2020-06-17T21:09:21.000Z | app/analytics.js | dankuck/bookstore | 08fbb831547481707c750c0bf5801e174b284fb7 | [
"MIT"
] | 5 | 2020-11-06T18:34:59.000Z | 2021-04-28T14:58:13.000Z | app/analytics.js | dankuck/bookstore | 08fbb831547481707c750c0bf5801e174b284fb7 | [
"MIT"
] | null | null | null | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
export default function analytics(app) {
if (app.config.googleAnalytics && app.config.googleAnalytics.id) {
ga('create', app.config.googleAnalytics.id, 'auto');
}
const send = function (...args) {
if (app.config.googleAnalytics && app.config.googleAnalytics.on) {
ga('send', ...args);
}
if (app.config.googleAnalytics && app.config.googleAnalytics.log) {
console.log('[GA]', ...args);
}
};
app.$watch('world.location', () => {
send('pageview', app.world.location);
}, {immediate: true});
app.$watch(
() => { return [...app.world.inventory] },
(after, before) => {
const added = after.filter(item => ! before.includes(item));
const removed = before.filter(item => ! after.includes(item));
added.forEach(item => send('event', item.name, 'take'));
removed.forEach(item => send('event', item.name, 'drop'));
}
);
app.onEvent((item, action) => send('event', item, action));
};
| 36.263158 | 82 | 0.5791 |
a1ed0847d63ea028c844a8e383ba053114ed9586 | 269 | js | JavaScript | node/node_modules/node-env-file/test/helper.js | oswaldo89/RealTimeUserMonitor | a7e2a897647f0fe3670c53b922193ecfdc548f73 | [
"MIT"
] | 112 | 2015-01-08T19:13:50.000Z | 2021-05-16T08:32:08.000Z | node/node_modules/node-env-file/test/helper.js | oswaldo89/RealTimeUserMonitor | a7e2a897647f0fe3670c53b922193ecfdc548f73 | [
"MIT"
] | 14 | 2019-07-08T08:55:17.000Z | 2019-07-08T08:55:41.000Z | node_modules/node-env-file/test/helper.js | mikelovskij/sauron2 | b8cb73684809de000ff360f7733518a315137538 | [
"MIT"
] | 16 | 2015-02-04T23:18:56.000Z | 2021-11-29T21:20:14.000Z | 'use strict'
process.env.NODE_ENV = 'test'
module.exports.chai = require('chai')
module.exports.chai.config.includeStack = true
module.exports.assert = module.exports.chai.assert
module.exports.expect = module.exports.chai.expect
module.exports.debug = console.log
| 22.416667 | 50 | 0.780669 |
a1ef05bc4d1157f2708a7510e98e2713b86ad68d | 430 | js | JavaScript | src/util/randArr.js | Matthewmob/mobsin-game-engine | b443691e04ee02d9803c47bb70163e6a37af3930 | [
"MIT"
] | 1 | 2020-05-20T04:25:54.000Z | 2020-05-20T04:25:54.000Z | src/util/randArr.js | Matthewmob/mobsin-game-engine | b443691e04ee02d9803c47bb70163e6a37af3930 | [
"MIT"
] | 9 | 2020-05-18T03:10:15.000Z | 2020-07-11T06:21:55.000Z | src/util/randArr.js | Matthewmob/mobsin-game-engine | b443691e04ee02d9803c47bb70163e6a37af3930 | [
"MIT"
] | null | null | null | /**
* Get the value from a random index of the given array.
*
* @memberof Whirl.util
*
* @param {any[]} arr Array to retrieve the value from.
* @returns {any}
*
* @example
* Whirl.util.randArr([1, 5, "2", {x: 5}]); // "2"
* Whirl.util.randArr([1, 5, 2]); // 2
* Whirl.util.randArr([3, 8, 9, 9, 1, 6]); // 9
*/
const randArr = (arr) => {
return arr[Math.floor(Math.random() * arr.length)];
};
export default randArr;
| 22.631579 | 56 | 0.583721 |
a1ef994ba32e5b3598bd78f98ae0414e9ba7f71e | 487 | js | JavaScript | src/pages/background/reducers/linkInfo.js | CoolCoderTech/Lab12-Linkedin-Chrome-extension | 4935063dac271e67c12da669a9740ba662cbaa4e | [
"MIT"
] | 1 | 2021-11-27T22:48:02.000Z | 2021-11-27T22:48:02.000Z | src/pages/background/reducers/linkInfo.js | CoolCoderTech/Lab12-Linkedin-Chrome-extension | 4935063dac271e67c12da669a9740ba662cbaa4e | [
"MIT"
] | 11 | 2020-07-17T00:32:43.000Z | 2021-06-21T04:51:47.000Z | src/pages/background/reducers/linkInfo.js | CoolCoderTech/Lab12-Linkedin-Chrome-extension | 4935063dac271e67c12da669a9740ba662cbaa4e | [
"MIT"
] | 1 | 2021-08-28T15:48:29.000Z | 2021-08-28T15:48:29.000Z | const initialState = {
name: null,
jobTitle: null,
location: null,
skills: null
};
const linkInfo = (state = initialState, action) => {
switch (action.type) {
case "LINK_INFO":
return {
...state,
name: action.name,
jobTitle: action.jobTitle,
location: action.location,
skills: action.skills,
jobs: action.jobs,
degrees: action.degrees
};
default:
return state;
}
};
export default linkInfo;
| 18.730769 | 52 | 0.583162 |