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
4aea600dfeb2ef0f26a9a61102a0b814034b13d2
3,867
js
JavaScript
src/themes/fonts.js
Pokesi/tohu-frontend
8216f9994c70be55abaebc2c1d06602c9e65c225
[ "MIT" ]
null
null
null
src/themes/fonts.js
Pokesi/tohu-frontend
8216f9994c70be55abaebc2c1d06602c9e65c225
[ "MIT" ]
7
2022-03-11T04:51:00.000Z
2022-03-28T04:54:41.000Z
src/themes/fonts.js
Pokesi/tohu-frontend
8216f9994c70be55abaebc2c1d06602c9e65c225
[ "MIT" ]
1
2022-03-10T02:44:45.000Z
2022-03-10T02:44:45.000Z
import SquareWOFF from "../assets/fonts/Inconsolata-Regular.ttf"; import SquareBoldWOFF from "../assets/fonts/Inconsolata-Bold.ttf"; import SquareSemiBoldWOFF from "../assets/fonts/Inconsolata-SemiBold.ttf"; import SquareItalicWOFF from "../assets/fonts/Inconsolata-Regular.ttf"; import SquareLightWOFF from "../assets/fonts/Inconsolata-Light.ttf"; import SquareMediumWOFF from "../assets/fonts/Inconsolata-Medium.ttf"; import MontserratWOFF from "../assets/fonts/Montserrat-Regular.ttf"; import MontserratBoldWOFF from "../assets/fonts/Montserrat-Bold.ttf"; import MontserratSemiBoldWOFF from "../assets/fonts/Montserrat-SemiBold.ttf"; import MontserratItalicWOFF from "../assets/fonts/Montserrat-Italic.ttf"; import MontserratLightWOFF from "../assets/fonts/Montserrat-Light.ttf"; import MontserratMediumWOFF from "../assets/fonts/Montserrat-Medium.ttf"; const square = { fontFamily: "Square", fontStyle: "normal", fontDisplay: "swap", fontWeight: 400, src: ` local('Inconsolata'), local('Inconsolata-Regular.'), url(${SquareWOFF}) format('truetype') `, }; const squareLight = { fontFamily: "Square", fontStyle: "normal", fontDisplay: "swap", fontWeight: 300, src: ` local('Inconsolata'), local('Inconsolata-Light'), url(${SquareLightWOFF}) format('truetype') `, }; const squareMedium = { fontFamily: "Square", fontStyle: "medium", fontDisplay: "swap", fontWeight: 500, src: ` local('Inconsolata'), local('Inconsolata-Medium'), url(${SquareMediumWOFF}) format('truetype') `, }; const squareSemiBold = { fontFamily: "Square", fontStyle: "normal", fontDisplay: "swap", fontWeight: 600, src: ` local('Inconsolata'), local('Inconsolata-SemiBold'), url(${SquareSemiBoldWOFF}) format('truetype') `, }; const squareBold = { fontFamily: "Square", fontStyle: "bold", fontDisplay: "swap", fontWeight: 700, src: ` local('Inconsolata-Bold'), local('Inconsolata-Bold'), url(${SquareBoldWOFF}) format('truetype') `, }; const squareItalic = { fontFamily: "Square", fontStyle: "italic", fontDisplay: "swap", fontWeight: 400, src: ` local('Inconsolata'), local('Inconsolata-Regular'), url(${SquareItalicWOFF}) format('truetype') `, }; const montserrat = { fontFamily: "Montserrat", fontStyle: "normal", fontDisplay: "swap", fontWeight: 400, src: ` local('Inconsolata'), local('Inconsolata-Regular.'), url(${MontserratWOFF}) format('sans-serif') `, }; const montserratLight = { fontFamily: "Montserrat", fontStyle: "normal", fontDisplay: "swap", fontWeight: 300, src: ` local('Inconsolata'), local('Inconsolata-Light'), url(${MontserratLightWOFF}) format('sans-serif') `, }; const montserratMedium = { fontFamily: "Montserrat", fontStyle: "medium", fontDisplay: "swap", fontWeight: 500, src: ` local('Inconsolata'), local('Inconsolata-Medium'), url(${MontserratMediumWOFF}) format('sans-serif') `, }; const montserratSemiBold = { fontFamily: "Montserrat", fontStyle: "normal", fontDisplay: "swap", fontWeight: 600, src: ` local('Inconsolata'), local('Inconsolata-SemiBold'), url(${MontserratSemiBoldWOFF}) format('sans-serif') `, }; const montserratBold = { fontFamily: "Montserrat", fontStyle: "bold", fontDisplay: "swap", fontWeight: 700, src: ` local('Inconsolata-Bold'), local('Inconsolata-Bold'), url(${MontserratBoldWOFF}) format('sans-serif') `, }; const montserratItalic = { fontFamily: "Montserrat", fontStyle: "italic", fontDisplay: "swap", fontWeight: 400, src: ` local('Inconsolata'), local('Inconsolata-Regular'), url(${MontserratItalicWOFF}) format('sans-serif') `, }; const fonts = [square, squareLight, squareMedium, squareBold, squareItalic, montserrat, montserratLight, montserratMedium, montserratBold, montserratItalic]; export default fonts;
23.87037
157
0.696923
4aea804a11fa445fd2b1555c4714e29fba1e6350
5,252
js
JavaScript
dist/api/auth/auth.controller.js
june2/talk-server
4f7fd88f9f5551c021b3f6bb5a1fab98e383ebf1
[ "MIT" ]
1
2019-08-13T16:07:30.000Z
2019-08-13T16:07:30.000Z
dist/api/auth/auth.controller.js
june2/talk-server
4f7fd88f9f5551c021b3f6bb5a1fab98e383ebf1
[ "MIT" ]
4
2020-09-06T12:14:30.000Z
2022-01-22T08:11:24.000Z
dist/api/auth/auth.controller.js
june2/talk-server
4f7fd88f9f5551c021b3f6bb5a1fab98e383ebf1
[ "MIT" ]
null
null
null
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const crypto = require("crypto"); const swagger_1 = require("@nestjs/swagger"); const common_1 = require("@nestjs/common"); const passport_1 = require("@nestjs/passport"); const auth_service_1 = require("./auth.service"); const user_service_1 = require("./../user/user.service"); const user_dto_1 = require("./../user/user.dto"); const auth_dto_1 = require("./auth.dto"); const notification_service_1 = require("../notification/notification.service"); let AuthController = class AuthController { constructor(authService, userService, notificationService) { this.authService = authService; this.userService = userService; this.notificationService = notificationService; } register(createUserDto) { return __awaiter(this, void 0, void 0, function* () { return this.authService.register(createUserDto); }); } login(authLoginDto) { return __awaiter(this, void 0, void 0, function* () { const user = yield this.userService.findOne({ email: authLoginDto.email, password: crypto.createHmac('sha256', authLoginDto.password).digest('hex') }); if (!user) { throw new common_1.UnauthorizedException('Wrong login combination!'); } return yield this.authService.createToken(user); }); } getProfile(req) { return __awaiter(this, void 0, void 0, function* () { let user = req.user; return { id: user.id, state: user.state, point: user.point, lastLoginAt: user.lastLoginAt, location: user.location, email: user.email, images: user.images, createdAt: user.createdAt, updatedAt: user.updatedAt, intro: user.intro, name: user.name, gender: user.gender, birthday: user.birthday, isActivePush: user.isActivePush, rewardAt: user.rewardAt, tabBadgeCount: yield this.notificationService.count(req.user.id) }; }); } }; __decorate([ common_1.Post('register'), __param(0, common_1.Body()), __metadata("design:type", Function), __metadata("design:paramtypes", [user_dto_1.CreateUserDto]), __metadata("design:returntype", Promise) ], AuthController.prototype, "register", null); __decorate([ common_1.Post('/login'), swagger_1.ApiResponse({ status: 201, description: 'Successful Login' }), swagger_1.ApiResponse({ status: 400, description: 'Bad Request' }), swagger_1.ApiResponse({ status: 401, description: 'Unauthorized' }), __param(0, common_1.Body()), __metadata("design:type", Function), __metadata("design:paramtypes", [auth_dto_1.AuthLoginDto]), __metadata("design:returntype", Promise) ], AuthController.prototype, "login", null); __decorate([ common_1.UseGuards(passport_1.AuthGuard('jwt')), common_1.Get('me'), __param(0, common_1.Request()), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Promise) ], AuthController.prototype, "getProfile", null); AuthController = __decorate([ swagger_1.ApiBearerAuth(), swagger_1.ApiUseTags('Auth'), common_1.Controller('auth'), __metadata("design:paramtypes", [auth_service_1.AuthService, user_service_1.UserService, notification_service_1.NotificationService]) ], AuthController); exports.AuthController = AuthController; //# sourceMappingURL=auth.controller.js.map
46.477876
151
0.632711
4aea9ba6c0bda18292c1934035f3033f57df99bd
335
js
JavaScript
src/utils/index.js
arielerv/hero-journey-be
952cb63c994e55ca4348397848293f8b25bef35f
[ "MIT" ]
1
2021-04-01T23:34:02.000Z
2021-04-01T23:34:02.000Z
src/utils/index.js
arielerv/hero-journey-be
952cb63c994e55ca4348397848293f8b25bef35f
[ "MIT" ]
null
null
null
src/utils/index.js
arielerv/hero-journey-be
952cb63c994e55ca4348397848293f8b25bef35f
[ "MIT" ]
null
null
null
const { getOffset, getPageSize } = require('./getOffset'); const validate = require('./validate'); const validateJWT = require('./validateJWT'); const createJWT = require('./createJWT'); const rename = require('./rename'); module.exports = { getOffset, getPageSize, rename, validate, validateJWT, createJWT };
22.333333
58
0.668657
4aed0dd8842a3a85e8d2f0110c0ed745ab25e3b0
1,740
js
JavaScript
functions/Attribute/AuthManager.js
stories2/Firebase-Google-Drive
da3ccf0ec5c0231a7ed8765d14f86a1dd324570c
[ "MIT" ]
1
2021-02-03T15:59:37.000Z
2021-02-03T15:59:37.000Z
functions/Attribute/AuthManager.js
stories2/Firebase-Google-Drive
da3ccf0ec5c0231a7ed8765d14f86a1dd324570c
[ "MIT" ]
null
null
null
functions/Attribute/AuthManager.js
stories2/Firebase-Google-Drive
da3ccf0ec5c0231a7ed8765d14f86a1dd324570c
[ "MIT" ]
null
null
null
exports.verifyAuthToken = function(request, response, next) { var responseManager = require('../Utils/ResponseManager') const admin = global.admin try { token = request.get('Authorization') admin.auth().verifyIdToken(token) .then(function (decodedToken) { global.log.debug("AuthManager", "verifyAuthToken", "token verified uid: " + decodedToken.uid) request.user = decodedToken admin.auth().getUser(decodedToken.uid) .then(function (userRecord) { global.log.info("AuthManager", "verifyAuthToken", "we found user info") userRecordData = userRecord.toJSON() userRecordDataStr = JSON.stringify(userRecordData) request.userRecordData = userRecordData global.log.debug("AuthManager", "verifyAuthToken", "user info decoded : " + userRecordDataStr) return next(); }) .catch(function (error) { global.log.error("AuthManager", "verifyAuthToken", "cannot verify user: " + JSON.stringify(error)) responseManager.unauthorized(response, {}) }) }) .catch(function (error) { global.log.error("AuthManager", "verifyAuthToken", "cannot verify token: " + JSON.stringify(error)) responseManager.unauthorized(response, {}) }) } catch (exception) { global.log.error("AuthManager", "verifyAuthToken", "server crashed: " + JSON.stringify(exception)) responseManager.internalServerError(response, {}) } }
47.027027
122
0.560345
4aed7e7c24de7bec34117603e42c8056c0d3cc58
229
js
JavaScript
dist/styles/rem.js
dfds-frontend/react-components
51e62edce56d16a63f5bf936b4c044f145c9f015
[ "Unlicense" ]
2
2019-01-07T11:13:08.000Z
2019-01-28T12:57:29.000Z
dist/styles/rem.js
dfds-frontend/react-components
51e62edce56d16a63f5bf936b4c044f145c9f015
[ "Unlicense" ]
null
null
null
dist/styles/rem.js
dfds-frontend/react-components
51e62edce56d16a63f5bf936b4c044f145c9f015
[ "Unlicense" ]
null
null
null
// replacement for the rem function from polished export var rem = function rem(targetPixelValue) { var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 16; return targetPixelValue / base + 'rem'; };
45.8
84
0.707424
4aede2ce93ade477849c629a5dd15ed3ba0f390d
348
js
JavaScript
spoopy-site/src/components/centerLoading.js
SpoopySite/spoopy-python
da68e454eee2a242e3df2ae8ef31bf1e50da571b
[ "MIT" ]
1
2020-01-27T17:42:30.000Z
2020-01-27T17:42:30.000Z
spoopy-site/src/components/centerLoading.js
SpoopySite/spoopy-python
da68e454eee2a242e3df2ae8ef31bf1e50da571b
[ "MIT" ]
59
2021-11-17T08:21:59.000Z
2022-03-29T08:29:55.000Z
spoopy-site/src/components/centerLoading.js
SpoopySite/SpoopySite
da68e454eee2a242e3df2ae8ef31bf1e50da571b
[ "MIT" ]
3
2020-01-26T23:19:24.000Z
2021-09-25T07:07:59.000Z
import React from "react"; import { CircularProgress } from "@mui/material"; import { styled } from "@mui/system"; const StyledDiv = styled("div")({ loading: { position: "absolute", left: "50%", top: "40%" } }) export default function CenterLoading() { return ( <StyledDiv> <CircularProgress/> </StyledDiv> ); }
17.4
49
0.612069
dbe042c4ae359aa46d3b9272810b5f2c9c49a76d
437
js
JavaScript
lib/util/Cursor.js
stdevi/diagram-js
dd379faa3ec5358158a00e7dd5e50b31f9fed54e
[ "MIT" ]
1,156
2015-01-07T01:02:22.000Z
2022-03-29T04:12:41.000Z
lib/util/Cursor.js
stdevi/diagram-js
dd379faa3ec5358158a00e7dd5e50b31f9fed54e
[ "MIT" ]
412
2015-01-06T17:15:22.000Z
2022-03-27T18:36:46.000Z
lib/util/Cursor.js
stdevi/diagram-js
dd379faa3ec5358158a00e7dd5e50b31f9fed54e
[ "MIT" ]
418
2015-01-13T10:06:41.000Z
2022-03-28T12:25:45.000Z
import { classes as domClasses } from 'min-dom'; var CURSOR_CLS_PATTERN = /^djs-cursor-.*$/; export function set(mode) { var classes = domClasses(document.body); classes.removeMatching(CURSOR_CLS_PATTERN); if (mode) { classes.add('djs-cursor-' + mode); } } export function unset() { set(null); } export function has(mode) { var classes = domClasses(document.body); return classes.has('djs-cursor-' + mode); }
16.185185
45
0.672769
dbe0a5960425245f1a641f4070ed720a06da4ee4
1,281
js
JavaScript
src/libs/header.js
cypherkunp/serverless-js-template
16a216ea0aeaa6ce875f1ec90fb95bfac2d3952b
[ "Unlicense" ]
null
null
null
src/libs/header.js
cypherkunp/serverless-js-template
16a216ea0aeaa6ce875f1ec90fb95bfac2d3952b
[ "Unlicense" ]
null
null
null
src/libs/header.js
cypherkunp/serverless-js-template
16a216ea0aeaa6ce875f1ec90fb95bfac2d3952b
[ "Unlicense" ]
null
null
null
const commonAccessControlAllowHeaders = [ 'Content-Type', 'Content-Encoding', 'X-Amz-Date', 'Authorization', 'X-Api-Key', 'X-Auth-Token', 'X-Amz-Security-Token', 'X-Amz-User-Agent', 'Access-Control-Request-Method', 'Access-Control-Request-Headers', ]; function getCapHeaderValue(header) { return header .split('-') .map(word => word.charAt(0).toUpperCase() + word.slice(1)) .join('-'); } function getSmlHeaderValue(header) { return header .split('-') .map(word => word.charAt(0).toLowerCase() + word.slice(1)) .join('-'); } function getHeaderValue(headers, header) { const capHeader = getCapHeaderValue(header); const smlHeader = getSmlHeaderValue(header); let headerValue = null; if (headers[capHeader]) { headerValue = headers[capHeader]; } else if (headers[smlHeader]) { headerValue = headers[smlHeader]; } return headerValue; } function getCorsHeaders(requestHeaders, allowMethods, allowHeaders = []) { return { 'access-control-allow-headers': [commonAccessControlAllowHeaders, ...allowHeaders].join(','), 'access-control-allow-origin': getHeaderValue(requestHeaders, 'origin') || '*', 'access-control-allow-methods': allowMethods.join(','), }; } module.exports = { getCorsHeaders };
25.117647
97
0.676815
dbe0c3d44b67414edd33d24f388623a1c01f1494
1,829
js
JavaScript
instacart.com/out/scripts/status_common-1fd834a384bbe98054e27a8f008945ad030e03ce2da00ef88610bf6bb8485193.js
Bhagavan-Bollina/Recon-Data
aabc3e6cee4f6f43be32b781fca88e41d60a3193
[ "MIT" ]
5
2020-08-16T04:35:58.000Z
2020-09-04T17:35:24.000Z
instacart.com/out/scripts/status_common-1fd834a384bbe98054e27a8f008945ad030e03ce2da00ef88610bf6bb8485193.js
Bhagavan-Bollina/Recon-Data
aabc3e6cee4f6f43be32b781fca88e41d60a3193
[ "MIT" ]
null
null
null
instacart.com/out/scripts/status_common-1fd834a384bbe98054e27a8f008945ad030e03ce2da00ef88610bf6bb8485193.js
Bhagavan-Bollina/Recon-Data
aabc3e6cee4f6f43be32b781fca88e41d60a3193
[ "MIT" ]
6
2021-01-24T13:12:13.000Z
2021-08-24T09:07:28.000Z
$(function(){SP.currentPage.updatesDropdown={getParent:function(){return HRB.utils.djshook("updates-dropdown-container")},getDropdown:function(){return HRB.utils.djshook("updates-dropdown").filter(".updates-dropdown")},isOpen:!1,toggleDropdown:function(){0==this.isOpen?this.show():this.hide()},show:function(){this.getDropdown().show(),this.isOpen=!0,setTimeout(function(){SP.currentPage.updatesDropdown.onBodyClose()},300)},hide:function(){this.getDropdown().hide(),this.isOpen=!1,this.offBodyClose(),$(window).trigger("updatesDropdownHide")},onBodyClose:function(){$("body").on("click.closeDropdown",function(o){SP.currentPage.updatesDropdown.getDropdown().is(o.target)||SP.currentPage.updatesDropdown.getDropdown().has(o.target).length||SP.currentPage.updatesDropdown.hide()})},offBodyClose:function(){$("body").off("click.closeDropdown")}},HRB.utils.djshook("show-updates-dropdown").on("click",function(){SP.currentPage.updatesDropdown.toggleDropdown()})}),$(function(){var o=$(".updates-dropdown-nav").find("a"),t=$(".updates-dropdown-sections-container > div");o.on("click",function(){if($this=$(this),"updates-dropdown-close"!=$this.attr("data-js-hook"))return $elToShow=$($this.attr("href")),o.removeClass("active"),$this.addClass("active"),t.hide(),$elToShow.show(),!1;SP.currentPage.updatesDropdown.hide()})}),$(function(){var o=HRB.utils.djshook("images-container"),t=function(){o.css("height",315*parseInt(o.css("width"))/850)};o.length&&(t(),$(window).on("resize",t))}),$(function(){var o=$(".starter .masthead .updates-dropdown-container"),t=$(".masthead"),n=function(){o.css("top",(t.height()-o.height())/2)};o.length&&(n(),$(window).on("resize",n))}),$(function(){var o=HRB.utils.djshook("updates-dropdown-container"),t=$("#replace-with-subscribe");t.length&&(t.replaceWith(o),o.css("display","inline-block"))});
1,829
1,829
0.725533
dbe0fdcb6c3a4c7e0019b81f4c66dd545ff371ec
1,606
js
JavaScript
frontend/src/reducers/nav.js
unicef/un-partner-portal
73afa193a5f6d626928cae0025c72a17f0ef8f61
[ "Apache-2.0" ]
6
2017-11-21T10:00:44.000Z
2022-02-12T16:51:48.000Z
frontend/src/reducers/nav.js
unicef/un-partner-portal
73afa193a5f6d626928cae0025c72a17f0ef8f61
[ "Apache-2.0" ]
995
2017-07-31T02:08:36.000Z
2022-03-08T22:44:03.000Z
frontend/src/reducers/nav.js
unicef/un-partner-portal
73afa193a5f6d626928cae0025c72a17f0ef8f61
[ "Apache-2.0" ]
1
2021-07-21T10:45:15.000Z
2021-07-21T10:45:15.000Z
import cfeiIcon from 'material-ui-icons/Language'; import applicationsIcon from 'material-ui-icons/Assignment'; import settingsIcon from 'material-ui-icons/Settings'; import partnersIcon from 'material-ui-icons/Group'; import dashboardIcon from 'material-ui-icons/Dashboard'; import help from 'material-ui-icons/Help'; import { SESSION_READY } from './session'; export const PARTNER = 'partner'; export const AGENCY = 'agency'; const initialState = [ { path: '/dashboard', label: 'Dashboard', roles: [PARTNER, AGENCY], icon: dashboardIcon }, { path: '/cfei', label: 'Partnership Opportunities', roles: [PARTNER, AGENCY], icon: cfeiIcon }, { path: '/partner', label: 'Partners', roles: [AGENCY], icon: partnersIcon }, { path: '/applications', label: 'Your Applications', roles: [PARTNER], icon: applicationsIcon }, { path: '/profile', label: 'Profile', roles: [PARTNER], icon: settingsIcon }, { path: '/reports', label: 'Reports', roles: [AGENCY], icon: applicationsIcon }, { path: 'https://unpartnerportalcso.zendesk.com/hc/en-us', external: true, label: 'Resource Library', roles: [PARTNER], icon: help }, { path: 'https://unpartnerportalhelpcenter.zendesk.com/hc/en-us', external: true, label: 'Resource Library', roles: [AGENCY], icon: help }, ]; export const filterItems = (state, role) => state.filter( item => item.roles.includes(role), ); export default function navReducer(state = initialState, action) { switch (action.type) { case SESSION_READY: { return filterItems(initialState, action.getState().session.role); } default: return state; } }
41.179487
141
0.703611
dbe172fd24ac19b74a460dc0072dc5b4451afb21
165
js
JavaScript
src/components/pages/Services.js
baraboulka/spa-center
fd8c9df0e21e5d5719b0e9604c575073173ae5cc
[ "MIT" ]
null
null
null
src/components/pages/Services.js
baraboulka/spa-center
fd8c9df0e21e5d5719b0e9604c575073173ae5cc
[ "MIT" ]
null
null
null
src/components/pages/Services.js
baraboulka/spa-center
fd8c9df0e21e5d5719b0e9604c575073173ae5cc
[ "MIT" ]
null
null
null
import Layout from "../basic/layout"; const Services = () => { return ( <Layout> <h1>Services page</h1> </Layout> ); }; export default Services;
13.75
37
0.575758
dbe34a28fe6a4651d143c0e3ce836088aa401dd4
8,367
js
JavaScript
JavaScript OOP/Exam 2015/academy-online-catalogs/tasks/solution.js
Paskow/Telerik-Academy-JavaScript-Homeworks
05ae0d5b6388be06a1b64940950c6a623bb7eecd
[ "MIT" ]
null
null
null
JavaScript OOP/Exam 2015/academy-online-catalogs/tasks/solution.js
Paskow/Telerik-Academy-JavaScript-Homeworks
05ae0d5b6388be06a1b64940950c6a623bb7eecd
[ "MIT" ]
null
null
null
JavaScript OOP/Exam 2015/academy-online-catalogs/tasks/solution.js
Paskow/Telerik-Academy-JavaScript-Homeworks
05ae0d5b6388be06a1b64940950c6a623bb7eecd
[ "MIT" ]
null
null
null
function solve() { let itemId = 0; let catalogId = 0; class Item { constructor(description, name) { this._id = Item._idGenerator(); if (description.length === 0) { throw new Error(); } if (name.length < 2 || name.length > 40) { throw new Error() } this._description = description; this._name = name; } get id() { return this._id; } get name() { return this._name; } get description() { return this._description; } set name(value) { if (value.length < 2 || value.length > 40) { throw new Error() } this._name = value; } set description(value) { if (value.length === 0) { throw new Error(); } this._description = value; } static _idGenerator() { return itemId += 1; } } class Book extends Item { constructor(name, isbn, genre, description) { super(description, name); if (isNaN(isbn) || (isbn.length !== 10 && isbn.length !== 13)) { throw new Error(); } if (genre.length < 2 || genre.length > 20) { throw new Error(); } this._isbn = isbn; this._genre = genre; } get isbn() { return this._isbn; } get genre() { return this._genre; } set isbn(value) { if (isNaN(value) || (value.length !== 10 && value.length !== 13)) { throw new Error(); } this._isbn = value; } set genre(value) { if (value.length < 2 || value.length > 20) { throw new Error() } THIS._genre = value; } } class Media extends Item { constructor(name, rating, duration, description) { super(description, name); if (duration < 1 || isNaN(duration)) { throw new Error(); } if (rating < 1 || rating > 5 || isNaN(rating)) { throw Error(); } this._rating = rating; this._duration = duration; } get rating() { return this._rating; } get duration() { return this._duration; } set rating(value) { if (value < 1 || value > 5 || isNaN(rating)) { throw Error(); } this._rating = value; } set duration(value) { if (value < 1 || isNaN(duration)) { throw new Error(); } this._duration = value; } } class Catalog { constructor(name) { if (name.length < 2 || name.length > 40) { throw new Error(); } this._name = name; this._id = Catalog._idGenerator(); this._items = []; } get id() { return this._id; } get name() { return this._name; } set name(value) { if (value.length < 2 || value.length > 40) { throw new Error(); } this._name = value; } get items() { return this._items; } set items(value) { this._items = value; } static _idGenerator() { return catalogId += 1; } add(...items) { if (items === undefined || items.length === 0) { throw new Error(); } items.forEach(function(item) { if (!(item instanceof Item)) { throw new Error(); } }); items.forEach(x => this._items.push(x)); return this; } find(parameter) { if (!(parameter instanceof Object) && !(typeof parameter === 'number')) { throw new Error(); } var result = null; if (!isNaN(parameter)) { this._items.forEach(function(item) { if (item.id === parameter) { result = item; } }); return result; } result = []; var keys = Object.keys(parameter); for (let i = 0; i < this._items.length; i += 1) { for (let j = 0; j < keys.length; j += 1) { if (this._items[i][keys[j]] === parameter[keys[j]]) { if (j === keys.length - 1) { result.push(this._items[i]); } else { continue; } } break; } } return result; } search(pattern) { if (pattern.length < 1) { throw new Error(); } pattern = pattern.toLocaleLowerCase(); var result = []; this._items.forEach(function(item) { if (item.name.toLocaleLowerCase().indexOf(pattern) >= 0 || item.description.toLocaleLowerCase().indexOf(pattern) >= 0) { result.push(item); } }); return result; } } class BookCatalog extends Catalog { constructor(name) { super(name); } add(...items) { if (items[0] instanceof Array) { items = items[0]; } items.forEach(function(item) { if (!(item instanceof Book)) { throw new Error(); } }); super.add(...items) return this; } getGenres() { var uniqueGenres = []; this._items.forEach(function(item) { if (uniqueGenres.indexOf(item.genre.toLocaleLowerCase) < 0) { uniqueGenres.push(item.genre.toLocaleLowerCase()); } }); return uniqueGenres; } find(parameter){ super.find(parameter) } } class MediaCatalog extends Catalog { constructor(name) { super(name); } add(...items) { if (items[0] instanceof Array) { items = items[0]; } items.forEach(function(item) { if (!(item instanceof Media)) { throw new Error(); } }); super.add(...items) return this; } getTop(count) { if (isNaN(count) || count < 1) { throw new Error(); } var sortedMedias = this._items.slice().sort((a, b) => b.rating - a.rating); var topMedias = []; for (let i = 0; i < count; i += 1) { if (sortedMedias.length - 1 < i) { break; } topMedias.push({ id: sortedMedias[i].id, name: sortedMedias[i].name }); } return topMedias; } getSortedByDuration() { return this._items.slice().sort(function(a, b) { var result = b.duration - a.duration if (result === 0) { result = a.id - b.id; } return result; }); } find(parameter){ super.find(parameter); } } return { getBook: function(name, isbn, genre, description) { return new Book(name, isbn, genre, description); }, getMedia: function(name, rating, duration, description) { return new Media(name, rating, duration, description); }, getBookCatalog: function(name) { return new BookCatalog(name); }, getMediaCatalog: function(name) { return new MediaCatalog(name); } } } module.exports = solve;
25.050898
87
0.409466
dbe3d46d9415edf40c2b17f0e0420f90c60c5b3a
859
js
JavaScript
src/scripts/setjs/loaders/ssr-loader.js
stateempire/setjs.org
9d2f996b3f7efece5fcf0f7a36f7289ab4e5bbcd
[ "MIT" ]
2
2021-03-05T07:25:14.000Z
2021-03-09T02:39:14.000Z
src/scripts/setjs/loaders/ssr-loader.js
stateempire/setjs.org
9d2f996b3f7efece5fcf0f7a36f7289ab4e5bbcd
[ "MIT" ]
null
null
null
src/scripts/setjs/loaders/ssr-loader.js
stateempire/setjs.org
9d2f996b3f7efece5fcf0f7a36f7289ab4e5bbcd
[ "MIT" ]
null
null
null
var $container = $('#main-content'); var $prev = $('.initial'); var $body = $('body'); var bodyStyle = {}; var bodyCls; function progress() {} function loadContent($content) { var bodyCss; if (typeof $content === 'string') { $content = $($content); } bodyCss = $content.data('css'); if (typeof bodyCss != 'object') { bodyCss = {}; } $prev.remove(); $prev = $content; $container.append($content); $.each(bodyStyle, function(key) { $body.css(key, ''); }); $body.attr('id', $content.data('id') || ($content.data('template') || '').replace(/\//g, '-')) .removeClass(bodyCls) .addClass($content.data('class')) .css(bodyCss); bodyCls = $content.data('class'); bodyStyle = bodyCss; console.log('This is SSR mode loader'); } function showBlank() {} export default {loadContent, showBlank, progress};
23.861111
96
0.594878
dbe5514250fec890747161dce0077b60297ebb2b
274
js
JavaScript
src/utils/index.js
ozlongblack/h2
7d1212c7ec1eb233672b6f2905834fc9dc15df29
[ "MIT" ]
1
2019-01-11T05:57:30.000Z
2019-01-11T05:57:30.000Z
src/utils/index.js
ozlongblack/h2
7d1212c7ec1eb233672b6f2905834fc9dc15df29
[ "MIT" ]
null
null
null
src/utils/index.js
ozlongblack/h2
7d1212c7ec1eb233672b6f2905834fc9dc15df29
[ "MIT" ]
null
null
null
// @flow export { default as delay } from './transitions/delay'; export { default as lazyContainer } from './transitions/lazyContainer'; export { default as useScrollStatus } from './hooks/useScrollStatus'; export { default as useViewStatus } from './hooks/useViewStatus';
39.142857
71
0.744526
dbe81cedac22545481bf1fd44c2404542143fb61
489
js
JavaScript
frontend/components/edit_user/edit_user_container.js
RenanCostaSource/HOPE
fc104a4afcb84ff0543ef1b4a5930cbe54cca0fc
[ "MIT" ]
1
2020-09-29T23:08:50.000Z
2020-09-29T23:08:50.000Z
frontend/components/edit_user/edit_user_container.js
renanpaiva/HOPE
fc104a4afcb84ff0543ef1b4a5930cbe54cca0fc
[ "MIT" ]
1
2020-10-05T14:25:10.000Z
2020-10-05T14:25:10.000Z
frontend/components/edit_user/edit_user_container.js
renanpaiva/HOPE
fc104a4afcb84ff0543ef1b4a5930cbe54cca0fc
[ "MIT" ]
null
null
null
import EditUser from './edit_user'; import { connect } from 'react-redux'; import { updateUser, fetchSingleUser } from '../../actions/user_actions'; const mapStateToProps = (state) => { return { user: state.user, }; }; const mapDispatchToProps = dispatch => { return { updateUser: (user) => dispatch(updateUser(user)), fetchSingleUser: (userId) => dispatch(fetchSingleUser(userId)), }; }; export default connect( mapStateToProps, mapDispatchToProps )(EditUser);
22.227273
73
0.687117
dbe834543b4a31867d9dc230aaadc7bf0c68c6dd
1,273
js
JavaScript
src/validations/SinhVien_NguyenChauQuyen_de3.validation.js
quyen46919/NodeJs_Express_BoilerPlate
4c3484c458a3b84ae3be1ca856bcfc7c891ee149
[ "MIT" ]
null
null
null
src/validations/SinhVien_NguyenChauQuyen_de3.validation.js
quyen46919/NodeJs_Express_BoilerPlate
4c3484c458a3b84ae3be1ca856bcfc7c891ee149
[ "MIT" ]
null
null
null
src/validations/SinhVien_NguyenChauQuyen_de3.validation.js
quyen46919/NodeJs_Express_BoilerPlate
4c3484c458a3b84ae3be1ca856bcfc7c891ee149
[ "MIT" ]
null
null
null
const Joi = require('joi'); const { objectId } = require('./custom.validation'); const taoSinhVien = { body: Joi.object().keys({ hoTen: Joi.string().max(30).required(), maKhoa: Joi.string().custom(objectId).required(), namSinh: Joi.number().required(), queQuan: Joi.string().max(30).required(), }), }; const timTatCaSinhVien = { query: Joi.object().keys({ hoTen: Joi.string().max(30), maKhoa: Joi.string().custom(objectId), namSinh: Joi.number(), queQuan: Joi.string().max(30), sortBy: Joi.string(), limit: Joi.number().integer(), page: Joi.number().integer(), }), }; const timSinhVienTheoId = { params: Joi.object().keys({ sinhVienId: Joi.string().custom(objectId), }), }; const capNhatSinhVien = { params: Joi.object().keys({ sinhVienId: Joi.required().custom(objectId), }), body: Joi.object() .keys({ hoTen: Joi.string().max(30), maKhoa: Joi.string().custom(objectId), namSinh: Joi.number(), queQuan: Joi.string().max(30), }) .min(1), }; const xoaSinhVien = { params: Joi.object().keys({ sinhVienId: Joi.string().custom(objectId), }), }; module.exports = { taoSinhVien, timTatCaSinhVien, timSinhVienTheoId, capNhatSinhVien, xoaSinhVien, };
21.948276
53
0.619796
dbe92b23d1023eddddbaa50f00ea6343743c4da3
468
js
JavaScript
client/src/store/theme.js
iivanovw7/work-book
826a98dd8073e2f3d994875ce3652db07396bf34
[ "MIT" ]
null
null
null
client/src/store/theme.js
iivanovw7/work-book
826a98dd8073e2f3d994875ce3652db07396bf34
[ "MIT" ]
10
2021-03-09T17:07:32.000Z
2022-03-24T08:55:31.000Z
client/src/store/theme.js
iivanovw7/work-book
826a98dd8073e2f3d994875ce3652db07396bf34
[ "MIT" ]
null
null
null
import Cookies from 'js-cookie'; export default (store) => { const previousTheme = Cookies.get('theme'); const verifiedPreviousTheme = previousTheme === 'dark' ? 'dark' : 'light'; store.on('@init', () => ({ theme: verifiedPreviousTheme })); store.on('switch', ({ theme }) => { if (theme === 'dark') { Cookies.set('theme', 'light'); return ({ theme: 'light' }); } Cookies.set('theme', 'dark'); return ({ theme: 'dark' }); }); };
27.529412
76
0.564103
dbe9e83731126094b1f87bbae6ce05d55ec55dba
198
js
JavaScript
JavaScript-Mateus_Battisti/projetos/Secao_3/ex04/scripts.js
BrunoEnriqueB/HTML_CSS
596202e03905b85daf3a59572587a7d96077e21b
[ "MIT" ]
null
null
null
JavaScript-Mateus_Battisti/projetos/Secao_3/ex04/scripts.js
BrunoEnriqueB/HTML_CSS
596202e03905b85daf3a59572587a7d96077e21b
[ "MIT" ]
null
null
null
JavaScript-Mateus_Battisti/projetos/Secao_3/ex04/scripts.js
BrunoEnriqueB/HTML_CSS
596202e03905b85daf3a59572587a7d96077e21b
[ "MIT" ]
null
null
null
// Escreva três valores em string em um arquivo e exiba no navegador com o console.log(); console.log((3 < 5) && (20 < 10)); console.log((3 < 5) || (20 > 10)); console.log(!((3 < 5) && (20 < 10)));
39.6
89
0.585859
dbeb7878174ed37db100d9a07d35b101cdf6b24d
2,150
js
JavaScript
src/js/components/Camera.js
r-wittmann/IFD-proto
05ecce6547f0698e05e50e21db2920c870119399
[ "MIT" ]
null
null
null
src/js/components/Camera.js
r-wittmann/IFD-proto
05ecce6547f0698e05e50e21db2920c870119399
[ "MIT" ]
null
null
null
src/js/components/Camera.js
r-wittmann/IFD-proto
05ecce6547f0698e05e50e21db2920c870119399
[ "MIT" ]
null
null
null
import React from 'react' import { Entity } from 'aframe-react' const Camera = (props) => ( <Entity> <Entity id='main-camera' camera='userHeight: 1.6' look-controls wasd-controls='' {...props}> {/* hover cursor, product hovering */} <a-entity raycaster='far: 8; near: 6.1;' cursor='fuse: true; fuseTimeout: 1' /> {/* category selector with animation */} <Entity raycaster='far: 4; near: 3.9;' cursor='' // selection should work by clicking on desctop and by fusing on the mobile device position='0 0 -1' geometry='primitive: ring; radiusInner: 0.015; radiusOuter: 0.02' material='color: green; shader: flat' > <a-animation begin='click' easing='ease-in' attribute='scale' fill='backwards' from='0.1 0.1 0.1' to='1 1 1' dur='200' /> <a-animation begin='cursor-fusing' easing='linear' attribute='scale' fill='backwards' from='1 1 1' to='0.1 0.1 0.1' dur='1200' delay='200' /> </Entity> {/* product selector, orange ring */} <Entity raycaster='far: 3.5; near: 1;' cursor='fuse: true; fuse-timeout: 3500' position='0 0 -1' geometry='primitive: torus; radius: 0.03; radius-tubular: 0.004; arc: 0.01;' material='color: orange; shader: flat' > <a-animation begin='click' easing='ease-in' attribute='geometry.arc' fill='backwards' from='360' to='0.01' dur='200' /> <a-animation begin='mouseleave' easing='ease-in' attribute='geometry.arc' fill='backwards' to='0.01' dur='500' /> <a-animation begin='cursor-fusing' easing='linear' attribute='geometry.arc' fill='backwards' from='0.01' to='360' dur='2500' delay='1000' /> </Entity> </Entity> </Entity> ) export default Camera
27.922078
100
0.503721
dbebf2b2760b4a0aa98fe7391d9d71625ca7208a
5,428
js
JavaScript
node_modules/@sap/cds-compiler/lib/checks/checkArtifacts.js
Showkath/car-cap-demo
738ce73f2016d4a3f2b5ca6882b303440cd26fdf
[ "Apache-2.0" ]
null
null
null
node_modules/@sap/cds-compiler/lib/checks/checkArtifacts.js
Showkath/car-cap-demo
738ce73f2016d4a3f2b5ca6882b303440cd26fdf
[ "Apache-2.0" ]
null
null
null
node_modules/@sap/cds-compiler/lib/checks/checkArtifacts.js
Showkath/car-cap-demo
738ce73f2016d4a3f2b5ca6882b303440cd26fdf
[ "Apache-2.0" ]
null
null
null
'use strict'; const alerts = require('../base/alerts'); const { getMessageFunction } = require('../base/messages'); const { hasArtifactTypeInformation } = require('../model/modelUtils') // Semantic checks that are performed on artifacts // Check that artifact 'art' is not empty and does not contain only virtual elements // (not applicable to abstract artifacts) function checkNotEmptyOrOnlyVirtualElems(art, model) { const { info, signal } = alerts(model); if (!art.abstract && emptyOrOnlyVirtualElements(art)) { const location = art.name && art.name.location || art.location; if (art.kind === 'entity') signal(info`Dubious entity without non-virtual elements`, location, undefined, 'empty-entity'); else if (art.kind === 'type') signal(info`Dubious type without non-virtual elements`, location, undefined, 'empty-type'); } // Return true if artifact or element 'construct' is a virtual element or an empty structure // or a structure that (recursively) is empty or only contains virtual elements function emptyOrOnlyVirtualElements(construct) { // Structured type ? if ((construct._finalType || construct).elements) { construct = construct._finalType || construct; // No elements or all elements recursively empty, too ? return construct.elements.length == 0 || Object.keys(construct.elements).map(k => construct.elements[k]).every(elm => emptyOrOnlyVirtualElements(elm)); } // Non-structured type - just check for virtual-ness or non-existing elements for entities or views return construct.virtual || (( construct.kind === 'entity' || construct.kind === 'view' ) && construct.elements === undefined ); } } // Check that queries in 'art' do not contain unmanaged associations in GROUP BY or ORDER BY function checkNoUnmanagedAssocsInGroupByOrderBy(art, model) { const { error, signal } = alerts(model); for (let query of art.$queries || []) { for (let groupByEntry of query.groupBy || []) { if (groupByEntry._artifact && groupByEntry._artifact._finalType && groupByEntry._artifact._finalType.onCond) { // Unmanaged association - complain signal(error`"${art.name.absolute}": Unmanaged associations are not allowed in GROUP BY`, groupByEntry.location); } } for (let orderByEntry of query.orderBy || []) { if (orderByEntry.value && orderByEntry.value._artifact && orderByEntry.value._artifact._finalType && orderByEntry.value._artifact._finalType.onCond) { // Unmanaged association - complain signal(error`"${art.name.absolute}": Unmanaged associations are not allowed in ORDER BY`, orderByEntry.value.location); } } } } /** * If the given artifact is a type definition then check whether it is * properly defined and has valid type information, e.g. information about * its elements or references another valid type. * * @param {XSN.Definition} artifact * @param {XSN.Model} model */ function checkTypeDefinitionHasType(artifact, model) { if (artifact.kind !== 'type') return; checkArtifactHasProperType(artifact, model); } /** * Check that the given artifact has proper type information. * Either the artifact itself is a proper type or its `type` property * references a proper type (including `many type of`). * * @param {XSN.Definition} artifact * @param {XSN.Model} model */ function checkArtifactHasProperType(artifact, model) { function warnAboutMissingType(art) { // Can happen in CSN, e.g. `{ a: { kind: "type" } }` but should // not happen in CDL. const message = getMessageFunction(model); message('check-proper-type', art.location, art, { art: artifact }, ['Error'], { std: 'Dubious type $(ART) without type information', element: 'Dubious element $(MEMBER) of $(ART) without type information', }); } if (!hasArtifactTypeInformation(artifact)) { warnAboutMissingType(artifact); return; } // Check for `type of` if (artifact.type) { checkTypeOfHasProperType(artifact, model) return; } const items = artifact.items; if (!items) return; // `array of` without nested `type of` if (!hasArtifactTypeInformation(items)) warnAboutMissingType(items); else if (items && items.type) // `array of type of` checkTypeOfHasProperType(items, model) } /** * Check that the `type of` information in the given artifact (i.e. `type` property) * has proper type information or warn otherwise. The artifact's final type is checked. * * @param {XSN.Artifact} artifact * @param {XSN.Model} model */ function checkTypeOfHasProperType(artifact, model) { if (!artifact.type) return; const finalType = artifact.type._artifact && artifact.type._artifact._finalType; if (finalType && !hasArtifactTypeInformation(finalType)) { const message = getMessageFunction(model); message('check-proper-type-of', artifact.type.location, artifact, { art: artifact.type }, 'Info', { std: 'Referred type of $(ART) does not contain proper type information', element: 'Referred element $(MEMBER) of $(ART) does not contain proper type information', }); return; } } module.exports = { checkNotEmptyOrOnlyVirtualElems, checkNoUnmanagedAssocsInGroupByOrderBy, checkTypeDefinitionHasType, checkTypeOfHasProperType, checkArtifactHasProperType, };
37.694444
156
0.693257
dbec0c95c96cf4632fda6c7fb7bfe528272611e7
303
js
JavaScript
client/app.routing.js
melissa8717/Laiterie
cb9427eacf9bd605466252391c0d6498cefe8568
[ "MIT" ]
null
null
null
client/app.routing.js
melissa8717/Laiterie
cb9427eacf9bd605466252391c0d6498cefe8568
[ "MIT" ]
null
null
null
client/app.routing.js
melissa8717/Laiterie
cb9427eacf9bd605466252391c0d6498cefe8568
[ "MIT" ]
null
null
null
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var router_1 = require("@angular/router"); exports.appRoutingProviders = [router_1.provideRouter(exports.appRoutes)]; exports.routing = router_1.RouterModule.forRoot(exports.appRoutes); //# sourceMappingURL=app.routing.js.map
43.285714
74
0.782178
dbec81c6170d3a79a88f67362d2ec89b1024adeb
17,334
js
JavaScript
public/js/searchFilter.js
Joymania/Advanced-Ecommerce-7
41c548ded74c675958e3f9df385fcfa016a81c2d
[ "MIT" ]
null
null
null
public/js/searchFilter.js
Joymania/Advanced-Ecommerce-7
41c548ded74c675958e3f9df385fcfa016a81c2d
[ "MIT" ]
null
null
null
public/js/searchFilter.js
Joymania/Advanced-Ecommerce-7
41c548ded74c675958e3f9df385fcfa016a81c2d
[ "MIT" ]
null
null
null
//Filter by price or $(document).ready(function () { $('.priceFilter').on('click', function () { $(".priceFilter").css({ 'backgroundColor':'#FFFFFF', 'color': 'black' }); $(this).css({ 'backgroundColor':'#666666', 'color': 'white' }); let first = $(this).find('span[class="first"]').text(); let second = $(this).find('span[class="second"]').text(); /*let amount = $('#amount').val(); let split = amount.split('-'); let first =split[0].replace('$',''); let second = split[1].replace('$','');*/ /*let search = $('#search').val(); let category = $('#category').val();*/ let shopArea = $('#shopArea'); let singleProduct = $('.singleProduct'); $.ajax({ type: 'get', url: '/search-filter', data: { first: first, second: second }, success: function (data) { singleProduct.attr('hidden',true); if (data.length > 0) { $('#noResult').remove(); for (let i = 0; i < data.length; i++) { if (data[i].promo_price === null) { shopArea.append('' + '<div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-12 singleProduct">' + ' <div class="single-product-wrap mb-35">' + '<div class="product-img product-img-zoom mb-15">' + '<a href="/' + data[i].id + '/product-details">' + '<img src="../upload/products_images/' + data[i].image + '" style="width: 266px; height: 320px;"></a>' + '<div class="product-action-2 tooltip-style-2">' + '<button title="Wishlist"><i class="icon-heart"></i></button>' + '</div> </div>' + ' <div class="product-content-wrap-2 text-center">' + '<h3><a href="/' + data[i].id + '/product-details">' + data[i].name + '</a></h3>' + '<div class="product-price-2">' + '<span class="price">' + data[i].price + '</span><span style="margin-left: -3px">Tk.</span>' + '</div>' + '</div>' + '<div class="product-content-wrap-2 product-content-position text-center">' + '<h3><a href="/' + data[i].id + '/product-details">' + data[i].name + '</a></h3>' + '<div class="product-price-2">' + ' <span class="product-price">' + data[i].price + ' Tk.</span>' + ' </div>' + '<div class="pro-add-to-cart">' + '<a href="/' + data[i].id + '/product-details">' + '<button title="Add to Cart">Add To Cart</button>' + '</a>' + ' </div> </div> </div> </div>') }else{ shopArea.append('' + '<div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-12 singleProduct">' + ' <div class="single-product-wrap mb-35">' + '<div class="product-img product-img-zoom mb-15">' + '<a href="/' + data[i].id + '/product-details">' + '<img src="../upload/products_images/' + data[i].image + '" style="width: 266px; height: 320px;"></a>' + '<div class="product-action-2 tooltip-style-2">' + '<button title="Wishlist"><i class="icon-heart"></i></button>' + '</div> </div>' + ' <div class="product-content-wrap-2 text-center">' + '<h3><a href="/' + data[i].id + '/product-details">' + data[i].name + '</a></h3>' + '<div class="product-price-2">' + '<span class="new-price">' + data[i].promo_price + '</span><span style="margin-left: -3px">Tk.</span>' + '<span class="old-price">' + data[i].price + '</span><span style="margin-left: -3px">Tk.</span>' + '</div>' + '</div>' + '<div class="product-content-wrap-2 product-content-position text-center">' + '<h3><a href="/' + data[i].id + '/product-details">' + data[i].name + '</a></h3>' + '<div class="product-price-2">' + ' <span class="new-price">' + data[i].promo_price + ' Tk.</span>' + ' <span class="old-price">' + data[i].price + ' Tk.</span>' + ' </div>' + '<div class="pro-add-to-cart">' + '<a href="/' + data[i].id + '/product-details">' + '<button title="Add to Cart">Add To Cart</button>' + '</a>' + ' </div> </div> </div> </div>') } } }else { $('#noResult').remove(); shopArea.append('' + '<div id="noResult" class="col-12 text-center"><h3>No Result Found</h3></div>'); } }, error: function (error) { } }) }); }); //Sorting by name or price function $(document).ready(function () { function SortByName() { var sortedProducts = $('.singleProduct').sort(function(a, b) { return $(a).find('.productName').text().localeCompare($(b).find('.productName').text()) }); $('#shopArea').remove('.singleProduct').append(sortedProducts) } function SortByPrice(){ var sortedProducts = $('.singleProduct').sort(function(a, b) { return $(a).find('.product-price').text().localeCompare($(b).find('.product-price').text()) }); $('#shopArea').remove('.singleProduct').append(sortedProducts) } $('#sortBy').on('change', function () { if ($(this).val() === 'name'){ SortByName(); } if ($(this).val() === 'price') { SortByPrice(); } }); }); //Newly Search products $(document).ready(function () { $('#search2').on('submit', function (e) { e.preventDefault(); let shopArea = $('#shopArea'); let singleProduct = $('.singleProduct'); let searchText = $('#searchInput').val(); $.ajax({ type: 'get', url: '/search-ajax', data: { search: searchText }, success: function (data) { singleProduct.attr('hidden',true); if (data.length > 0) { $('#noResult').remove(); for (let i = 0; i < data.length; i++) { if (data[i].promo_price === null){ console.log(data[i].promo_price); shopArea.append('' + '<div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-12 singleProduct">' + ' <div class="single-product-wrap mb-35">' + '<div class="product-img product-img-zoom mb-15">' + '<a href="/'+data[i].id+'/product-details">' + '<img src="../upload/products_images/'+data[i].image+'" style="width: 266px; height: 320px;"></a>' + '<div class="product-action-2 tooltip-style-2">' + '<button title="Wishlist"><i class="icon-heart"></i></button>' + '</div> </div>' + ' <div class="product-content-wrap-2 text-center">' + '<h3><a href="/'+data[i].id+'/product-details">'+data[i].name+'</a></h3>' + '<div class="product-price-2">' + '<span class="price">'+data[i].price+'</span><span style="margin-left: -3px">Tk.</span>' + '</div>' + '</div>' + '<div class="product-content-wrap-2 product-content-position text-center">' + '<h3><a href="/'+data[i].id+'/product-details">'+data[i].name+'</a></h3>' + '<div class="product-price-2">' + ' <span class="product-price">'+data[i].price+' Tk.</span>' + ' </div>' + '<div class="pro-add-to-cart">' + '<a href="/'+data[i].id+'/product-details">'+ '<button title="Add to Cart">Add To Cart</button>' + '</a>'+ ' </div> </div> </div> </div>') }else{ shopArea.append('' + '<div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-12 singleProduct">' + ' <div class="single-product-wrap mb-35">' + '<div class="product-img product-img-zoom mb-15">' + '<a href="/'+data[i].id+'/product-details">' + '<img src="../upload/products_images/'+data[i].image+'" style="width: 266px; height: 320px;"></a>' + '<div class="product-action-2 tooltip-style-2">' + '<button title="Wishlist"><i class="icon-heart"></i></button>' + '</div> </div>' + ' <div class="product-content-wrap-2 text-center">' + '<h3><a href="/'+data[i].id+'/product-details">'+data[i].name+'</a></h3>' + '<div class="product-price-2">' + '<span class="old-price">'+data[i].promo_price+'</span><span style="margin-left: -3px">Tk.</span>' + '<span class="new-price">'+data[i].price+'</span><span style="margin-left: -3px">Tk.</span>' + '</div>' + '</div>' + '<div class="product-content-wrap-2 product-content-position text-center">' + '<h3><a href="/'+data[i].id+'/product-details">'+data[i].name+'</a></h3>' + '<div class="product-price-2">' + ' <span class="new-price">'+data[i].promo_price+' Tk.</span>' + ' <span class="old-price">'+data[i].price+' Tk.</span>' + ' </div>' + '<div class="pro-add-to-cart">' + '<a href="/'+data[i].id+'/product-details">'+ '<button title="Add to Cart">Add To Cart</button>' + '</a>'+ ' </div> </div> </div> </div>') } } }else { $('#noResult').remove(); shopArea.append('' + '<div id="noResult" class="col-12 text-center"><h3>No Result Found</h3></div>'); } } }) }) }); $(document).ready(function () { $(".categoryName").on('click', function (e) { e.preventDefault(); let shopArea = $('#shopArea'); let categoryName = $(this).text(); let singleProduct = $('.singleProduct'); $.ajax({ type: 'GET', url: '/category-products', data: {category: categoryName}, success: function (data) { singleProduct.attr('hidden',true); if (data.length > 0) { $('#noResult').remove(); for (let i = 0; i < data.length; i++) { if (data[i].promo_price === null) { shopArea.append('' + '<div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-12 singleProduct">' + ' <div class="single-product-wrap mb-35">' + '<div class="product-img product-img-zoom mb-15">' + '<a href="/' + data[i].id + '/product-details">' + '<img src="../upload/products_images/' + data[i].image + '" style="width: 266px; height: 320px;"></a>' + '<div class="product-action-2 tooltip-style-2">' + '<button title="Wishlist"><i class="icon-heart"></i></button>' + '</div> </div>' + ' <div class="product-content-wrap-2 text-center">' + '<h3><a href="/' + data[i].id + '/product-details">' + data[i].name + '</a></h3>' + '<div class="product-price-2">' + '<span class="price">' + data[i].price + '</span><span style="margin-left: -3px">Tk.</span>' + '</div>' + '</div>' + '<div class="product-content-wrap-2 product-content-position text-center">' + '<h3><a href="/' + data[i].id + '/product-details">' + data[i].name + '</a></h3>' + '<div class="product-price-2">' + ' <span class="product-price">' + data[i].price + ' Tk.</span>' + ' </div>' + '<div class="pro-add-to-cart">' + '<a href="/' + data[i].id + '/product-details">' + '<button title="Add to Cart">Add To Cart</button>' + '</a>' + ' </div> </div> </div> </div>') }else{ shopArea.append('' + '<div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-12 singleProduct">' + ' <div class="single-product-wrap mb-35">' + '<div class="product-img product-img-zoom mb-15">' + '<a href="/' + data[i].id + '/product-details">' + '<img src="../upload/products_images/' + data[i].image + '" style="width: 266px; height: 320px;"></a>' + '<div class="product-action-2 tooltip-style-2">' + '<button title="Wishlist"><i class="icon-heart"></i></button>' + '</div> </div>' + ' <div class="product-content-wrap-2 text-center">' + '<h3><a href="/' + data[i].id + '/product-details">' + data[i].name + '</a></h3>' + '<div class="product-price-2">' + '<span class="new-price">' + data[i].promo_price + '</span><span style="margin-left: -3px">Tk.</span>' + '<span class="old-price">' + data[i].price + '</span><span style="margin-left: -3px">Tk.</span>' + '</div>' + '</div>' + '<div class="product-content-wrap-2 product-content-position text-center">' + '<h3><a href="/' + data[i].id + '/product-details">' + data[i].name + '</a></h3>' + '<div class="product-price-2">' + ' <span class="new-price">' + data[i].promo_price + ' Tk.</span>' + ' <span class="new-price">' + data[i].price + ' Tk.</span>' + ' </div>' + '<div class="pro-add-to-cart">' + '<a href="/' + data[i].id + '/product-details">' + '<button title="Add to Cart">Add To Cart</button>' + '</a>' + ' </div> </div> </div> </div>') } } }else { $('#noResult').remove(); shopArea.append('' + '<div id="noResult" class="col-12 text-center"><h3>No Result Found</h3></div>'); } } }) }); });
56.832787
136
0.377005
dbecd3accd89f611e36991fdbb7ccefde5025c80
1,324
js
JavaScript
public/js/validate/metodos.js
lbovolini/gig_hunter
9423374bfaa52f3de8d8b1e2c402e3342e47fc5d
[ "Apache-2.0" ]
null
null
null
public/js/validate/metodos.js
lbovolini/gig_hunter
9423374bfaa52f3de8d8b1e2c402e3342e47fc5d
[ "Apache-2.0" ]
null
null
null
public/js/validate/metodos.js
lbovolini/gig_hunter
9423374bfaa52f3de8d8b1e2c402e3342e47fc5d
[ "Apache-2.0" ]
null
null
null
// somente letras jQuery.validator.addMethod("lettersonly", function(value, element) { return this.optional(element) || /^[a-z," "]+$/i.test(value); }, "Deve conter somente letras."); // somente letras, numeros e hifen $.validator.addMethod("loginRegex", function(value, element) { return this.optional(element) || /^[a-z0-9]+$/i.test(value); }, "Deve conter somente letras e números."); // valida data /* http://coffeverton.blogspot.com.br/2013/09/validando-datas-em-pt-br-com-jquery.html */ $.validator.addMethod( "date", function(value, element) { var check = false; var re = /^\d{1,2}\/\d{1,2}\/\d{4}$/; if( re.test(value)){ var adata = value.split('/'); var gg = parseInt(adata[0],10); var mm = parseInt(adata[1],10); var aaaa = parseInt(adata[2],10); var xdata = new Date(aaaa,mm-1,gg); if ( ( xdata.getFullYear() == aaaa ) && ( xdata.getMonth () == mm - 1 ) && ( xdata.getDate() == gg ) ) check = true; else check = false; } else check = false; return this.optional(element) || check; }, "Insira uma data válida" );
36.777778
120
0.509819
dbedb16fbe0104fafb4292e8b6a3641f68447a00
7,902
js
JavaScript
open-falcon4j-web/src/main/webapp/WEB-INF/resources/js/service/action.js
minlingchao1/open-falcon4j
65a0e6476c2d91e070abb32a0e209a1338904543
[ "Apache-2.0" ]
10
2017-05-11T08:14:04.000Z
2021-12-13T04:06:07.000Z
open-falcon4j-web/src/main/webapp/WEB-INF/resources/js/service/action.js
minlingchao1/open-falcon4j
65a0e6476c2d91e070abb32a0e209a1338904543
[ "Apache-2.0" ]
1
2018-04-27T08:44:03.000Z
2018-04-27T08:44:03.000Z
open-falcon4j-web/src/main/webapp/WEB-INF/resources/js/service/action.js
minlingchao1/open-falcon4j
65a0e6476c2d91e070abb32a0e209a1338904543
[ "Apache-2.0" ]
4
2017-08-07T05:18:37.000Z
2021-12-13T04:06:12.000Z
$(function () { Action.init() }) var Action={ init:function () { Action.getAllUserGroup() Action.bind() }, bind:function () { $("#confirmAddAction").click(Action.addAction) $("#confirmModifyAction").click(Action.modifyAction) $(".modify").click(Action.showModifyModal) $(".del").click(Action.delAction) }, showModifyModal:function () { var name=$(this).attr("name"); var url=$(this).attr("url"); var afterCallbackmail=$(this).attr("afterCallbackmail")=="true"?1:0; var afterCallbackSms=$(this).attr("afterCallbackSms")=="true"?1:0; var beforeCallbackMail=$(this).attr("beforeCallbackMail")=="true"?1:0; var beforeCallbackSms=$(this).attr("beforeCallbackSms")=="true"?1:0; var callback=$(this).attr("callback")=="true"?1:0; var id=$(this).attr("action") var usrGrpId=$(this).attr("userGrpId"); $("#name").val(name); $("#url").val(url); $("#afterCallbackmail").val(afterCallbackmail).trigger("change") $("#afterCallbackSms").val(afterCallbackSms).trigger("change") $("#beforeCallbackMail").val(beforeCallbackMail).trigger("change") $("#beforeCallbackSms").val(beforeCallbackSms).trigger("change") $("#callback").val(callback).trigger("change"); $("#userGrpId").val(usrGrpId).trigger("change"); $("#id").val(id) $("#modify-action").modal("show"); }, delAction:function () { var id=$(this).attr("action") bootbox.confirm("确定删除?", function(result) { if(result){ $.ajax({ type:"post", url:"/action/delete", dataType:"json", data:{ id:id, }, success:function (data) { if(data.success){ swal({ title: "删除成功", confirmButtonColor: "#66BB6A", type: "success" }); window.location.reload(); }else { swal({ title: "删除失败", text:data.msg, confirmButtonColor: "#EF5350", type: "error" }); } } }) } }); }, addAction:function () { var name=$("#add-name").val() var url=$("#add-url").val() var callback=$("#add-callback").val() var afterCallbackmail=$("#add-afterCallbackmail").val(); var afterCallbackSms=$("#add-afterCallbackSms").val() var beforeCallbackMail=$("#add-beforeCallbackMail").val() var beforeCallbackSms=$("#add-beforeCallbackSms").val() var usrGrpId=$("#add-userGrpId").val(); if(name==""){ swal({ title: "请输入名称", confirmButtonColor: "#EF5350", type: "error" }); return; } $.ajax({ type:"post", url:"/action/add", dataType:"json", data:{ name:name, userGrpId:usrGrpId, url:url, callback:callback, beforeCallbackSms:beforeCallbackSms, beforeCallbackMail:beforeCallbackMail, afterCallbackSms:afterCallbackSms, afterCallbackmail:afterCallbackmail }, success:function (data) { if(data.success){ $("#add-action").modal("hide"); swal({ title: "修改成功", confirmButtonColor: "#66BB6A", type: "success" }); window.location.reload(); }else { $("#add-action").modal("hide"); swal({ title: "修改失败", text:data.msg, confirmButtonColor: "#EF5350", type: "error" }); } } }) }, modifyAction:function () { var name=$("#name").val() var url=$("#url").val() var callback=$("#callback").val() var afterCallbackmail=$("#afterCallbackmail").val(); var afterCallbackSms=$("#afterCallbackSms").val() var beforeCallbackMail=$("#beforeCallbackMail").val() var beforeCallbackSms=$("#beforeCallbackSms").val() var usrGrpId=$("#userGrpId").val() var id=$("#id").val(); if(name==""){ swal({ title: "请输入名称", confirmButtonColor: "#EF5350", type: "error" }); return; } $.ajax({ type:"post", url:"/action/modify", dataType:"json", data:{ id:id, name:name, userGrpId:usrGrpId, url:url, callback:callback, beforeCallbackSms:beforeCallbackSms, beforeCallbackMail:beforeCallbackMail, afterCallbackSms:afterCallbackSms, afterCallbackmail:afterCallbackmail }, success:function (data) { if(data.success){ $("#modify-action").modal("hide"); swal({ title: "修改成功", confirmButtonColor: "#66BB6A", type: "success" }); window.location.reload(); }else { $("#modify-action").modal("hide"); swal({ title: "修改失败", text:data.msg, confirmButtonColor: "#EF5350", type: "error" }); } } }) }, getAllUserGroup:function () { $.ajax({ type:"get", url:"/usergroup/getAll", dataType:"json", success:function (data) { if(data.success){ $("#add-userGrpId").select2({ language: 'zh-CN', data: data.result, placeholder:'请选择用户组', }) $("#userGrpId").select2({ language: 'zh-CN', data: data.result, placeholder:'请选择用户组', }) } } }) } }
37.628571
78
0.363958
dbee0a928956c43e3546a65c8cd78b54b9fea87f
2,815
js
JavaScript
public/assets/front/js/script.js
taouraghti/association
a51ec5c6d595405ee99dd4fae0eaaa42c2b7c9e9
[ "MIT" ]
null
null
null
public/assets/front/js/script.js
taouraghti/association
a51ec5c6d595405ee99dd4fae0eaaa42c2b7c9e9
[ "MIT" ]
null
null
null
public/assets/front/js/script.js
taouraghti/association
a51ec5c6d595405ee99dd4fae0eaaa42c2b7c9e9
[ "MIT" ]
null
null
null
$(function(){ /*********** Start slider ***********/ var winH = $(window).height(), upperH = $('.upper-bar').innerHeight(), navH = $('.navbar').innerHeight(); $('.slider, .carousel-item').height(winH - upperH - navH); /*********** End slider *************/ /*********** Start shuffle images ************/ $(".latest-images ul li").on("click",function(){ $(this).addClass("active").siblings().removeClass("active"); if($(this).data('class') === 'all') $('.latest-images .col-sm').css('opacity',1); else { $('.latest-images .col-sm').css('opacity', .08); $($(this).data('class')).parent().css('opacity',1); } }); /*********** End shuffle images ************/ $(".nav-link").click(function(){ $('html, body').animate({ scrollTop: $( '#' + $(this).data('value')).offset().top },2000) }); $('[placeholder]').focus(function(){ $(this).attr('data',$(this).attr('placeholder')); $(this).attr('placeholder',''); }); $('[placeholder]').blur(function(){ $(this).attr('placeholder', $(this).attr('data')); }) $('input').each(function(){ if($(this).attr('required') == 'required') $(this).after('<span class="etoile">*</span>'); }); /* Show Login Or Signup form*/ $('h1 span').click(function() { $(this).addClass('selected').siblings().removeClass('selected'); $('.login-page form').hide(); $('.' + $(this).data('class')).fadeIn(100); }) //confirmation Message on Button $(".confirm").click(function(){ /*r = confirm("Are You Sure ?"); if(r == false) $(this).attr('href','members.php');*/ return confirm("Are You Sure ?"); }); $(".activate-btn").parent().parent().css('color','rgba(0,0,0,.5)'); //add item function $(".live-name").keyup(function() { $(".live-preview .card-body h5").text($(this).val()); }); $(".live-desc").keyup(function() { $(".live-preview .card-body p").text($(this).val()); }); $(".live-price").keyup(function() { $(".live-preview .price").text($(this).val()); }); /*$(".live-img").on('change',function() { console.log($(this).val()); var fileName = $(this).val().replace('C:\\fakepath\\', ""); $(".live-preview img").attr('src', fileName); });*/ $('#inputGroupFile02').on('change',function(){ //get the file name var fileName = $(this).val().replace('C:\\fakepath\\', " "); //replace the "Choose a file" label $(this).next('.custom-file-label').html(fileName); }) });
29.631579
106
0.46643
dbee51bae3be96679af79923e800bc44adfdec6b
270
js
JavaScript
src/state/action-creators/calcIsFinishedAction.js
slawekSk13/PaniKrwinka_sumator_hematologiczny
f0fad651eb21088e4a6fe5dc76b5e8d38d58905f
[ "Unlicense" ]
null
null
null
src/state/action-creators/calcIsFinishedAction.js
slawekSk13/PaniKrwinka_sumator_hematologiczny
f0fad651eb21088e4a6fe5dc76b5e8d38d58905f
[ "Unlicense" ]
null
null
null
src/state/action-creators/calcIsFinishedAction.js
slawekSk13/PaniKrwinka_sumator_hematologiczny
f0fad651eb21088e4a6fe5dc76b5e8d38d58905f
[ "Unlicense" ]
null
null
null
const setCalcFinished = () => { return (dispatch) => { dispatch({ type: "FINISHED" }); }; }; const setCalcUnFinished = () => { return (dispatch) => { dispatch({ type: "ONGOING" }); }; }; export {setCalcUnFinished, setCalcFinished}
20.769231
45
0.544444
dbefc90bd74af0f4fd0ba0fe8b858a000b5b50d9
1,508
js
JavaScript
src/components/topic/TopicMain.js
oheart/react-cnode
b92f92233294d95e9abdc55334c97b37e2e35266
[ "MIT" ]
null
null
null
src/components/topic/TopicMain.js
oheart/react-cnode
b92f92233294d95e9abdc55334c97b37e2e35266
[ "MIT" ]
null
null
null
src/components/topic/TopicMain.js
oheart/react-cnode
b92f92233294d95e9abdc55334c97b37e2e35266
[ "MIT" ]
null
null
null
import React, {Component} from 'react' import TopicDetail from './TopicDetail' import TopicReplyDetail from './TopicReplyDetail' import {withRouter} from 'react-router-dom' import Fetch from '../../utils/fetch' import Service from '../../utils/service' class TopicMain extends Component{ constructor(){ super(); this.state = { detailData: {} } } req_getTopicDetails(){ const {match} = this.props; const topicId = match.params.topicId; const url = Service.getReqUrl().topicDetail; Fetch.getRequest(url + topicId, null , (res) => { if(res.success){ this.setState({ detailData: res.data }) } },(error) => { console.log(error) }) } componentDidMount(){ this.req_getTopicDetails() } render(){ const {detailData} = this.state; //如果是空对象不进行组件渲染 if(Service.isEmptyObj(detailData)){ return null; } return ( <div className="main-part-wrapper"> <TopicDetail detailData = {detailData} /> <TopicReplyDetail detailData = {detailData} req_getTopicDetails= {(e) => this.req_getTopicDetails()} /> </div> ) } } export default withRouter(TopicMain)
27.418182
80
0.498674
dbefe2d1f5aac36ed5e8c63e45600228eb4dfe17
3,405
js
JavaScript
Source/Devices/Vessel/all_websocket.js
dolittle-casestudies/ocfev
e485ea33132eaf67a27a1dc6060a4afe7c5a14f8
[ "MIT" ]
1
2018-06-08T08:48:42.000Z
2018-06-08T08:48:42.000Z
Source/Devices/Vessel/all_websocket.js
dolittle-casestudies/ocfev
e485ea33132eaf67a27a1dc6060a4afe7c5a14f8
[ "MIT" ]
39
2018-05-16T06:57:05.000Z
2018-06-14T12:57:59.000Z
Source/Devices/Vessel/all_websocket.js
dolittle-casestudies/ocfev
e485ea33132eaf67a27a1dc6060a4afe7c5a14f8
[ "MIT" ]
2
2018-05-28T10:21:26.000Z
2021-09-15T12:00:18.000Z
var host = '104.40.203.222'; var port = 8080; var WebSocket = require('ws'); var ws = null; var connected = false; var motorAMin = 0.555; var motorBMin = 0.555; var motorRelationship = (motorAMin/motorBMin); var motorBMax = 0.7; var motorAMax = motorBMax * motorRelationship; var motorDirectionPins = [19, 25]; var motorThrottlePins = [18, 23]; var motorMinValues = [motorAMin, motorBMin]; var motorMaxValues = [motorAMax, motorBMax]; var prevMotorThrottles = [0,0]; function sendToMotor(motor, value) { motor = motor%2; digitalWrite(motorDirectionPins[motor],1); analogWrite(motorThrottlePins[motor], value, { freq : 25000 }); } function stopMotor(motor) { sendToMotor(motor,0); prevMotorThrottles[motor] = 0; } function setMotorThrottle(motor, throttle) { motor = motor%2; if( throttle > 1 ) throttle = 1; if( throttle < 0 ) throttle = 0; if( throttle === 0 ) { stopMotor(motor); return; } function calculateAndSetActualThrottle() { var min = motorMinValues[motor]; var max = motorMaxValues[motor]; var delta = max - min; var actualThrottle = (throttle * delta) + min; console.log("Setting engine "+motor+" to "+actualThrottle); prevMotorThrottles[motor] = actualThrottle; sendToMotor(motor,actualThrottle); } if( prevMotorThrottles[motor] === 0 ) { sendToMotor(motor, 0.65); setTimeout(calculateAndSetActualThrottle, 200); } else { calculateAndSetActualThrottle(); } } function connectWebSocket() { if( ws !== null ) { delete ws; ws = null; } try { ws = new WebSocket(host, { path: '/vessel/orientation', port: port, protocol: 'none', protocolVersion: 13, origin: 'Espruino', keepAlive: 60, headers: {} }); ws.on('open', function () { console.log('Connected to server'); connected = true; }); ws.on('error', function(msg) { console.log(`Error - ${msg}`); }); ws.on('message', function (msg) { if( msg != 'pong' ) { var methodCall = JSON.parse(msg); if( methodCall.method == "throttleChanged" ) { var engine = methodCall.arguments[0]; var throttle = methodCall.arguments[1]; console.log(`Throttle Changed for engine ${engine} to value ${throttle}`); setMotorThrottle(engine, throttle); } } }); } catch(ex) { connected = false; console.log('Error trying to connect - retrying in 5 seconds'); setTimeout(function() { connectWebSocket(); },5000); } } function onInit() { I2C1.setup({ scl: 22, sda: 21 }); //, bitrate: 100000}); const mpu = require("MPU6050").connect(I2C1); connectWebSocket(); setInterval(function () { if( !connected ) return; var gravity = mpu.getGravity(); var payload = { method: 'changeGravity', arguments: [ gravity[0], -gravity[1], gravity[2] ] }; try { ws.send(JSON.stringify(payload)); } catch(ex) { console.log('Failed trying to send - reconnect WebSocket in 5 seconds'); connected = false; setTimeout(function() { connectWebSocket(); }, 5000); } }, 1000); // Initialize Motor pins pinMode(19, "output", true); pinMode(18, "output", true); pinMode(23, "output", true); pinMode(25, "output", true); stopMotor(0); stopMotor(1); }
21.967742
84
0.61116
dbf03fb174d11a7c5ef184c93a3dc563438005e1
618
js
JavaScript
models/user.js
matiascoar/node-express-postgresql-sequelize
e1ec4ed911b2a0130ee5f19a9254e63d02b3812c
[ "MIT" ]
null
null
null
models/user.js
matiascoar/node-express-postgresql-sequelize
e1ec4ed911b2a0130ee5f19a9254e63d02b3812c
[ "MIT" ]
null
null
null
models/user.js
matiascoar/node-express-postgresql-sequelize
e1ec4ed911b2a0130ee5f19a9254e63d02b3812c
[ "MIT" ]
null
null
null
'use strict'; module.exports = (sequelize, DataTypes) => { const User = sequelize.define('User', { user_name: DataTypes.STRING, mail: DataTypes.STRING, is_admin: DataTypes.BOOLEAN, password: DataTypes.STRING }, {}); User.associate = function(models) { User.hasMany(models.Command, { as: 'commands', foreignKey: 'user_id' }); User.belongsToMany(models.Device, { through: 'Privilege', as: 'devices', foreignKey: 'device_id' }); /*User.hasMany(models.Device, { as: 'owned_devices', foreignKey: 'owner_id' });*/ }; return User; };
24.72
44
0.606796
dbf144deed54a78c03cfa619a20ec5d164d9f2a6
1,436
js
JavaScript
resources/js/router.js
nerdroid23/url-shortener
cc77f66f512d146c40f4bcf3978eab3f26e809f0
[ "MIT" ]
null
null
null
resources/js/router.js
nerdroid23/url-shortener
cc77f66f512d146c40f4bcf3978eab3f26e809f0
[ "MIT" ]
4
2021-02-02T21:16:05.000Z
2022-02-27T09:22:34.000Z
resources/js/router.js
nerdroid23/url-shortener
cc77f66f512d146c40f4bcf3978eab3f26e809f0
[ "MIT" ]
null
null
null
import Vue from 'vue'; import VueRouter from 'vue-router'; Vue.use(VueRouter); const routes = [ { path: '/', name: 'dashboard', component: () => import(/* webpackChunkName: "index" */ './pages/Index'), meta: { middleware: 'auth' } }, { path: '/login', name: 'login', component: () => import(/* webpackChunkName: "login" */ './pages/auth/Login'), meta: { middleware: 'guest' } }, { path: '/register', name: 'register', component: () => import(/* webpackChunkName: "register" */ './pages/auth/Register'), meta: { middleware: 'guest' } }, { path: '/password/email', name: 'forgot-password', component: () => import(/* webpackChunkName: "forgot-password" */ './pages/auth/ForgotPassword'), meta: { middleware: 'guest' } }, { path: '/password/reset', name: 'reset-password', component: () => import(/* webpackChunkName: "reset-password" */ './pages/auth/ResetPassword'), meta: { middleware: 'guest' } }, ]; const router = new VueRouter({ mode: 'history', routes }) router.beforeEach((to, from, next) => { const middleware = to.meta.middleware; if (!window.loggedIn && middleware === 'auth') { next({ name: 'login' }); return; } if (window.loggedIn && middleware === 'guest') { next({ name: 'dashboard' }); return; } next(); }); export default router;
20.225352
101
0.557799
dbf1505501bad86bd8c8f55b0f0796e5231e14cd
1,960
js
JavaScript
data/test/js/dbf1505501bad86bd8c8f55b0f0796e5231e14cdnav_controller.js
aliostad/deep-learning-lang-detection
d6b031f3ebc690cf2ffd0ae1b08ffa8fb3b38a62
[ "MIT" ]
84
2017-10-25T15:49:21.000Z
2021-11-28T21:25:54.000Z
data/test/js/dbf1505501bad86bd8c8f55b0f0796e5231e14cdnav_controller.js
vassalos/deep-learning-lang-detection
cbb00b3e81bed3a64553f9c6aa6138b2511e544e
[ "MIT" ]
5
2018-03-29T11:50:46.000Z
2021-04-26T13:33:18.000Z
data/test/js/dbf1505501bad86bd8c8f55b0f0796e5231e14cdnav_controller.js
vassalos/deep-learning-lang-detection
cbb00b3e81bed3a64553f9c6aa6138b2511e544e
[ "MIT" ]
24
2017-11-22T08:31:00.000Z
2022-03-27T01:22:31.000Z
PortfolioApp.controller('NavController', NavController); NavController.$inject = ['$http']; function NavController($http) { var nav = this; nav.toggle = false; nav.whichNav = ''; nav.theFunction = "nav.scrollJavaScript()"; nav.secondNav = { 'projects' : ['JAVA', 'RUBY', 'JAVASCIPT'], 'background' : ['EDUCATION', 'TEACHING', 'BUSINESS DEV', 'WEB DEV'] } nav.menuVanish = function(){ nav.toggle = false }; nav.home = function(){ $('.nav-text-main').css({'color': '#173e43'}); }; nav.reset = function(){ $('.nav-text-main').css({'color': '#173e43'}); nav.toggle = false; }; nav.contact = function(){ $('.nav-text-main').css({'color': '#173e43'}); $('#contact').css({'color': '#999999'}); nav.toggle = false; }; nav.projects = function(){ $('.nav-text-main').css({'color': '#173e43'}); $('#projects').css({'color': '#999999'}); nav.toggle = true; nav.whichNav = 'projects'; }; nav.background = function(){ $('.nav-text-main').css({'color': '#173e43'}); $('#background').css({'color': '#999999'}); nav.toggle = true; nav.whichNav = 'background'; }; nav.scroll = function(itemName){ window.setTimeout( function(){ if(itemName == "JAVASCIPT"){ var $target = $("#javascript-breaker"); } else if(itemName == "RUBY"){ var $target = $("#ruby-breaker"); } else if(itemName == "JAVA"){ var $target = $("#java-breaker"); } else if(itemName == "WEB DEV"){ var $target = $("#web-breaker"); } else if(itemName == "TEACHING"){ var $target = $("#teaching-breaker"); } else if(itemName == "BUSINESS DEV"){ var $target = $("#bussiness-breaker"); } else if(itemName == "EDUCATION"){ var $target = $("#education-breaker"); } $("body").animate({scrollTop: $target.offset().top}, "slow"); }, 400); } }
28.405797
71
0.535714
dbf1898a015485164cf6312b60563f62b8919d74
3,707
js
JavaScript
sapui5-sdk-1.74.0/resources/sap/zen/crosstab/DataCell.js
juanfelipe82193/opensap
568c01843a07b8a1be88f8fb8ccb49845fb8110e
[ "Apache-2.0" ]
null
null
null
sapui5-sdk-1.74.0/resources/sap/zen/crosstab/DataCell.js
juanfelipe82193/opensap
568c01843a07b8a1be88f8fb8ccb49845fb8110e
[ "Apache-2.0" ]
null
null
null
sapui5-sdk-1.74.0/resources/sap/zen/crosstab/DataCell.js
juanfelipe82193/opensap
568c01843a07b8a1be88f8fb8ccb49845fb8110e
[ "Apache-2.0" ]
null
null
null
/*! * (c) Copyright 2010-2019 SAP SE or an SAP affiliate company. */ jQuery.sap.declare("sap.zen.crosstab.DataCell");jQuery.sap.require("sap.zen.crosstab.library");jQuery.sap.require("sap.ui.core.Control");sap.ui.core.Control.extend("sap.zen.crosstab.DataCell",{metadata:{library:"sap.zen.crosstab",properties:{text:{type:"string",group:"Misc",defaultValue:null},area:{type:"object",group:"Misc",defaultValue:null},row:{type:"int",group:"Misc",defaultValue:null},col:{type:"int",group:"Misc",defaultValue:null},tableRow:{type:"int",group:"Misc",defaultValue:null},tableCol:{type:"int",group:"Misc",defaultValue:null}}}});jQuery.sap.require("sap.zen.crosstab.CellStyleHandler");jQuery.sap.require("sap.zen.crosstab.rendering.RenderingConstants");jQuery.sap.require("sap.zen.crosstab.utils.Utils"); sap.zen.crosstab.DataCell.prototype.init=function(){"use strict";this.aStyles=[];this.bLoading=false;this.bIsEntryEnabled=false;this.sUnit="";this.sPassiveCellType=sap.zen.crosstab.rendering.RenderingConstants.PASSIVE_CELL_TYPE_NORMAL;this.iNumberOfLineBreaks=0;}; sap.zen.crosstab.DataCell.prototype.getCellType=function(){return sap.zen.crosstab.rendering.RenderingConstants.TYPE_DATA_CELL;}; sap.zen.crosstab.DataCell.prototype.isHeaderCell=function(){return false;}; sap.zen.crosstab.DataCell.prototype.getCssClassNames=function(i,I,b){return sap.zen.crosstab.CellStyleHandler.getCssClasses(this.aStyles,i,I,b);}; sap.zen.crosstab.DataCell.prototype.getStyleIdList=function(){return this.aStyles;}; sap.zen.crosstab.DataCell.prototype.setStyleIdList=function(n){this.aStyles=n;}; sap.zen.crosstab.DataCell.prototype.addStyle=function(s){var S=sap.zen.crosstab.CellStyleHandler.getStyleId(s,sap.zen.crosstab.rendering.RenderingConstants.TYPE_DATA_CELL);if(this.aStyles.indexOf(S)===-1){this.aStyles.push(S);}}; sap.zen.crosstab.DataCell.prototype.removeStyle=function(s){var S=sap.zen.crosstab.CellStyleHandler.getStyleId(s,sap.zen.crosstab.rendering.RenderingConstants.TYPE_DATA_CELL);var i=this.aStyles.indexOf(S);if(i!==-1){this.aStyles.splice(i,1);}}; sap.zen.crosstab.DataCell.prototype.hasStyle=function(s){var S=sap.zen.crosstab.CellStyleHandler.getStyleId(s,sap.zen.crosstab.rendering.RenderingConstants.TYPE_DATA_CELL);var i=this.aStyles.indexOf(S);if(i===-1){return false;}else{return true;}}; sap.zen.crosstab.DataCell.prototype.getColSpan=function(){return 1;}; sap.zen.crosstab.DataCell.prototype.getRowSpan=function(){return 1;}; sap.zen.crosstab.DataCell.prototype.getEffectiveColSpan=function(){return 1;}; sap.zen.crosstab.DataCell.prototype.getEffectiveRowSpan=function(){return 1;}; sap.zen.crosstab.DataCell.prototype.isLoading=function(){return this.bLoading;}; sap.zen.crosstab.DataCell.prototype.setLoading=function(l){this.bLoading=l;}; sap.zen.crosstab.DataCell.prototype.isSelectable=function(){return false;}; sap.zen.crosstab.DataCell.prototype.getUnescapedText=function(){return sap.zen.crosstab.utils.Utils.unEscapeDisplayString(this.getText());}; sap.zen.crosstab.DataCell.prototype.setEntryEnabled=function(i){this.bIsEntryEnabled=i;}; sap.zen.crosstab.DataCell.prototype.isEntryEnabled=function(){return this.bIsEntryEnabled;}; sap.zen.crosstab.DataCell.prototype.setUnit=function(u){this.sUnit=u;}; sap.zen.crosstab.DataCell.prototype.getUnit=function(){return this.sUnit;}; sap.zen.crosstab.DataCell.prototype.getPassiveCellType=function(){return this.sPassiveCellType;}; sap.zen.crosstab.DataCell.prototype.setPassiveCellType=function(p){this.sPassiveCellType=p;}; sap.zen.crosstab.DataCell.prototype.setNumberOfLineBreaks=function(n){this.iNumberOfLineBreaks=n;}; sap.zen.crosstab.DataCell.prototype.getNumberOfLineBreaks=function(){return this.iNumberOfLineBreaks;};
123.566667
727
0.80901
dbf1918b5b8b6c3fe3be2df0c3c5cc466a0251e2
5,253
js
JavaScript
ex-member/jack/mkSnakeGame/mkSnakeGame.js
honux77/level1-js
61a615e1984714750c0cb57b82250d822cd25e2e
[ "MIT" ]
8
2017-11-06T01:41:31.000Z
2019-11-13T04:49:48.000Z
ex-member/jack/mkSnakeGame/mkSnakeGame.js
honux77/level1-js
61a615e1984714750c0cb57b82250d822cd25e2e
[ "MIT" ]
19
2017-11-03T06:48:35.000Z
2017-12-21T02:52:44.000Z
jack/mkSnakeGame/mkSnakeGame.js
code-squad/level1-js
cd2b0523f6507ac2059cc10dd473de55974bb28a
[ "MIT" ]
19
2017-11-03T06:02:18.000Z
2017-12-29T05:18:51.000Z
var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); //canvas end var h = document.getElementById("h1"); h.innerHTML = "Snake patterned CodeSquad Game"; var btn = document.getElementById("btn"); btn.innerHTML = "REPLAY!"; var score = document.getElementById("score"); var dpscore = ""; score.innerHTML = "Current sentence"; var sentence = document.getElementById("sentence"); sentence.innerHTML = "CODE" + dpscore; function drawBoarder () { ctx.fillStyle = "lightgreen"; ctx.fillRect(0, 0, 400, 10); // ctx.fillRect(0, 390, 400, 10); ctx.fillRect(0, 0, 10, 400); ctx.fillRect(390, 0, 10, 400); } //display end function gameOver() { clearInterval(x); } function replay() { location.reload(); } //gameover end var Block = function(col, row) { this.col = col; this.row = row; }; var dpsentence = ["S","Q","U","A","D ","M","A","S","T","E","R ","& ","M","E","M","B","E", "R ","F","I","G","H","T","I","N","G!"]; Block.prototype.drawSquare = function (i) { var x = this.col * 10; var y = this.row * 10; var arr1 = ["C","O","D","E","S","Q","U","A","D"]; var arr2 = ["M","A","S","T","E","R","&","M","E","M","B","E","R"]; var arr3 = ["F","I","G","H","T","I","N","G"]; if (i < 9) { ctx.font = "13px Verdana"; ctx.fillStyle = "blue"; ctx.fillText(arr1[i], x, y); } else if (i >= 9 && i < 22) { ctx.font = "13px Verdana"; ctx.fillStyle = "purple"; ctx.fillText(arr2[i - 9], x, y); } else { if (i === 29) { ctx.font="13px Verdana"; ctx.fillStyle = "red"; ctx.fillText(arr3[i - 22], x, y); gameOver(); score.innerHTML = "FINISH!!"; sentence.innerHTML = "CodeSquad Master & Member Fighting!"; return; } ctx.font="13px Verdana"; ctx.fillStyle = "red"; ctx.fillText(arr3[i - 22], x, y); } }; Block.prototype.equal = function(otherBlock) { return this.col === otherBlock.col && this.row === otherBlock.row; }; Block.prototype.drawFood = function(color) { var x1 = this.col * 10; var y1 = this.row * 10 - 10; ctx.fillStyle = color; ctx.fillRect(x1, y1, 10, 10); }; //block end var snake = { segments : [new Block(7,5), new Block(6,5), new Block(5,5), new Block(4,5)], direction : "right", nextDirection : "right", color: "blue", draw : function() { for (var i = 0; i < this.segments.length; i++) { this.segments[i].drawSquare(i); } }, move : function() { var head = this.segments[0]; var newHead; this.direction = this.nextDirection; if (this.direction === "right") { newHead = new Block(head.col + 1, head.row); } else if (this.direction === "left") { newHead = new Block(head.col - 1, head.row); } else if (this.direction === "up") { newHead = new Block(head.col, head.row - 1); } else if (this.direction === "down") { newHead = new Block(head.col, head.row + 1); } if(this.checkCollision(newHead)) { gameOver(); return; } this.segments.unshift(newHead); if(newHead.equal(coffee.position)) { coffee.move(); dpscore += dpsentence[0]; dpsentence.shift(); sentence.innerHTML = "CODE" + dpscore; } else { this.segments.pop(); } }, checkCollision: function(head) { var leftCollision = (head.col === 0); var topCollision = (head.row === 0 + 1); var rightCollision = (head.col === 40 - 1); var bottomCollision = (head.row === 40); var wallCollision = leftCollision || topCollision || rightCollision || bottomCollision; var selfCollision = false; for (var i = 0; i < this.segments.length; i++) { if (head.equal(this.segments[i])) { selfCollision = true; } } return wallCollision || selfCollision; }, setDirection : function(newDirection) { if (this.direction === "up" && newDirection === "down") { return; } else if (this.direction === "right" && newDirection === "left") { return; } else if (this.direction === "down" && newDirection === "up") { return; } else if (this.direction === "left" && newDirection === "right") { return; } this.nextDirection = newDirection; } }; //snake end var coffee = { position : new Block(10,10), move : function() { var rx = Math.floor(Math.random() * 37) + 2; var ry = Math.floor(Math.random() * 38) + 2; this.position = new Block(rx, ry); }, draw : function() { this.position.drawFood("Green"); } }; //coffee end var directions = { 37 : "left", 38 : "up", 39 : "right", 40 : "down" }; var isKeyDown = []; window.addEventListener("keydown",onKeyDown,false); window.addEventListener("keyup",onKeyUp,false); function onKeyDown(e){ var newDirection = directions[e.keyCode]; if(newDirection !== undefined) { snake.setDirection(newDirection); } } function onKeyUp(e){ isKeyDown[e.keyCode] = false; } //keyboard end //main start var drawAll = function() { ctx.clearRect(0,0,400,400); snake.move(); snake.draw(); coffee.draw(); drawBoarder(); }; var x = setInterval(drawAll, 90); //main end
27.941489
93
0.565962
dbf3774f36758bdfe8466d6a5d3cf3fe3e0e866e
2,165
js
JavaScript
extensions/init-workspace-1.0.7/out/utils.js
guopingbo/TestFirstRepo
608df9352cf24b3a016f28f94d98c4c4bc040700
[ "Apache-2.0" ]
null
null
null
extensions/init-workspace-1.0.7/out/utils.js
guopingbo/TestFirstRepo
608df9352cf24b3a016f28f94d98c4c4bc040700
[ "Apache-2.0" ]
1
2019-08-15T12:42:31.000Z
2019-08-15T12:43:11.000Z
extensions/init-workspace-1.0.7/out/utils.js
guopingbo/TestFirstRepo
608df9352cf24b3a016f28f94d98c4c4bc040700
[ "Apache-2.0" ]
null
null
null
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const vscode = require("vscode"); const fs = require("fs"); const path = require("path"); exports.getWorkspaceRootPath = () => { const workspace = vscode.workspace.workspaceFolders; return workspace && workspace.length > 0 ? workspace[0].uri.path : ""; }; exports.sleep = (time) => { return new Promise(res => { setTimeout(() => { res(); }, time); }); }; // 触发预览插件自动检测 yml 文件 exports.launchPreviewDerectionYml = (retry = 0) => __awaiter(this, void 0, void 0, function* () { const exec = (count) => __awaiter(this, void 0, void 0, function* () { if (count < 0) return; const allCommands = yield vscode.commands.getCommands(true); const previewCommand = "preview.derectionYml"; if (allCommands.some(e => e === previewCommand)) { vscode.commands.executeCommand(previewCommand); } else { yield exports.sleep(1000); exec(count - 1); } }); exec(retry); }); exports.removeDir = (dir) => { let files = fs.readdirSync(dir); for (var i = 0; i < files.length; i++) { let newPath = path.join(dir, files[i]); let stat = fs.statSync(newPath); if (stat.isDirectory()) { //如果是文件夹就递归下去 exports.removeDir(newPath); } else { //删除文件 fs.unlinkSync(newPath); } } fs.rmdirSync(dir); //如果文件夹是空的,就将自己删除掉 }; //# sourceMappingURL=utils.js.map
37.327586
151
0.581986
dbf50449186b5a4e1aaad44a1376d0f9b75ffeed
647,715
js
JavaScript
worker.js
Bizboard/SPSoapAdapter
16a2ad11b81b0c7ef28f95cfd63967dbde901637
[ "MIT" ]
null
null
null
worker.js
Bizboard/SPSoapAdapter
16a2ad11b81b0c7ef28f95cfd63967dbde901637
[ "MIT" ]
null
null
null
worker.js
Bizboard/SPSoapAdapter
16a2ad11b81b0c7ef28f95cfd63967dbde901637
[ "MIT" ]
null
null
null
(function(){ var curSystem = typeof System != 'undefined' ? System : undefined; /* */ "format global"; "exports $traceurRuntime"; (function(global) { 'use strict'; if (global.$traceurRuntime) { return; } var $Object = Object; var $TypeError = TypeError; var $create = $Object.create; var $defineProperties = $Object.defineProperties; var $defineProperty = $Object.defineProperty; var $freeze = $Object.freeze; var $getOwnPropertyDescriptor = $Object.getOwnPropertyDescriptor; var $getOwnPropertyNames = $Object.getOwnPropertyNames; var $keys = $Object.keys; var $hasOwnProperty = $Object.prototype.hasOwnProperty; var $toString = $Object.prototype.toString; var $preventExtensions = Object.preventExtensions; var $seal = Object.seal; var $isExtensible = Object.isExtensible; var $apply = Function.prototype.call.bind(Function.prototype.apply); function $bind(operand, thisArg, args) { var argArray = [thisArg]; for (var i = 0; i < args.length; i++) { argArray[i + 1] = args[i]; } var func = $apply(Function.prototype.bind, operand, argArray); return func; } function $construct(func, argArray) { var object = new ($bind(func, null, argArray)); return object; } var counter = 0; function newUniqueString() { return '__$' + Math.floor(Math.random() * 1e9) + '$' + ++counter + '$__'; } var privateNames = $create(null); function isPrivateName(s) { return privateNames[s]; } function createPrivateName() { var s = newUniqueString(); privateNames[s] = true; return s; } var CONTINUATION_TYPE = Object.create(null); function createContinuation(operand, thisArg, argsArray) { return [CONTINUATION_TYPE, operand, thisArg, argsArray]; } function isContinuation(object) { return object && object[0] === CONTINUATION_TYPE; } var isTailRecursiveName = null; function setupProperTailCalls() { isTailRecursiveName = createPrivateName(); Function.prototype.call = initTailRecursiveFunction(function call(thisArg) { var result = tailCall(function(thisArg) { var argArray = []; for (var i = 1; i < arguments.length; ++i) { argArray[i - 1] = arguments[i]; } var continuation = createContinuation(this, thisArg, argArray); return continuation; }, this, arguments); return result; }); Function.prototype.apply = initTailRecursiveFunction(function apply(thisArg, argArray) { var result = tailCall(function(thisArg, argArray) { var continuation = createContinuation(this, thisArg, argArray); return continuation; }, this, arguments); return result; }); } function initTailRecursiveFunction(func) { if (isTailRecursiveName === null) { setupProperTailCalls(); } func[isTailRecursiveName] = true; return func; } function isTailRecursive(func) { return !!func[isTailRecursiveName]; } function tailCall(func, thisArg, argArray) { var continuation = argArray[0]; if (isContinuation(continuation)) { continuation = $apply(func, thisArg, continuation[3]); return continuation; } continuation = createContinuation(func, thisArg, argArray); while (true) { if (isTailRecursive(func)) { continuation = $apply(func, continuation[2], [continuation]); } else { continuation = $apply(func, continuation[2], continuation[3]); } if (!isContinuation(continuation)) { return continuation; } func = continuation[1]; } } function construct() { var object; if (isTailRecursive(this)) { object = $construct(this, [createContinuation(null, null, arguments)]); } else { object = $construct(this, arguments); } return object; } var $traceurRuntime = { initTailRecursiveFunction: initTailRecursiveFunction, call: tailCall, continuation: createContinuation, construct: construct }; (function() { function nonEnum(value) { return { configurable: true, enumerable: false, value: value, writable: true }; } var method = nonEnum; var symbolInternalProperty = newUniqueString(); var symbolDescriptionProperty = newUniqueString(); var symbolDataProperty = newUniqueString(); var symbolValues = $create(null); function isShimSymbol(symbol) { return typeof symbol === 'object' && symbol instanceof SymbolValue; } function typeOf(v) { if (isShimSymbol(v)) return 'symbol'; return typeof v; } function Symbol(description) { var value = new SymbolValue(description); if (!(this instanceof Symbol)) return value; throw new TypeError('Symbol cannot be new\'ed'); } $defineProperty(Symbol.prototype, 'constructor', nonEnum(Symbol)); $defineProperty(Symbol.prototype, 'toString', method(function() { var symbolValue = this[symbolDataProperty]; return symbolValue[symbolInternalProperty]; })); $defineProperty(Symbol.prototype, 'valueOf', method(function() { var symbolValue = this[symbolDataProperty]; if (!symbolValue) throw TypeError('Conversion from symbol to string'); if (!getOption('symbols')) return symbolValue[symbolInternalProperty]; return symbolValue; })); function SymbolValue(description) { var key = newUniqueString(); $defineProperty(this, symbolDataProperty, {value: this}); $defineProperty(this, symbolInternalProperty, {value: key}); $defineProperty(this, symbolDescriptionProperty, {value: description}); freeze(this); symbolValues[key] = this; } $defineProperty(SymbolValue.prototype, 'constructor', nonEnum(Symbol)); $defineProperty(SymbolValue.prototype, 'toString', { value: Symbol.prototype.toString, enumerable: false }); $defineProperty(SymbolValue.prototype, 'valueOf', { value: Symbol.prototype.valueOf, enumerable: false }); var hashProperty = createPrivateName(); var hashPropertyDescriptor = {value: undefined}; var hashObjectProperties = { hash: {value: undefined}, self: {value: undefined} }; var hashCounter = 0; function getOwnHashObject(object) { var hashObject = object[hashProperty]; if (hashObject && hashObject.self === object) return hashObject; if ($isExtensible(object)) { hashObjectProperties.hash.value = hashCounter++; hashObjectProperties.self.value = object; hashPropertyDescriptor.value = $create(null, hashObjectProperties); $defineProperty(object, hashProperty, hashPropertyDescriptor); return hashPropertyDescriptor.value; } return undefined; } function freeze(object) { getOwnHashObject(object); return $freeze.apply(this, arguments); } function preventExtensions(object) { getOwnHashObject(object); return $preventExtensions.apply(this, arguments); } function seal(object) { getOwnHashObject(object); return $seal.apply(this, arguments); } freeze(SymbolValue.prototype); function isSymbolString(s) { return symbolValues[s] || privateNames[s]; } function toProperty(name) { if (isShimSymbol(name)) return name[symbolInternalProperty]; return name; } function removeSymbolKeys(array) { var rv = []; for (var i = 0; i < array.length; i++) { if (!isSymbolString(array[i])) { rv.push(array[i]); } } return rv; } function getOwnPropertyNames(object) { return removeSymbolKeys($getOwnPropertyNames(object)); } function keys(object) { return removeSymbolKeys($keys(object)); } function getOwnPropertySymbols(object) { var rv = []; var names = $getOwnPropertyNames(object); for (var i = 0; i < names.length; i++) { var symbol = symbolValues[names[i]]; if (symbol) { rv.push(symbol); } } return rv; } function getOwnPropertyDescriptor(object, name) { return $getOwnPropertyDescriptor(object, toProperty(name)); } function hasOwnProperty(name) { return $hasOwnProperty.call(this, toProperty(name)); } function getOption(name) { return global.$traceurRuntime.options[name]; } function defineProperty(object, name, descriptor) { if (isShimSymbol(name)) { name = name[symbolInternalProperty]; } $defineProperty(object, name, descriptor); return object; } function polyfillObject(Object) { $defineProperty(Object, 'defineProperty', {value: defineProperty}); $defineProperty(Object, 'getOwnPropertyNames', {value: getOwnPropertyNames}); $defineProperty(Object, 'getOwnPropertyDescriptor', {value: getOwnPropertyDescriptor}); $defineProperty(Object.prototype, 'hasOwnProperty', {value: hasOwnProperty}); $defineProperty(Object, 'freeze', {value: freeze}); $defineProperty(Object, 'preventExtensions', {value: preventExtensions}); $defineProperty(Object, 'seal', {value: seal}); $defineProperty(Object, 'keys', {value: keys}); } function exportStar(object) { for (var i = 1; i < arguments.length; i++) { var names = $getOwnPropertyNames(arguments[i]); for (var j = 0; j < names.length; j++) { var name = names[j]; if (name === '__esModule' || name === 'default' || isSymbolString(name)) continue; (function(mod, name) { $defineProperty(object, name, { get: function() { return mod[name]; }, enumerable: true }); })(arguments[i], names[j]); } } return object; } function isObject(x) { return x != null && (typeof x === 'object' || typeof x === 'function'); } function toObject(x) { if (x == null) throw $TypeError(); return $Object(x); } function checkObjectCoercible(argument) { if (argument == null) { throw new TypeError('Value cannot be converted to an Object'); } return argument; } var hasNativeSymbol; function polyfillSymbol(global, Symbol) { if (!global.Symbol) { global.Symbol = Symbol; Object.getOwnPropertySymbols = getOwnPropertySymbols; hasNativeSymbol = false; } else { hasNativeSymbol = true; } if (!global.Symbol.iterator) { global.Symbol.iterator = Symbol('Symbol.iterator'); } if (!global.Symbol.observer) { global.Symbol.observer = Symbol('Symbol.observer'); } } function hasNativeSymbolFunc() { return hasNativeSymbol; } function setupGlobals(global) { polyfillSymbol(global, Symbol); global.Reflect = global.Reflect || {}; global.Reflect.global = global.Reflect.global || global; polyfillObject(global.Object); } setupGlobals(global); global.$traceurRuntime = { call: tailCall, checkObjectCoercible: checkObjectCoercible, construct: construct, continuation: createContinuation, createPrivateName: createPrivateName, defineProperties: $defineProperties, defineProperty: $defineProperty, exportStar: exportStar, getOwnHashObject: getOwnHashObject, getOwnPropertyDescriptor: $getOwnPropertyDescriptor, getOwnPropertyNames: $getOwnPropertyNames, hasNativeSymbol: hasNativeSymbolFunc, initTailRecursiveFunction: initTailRecursiveFunction, isObject: isObject, isPrivateName: isPrivateName, isSymbolString: isSymbolString, keys: $keys, options: {}, setupGlobals: setupGlobals, toObject: toObject, toProperty: toProperty, typeof: typeOf }; })(); })(typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this); (function() { function buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) { var out = []; if (opt_scheme) { out.push(opt_scheme, ':'); } if (opt_domain) { out.push('//'); if (opt_userInfo) { out.push(opt_userInfo, '@'); } out.push(opt_domain); if (opt_port) { out.push(':', opt_port); } } if (opt_path) { out.push(opt_path); } if (opt_queryData) { out.push('?', opt_queryData); } if (opt_fragment) { out.push('#', opt_fragment); } return out.join(''); } ; var splitRe = new RegExp('^' + '(?:' + '([^:/?#.]+)' + ':)?' + '(?://' + '(?:([^/?#]*)@)?' + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + '(?::([0-9]+))?' + ')?' + '([^?#]+)?' + '(?:\\?([^#]*))?' + '(?:#(.*))?' + '$'); var ComponentIndex = { SCHEME: 1, USER_INFO: 2, DOMAIN: 3, PORT: 4, PATH: 5, QUERY_DATA: 6, FRAGMENT: 7 }; function split(uri) { return (uri.match(splitRe)); } function removeDotSegments(path) { if (path === '/') return '/'; var leadingSlash = path[0] === '/' ? '/' : ''; var trailingSlash = path.slice(-1) === '/' ? '/' : ''; var segments = path.split('/'); var out = []; var up = 0; for (var pos = 0; pos < segments.length; pos++) { var segment = segments[pos]; switch (segment) { case '': case '.': break; case '..': if (out.length) out.pop(); else up++; break; default: out.push(segment); } } if (!leadingSlash) { while (up-- > 0) { out.unshift('..'); } if (out.length === 0) out.push('.'); } return leadingSlash + out.join('/') + trailingSlash; } function joinAndCanonicalizePath(parts) { var path = parts[ComponentIndex.PATH] || ''; path = removeDotSegments(path); parts[ComponentIndex.PATH] = path; return buildFromEncodedParts(parts[ComponentIndex.SCHEME], parts[ComponentIndex.USER_INFO], parts[ComponentIndex.DOMAIN], parts[ComponentIndex.PORT], parts[ComponentIndex.PATH], parts[ComponentIndex.QUERY_DATA], parts[ComponentIndex.FRAGMENT]); } function canonicalizeUrl(url) { var parts = split(url); return joinAndCanonicalizePath(parts); } function resolveUrl(base, url) { var parts = split(url); var baseParts = split(base); if (parts[ComponentIndex.SCHEME]) { return joinAndCanonicalizePath(parts); } else { parts[ComponentIndex.SCHEME] = baseParts[ComponentIndex.SCHEME]; } for (var i = ComponentIndex.SCHEME; i <= ComponentIndex.PORT; i++) { if (!parts[i]) { parts[i] = baseParts[i]; } } if (parts[ComponentIndex.PATH][0] == '/') { return joinAndCanonicalizePath(parts); } var path = baseParts[ComponentIndex.PATH]; var index = path.lastIndexOf('/'); path = path.slice(0, index + 1) + parts[ComponentIndex.PATH]; parts[ComponentIndex.PATH] = path; return joinAndCanonicalizePath(parts); } function isAbsolute(name) { if (!name) return false; if (name[0] === '/') return true; var parts = split(name); if (parts[ComponentIndex.SCHEME]) return true; return false; } $traceurRuntime.canonicalizeUrl = canonicalizeUrl; $traceurRuntime.isAbsolute = isAbsolute; $traceurRuntime.removeDotSegments = removeDotSegments; $traceurRuntime.resolveUrl = resolveUrl; })(); (function(global) { 'use strict'; var $__1 = $traceurRuntime, canonicalizeUrl = $__1.canonicalizeUrl, resolveUrl = $__1.resolveUrl, isAbsolute = $__1.isAbsolute; var moduleInstantiators = Object.create(null); var baseURL; if (global.location && global.location.href) baseURL = resolveUrl(global.location.href, './'); else baseURL = ''; function UncoatedModuleEntry(url, uncoatedModule) { this.url = url; this.value_ = uncoatedModule; } function ModuleEvaluationError(erroneousModuleName, cause) { this.message = this.constructor.name + ': ' + this.stripCause(cause) + ' in ' + erroneousModuleName; if (!(cause instanceof ModuleEvaluationError) && cause.stack) this.stack = this.stripStack(cause.stack); else this.stack = ''; } ModuleEvaluationError.prototype = Object.create(Error.prototype); ModuleEvaluationError.prototype.constructor = ModuleEvaluationError; ModuleEvaluationError.prototype.stripError = function(message) { return message.replace(/.*Error:/, this.constructor.name + ':'); }; ModuleEvaluationError.prototype.stripCause = function(cause) { if (!cause) return ''; if (!cause.message) return cause + ''; return this.stripError(cause.message); }; ModuleEvaluationError.prototype.loadedBy = function(moduleName) { this.stack += '\n loaded by ' + moduleName; }; ModuleEvaluationError.prototype.stripStack = function(causeStack) { var stack = []; causeStack.split('\n').some(function(frame) { if (/UncoatedModuleInstantiator/.test(frame)) return true; stack.push(frame); }); stack[0] = this.stripError(stack[0]); return stack.join('\n'); }; function beforeLines(lines, number) { var result = []; var first = number - 3; if (first < 0) first = 0; for (var i = first; i < number; i++) { result.push(lines[i]); } return result; } function afterLines(lines, number) { var last = number + 1; if (last > lines.length - 1) last = lines.length - 1; var result = []; for (var i = number; i <= last; i++) { result.push(lines[i]); } return result; } function columnSpacing(columns) { var result = ''; for (var i = 0; i < columns - 1; i++) { result += '-'; } return result; } function UncoatedModuleInstantiator(url, func) { UncoatedModuleEntry.call(this, url, null); this.func = func; } UncoatedModuleInstantiator.prototype = Object.create(UncoatedModuleEntry.prototype); UncoatedModuleInstantiator.prototype.getUncoatedModule = function() { var $__0 = this; if (this.value_) return this.value_; try { var relativeRequire; if (typeof $traceurRuntime !== undefined && $traceurRuntime.require) { relativeRequire = $traceurRuntime.require.bind(null, this.url); } return this.value_ = this.func.call(global, relativeRequire); } catch (ex) { if (ex instanceof ModuleEvaluationError) { ex.loadedBy(this.url); throw ex; } if (ex.stack) { var lines = this.func.toString().split('\n'); var evaled = []; ex.stack.split('\n').some(function(frame, index) { if (frame.indexOf('UncoatedModuleInstantiator.getUncoatedModule') > 0) return true; var m = /(at\s[^\s]*\s).*>:(\d*):(\d*)\)/.exec(frame); if (m) { var line = parseInt(m[2], 10); evaled = evaled.concat(beforeLines(lines, line)); if (index === 1) { evaled.push(columnSpacing(m[3]) + '^ ' + $__0.url); } else { evaled.push(columnSpacing(m[3]) + '^'); } evaled = evaled.concat(afterLines(lines, line)); evaled.push('= = = = = = = = ='); } else { evaled.push(frame); } }); ex.stack = evaled.join('\n'); } throw new ModuleEvaluationError(this.url, ex); } }; function getUncoatedModuleInstantiator(name) { if (!name) return; var url = ModuleStore.normalize(name); return moduleInstantiators[url]; } ; var moduleInstances = Object.create(null); var liveModuleSentinel = {}; function Module(uncoatedModule) { var isLive = arguments[1]; var coatedModule = Object.create(null); Object.getOwnPropertyNames(uncoatedModule).forEach(function(name) { var getter, value; if (isLive === liveModuleSentinel) { var descr = Object.getOwnPropertyDescriptor(uncoatedModule, name); if (descr.get) getter = descr.get; } if (!getter) { value = uncoatedModule[name]; getter = function() { return value; }; } Object.defineProperty(coatedModule, name, { get: getter, enumerable: true }); }); Object.preventExtensions(coatedModule); return coatedModule; } var ModuleStore = { normalize: function(name, refererName, refererAddress) { if (typeof name !== 'string') throw new TypeError('module name must be a string, not ' + typeof name); if (isAbsolute(name)) return canonicalizeUrl(name); if (/[^\.]\/\.\.\//.test(name)) { throw new Error('module name embeds /../: ' + name); } if (name[0] === '.' && refererName) return resolveUrl(refererName, name); return canonicalizeUrl(name); }, get: function(normalizedName) { var m = getUncoatedModuleInstantiator(normalizedName); if (!m) return undefined; var moduleInstance = moduleInstances[m.url]; if (moduleInstance) return moduleInstance; moduleInstance = Module(m.getUncoatedModule(), liveModuleSentinel); return moduleInstances[m.url] = moduleInstance; }, set: function(normalizedName, module) { normalizedName = String(normalizedName); moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, function() { return module; }); moduleInstances[normalizedName] = module; }, get baseURL() { return baseURL; }, set baseURL(v) { baseURL = String(v); }, registerModule: function(name, deps, func) { var normalizedName = ModuleStore.normalize(name); if (moduleInstantiators[normalizedName]) throw new Error('duplicate module named ' + normalizedName); moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, func); }, bundleStore: Object.create(null), register: function(name, deps, func) { if (!deps || !deps.length && !func.length) { this.registerModule(name, deps, func); } else { this.bundleStore[name] = { deps: deps, execute: function() { var $__0 = arguments; var depMap = {}; deps.forEach(function(dep, index) { return depMap[dep] = $__0[index]; }); var registryEntry = func.call(this, depMap); registryEntry.execute.call(this); return registryEntry.exports; } }; } }, getAnonymousModule: function(func) { return new Module(func.call(global), liveModuleSentinel); } }; var moduleStoreModule = new Module({ModuleStore: ModuleStore}); ModuleStore.set('@traceur/src/runtime/ModuleStore.js', moduleStoreModule); var setupGlobals = $traceurRuntime.setupGlobals; $traceurRuntime.setupGlobals = function(global) { setupGlobals(global); }; $traceurRuntime.ModuleStore = ModuleStore; global.System = { register: ModuleStore.register.bind(ModuleStore), registerModule: ModuleStore.registerModule.bind(ModuleStore), get: ModuleStore.get, set: ModuleStore.set, normalize: ModuleStore.normalize }; })(typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this); System.registerModule("traceur-runtime@0.0.90/src/runtime/async.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/async.js"; if (typeof $traceurRuntime !== 'object') { throw new Error('traceur runtime not found.'); } var $createPrivateName = $traceurRuntime.createPrivateName; var $defineProperty = $traceurRuntime.defineProperty; var $defineProperties = $traceurRuntime.defineProperties; var $create = Object.create; var thisName = $createPrivateName(); var argsName = $createPrivateName(); var observeName = $createPrivateName(); function AsyncGeneratorFunction() {} function AsyncGeneratorFunctionPrototype() {} AsyncGeneratorFunction.prototype = AsyncGeneratorFunctionPrototype; AsyncGeneratorFunctionPrototype.constructor = AsyncGeneratorFunction; $defineProperty(AsyncGeneratorFunctionPrototype, 'constructor', {enumerable: false}); var AsyncGeneratorContext = function() { function AsyncGeneratorContext(observer) { var $__0 = this; this.decoratedObserver = $traceurRuntime.createDecoratedGenerator(observer, function() { $__0.done = true; }); this.done = false; this.inReturn = false; } return ($traceurRuntime.createClass)(AsyncGeneratorContext, { throw: function(error) { if (!this.inReturn) { throw error; } }, yield: function(value) { if (this.done) { this.inReturn = true; throw undefined; } var result; try { result = this.decoratedObserver.next(value); } catch (e) { this.done = true; throw e; } if (result === undefined) { return; } if (result.done) { this.done = true; this.inReturn = true; throw undefined; } return result.value; }, yieldFor: function(observable) { var ctx = this; return $traceurRuntime.observeForEach(observable[$traceurRuntime.toProperty(Symbol.observer)].bind(observable), function(value) { if (ctx.done) { this.return(); return; } var result; try { result = ctx.decoratedObserver.next(value); } catch (e) { ctx.done = true; throw e; } if (result === undefined) { return; } if (result.done) { ctx.done = true; } return result; }); } }, {}); }(); AsyncGeneratorFunctionPrototype.prototype[Symbol.observer] = function(observer) { var observe = this[observeName]; var ctx = new AsyncGeneratorContext(observer); $traceurRuntime.schedule(function() { return observe(ctx); }).then(function(value) { if (!ctx.done) { ctx.decoratedObserver.return(value); } }).catch(function(error) { if (!ctx.done) { ctx.decoratedObserver.throw(error); } }); return ctx.decoratedObserver; }; $defineProperty(AsyncGeneratorFunctionPrototype.prototype, Symbol.observer, {enumerable: false}); function initAsyncGeneratorFunction(functionObject) { functionObject.prototype = $create(AsyncGeneratorFunctionPrototype.prototype); functionObject.__proto__ = AsyncGeneratorFunctionPrototype; return functionObject; } function createAsyncGeneratorInstance(observe, functionObject) { for (var args = [], $__9 = 2; $__9 < arguments.length; $__9++) args[$__9 - 2] = arguments[$__9]; var object = $create(functionObject.prototype); object[thisName] = this; object[argsName] = args; object[observeName] = observe; return object; } function observeForEach(observe, next) { return new Promise(function(resolve, reject) { var generator = observe({ next: function(value) { return next.call(generator, value); }, throw: function(error) { reject(error); }, return: function(value) { resolve(value); } }); }); } function schedule(asyncF) { return Promise.resolve().then(asyncF); } var generator = Symbol(); var onDone = Symbol(); var DecoratedGenerator = function() { function DecoratedGenerator(_generator, _onDone) { this[generator] = _generator; this[onDone] = _onDone; } return ($traceurRuntime.createClass)(DecoratedGenerator, { next: function(value) { var result = this[generator].next(value); if (result !== undefined && result.done) { this[onDone].call(this); } return result; }, throw: function(error) { this[onDone].call(this); return this[generator].throw(error); }, return: function(value) { this[onDone].call(this); return this[generator].return(value); } }, {}); }(); function createDecoratedGenerator(generator, onDone) { return new DecoratedGenerator(generator, onDone); } Array.prototype[$traceurRuntime.toProperty(Symbol.observer)] = function(observer) { var done = false; var decoratedObserver = createDecoratedGenerator(observer, function() { return done = true; }); var $__5 = true; var $__6 = false; var $__7 = undefined; try { for (var $__3 = void 0, $__2 = (this)[$traceurRuntime.toProperty(Symbol.iterator)](); !($__5 = ($__3 = $__2.next()).done); $__5 = true) { var value = $__3.value; { decoratedObserver.next(value); if (done) { return; } } } } catch ($__8) { $__6 = true; $__7 = $__8; } finally { try { if (!$__5 && $__2.return != null) { $__2.return(); } } finally { if ($__6) { throw $__7; } } } decoratedObserver.return(); return decoratedObserver; }; $defineProperty(Array.prototype, $traceurRuntime.toProperty(Symbol.observer), {enumerable: false}); $traceurRuntime.initAsyncGeneratorFunction = initAsyncGeneratorFunction; $traceurRuntime.createAsyncGeneratorInstance = createAsyncGeneratorInstance; $traceurRuntime.observeForEach = observeForEach; $traceurRuntime.schedule = schedule; $traceurRuntime.createDecoratedGenerator = createDecoratedGenerator; return {}; }); System.registerModule("traceur-runtime@0.0.90/src/runtime/classes.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/classes.js"; var $Object = Object; var $TypeError = TypeError; var $create = $Object.create; var $defineProperties = $traceurRuntime.defineProperties; var $defineProperty = $traceurRuntime.defineProperty; var $getOwnPropertyDescriptor = $traceurRuntime.getOwnPropertyDescriptor; var $getOwnPropertyNames = $traceurRuntime.getOwnPropertyNames; var $getPrototypeOf = Object.getPrototypeOf; var $__0 = Object, getOwnPropertyNames = $__0.getOwnPropertyNames, getOwnPropertySymbols = $__0.getOwnPropertySymbols; function superDescriptor(homeObject, name) { var proto = $getPrototypeOf(homeObject); do { var result = $getOwnPropertyDescriptor(proto, name); if (result) return result; proto = $getPrototypeOf(proto); } while (proto); return undefined; } function superConstructor(ctor) { return ctor.__proto__; } function superGet(self, homeObject, name) { var descriptor = superDescriptor(homeObject, name); if (descriptor) { var value = descriptor.value; if (value) return value; if (!descriptor.get) return value; return descriptor.get.call(self); } return undefined; } function superSet(self, homeObject, name, value) { var descriptor = superDescriptor(homeObject, name); if (descriptor && descriptor.set) { descriptor.set.call(self, value); return value; } throw $TypeError(("super has no setter '" + name + "'.")); } function forEachPropertyKey(object, f) { getOwnPropertyNames(object).forEach(f); getOwnPropertySymbols(object).forEach(f); } function getDescriptors(object) { var descriptors = {}; forEachPropertyKey(object, function(key) { descriptors[key] = $getOwnPropertyDescriptor(object, key); descriptors[key].enumerable = false; }); return descriptors; } var nonEnum = {enumerable: false}; function makePropertiesNonEnumerable(object) { forEachPropertyKey(object, function(key) { $defineProperty(object, key, nonEnum); }); } function createClass(ctor, object, staticObject, superClass) { $defineProperty(object, 'constructor', { value: ctor, configurable: true, enumerable: false, writable: true }); if (arguments.length > 3) { if (typeof superClass === 'function') ctor.__proto__ = superClass; ctor.prototype = $create(getProtoParent(superClass), getDescriptors(object)); } else { makePropertiesNonEnumerable(object); ctor.prototype = object; } $defineProperty(ctor, 'prototype', { configurable: false, writable: false }); return $defineProperties(ctor, getDescriptors(staticObject)); } function getProtoParent(superClass) { if (typeof superClass === 'function') { var prototype = superClass.prototype; if ($Object(prototype) === prototype || prototype === null) return superClass.prototype; throw new $TypeError('super prototype must be an Object or null'); } if (superClass === null) return null; throw new $TypeError(("Super expression must either be null or a function, not " + typeof superClass + ".")); } $traceurRuntime.createClass = createClass; $traceurRuntime.superConstructor = superConstructor; $traceurRuntime.superGet = superGet; $traceurRuntime.superSet = superSet; return {}; }); System.registerModule("traceur-runtime@0.0.90/src/runtime/destructuring.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/destructuring.js"; function iteratorToArray(iter) { var rv = []; var i = 0; var tmp; while (!(tmp = iter.next()).done) { rv[i++] = tmp.value; } return rv; } $traceurRuntime.iteratorToArray = iteratorToArray; return {}; }); System.registerModule("traceur-runtime@0.0.90/src/runtime/generators.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/generators.js"; if (typeof $traceurRuntime !== 'object') { throw new Error('traceur runtime not found.'); } var createPrivateName = $traceurRuntime.createPrivateName; var $defineProperties = $traceurRuntime.defineProperties; var $defineProperty = $traceurRuntime.defineProperty; var $create = Object.create; var $TypeError = TypeError; function nonEnum(value) { return { configurable: true, enumerable: false, value: value, writable: true }; } var ST_NEWBORN = 0; var ST_EXECUTING = 1; var ST_SUSPENDED = 2; var ST_CLOSED = 3; var END_STATE = -2; var RETHROW_STATE = -3; function getInternalError(state) { return new Error('Traceur compiler bug: invalid state in state machine: ' + state); } var RETURN_SENTINEL = {}; function GeneratorContext() { this.state = 0; this.GState = ST_NEWBORN; this.storedException = undefined; this.finallyFallThrough = undefined; this.sent_ = undefined; this.returnValue = undefined; this.oldReturnValue = undefined; this.tryStack_ = []; } GeneratorContext.prototype = { pushTry: function(catchState, finallyState) { if (finallyState !== null) { var finallyFallThrough = null; for (var i = this.tryStack_.length - 1; i >= 0; i--) { if (this.tryStack_[i].catch !== undefined) { finallyFallThrough = this.tryStack_[i].catch; break; } } if (finallyFallThrough === null) finallyFallThrough = RETHROW_STATE; this.tryStack_.push({ finally: finallyState, finallyFallThrough: finallyFallThrough }); } if (catchState !== null) { this.tryStack_.push({catch: catchState}); } }, popTry: function() { this.tryStack_.pop(); }, maybeUncatchable: function() { if (this.storedException === RETURN_SENTINEL) { throw RETURN_SENTINEL; } }, get sent() { this.maybeThrow(); return this.sent_; }, set sent(v) { this.sent_ = v; }, get sentIgnoreThrow() { return this.sent_; }, maybeThrow: function() { if (this.action === 'throw') { this.action = 'next'; throw this.sent_; } }, end: function() { switch (this.state) { case END_STATE: return this; case RETHROW_STATE: throw this.storedException; default: throw getInternalError(this.state); } }, handleException: function(ex) { this.GState = ST_CLOSED; this.state = END_STATE; throw ex; }, wrapYieldStar: function(iterator) { var ctx = this; return { next: function(v) { return iterator.next(v); }, throw: function(e) { var result; if (e === RETURN_SENTINEL) { if (iterator.return) { result = iterator.return(ctx.returnValue); if (!result.done) { ctx.returnValue = ctx.oldReturnValue; return result; } ctx.returnValue = result.value; } throw e; } if (iterator.throw) { return iterator.throw(e); } iterator.return && iterator.return(); throw $TypeError('Inner iterator does not have a throw method'); } }; } }; function nextOrThrow(ctx, moveNext, action, x) { switch (ctx.GState) { case ST_EXECUTING: throw new Error(("\"" + action + "\" on executing generator")); case ST_CLOSED: if (action == 'next') { return { value: undefined, done: true }; } if (x === RETURN_SENTINEL) { return { value: ctx.returnValue, done: true }; } throw x; case ST_NEWBORN: if (action === 'throw') { ctx.GState = ST_CLOSED; if (x === RETURN_SENTINEL) { return { value: ctx.returnValue, done: true }; } throw x; } if (x !== undefined) throw $TypeError('Sent value to newborn generator'); case ST_SUSPENDED: ctx.GState = ST_EXECUTING; ctx.action = action; ctx.sent = x; var value; try { value = moveNext(ctx); } catch (ex) { if (ex === RETURN_SENTINEL) { value = ctx; } else { throw ex; } } var done = value === ctx; if (done) value = ctx.returnValue; ctx.GState = done ? ST_CLOSED : ST_SUSPENDED; return { value: value, done: done }; } } var ctxName = createPrivateName(); var moveNextName = createPrivateName(); function GeneratorFunction() {} function GeneratorFunctionPrototype() {} GeneratorFunction.prototype = GeneratorFunctionPrototype; $defineProperty(GeneratorFunctionPrototype, 'constructor', nonEnum(GeneratorFunction)); GeneratorFunctionPrototype.prototype = { constructor: GeneratorFunctionPrototype, next: function(v) { return nextOrThrow(this[ctxName], this[moveNextName], 'next', v); }, throw: function(v) { return nextOrThrow(this[ctxName], this[moveNextName], 'throw', v); }, return: function(v) { this[ctxName].oldReturnValue = this[ctxName].returnValue; this[ctxName].returnValue = v; return nextOrThrow(this[ctxName], this[moveNextName], 'throw', RETURN_SENTINEL); } }; $defineProperties(GeneratorFunctionPrototype.prototype, { constructor: {enumerable: false}, next: {enumerable: false}, throw: {enumerable: false}, return: {enumerable: false} }); Object.defineProperty(GeneratorFunctionPrototype.prototype, Symbol.iterator, nonEnum(function() { return this; })); function createGeneratorInstance(innerFunction, functionObject, self) { var moveNext = getMoveNext(innerFunction, self); var ctx = new GeneratorContext(); var object = $create(functionObject.prototype); object[ctxName] = ctx; object[moveNextName] = moveNext; return object; } function initGeneratorFunction(functionObject) { functionObject.prototype = $create(GeneratorFunctionPrototype.prototype); functionObject.__proto__ = GeneratorFunctionPrototype; return functionObject; } function AsyncFunctionContext() { GeneratorContext.call(this); this.err = undefined; var ctx = this; ctx.result = new Promise(function(resolve, reject) { ctx.resolve = resolve; ctx.reject = reject; }); } AsyncFunctionContext.prototype = $create(GeneratorContext.prototype); AsyncFunctionContext.prototype.end = function() { switch (this.state) { case END_STATE: this.resolve(this.returnValue); break; case RETHROW_STATE: this.reject(this.storedException); break; default: this.reject(getInternalError(this.state)); } }; AsyncFunctionContext.prototype.handleException = function() { this.state = RETHROW_STATE; }; function asyncWrap(innerFunction, self) { var moveNext = getMoveNext(innerFunction, self); var ctx = new AsyncFunctionContext(); ctx.createCallback = function(newState) { return function(value) { ctx.state = newState; ctx.value = value; moveNext(ctx); }; }; ctx.errback = function(err) { handleCatch(ctx, err); moveNext(ctx); }; moveNext(ctx); return ctx.result; } function getMoveNext(innerFunction, self) { return function(ctx) { while (true) { try { return innerFunction.call(self, ctx); } catch (ex) { handleCatch(ctx, ex); } } }; } function handleCatch(ctx, ex) { ctx.storedException = ex; var last = ctx.tryStack_[ctx.tryStack_.length - 1]; if (!last) { ctx.handleException(ex); return; } ctx.state = last.catch !== undefined ? last.catch : last.finally; if (last.finallyFallThrough !== undefined) ctx.finallyFallThrough = last.finallyFallThrough; } $traceurRuntime.asyncWrap = asyncWrap; $traceurRuntime.initGeneratorFunction = initGeneratorFunction; $traceurRuntime.createGeneratorInstance = createGeneratorInstance; return {}; }); System.registerModule("traceur-runtime@0.0.90/src/runtime/relativeRequire.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/relativeRequire.js"; var path; function relativeRequire(callerPath, requiredPath) { path = path || typeof require !== 'undefined' && require('path'); function isDirectory(path) { return path.slice(-1) === '/'; } function isAbsolute(path) { return path[0] === '/'; } function isRelative(path) { return path[0] === '.'; } if (isDirectory(requiredPath) || isAbsolute(requiredPath)) return; return isRelative(requiredPath) ? require(path.resolve(path.dirname(callerPath), requiredPath)) : require(requiredPath); } $traceurRuntime.require = relativeRequire; return {}; }); System.registerModule("traceur-runtime@0.0.90/src/runtime/spread.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/spread.js"; function spread() { var rv = [], j = 0, iterResult; for (var i = 0; i < arguments.length; i++) { var valueToSpread = $traceurRuntime.checkObjectCoercible(arguments[i]); if (typeof valueToSpread[$traceurRuntime.toProperty(Symbol.iterator)] !== 'function') { throw new TypeError('Cannot spread non-iterable object.'); } var iter = valueToSpread[$traceurRuntime.toProperty(Symbol.iterator)](); while (!(iterResult = iter.next()).done) { rv[j++] = iterResult.value; } } return rv; } $traceurRuntime.spread = spread; return {}; }); System.registerModule("traceur-runtime@0.0.90/src/runtime/template.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/template.js"; var $__0 = Object, defineProperty = $__0.defineProperty, freeze = $__0.freeze; var slice = Array.prototype.slice; var map = Object.create(null); function getTemplateObject(raw) { var cooked = arguments[1]; var key = raw.join('${}'); var templateObject = map[key]; if (templateObject) return templateObject; if (!cooked) { cooked = slice.call(raw); } return map[key] = freeze(defineProperty(cooked, 'raw', {value: freeze(raw)})); } $traceurRuntime.getTemplateObject = getTemplateObject; return {}; }); System.registerModule("traceur-runtime@0.0.90/src/runtime/type-assertions.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/type-assertions.js"; var types = { any: {name: 'any'}, boolean: {name: 'boolean'}, number: {name: 'number'}, string: {name: 'string'}, symbol: {name: 'symbol'}, void: {name: 'void'} }; var GenericType = function() { function GenericType(type, argumentTypes) { this.type = type; this.argumentTypes = argumentTypes; } return ($traceurRuntime.createClass)(GenericType, {}, {}); }(); var typeRegister = Object.create(null); function genericType(type) { for (var argumentTypes = [], $__1 = 1; $__1 < arguments.length; $__1++) argumentTypes[$__1 - 1] = arguments[$__1]; var typeMap = typeRegister; var key = $traceurRuntime.getOwnHashObject(type).hash; if (!typeMap[key]) { typeMap[key] = Object.create(null); } typeMap = typeMap[key]; for (var i = 0; i < argumentTypes.length - 1; i++) { key = $traceurRuntime.getOwnHashObject(argumentTypes[i]).hash; if (!typeMap[key]) { typeMap[key] = Object.create(null); } typeMap = typeMap[key]; } var tail = argumentTypes[argumentTypes.length - 1]; key = $traceurRuntime.getOwnHashObject(tail).hash; if (!typeMap[key]) { typeMap[key] = new GenericType(type, argumentTypes); } return typeMap[key]; } $traceurRuntime.GenericType = GenericType; $traceurRuntime.genericType = genericType; $traceurRuntime.type = types; return {}; }); System.registerModule("traceur-runtime@0.0.90/src/runtime/runtime-modules.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/runtime-modules.js"; System.get("traceur-runtime@0.0.90/src/runtime/relativeRequire.js"); System.get("traceur-runtime@0.0.90/src/runtime/spread.js"); System.get("traceur-runtime@0.0.90/src/runtime/destructuring.js"); System.get("traceur-runtime@0.0.90/src/runtime/classes.js"); System.get("traceur-runtime@0.0.90/src/runtime/async.js"); System.get("traceur-runtime@0.0.90/src/runtime/generators.js"); System.get("traceur-runtime@0.0.90/src/runtime/template.js"); System.get("traceur-runtime@0.0.90/src/runtime/type-assertions.js"); return {}; }); System.get("traceur-runtime@0.0.90/src/runtime/runtime-modules.js" + ''); System.registerModule("traceur-runtime@0.0.90/src/runtime/polyfills/utils.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/polyfills/utils.js"; var $ceil = Math.ceil; var $floor = Math.floor; var $isFinite = isFinite; var $isNaN = isNaN; var $pow = Math.pow; var $min = Math.min; var toObject = $traceurRuntime.toObject; function toUint32(x) { return x >>> 0; } function isObject(x) { return x && (typeof x === 'object' || typeof x === 'function'); } function isCallable(x) { return typeof x === 'function'; } function isNumber(x) { return typeof x === 'number'; } function toInteger(x) { x = +x; if ($isNaN(x)) return 0; if (x === 0 || !$isFinite(x)) return x; return x > 0 ? $floor(x) : $ceil(x); } var MAX_SAFE_LENGTH = $pow(2, 53) - 1; function toLength(x) { var len = toInteger(x); return len < 0 ? 0 : $min(len, MAX_SAFE_LENGTH); } function checkIterable(x) { return !isObject(x) ? undefined : x[Symbol.iterator]; } function isConstructor(x) { return isCallable(x); } function createIteratorResultObject(value, done) { return { value: value, done: done }; } function maybeDefine(object, name, descr) { if (!(name in object)) { Object.defineProperty(object, name, descr); } } function maybeDefineMethod(object, name, value) { maybeDefine(object, name, { value: value, configurable: true, enumerable: false, writable: true }); } function maybeDefineConst(object, name, value) { maybeDefine(object, name, { value: value, configurable: false, enumerable: false, writable: false }); } function maybeAddFunctions(object, functions) { for (var i = 0; i < functions.length; i += 2) { var name = functions[i]; var value = functions[i + 1]; maybeDefineMethod(object, name, value); } } function maybeAddConsts(object, consts) { for (var i = 0; i < consts.length; i += 2) { var name = consts[i]; var value = consts[i + 1]; maybeDefineConst(object, name, value); } } function maybeAddIterator(object, func, Symbol) { if (!Symbol || !Symbol.iterator || object[Symbol.iterator]) return; if (object['@@iterator']) func = object['@@iterator']; Object.defineProperty(object, Symbol.iterator, { value: func, configurable: true, enumerable: false, writable: true }); } var polyfills = []; function registerPolyfill(func) { polyfills.push(func); } function polyfillAll(global) { polyfills.forEach(function(f) { return f(global); }); } return { get toObject() { return toObject; }, get toUint32() { return toUint32; }, get isObject() { return isObject; }, get isCallable() { return isCallable; }, get isNumber() { return isNumber; }, get toInteger() { return toInteger; }, get toLength() { return toLength; }, get checkIterable() { return checkIterable; }, get isConstructor() { return isConstructor; }, get createIteratorResultObject() { return createIteratorResultObject; }, get maybeDefine() { return maybeDefine; }, get maybeDefineMethod() { return maybeDefineMethod; }, get maybeDefineConst() { return maybeDefineConst; }, get maybeAddFunctions() { return maybeAddFunctions; }, get maybeAddConsts() { return maybeAddConsts; }, get maybeAddIterator() { return maybeAddIterator; }, get registerPolyfill() { return registerPolyfill; }, get polyfillAll() { return polyfillAll; } }; }); System.registerModule("traceur-runtime@0.0.90/src/runtime/polyfills/Map.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/polyfills/Map.js"; var $__0 = System.get("traceur-runtime@0.0.90/src/runtime/polyfills/utils.js"), isObject = $__0.isObject, registerPolyfill = $__0.registerPolyfill; var $__9 = $traceurRuntime, getOwnHashObject = $__9.getOwnHashObject, hasNativeSymbol = $__9.hasNativeSymbol; var $hasOwnProperty = Object.prototype.hasOwnProperty; var deletedSentinel = {}; function lookupIndex(map, key) { if (isObject(key)) { var hashObject = getOwnHashObject(key); return hashObject && map.objectIndex_[hashObject.hash]; } if (typeof key === 'string') return map.stringIndex_[key]; return map.primitiveIndex_[key]; } function initMap(map) { map.entries_ = []; map.objectIndex_ = Object.create(null); map.stringIndex_ = Object.create(null); map.primitiveIndex_ = Object.create(null); map.deletedCount_ = 0; } var Map = function() { function Map() { var $__11, $__12; var iterable = arguments[0]; if (!isObject(this)) throw new TypeError('Map called on incompatible type'); if ($hasOwnProperty.call(this, 'entries_')) { throw new TypeError('Map can not be reentrantly initialised'); } initMap(this); if (iterable !== null && iterable !== undefined) { var $__5 = true; var $__6 = false; var $__7 = undefined; try { for (var $__3 = void 0, $__2 = (iterable)[$traceurRuntime.toProperty(Symbol.iterator)](); !($__5 = ($__3 = $__2.next()).done); $__5 = true) { var $__10 = $__3.value, key = ($__11 = $__10[$traceurRuntime.toProperty(Symbol.iterator)](), ($__12 = $__11.next()).done ? void 0 : $__12.value), value = ($__12 = $__11.next()).done ? void 0 : $__12.value; { this.set(key, value); } } } catch ($__8) { $__6 = true; $__7 = $__8; } finally { try { if (!$__5 && $__2.return != null) { $__2.return(); } } finally { if ($__6) { throw $__7; } } } } } return ($traceurRuntime.createClass)(Map, { get size() { return this.entries_.length / 2 - this.deletedCount_; }, get: function(key) { var index = lookupIndex(this, key); if (index !== undefined) return this.entries_[index + 1]; }, set: function(key, value) { var objectMode = isObject(key); var stringMode = typeof key === 'string'; var index = lookupIndex(this, key); if (index !== undefined) { this.entries_[index + 1] = value; } else { index = this.entries_.length; this.entries_[index] = key; this.entries_[index + 1] = value; if (objectMode) { var hashObject = getOwnHashObject(key); var hash = hashObject.hash; this.objectIndex_[hash] = index; } else if (stringMode) { this.stringIndex_[key] = index; } else { this.primitiveIndex_[key] = index; } } return this; }, has: function(key) { return lookupIndex(this, key) !== undefined; }, delete: function(key) { var objectMode = isObject(key); var stringMode = typeof key === 'string'; var index; var hash; if (objectMode) { var hashObject = getOwnHashObject(key); if (hashObject) { index = this.objectIndex_[hash = hashObject.hash]; delete this.objectIndex_[hash]; } } else if (stringMode) { index = this.stringIndex_[key]; delete this.stringIndex_[key]; } else { index = this.primitiveIndex_[key]; delete this.primitiveIndex_[key]; } if (index !== undefined) { this.entries_[index] = deletedSentinel; this.entries_[index + 1] = undefined; this.deletedCount_++; return true; } return false; }, clear: function() { initMap(this); }, forEach: function(callbackFn) { var thisArg = arguments[1]; for (var i = 0; i < this.entries_.length; i += 2) { var key = this.entries_[i]; var value = this.entries_[i + 1]; if (key === deletedSentinel) continue; callbackFn.call(thisArg, value, key, this); } }, entries: $traceurRuntime.initGeneratorFunction(function $__13() { var i, key, value; return $traceurRuntime.createGeneratorInstance(function($ctx) { while (true) switch ($ctx.state) { case 0: i = 0; $ctx.state = 12; break; case 12: $ctx.state = (i < this.entries_.length) ? 8 : -2; break; case 4: i += 2; $ctx.state = 12; break; case 8: key = this.entries_[i]; value = this.entries_[i + 1]; $ctx.state = 9; break; case 9: $ctx.state = (key === deletedSentinel) ? 4 : 6; break; case 6: $ctx.state = 2; return [key, value]; case 2: $ctx.maybeThrow(); $ctx.state = 4; break; default: return $ctx.end(); } }, $__13, this); }), keys: $traceurRuntime.initGeneratorFunction(function $__14() { var i, key, value; return $traceurRuntime.createGeneratorInstance(function($ctx) { while (true) switch ($ctx.state) { case 0: i = 0; $ctx.state = 12; break; case 12: $ctx.state = (i < this.entries_.length) ? 8 : -2; break; case 4: i += 2; $ctx.state = 12; break; case 8: key = this.entries_[i]; value = this.entries_[i + 1]; $ctx.state = 9; break; case 9: $ctx.state = (key === deletedSentinel) ? 4 : 6; break; case 6: $ctx.state = 2; return key; case 2: $ctx.maybeThrow(); $ctx.state = 4; break; default: return $ctx.end(); } }, $__14, this); }), values: $traceurRuntime.initGeneratorFunction(function $__15() { var i, key, value; return $traceurRuntime.createGeneratorInstance(function($ctx) { while (true) switch ($ctx.state) { case 0: i = 0; $ctx.state = 12; break; case 12: $ctx.state = (i < this.entries_.length) ? 8 : -2; break; case 4: i += 2; $ctx.state = 12; break; case 8: key = this.entries_[i]; value = this.entries_[i + 1]; $ctx.state = 9; break; case 9: $ctx.state = (key === deletedSentinel) ? 4 : 6; break; case 6: $ctx.state = 2; return value; case 2: $ctx.maybeThrow(); $ctx.state = 4; break; default: return $ctx.end(); } }, $__15, this); }) }, {}); }(); Object.defineProperty(Map.prototype, Symbol.iterator, { configurable: true, writable: true, value: Map.prototype.entries }); function needsPolyfill(global) { var $__10 = global, Map = $__10.Map, Symbol = $__10.Symbol; if (!Map || !$traceurRuntime.hasNativeSymbol() || !Map.prototype[Symbol.iterator] || !Map.prototype.entries) { return true; } try { return new Map([[]]).size !== 1; } catch (e) { return false; } } function polyfillMap(global) { if (needsPolyfill(global)) { global.Map = Map; } } registerPolyfill(polyfillMap); return { get Map() { return Map; }, get polyfillMap() { return polyfillMap; } }; }); System.get("traceur-runtime@0.0.90/src/runtime/polyfills/Map.js" + ''); System.registerModule("traceur-runtime@0.0.90/src/runtime/polyfills/Set.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/polyfills/Set.js"; var $__0 = System.get("traceur-runtime@0.0.90/src/runtime/polyfills/utils.js"), isObject = $__0.isObject, registerPolyfill = $__0.registerPolyfill; var Map = System.get("traceur-runtime@0.0.90/src/runtime/polyfills/Map.js").Map; var getOwnHashObject = $traceurRuntime.getOwnHashObject; var $hasOwnProperty = Object.prototype.hasOwnProperty; function initSet(set) { set.map_ = new Map(); } var Set = function() { function Set() { var iterable = arguments[0]; if (!isObject(this)) throw new TypeError('Set called on incompatible type'); if ($hasOwnProperty.call(this, 'map_')) { throw new TypeError('Set can not be reentrantly initialised'); } initSet(this); if (iterable !== null && iterable !== undefined) { var $__7 = true; var $__8 = false; var $__9 = undefined; try { for (var $__5 = void 0, $__4 = (iterable)[$traceurRuntime.toProperty(Symbol.iterator)](); !($__7 = ($__5 = $__4.next()).done); $__7 = true) { var item = $__5.value; { this.add(item); } } } catch ($__10) { $__8 = true; $__9 = $__10; } finally { try { if (!$__7 && $__4.return != null) { $__4.return(); } } finally { if ($__8) { throw $__9; } } } } } return ($traceurRuntime.createClass)(Set, { get size() { return this.map_.size; }, has: function(key) { return this.map_.has(key); }, add: function(key) { this.map_.set(key, key); return this; }, delete: function(key) { return this.map_.delete(key); }, clear: function() { return this.map_.clear(); }, forEach: function(callbackFn) { var thisArg = arguments[1]; var $__2 = this; return this.map_.forEach(function(value, key) { callbackFn.call(thisArg, key, key, $__2); }); }, values: $traceurRuntime.initGeneratorFunction(function $__12() { var $__13, $__14; return $traceurRuntime.createGeneratorInstance(function($ctx) { while (true) switch ($ctx.state) { case 0: $__13 = $ctx.wrapYieldStar(this.map_.keys()[Symbol.iterator]()); $ctx.sent = void 0; $ctx.action = 'next'; $ctx.state = 12; break; case 12: $__14 = $__13[$ctx.action]($ctx.sentIgnoreThrow); $ctx.state = 9; break; case 9: $ctx.state = ($__14.done) ? 3 : 2; break; case 3: $ctx.sent = $__14.value; $ctx.state = -2; break; case 2: $ctx.state = 12; return $__14.value; default: return $ctx.end(); } }, $__12, this); }), entries: $traceurRuntime.initGeneratorFunction(function $__15() { var $__16, $__17; return $traceurRuntime.createGeneratorInstance(function($ctx) { while (true) switch ($ctx.state) { case 0: $__16 = $ctx.wrapYieldStar(this.map_.entries()[Symbol.iterator]()); $ctx.sent = void 0; $ctx.action = 'next'; $ctx.state = 12; break; case 12: $__17 = $__16[$ctx.action]($ctx.sentIgnoreThrow); $ctx.state = 9; break; case 9: $ctx.state = ($__17.done) ? 3 : 2; break; case 3: $ctx.sent = $__17.value; $ctx.state = -2; break; case 2: $ctx.state = 12; return $__17.value; default: return $ctx.end(); } }, $__15, this); }) }, {}); }(); Object.defineProperty(Set.prototype, Symbol.iterator, { configurable: true, writable: true, value: Set.prototype.values }); Object.defineProperty(Set.prototype, 'keys', { configurable: true, writable: true, value: Set.prototype.values }); function needsPolyfill(global) { var $__11 = global, Set = $__11.Set, Symbol = $__11.Symbol; if (!Set || !$traceurRuntime.hasNativeSymbol() || !Set.prototype[Symbol.iterator] || !Set.prototype.values) { return true; } try { return new Set([1]).size !== 1; } catch (e) { return false; } } function polyfillSet(global) { if (needsPolyfill(global)) { global.Set = Set; } } registerPolyfill(polyfillSet); return { get Set() { return Set; }, get polyfillSet() { return polyfillSet; } }; }); System.get("traceur-runtime@0.0.90/src/runtime/polyfills/Set.js" + ''); System.registerModule("traceur-runtime@0.0.90/node_modules/rsvp/lib/rsvp/asap.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/node_modules/rsvp/lib/rsvp/asap.js"; var len = 0; function asap(callback, arg) { queue[len] = callback; queue[len + 1] = arg; len += 2; if (len === 2) { scheduleFlush(); } } var $__default = asap; var browserGlobal = (typeof window !== 'undefined') ? window : {}; var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; function useNextTick() { return function() { process.nextTick(flush); }; } function useMutationObserver() { var iterations = 0; var observer = new BrowserMutationObserver(flush); var node = document.createTextNode(''); observer.observe(node, {characterData: true}); return function() { node.data = (iterations = ++iterations % 2); }; } function useMessageChannel() { var channel = new MessageChannel(); channel.port1.onmessage = flush; return function() { channel.port2.postMessage(0); }; } function useSetTimeout() { return function() { setTimeout(flush, 1); }; } var queue = new Array(1000); function flush() { for (var i = 0; i < len; i += 2) { var callback = queue[i]; var arg = queue[i + 1]; callback(arg); queue[i] = undefined; queue[i + 1] = undefined; } len = 0; } var scheduleFlush; if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { scheduleFlush = useNextTick(); } else if (BrowserMutationObserver) { scheduleFlush = useMutationObserver(); } else if (isWorker) { scheduleFlush = useMessageChannel(); } else { scheduleFlush = useSetTimeout(); } return {get default() { return $__default; }}; }); System.registerModule("traceur-runtime@0.0.90/src/runtime/polyfills/Promise.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/polyfills/Promise.js"; var async = System.get("traceur-runtime@0.0.90/node_modules/rsvp/lib/rsvp/asap.js").default; var registerPolyfill = System.get("traceur-runtime@0.0.90/src/runtime/polyfills/utils.js").registerPolyfill; var promiseRaw = {}; function isPromise(x) { return x && typeof x === 'object' && x.status_ !== undefined; } function idResolveHandler(x) { return x; } function idRejectHandler(x) { throw x; } function chain(promise) { var onResolve = arguments[1] !== (void 0) ? arguments[1] : idResolveHandler; var onReject = arguments[2] !== (void 0) ? arguments[2] : idRejectHandler; var deferred = getDeferred(promise.constructor); switch (promise.status_) { case undefined: throw TypeError; case 0: promise.onResolve_.push(onResolve, deferred); promise.onReject_.push(onReject, deferred); break; case +1: promiseEnqueue(promise.value_, [onResolve, deferred]); break; case -1: promiseEnqueue(promise.value_, [onReject, deferred]); break; } return deferred.promise; } function getDeferred(C) { if (this === $Promise) { var promise = promiseInit(new $Promise(promiseRaw)); return { promise: promise, resolve: function(x) { promiseResolve(promise, x); }, reject: function(r) { promiseReject(promise, r); } }; } else { var result = {}; result.promise = new C(function(resolve, reject) { result.resolve = resolve; result.reject = reject; }); return result; } } function promiseSet(promise, status, value, onResolve, onReject) { promise.status_ = status; promise.value_ = value; promise.onResolve_ = onResolve; promise.onReject_ = onReject; return promise; } function promiseInit(promise) { return promiseSet(promise, 0, undefined, [], []); } var Promise = function() { function Promise(resolver) { if (resolver === promiseRaw) return; if (typeof resolver !== 'function') throw new TypeError; var promise = promiseInit(this); try { resolver(function(x) { promiseResolve(promise, x); }, function(r) { promiseReject(promise, r); }); } catch (e) { promiseReject(promise, e); } } return ($traceurRuntime.createClass)(Promise, { catch: function(onReject) { return this.then(undefined, onReject); }, then: function(onResolve, onReject) { if (typeof onResolve !== 'function') onResolve = idResolveHandler; if (typeof onReject !== 'function') onReject = idRejectHandler; var that = this; var constructor = this.constructor; return chain(this, function(x) { x = promiseCoerce(constructor, x); return x === that ? onReject(new TypeError) : isPromise(x) ? x.then(onResolve, onReject) : onResolve(x); }, onReject); } }, { resolve: function(x) { if (this === $Promise) { if (isPromise(x)) { return x; } return promiseSet(new $Promise(promiseRaw), +1, x); } else { return new this(function(resolve, reject) { resolve(x); }); } }, reject: function(r) { if (this === $Promise) { return promiseSet(new $Promise(promiseRaw), -1, r); } else { return new this(function(resolve, reject) { reject(r); }); } }, all: function(values) { var deferred = getDeferred(this); var resolutions = []; try { var makeCountdownFunction = function(i) { return function(x) { resolutions[i] = x; if (--count === 0) deferred.resolve(resolutions); }; }; var count = 0; var i = 0; var $__6 = true; var $__7 = false; var $__8 = undefined; try { for (var $__4 = void 0, $__3 = (values)[$traceurRuntime.toProperty(Symbol.iterator)](); !($__6 = ($__4 = $__3.next()).done); $__6 = true) { var value = $__4.value; { var countdownFunction = makeCountdownFunction(i); this.resolve(value).then(countdownFunction, function(r) { deferred.reject(r); }); ++i; ++count; } } } catch ($__9) { $__7 = true; $__8 = $__9; } finally { try { if (!$__6 && $__3.return != null) { $__3.return(); } } finally { if ($__7) { throw $__8; } } } if (count === 0) { deferred.resolve(resolutions); } } catch (e) { deferred.reject(e); } return deferred.promise; }, race: function(values) { var deferred = getDeferred(this); try { for (var i = 0; i < values.length; i++) { this.resolve(values[i]).then(function(x) { deferred.resolve(x); }, function(r) { deferred.reject(r); }); } } catch (e) { deferred.reject(e); } return deferred.promise; } }); }(); var $Promise = Promise; var $PromiseReject = $Promise.reject; function promiseResolve(promise, x) { promiseDone(promise, +1, x, promise.onResolve_); } function promiseReject(promise, r) { promiseDone(promise, -1, r, promise.onReject_); } function promiseDone(promise, status, value, reactions) { if (promise.status_ !== 0) return; promiseEnqueue(value, reactions); promiseSet(promise, status, value); } function promiseEnqueue(value, tasks) { async(function() { for (var i = 0; i < tasks.length; i += 2) { promiseHandle(value, tasks[i], tasks[i + 1]); } }); } function promiseHandle(value, handler, deferred) { try { var result = handler(value); if (result === deferred.promise) throw new TypeError; else if (isPromise(result)) chain(result, deferred.resolve, deferred.reject); else deferred.resolve(result); } catch (e) { try { deferred.reject(e); } catch (e) {} } } var thenableSymbol = '@@thenable'; function isObject(x) { return x && (typeof x === 'object' || typeof x === 'function'); } function promiseCoerce(constructor, x) { if (!isPromise(x) && isObject(x)) { var then; try { then = x.then; } catch (r) { var promise = $PromiseReject.call(constructor, r); x[thenableSymbol] = promise; return promise; } if (typeof then === 'function') { var p = x[thenableSymbol]; if (p) { return p; } else { var deferred = getDeferred(constructor); x[thenableSymbol] = deferred.promise; try { then.call(x, deferred.resolve, deferred.reject); } catch (r) { deferred.reject(r); } return deferred.promise; } } } return x; } function polyfillPromise(global) { if (!global.Promise) global.Promise = Promise; } registerPolyfill(polyfillPromise); return { get Promise() { return Promise; }, get polyfillPromise() { return polyfillPromise; } }; }); System.get("traceur-runtime@0.0.90/src/runtime/polyfills/Promise.js" + ''); System.registerModule("traceur-runtime@0.0.90/src/runtime/polyfills/StringIterator.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/polyfills/StringIterator.js"; var $__0 = System.get("traceur-runtime@0.0.90/src/runtime/polyfills/utils.js"), createIteratorResultObject = $__0.createIteratorResultObject, isObject = $__0.isObject; var toProperty = $traceurRuntime.toProperty; var hasOwnProperty = Object.prototype.hasOwnProperty; var iteratedString = Symbol('iteratedString'); var stringIteratorNextIndex = Symbol('stringIteratorNextIndex'); var StringIterator = function() { var $__2; function StringIterator() {} return ($traceurRuntime.createClass)(StringIterator, ($__2 = {}, Object.defineProperty($__2, "next", { value: function() { var o = this; if (!isObject(o) || !hasOwnProperty.call(o, iteratedString)) { throw new TypeError('this must be a StringIterator object'); } var s = o[toProperty(iteratedString)]; if (s === undefined) { return createIteratorResultObject(undefined, true); } var position = o[toProperty(stringIteratorNextIndex)]; var len = s.length; if (position >= len) { o[toProperty(iteratedString)] = undefined; return createIteratorResultObject(undefined, true); } var first = s.charCodeAt(position); var resultString; if (first < 0xD800 || first > 0xDBFF || position + 1 === len) { resultString = String.fromCharCode(first); } else { var second = s.charCodeAt(position + 1); if (second < 0xDC00 || second > 0xDFFF) { resultString = String.fromCharCode(first); } else { resultString = String.fromCharCode(first) + String.fromCharCode(second); } } o[toProperty(stringIteratorNextIndex)] = position + resultString.length; return createIteratorResultObject(resultString, false); }, configurable: true, enumerable: true, writable: true }), Object.defineProperty($__2, Symbol.iterator, { value: function() { return this; }, configurable: true, enumerable: true, writable: true }), $__2), {}); }(); function createStringIterator(string) { var s = String(string); var iterator = Object.create(StringIterator.prototype); iterator[toProperty(iteratedString)] = s; iterator[toProperty(stringIteratorNextIndex)] = 0; return iterator; } return {get createStringIterator() { return createStringIterator; }}; }); System.registerModule("traceur-runtime@0.0.90/src/runtime/polyfills/String.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/polyfills/String.js"; var createStringIterator = System.get("traceur-runtime@0.0.90/src/runtime/polyfills/StringIterator.js").createStringIterator; var $__1 = System.get("traceur-runtime@0.0.90/src/runtime/polyfills/utils.js"), maybeAddFunctions = $__1.maybeAddFunctions, maybeAddIterator = $__1.maybeAddIterator, registerPolyfill = $__1.registerPolyfill; var $toString = Object.prototype.toString; var $indexOf = String.prototype.indexOf; var $lastIndexOf = String.prototype.lastIndexOf; function startsWith(search) { var string = String(this); if (this == null || $toString.call(search) == '[object RegExp]') { throw TypeError(); } var stringLength = string.length; var searchString = String(search); var searchLength = searchString.length; var position = arguments.length > 1 ? arguments[1] : undefined; var pos = position ? Number(position) : 0; if (isNaN(pos)) { pos = 0; } var start = Math.min(Math.max(pos, 0), stringLength); return $indexOf.call(string, searchString, pos) == start; } function endsWith(search) { var string = String(this); if (this == null || $toString.call(search) == '[object RegExp]') { throw TypeError(); } var stringLength = string.length; var searchString = String(search); var searchLength = searchString.length; var pos = stringLength; if (arguments.length > 1) { var position = arguments[1]; if (position !== undefined) { pos = position ? Number(position) : 0; if (isNaN(pos)) { pos = 0; } } } var end = Math.min(Math.max(pos, 0), stringLength); var start = end - searchLength; if (start < 0) { return false; } return $lastIndexOf.call(string, searchString, start) == start; } function includes(search) { if (this == null) { throw TypeError(); } var string = String(this); if (search && $toString.call(search) == '[object RegExp]') { throw TypeError(); } var stringLength = string.length; var searchString = String(search); var searchLength = searchString.length; var position = arguments.length > 1 ? arguments[1] : undefined; var pos = position ? Number(position) : 0; if (pos != pos) { pos = 0; } var start = Math.min(Math.max(pos, 0), stringLength); if (searchLength + start > stringLength) { return false; } return $indexOf.call(string, searchString, pos) != -1; } function repeat(count) { if (this == null) { throw TypeError(); } var string = String(this); var n = count ? Number(count) : 0; if (isNaN(n)) { n = 0; } if (n < 0 || n == Infinity) { throw RangeError(); } if (n == 0) { return ''; } var result = ''; while (n--) { result += string; } return result; } function codePointAt(position) { if (this == null) { throw TypeError(); } var string = String(this); var size = string.length; var index = position ? Number(position) : 0; if (isNaN(index)) { index = 0; } if (index < 0 || index >= size) { return undefined; } var first = string.charCodeAt(index); var second; if (first >= 0xD800 && first <= 0xDBFF && size > index + 1) { second = string.charCodeAt(index + 1); if (second >= 0xDC00 && second <= 0xDFFF) { return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; } } return first; } function raw(callsite) { var raw = callsite.raw; var len = raw.length >>> 0; if (len === 0) return ''; var s = ''; var i = 0; while (true) { s += raw[i]; if (i + 1 === len) return s; s += arguments[++i]; } } function fromCodePoint(_) { var codeUnits = []; var floor = Math.floor; var highSurrogate; var lowSurrogate; var index = -1; var length = arguments.length; if (!length) { return ''; } while (++index < length) { var codePoint = Number(arguments[index]); if (!isFinite(codePoint) || codePoint < 0 || codePoint > 0x10FFFF || floor(codePoint) != codePoint) { throw RangeError('Invalid code point: ' + codePoint); } if (codePoint <= 0xFFFF) { codeUnits.push(codePoint); } else { codePoint -= 0x10000; highSurrogate = (codePoint >> 10) + 0xD800; lowSurrogate = (codePoint % 0x400) + 0xDC00; codeUnits.push(highSurrogate, lowSurrogate); } } return String.fromCharCode.apply(null, codeUnits); } function stringPrototypeIterator() { var o = $traceurRuntime.checkObjectCoercible(this); var s = String(o); return createStringIterator(s); } function polyfillString(global) { var String = global.String; maybeAddFunctions(String.prototype, ['codePointAt', codePointAt, 'endsWith', endsWith, 'includes', includes, 'repeat', repeat, 'startsWith', startsWith]); maybeAddFunctions(String, ['fromCodePoint', fromCodePoint, 'raw', raw]); maybeAddIterator(String.prototype, stringPrototypeIterator, Symbol); } registerPolyfill(polyfillString); return { get startsWith() { return startsWith; }, get endsWith() { return endsWith; }, get includes() { return includes; }, get repeat() { return repeat; }, get codePointAt() { return codePointAt; }, get raw() { return raw; }, get fromCodePoint() { return fromCodePoint; }, get stringPrototypeIterator() { return stringPrototypeIterator; }, get polyfillString() { return polyfillString; } }; }); System.get("traceur-runtime@0.0.90/src/runtime/polyfills/String.js" + ''); System.registerModule("traceur-runtime@0.0.90/src/runtime/polyfills/ArrayIterator.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/polyfills/ArrayIterator.js"; var $__0 = System.get("traceur-runtime@0.0.90/src/runtime/polyfills/utils.js"), toObject = $__0.toObject, toUint32 = $__0.toUint32, createIteratorResultObject = $__0.createIteratorResultObject; var ARRAY_ITERATOR_KIND_KEYS = 1; var ARRAY_ITERATOR_KIND_VALUES = 2; var ARRAY_ITERATOR_KIND_ENTRIES = 3; var ArrayIterator = function() { var $__2; function ArrayIterator() {} return ($traceurRuntime.createClass)(ArrayIterator, ($__2 = {}, Object.defineProperty($__2, "next", { value: function() { var iterator = toObject(this); var array = iterator.iteratorObject_; if (!array) { throw new TypeError('Object is not an ArrayIterator'); } var index = iterator.arrayIteratorNextIndex_; var itemKind = iterator.arrayIterationKind_; var length = toUint32(array.length); if (index >= length) { iterator.arrayIteratorNextIndex_ = Infinity; return createIteratorResultObject(undefined, true); } iterator.arrayIteratorNextIndex_ = index + 1; if (itemKind == ARRAY_ITERATOR_KIND_VALUES) return createIteratorResultObject(array[index], false); if (itemKind == ARRAY_ITERATOR_KIND_ENTRIES) return createIteratorResultObject([index, array[index]], false); return createIteratorResultObject(index, false); }, configurable: true, enumerable: true, writable: true }), Object.defineProperty($__2, Symbol.iterator, { value: function() { return this; }, configurable: true, enumerable: true, writable: true }), $__2), {}); }(); function createArrayIterator(array, kind) { var object = toObject(array); var iterator = new ArrayIterator; iterator.iteratorObject_ = object; iterator.arrayIteratorNextIndex_ = 0; iterator.arrayIterationKind_ = kind; return iterator; } function entries() { return createArrayIterator(this, ARRAY_ITERATOR_KIND_ENTRIES); } function keys() { return createArrayIterator(this, ARRAY_ITERATOR_KIND_KEYS); } function values() { return createArrayIterator(this, ARRAY_ITERATOR_KIND_VALUES); } return { get entries() { return entries; }, get keys() { return keys; }, get values() { return values; } }; }); System.registerModule("traceur-runtime@0.0.90/src/runtime/polyfills/Array.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/polyfills/Array.js"; var $__0 = System.get("traceur-runtime@0.0.90/src/runtime/polyfills/ArrayIterator.js"), entries = $__0.entries, keys = $__0.keys, jsValues = $__0.values; var $__1 = System.get("traceur-runtime@0.0.90/src/runtime/polyfills/utils.js"), checkIterable = $__1.checkIterable, isCallable = $__1.isCallable, isConstructor = $__1.isConstructor, maybeAddFunctions = $__1.maybeAddFunctions, maybeAddIterator = $__1.maybeAddIterator, registerPolyfill = $__1.registerPolyfill, toInteger = $__1.toInteger, toLength = $__1.toLength, toObject = $__1.toObject; function from(arrLike) { var mapFn = arguments[1]; var thisArg = arguments[2]; var C = this; var items = toObject(arrLike); var mapping = mapFn !== undefined; var k = 0; var arr, len; if (mapping && !isCallable(mapFn)) { throw TypeError(); } if (checkIterable(items)) { arr = isConstructor(C) ? new C() : []; var $__5 = true; var $__6 = false; var $__7 = undefined; try { for (var $__3 = void 0, $__2 = (items)[$traceurRuntime.toProperty(Symbol.iterator)](); !($__5 = ($__3 = $__2.next()).done); $__5 = true) { var item = $__3.value; { if (mapping) { arr[k] = mapFn.call(thisArg, item, k); } else { arr[k] = item; } k++; } } } catch ($__8) { $__6 = true; $__7 = $__8; } finally { try { if (!$__5 && $__2.return != null) { $__2.return(); } } finally { if ($__6) { throw $__7; } } } arr.length = k; return arr; } len = toLength(items.length); arr = isConstructor(C) ? new C(len) : new Array(len); for (; k < len; k++) { if (mapping) { arr[k] = typeof thisArg === 'undefined' ? mapFn(items[k], k) : mapFn.call(thisArg, items[k], k); } else { arr[k] = items[k]; } } arr.length = len; return arr; } function of() { for (var items = [], $__9 = 0; $__9 < arguments.length; $__9++) items[$__9] = arguments[$__9]; var C = this; var len = items.length; var arr = isConstructor(C) ? new C(len) : new Array(len); for (var k = 0; k < len; k++) { arr[k] = items[k]; } arr.length = len; return arr; } function fill(value) { var start = arguments[1] !== (void 0) ? arguments[1] : 0; var end = arguments[2]; var object = toObject(this); var len = toLength(object.length); var fillStart = toInteger(start); var fillEnd = end !== undefined ? toInteger(end) : len; fillStart = fillStart < 0 ? Math.max(len + fillStart, 0) : Math.min(fillStart, len); fillEnd = fillEnd < 0 ? Math.max(len + fillEnd, 0) : Math.min(fillEnd, len); while (fillStart < fillEnd) { object[fillStart] = value; fillStart++; } return object; } function find(predicate) { var thisArg = arguments[1]; return findHelper(this, predicate, thisArg); } function findIndex(predicate) { var thisArg = arguments[1]; return findHelper(this, predicate, thisArg, true); } function findHelper(self, predicate) { var thisArg = arguments[2]; var returnIndex = arguments[3] !== (void 0) ? arguments[3] : false; var object = toObject(self); var len = toLength(object.length); if (!isCallable(predicate)) { throw TypeError(); } for (var i = 0; i < len; i++) { var value = object[i]; if (predicate.call(thisArg, value, i, object)) { return returnIndex ? i : value; } } return returnIndex ? -1 : undefined; } function polyfillArray(global) { var $__10 = global, Array = $__10.Array, Object = $__10.Object, Symbol = $__10.Symbol; var values = jsValues; if (Symbol && Symbol.iterator && Array.prototype[Symbol.iterator]) { values = Array.prototype[Symbol.iterator]; } maybeAddFunctions(Array.prototype, ['entries', entries, 'keys', keys, 'values', values, 'fill', fill, 'find', find, 'findIndex', findIndex]); maybeAddFunctions(Array, ['from', from, 'of', of]); maybeAddIterator(Array.prototype, values, Symbol); maybeAddIterator(Object.getPrototypeOf([].values()), function() { return this; }, Symbol); } registerPolyfill(polyfillArray); return { get from() { return from; }, get of() { return of; }, get fill() { return fill; }, get find() { return find; }, get findIndex() { return findIndex; }, get polyfillArray() { return polyfillArray; } }; }); System.get("traceur-runtime@0.0.90/src/runtime/polyfills/Array.js" + ''); System.registerModule("traceur-runtime@0.0.90/src/runtime/polyfills/Object.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/polyfills/Object.js"; var $__0 = System.get("traceur-runtime@0.0.90/src/runtime/polyfills/utils.js"), maybeAddFunctions = $__0.maybeAddFunctions, registerPolyfill = $__0.registerPolyfill; var $__1 = $traceurRuntime, defineProperty = $__1.defineProperty, getOwnPropertyDescriptor = $__1.getOwnPropertyDescriptor, getOwnPropertyNames = $__1.getOwnPropertyNames, isPrivateName = $__1.isPrivateName, keys = $__1.keys; function is(left, right) { if (left === right) return left !== 0 || 1 / left === 1 / right; return left !== left && right !== right; } function assign(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; var props = source == null ? [] : keys(source); var p = void 0, length = props.length; for (p = 0; p < length; p++) { var name = props[p]; if (isPrivateName(name)) continue; target[name] = source[name]; } } return target; } function mixin(target, source) { var props = getOwnPropertyNames(source); var p, descriptor, length = props.length; for (p = 0; p < length; p++) { var name = props[p]; if (isPrivateName(name)) continue; descriptor = getOwnPropertyDescriptor(source, props[p]); defineProperty(target, props[p], descriptor); } return target; } function polyfillObject(global) { var Object = global.Object; maybeAddFunctions(Object, ['assign', assign, 'is', is, 'mixin', mixin]); } registerPolyfill(polyfillObject); return { get is() { return is; }, get assign() { return assign; }, get mixin() { return mixin; }, get polyfillObject() { return polyfillObject; } }; }); System.get("traceur-runtime@0.0.90/src/runtime/polyfills/Object.js" + ''); System.registerModule("traceur-runtime@0.0.90/src/runtime/polyfills/Number.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/polyfills/Number.js"; var $__0 = System.get("traceur-runtime@0.0.90/src/runtime/polyfills/utils.js"), isNumber = $__0.isNumber, maybeAddConsts = $__0.maybeAddConsts, maybeAddFunctions = $__0.maybeAddFunctions, registerPolyfill = $__0.registerPolyfill, toInteger = $__0.toInteger; var $abs = Math.abs; var $isFinite = isFinite; var $isNaN = isNaN; var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; var MIN_SAFE_INTEGER = -Math.pow(2, 53) + 1; var EPSILON = Math.pow(2, -52); function NumberIsFinite(number) { return isNumber(number) && $isFinite(number); } function isInteger(number) { return NumberIsFinite(number) && toInteger(number) === number; } function NumberIsNaN(number) { return isNumber(number) && $isNaN(number); } function isSafeInteger(number) { if (NumberIsFinite(number)) { var integral = toInteger(number); if (integral === number) return $abs(integral) <= MAX_SAFE_INTEGER; } return false; } function polyfillNumber(global) { var Number = global.Number; maybeAddConsts(Number, ['MAX_SAFE_INTEGER', MAX_SAFE_INTEGER, 'MIN_SAFE_INTEGER', MIN_SAFE_INTEGER, 'EPSILON', EPSILON]); maybeAddFunctions(Number, ['isFinite', NumberIsFinite, 'isInteger', isInteger, 'isNaN', NumberIsNaN, 'isSafeInteger', isSafeInteger]); } registerPolyfill(polyfillNumber); return { get MAX_SAFE_INTEGER() { return MAX_SAFE_INTEGER; }, get MIN_SAFE_INTEGER() { return MIN_SAFE_INTEGER; }, get EPSILON() { return EPSILON; }, get isFinite() { return NumberIsFinite; }, get isInteger() { return isInteger; }, get isNaN() { return NumberIsNaN; }, get isSafeInteger() { return isSafeInteger; }, get polyfillNumber() { return polyfillNumber; } }; }); System.get("traceur-runtime@0.0.90/src/runtime/polyfills/Number.js" + ''); System.registerModule("traceur-runtime@0.0.90/src/runtime/polyfills/fround.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/polyfills/fround.js"; var $isFinite = isFinite; var $isNaN = isNaN; var $__0 = Math, LN2 = $__0.LN2, abs = $__0.abs, floor = $__0.floor, log = $__0.log, min = $__0.min, pow = $__0.pow; function packIEEE754(v, ebits, fbits) { var bias = (1 << (ebits - 1)) - 1, s, e, f, ln, i, bits, str, bytes; function roundToEven(n) { var w = floor(n), f = n - w; if (f < 0.5) return w; if (f > 0.5) return w + 1; return w % 2 ? w + 1 : w; } if (v !== v) { e = (1 << ebits) - 1; f = pow(2, fbits - 1); s = 0; } else if (v === Infinity || v === -Infinity) { e = (1 << ebits) - 1; f = 0; s = (v < 0) ? 1 : 0; } else if (v === 0) { e = 0; f = 0; s = (1 / v === -Infinity) ? 1 : 0; } else { s = v < 0; v = abs(v); if (v >= pow(2, 1 - bias)) { e = min(floor(log(v) / LN2), 1023); f = roundToEven(v / pow(2, e) * pow(2, fbits)); if (f / pow(2, fbits) >= 2) { e = e + 1; f = 1; } if (e > bias) { e = (1 << ebits) - 1; f = 0; } else { e = e + bias; f = f - pow(2, fbits); } } else { e = 0; f = roundToEven(v / pow(2, 1 - bias - fbits)); } } bits = []; for (i = fbits; i; i -= 1) { bits.push(f % 2 ? 1 : 0); f = floor(f / 2); } for (i = ebits; i; i -= 1) { bits.push(e % 2 ? 1 : 0); e = floor(e / 2); } bits.push(s ? 1 : 0); bits.reverse(); str = bits.join(''); bytes = []; while (str.length) { bytes.push(parseInt(str.substring(0, 8), 2)); str = str.substring(8); } return bytes; } function unpackIEEE754(bytes, ebits, fbits) { var bits = [], i, j, b, str, bias, s, e, f; for (i = bytes.length; i; i -= 1) { b = bytes[i - 1]; for (j = 8; j; j -= 1) { bits.push(b % 2 ? 1 : 0); b = b >> 1; } } bits.reverse(); str = bits.join(''); bias = (1 << (ebits - 1)) - 1; s = parseInt(str.substring(0, 1), 2) ? -1 : 1; e = parseInt(str.substring(1, 1 + ebits), 2); f = parseInt(str.substring(1 + ebits), 2); if (e === (1 << ebits) - 1) { return f !== 0 ? NaN : s * Infinity; } else if (e > 0) { return s * pow(2, e - bias) * (1 + f / pow(2, fbits)); } else if (f !== 0) { return s * pow(2, -(bias - 1)) * (f / pow(2, fbits)); } else { return s < 0 ? -0 : 0; } } function unpackF32(b) { return unpackIEEE754(b, 8, 23); } function packF32(v) { return packIEEE754(v, 8, 23); } function fround(x) { if (x === 0 || !$isFinite(x) || $isNaN(x)) { return x; } return unpackF32(packF32(Number(x))); } return {get fround() { return fround; }}; }); System.registerModule("traceur-runtime@0.0.90/src/runtime/polyfills/Math.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/polyfills/Math.js"; var jsFround = System.get("traceur-runtime@0.0.90/src/runtime/polyfills/fround.js").fround; var $__1 = System.get("traceur-runtime@0.0.90/src/runtime/polyfills/utils.js"), maybeAddFunctions = $__1.maybeAddFunctions, registerPolyfill = $__1.registerPolyfill, toUint32 = $__1.toUint32; var $isFinite = isFinite; var $isNaN = isNaN; var $__2 = Math, abs = $__2.abs, ceil = $__2.ceil, exp = $__2.exp, floor = $__2.floor, log = $__2.log, pow = $__2.pow, sqrt = $__2.sqrt; function clz32(x) { x = toUint32(+x); if (x == 0) return 32; var result = 0; if ((x & 0xFFFF0000) === 0) { x <<= 16; result += 16; } ; if ((x & 0xFF000000) === 0) { x <<= 8; result += 8; } ; if ((x & 0xF0000000) === 0) { x <<= 4; result += 4; } ; if ((x & 0xC0000000) === 0) { x <<= 2; result += 2; } ; if ((x & 0x80000000) === 0) { x <<= 1; result += 1; } ; return result; } function imul(x, y) { x = toUint32(+x); y = toUint32(+y); var xh = (x >>> 16) & 0xffff; var xl = x & 0xffff; var yh = (y >>> 16) & 0xffff; var yl = y & 0xffff; return xl * yl + (((xh * yl + xl * yh) << 16) >>> 0) | 0; } function sign(x) { x = +x; if (x > 0) return 1; if (x < 0) return -1; return x; } function log10(x) { return log(x) * 0.434294481903251828; } function log2(x) { return log(x) * 1.442695040888963407; } function log1p(x) { x = +x; if (x < -1 || $isNaN(x)) { return NaN; } if (x === 0 || x === Infinity) { return x; } if (x === -1) { return -Infinity; } var result = 0; var n = 50; if (x < 0 || x > 1) { return log(1 + x); } for (var i = 1; i < n; i++) { if ((i % 2) === 0) { result -= pow(x, i) / i; } else { result += pow(x, i) / i; } } return result; } function expm1(x) { x = +x; if (x === -Infinity) { return -1; } if (!$isFinite(x) || x === 0) { return x; } return exp(x) - 1; } function cosh(x) { x = +x; if (x === 0) { return 1; } if ($isNaN(x)) { return NaN; } if (!$isFinite(x)) { return Infinity; } if (x < 0) { x = -x; } if (x > 21) { return exp(x) / 2; } return (exp(x) + exp(-x)) / 2; } function sinh(x) { x = +x; if (!$isFinite(x) || x === 0) { return x; } return (exp(x) - exp(-x)) / 2; } function tanh(x) { x = +x; if (x === 0) return x; if (!$isFinite(x)) return sign(x); var exp1 = exp(x); var exp2 = exp(-x); return (exp1 - exp2) / (exp1 + exp2); } function acosh(x) { x = +x; if (x < 1) return NaN; if (!$isFinite(x)) return x; return log(x + sqrt(x + 1) * sqrt(x - 1)); } function asinh(x) { x = +x; if (x === 0 || !$isFinite(x)) return x; if (x > 0) return log(x + sqrt(x * x + 1)); return -log(-x + sqrt(x * x + 1)); } function atanh(x) { x = +x; if (x === -1) { return -Infinity; } if (x === 1) { return Infinity; } if (x === 0) { return x; } if ($isNaN(x) || x < -1 || x > 1) { return NaN; } return 0.5 * log((1 + x) / (1 - x)); } function hypot(x, y) { var length = arguments.length; var args = new Array(length); var max = 0; for (var i = 0; i < length; i++) { var n = arguments[i]; n = +n; if (n === Infinity || n === -Infinity) return Infinity; n = abs(n); if (n > max) max = n; args[i] = n; } if (max === 0) max = 1; var sum = 0; var compensation = 0; for (var i = 0; i < length; i++) { var n = args[i] / max; var summand = n * n - compensation; var preliminary = sum + summand; compensation = (preliminary - sum) - summand; sum = preliminary; } return sqrt(sum) * max; } function trunc(x) { x = +x; if (x > 0) return floor(x); if (x < 0) return ceil(x); return x; } var fround, f32; if (typeof Float32Array === 'function') { f32 = new Float32Array(1); fround = function(x) { f32[0] = Number(x); return f32[0]; }; } else { fround = jsFround; } function cbrt(x) { x = +x; if (x === 0) return x; var negate = x < 0; if (negate) x = -x; var result = pow(x, 1 / 3); return negate ? -result : result; } function polyfillMath(global) { var Math = global.Math; maybeAddFunctions(Math, ['acosh', acosh, 'asinh', asinh, 'atanh', atanh, 'cbrt', cbrt, 'clz32', clz32, 'cosh', cosh, 'expm1', expm1, 'fround', fround, 'hypot', hypot, 'imul', imul, 'log10', log10, 'log1p', log1p, 'log2', log2, 'sign', sign, 'sinh', sinh, 'tanh', tanh, 'trunc', trunc]); } registerPolyfill(polyfillMath); return { get clz32() { return clz32; }, get imul() { return imul; }, get sign() { return sign; }, get log10() { return log10; }, get log2() { return log2; }, get log1p() { return log1p; }, get expm1() { return expm1; }, get cosh() { return cosh; }, get sinh() { return sinh; }, get tanh() { return tanh; }, get acosh() { return acosh; }, get asinh() { return asinh; }, get atanh() { return atanh; }, get hypot() { return hypot; }, get trunc() { return trunc; }, get fround() { return fround; }, get cbrt() { return cbrt; }, get polyfillMath() { return polyfillMath; } }; }); System.get("traceur-runtime@0.0.90/src/runtime/polyfills/Math.js" + ''); System.registerModule("traceur-runtime@0.0.90/src/runtime/polyfills/polyfills.js", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.90/src/runtime/polyfills/polyfills.js"; var polyfillAll = System.get("traceur-runtime@0.0.90/src/runtime/polyfills/utils.js").polyfillAll; polyfillAll(Reflect.global); var setupGlobals = $traceurRuntime.setupGlobals; $traceurRuntime.setupGlobals = function(global) { setupGlobals(global); polyfillAll(global); }; return {}; }); System.get("traceur-runtime@0.0.90/src/runtime/polyfills/polyfills.js" + ''); System = curSystem; })(); (function(global) { var defined = {}; // indexOf polyfill for IE8 var indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) if (this[i] === item) return i; return -1; } function dedupe(deps) { var newDeps = []; for (var i = 0, l = deps.length; i < l; i++) if (indexOf.call(newDeps, deps[i]) == -1) newDeps.push(deps[i]) return newDeps; } function register(name, deps, declare) { if (arguments.length === 4) return registerDynamic.apply(this, arguments); doRegister(name, { declarative: true, deps: deps, declare: declare }); } function registerDynamic(name, deps, executingRequire, execute) { doRegister(name, { declarative: false, deps: deps, executingRequire: executingRequire, execute: execute }); } function doRegister(name, entry) { entry.name = name; // we never overwrite an existing define if (!(name in defined)) defined[name] = entry; entry.deps = dedupe(entry.deps); // we have to normalize dependencies // (assume dependencies are normalized for now) // entry.normalizedDeps = entry.deps.map(normalize); entry.normalizedDeps = entry.deps; } function buildGroups(entry, groups) { groups[entry.groupIndex] = groups[entry.groupIndex] || []; if (indexOf.call(groups[entry.groupIndex], entry) != -1) return; groups[entry.groupIndex].push(entry); for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) { var depName = entry.normalizedDeps[i]; var depEntry = defined[depName]; // not in the registry means already linked / ES6 if (!depEntry || depEntry.evaluated) continue; // now we know the entry is in our unlinked linkage group var depGroupIndex = entry.groupIndex + (depEntry.declarative != entry.declarative); // the group index of an entry is always the maximum if (depEntry.groupIndex === undefined || depEntry.groupIndex < depGroupIndex) { // if already in a group, remove from the old group if (depEntry.groupIndex !== undefined) { groups[depEntry.groupIndex].splice(indexOf.call(groups[depEntry.groupIndex], depEntry), 1); // if the old group is empty, then we have a mixed depndency cycle if (groups[depEntry.groupIndex].length == 0) throw new TypeError("Mixed dependency cycle detected"); } depEntry.groupIndex = depGroupIndex; } buildGroups(depEntry, groups); } } function link(name) { var startEntry = defined[name]; startEntry.groupIndex = 0; var groups = []; buildGroups(startEntry, groups); var curGroupDeclarative = !!startEntry.declarative == groups.length % 2; for (var i = groups.length - 1; i >= 0; i--) { var group = groups[i]; for (var j = 0; j < group.length; j++) { var entry = group[j]; // link each group if (curGroupDeclarative) linkDeclarativeModule(entry); else linkDynamicModule(entry); } curGroupDeclarative = !curGroupDeclarative; } } // module binding records var moduleRecords = {}; function getOrCreateModuleRecord(name) { return moduleRecords[name] || (moduleRecords[name] = { name: name, dependencies: [], exports: {}, // start from an empty module and extend importers: [] }) } function linkDeclarativeModule(entry) { // only link if already not already started linking (stops at circular) if (entry.module) return; var module = entry.module = getOrCreateModuleRecord(entry.name); var exports = entry.module.exports; var declaration = entry.declare.call(global, function(name, value) { module.locked = true; exports[name] = value; for (var i = 0, l = module.importers.length; i < l; i++) { var importerModule = module.importers[i]; if (!importerModule.locked) { var importerIndex = indexOf.call(importerModule.dependencies, module); importerModule.setters[importerIndex](exports); } } module.locked = false; return value; }); module.setters = declaration.setters; module.execute = declaration.execute; // now link all the module dependencies for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) { var depName = entry.normalizedDeps[i]; var depEntry = defined[depName]; var depModule = moduleRecords[depName]; // work out how to set depExports based on scenarios... var depExports; if (depModule) { depExports = depModule.exports; } else if (depEntry && !depEntry.declarative) { depExports = depEntry.esModule; } // in the module registry else if (!depEntry) { depExports = load(depName); } // we have an entry -> link else { linkDeclarativeModule(depEntry); depModule = depEntry.module; depExports = depModule.exports; } // only declarative modules have dynamic bindings if (depModule && depModule.importers) { depModule.importers.push(module); module.dependencies.push(depModule); } else module.dependencies.push(null); // run the setter for this dependency if (module.setters[i]) module.setters[i](depExports); } } // An analog to loader.get covering execution of all three layers (real declarative, simulated declarative, simulated dynamic) function getModule(name) { var exports; var entry = defined[name]; if (!entry) { exports = load(name); if (!exports) throw new Error("Unable to load dependency " + name + "."); } else { if (entry.declarative) ensureEvaluated(name, []); else if (!entry.evaluated) linkDynamicModule(entry); exports = entry.module.exports; } if ((!entry || entry.declarative) && exports && exports.__useDefault) return exports['default']; return exports; } function linkDynamicModule(entry) { if (entry.module) return; var exports = {}; var module = entry.module = { exports: exports, id: entry.name }; // AMD requires execute the tree first if (!entry.executingRequire) { for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) { var depName = entry.normalizedDeps[i]; var depEntry = defined[depName]; if (depEntry) linkDynamicModule(depEntry); } } // now execute entry.evaluated = true; var output = entry.execute.call(global, function(name) { for (var i = 0, l = entry.deps.length; i < l; i++) { if (entry.deps[i] != name) continue; return getModule(entry.normalizedDeps[i]); } throw new TypeError('Module ' + name + ' not declared as a dependency.'); }, exports, module); if (output) module.exports = output; // create the esModule object, which allows ES6 named imports of dynamics exports = module.exports; if (exports && exports.__esModule) { entry.esModule = exports; } else { var hasOwnProperty = exports && exports.hasOwnProperty; entry.esModule = {}; for (var p in exports) { if (!hasOwnProperty || exports.hasOwnProperty(p)) entry.esModule[p] = exports[p]; } entry.esModule['default'] = exports; entry.esModule.__useDefault = true; } } /* * Given a module, and the list of modules for this current branch, * ensure that each of the dependencies of this module is evaluated * (unless one is a circular dependency already in the list of seen * modules, in which case we execute it) * * Then we evaluate the module itself depth-first left to right * execution to match ES6 modules */ function ensureEvaluated(moduleName, seen) { var entry = defined[moduleName]; // if already seen, that means it's an already-evaluated non circular dependency if (!entry || entry.evaluated || !entry.declarative) return; // this only applies to declarative modules which late-execute seen.push(moduleName); for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) { var depName = entry.normalizedDeps[i]; if (indexOf.call(seen, depName) == -1) { if (!defined[depName]) load(depName); else ensureEvaluated(depName, seen); } } if (entry.evaluated) return; entry.evaluated = true; entry.module.execute.call(global); } // magical execution function var modules = {}; function load(name) { if (modules[name]) return modules[name]; var entry = defined[name]; // first we check if this module has already been defined in the registry if (!entry) throw "Module " + name + " not present."; // recursively ensure that the module and all its // dependencies are linked (with dependency group handling) link(name); // now handle dependency execution in correct order ensureEvaluated(name, []); // remove from the registry defined[name] = undefined; // return the defined module object return modules[name] = entry.declarative ? entry.module.exports : entry.esModule; }; return function(mains, declare) { return function(formatDetect) { formatDetect(function() { var System = { _nodeRequire: typeof require != 'undefined' && require.resolve && typeof process != 'undefined' && require, register: register, registerDynamic: registerDynamic, get: load, set: function(name, module) { modules[name] = module; }, newModule: function(module) { return module; }, 'import': function() { throw new TypeError('Dynamic System.import calls are not supported for SFX bundles. Rather use a named bundle.'); } }; System.set('@empty', {}); declare(System); var firstLoad = load(mains[0]); if (mains.length > 1) for (var i = 1; i < mains.length; i++) load(mains[i]); return firstLoad; }); }; }; })(typeof self != 'undefined' ? self : global) /* (['mainModule'], function(System) { System.register(...); }) (function(factory) { if (typeof define && define.amd) define(factory); // etc UMD / module pattern })*/ (['Worker/Manager.js'], function(System) { (function(__global) { var loader = System; var indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) if (this[i] === item) return i; return -1; } var commentRegEx = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg; var cjsRequirePre = "(?:^|[^$_a-zA-Z\\xA0-\\uFFFF.])"; var cjsRequirePost = "\\s*\\(\\s*(\"([^\"]+)\"|'([^']+)')\\s*\\)"; var fnBracketRegEx = /\(([^\)]*)\)/; var wsRegEx = /^\s+|\s+$/g; var requireRegExs = {}; function getCJSDeps(source, requireIndex) { // remove comments source = source.replace(commentRegEx, ''); // determine the require alias var params = source.match(fnBracketRegEx); var requireAlias = (params[1].split(',')[requireIndex] || 'require').replace(wsRegEx, ''); // find or generate the regex for this requireAlias var requireRegEx = requireRegExs[requireAlias] || (requireRegExs[requireAlias] = new RegExp(cjsRequirePre + requireAlias + cjsRequirePost, 'g')); requireRegEx.lastIndex = 0; var deps = []; var match; while (match = requireRegEx.exec(source)) deps.push(match[2] || match[3]); return deps; } /* AMD-compatible require To copy RequireJS, set window.require = window.requirejs = loader.amdRequire */ function require(names, callback, errback, referer) { // in amd, first arg can be a config object... we just ignore if (typeof names == 'object' && !(names instanceof Array)) return require.apply(null, Array.prototype.splice.call(arguments, 1, arguments.length - 1)); // amd require if (typeof names == 'string' && typeof callback == 'function') names = [names]; if (names instanceof Array) { var dynamicRequires = []; for (var i = 0; i < names.length; i++) dynamicRequires.push(loader['import'](names[i], referer)); Promise.all(dynamicRequires).then(function(modules) { if (callback) callback.apply(null, modules); }, errback); } // commonjs require else if (typeof names == 'string') { var module = loader.get(names); return module.__useDefault ? module['default'] : module; } else throw new TypeError('Invalid require'); }; function define(name, deps, factory) { if (typeof name != 'string') { factory = deps; deps = name; name = null; } if (!(deps instanceof Array)) { factory = deps; deps = ['require', 'exports', 'module'].splice(0, factory.length); } if (typeof factory != 'function') factory = (function(factory) { return function() { return factory; } })(factory); // in IE8, a trailing comma becomes a trailing undefined entry if (deps[deps.length - 1] === undefined) deps.pop(); // remove system dependencies var requireIndex, exportsIndex, moduleIndex; if ((requireIndex = indexOf.call(deps, 'require')) != -1) { deps.splice(requireIndex, 1); // only trace cjs requires for non-named // named defines assume the trace has already been done if (!name) deps = deps.concat(getCJSDeps(factory.toString(), requireIndex)); } if ((exportsIndex = indexOf.call(deps, 'exports')) != -1) deps.splice(exportsIndex, 1); if ((moduleIndex = indexOf.call(deps, 'module')) != -1) deps.splice(moduleIndex, 1); var define = { name: name, deps: deps, execute: function(req, exports, module) { var depValues = []; for (var i = 0; i < deps.length; i++) depValues.push(req(deps[i])); module.uri = loader.baseURL + (module.id[0] == '/' ? module.id : '/' + module.id); module.config = function() {}; // add back in system dependencies if (moduleIndex != -1) depValues.splice(moduleIndex, 0, module); if (exportsIndex != -1) depValues.splice(exportsIndex, 0, exports); if (requireIndex != -1) depValues.splice(requireIndex, 0, function(names, callback, errback) { if (typeof names == 'string' && typeof callback != 'function') return req(names); return require.call(loader, names, callback, errback, module.id); }); // set global require to AMD require var curRequire = __global.require; __global.require = require; var output = factory.apply(exportsIndex == -1 ? __global : exports, depValues); __global.require = curRequire; if (typeof output == 'undefined' && module) output = module.exports; if (typeof output != 'undefined') return output; } }; // anonymous define if (!name) { // already defined anonymously -> throw if (lastModule.anonDefine) throw new TypeError('Multiple defines for anonymous module'); lastModule.anonDefine = define; } // named define else { // if it has no dependencies and we don't have any other // defines, then let this be an anonymous define // this is just to support single modules of the form: // define('jquery') // still loading anonymously // because it is done widely enough to be useful if (deps.length == 0 && !lastModule.anonDefine && !lastModule.isBundle) { lastModule.anonDefine = define; } // otherwise its a bundle only else { // if there is an anonDefine already (we thought it could have had a single named define) // then we define it now // this is to avoid defining named defines when they are actually anonymous if (lastModule.anonDefine && lastModule.anonDefine.name) loader.registerDynamic(lastModule.anonDefine.name, lastModule.anonDefine.deps, false, lastModule.anonDefine.execute); lastModule.anonDefine = null; } // note this is now a bundle lastModule.isBundle = true; // define the module through the register registry loader.registerDynamic(name, define.deps, false, define.execute); } } define.amd = {}; // adds define as a global (potentially just temporarily) function createDefine(loader) { lastModule.anonDefine = null; lastModule.isBundle = false; // ensure no NodeJS environment detection var oldModule = __global.module; var oldExports = __global.exports; var oldDefine = __global.define; __global.module = undefined; __global.exports = undefined; __global.define = define; return function() { __global.define = oldDefine; __global.module = oldModule; __global.exports = oldExports; }; } var lastModule = { isBundle: false, anonDefine: null }; loader.set('@@amd-helpers', loader.newModule({ createDefine: createDefine, require: require, define: define, lastModule: lastModule })); loader.amdDefine = define; loader.amdRequire = require; })(typeof self != 'undefined' ? self : global); System.registerDynamic("npm:process@0.10.1/browser.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var process = module.exports = {}; var queue = []; var draining = false; function drainQueue() { if (draining) { return; } draining = true; var currentQueue; var len = queue.length; while (len) { currentQueue = queue; queue = []; var i = -1; while (++i < len) { currentQueue[i](); } len = queue.length; } draining = false; } process.nextTick = function(fun) { queue.push(fun); if (!draining) { setTimeout(drainQueue, 0); } }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.binding = function(name) { throw new Error('process.binding is not supported'); }; process.cwd = function() { return '/'; }; process.chdir = function(dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; global.define = __define; return module.exports; }); System.registerDynamic("npm:eventemitter3@1.1.0/index.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; 'use strict'; var prefix = typeof Object.create !== 'function' ? '~' : false; function EE(fn, context, once) { this.fn = fn; this.context = context; this.once = once || false; } function EventEmitter() {} EventEmitter.prototype._events = undefined; EventEmitter.prototype.listeners = function listeners(event, exists) { var evt = prefix ? prefix + event : event, available = this._events && this._events[evt]; if (exists) return !!available; if (!available) return []; if (this._events[evt].fn) return [this._events[evt].fn]; for (var i = 0, l = this._events[evt].length, ee = new Array(l); i < l; i++) { ee[i] = this._events[evt][i].fn; } return ee; }; EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { var evt = prefix ? prefix + event : event; if (!this._events || !this._events[evt]) return false; var listeners = this._events[evt], len = arguments.length, args, i; if ('function' === typeof listeners.fn) { if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); switch (len) { case 1: return listeners.fn.call(listeners.context), true; case 2: return listeners.fn.call(listeners.context, a1), true; case 3: return listeners.fn.call(listeners.context, a1, a2), true; case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; } for (i = 1, args = new Array(len - 1); i < len; i++) { args[i - 1] = arguments[i]; } listeners.fn.apply(listeners.context, args); } else { var length = listeners.length, j; for (i = 0; i < length; i++) { if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); switch (len) { case 1: listeners[i].fn.call(listeners[i].context); break; case 2: listeners[i].fn.call(listeners[i].context, a1); break; case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; default: if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) { args[j - 1] = arguments[j]; } listeners[i].fn.apply(listeners[i].context, args); } } } return true; }; EventEmitter.prototype.on = function on(event, fn, context) { var listener = new EE(fn, context || this), evt = prefix ? prefix + event : event; if (!this._events) this._events = prefix ? {} : Object.create(null); if (!this._events[evt]) this._events[evt] = listener; else { if (!this._events[evt].fn) this._events[evt].push(listener); else this._events[evt] = [this._events[evt], listener]; } return this; }; EventEmitter.prototype.once = function once(event, fn, context) { var listener = new EE(fn, context || this, true), evt = prefix ? prefix + event : event; if (!this._events) this._events = prefix ? {} : Object.create(null); if (!this._events[evt]) this._events[evt] = listener; else { if (!this._events[evt].fn) this._events[evt].push(listener); else this._events[evt] = [this._events[evt], listener]; } return this; }; EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { var evt = prefix ? prefix + event : event; if (!this._events || !this._events[evt]) return this; var listeners = this._events[evt], events = []; if (fn) { if (listeners.fn) { if (listeners.fn !== fn || (once && !listeners.once) || (context && listeners.context !== context)) { events.push(listeners); } } else { for (var i = 0, length = listeners.length; i < length; i++) { if (listeners[i].fn !== fn || (once && !listeners[i].once) || (context && listeners[i].context !== context)) { events.push(listeners[i]); } } } } if (events.length) { this._events[evt] = events.length === 1 ? events[0] : events; } else { delete this._events[evt]; } return this; }; EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { if (!this._events) return this; if (event) delete this._events[prefix ? prefix + event : event]; else this._events = prefix ? {} : Object.create(null); return this; }; EventEmitter.prototype.off = EventEmitter.prototype.removeListener; EventEmitter.prototype.addListener = EventEmitter.prototype.on; EventEmitter.prototype.setMaxListeners = function setMaxListeners() { return this; }; EventEmitter.prefixed = prefix; module.exports = EventEmitter; global.define = __define; return module.exports; }); (function() { var _removeDefine = System.get("@@amd-helpers").createDefine(); define("Worker/xmljs.js", ["require"], function(require) { return function(config) { 'use strict'; var VERSION = "1.1.6"; config = config || {}; initConfigDefaults(); initRequiredPolyfills(); function initConfigDefaults() { if (config.escapeMode === undefined) { config.escapeMode = true; } config.attributePrefix = config.attributePrefix || "_"; config.arrayAccessForm = config.arrayAccessForm || "none"; config.emptyNodeForm = config.emptyNodeForm || "text"; if (config.enableToStringFunc === undefined) { config.enableToStringFunc = true; } config.arrayAccessFormPaths = config.arrayAccessFormPaths || []; if (config.skipEmptyTextNodesForObj === undefined) { config.skipEmptyTextNodesForObj = true; } if (config.stripWhitespaces === undefined) { config.stripWhitespaces = true; } config.datetimeAccessFormPaths = config.datetimeAccessFormPaths || []; } var DOMNodeTypes = { ELEMENT_NODE: 1, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, COMMENT_NODE: 8, DOCUMENT_NODE: 9 }; function initRequiredPolyfills() { function pad(number) { var r = String(number); if (r.length === 1) { r = '0' + r; } return r; } if (typeof String.prototype.trim !== 'function') { String.prototype.trim = function() { return this.replace(/^\s+|^\n+|(\s|\n)+$/g, ''); }; } if (typeof Date.prototype.toISOString !== 'function') { Date.prototype.toISOString = function() { return this.getUTCFullYear() + '-' + pad(this.getUTCMonth() + 1) + '-' + pad(this.getUTCDate()) + 'T' + pad(this.getUTCHours()) + ':' + pad(this.getUTCMinutes()) + ':' + pad(this.getUTCSeconds()) + '.' + String((this.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + 'Z'; }; } } function getNodeLocalName(node) { var nodeLocalName = node.localName; if (nodeLocalName == null) nodeLocalName = node.baseName; if (nodeLocalName == null || nodeLocalName == "") nodeLocalName = node.nodeName; return nodeLocalName; } function getNodePrefix(node) { return node.prefix; } function escapeXmlChars(str) { if (typeof(str) == "string") return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;'); else return str; } function unescapeXmlChars(str) { return str.replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&#x27;/g, "'"); } function toArrayAccessForm(obj, childName, path) { switch (config.arrayAccessForm) { case "property": if (!(obj[childName] instanceof Array)) obj[childName + "_asArray"] = [obj[childName]]; else obj[childName + "_asArray"] = obj[childName]; break; } if (!(obj[childName] instanceof Array) && config.arrayAccessFormPaths.length > 0) { var idx = 0; for (; idx < config.arrayAccessFormPaths.length; idx++) { var arrayPath = config.arrayAccessFormPaths[idx]; if (typeof arrayPath === "string") { if (arrayPath == path) break; } else if (arrayPath instanceof RegExp) { if (arrayPath.test(path)) break; } else if (typeof arrayPath === "function") { if (arrayPath(obj, childName, path)) break; } } if (idx != config.arrayAccessFormPaths.length) { obj[childName] = [obj[childName]]; } } } function fromXmlDateTime(prop) { var bits = prop.split(/[-T:+Z]/g); var d = new Date(bits[0], bits[1] - 1, bits[2]); var secondBits = bits[5].split("\."); d.setHours(bits[3], bits[4], secondBits[0]); if (secondBits.length > 1) d.setMilliseconds(secondBits[1]); if (bits[6] && bits[7]) { var offsetMinutes = bits[6] * 60 + Number(bits[7]); var sign = /\d\d-\d\d:\d\d$/.test(prop) ? '-' : '+'; offsetMinutes = 0 + (sign == '-' ? -1 * offsetMinutes : offsetMinutes); d.setMinutes(d.getMinutes() - offsetMinutes - d.getTimezoneOffset()); } else if (prop.indexOf("Z", prop.length - 1) !== -1) { d = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds())); } return d; } function checkFromXmlDateTimePaths(value, childName, fullPath) { if (config.datetimeAccessFormPaths.length > 0) { var path = fullPath.split("\.#")[0]; var idx = 0; for (; idx < config.datetimeAccessFormPaths.length; idx++) { var dtPath = config.datetimeAccessFormPaths[idx]; if (typeof dtPath === "string") { if (dtPath == path) break; } else if (dtPath instanceof RegExp) { if (dtPath.test(path)) break; } else if (typeof dtPath === "function") { if (dtPath(obj, childName, path)) break; } } if (idx != config.datetimeAccessFormPaths.length) { return fromXmlDateTime(value); } else return value; } else return value; } function parseDOMChildren(node, path) { if (node.nodeType == DOMNodeTypes.DOCUMENT_NODE) { var result = new Object; var nodeChildren = node.childNodes; for (var cidx = 0; cidx < nodeChildren.length; cidx++) { var child = nodeChildren.item(cidx); if (child.nodeType == DOMNodeTypes.ELEMENT_NODE) { var childName = getNodeLocalName(child); result[childName] = parseDOMChildren(child, childName); } } return result; } else if (node.nodeType == DOMNodeTypes.ELEMENT_NODE) { var result = new Object; result.__cnt = 0; var nodeChildren = node.childNodes; for (var cidx = 0; cidx < nodeChildren.length; cidx++) { var child = nodeChildren.item(cidx); var childName = getNodeLocalName(child); if (child.nodeType != DOMNodeTypes.COMMENT_NODE) { result.__cnt++; if (result[childName] == null) { result[childName] = parseDOMChildren(child, path + "." + childName); toArrayAccessForm(result, childName, path + "." + childName); } else { if (result[childName] != null) { if (!(result[childName] instanceof Array)) { result[childName] = [result[childName]]; toArrayAccessForm(result, childName, path + "." + childName); } } (result[childName])[result[childName].length] = parseDOMChildren(child, path + "." + childName); } } } for (var aidx = 0; aidx < node.attributes.length; aidx++) { var attr = node.attributes.item(aidx); result.__cnt++; result[config.attributePrefix + attr.name] = attr.value; } var nodePrefix = getNodePrefix(node); if (nodePrefix != null && nodePrefix != "") { result.__cnt++; result.__prefix = nodePrefix; } if (result["#text"] != null) { result.__text = result["#text"]; if (result.__text instanceof Array) { result.__text = result.__text.join("\n"); } if (config.escapeMode) result.__text = unescapeXmlChars(result.__text); if (config.stripWhitespaces) result.__text = result.__text.trim(); delete result["#text"]; if (config.arrayAccessForm == "property") delete result["#text_asArray"]; result.__text = checkFromXmlDateTimePaths(result.__text, childName, path + "." + childName); } if (result["#cdata-section"] != null) { result.__cdata = result["#cdata-section"]; delete result["#cdata-section"]; if (config.arrayAccessForm == "property") delete result["#cdata-section_asArray"]; } if (result.__cnt == 1 && result.__text != null) { result = result.__text; } else if (result.__cnt == 0 && config.emptyNodeForm == "text") { result = ''; } else if (result.__cnt > 1 && result.__text != null && config.skipEmptyTextNodesForObj) { if ((config.stripWhitespaces && result.__text == "") || (result.__text.trim() == "")) { delete result.__text; } } delete result.__cnt; if (config.enableToStringFunc && (result.__text != null || result.__cdata != null)) { result.toString = function() { return (this.__text != null ? this.__text : '') + (this.__cdata != null ? this.__cdata : ''); }; } return result; } else if (node.nodeType == DOMNodeTypes.TEXT_NODE || node.nodeType == DOMNodeTypes.CDATA_SECTION_NODE) { return node.nodeValue; } } function startTag(jsonObj, element, attrList, closed) { var resultStr = "<" + ((jsonObj != null && jsonObj.__prefix != null) ? (jsonObj.__prefix + ":") : "") + element; if (attrList != null) { for (var aidx = 0; aidx < attrList.length; aidx++) { var attrName = attrList[aidx]; var attrVal = jsonObj[attrName]; if (config.escapeMode) attrVal = escapeXmlChars(attrVal); resultStr += " " + attrName.substr(config.attributePrefix.length) + "='" + attrVal + "'"; } } if (!closed) resultStr += ">"; else resultStr += "/>"; return resultStr; } function endTag(jsonObj, elementName) { return "</" + (jsonObj.__prefix != null ? (jsonObj.__prefix + ":") : "") + elementName + ">"; } function endsWith(str, suffix) { return str.indexOf(suffix, str.length - suffix.length) !== -1; } function jsonXmlSpecialElem(jsonObj, jsonObjField) { if ((config.arrayAccessForm == "property" && endsWith(jsonObjField.toString(), ("_asArray"))) || jsonObjField.toString().indexOf(config.attributePrefix) == 0 || jsonObjField.toString().indexOf("__") == 0 || (jsonObj[jsonObjField] instanceof Function)) return true; else return false; } function jsonXmlElemCount(jsonObj) { var elementsCnt = 0; if (jsonObj instanceof Object) { for (var it in jsonObj) { if (jsonXmlSpecialElem(jsonObj, it)) continue; elementsCnt++; } } return elementsCnt; } function parseJSONAttributes(jsonObj) { var attrList = []; if (jsonObj instanceof Object) { for (var ait in jsonObj) { if (ait.toString().indexOf("__") == -1 && ait.toString().indexOf(config.attributePrefix) == 0) { attrList.push(ait); } } } return attrList; } function parseJSONTextAttrs(jsonTxtObj) { var result = ""; if (jsonTxtObj.__cdata != null) { result += "<![CDATA[" + jsonTxtObj.__cdata + "]]>"; } if (jsonTxtObj.__text != null) { if (config.escapeMode) result += escapeXmlChars(jsonTxtObj.__text); else result += jsonTxtObj.__text; } return result; } function parseJSONTextObject(jsonTxtObj) { var result = ""; if (jsonTxtObj instanceof Object) { result += parseJSONTextAttrs(jsonTxtObj); } else if (jsonTxtObj != null) { if (config.escapeMode) result += escapeXmlChars(jsonTxtObj); else result += jsonTxtObj; } return result; } function parseJSONArray(jsonArrRoot, jsonArrObj, attrList) { var result = ""; if (jsonArrRoot.length == 0) { result += startTag(jsonArrRoot, jsonArrObj, attrList, true); } else { for (var arIdx = 0; arIdx < jsonArrRoot.length; arIdx++) { result += startTag(jsonArrRoot[arIdx], jsonArrObj, parseJSONAttributes(jsonArrRoot[arIdx]), false); result += parseJSONObject(jsonArrRoot[arIdx]); result += endTag(jsonArrRoot[arIdx], jsonArrObj); } } return result; } function parseJSONObject(jsonObj) { var result = ""; var elementsCnt = jsonXmlElemCount(jsonObj); if (elementsCnt > 0) { for (var it in jsonObj) { if (jsonXmlSpecialElem(jsonObj, it)) continue; var subObj = jsonObj[it]; var attrList = parseJSONAttributes(subObj); if (subObj == null || subObj == undefined) { result += startTag(subObj, it, attrList, true); } else if (subObj instanceof Object) { if (subObj instanceof Array) { result += parseJSONArray(subObj, it, attrList); } else if (subObj instanceof Date) { result += startTag(subObj, it, attrList, false); result += subObj.toISOString(); result += endTag(subObj, it); } else { var subObjElementsCnt = jsonXmlElemCount(subObj); if (subObjElementsCnt > 0 || subObj.__text != null || subObj.__cdata != null) { result += startTag(subObj, it, attrList, false); result += parseJSONObject(subObj); result += endTag(subObj, it); } else { result += startTag(subObj, it, attrList, true); } } } else { result += startTag(subObj, it, attrList, false); result += parseJSONTextObject(subObj); result += endTag(subObj, it); } } } result += parseJSONTextObject(jsonObj); return result; } this.parseXmlString = function(xmlDocStr) { var isIEParser = window.ActiveXObject || "ActiveXObject" in window; if (xmlDocStr === undefined) { return null; } var xmlDoc; if (window.DOMParser) { var parser = new window.DOMParser(); var parsererrorNS = null; if (!isIEParser) { try { parsererrorNS = parser.parseFromString("INVALID", "text/xml").childNodes[0].namespaceURI; } catch (err) { parsererrorNS = null; } } try { xmlDoc = parser.parseFromString(xmlDocStr, "text/xml"); if (parsererrorNS != null && xmlDoc.getElementsByTagNameNS(parsererrorNS, "parsererror").length > 0) { xmlDoc = null; } } catch (err) { xmlDoc = null; } } else { if (xmlDocStr.indexOf("<?") == 0) { xmlDocStr = xmlDocStr.substr(xmlDocStr.indexOf("?>") + 2); } xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = "false"; xmlDoc.loadXML(xmlDocStr); } return xmlDoc; }; this.asArray = function(prop) { if (prop instanceof Array) return prop; else return [prop]; }; this.toXmlDateTime = function(dt) { if (dt instanceof Date) return dt.toISOString(); else if (typeof(dt) === 'number') return new Date(dt).toISOString(); else return null; }; this.asDateTime = function(prop) { if (typeof(prop) == "string") { return fromXmlDateTime(prop); } else return prop; }; this.xml2json = function(xmlDoc) { return parseDOMChildren(xmlDoc); }; this.xml_str2json = function(xmlDocStr) { var xmlDoc = this.parseXmlString(xmlDocStr); if (xmlDoc != null) return this.xml2json(xmlDoc); else return null; }; this.json2xml_str = function(jsonObj) { return parseJSONObject(jsonObj); }; this.json2xml = function(jsonObj) { var xmlDocStr = this.json2xml_str(jsonObj); return this.parseXmlString(xmlDocStr); }; this.getVersion = function() { return VERSION; }; }; }); _removeDefine(); })(); System.registerDynamic("npm:events@1.0.2/events.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; } module.exports = EventEmitter; EventEmitter.EventEmitter = EventEmitter; EventEmitter.prototype._events = undefined; EventEmitter.prototype._maxListeners = undefined; EventEmitter.defaultMaxListeners = 10; EventEmitter.prototype.setMaxListeners = function(n) { if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number'); this._maxListeners = n; return this; }; EventEmitter.prototype.emit = function(type) { var er, handler, len, args, i, listeners; if (!this._events) this._events = {}; if (type === 'error') { if (!this._events.error || (isObject(this._events.error) && !this._events.error.length)) { er = arguments[1]; if (er instanceof Error) { throw er; } throw TypeError('Uncaught, unspecified "error" event.'); } } handler = this._events[type]; if (isUndefined(handler)) return false; if (isFunction(handler)) { switch (arguments.length) { case 1: handler.call(this); break; case 2: handler.call(this, arguments[1]); break; case 3: handler.call(this, arguments[1], arguments[2]); break; default: len = arguments.length; args = new Array(len - 1); for (i = 1; i < len; i++) args[i - 1] = arguments[i]; handler.apply(this, args); } } else if (isObject(handler)) { len = arguments.length; args = new Array(len - 1); for (i = 1; i < len; i++) args[i - 1] = arguments[i]; listeners = handler.slice(); len = listeners.length; for (i = 0; i < len; i++) listeners[i].apply(this, args); } return true; }; EventEmitter.prototype.addListener = function(type, listener) { var m; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events) this._events = {}; if (this._events.newListener) this.emit('newListener', type, isFunction(listener.listener) ? listener.listener : listener); if (!this._events[type]) this._events[type] = listener; else if (isObject(this._events[type])) this._events[type].push(listener); else this._events[type] = [this._events[type], listener]; if (isObject(this._events[type]) && !this._events[type].warned) { var m; if (!isUndefined(this._maxListeners)) { m = this._maxListeners; } else { m = EventEmitter.defaultMaxListeners; } if (m && m > 0 && this._events[type].length > m) { this._events[type].warned = true; console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length); if (typeof console.trace === 'function') { console.trace(); } } } return this; }; EventEmitter.prototype.on = EventEmitter.prototype.addListener; EventEmitter.prototype.once = function(type, listener) { if (!isFunction(listener)) throw TypeError('listener must be a function'); var fired = false; function g() { this.removeListener(type, g); if (!fired) { fired = true; listener.apply(this, arguments); } } g.listener = listener; this.on(type, g); return this; }; EventEmitter.prototype.removeListener = function(type, listener) { var list, position, length, i; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events || !this._events[type]) return this; list = this._events[type]; length = list.length; position = -1; if (list === listener || (isFunction(list.listener) && list.listener === listener)) { delete this._events[type]; if (this._events.removeListener) this.emit('removeListener', type, listener); } else if (isObject(list)) { for (i = length; i-- > 0; ) { if (list[i] === listener || (list[i].listener && list[i].listener === listener)) { position = i; break; } } if (position < 0) return this; if (list.length === 1) { list.length = 0; delete this._events[type]; } else { list.splice(position, 1); } if (this._events.removeListener) this.emit('removeListener', type, listener); } return this; }; EventEmitter.prototype.removeAllListeners = function(type) { var key, listeners; if (!this._events) return this; if (!this._events.removeListener) { if (arguments.length === 0) this._events = {}; else if (this._events[type]) delete this._events[type]; return this; } if (arguments.length === 0) { for (key in this._events) { if (key === 'removeListener') continue; this.removeAllListeners(key); } this.removeAllListeners('removeListener'); this._events = {}; return this; } listeners = this._events[type]; if (isFunction(listeners)) { this.removeListener(type, listeners); } else { while (listeners.length) this.removeListener(type, listeners[listeners.length - 1]); } delete this._events[type]; return this; }; EventEmitter.prototype.listeners = function(type) { var ret; if (!this._events || !this._events[type]) ret = []; else if (isFunction(this._events[type])) ret = [this._events[type]]; else ret = this._events[type].slice(); return ret; }; EventEmitter.listenerCount = function(emitter, type) { var ret; if (!emitter._events || !emitter._events[type]) ret = 0; else if (isFunction(emitter._events[type])) ret = 1; else ret = emitter._events[type].length; return ret; }; function isFunction(arg) { return typeof arg === 'function'; } function isNumber(arg) { return typeof arg === 'number'; } function isObject(arg) { return typeof arg === 'object' && arg !== null; } function isUndefined(arg) { return arg === void 0; } global.define = __define; return module.exports; }); System.registerDynamic("npm:inherits@2.0.1/inherits_browser.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; if (typeof Object.create === 'function') { module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor; ctor.prototype = Object.create(superCtor.prototype, {constructor: { value: ctor, enumerable: false, writable: true, configurable: true }}); }; } else { module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function() {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }; } global.define = __define; return module.exports; }); System.registerDynamic("npm:isarray@0.0.1/index.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = Array.isArray || function(arr) { return Object.prototype.toString.call(arr) == '[object Array]'; }; global.define = __define; return module.exports; }); System.registerDynamic("npm:base64-js@0.0.8/lib/b64.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; ; (function(exports) { 'use strict'; var Arr = (typeof Uint8Array !== 'undefined') ? Uint8Array : Array; var PLUS = '+'.charCodeAt(0); var SLASH = '/'.charCodeAt(0); var NUMBER = '0'.charCodeAt(0); var LOWER = 'a'.charCodeAt(0); var UPPER = 'A'.charCodeAt(0); var PLUS_URL_SAFE = '-'.charCodeAt(0); var SLASH_URL_SAFE = '_'.charCodeAt(0); function decode(elt) { var code = elt.charCodeAt(0); if (code === PLUS || code === PLUS_URL_SAFE) return 62; if (code === SLASH || code === SLASH_URL_SAFE) return 63; if (code < NUMBER) return -1; if (code < NUMBER + 10) return code - NUMBER + 26 + 26; if (code < UPPER + 26) return code - UPPER; if (code < LOWER + 26) return code - LOWER + 26; } function b64ToByteArray(b64) { var i, j, l, tmp, placeHolders, arr; if (b64.length % 4 > 0) { throw new Error('Invalid string. Length must be a multiple of 4'); } var len = b64.length; placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0; arr = new Arr(b64.length * 3 / 4 - placeHolders); l = placeHolders > 0 ? b64.length - 4 : b64.length; var L = 0; function push(v) { arr[L++] = v; } for (i = 0, j = 0; i < l; i += 4, j += 3) { tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3)); push((tmp & 0xFF0000) >> 16); push((tmp & 0xFF00) >> 8); push(tmp & 0xFF); } if (placeHolders === 2) { tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4); push(tmp & 0xFF); } else if (placeHolders === 1) { tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2); push((tmp >> 8) & 0xFF); push(tmp & 0xFF); } return arr; } function uint8ToBase64(uint8) { var i, extraBytes = uint8.length % 3, output = "", temp, length; function encode(num) { return lookup.charAt(num); } function tripletToBase64(num) { return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F); } for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]); output += tripletToBase64(temp); } switch (extraBytes) { case 1: temp = uint8[uint8.length - 1]; output += encode(temp >> 2); output += encode((temp << 4) & 0x3F); output += '=='; break; case 2: temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]); output += encode(temp >> 10); output += encode((temp >> 4) & 0x3F); output += encode((temp << 2) & 0x3F); output += '='; break; } return output; } exports.toByteArray = b64ToByteArray; exports.fromByteArray = uint8ToBase64; }(typeof exports === 'undefined' ? (this.base64js = {}) : exports)); global.define = __define; return module.exports; }); System.registerDynamic("npm:ieee754@1.1.6/index.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; exports.read = function(buffer, offset, isLE, mLen, nBytes) { var e, m; var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var nBits = -7; var i = isLE ? (nBytes - 1) : 0; var d = isLE ? -1 : 1; var s = buffer[offset + i]; i += d; e = s & ((1 << (-nBits)) - 1); s >>= (-nBits); nBits += eLen; for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} m = e & ((1 << (-nBits)) - 1); e >>= (-nBits); nBits += mLen; for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} if (e === 0) { e = 1 - eBias; } else if (e === eMax) { return m ? NaN : ((s ? -1 : 1) * Infinity); } else { m = m + Math.pow(2, mLen); e = e - eBias; } return (s ? -1 : 1) * m * Math.pow(2, e - mLen); }; exports.write = function(buffer, value, offset, isLE, mLen, nBytes) { var e, m, c; var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0); var i = isLE ? 0 : (nBytes - 1); var d = isLE ? 1 : -1; var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; value = Math.abs(value); if (isNaN(value) || value === Infinity) { m = isNaN(value) ? 1 : 0; e = eMax; } else { e = Math.floor(Math.log(value) / Math.LN2); if (value * (c = Math.pow(2, -e)) < 1) { e--; c *= 2; } if (e + eBias >= 1) { value += rt / c; } else { value += rt * Math.pow(2, 1 - eBias); } if (value * c >= 2) { e++; c /= 2; } if (e + eBias >= eMax) { m = 0; e = eMax; } else if (e + eBias >= 1) { m = (value * c - 1) * Math.pow(2, mLen); e = e + eBias; } else { m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); e = 0; } } for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} e = (e << mLen) | m; eLen += mLen; for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} buffer[offset + i - d] |= s * 128; }; global.define = __define; return module.exports; }); System.registerDynamic("npm:is-array@1.0.1/index.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var isArray = Array.isArray; var str = Object.prototype.toString; module.exports = isArray || function(val) { return !!val && '[object Array]' == str.call(val); }; global.define = __define; return module.exports; }); System.registerDynamic("npm:core-util-is@1.0.1/lib/util.js", ["github:jspm/nodelibs-buffer@0.1.0.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function(Buffer) { function isArray(ar) { return Array.isArray(ar); } exports.isArray = isArray; function isBoolean(arg) { return typeof arg === 'boolean'; } exports.isBoolean = isBoolean; function isNull(arg) { return arg === null; } exports.isNull = isNull; function isNullOrUndefined(arg) { return arg == null; } exports.isNullOrUndefined = isNullOrUndefined; function isNumber(arg) { return typeof arg === 'number'; } exports.isNumber = isNumber; function isString(arg) { return typeof arg === 'string'; } exports.isString = isString; function isSymbol(arg) { return typeof arg === 'symbol'; } exports.isSymbol = isSymbol; function isUndefined(arg) { return arg === void 0; } exports.isUndefined = isUndefined; function isRegExp(re) { return isObject(re) && objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; } exports.isObject = isObject; function isDate(d) { return isObject(d) && objectToString(d) === '[object Date]'; } exports.isDate = isDate; function isError(e) { return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; function isFunction(arg) { return typeof arg === 'function'; } exports.isFunction = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || typeof arg === 'undefined'; } exports.isPrimitive = isPrimitive; function isBuffer(arg) { return Buffer.isBuffer(arg); } exports.isBuffer = isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); } })(require("github:jspm/nodelibs-buffer@0.1.0.js").Buffer); global.define = __define; return module.exports; }); System.registerDynamic("npm:readable-stream@1.1.13/lib/_stream_writable.js", ["github:jspm/nodelibs-buffer@0.1.0.js", "npm:core-util-is@1.0.1.js", "npm:inherits@2.0.1.js", "npm:stream-browserify@1.0.0/index.js", "npm:readable-stream@1.1.13/lib/_stream_duplex.js", "npm:readable-stream@1.1.13/lib/_stream_duplex.js", "github:jspm/nodelibs-buffer@0.1.0.js", "github:jspm/nodelibs-process@0.1.1.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function(Buffer, process) { module.exports = Writable; var Buffer = require("github:jspm/nodelibs-buffer@0.1.0.js").Buffer; Writable.WritableState = WritableState; var util = require("npm:core-util-is@1.0.1.js"); util.inherits = require("npm:inherits@2.0.1.js"); var Stream = require("npm:stream-browserify@1.0.0/index.js"); util.inherits(Writable, Stream); function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; } function WritableState(options, stream) { var Duplex = require("npm:readable-stream@1.1.13/lib/_stream_duplex.js"); options = options || {}; var hwm = options.highWaterMark; var defaultHwm = options.objectMode ? 16 : 16 * 1024; this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; this.objectMode = !!options.objectMode; if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; this.highWaterMark = ~~this.highWaterMark; this.needDrain = false; this.ending = false; this.ended = false; this.finished = false; var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; this.defaultEncoding = options.defaultEncoding || 'utf8'; this.length = 0; this.writing = false; this.corked = 0; this.sync = true; this.bufferProcessing = false; this.onwrite = function(er) { onwrite(stream, er); }; this.writecb = null; this.writelen = 0; this.buffer = []; this.pendingcb = 0; this.prefinished = false; this.errorEmitted = false; } function Writable(options) { var Duplex = require("npm:readable-stream@1.1.13/lib/_stream_duplex.js"); if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); this._writableState = new WritableState(options, this); this.writable = true; Stream.call(this); } Writable.prototype.pipe = function() { this.emit('error', new Error('Cannot pipe. Not readable.')); }; function writeAfterEnd(stream, state, cb) { var er = new Error('write after end'); stream.emit('error', er); process.nextTick(function() { cb(er); }); } function validChunk(stream, state, chunk, cb) { var valid = true; if (!util.isBuffer(chunk) && !util.isString(chunk) && !util.isNullOrUndefined(chunk) && !state.objectMode) { var er = new TypeError('Invalid non-string/buffer chunk'); stream.emit('error', er); process.nextTick(function() { cb(er); }); valid = false; } return valid; } Writable.prototype.write = function(chunk, encoding, cb) { var state = this._writableState; var ret = false; if (util.isFunction(encoding)) { cb = encoding; encoding = null; } if (util.isBuffer(chunk)) encoding = 'buffer'; else if (!encoding) encoding = state.defaultEncoding; if (!util.isFunction(cb)) cb = function() {}; if (state.ended) writeAfterEnd(this, state, cb); else if (validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function() { var state = this._writableState; state.corked++; }; Writable.prototype.uncork = function() { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.buffer.length) clearBuffer(this, state); } }; function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && util.isString(chunk)) { chunk = new Buffer(chunk, encoding); } return chunk; } function writeOrBuffer(stream, state, chunk, encoding, cb) { chunk = decodeChunk(state, chunk, encoding); if (util.isBuffer(chunk)) encoding = 'buffer'; var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; if (!ret) state.needDrain = true; if (state.writing || state.corked) state.buffer.push(new WriteReq(chunk, encoding, cb)); else doWrite(stream, state, false, len, chunk, encoding, cb); return ret; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (writev) stream._writev(chunk, state.onwrite); else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { if (sync) process.nextTick(function() { state.pendingcb--; cb(er); }); else { state.pendingcb--; cb(er); } stream._writableState.errorEmitted = true; stream.emit('error', er); } function onwriteStateUpdate(state) { state.writing = false; state.writecb = null; state.length -= state.writelen; state.writelen = 0; } function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; onwriteStateUpdate(state); if (er) onwriteError(stream, state, sync, er, cb); else { var finished = needFinish(stream, state); if (!finished && !state.corked && !state.bufferProcessing && state.buffer.length) { clearBuffer(stream, state); } if (sync) { process.nextTick(function() { afterWrite(stream, state, finished, cb); }); } else { afterWrite(stream, state, finished, cb); } } } function afterWrite(stream, state, finished, cb) { if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); } function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } } function clearBuffer(stream, state) { state.bufferProcessing = true; if (stream._writev && state.buffer.length > 1) { var cbs = []; for (var c = 0; c < state.buffer.length; c++) cbs.push(state.buffer[c].callback); state.pendingcb++; doWrite(stream, state, true, state.length, state.buffer, '', function(err) { for (var i = 0; i < cbs.length; i++) { state.pendingcb--; cbs[i](err); } }); state.buffer = []; } else { for (var c = 0; c < state.buffer.length; c++) { var entry = state.buffer[c]; var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); if (state.writing) { c++; break; } } if (c < state.buffer.length) state.buffer = state.buffer.slice(c); else state.buffer.length = 0; } state.bufferProcessing = false; } Writable.prototype._write = function(chunk, encoding, cb) { cb(new Error('not implemented')); }; Writable.prototype._writev = null; Writable.prototype.end = function(chunk, encoding, cb) { var state = this._writableState; if (util.isFunction(chunk)) { cb = chunk; chunk = null; encoding = null; } else if (util.isFunction(encoding)) { cb = encoding; encoding = null; } if (!util.isNullOrUndefined(chunk)) this.write(chunk, encoding); if (state.corked) { state.corked = 1; this.uncork(); } if (!state.ending && !state.finished) endWritable(this, state, cb); }; function needFinish(stream, state) { return (state.ending && state.length === 0 && !state.finished && !state.writing); } function prefinish(stream, state) { if (!state.prefinished) { state.prefinished = true; stream.emit('prefinish'); } } function finishMaybe(stream, state) { var need = needFinish(stream, state); if (need) { if (state.pendingcb === 0) { prefinish(stream, state); state.finished = true; stream.emit('finish'); } else prefinish(stream, state); } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) process.nextTick(cb); else stream.once('finish', cb); } state.ended = true; } })(require("github:jspm/nodelibs-buffer@0.1.0.js").Buffer, require("github:jspm/nodelibs-process@0.1.1.js")); global.define = __define; return module.exports; }); System.registerDynamic("npm:string_decoder@0.10.31/index.js", ["github:jspm/nodelibs-buffer@0.1.0.js", "github:jspm/nodelibs-buffer@0.1.0.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function(Buffer) { var Buffer = require("github:jspm/nodelibs-buffer@0.1.0.js").Buffer; var isBufferEncoding = Buffer.isEncoding || function(encoding) { switch (encoding && encoding.toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; default: return false; } }; function assertEncoding(encoding) { if (encoding && !isBufferEncoding(encoding)) { throw new Error('Unknown encoding: ' + encoding); } } var StringDecoder = exports.StringDecoder = function(encoding) { this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); assertEncoding(encoding); switch (this.encoding) { case 'utf8': this.surrogateSize = 3; break; case 'ucs2': case 'utf16le': this.surrogateSize = 2; this.detectIncompleteChar = utf16DetectIncompleteChar; break; case 'base64': this.surrogateSize = 3; this.detectIncompleteChar = base64DetectIncompleteChar; break; default: this.write = passThroughWrite; return; } this.charBuffer = new Buffer(6); this.charReceived = 0; this.charLength = 0; }; StringDecoder.prototype.write = function(buffer) { var charStr = ''; while (this.charLength) { var available = (buffer.length >= this.charLength - this.charReceived) ? this.charLength - this.charReceived : buffer.length; buffer.copy(this.charBuffer, this.charReceived, 0, available); this.charReceived += available; if (this.charReceived < this.charLength) { return ''; } buffer = buffer.slice(available, buffer.length); charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); var charCode = charStr.charCodeAt(charStr.length - 1); if (charCode >= 0xD800 && charCode <= 0xDBFF) { this.charLength += this.surrogateSize; charStr = ''; continue; } this.charReceived = this.charLength = 0; if (buffer.length === 0) { return charStr; } break; } this.detectIncompleteChar(buffer); var end = buffer.length; if (this.charLength) { buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); end -= this.charReceived; } charStr += buffer.toString(this.encoding, 0, end); var end = charStr.length - 1; var charCode = charStr.charCodeAt(end); if (charCode >= 0xD800 && charCode <= 0xDBFF) { var size = this.surrogateSize; this.charLength += size; this.charReceived += size; this.charBuffer.copy(this.charBuffer, size, 0, size); buffer.copy(this.charBuffer, 0, 0, size); return charStr.substring(0, end); } return charStr; }; StringDecoder.prototype.detectIncompleteChar = function(buffer) { var i = (buffer.length >= 3) ? 3 : buffer.length; for (; i > 0; i--) { var c = buffer[buffer.length - i]; if (i == 1 && c >> 5 == 0x06) { this.charLength = 2; break; } if (i <= 2 && c >> 4 == 0x0E) { this.charLength = 3; break; } if (i <= 3 && c >> 3 == 0x1E) { this.charLength = 4; break; } } this.charReceived = i; }; StringDecoder.prototype.end = function(buffer) { var res = ''; if (buffer && buffer.length) res = this.write(buffer); if (this.charReceived) { var cr = this.charReceived; var buf = this.charBuffer; var enc = this.encoding; res += buf.slice(0, cr).toString(enc); } return res; }; function passThroughWrite(buffer) { return buffer.toString(this.encoding); } function utf16DetectIncompleteChar(buffer) { this.charReceived = buffer.length % 2; this.charLength = this.charReceived ? 2 : 0; } function base64DetectIncompleteChar(buffer) { this.charReceived = buffer.length % 3; this.charLength = this.charReceived ? 3 : 0; } })(require("github:jspm/nodelibs-buffer@0.1.0.js").Buffer); global.define = __define; return module.exports; }); System.registerDynamic("npm:readable-stream@1.1.13/lib/_stream_transform.js", ["npm:readable-stream@1.1.13/lib/_stream_duplex.js", "npm:core-util-is@1.0.1.js", "npm:inherits@2.0.1.js", "github:jspm/nodelibs-process@0.1.1.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function(process) { module.exports = Transform; var Duplex = require("npm:readable-stream@1.1.13/lib/_stream_duplex.js"); var util = require("npm:core-util-is@1.0.1.js"); util.inherits = require("npm:inherits@2.0.1.js"); util.inherits(Transform, Duplex); function TransformState(options, stream) { this.afterTransform = function(er, data) { return afterTransform(stream, er, data); }; this.needTransform = false; this.transforming = false; this.writecb = null; this.writechunk = null; } function afterTransform(stream, er, data) { var ts = stream._transformState; ts.transforming = false; var cb = ts.writecb; if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); ts.writechunk = null; ts.writecb = null; if (!util.isNullOrUndefined(data)) stream.push(data); if (cb) cb(er); var rs = stream._readableState; rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { stream._read(rs.highWaterMark); } } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); this._transformState = new TransformState(options, this); var stream = this; this._readableState.needReadable = true; this._readableState.sync = false; this.once('prefinish', function() { if (util.isFunction(this._flush)) this._flush(function(er) { done(stream, er); }); else done(stream); }); } Transform.prototype.push = function(chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; Transform.prototype._transform = function(chunk, encoding, cb) { throw new Error('not implemented'); }; Transform.prototype._write = function(chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; Transform.prototype._read = function(n) { var ts = this._transformState; if (!util.isNull(ts.writechunk) && ts.writecb && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { ts.needTransform = true; } }; function done(stream, er) { if (er) return stream.emit('error', er); var ws = stream._writableState; var ts = stream._transformState; if (ws.length) throw new Error('calling transform done when ws.length != 0'); if (ts.transforming) throw new Error('calling transform done when still transforming'); return stream.push(null); } })(require("github:jspm/nodelibs-process@0.1.1.js")); global.define = __define; return module.exports; }); System.registerDynamic("npm:readable-stream@1.1.13/lib/_stream_passthrough.js", ["npm:readable-stream@1.1.13/lib/_stream_transform.js", "npm:core-util-is@1.0.1.js", "npm:inherits@2.0.1.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = PassThrough; var Transform = require("npm:readable-stream@1.1.13/lib/_stream_transform.js"); var util = require("npm:core-util-is@1.0.1.js"); util.inherits = require("npm:inherits@2.0.1.js"); util.inherits(PassThrough, Transform); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } PassThrough.prototype._transform = function(chunk, encoding, cb) { cb(null, chunk); }; global.define = __define; return module.exports; }); System.registerDynamic("npm:readable-stream@1.1.13/writable.js", ["npm:readable-stream@1.1.13/lib/_stream_writable.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:readable-stream@1.1.13/lib/_stream_writable.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:readable-stream@1.1.13/duplex.js", ["npm:readable-stream@1.1.13/lib/_stream_duplex.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:readable-stream@1.1.13/lib/_stream_duplex.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:readable-stream@1.1.13/transform.js", ["npm:readable-stream@1.1.13/lib/_stream_transform.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:readable-stream@1.1.13/lib/_stream_transform.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:readable-stream@1.1.13/passthrough.js", ["npm:readable-stream@1.1.13/lib/_stream_passthrough.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:readable-stream@1.1.13/lib/_stream_passthrough.js"); global.define = __define; return module.exports; }); System.registerDynamic("github:jspm/nodelibs-string_decoder@0.1.0/index.js", ["npm:string_decoder@0.10.31.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = System._nodeRequire ? System._nodeRequire('string_decoder') : require("npm:string_decoder@0.10.31.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseToString.js", ["github:jspm/nodelibs-process@0.1.1.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function(process) { function baseToString(value) { if (typeof value == 'string') { return value; } return value == null ? '' : (value + ''); } module.exports = baseToString; })(require("github:jspm/nodelibs-process@0.1.1.js")); global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/isObjectLike.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; function isObjectLike(value) { return !!value && typeof value == 'object'; } module.exports = isObjectLike; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseProperty.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } module.exports = baseProperty; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/isLength.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var MAX_SAFE_INTEGER = 9007199254740991; function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } module.exports = isLength; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/lang/isObject.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; function isObject(value) { var type = typeof value; return !!value && (type == 'object' || type == 'function'); } module.exports = isObject; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/lang/isArguments.js", ["npm:lodash@3.9.3/internal/isArrayLike.js", "npm:lodash@3.9.3/internal/isObjectLike.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var isArrayLike = require("npm:lodash@3.9.3/internal/isArrayLike.js"), isObjectLike = require("npm:lodash@3.9.3/internal/isObjectLike.js"); var argsTag = '[object Arguments]'; var objectProto = Object.prototype; var objToString = objectProto.toString; function isArguments(value) { return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag; } module.exports = isArguments; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/lang/isArray.js", ["npm:lodash@3.9.3/internal/getNative.js", "npm:lodash@3.9.3/internal/isLength.js", "npm:lodash@3.9.3/internal/isObjectLike.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var getNative = require("npm:lodash@3.9.3/internal/getNative.js"), isLength = require("npm:lodash@3.9.3/internal/isLength.js"), isObjectLike = require("npm:lodash@3.9.3/internal/isObjectLike.js"); var arrayTag = '[object Array]'; var objectProto = Object.prototype; var objToString = objectProto.toString; var nativeIsArray = getNative(Array, 'isArray'); var isArray = nativeIsArray || function(value) { return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; }; module.exports = isArray; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/isIndex.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var reIsUint = /^\d+$/; var MAX_SAFE_INTEGER = 9007199254740991; function isIndex(value, length) { value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; length = length == null ? MAX_SAFE_INTEGER : length; return value > -1 && value % 1 == 0 && value < length; } module.exports = isIndex; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/object/keysIn.js", ["npm:lodash@3.9.3/lang/isArguments.js", "npm:lodash@3.9.3/lang/isArray.js", "npm:lodash@3.9.3/internal/isIndex.js", "npm:lodash@3.9.3/internal/isLength.js", "npm:lodash@3.9.3/lang/isObject.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var isArguments = require("npm:lodash@3.9.3/lang/isArguments.js"), isArray = require("npm:lodash@3.9.3/lang/isArray.js"), isIndex = require("npm:lodash@3.9.3/internal/isIndex.js"), isLength = require("npm:lodash@3.9.3/internal/isLength.js"), isObject = require("npm:lodash@3.9.3/lang/isObject.js"); var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; function keysIn(object) { if (object == null) { return []; } if (!isObject(object)) { object = Object(object); } var length = object.length; length = (length && isLength(length) && (isArray(object) || isArguments(object)) && length) || 0; var Ctor = object.constructor, index = -1, isProto = typeof Ctor == 'function' && Ctor.prototype === object, result = Array(length), skipIndexes = length > 0; while (++index < length) { result[index] = (index + ''); } for (var key in object) { if (!(skipIndexes && isIndex(key, length)) && !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } return result; } module.exports = keysIn; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseCopy.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; function baseCopy(source, props, object) { object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; object[key] = source[key]; } return object; } module.exports = baseCopy; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/utility/identity.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; function identity(value) { return value; } module.exports = identity; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/isIterateeCall.js", ["npm:lodash@3.9.3/internal/isArrayLike.js", "npm:lodash@3.9.3/internal/isIndex.js", "npm:lodash@3.9.3/lang/isObject.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var isArrayLike = require("npm:lodash@3.9.3/internal/isArrayLike.js"), isIndex = require("npm:lodash@3.9.3/internal/isIndex.js"), isObject = require("npm:lodash@3.9.3/lang/isObject.js"); function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object)) { var other = object[index]; return value === value ? (value === other) : (other !== other); } return false; } module.exports = isIterateeCall; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/function/restParam.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var FUNC_ERROR_TEXT = 'Expected a function'; var nativeMax = Math.max; function restParam(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), rest = Array(length); while (++index < length) { rest[index] = args[start + index]; } switch (start) { case 0: return func.call(this, rest); case 1: return func.call(this, args[0], rest); case 2: return func.call(this, args[0], args[1], rest); } var otherArgs = Array(start + 1); index = -1; while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = rest; return func.apply(this, otherArgs); }; } module.exports = restParam; global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLStringifier.js", ["github:jspm/nodelibs-process@0.1.1.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function(process) { (function() { var XMLStringifier, bind = function(fn, me) { return function() { return fn.apply(me, arguments); }; }, hasProp = {}.hasOwnProperty; module.exports = XMLStringifier = (function() { function XMLStringifier(options) { this.assertLegalChar = bind(this.assertLegalChar, this); var key, ref, value; this.allowSurrogateChars = options != null ? options.allowSurrogateChars : void 0; ref = (options != null ? options.stringify : void 0) || {}; for (key in ref) { if (!hasProp.call(ref, key)) continue; value = ref[key]; this[key] = value; } } XMLStringifier.prototype.eleName = function(val) { val = '' + val || ''; return this.assertLegalChar(val); }; XMLStringifier.prototype.eleText = function(val) { val = '' + val || ''; return this.assertLegalChar(this.elEscape(val)); }; XMLStringifier.prototype.cdata = function(val) { val = '' + val || ''; if (val.match(/]]>/)) { throw new Error("Invalid CDATA text: " + val); } return this.assertLegalChar(val); }; XMLStringifier.prototype.comment = function(val) { val = '' + val || ''; if (val.match(/--/)) { throw new Error("Comment text cannot contain double-hypen: " + val); } return this.assertLegalChar(val); }; XMLStringifier.prototype.raw = function(val) { return '' + val || ''; }; XMLStringifier.prototype.attName = function(val) { return '' + val || ''; }; XMLStringifier.prototype.attValue = function(val) { val = '' + val || ''; return this.attEscape(val); }; XMLStringifier.prototype.insTarget = function(val) { return '' + val || ''; }; XMLStringifier.prototype.insValue = function(val) { val = '' + val || ''; if (val.match(/\?>/)) { throw new Error("Invalid processing instruction value: " + val); } return val; }; XMLStringifier.prototype.xmlVersion = function(val) { val = '' + val || ''; if (!val.match(/1\.[0-9]+/)) { throw new Error("Invalid version number: " + val); } return val; }; XMLStringifier.prototype.xmlEncoding = function(val) { val = '' + val || ''; if (!val.match(/[A-Za-z](?:[A-Za-z0-9._-]|-)*/)) { throw new Error("Invalid encoding: " + val); } return val; }; XMLStringifier.prototype.xmlStandalone = function(val) { if (val) { return "yes"; } else { return "no"; } }; XMLStringifier.prototype.dtdPubID = function(val) { return '' + val || ''; }; XMLStringifier.prototype.dtdSysID = function(val) { return '' + val || ''; }; XMLStringifier.prototype.dtdElementValue = function(val) { return '' + val || ''; }; XMLStringifier.prototype.dtdAttType = function(val) { return '' + val || ''; }; XMLStringifier.prototype.dtdAttDefault = function(val) { if (val != null) { return '' + val || ''; } else { return val; } }; XMLStringifier.prototype.dtdEntityValue = function(val) { return '' + val || ''; }; XMLStringifier.prototype.dtdNData = function(val) { return '' + val || ''; }; XMLStringifier.prototype.convertAttKey = '@'; XMLStringifier.prototype.convertPIKey = '?'; XMLStringifier.prototype.convertTextKey = '#text'; XMLStringifier.prototype.convertCDataKey = '#cdata'; XMLStringifier.prototype.convertCommentKey = '#comment'; XMLStringifier.prototype.convertRawKey = '#raw'; XMLStringifier.prototype.convertListKey = '#list'; XMLStringifier.prototype.assertLegalChar = function(str) { var chars, chr; if (this.allowSurrogateChars) { chars = /[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uFFFE-\uFFFF]/; } else { chars = /[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/; } chr = str.match(chars); if (chr) { throw new Error("Invalid character (" + chr + ") in string: " + str + " at index " + chr.index); } return str; }; XMLStringifier.prototype.elEscape = function(str) { return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\r/g, '&#xD;'); }; XMLStringifier.prototype.attEscape = function(str) { return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/\t/g, '&#x9;').replace(/\n/g, '&#xA;').replace(/\r/g, '&#xD;'); }; return XMLStringifier; })(); }).call(this); })(require("github:jspm/nodelibs-process@0.1.1.js")); global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseCreate.js", ["npm:lodash@3.9.3/lang/isObject.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var isObject = require("npm:lodash@3.9.3/lang/isObject.js"); var baseCreate = (function() { function object() {} return function(prototype) { if (isObject(prototype)) { object.prototype = prototype; var result = new object; object.prototype = null; } return result || {}; }; }()); module.exports = baseCreate; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseIsFunction.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; function baseIsFunction(value) { return typeof value == 'function' || false; } module.exports = baseIsFunction; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/lang/isString.js", ["npm:lodash@3.9.3/internal/isObjectLike.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var isObjectLike = require("npm:lodash@3.9.3/internal/isObjectLike.js"); var stringTag = '[object String]'; var objectProto = Object.prototype; var objToString = objectProto.toString; function isString(value) { return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag); } module.exports = isString; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/arrayEvery.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; function arrayEvery(array, predicate) { var index = -1, length = array.length; while (++index < length) { if (!predicate(array[index], index, array)) { return false; } } return true; } module.exports = arrayEvery; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/arraySome.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; function arraySome(array, predicate) { var index = -1, length = array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } module.exports = arraySome; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/equalByTag.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', numberTag = '[object Number]', regexpTag = '[object RegExp]', stringTag = '[object String]'; function equalByTag(object, other, tag) { switch (tag) { case boolTag: case dateTag: return +object == +other; case errorTag: return object.name == other.name && object.message == other.message; case numberTag: return (object != +object) ? other != +other : object == +other; case regexpTag: case stringTag: return object == (other + ''); } return false; } module.exports = equalByTag; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/equalObjects.js", ["npm:lodash@3.9.3/object/keys.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var keys = require("npm:lodash@3.9.3/object/keys.js"); var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) { var objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length; if (objLength != othLength && !isLoose) { return false; } var index = objLength; while (index--) { var key = objProps[index]; if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) { return false; } } var skipCtor = isLoose; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key], result = customizer ? customizer(isLoose ? othValue : objValue, isLoose ? objValue : othValue, key) : undefined; if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) { return false; } skipCtor || (skipCtor = key == 'constructor'); } if (!skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { return false; } } return true; } module.exports = equalObjects; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/lang/isTypedArray.js", ["npm:lodash@3.9.3/internal/isLength.js", "npm:lodash@3.9.3/internal/isObjectLike.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var isLength = require("npm:lodash@3.9.3/internal/isLength.js"), isObjectLike = require("npm:lodash@3.9.3/internal/isObjectLike.js"); var argsTag = '[object Arguments]', arrayTag = '[object Array]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', mapTag = '[object Map]', numberTag = '[object Number]', objectTag = '[object Object]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; var objectProto = Object.prototype; var objToString = objectProto.toString; function isTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; } module.exports = isTypedArray; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/toObject.js", ["npm:lodash@3.9.3/lang/isObject.js", "github:jspm/nodelibs-process@0.1.1.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function(process) { var isObject = require("npm:lodash@3.9.3/lang/isObject.js"); function toObject(value) { return isObject(value) ? value : Object(value); } module.exports = toObject; })(require("github:jspm/nodelibs-process@0.1.1.js")); global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/isStrictComparable.js", ["npm:lodash@3.9.3/lang/isObject.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var isObject = require("npm:lodash@3.9.3/lang/isObject.js"); function isStrictComparable(value) { return value === value && !isObject(value); } module.exports = isStrictComparable; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/object/pairs.js", ["npm:lodash@3.9.3/object/keys.js", "npm:lodash@3.9.3/internal/toObject.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var keys = require("npm:lodash@3.9.3/object/keys.js"), toObject = require("npm:lodash@3.9.3/internal/toObject.js"); function pairs(object) { object = toObject(object); var index = -1, props = keys(object), length = props.length, result = Array(length); while (++index < length) { var key = props[index]; result[index] = [key, object[key]]; } return result; } module.exports = pairs; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseGet.js", ["npm:lodash@3.9.3/internal/toObject.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var toObject = require("npm:lodash@3.9.3/internal/toObject.js"); function baseGet(object, path, pathKey) { if (object == null) { return; } if (pathKey !== undefined && pathKey in toObject(object)) { path = [pathKey]; } var index = 0, length = path.length; while (object != null && index < length) { object = object[path[index++]]; } return (index && index == length) ? object : undefined; } module.exports = baseGet; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseSlice.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; function baseSlice(array, start, end) { var index = -1, length = array.length; start = start == null ? 0 : (+start || 0); if (start < 0) { start = -start > length ? 0 : (length + start); } end = (end === undefined || end > length) ? length : (+end || 0); if (end < 0) { end += length; } length = start > end ? 0 : ((end - start) >>> 0); start >>>= 0; var result = Array(length); while (++index < length) { result[index] = array[index + start]; } return result; } module.exports = baseSlice; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/isKey.js", ["npm:lodash@3.9.3/lang/isArray.js", "npm:lodash@3.9.3/internal/toObject.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var isArray = require("npm:lodash@3.9.3/lang/isArray.js"), toObject = require("npm:lodash@3.9.3/internal/toObject.js"); var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; function isKey(value, object) { var type = typeof value; if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { return true; } if (isArray(value)) { return false; } var result = !reIsDeepProp.test(value); return result || (object != null && value in toObject(object)); } module.exports = isKey; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/array/last.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; function last(array) { var length = array ? array.length : 0; return length ? array[length - 1] : undefined; } module.exports = last; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/toPath.js", ["npm:lodash@3.9.3/internal/baseToString.js", "npm:lodash@3.9.3/lang/isArray.js", "github:jspm/nodelibs-process@0.1.1.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function(process) { var baseToString = require("npm:lodash@3.9.3/internal/baseToString.js"), isArray = require("npm:lodash@3.9.3/lang/isArray.js"); var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g; var reEscapeChar = /\\(\\)?/g; function toPath(value) { if (isArray(value)) { return value; } var result = []; baseToString(value).replace(rePropName, function(match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); }); return result; } module.exports = toPath; })(require("github:jspm/nodelibs-process@0.1.1.js")); global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/basePropertyDeep.js", ["npm:lodash@3.9.3/internal/baseGet.js", "npm:lodash@3.9.3/internal/toPath.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var baseGet = require("npm:lodash@3.9.3/internal/baseGet.js"), toPath = require("npm:lodash@3.9.3/internal/toPath.js"); function basePropertyDeep(path) { var pathKey = (path + ''); path = toPath(path); return function(object) { return baseGet(object, path, pathKey); }; } module.exports = basePropertyDeep; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/createBaseFor.js", ["npm:lodash@3.9.3/internal/toObject.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var toObject = require("npm:lodash@3.9.3/internal/toObject.js"); function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var iterable = toObject(object), props = keysFunc(object), length = props.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length)) { var key = props[index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } module.exports = createBaseFor; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/createBaseEach.js", ["npm:lodash@3.9.3/internal/getLength.js", "npm:lodash@3.9.3/internal/isLength.js", "npm:lodash@3.9.3/internal/toObject.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var getLength = require("npm:lodash@3.9.3/internal/getLength.js"), isLength = require("npm:lodash@3.9.3/internal/isLength.js"), toObject = require("npm:lodash@3.9.3/internal/toObject.js"); function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { var length = collection ? getLength(collection) : 0; if (!isLength(length)) { return eachFunc(collection, iteratee); } var index = fromRight ? length : -1, iterable = toObject(collection); while ((fromRight ? index-- : ++index < length)) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } module.exports = createBaseEach; global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLAttribute.js", ["npm:lodash@3.9.3/object/create.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLAttribute, create; create = require("npm:lodash@3.9.3/object/create.js"); module.exports = XMLAttribute = (function() { function XMLAttribute(parent, name, value) { this.stringify = parent.stringify; if (name == null) { throw new Error("Missing attribute name of element " + parent.name); } if (value == null) { throw new Error("Missing attribute value for attribute " + name + " of element " + parent.name); } this.name = this.stringify.attName(name); this.value = this.stringify.attValue(value); } XMLAttribute.prototype.clone = function() { return create(XMLAttribute.prototype, this); }; XMLAttribute.prototype.toString = function(options, level) { return ' ' + this.name + '="' + this.value + '"'; }; return XMLAttribute; })(); }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLProcessingInstruction.js", ["npm:lodash@3.9.3/object/create.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLProcessingInstruction, create; create = require("npm:lodash@3.9.3/object/create.js"); module.exports = XMLProcessingInstruction = (function() { function XMLProcessingInstruction(parent, target, value) { this.stringify = parent.stringify; if (target == null) { throw new Error("Missing instruction target"); } this.target = this.stringify.insTarget(target); if (value) { this.value = this.stringify.insValue(value); } } XMLProcessingInstruction.prototype.clone = function() { return create(XMLProcessingInstruction.prototype, this); }; XMLProcessingInstruction.prototype.toString = function(options, level) { var indent, newline, offset, pretty, r, ref, ref1, ref2, space; pretty = (options != null ? options.pretty : void 0) || false; indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; level || (level = 0); space = new Array(level + offset + 1).join(indent); r = ''; if (pretty) { r += space; } r += '<?'; r += this.target; if (this.value) { r += ' ' + this.value; } r += '?>'; if (pretty) { r += newline; } return r; }; return XMLProcessingInstruction; })(); }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLCData.js", ["npm:lodash@3.9.3/object/create.js", "npm:xmlbuilder@2.6.4/lib/XMLNode.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLCData, XMLNode, create, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; create = require("npm:lodash@3.9.3/object/create.js"); XMLNode = require("npm:xmlbuilder@2.6.4/lib/XMLNode.js"); module.exports = XMLCData = (function(superClass) { extend(XMLCData, superClass); function XMLCData(parent, text) { XMLCData.__super__.constructor.call(this, parent); if (text == null) { throw new Error("Missing CDATA text"); } this.text = this.stringify.cdata(text); } XMLCData.prototype.clone = function() { return create(XMLCData.prototype, this); }; XMLCData.prototype.toString = function(options, level) { var indent, newline, offset, pretty, r, ref, ref1, ref2, space; pretty = (options != null ? options.pretty : void 0) || false; indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; level || (level = 0); space = new Array(level + offset + 1).join(indent); r = ''; if (pretty) { r += space; } r += '<![CDATA[' + this.text + ']]>'; if (pretty) { r += newline; } return r; }; return XMLCData; })(XMLNode); }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLComment.js", ["npm:lodash@3.9.3/object/create.js", "npm:xmlbuilder@2.6.4/lib/XMLNode.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLComment, XMLNode, create, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; create = require("npm:lodash@3.9.3/object/create.js"); XMLNode = require("npm:xmlbuilder@2.6.4/lib/XMLNode.js"); module.exports = XMLComment = (function(superClass) { extend(XMLComment, superClass); function XMLComment(parent, text) { XMLComment.__super__.constructor.call(this, parent); if (text == null) { throw new Error("Missing comment text"); } this.text = this.stringify.comment(text); } XMLComment.prototype.clone = function() { return create(XMLComment.prototype, this); }; XMLComment.prototype.toString = function(options, level) { var indent, newline, offset, pretty, r, ref, ref1, ref2, space; pretty = (options != null ? options.pretty : void 0) || false; indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; level || (level = 0); space = new Array(level + offset + 1).join(indent); r = ''; if (pretty) { r += space; } r += '<!-- ' + this.text + ' -->'; if (pretty) { r += newline; } return r; }; return XMLComment; })(XMLNode); }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLDTDAttList.js", ["npm:lodash@3.9.3/object/create.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLDTDAttList, create; create = require("npm:lodash@3.9.3/object/create.js"); module.exports = XMLDTDAttList = (function() { function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) { this.stringify = parent.stringify; if (elementName == null) { throw new Error("Missing DTD element name"); } if (attributeName == null) { throw new Error("Missing DTD attribute name"); } if (!attributeType) { throw new Error("Missing DTD attribute type"); } if (!defaultValueType) { throw new Error("Missing DTD attribute default"); } if (defaultValueType.indexOf('#') !== 0) { defaultValueType = '#' + defaultValueType; } if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) { throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT"); } if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) { throw new Error("Default value only applies to #FIXED or #DEFAULT"); } this.elementName = this.stringify.eleName(elementName); this.attributeName = this.stringify.attName(attributeName); this.attributeType = this.stringify.dtdAttType(attributeType); this.defaultValue = this.stringify.dtdAttDefault(defaultValue); this.defaultValueType = defaultValueType; } XMLDTDAttList.prototype.clone = function() { return create(XMLDTDAttList.prototype, this); }; XMLDTDAttList.prototype.toString = function(options, level) { var indent, newline, offset, pretty, r, ref, ref1, ref2, space; pretty = (options != null ? options.pretty : void 0) || false; indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; level || (level = 0); space = new Array(level + offset + 1).join(indent); r = ''; if (pretty) { r += space; } r += '<!ATTLIST ' + this.elementName + ' ' + this.attributeName + ' ' + this.attributeType; if (this.defaultValueType !== '#DEFAULT') { r += ' ' + this.defaultValueType; } if (this.defaultValue) { r += ' "' + this.defaultValue + '"'; } r += '>'; if (pretty) { r += newline; } return r; }; return XMLDTDAttList; })(); }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLDTDEntity.js", ["npm:lodash@3.9.3/object/create.js", "npm:lodash@3.9.3/lang/isObject.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLDTDEntity, create, isObject; create = require("npm:lodash@3.9.3/object/create.js"); isObject = require("npm:lodash@3.9.3/lang/isObject.js"); module.exports = XMLDTDEntity = (function() { function XMLDTDEntity(parent, pe, name, value) { this.stringify = parent.stringify; if (name == null) { throw new Error("Missing entity name"); } if (value == null) { throw new Error("Missing entity value"); } this.pe = !!pe; this.name = this.stringify.eleName(name); if (!isObject(value)) { this.value = this.stringify.dtdEntityValue(value); } else { if (!value.pubID && !value.sysID) { throw new Error("Public and/or system identifiers are required for an external entity"); } if (value.pubID && !value.sysID) { throw new Error("System identifier is required for a public external entity"); } if (value.pubID != null) { this.pubID = this.stringify.dtdPubID(value.pubID); } if (value.sysID != null) { this.sysID = this.stringify.dtdSysID(value.sysID); } if (value.nData != null) { this.nData = this.stringify.dtdNData(value.nData); } if (this.pe && this.nData) { throw new Error("Notation declaration is not allowed in a parameter entity"); } } } XMLDTDEntity.prototype.clone = function() { return create(XMLDTDEntity.prototype, this); }; XMLDTDEntity.prototype.toString = function(options, level) { var indent, newline, offset, pretty, r, ref, ref1, ref2, space; pretty = (options != null ? options.pretty : void 0) || false; indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; level || (level = 0); space = new Array(level + offset + 1).join(indent); r = ''; if (pretty) { r += space; } r += '<!ENTITY'; if (this.pe) { r += ' %'; } r += ' ' + this.name; if (this.value) { r += ' "' + this.value + '"'; } else { if (this.pubID && this.sysID) { r += ' PUBLIC "' + this.pubID + '" "' + this.sysID + '"'; } else if (this.sysID) { r += ' SYSTEM "' + this.sysID + '"'; } if (this.nData) { r += ' NDATA ' + this.nData; } } r += '>'; if (pretty) { r += newline; } return r; }; return XMLDTDEntity; })(); }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLDTDElement.js", ["npm:lodash@3.9.3/object/create.js", "npm:lodash@3.9.3/lang/isArray.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLDTDElement, create, isArray; create = require("npm:lodash@3.9.3/object/create.js"); isArray = require("npm:lodash@3.9.3/lang/isArray.js"); module.exports = XMLDTDElement = (function() { function XMLDTDElement(parent, name, value) { this.stringify = parent.stringify; if (name == null) { throw new Error("Missing DTD element name"); } if (!value) { value = '(#PCDATA)'; } if (isArray(value)) { value = '(' + value.join(',') + ')'; } this.name = this.stringify.eleName(name); this.value = this.stringify.dtdElementValue(value); } XMLDTDElement.prototype.clone = function() { return create(XMLDTDElement.prototype, this); }; XMLDTDElement.prototype.toString = function(options, level) { var indent, newline, offset, pretty, r, ref, ref1, ref2, space; pretty = (options != null ? options.pretty : void 0) || false; indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; level || (level = 0); space = new Array(level + offset + 1).join(indent); r = ''; if (pretty) { r += space; } r += '<!ELEMENT ' + this.name + ' ' + this.value + '>'; if (pretty) { r += newline; } return r; }; return XMLDTDElement; })(); }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLDTDNotation.js", ["npm:lodash@3.9.3/object/create.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLDTDNotation, create; create = require("npm:lodash@3.9.3/object/create.js"); module.exports = XMLDTDNotation = (function() { function XMLDTDNotation(parent, name, value) { this.stringify = parent.stringify; if (name == null) { throw new Error("Missing notation name"); } if (!value.pubID && !value.sysID) { throw new Error("Public or system identifiers are required for an external entity"); } this.name = this.stringify.eleName(name); if (value.pubID != null) { this.pubID = this.stringify.dtdPubID(value.pubID); } if (value.sysID != null) { this.sysID = this.stringify.dtdSysID(value.sysID); } } XMLDTDNotation.prototype.clone = function() { return create(XMLDTDNotation.prototype, this); }; XMLDTDNotation.prototype.toString = function(options, level) { var indent, newline, offset, pretty, r, ref, ref1, ref2, space; pretty = (options != null ? options.pretty : void 0) || false; indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; level || (level = 0); space = new Array(level + offset + 1).join(indent); r = ''; if (pretty) { r += space; } r += '<!NOTATION ' + this.name; if (this.pubID && this.sysID) { r += ' PUBLIC "' + this.pubID + '" "' + this.sysID + '"'; } else if (this.pubID) { r += ' PUBLIC "' + this.pubID + '"'; } else if (this.sysID) { r += ' SYSTEM "' + this.sysID + '"'; } r += '>'; if (pretty) { r += newline; } return r; }; return XMLDTDNotation; })(); }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLRaw.js", ["npm:lodash@3.9.3/object/create.js", "npm:xmlbuilder@2.6.4/lib/XMLNode.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLNode, XMLRaw, create, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; create = require("npm:lodash@3.9.3/object/create.js"); XMLNode = require("npm:xmlbuilder@2.6.4/lib/XMLNode.js"); module.exports = XMLRaw = (function(superClass) { extend(XMLRaw, superClass); function XMLRaw(parent, text) { XMLRaw.__super__.constructor.call(this, parent); if (text == null) { throw new Error("Missing raw text"); } this.value = this.stringify.raw(text); } XMLRaw.prototype.clone = function() { return create(XMLRaw.prototype, this); }; XMLRaw.prototype.toString = function(options, level) { var indent, newline, offset, pretty, r, ref, ref1, ref2, space; pretty = (options != null ? options.pretty : void 0) || false; indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; level || (level = 0); space = new Array(level + offset + 1).join(indent); r = ''; if (pretty) { r += space; } r += this.value; if (pretty) { r += newline; } return r; }; return XMLRaw; })(XMLNode); }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLText.js", ["npm:lodash@3.9.3/object/create.js", "npm:xmlbuilder@2.6.4/lib/XMLNode.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLNode, XMLText, create, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; create = require("npm:lodash@3.9.3/object/create.js"); XMLNode = require("npm:xmlbuilder@2.6.4/lib/XMLNode.js"); module.exports = XMLText = (function(superClass) { extend(XMLText, superClass); function XMLText(parent, text) { XMLText.__super__.constructor.call(this, parent); if (text == null) { throw new Error("Missing element text"); } this.value = this.stringify.eleText(text); } XMLText.prototype.clone = function() { return create(XMLText.prototype, this); }; XMLText.prototype.toString = function(options, level) { var indent, newline, offset, pretty, r, ref, ref1, ref2, space; pretty = (options != null ? options.pretty : void 0) || false; indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; level || (level = 0); space = new Array(level + offset + 1).join(indent); r = ''; if (pretty) { r += space; } r += this.value; if (pretty) { r += newline; } return r; }; return XMLText; })(XMLNode); }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("npm:xml2js@0.4.9/lib/bom.js", ["npm:xml2js@0.4.9/lib/xml2js.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var xml2js; xml2js = require("npm:xml2js@0.4.9/lib/xml2js.js"); exports.stripBOM = function(str) { if (str[0] === '\uFEFF') { return str.substring(1); } else { return str; } }; }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("npm:xml2js@0.4.9/lib/processors.js", [], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var prefixMatch; prefixMatch = new RegExp(/(?!xmlns)^.*:/); exports.normalize = function(str) { return str.toLowerCase(); }; exports.firstCharLowerCase = function(str) { return str.charAt(0).toLowerCase() + str.slice(1); }; exports.stripPrefix = function(str) { return str.replace(prefixMatch, ''); }; exports.parseNumbers = function(str) { if (!isNaN(str)) { str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str); } return str; }; }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("npm:process@0.10.1.js", ["npm:process@0.10.1/browser.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:process@0.10.1/browser.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:eventemitter3@1.1.0.js", ["npm:eventemitter3@1.1.0/index.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:eventemitter3@1.1.0/index.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:events@1.0.2.js", ["npm:events@1.0.2/events.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:events@1.0.2/events.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:inherits@2.0.1.js", ["npm:inherits@2.0.1/inherits_browser.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:inherits@2.0.1/inherits_browser.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:isarray@0.0.1.js", ["npm:isarray@0.0.1/index.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:isarray@0.0.1/index.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:base64-js@0.0.8.js", ["npm:base64-js@0.0.8/lib/b64.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:base64-js@0.0.8/lib/b64.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:ieee754@1.1.6.js", ["npm:ieee754@1.1.6/index.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:ieee754@1.1.6/index.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:is-array@1.0.1.js", ["npm:is-array@1.0.1/index.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:is-array@1.0.1/index.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:core-util-is@1.0.1.js", ["npm:core-util-is@1.0.1/lib/util.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:core-util-is@1.0.1/lib/util.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:readable-stream@1.1.13/lib/_stream_duplex.js", ["npm:core-util-is@1.0.1.js", "npm:inherits@2.0.1.js", "npm:readable-stream@1.1.13/lib/_stream_readable.js", "npm:readable-stream@1.1.13/lib/_stream_writable.js", "github:jspm/nodelibs-process@0.1.1.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function(process) { module.exports = Duplex; var objectKeys = Object.keys || function(obj) { var keys = []; for (var key in obj) keys.push(key); return keys; }; var util = require("npm:core-util-is@1.0.1.js"); util.inherits = require("npm:inherits@2.0.1.js"); var Readable = require("npm:readable-stream@1.1.13/lib/_stream_readable.js"); var Writable = require("npm:readable-stream@1.1.13/lib/_stream_writable.js"); util.inherits(Duplex, Readable); forEach(objectKeys(Writable.prototype), function(method) { if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; }); function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options); Writable.call(this, options); if (options && options.readable === false) this.readable = false; if (options && options.writable === false) this.writable = false; this.allowHalfOpen = true; if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; this.once('end', onend); } function onend() { if (this.allowHalfOpen || this._writableState.ended) return; process.nextTick(this.end.bind(this)); } function forEach(xs, f) { for (var i = 0, l = xs.length; i < l; i++) { f(xs[i], i); } } })(require("github:jspm/nodelibs-process@0.1.1.js")); global.define = __define; return module.exports; }); System.registerDynamic("npm:string_decoder@0.10.31.js", ["npm:string_decoder@0.10.31/index.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:string_decoder@0.10.31/index.js"); global.define = __define; return module.exports; }); System.registerDynamic("github:jspm/nodelibs-string_decoder@0.1.0.js", ["github:jspm/nodelibs-string_decoder@0.1.0/index.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("github:jspm/nodelibs-string_decoder@0.1.0/index.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/string/escapeRegExp.js", ["npm:lodash@3.9.3/internal/baseToString.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var baseToString = require("npm:lodash@3.9.3/internal/baseToString.js"); var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g, reHasRegExpChars = RegExp(reRegExpChars.source); function escapeRegExp(string) { string = baseToString(string); return (string && reHasRegExpChars.test(string)) ? string.replace(reRegExpChars, '\\$&') : string; } module.exports = escapeRegExp; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/getLength.js", ["npm:lodash@3.9.3/internal/baseProperty.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var baseProperty = require("npm:lodash@3.9.3/internal/baseProperty.js"); var getLength = baseProperty('length'); module.exports = getLength; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/shimKeys.js", ["npm:lodash@3.9.3/lang/isArguments.js", "npm:lodash@3.9.3/lang/isArray.js", "npm:lodash@3.9.3/internal/isIndex.js", "npm:lodash@3.9.3/internal/isLength.js", "npm:lodash@3.9.3/object/keysIn.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var isArguments = require("npm:lodash@3.9.3/lang/isArguments.js"), isArray = require("npm:lodash@3.9.3/lang/isArray.js"), isIndex = require("npm:lodash@3.9.3/internal/isIndex.js"), isLength = require("npm:lodash@3.9.3/internal/isLength.js"), keysIn = require("npm:lodash@3.9.3/object/keysIn.js"); var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; function shimKeys(object) { var props = keysIn(object), propsLength = props.length, length = propsLength && object.length; var allowIndexes = !!length && isLength(length) && (isArray(object) || isArguments(object)); var index = -1, result = []; while (++index < propsLength) { var key = props[index]; if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { result.push(key); } } return result; } module.exports = shimKeys; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseAssign.js", ["npm:lodash@3.9.3/internal/baseCopy.js", "npm:lodash@3.9.3/object/keys.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var baseCopy = require("npm:lodash@3.9.3/internal/baseCopy.js"), keys = require("npm:lodash@3.9.3/object/keys.js"); function baseAssign(object, source) { return source == null ? object : baseCopy(source, keys(source), object); } module.exports = baseAssign; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/bindCallback.js", ["npm:lodash@3.9.3/utility/identity.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var identity = require("npm:lodash@3.9.3/utility/identity.js"); function bindCallback(func, thisArg, argCount) { if (typeof func != 'function') { return identity; } if (thisArg === undefined) { return func; } switch (argCount) { case 1: return function(value) { return func.call(thisArg, value); }; case 3: return function(value, index, collection) { return func.call(thisArg, value, index, collection); }; case 4: return function(accumulator, value, index, collection) { return func.call(thisArg, accumulator, value, index, collection); }; case 5: return function(value, other, key, object, source) { return func.call(thisArg, value, other, key, object, source); }; } return function() { return func.apply(thisArg, arguments); }; } module.exports = bindCallback; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/object/create.js", ["npm:lodash@3.9.3/internal/baseAssign.js", "npm:lodash@3.9.3/internal/baseCreate.js", "npm:lodash@3.9.3/internal/isIterateeCall.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var baseAssign = require("npm:lodash@3.9.3/internal/baseAssign.js"), baseCreate = require("npm:lodash@3.9.3/internal/baseCreate.js"), isIterateeCall = require("npm:lodash@3.9.3/internal/isIterateeCall.js"); function create(prototype, properties, guard) { var result = baseCreate(prototype); if (guard && isIterateeCall(prototype, properties, guard)) { properties = null; } return properties ? baseAssign(result, properties) : result; } module.exports = create; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/lang/isFunction.js", ["npm:lodash@3.9.3/internal/baseIsFunction.js", "npm:lodash@3.9.3/internal/getNative.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var baseIsFunction = require("npm:lodash@3.9.3/internal/baseIsFunction.js"), getNative = require("npm:lodash@3.9.3/internal/getNative.js"); var funcTag = '[object Function]'; var objectProto = Object.prototype; var objToString = objectProto.toString; var Uint8Array = getNative(global, 'Uint8Array'); var isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) { return objToString.call(value) == funcTag; }; module.exports = isFunction; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/lang/isEmpty.js", ["npm:lodash@3.9.3/lang/isArguments.js", "npm:lodash@3.9.3/lang/isArray.js", "npm:lodash@3.9.3/internal/isArrayLike.js", "npm:lodash@3.9.3/lang/isFunction.js", "npm:lodash@3.9.3/internal/isObjectLike.js", "npm:lodash@3.9.3/lang/isString.js", "npm:lodash@3.9.3/object/keys.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var isArguments = require("npm:lodash@3.9.3/lang/isArguments.js"), isArray = require("npm:lodash@3.9.3/lang/isArray.js"), isArrayLike = require("npm:lodash@3.9.3/internal/isArrayLike.js"), isFunction = require("npm:lodash@3.9.3/lang/isFunction.js"), isObjectLike = require("npm:lodash@3.9.3/internal/isObjectLike.js"), isString = require("npm:lodash@3.9.3/lang/isString.js"), keys = require("npm:lodash@3.9.3/object/keys.js"); function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) || (isObjectLike(value) && isFunction(value.splice)))) { return !value.length; } return !keys(value).length; } module.exports = isEmpty; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/equalArrays.js", ["npm:lodash@3.9.3/internal/arraySome.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var arraySome = require("npm:lodash@3.9.3/internal/arraySome.js"); function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) { var index = -1, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isLoose && othLength > arrLength)) { return false; } while (++index < arrLength) { var arrValue = array[index], othValue = other[index], result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined; if (result !== undefined) { if (result) { continue; } return false; } if (isLoose) { if (!arraySome(other, function(othValue) { return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB); })) { return false; } } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) { return false; } } return true; } module.exports = equalArrays; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/getMatchData.js", ["npm:lodash@3.9.3/internal/isStrictComparable.js", "npm:lodash@3.9.3/object/pairs.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var isStrictComparable = require("npm:lodash@3.9.3/internal/isStrictComparable.js"), pairs = require("npm:lodash@3.9.3/object/pairs.js"); function getMatchData(object) { var result = pairs(object), length = result.length; while (length--) { result[length][2] = isStrictComparable(result[length][1]); } return result; } module.exports = getMatchData; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseMatchesProperty.js", ["npm:lodash@3.9.3/internal/baseGet.js", "npm:lodash@3.9.3/internal/baseIsEqual.js", "npm:lodash@3.9.3/internal/baseSlice.js", "npm:lodash@3.9.3/lang/isArray.js", "npm:lodash@3.9.3/internal/isKey.js", "npm:lodash@3.9.3/internal/isStrictComparable.js", "npm:lodash@3.9.3/array/last.js", "npm:lodash@3.9.3/internal/toObject.js", "npm:lodash@3.9.3/internal/toPath.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var baseGet = require("npm:lodash@3.9.3/internal/baseGet.js"), baseIsEqual = require("npm:lodash@3.9.3/internal/baseIsEqual.js"), baseSlice = require("npm:lodash@3.9.3/internal/baseSlice.js"), isArray = require("npm:lodash@3.9.3/lang/isArray.js"), isKey = require("npm:lodash@3.9.3/internal/isKey.js"), isStrictComparable = require("npm:lodash@3.9.3/internal/isStrictComparable.js"), last = require("npm:lodash@3.9.3/array/last.js"), toObject = require("npm:lodash@3.9.3/internal/toObject.js"), toPath = require("npm:lodash@3.9.3/internal/toPath.js"); function baseMatchesProperty(path, srcValue) { var isArr = isArray(path), isCommon = isKey(path) && isStrictComparable(srcValue), pathKey = (path + ''); path = toPath(path); return function(object) { if (object == null) { return false; } var key = pathKey; object = toObject(object); if ((isArr || !isCommon) && !(key in object)) { object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); if (object == null) { return false; } key = last(path); object = toObject(object); } return object[key] === srcValue ? (srcValue !== undefined || (key in object)) : baseIsEqual(srcValue, object[key], undefined, true); }; } module.exports = baseMatchesProperty; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/utility/property.js", ["npm:lodash@3.9.3/internal/baseProperty.js", "npm:lodash@3.9.3/internal/basePropertyDeep.js", "npm:lodash@3.9.3/internal/isKey.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var baseProperty = require("npm:lodash@3.9.3/internal/baseProperty.js"), basePropertyDeep = require("npm:lodash@3.9.3/internal/basePropertyDeep.js"), isKey = require("npm:lodash@3.9.3/internal/isKey.js"); function property(path) { return isKey(path) ? baseProperty(path) : basePropertyDeep(path); } module.exports = property; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseFor.js", ["npm:lodash@3.9.3/internal/createBaseFor.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var createBaseFor = require("npm:lodash@3.9.3/internal/createBaseFor.js"); var baseFor = createBaseFor(); module.exports = baseFor; global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLDocType.js", ["npm:lodash@3.9.3/object/create.js", "npm:lodash@3.9.3/lang/isObject.js", "npm:xmlbuilder@2.6.4/lib/XMLCData.js", "npm:xmlbuilder@2.6.4/lib/XMLComment.js", "npm:xmlbuilder@2.6.4/lib/XMLDTDAttList.js", "npm:xmlbuilder@2.6.4/lib/XMLDTDEntity.js", "npm:xmlbuilder@2.6.4/lib/XMLDTDElement.js", "npm:xmlbuilder@2.6.4/lib/XMLDTDNotation.js", "npm:xmlbuilder@2.6.4/lib/XMLProcessingInstruction.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLProcessingInstruction, create, isObject; create = require("npm:lodash@3.9.3/object/create.js"); isObject = require("npm:lodash@3.9.3/lang/isObject.js"); XMLCData = require("npm:xmlbuilder@2.6.4/lib/XMLCData.js"); XMLComment = require("npm:xmlbuilder@2.6.4/lib/XMLComment.js"); XMLDTDAttList = require("npm:xmlbuilder@2.6.4/lib/XMLDTDAttList.js"); XMLDTDEntity = require("npm:xmlbuilder@2.6.4/lib/XMLDTDEntity.js"); XMLDTDElement = require("npm:xmlbuilder@2.6.4/lib/XMLDTDElement.js"); XMLDTDNotation = require("npm:xmlbuilder@2.6.4/lib/XMLDTDNotation.js"); XMLProcessingInstruction = require("npm:xmlbuilder@2.6.4/lib/XMLProcessingInstruction.js"); module.exports = XMLDocType = (function() { function XMLDocType(parent, pubID, sysID) { var ref, ref1; this.documentObject = parent; this.stringify = this.documentObject.stringify; this.children = []; if (isObject(pubID)) { ref = pubID, pubID = ref.pubID, sysID = ref.sysID; } if (sysID == null) { ref1 = [pubID, sysID], sysID = ref1[0], pubID = ref1[1]; } if (pubID != null) { this.pubID = this.stringify.dtdPubID(pubID); } if (sysID != null) { this.sysID = this.stringify.dtdSysID(sysID); } } XMLDocType.prototype.clone = function() { return create(XMLDocType.prototype, this); }; XMLDocType.prototype.element = function(name, value) { var child; child = new XMLDTDElement(this, name, value); this.children.push(child); return this; }; XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { var child; child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue); this.children.push(child); return this; }; XMLDocType.prototype.entity = function(name, value) { var child; child = new XMLDTDEntity(this, false, name, value); this.children.push(child); return this; }; XMLDocType.prototype.pEntity = function(name, value) { var child; child = new XMLDTDEntity(this, true, name, value); this.children.push(child); return this; }; XMLDocType.prototype.notation = function(name, value) { var child; child = new XMLDTDNotation(this, name, value); this.children.push(child); return this; }; XMLDocType.prototype.cdata = function(value) { var child; child = new XMLCData(this, value); this.children.push(child); return this; }; XMLDocType.prototype.comment = function(value) { var child; child = new XMLComment(this, value); this.children.push(child); return this; }; XMLDocType.prototype.instruction = function(target, value) { var child; child = new XMLProcessingInstruction(this, target, value); this.children.push(child); return this; }; XMLDocType.prototype.root = function() { return this.documentObject.root(); }; XMLDocType.prototype.document = function() { return this.documentObject; }; XMLDocType.prototype.toString = function(options, level) { var child, i, indent, len, newline, offset, pretty, r, ref, ref1, ref2, ref3, space; pretty = (options != null ? options.pretty : void 0) || false; indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; level || (level = 0); space = new Array(level + offset + 1).join(indent); r = ''; if (pretty) { r += space; } r += '<!DOCTYPE ' + this.root().name; if (this.pubID && this.sysID) { r += ' PUBLIC "' + this.pubID + '" "' + this.sysID + '"'; } else if (this.sysID) { r += ' SYSTEM "' + this.sysID + '"'; } if (this.children.length > 0) { r += ' ['; if (pretty) { r += newline; } ref3 = this.children; for (i = 0, len = ref3.length; i < len; i++) { child = ref3[i]; r += child.toString(options, level + 1); } r += ']'; } r += '>'; if (pretty) { r += newline; } return r; }; XMLDocType.prototype.ele = function(name, value) { return this.element(name, value); }; XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue); }; XMLDocType.prototype.ent = function(name, value) { return this.entity(name, value); }; XMLDocType.prototype.pent = function(name, value) { return this.pEntity(name, value); }; XMLDocType.prototype.not = function(name, value) { return this.notation(name, value); }; XMLDocType.prototype.dat = function(value) { return this.cdata(value); }; XMLDocType.prototype.com = function(value) { return this.comment(value); }; XMLDocType.prototype.ins = function(target, value) { return this.instruction(target, value); }; XMLDocType.prototype.up = function() { return this.root(); }; XMLDocType.prototype.doc = function() { return this.document(); }; return XMLDocType; })(); }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("github:jspm/nodelibs-process@0.1.1/index.js", ["npm:process@0.10.1.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = System._nodeRequire ? process : require("npm:process@0.10.1.js"); global.define = __define; return module.exports; }); System.registerDynamic("github:jspm/nodelibs-events@0.1.1/index.js", ["npm:events@1.0.2.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = System._nodeRequire ? System._nodeRequire('events') : require("npm:events@1.0.2.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:buffer@3.2.2/index.js", ["npm:base64-js@0.0.8.js", "npm:ieee754@1.1.6.js", "npm:is-array@1.0.1.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var base64 = require("npm:base64-js@0.0.8.js"); var ieee754 = require("npm:ieee754@1.1.6.js"); var isArray = require("npm:is-array@1.0.1.js"); exports.Buffer = Buffer; exports.SlowBuffer = SlowBuffer; exports.INSPECT_MAX_BYTES = 50; Buffer.poolSize = 8192; var kMaxLength = 0x3fffffff; var rootParent = {}; Buffer.TYPED_ARRAY_SUPPORT = (function() { try { var buf = new ArrayBuffer(0); var arr = new Uint8Array(buf); arr.foo = function() { return 42; }; return arr.foo() === 42 && typeof arr.subarray === 'function' && new Uint8Array(1).subarray(1, 1).byteLength === 0; } catch (e) { return false; } })(); function Buffer(arg) { if (!(this instanceof Buffer)) { if (arguments.length > 1) return new Buffer(arg, arguments[1]); return new Buffer(arg); } this.length = 0; this.parent = undefined; if (typeof arg === 'number') { return fromNumber(this, arg); } if (typeof arg === 'string') { return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8'); } return fromObject(this, arg); } function fromNumber(that, length) { that = allocate(that, length < 0 ? 0 : checked(length) | 0); if (!Buffer.TYPED_ARRAY_SUPPORT) { for (var i = 0; i < length; i++) { that[i] = 0; } } return that; } function fromString(that, string, encoding) { if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8'; var length = byteLength(string, encoding) | 0; that = allocate(that, length); that.write(string, encoding); return that; } function fromObject(that, object) { if (Buffer.isBuffer(object)) return fromBuffer(that, object); if (isArray(object)) return fromArray(that, object); if (object == null) { throw new TypeError('must start with number, buffer, array or string'); } if (typeof ArrayBuffer !== 'undefined' && object.buffer instanceof ArrayBuffer) { return fromTypedArray(that, object); } if (object.length) return fromArrayLike(that, object); return fromJsonObject(that, object); } function fromBuffer(that, buffer) { var length = checked(buffer.length) | 0; that = allocate(that, length); buffer.copy(that, 0, 0, length); return that; } function fromArray(that, array) { var length = checked(array.length) | 0; that = allocate(that, length); for (var i = 0; i < length; i += 1) { that[i] = array[i] & 255; } return that; } function fromTypedArray(that, array) { var length = checked(array.length) | 0; that = allocate(that, length); for (var i = 0; i < length; i += 1) { that[i] = array[i] & 255; } return that; } function fromArrayLike(that, array) { var length = checked(array.length) | 0; that = allocate(that, length); for (var i = 0; i < length; i += 1) { that[i] = array[i] & 255; } return that; } function fromJsonObject(that, object) { var array; var length = 0; if (object.type === 'Buffer' && isArray(object.data)) { array = object.data; length = checked(array.length) | 0; } that = allocate(that, length); for (var i = 0; i < length; i += 1) { that[i] = array[i] & 255; } return that; } function allocate(that, length) { if (Buffer.TYPED_ARRAY_SUPPORT) { that = Buffer._augment(new Uint8Array(length)); } else { that.length = length; that._isBuffer = true; } var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1; if (fromPool) that.parent = rootParent; return that; } function checked(length) { if (length >= kMaxLength) { throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength.toString(16) + ' bytes'); } return length | 0; } function SlowBuffer(subject, encoding) { if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding); var buf = new Buffer(subject, encoding); delete buf.parent; return buf; } Buffer.isBuffer = function isBuffer(b) { return !!(b != null && b._isBuffer); }; Buffer.compare = function compare(a, b) { if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { throw new TypeError('Arguments must be Buffers'); } if (a === b) return 0; var x = a.length; var y = b.length; var i = 0; var len = Math.min(x, y); while (i < len) { if (a[i] !== b[i]) break; ++i; } if (i !== len) { x = a[i]; y = b[i]; } if (x < y) return -1; if (y < x) return 1; return 0; }; Buffer.isEncoding = function isEncoding(encoding) { switch (String(encoding).toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'raw': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return true; default: return false; } }; Buffer.concat = function concat(list, length) { if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.'); if (list.length === 0) { return new Buffer(0); } else if (list.length === 1) { return list[0]; } var i; if (length === undefined) { length = 0; for (i = 0; i < list.length; i++) { length += list[i].length; } } var buf = new Buffer(length); var pos = 0; for (i = 0; i < list.length; i++) { var item = list[i]; item.copy(buf, pos); pos += item.length; } return buf; }; function byteLength(string, encoding) { if (typeof string !== 'string') string = String(string); if (string.length === 0) return 0; switch (encoding || 'utf8') { case 'ascii': case 'binary': case 'raw': return string.length; case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return string.length * 2; case 'hex': return string.length >>> 1; case 'utf8': case 'utf-8': return utf8ToBytes(string).length; case 'base64': return base64ToBytes(string).length; default: return string.length; } } Buffer.byteLength = byteLength; Buffer.prototype.length = undefined; Buffer.prototype.parent = undefined; Buffer.prototype.toString = function toString(encoding, start, end) { var loweredCase = false; start = start | 0; end = end === undefined || end === Infinity ? this.length : end | 0; if (!encoding) encoding = 'utf8'; if (start < 0) start = 0; if (end > this.length) end = this.length; if (end <= start) return ''; while (true) { switch (encoding) { case 'hex': return hexSlice(this, start, end); case 'utf8': case 'utf-8': return utf8Slice(this, start, end); case 'ascii': return asciiSlice(this, start, end); case 'binary': return binarySlice(this, start, end); case 'base64': return base64Slice(this, start, end); case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return utf16leSlice(this, start, end); default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); encoding = (encoding + '').toLowerCase(); loweredCase = true; } } }; Buffer.prototype.equals = function equals(b) { if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer'); if (this === b) return true; return Buffer.compare(this, b) === 0; }; Buffer.prototype.inspect = function inspect() { var str = ''; var max = exports.INSPECT_MAX_BYTES; if (this.length > 0) { str = this.toString('hex', 0, max).match(/.{2}/g).join(' '); if (this.length > max) str += ' ... '; } return '<Buffer ' + str + '>'; }; Buffer.prototype.compare = function compare(b) { if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer'); if (this === b) return 0; return Buffer.compare(this, b); }; Buffer.prototype.indexOf = function indexOf(val, byteOffset) { if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff; else if (byteOffset < -0x80000000) byteOffset = -0x80000000; byteOffset >>= 0; if (this.length === 0) return -1; if (byteOffset >= this.length) return -1; if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0); if (typeof val === 'string') { if (val.length === 0) return -1; return String.prototype.indexOf.call(this, val, byteOffset); } if (Buffer.isBuffer(val)) { return arrayIndexOf(this, val, byteOffset); } if (typeof val === 'number') { if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') { return Uint8Array.prototype.indexOf.call(this, val, byteOffset); } return arrayIndexOf(this, [val], byteOffset); } function arrayIndexOf(arr, val, byteOffset) { var foundIndex = -1; for (var i = 0; byteOffset + i < arr.length; i++) { if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) { if (foundIndex === -1) foundIndex = i; if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex; } else { foundIndex = -1; } } return -1; } throw new TypeError('val must be string, number or Buffer'); }; Buffer.prototype.get = function get(offset) { console.log('.get() is deprecated. Access using array indexes instead.'); return this.readUInt8(offset); }; Buffer.prototype.set = function set(v, offset) { console.log('.set() is deprecated. Access using array indexes instead.'); return this.writeUInt8(v, offset); }; function hexWrite(buf, string, offset, length) { offset = Number(offset) || 0; var remaining = buf.length - offset; if (!length) { length = remaining; } else { length = Number(length); if (length > remaining) { length = remaining; } } var strLen = string.length; if (strLen % 2 !== 0) throw new Error('Invalid hex string'); if (length > strLen / 2) { length = strLen / 2; } for (var i = 0; i < length; i++) { var parsed = parseInt(string.substr(i * 2, 2), 16); if (isNaN(parsed)) throw new Error('Invalid hex string'); buf[offset + i] = parsed; } return i; } function utf8Write(buf, string, offset, length) { return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); } function asciiWrite(buf, string, offset, length) { return blitBuffer(asciiToBytes(string), buf, offset, length); } function binaryWrite(buf, string, offset, length) { return asciiWrite(buf, string, offset, length); } function base64Write(buf, string, offset, length) { return blitBuffer(base64ToBytes(string), buf, offset, length); } function ucs2Write(buf, string, offset, length) { return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); } Buffer.prototype.write = function write(string, offset, length, encoding) { if (offset === undefined) { encoding = 'utf8'; length = this.length; offset = 0; } else if (length === undefined && typeof offset === 'string') { encoding = offset; length = this.length; offset = 0; } else if (isFinite(offset)) { offset = offset | 0; if (isFinite(length)) { length = length | 0; if (encoding === undefined) encoding = 'utf8'; } else { encoding = length; length = undefined; } } else { var swap = encoding; encoding = offset; offset = length | 0; length = swap; } var remaining = this.length - offset; if (length === undefined || length > remaining) length = remaining; if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { throw new RangeError('attempt to write outside buffer bounds'); } if (!encoding) encoding = 'utf8'; var loweredCase = false; for (; ; ) { switch (encoding) { case 'hex': return hexWrite(this, string, offset, length); case 'utf8': case 'utf-8': return utf8Write(this, string, offset, length); case 'ascii': return asciiWrite(this, string, offset, length); case 'binary': return binaryWrite(this, string, offset, length); case 'base64': return base64Write(this, string, offset, length); case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return ucs2Write(this, string, offset, length); default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); encoding = ('' + encoding).toLowerCase(); loweredCase = true; } } }; Buffer.prototype.toJSON = function toJSON() { return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0) }; }; function base64Slice(buf, start, end) { if (start === 0 && end === buf.length) { return base64.fromByteArray(buf); } else { return base64.fromByteArray(buf.slice(start, end)); } } function utf8Slice(buf, start, end) { var res = ''; var tmp = ''; end = Math.min(buf.length, end); for (var i = start; i < end; i++) { if (buf[i] <= 0x7F) { res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i]); tmp = ''; } else { tmp += '%' + buf[i].toString(16); } } return res + decodeUtf8Char(tmp); } function asciiSlice(buf, start, end) { var ret = ''; end = Math.min(buf.length, end); for (var i = start; i < end; i++) { ret += String.fromCharCode(buf[i] & 0x7F); } return ret; } function binarySlice(buf, start, end) { var ret = ''; end = Math.min(buf.length, end); for (var i = start; i < end; i++) { ret += String.fromCharCode(buf[i]); } return ret; } function hexSlice(buf, start, end) { var len = buf.length; if (!start || start < 0) start = 0; if (!end || end < 0 || end > len) end = len; var out = ''; for (var i = start; i < end; i++) { out += toHex(buf[i]); } return out; } function utf16leSlice(buf, start, end) { var bytes = buf.slice(start, end); var res = ''; for (var i = 0; i < bytes.length; i += 2) { res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); } return res; } Buffer.prototype.slice = function slice(start, end) { var len = this.length; start = ~~start; end = end === undefined ? len : ~~end; if (start < 0) { start += len; if (start < 0) start = 0; } else if (start > len) { start = len; } if (end < 0) { end += len; if (end < 0) end = 0; } else if (end > len) { end = len; } if (end < start) end = start; var newBuf; if (Buffer.TYPED_ARRAY_SUPPORT) { newBuf = Buffer._augment(this.subarray(start, end)); } else { var sliceLen = end - start; newBuf = new Buffer(sliceLen, undefined); for (var i = 0; i < sliceLen; i++) { newBuf[i] = this[i + start]; } } if (newBuf.length) newBuf.parent = this.parent || this; return newBuf; }; function checkOffset(offset, ext, length) { if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint'); if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length'); } Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { offset = offset | 0; byteLength = byteLength | 0; if (!noAssert) checkOffset(offset, byteLength, this.length); var val = this[offset]; var mul = 1; var i = 0; while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul; } return val; }; Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { offset = offset | 0; byteLength = byteLength | 0; if (!noAssert) { checkOffset(offset, byteLength, this.length); } var val = this[offset + --byteLength]; var mul = 1; while (byteLength > 0 && (mul *= 0x100)) { val += this[offset + --byteLength] * mul; } return val; }; Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { if (!noAssert) checkOffset(offset, 1, this.length); return this[offset]; }; Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length); return this[offset] | (this[offset + 1] << 8); }; Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length); return (this[offset] << 8) | this[offset + 1]; }; Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length); return ((this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16)) + (this[offset + 3] * 0x1000000); }; Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length); return (this[offset] * 0x1000000) + ((this[offset + 1] << 16) | (this[offset + 2] << 8) | this[offset + 3]); }; Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) { offset = offset | 0; byteLength = byteLength | 0; if (!noAssert) checkOffset(offset, byteLength, this.length); var val = this[offset]; var mul = 1; var i = 0; while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul; } mul *= 0x80; if (val >= mul) val -= Math.pow(2, 8 * byteLength); return val; }; Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) { offset = offset | 0; byteLength = byteLength | 0; if (!noAssert) checkOffset(offset, byteLength, this.length); var i = byteLength; var mul = 1; var val = this[offset + --i]; while (i > 0 && (mul *= 0x100)) { val += this[offset + --i] * mul; } mul *= 0x80; if (val >= mul) val -= Math.pow(2, 8 * byteLength); return val; }; Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { if (!noAssert) checkOffset(offset, 1, this.length); if (!(this[offset] & 0x80)) return (this[offset]); return ((0xff - this[offset] + 1) * -1); }; Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length); var val = this[offset] | (this[offset + 1] << 8); return (val & 0x8000) ? val | 0xFFFF0000 : val; }; Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length); var val = this[offset + 1] | (this[offset] << 8); return (val & 0x8000) ? val | 0xFFFF0000 : val; }; Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length); return (this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16) | (this[offset + 3] << 24); }; Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length); return (this[offset] << 24) | (this[offset + 1] << 16) | (this[offset + 2] << 8) | (this[offset + 3]); }; Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length); return ieee754.read(this, offset, true, 23, 4); }; Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length); return ieee754.read(this, offset, false, 23, 4); }; Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { if (!noAssert) checkOffset(offset, 8, this.length); return ieee754.read(this, offset, true, 52, 8); }; Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { if (!noAssert) checkOffset(offset, 8, this.length); return ieee754.read(this, offset, false, 52, 8); }; function checkInt(buf, value, offset, ext, max, min) { if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance'); if (value > max || value < min) throw new RangeError('value is out of bounds'); if (offset + ext > buf.length) throw new RangeError('index out of range'); } Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) { value = +value; offset = offset | 0; byteLength = byteLength | 0; if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0); var mul = 1; var i = 0; this[offset] = value & 0xFF; while (++i < byteLength && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF; } return offset + byteLength; }; Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) { value = +value; offset = offset | 0; byteLength = byteLength | 0; if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0); var i = byteLength - 1; var mul = 1; this[offset + i] = value & 0xFF; while (--i >= 0 && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF; } return offset + byteLength; }; Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value); this[offset] = value; return offset + 1; }; function objectWriteUInt16(buf, value, offset, littleEndian) { if (value < 0) value = 0xffff + value + 1; for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) { buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> (littleEndian ? i : 1 - i) * 8; } } Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = value; this[offset + 1] = (value >>> 8); } else { objectWriteUInt16(this, value, offset, true); } return offset + 2; }; Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 8); this[offset + 1] = value; } else { objectWriteUInt16(this, value, offset, false); } return offset + 2; }; function objectWriteUInt32(buf, value, offset, littleEndian) { if (value < 0) value = 0xffffffff + value + 1; for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) { buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff; } } Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset + 3] = (value >>> 24); this[offset + 2] = (value >>> 16); this[offset + 1] = (value >>> 8); this[offset] = value; } else { objectWriteUInt32(this, value, offset, true); } return offset + 4; }; Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 24); this[offset + 1] = (value >>> 16); this[offset + 2] = (value >>> 8); this[offset + 3] = value; } else { objectWriteUInt32(this, value, offset, false); } return offset + 4; }; Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) { value = +value; offset = offset | 0; if (!noAssert) { var limit = Math.pow(2, 8 * byteLength - 1); checkInt(this, value, offset, byteLength, limit - 1, -limit); } var i = 0; var mul = 1; var sub = value < 0 ? 1 : 0; this[offset] = value & 0xFF; while (++i < byteLength && (mul *= 0x100)) { this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; } return offset + byteLength; }; Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) { value = +value; offset = offset | 0; if (!noAssert) { var limit = Math.pow(2, 8 * byteLength - 1); checkInt(this, value, offset, byteLength, limit - 1, -limit); } var i = byteLength - 1; var mul = 1; var sub = value < 0 ? 1 : 0; this[offset + i] = value & 0xFF; while (--i >= 0 && (mul *= 0x100)) { this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; } return offset + byteLength; }; Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80); if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value); if (value < 0) value = 0xff + value + 1; this[offset] = value; return offset + 1; }; Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = value; this[offset + 1] = (value >>> 8); } else { objectWriteUInt16(this, value, offset, true); } return offset + 2; }; Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 8); this[offset + 1] = value; } else { objectWriteUInt16(this, value, offset, false); } return offset + 2; }; Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = value; this[offset + 1] = (value >>> 8); this[offset + 2] = (value >>> 16); this[offset + 3] = (value >>> 24); } else { objectWriteUInt32(this, value, offset, true); } return offset + 4; }; Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { value = +value; offset = offset | 0; if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); if (value < 0) value = 0xffffffff + value + 1; if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 24); this[offset + 1] = (value >>> 16); this[offset + 2] = (value >>> 8); this[offset + 3] = value; } else { objectWriteUInt32(this, value, offset, false); } return offset + 4; }; function checkIEEE754(buf, value, offset, ext, max, min) { if (value > max || value < min) throw new RangeError('value is out of bounds'); if (offset + ext > buf.length) throw new RangeError('index out of range'); if (offset < 0) throw new RangeError('index out of range'); } function writeFloat(buf, value, offset, littleEndian, noAssert) { if (!noAssert) { checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38); } ieee754.write(buf, value, offset, littleEndian, 23, 4); return offset + 4; } Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { return writeFloat(this, value, offset, true, noAssert); }; Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { return writeFloat(this, value, offset, false, noAssert); }; function writeDouble(buf, value, offset, littleEndian, noAssert) { if (!noAssert) { checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308); } ieee754.write(buf, value, offset, littleEndian, 52, 8); return offset + 8; } Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { return writeDouble(this, value, offset, true, noAssert); }; Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { return writeDouble(this, value, offset, false, noAssert); }; Buffer.prototype.copy = function copy(target, targetStart, start, end) { if (!start) start = 0; if (!end && end !== 0) end = this.length; if (targetStart >= target.length) targetStart = target.length; if (!targetStart) targetStart = 0; if (end > 0 && end < start) end = start; if (end === start) return 0; if (target.length === 0 || this.length === 0) return 0; if (targetStart < 0) { throw new RangeError('targetStart out of bounds'); } if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds'); if (end < 0) throw new RangeError('sourceEnd out of bounds'); if (end > this.length) end = this.length; if (target.length - targetStart < end - start) { end = target.length - targetStart + start; } var len = end - start; if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { for (var i = 0; i < len; i++) { target[i + targetStart] = this[i + start]; } } else { target._set(this.subarray(start, start + len), targetStart); } return len; }; Buffer.prototype.fill = function fill(value, start, end) { if (!value) value = 0; if (!start) start = 0; if (!end) end = this.length; if (end < start) throw new RangeError('end < start'); if (end === start) return; if (this.length === 0) return; if (start < 0 || start >= this.length) throw new RangeError('start out of bounds'); if (end < 0 || end > this.length) throw new RangeError('end out of bounds'); var i; if (typeof value === 'number') { for (i = start; i < end; i++) { this[i] = value; } } else { var bytes = utf8ToBytes(value.toString()); var len = bytes.length; for (i = start; i < end; i++) { this[i] = bytes[i % len]; } } return this; }; Buffer.prototype.toArrayBuffer = function toArrayBuffer() { if (typeof Uint8Array !== 'undefined') { if (Buffer.TYPED_ARRAY_SUPPORT) { return (new Buffer(this)).buffer; } else { var buf = new Uint8Array(this.length); for (var i = 0, len = buf.length; i < len; i += 1) { buf[i] = this[i]; } return buf.buffer; } } else { throw new TypeError('Buffer.toArrayBuffer not supported in this browser'); } }; var BP = Buffer.prototype; Buffer._augment = function _augment(arr) { arr.constructor = Buffer; arr._isBuffer = true; arr._set = arr.set; arr.get = BP.get; arr.set = BP.set; arr.write = BP.write; arr.toString = BP.toString; arr.toLocaleString = BP.toString; arr.toJSON = BP.toJSON; arr.equals = BP.equals; arr.compare = BP.compare; arr.indexOf = BP.indexOf; arr.copy = BP.copy; arr.slice = BP.slice; arr.readUIntLE = BP.readUIntLE; arr.readUIntBE = BP.readUIntBE; arr.readUInt8 = BP.readUInt8; arr.readUInt16LE = BP.readUInt16LE; arr.readUInt16BE = BP.readUInt16BE; arr.readUInt32LE = BP.readUInt32LE; arr.readUInt32BE = BP.readUInt32BE; arr.readIntLE = BP.readIntLE; arr.readIntBE = BP.readIntBE; arr.readInt8 = BP.readInt8; arr.readInt16LE = BP.readInt16LE; arr.readInt16BE = BP.readInt16BE; arr.readInt32LE = BP.readInt32LE; arr.readInt32BE = BP.readInt32BE; arr.readFloatLE = BP.readFloatLE; arr.readFloatBE = BP.readFloatBE; arr.readDoubleLE = BP.readDoubleLE; arr.readDoubleBE = BP.readDoubleBE; arr.writeUInt8 = BP.writeUInt8; arr.writeUIntLE = BP.writeUIntLE; arr.writeUIntBE = BP.writeUIntBE; arr.writeUInt16LE = BP.writeUInt16LE; arr.writeUInt16BE = BP.writeUInt16BE; arr.writeUInt32LE = BP.writeUInt32LE; arr.writeUInt32BE = BP.writeUInt32BE; arr.writeIntLE = BP.writeIntLE; arr.writeIntBE = BP.writeIntBE; arr.writeInt8 = BP.writeInt8; arr.writeInt16LE = BP.writeInt16LE; arr.writeInt16BE = BP.writeInt16BE; arr.writeInt32LE = BP.writeInt32LE; arr.writeInt32BE = BP.writeInt32BE; arr.writeFloatLE = BP.writeFloatLE; arr.writeFloatBE = BP.writeFloatBE; arr.writeDoubleLE = BP.writeDoubleLE; arr.writeDoubleBE = BP.writeDoubleBE; arr.fill = BP.fill; arr.inspect = BP.inspect; arr.toArrayBuffer = BP.toArrayBuffer; return arr; }; var INVALID_BASE64_RE = /[^+\/0-9A-z\-]/g; function base64clean(str) { str = stringtrim(str).replace(INVALID_BASE64_RE, ''); if (str.length < 2) return ''; while (str.length % 4 !== 0) { str = str + '='; } return str; } function stringtrim(str) { if (str.trim) return str.trim(); return str.replace(/^\s+|\s+$/g, ''); } function toHex(n) { if (n < 16) return '0' + n.toString(16); return n.toString(16); } function utf8ToBytes(string, units) { units = units || Infinity; var codePoint; var length = string.length; var leadSurrogate = null; var bytes = []; var i = 0; for (; i < length; i++) { codePoint = string.charCodeAt(i); if (codePoint > 0xD7FF && codePoint < 0xE000) { if (leadSurrogate) { if (codePoint < 0xDC00) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); leadSurrogate = codePoint; continue; } else { codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000; leadSurrogate = null; } } else { if (codePoint > 0xDBFF) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); continue; } else if (i + 1 === length) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); continue; } else { leadSurrogate = codePoint; continue; } } } else if (leadSurrogate) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); leadSurrogate = null; } if (codePoint < 0x80) { if ((units -= 1) < 0) break; bytes.push(codePoint); } else if (codePoint < 0x800) { if ((units -= 2) < 0) break; bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80); } else if (codePoint < 0x10000) { if ((units -= 3) < 0) break; bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); } else if (codePoint < 0x200000) { if ((units -= 4) < 0) break; bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); } else { throw new Error('Invalid code point'); } } return bytes; } function asciiToBytes(str) { var byteArray = []; for (var i = 0; i < str.length; i++) { byteArray.push(str.charCodeAt(i) & 0xFF); } return byteArray; } function utf16leToBytes(str, units) { var c, hi, lo; var byteArray = []; for (var i = 0; i < str.length; i++) { if ((units -= 2) < 0) break; c = str.charCodeAt(i); hi = c >> 8; lo = c % 256; byteArray.push(lo); byteArray.push(hi); } return byteArray; } function base64ToBytes(str) { return base64.toByteArray(base64clean(str)); } function blitBuffer(src, dst, offset, length) { for (var i = 0; i < length; i++) { if ((i + offset >= dst.length) || (i >= src.length)) break; dst[i + offset] = src[i]; } return i; } function decodeUtf8Char(str) { try { return decodeURIComponent(str); } catch (err) { return String.fromCharCode(0xFFFD); } } global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/lang/isNative.js", ["npm:lodash@3.9.3/string/escapeRegExp.js", "npm:lodash@3.9.3/internal/isObjectLike.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var escapeRegExp = require("npm:lodash@3.9.3/string/escapeRegExp.js"), isObjectLike = require("npm:lodash@3.9.3/internal/isObjectLike.js"); var funcTag = '[object Function]'; var reIsHostCtor = /^\[object .+?Constructor\]$/; var objectProto = Object.prototype; var fnToString = Function.prototype.toString; var hasOwnProperty = objectProto.hasOwnProperty; var objToString = objectProto.toString; var reIsNative = RegExp('^' + escapeRegExp(fnToString.call(hasOwnProperty)).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); function isNative(value) { if (value == null) { return false; } if (objToString.call(value) == funcTag) { return reIsNative.test(fnToString.call(value)); } return isObjectLike(value) && reIsHostCtor.test(value); } module.exports = isNative; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/isArrayLike.js", ["npm:lodash@3.9.3/internal/getLength.js", "npm:lodash@3.9.3/internal/isLength.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var getLength = require("npm:lodash@3.9.3/internal/getLength.js"), isLength = require("npm:lodash@3.9.3/internal/isLength.js"); function isArrayLike(value) { return value != null && isLength(getLength(value)); } module.exports = isArrayLike; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/createAssigner.js", ["npm:lodash@3.9.3/internal/bindCallback.js", "npm:lodash@3.9.3/internal/isIterateeCall.js", "npm:lodash@3.9.3/function/restParam.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var bindCallback = require("npm:lodash@3.9.3/internal/bindCallback.js"), isIterateeCall = require("npm:lodash@3.9.3/internal/isIterateeCall.js"), restParam = require("npm:lodash@3.9.3/function/restParam.js"); function createAssigner(assigner) { return restParam(function(object, sources) { var index = -1, length = object == null ? 0 : sources.length, customizer = length > 2 ? sources[length - 2] : undefined, guard = length > 2 ? sources[2] : undefined, thisArg = length > 1 ? sources[length - 1] : undefined; if (typeof customizer == 'function') { customizer = bindCallback(customizer, thisArg, 5); length -= 2; } else { customizer = typeof thisArg == 'function' ? thisArg : undefined; length -= (customizer ? 1 : 0); } if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, customizer); } } return object; }); } module.exports = createAssigner; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseIsEqualDeep.js", ["npm:lodash@3.9.3/internal/equalArrays.js", "npm:lodash@3.9.3/internal/equalByTag.js", "npm:lodash@3.9.3/internal/equalObjects.js", "npm:lodash@3.9.3/lang/isArray.js", "npm:lodash@3.9.3/lang/isTypedArray.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var equalArrays = require("npm:lodash@3.9.3/internal/equalArrays.js"), equalByTag = require("npm:lodash@3.9.3/internal/equalByTag.js"), equalObjects = require("npm:lodash@3.9.3/internal/equalObjects.js"), isArray = require("npm:lodash@3.9.3/lang/isArray.js"), isTypedArray = require("npm:lodash@3.9.3/lang/isTypedArray.js"); var argsTag = '[object Arguments]', arrayTag = '[object Array]', objectTag = '[object Object]'; var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; var objToString = objectProto.toString; function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = arrayTag, othTag = arrayTag; if (!objIsArr) { objTag = objToString.call(object); if (objTag == argsTag) { objTag = objectTag; } else if (objTag != objectTag) { objIsArr = isTypedArray(object); } } if (!othIsArr) { othTag = objToString.call(other); if (othTag == argsTag) { othTag = objectTag; } else if (othTag != objectTag) { othIsArr = isTypedArray(other); } } var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && !(objIsArr || objIsObj)) { return equalByTag(object, other, objTag); } if (!isLoose) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB); } } if (!isSameTag) { return false; } stackA || (stackA = []); stackB || (stackB = []); var length = stackA.length; while (length--) { if (stackA[length] == object) { return stackB[length] == other; } } stackA.push(object); stackB.push(other); var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB); stackA.pop(); stackB.pop(); return result; } module.exports = baseIsEqualDeep; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseForOwn.js", ["npm:lodash@3.9.3/internal/baseFor.js", "npm:lodash@3.9.3/object/keys.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var baseFor = require("npm:lodash@3.9.3/internal/baseFor.js"), keys = require("npm:lodash@3.9.3/object/keys.js"); function baseForOwn(object, iteratee) { return baseFor(object, iteratee, keys); } module.exports = baseForOwn; global.define = __define; return module.exports; }); System.registerDynamic("github:jspm/nodelibs-process@0.1.1.js", ["github:jspm/nodelibs-process@0.1.1/index.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("github:jspm/nodelibs-process@0.1.1/index.js"); global.define = __define; return module.exports; }); System.registerDynamic("github:jspm/nodelibs-events@0.1.1.js", ["github:jspm/nodelibs-events@0.1.1/index.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("github:jspm/nodelibs-events@0.1.1/index.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:buffer@3.2.2.js", ["npm:buffer@3.2.2/index.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:buffer@3.2.2/index.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/getNative.js", ["npm:lodash@3.9.3/lang/isNative.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var isNative = require("npm:lodash@3.9.3/lang/isNative.js"); function getNative(object, key) { var value = object == null ? undefined : object[key]; return isNative(value) ? value : undefined; } module.exports = getNative; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseIsEqual.js", ["npm:lodash@3.9.3/internal/baseIsEqualDeep.js", "npm:lodash@3.9.3/lang/isObject.js", "npm:lodash@3.9.3/internal/isObjectLike.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var baseIsEqualDeep = require("npm:lodash@3.9.3/internal/baseIsEqualDeep.js"), isObject = require("npm:lodash@3.9.3/lang/isObject.js"), isObjectLike = require("npm:lodash@3.9.3/internal/isObjectLike.js"); function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) { if (value === other) { return true; } if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB); } module.exports = baseIsEqual; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseEach.js", ["npm:lodash@3.9.3/internal/baseForOwn.js", "npm:lodash@3.9.3/internal/createBaseEach.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var baseForOwn = require("npm:lodash@3.9.3/internal/baseForOwn.js"), createBaseEach = require("npm:lodash@3.9.3/internal/createBaseEach.js"); var baseEach = createBaseEach(baseForOwn); module.exports = baseEach; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/index.js", ["github:jspm/nodelibs-process@0.1.1.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; "format cjs"; (function(process) { ; (function() { var undefined; var VERSION = '3.9.3'; var BIND_FLAG = 1, BIND_KEY_FLAG = 2, CURRY_BOUND_FLAG = 4, CURRY_FLAG = 8, CURRY_RIGHT_FLAG = 16, PARTIAL_FLAG = 32, PARTIAL_RIGHT_FLAG = 64, ARY_FLAG = 128, REARG_FLAG = 256; var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = '...'; var HOT_COUNT = 150, HOT_SPAN = 16; var LAZY_DROP_WHILE_FLAG = 0, LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2; var FUNC_ERROR_TEXT = 'Expected a function'; var PLACEHOLDER = '__lodash_placeholder__'; var argsTag = '[object Arguments]', arrayTag = '[object Array]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', mapTag = '[object Map]', numberTag = '[object Number]', objectTag = '[object Object]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, reUnescapedHtml = /[&<>"'`]/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g; var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g, reHasRegExpChars = RegExp(reRegExpChars.source); var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g; var reEscapeChar = /\\(\\)?/g; var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; var reFlags = /\w*$/; var reHasHexPrefix = /^0[xX]/; var reIsHostCtor = /^\[object .+?Constructor\]$/; var reIsUint = /^\d+$/; var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; var reNoMatch = /($^)/; var reUnescapedString = /['\n\r\u2028\u2029\\]/g; var reWords = (function() { var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]', lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+'; return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g'); }()); var whitespace = (' \t\x0b\f\xa0\ufeff' + '\n\r\u2028\u2029' + '\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000'); var contextProps = ['Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number', 'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'document', 'isFinite', 'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', 'window']; var templateCounter = -1; var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[stringTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[mapTag] = cloneableTags[setTag] = cloneableTags[weakMapTag] = false; var debounceOptions = { 'leading': false, 'maxWait': 0, 'trailing': false }; var deburredLetters = { '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', '\xc7': 'C', '\xe7': 'c', '\xd0': 'D', '\xf0': 'd', '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', '\xd1': 'N', '\xf1': 'n', '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', '\xc6': 'Ae', '\xe6': 'ae', '\xde': 'Th', '\xfe': 'th', '\xdf': 'ss' }; var htmlEscapes = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;', '`': '&#96;' }; var htmlUnescapes = { '&amp;': '&', '&lt;': '<', '&gt;': '>', '&quot;': '"', '&#39;': "'", '&#96;': '`' }; var objectTypes = { 'function': true, 'object': true }; var stringEscapes = { '\\': '\\', "'": "'", '\n': 'n', '\r': 'r', '\u2028': 'u2028', '\u2029': 'u2029' }; var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global; var freeSelf = objectTypes[typeof self] && self && self.Object && self; var freeWindow = objectTypes[typeof window] && window && window.Object && window; var moduleExports = freeModule && freeModule.exports === freeExports && freeExports; var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this; function baseCompareAscending(value, other) { if (value !== other) { var valIsNull = value === null, valIsUndef = value === undefined, valIsReflexive = value === value; var othIsNull = other === null, othIsUndef = other === undefined, othIsReflexive = other === other; if ((value > other && !othIsNull) || !valIsReflexive || (valIsNull && !othIsUndef && othIsReflexive) || (valIsUndef && othIsReflexive)) { return 1; } if ((value < other && !valIsNull) || !othIsReflexive || (othIsNull && !valIsUndef && valIsReflexive) || (othIsUndef && valIsReflexive)) { return -1; } } return 0; } function baseFindIndex(array, predicate, fromRight) { var length = array.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { return index; } } return -1; } function baseIndexOf(array, value, fromIndex) { if (value !== value) { return indexOfNaN(array, fromIndex); } var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } function baseIsFunction(value) { return typeof value == 'function' || false; } function baseToString(value) { if (typeof value == 'string') { return value; } return value == null ? '' : (value + ''); } function charsLeftIndex(string, chars) { var index = -1, length = string.length; while (++index < length && chars.indexOf(string.charAt(index)) > -1) {} return index; } function charsRightIndex(string, chars) { var index = string.length; while (index-- && chars.indexOf(string.charAt(index)) > -1) {} return index; } function compareAscending(object, other) { return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index); } function compareMultiple(object, other, orders) { var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; while (++index < length) { var result = baseCompareAscending(objCriteria[index], othCriteria[index]); if (result) { if (index >= ordersLength) { return result; } return result * (orders[index] ? 1 : -1); } } return object.index - other.index; } function deburrLetter(letter) { return deburredLetters[letter]; } function escapeHtmlChar(chr) { return htmlEscapes[chr]; } function escapeStringChar(chr) { return '\\' + stringEscapes[chr]; } function indexOfNaN(array, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 0 : -1); while ((fromRight ? index-- : ++index < length)) { var other = array[index]; if (other !== other) { return index; } } return -1; } function isObjectLike(value) { return !!value && typeof value == 'object'; } function isSpace(charCode) { return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 || (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279))); } function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = -1, result = []; while (++index < length) { if (array[index] === placeholder) { array[index] = PLACEHOLDER; result[++resIndex] = index; } } return result; } function sortedUniq(array, iteratee) { var seen, index = -1, length = array.length, resIndex = -1, result = []; while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value, index, array) : value; if (!index || seen !== computed) { seen = computed; result[++resIndex] = value; } } return result; } function trimmedLeftIndex(string) { var index = -1, length = string.length; while (++index < length && isSpace(string.charCodeAt(index))) {} return index; } function trimmedRightIndex(string) { var index = string.length; while (index-- && isSpace(string.charCodeAt(index))) {} return index; } function unescapeHtmlChar(chr) { return htmlUnescapes[chr]; } function runInContext(context) { context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root; var Array = context.Array, Date = context.Date, Error = context.Error, Function = context.Function, Math = context.Math, Number = context.Number, Object = context.Object, RegExp = context.RegExp, String = context.String, TypeError = context.TypeError; var arrayProto = Array.prototype, objectProto = Object.prototype, stringProto = String.prototype; var document = (document = context.window) ? document.document : null; var fnToString = Function.prototype.toString; var hasOwnProperty = objectProto.hasOwnProperty; var idCounter = 0; var objToString = objectProto.toString; var oldDash = context._; var reIsNative = RegExp('^' + escapeRegExp(fnToString.call(hasOwnProperty)).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); var ArrayBuffer = getNative(context, 'ArrayBuffer'), bufferSlice = getNative(ArrayBuffer && new ArrayBuffer(0), 'slice'), ceil = Math.ceil, clearTimeout = context.clearTimeout, floor = Math.floor, getPrototypeOf = getNative(Object, 'getPrototypeOf'), parseFloat = context.parseFloat, push = arrayProto.push, Set = getNative(context, 'Set'), setTimeout = context.setTimeout, splice = arrayProto.splice, Uint8Array = getNative(context, 'Uint8Array'), WeakMap = getNative(context, 'WeakMap'); var Float64Array = (function() { try { var func = getNative(context, 'Float64Array'), result = new func(new ArrayBuffer(10), 0, 1) && func; } catch (e) {} return result || null; }()); var nativeCreate = getNative(Object, 'create'), nativeIsArray = getNative(Array, 'isArray'), nativeIsFinite = context.isFinite, nativeKeys = getNative(Object, 'keys'), nativeMax = Math.max, nativeMin = Math.min, nativeNow = getNative(Date, 'now'), nativeNumIsFinite = getNative(Number, 'isFinite'), nativeParseInt = context.parseInt, nativeRandom = Math.random; var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY, POSITIVE_INFINITY = Number.POSITIVE_INFINITY; var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; var FLOAT64_BYTES_PER_ELEMENT = Float64Array ? Float64Array.BYTES_PER_ELEMENT : 0; var MAX_SAFE_INTEGER = 9007199254740991; var metaMap = WeakMap && new WeakMap; var realNames = {}; function lodash(value) { if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { if (value instanceof LodashWrapper) { return value; } if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) { return wrapperClone(value); } } return new LodashWrapper(value); } function baseLodash() {} function LodashWrapper(value, chainAll, actions) { this.__wrapped__ = value; this.__actions__ = actions || []; this.__chain__ = !!chainAll; } var support = lodash.support = {}; (function(x) { var Ctor = function() { this.x = x; }, object = { '0': x, 'length': x }, props = []; Ctor.prototype = { 'valueOf': x, 'y': x }; for (var key in new Ctor) { props.push(key); } try { support.dom = document.createDocumentFragment().nodeType === 11; } catch (e) { support.dom = false; } }(1, 0)); lodash.templateSettings = { 'escape': reEscape, 'evaluate': reEvaluate, 'interpolate': reInterpolate, 'variable': '', 'imports': {'_': lodash} }; function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = null; this.__dir__ = 1; this.__dropCount__ = 0; this.__filtered__ = false; this.__iteratees__ = null; this.__takeCount__ = POSITIVE_INFINITY; this.__views__ = null; } function lazyClone() { var actions = this.__actions__, iteratees = this.__iteratees__, views = this.__views__, result = new LazyWrapper(this.__wrapped__); result.__actions__ = actions ? arrayCopy(actions) : null; result.__dir__ = this.__dir__; result.__filtered__ = this.__filtered__; result.__iteratees__ = iteratees ? arrayCopy(iteratees) : null; result.__takeCount__ = this.__takeCount__; result.__views__ = views ? arrayCopy(views) : null; return result; } function lazyReverse() { if (this.__filtered__) { var result = new LazyWrapper(this); result.__dir__ = -1; result.__filtered__ = true; } else { result = this.clone(); result.__dir__ *= -1; } return result; } function lazyValue() { var array = this.__wrapped__.value(); if (!isArray(array)) { return baseWrapperValue(array, this.__actions__); } var dir = this.__dir__, isRight = dir < 0, view = getView(0, array.length, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : (start - 1), takeCount = nativeMin(length, this.__takeCount__), iteratees = this.__iteratees__, iterLength = iteratees ? iteratees.length : 0, resIndex = 0, result = []; outer: while (length-- && resIndex < takeCount) { index += dir; var iterIndex = -1, value = array[index]; while (++iterIndex < iterLength) { var data = iteratees[iterIndex], iteratee = data.iteratee, type = data.type; if (type == LAZY_DROP_WHILE_FLAG) { if (data.done && (isRight ? (index > data.index) : (index < data.index))) { data.count = 0; data.done = false; } data.index = index; if (!data.done) { var limit = data.limit; if (!(data.done = limit > -1 ? (data.count++ >= limit) : !iteratee(value))) { continue outer; } } } else { var computed = iteratee(value); if (type == LAZY_MAP_FLAG) { value = computed; } else if (!computed) { if (type == LAZY_FILTER_FLAG) { continue outer; } else { break outer; } } } } result[resIndex++] = value; } return result; } function MapCache() { this.__data__ = {}; } function mapDelete(key) { return this.has(key) && delete this.__data__[key]; } function mapGet(key) { return key == '__proto__' ? undefined : this.__data__[key]; } function mapHas(key) { return key != '__proto__' && hasOwnProperty.call(this.__data__, key); } function mapSet(key, value) { if (key != '__proto__') { this.__data__[key] = value; } return this; } function SetCache(values) { var length = values ? values.length : 0; this.data = { 'hash': nativeCreate(null), 'set': new Set }; while (length--) { this.push(values[length]); } } function cacheIndexOf(cache, value) { var data = cache.data, result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value]; return result ? 0 : -1; } function cachePush(value) { var data = this.data; if (typeof value == 'string' || isObject(value)) { data.set.add(value); } else { data.hash[value] = true; } } function arrayCopy(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } function arrayEach(array, iteratee) { var index = -1, length = array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } function arrayEachRight(array, iteratee) { var length = array.length; while (length--) { if (iteratee(array[length], length, array) === false) { break; } } return array; } function arrayEvery(array, predicate) { var index = -1, length = array.length; while (++index < length) { if (!predicate(array[index], index, array)) { return false; } } return true; } function arrayExtremum(array, iteratee, comparator, exValue) { var index = -1, length = array.length, computed = exValue, result = computed; while (++index < length) { var value = array[index], current = +iteratee(value); if (comparator(current, computed)) { computed = current; result = value; } } return result; } function arrayFilter(array, predicate) { var index = -1, length = array.length, resIndex = -1, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result[++resIndex] = value; } } return result; } function arrayMap(array, iteratee) { var index = -1, length = array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } function arrayReduce(array, iteratee, accumulator, initFromArray) { var index = -1, length = array.length; if (initFromArray && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } function arrayReduceRight(array, iteratee, accumulator, initFromArray) { var length = array.length; if (initFromArray && length) { accumulator = array[--length]; } while (length--) { accumulator = iteratee(accumulator, array[length], length, array); } return accumulator; } function arraySome(array, predicate) { var index = -1, length = array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } function arraySum(array) { var length = array.length, result = 0; while (length--) { result += +array[length] || 0; } return result; } function assignDefaults(objectValue, sourceValue) { return objectValue === undefined ? sourceValue : objectValue; } function assignOwnDefaults(objectValue, sourceValue, key, object) { return (objectValue === undefined || !hasOwnProperty.call(object, key)) ? sourceValue : objectValue; } function assignWith(object, source, customizer) { var index = -1, props = keys(source), length = props.length; while (++index < length) { var key = props[index], value = object[key], result = customizer(value, source[key], key, object, source); if ((result === result ? (result !== value) : (value === value)) || (value === undefined && !(key in object))) { object[key] = result; } } return object; } function baseAssign(object, source) { return source == null ? object : baseCopy(source, keys(source), object); } function baseAt(collection, props) { var index = -1, isNil = collection == null, isArr = !isNil && isArrayLike(collection), length = isArr ? collection.length : 0, propsLength = props.length, result = Array(propsLength); while (++index < propsLength) { var key = props[index]; if (isArr) { result[index] = isIndex(key, length) ? collection[key] : undefined; } else { result[index] = isNil ? undefined : collection[key]; } } return result; } function baseCopy(source, props, object) { object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; object[key] = source[key]; } return object; } function baseCallback(func, thisArg, argCount) { var type = typeof func; if (type == 'function') { return thisArg === undefined ? func : bindCallback(func, thisArg, argCount); } if (func == null) { return identity; } if (type == 'object') { return baseMatches(func); } return thisArg === undefined ? property(func) : baseMatchesProperty(func, thisArg); } function baseClone(value, isDeep, customizer, key, object, stackA, stackB) { var result; if (customizer) { result = object ? customizer(value, key, object) : customizer(value); } if (result !== undefined) { return result; } if (!isObject(value)) { return value; } var isArr = isArray(value); if (isArr) { result = initCloneArray(value); if (!isDeep) { return arrayCopy(value, result); } } else { var tag = objToString.call(value), isFunc = tag == funcTag; if (tag == objectTag || tag == argsTag || (isFunc && !object)) { result = initCloneObject(isFunc ? {} : value); if (!isDeep) { return baseAssign(result, value); } } else { return cloneableTags[tag] ? initCloneByTag(value, tag, isDeep) : (object ? value : {}); } } stackA || (stackA = []); stackB || (stackB = []); var length = stackA.length; while (length--) { if (stackA[length] == value) { return stackB[length]; } } stackA.push(value); stackB.push(result); (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB); }); return result; } var baseCreate = (function() { function object() {} return function(prototype) { if (isObject(prototype)) { object.prototype = prototype; var result = new object; object.prototype = null; } return result || {}; }; }()); function baseDelay(func, wait, args) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return setTimeout(function() { func.apply(undefined, args); }, wait); } function baseDifference(array, values) { var length = array ? array.length : 0, result = []; if (!length) { return result; } var index = -1, indexOf = getIndexOf(), isCommon = indexOf == baseIndexOf, cache = (isCommon && values.length >= 200) ? createCache(values) : null, valuesLength = values.length; if (cache) { indexOf = cacheIndexOf; isCommon = false; values = cache; } outer: while (++index < length) { var value = array[index]; if (isCommon && value === value) { var valuesIndex = valuesLength; while (valuesIndex--) { if (values[valuesIndex] === value) { continue outer; } } result.push(value); } else if (indexOf(values, value, 0) < 0) { result.push(value); } } return result; } var baseEach = createBaseEach(baseForOwn); var baseEachRight = createBaseEach(baseForOwnRight, true); function baseEvery(collection, predicate) { var result = true; baseEach(collection, function(value, index, collection) { result = !!predicate(value, index, collection); return result; }); return result; } function baseExtremum(collection, iteratee, comparator, exValue) { var computed = exValue, result = computed; baseEach(collection, function(value, index, collection) { var current = +iteratee(value, index, collection); if (comparator(current, computed) || (current === exValue && current === result)) { computed = current; result = value; } }); return result; } function baseFill(array, value, start, end) { var length = array.length; start = start == null ? 0 : (+start || 0); if (start < 0) { start = -start > length ? 0 : (length + start); } end = (end === undefined || end > length) ? length : (+end || 0); if (end < 0) { end += length; } length = start > end ? 0 : (end >>> 0); start >>>= 0; while (start < length) { array[start++] = value; } return array; } function baseFilter(collection, predicate) { var result = []; baseEach(collection, function(value, index, collection) { if (predicate(value, index, collection)) { result.push(value); } }); return result; } function baseFind(collection, predicate, eachFunc, retKey) { var result; eachFunc(collection, function(value, key, collection) { if (predicate(value, key, collection)) { result = retKey ? key : value; return false; } }); return result; } function baseFlatten(array, isDeep, isStrict) { var index = -1, length = array.length, resIndex = -1, result = []; while (++index < length) { var value = array[index]; if (isObjectLike(value) && isArrayLike(value) && (isStrict || isArray(value) || isArguments(value))) { if (isDeep) { value = baseFlatten(value, isDeep, isStrict); } var valIndex = -1, valLength = value.length; while (++valIndex < valLength) { result[++resIndex] = value[valIndex]; } } else if (!isStrict) { result[++resIndex] = value; } } return result; } var baseFor = createBaseFor(); var baseForRight = createBaseFor(true); function baseForIn(object, iteratee) { return baseFor(object, iteratee, keysIn); } function baseForOwn(object, iteratee) { return baseFor(object, iteratee, keys); } function baseForOwnRight(object, iteratee) { return baseForRight(object, iteratee, keys); } function baseFunctions(object, props) { var index = -1, length = props.length, resIndex = -1, result = []; while (++index < length) { var key = props[index]; if (isFunction(object[key])) { result[++resIndex] = key; } } return result; } function baseGet(object, path, pathKey) { if (object == null) { return; } if (pathKey !== undefined && pathKey in toObject(object)) { path = [pathKey]; } var index = 0, length = path.length; while (object != null && index < length) { object = object[path[index++]]; } return (index && index == length) ? object : undefined; } function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) { if (value === other) { return true; } if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB); } function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = arrayTag, othTag = arrayTag; if (!objIsArr) { objTag = objToString.call(object); if (objTag == argsTag) { objTag = objectTag; } else if (objTag != objectTag) { objIsArr = isTypedArray(object); } } if (!othIsArr) { othTag = objToString.call(other); if (othTag == argsTag) { othTag = objectTag; } else if (othTag != objectTag) { othIsArr = isTypedArray(other); } } var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && !(objIsArr || objIsObj)) { return equalByTag(object, other, objTag); } if (!isLoose) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB); } } if (!isSameTag) { return false; } stackA || (stackA = []); stackB || (stackB = []); var length = stackA.length; while (length--) { if (stackA[length] == object) { return stackB[length] == other; } } stackA.push(object); stackB.push(other); var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB); stackA.pop(); stackB.pop(); return result; } function baseIsMatch(object, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = toObject(object); while (index--) { var data = matchData[index]; if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object)) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined && !(key in object)) { return false; } } else { var result = customizer ? customizer(objValue, srcValue, key) : undefined; if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) { return false; } } } return true; } function baseMap(collection, iteratee) { var index = -1, result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value, key, collection) { result[++index] = iteratee(value, key, collection); }); return result; } function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { var key = matchData[0][0], value = matchData[0][1]; return function(object) { if (object == null) { return false; } return object[key] === value && (value !== undefined || (key in toObject(object))); }; } return function(object) { return baseIsMatch(object, matchData); }; } function baseMatchesProperty(path, srcValue) { var isArr = isArray(path), isCommon = isKey(path) && isStrictComparable(srcValue), pathKey = (path + ''); path = toPath(path); return function(object) { if (object == null) { return false; } var key = pathKey; object = toObject(object); if ((isArr || !isCommon) && !(key in object)) { object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); if (object == null) { return false; } key = last(path); object = toObject(object); } return object[key] === srcValue ? (srcValue !== undefined || (key in object)) : baseIsEqual(srcValue, object[key], undefined, true); }; } function baseMerge(object, source, customizer, stackA, stackB) { if (!isObject(object)) { return object; } var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)), props = isSrcArr ? null : keys(source); arrayEach(props || source, function(srcValue, key) { if (props) { key = srcValue; srcValue = source[key]; } if (isObjectLike(srcValue)) { stackA || (stackA = []); stackB || (stackB = []); baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB); } else { var value = object[key], result = customizer ? customizer(value, srcValue, key, object, source) : undefined, isCommon = result === undefined; if (isCommon) { result = srcValue; } if ((result !== undefined || (isSrcArr && !(key in object))) && (isCommon || (result === result ? (result !== value) : (value === value)))) { object[key] = result; } } }); return object; } function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) { var length = stackA.length, srcValue = source[key]; while (length--) { if (stackA[length] == srcValue) { object[key] = stackB[length]; return; } } var value = object[key], result = customizer ? customizer(value, srcValue, key, object, source) : undefined, isCommon = result === undefined; if (isCommon) { result = srcValue; if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) { result = isArray(value) ? value : (isArrayLike(value) ? arrayCopy(value) : []); } else if (isPlainObject(srcValue) || isArguments(srcValue)) { result = isArguments(value) ? toPlainObject(value) : (isPlainObject(value) ? value : {}); } else { isCommon = false; } } stackA.push(srcValue); stackB.push(result); if (isCommon) { object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB); } else if (result === result ? (result !== value) : (value === value)) { object[key] = result; } } function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } function basePropertyDeep(path) { var pathKey = (path + ''); path = toPath(path); return function(object) { return baseGet(object, path, pathKey); }; } function basePullAt(array, indexes) { var length = array ? indexes.length : 0; while (length--) { var index = indexes[length]; if (index != previous && isIndex(index)) { var previous = index; splice.call(array, index, 1); } } return array; } function baseRandom(min, max) { return min + floor(nativeRandom() * (max - min + 1)); } function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) { eachFunc(collection, function(value, index, collection) { accumulator = initFromCollection ? (initFromCollection = false, value) : iteratee(accumulator, value, index, collection); }); return accumulator; } var baseSetData = !metaMap ? identity : function(func, data) { metaMap.set(func, data); return func; }; function baseSlice(array, start, end) { var index = -1, length = array.length; start = start == null ? 0 : (+start || 0); if (start < 0) { start = -start > length ? 0 : (length + start); } end = (end === undefined || end > length) ? length : (+end || 0); if (end < 0) { end += length; } length = start > end ? 0 : ((end - start) >>> 0); start >>>= 0; var result = Array(length); while (++index < length) { result[index] = array[index + start]; } return result; } function baseSome(collection, predicate) { var result; baseEach(collection, function(value, index, collection) { result = predicate(value, index, collection); return !result; }); return !!result; } function baseSortBy(array, comparer) { var length = array.length; array.sort(comparer); while (length--) { array[length] = array[length].value; } return array; } function baseSortByOrder(collection, iteratees, orders) { var callback = getCallback(), index = -1; iteratees = arrayMap(iteratees, function(iteratee) { return callback(iteratee); }); var result = baseMap(collection, function(value) { var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); return { 'criteria': criteria, 'index': ++index, 'value': value }; }); return baseSortBy(result, function(object, other) { return compareMultiple(object, other, orders); }); } function baseSum(collection, iteratee) { var result = 0; baseEach(collection, function(value, index, collection) { result += +iteratee(value, index, collection) || 0; }); return result; } function baseUniq(array, iteratee) { var index = -1, indexOf = getIndexOf(), length = array.length, isCommon = indexOf == baseIndexOf, isLarge = isCommon && length >= 200, seen = isLarge ? createCache() : null, result = []; if (seen) { indexOf = cacheIndexOf; isCommon = false; } else { isLarge = false; seen = iteratee ? [] : result; } outer: while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value, index, array) : value; if (isCommon && value === value) { var seenIndex = seen.length; while (seenIndex--) { if (seen[seenIndex] === computed) { continue outer; } } if (iteratee) { seen.push(computed); } result.push(value); } else if (indexOf(seen, computed, 0) < 0) { if (iteratee || isLarge) { seen.push(computed); } result.push(value); } } return result; } function baseValues(object, props) { var index = -1, length = props.length, result = Array(length); while (++index < length) { result[index] = object[props[index]]; } return result; } function baseWhile(array, predicate, isDrop, fromRight) { var length = array.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {} return isDrop ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); } function baseWrapperValue(value, actions) { var result = value; if (result instanceof LazyWrapper) { result = result.value(); } var index = -1, length = actions.length; while (++index < length) { var args = [result], action = actions[index]; push.apply(args, action.args); result = action.func.apply(action.thisArg, args); } return result; } function binaryIndex(array, value, retHighest) { var low = 0, high = array ? array.length : low; if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { while (low < high) { var mid = (low + high) >>> 1, computed = array[mid]; if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) { low = mid + 1; } else { high = mid; } } return high; } return binaryIndexBy(array, value, identity, retHighest); } function binaryIndexBy(array, value, iteratee, retHighest) { value = iteratee(value); var low = 0, high = array ? array.length : 0, valIsNaN = value !== value, valIsNull = value === null, valIsUndef = value === undefined; while (low < high) { var mid = floor((low + high) / 2), computed = iteratee(array[mid]), isDef = computed !== undefined, isReflexive = computed === computed; if (valIsNaN) { var setLow = isReflexive || retHighest; } else if (valIsNull) { setLow = isReflexive && isDef && (retHighest || computed != null); } else if (valIsUndef) { setLow = isReflexive && (retHighest || isDef); } else if (computed == null) { setLow = false; } else { setLow = retHighest ? (computed <= value) : (computed < value); } if (setLow) { low = mid + 1; } else { high = mid; } } return nativeMin(high, MAX_ARRAY_INDEX); } function bindCallback(func, thisArg, argCount) { if (typeof func != 'function') { return identity; } if (thisArg === undefined) { return func; } switch (argCount) { case 1: return function(value) { return func.call(thisArg, value); }; case 3: return function(value, index, collection) { return func.call(thisArg, value, index, collection); }; case 4: return function(accumulator, value, index, collection) { return func.call(thisArg, accumulator, value, index, collection); }; case 5: return function(value, other, key, object, source) { return func.call(thisArg, value, other, key, object, source); }; } return function() { return func.apply(thisArg, arguments); }; } function bufferClone(buffer) { return bufferSlice.call(buffer, 0); } if (!bufferSlice) { bufferClone = !(ArrayBuffer && Uint8Array) ? constant(null) : function(buffer) { var byteLength = buffer.byteLength, floatLength = Float64Array ? floor(byteLength / FLOAT64_BYTES_PER_ELEMENT) : 0, offset = floatLength * FLOAT64_BYTES_PER_ELEMENT, result = new ArrayBuffer(byteLength); if (floatLength) { var view = new Float64Array(result, 0, floatLength); view.set(new Float64Array(buffer, 0, floatLength)); } if (byteLength != offset) { view = new Uint8Array(result, offset); view.set(new Uint8Array(buffer, offset)); } return result; }; } function composeArgs(args, partials, holders) { var holdersLength = holders.length, argsIndex = -1, argsLength = nativeMax(args.length - holdersLength, 0), leftIndex = -1, leftLength = partials.length, result = Array(argsLength + leftLength); while (++leftIndex < leftLength) { result[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { result[holders[argsIndex]] = args[argsIndex]; } while (argsLength--) { result[leftIndex++] = args[argsIndex++]; } return result; } function composeArgsRight(args, partials, holders) { var holdersIndex = -1, holdersLength = holders.length, argsIndex = -1, argsLength = nativeMax(args.length - holdersLength, 0), rightIndex = -1, rightLength = partials.length, result = Array(argsLength + rightLength); while (++argsIndex < argsLength) { result[argsIndex] = args[argsIndex]; } var offset = argsIndex; while (++rightIndex < rightLength) { result[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { result[offset + holders[holdersIndex]] = args[argsIndex++]; } return result; } function createAggregator(setter, initializer) { return function(collection, iteratee, thisArg) { var result = initializer ? initializer() : {}; iteratee = getCallback(iteratee, thisArg, 3); if (isArray(collection)) { var index = -1, length = collection.length; while (++index < length) { var value = collection[index]; setter(result, value, iteratee(value, index, collection), collection); } } else { baseEach(collection, function(value, key, collection) { setter(result, value, iteratee(value, key, collection), collection); }); } return result; }; } function createAssigner(assigner) { return restParam(function(object, sources) { var index = -1, length = object == null ? 0 : sources.length, customizer = length > 2 ? sources[length - 2] : undefined, guard = length > 2 ? sources[2] : undefined, thisArg = length > 1 ? sources[length - 1] : undefined; if (typeof customizer == 'function') { customizer = bindCallback(customizer, thisArg, 5); length -= 2; } else { customizer = typeof thisArg == 'function' ? thisArg : undefined; length -= (customizer ? 1 : 0); } if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, customizer); } } return object; }); } function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { var length = collection ? getLength(collection) : 0; if (!isLength(length)) { return eachFunc(collection, iteratee); } var index = fromRight ? length : -1, iterable = toObject(collection); while ((fromRight ? index-- : ++index < length)) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var iterable = toObject(object), props = keysFunc(object), length = props.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length)) { var key = props[index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } function createBindWrapper(func, thisArg) { var Ctor = createCtorWrapper(func); function wrapper() { var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return fn.apply(thisArg, arguments); } return wrapper; } var createCache = !(nativeCreate && Set) ? constant(null) : function(values) { return new SetCache(values); }; function createCompounder(callback) { return function(string) { var index = -1, array = words(deburr(string)), length = array.length, result = ''; while (++index < length) { result = callback(result, array[index], index); } return result; }; } function createCtorWrapper(Ctor) { return function() { var args = arguments; switch (args.length) { case 0: return new Ctor; case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); } var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args); return isObject(result) ? result : thisBinding; }; } function createCurry(flag) { function curryFunc(func, arity, guard) { if (guard && isIterateeCall(func, arity, guard)) { arity = null; } var result = createWrapper(func, flag, null, null, null, null, null, arity); result.placeholder = curryFunc.placeholder; return result; } return curryFunc; } function createExtremum(comparator, exValue) { return function(collection, iteratee, thisArg) { if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { iteratee = null; } iteratee = getCallback(iteratee, thisArg, 3); if (iteratee.length == 1) { collection = toIterable(collection); var result = arrayExtremum(collection, iteratee, comparator, exValue); if (!(collection.length && result === exValue)) { return result; } } return baseExtremum(collection, iteratee, comparator, exValue); }; } function createFind(eachFunc, fromRight) { return function(collection, predicate, thisArg) { predicate = getCallback(predicate, thisArg, 3); if (isArray(collection)) { var index = baseFindIndex(collection, predicate, fromRight); return index > -1 ? collection[index] : undefined; } return baseFind(collection, predicate, eachFunc); }; } function createFindIndex(fromRight) { return function(array, predicate, thisArg) { if (!(array && array.length)) { return -1; } predicate = getCallback(predicate, thisArg, 3); return baseFindIndex(array, predicate, fromRight); }; } function createFindKey(objectFunc) { return function(object, predicate, thisArg) { predicate = getCallback(predicate, thisArg, 3); return baseFind(object, predicate, objectFunc, true); }; } function createFlow(fromRight) { return function() { var wrapper, length = arguments.length, index = fromRight ? length : -1, leftIndex = 0, funcs = Array(length); while ((fromRight ? index-- : ++index < length)) { var func = funcs[leftIndex++] = arguments[index]; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') { wrapper = new LodashWrapper([]); } } index = wrapper ? -1 : length; while (++index < length) { func = funcs[index]; var funcName = getFuncName(func), data = funcName == 'wrapper' ? getData(func) : null; if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) { wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); } else { wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func); } } return function() { var args = arguments; if (wrapper && args.length == 1 && isArray(args[0])) { return wrapper.plant(args[0]).value(); } var index = 0, result = length ? funcs[index].apply(this, args) : args[0]; while (++index < length) { result = funcs[index].call(this, result); } return result; }; }; } function createForEach(arrayFunc, eachFunc) { return function(collection, iteratee, thisArg) { return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee) : eachFunc(collection, bindCallback(iteratee, thisArg, 3)); }; } function createForIn(objectFunc) { return function(object, iteratee, thisArg) { if (typeof iteratee != 'function' || thisArg !== undefined) { iteratee = bindCallback(iteratee, thisArg, 3); } return objectFunc(object, iteratee, keysIn); }; } function createForOwn(objectFunc) { return function(object, iteratee, thisArg) { if (typeof iteratee != 'function' || thisArg !== undefined) { iteratee = bindCallback(iteratee, thisArg, 3); } return objectFunc(object, iteratee); }; } function createObjectMapper(isMapKeys) { return function(object, iteratee, thisArg) { var result = {}; iteratee = getCallback(iteratee, thisArg, 3); baseForOwn(object, function(value, key, object) { var mapped = iteratee(value, key, object); key = isMapKeys ? mapped : key; value = isMapKeys ? value : mapped; result[key] = value; }); return result; }; } function createPadDir(fromRight) { return function(string, length, chars) { string = baseToString(string); return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string); }; } function createPartial(flag) { var partialFunc = restParam(function(func, partials) { var holders = replaceHolders(partials, partialFunc.placeholder); return createWrapper(func, flag, null, partials, holders); }); return partialFunc; } function createReduce(arrayFunc, eachFunc) { return function(collection, iteratee, accumulator, thisArg) { var initFromArray = arguments.length < 3; return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee, accumulator, initFromArray) : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc); }; } function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & ARY_FLAG, isBind = bitmask & BIND_FLAG, isBindKey = bitmask & BIND_KEY_FLAG, isCurry = bitmask & CURRY_FLAG, isCurryBound = bitmask & CURRY_BOUND_FLAG, isCurryRight = bitmask & CURRY_RIGHT_FLAG, Ctor = isBindKey ? null : createCtorWrapper(func); function wrapper() { var length = arguments.length, index = length, args = Array(length); while (index--) { args[index] = arguments[index]; } if (partials) { args = composeArgs(args, partials, holders); } if (partialsRight) { args = composeArgsRight(args, partialsRight, holdersRight); } if (isCurry || isCurryRight) { var placeholder = wrapper.placeholder, argsHolders = replaceHolders(args, placeholder); length -= argsHolders.length; if (length < arity) { var newArgPos = argPos ? arrayCopy(argPos) : null, newArity = nativeMax(arity - length, 0), newsHolders = isCurry ? argsHolders : null, newHoldersRight = isCurry ? null : argsHolders, newPartials = isCurry ? args : null, newPartialsRight = isCurry ? null : args; bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); if (!isCurryBound) { bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); } var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity], result = createHybridWrapper.apply(undefined, newData); if (isLaziable(func)) { setData(result, newData); } result.placeholder = placeholder; return result; } } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; if (argPos) { args = reorder(args, argPos); } if (isAry && ary < args.length) { args.length = ary; } if (this && this !== root && this instanceof wrapper) { fn = Ctor || createCtorWrapper(func); } return fn.apply(thisBinding, args); } return wrapper; } function createPadding(string, length, chars) { var strLength = string.length; length = +length; if (strLength >= length || !nativeIsFinite(length)) { return ''; } var padLength = length - strLength; chars = chars == null ? ' ' : (chars + ''); return repeat(chars, ceil(padLength / chars.length)).slice(0, padLength); } function createPartialWrapper(func, bitmask, thisArg, partials) { var isBind = bitmask & BIND_FLAG, Ctor = createCtorWrapper(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(argsLength + leftLength); while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return fn.apply(isBind ? thisArg : this, args); } return wrapper; } function createSortedIndex(retHighest) { return function(array, value, iteratee, thisArg) { var callback = getCallback(iteratee); return (iteratee == null && callback === baseCallback) ? binaryIndex(array, value, retHighest) : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest); }; } function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & BIND_KEY_FLAG; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); partials = holders = null; } length -= (holders ? holders.length : 0); if (bitmask & PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = null; } var data = isBindKey ? null : getData(func), newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; if (data) { mergeData(newData, data); bitmask = newData[1]; arity = newData[9]; } newData[9] = arity == null ? (isBindKey ? 0 : func.length) : (nativeMax(arity - length, 0) || 0); if (bitmask == BIND_FLAG) { var result = createBindWrapper(newData[0], newData[2]); } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) { result = createPartialWrapper.apply(undefined, newData); } else { result = createHybridWrapper.apply(undefined, newData); } var setter = data ? baseSetData : setData; return setter(result, newData); } function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) { var index = -1, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isLoose && othLength > arrLength)) { return false; } while (++index < arrLength) { var arrValue = array[index], othValue = other[index], result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined; if (result !== undefined) { if (result) { continue; } return false; } if (isLoose) { if (!arraySome(other, function(othValue) { return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB); })) { return false; } } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) { return false; } } return true; } function equalByTag(object, other, tag) { switch (tag) { case boolTag: case dateTag: return +object == +other; case errorTag: return object.name == other.name && object.message == other.message; case numberTag: return (object != +object) ? other != +other : object == +other; case regexpTag: case stringTag: return object == (other + ''); } return false; } function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) { var objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length; if (objLength != othLength && !isLoose) { return false; } var index = objLength; while (index--) { var key = objProps[index]; if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) { return false; } } var skipCtor = isLoose; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key], result = customizer ? customizer(isLoose ? othValue : objValue, isLoose ? objValue : othValue, key) : undefined; if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) { return false; } skipCtor || (skipCtor = key == 'constructor'); } if (!skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { return false; } } return true; } function getCallback(func, thisArg, argCount) { var result = lodash.callback || callback; result = result === callback ? baseCallback : result; return argCount ? result(func, thisArg, argCount) : result; } var getData = !metaMap ? noop : function(func) { return metaMap.get(func); }; function getFuncName(func) { var result = func.name, array = realNames[result], length = array ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result; } function getIndexOf(collection, target, fromIndex) { var result = lodash.indexOf || indexOf; result = result === indexOf ? baseIndexOf : result; return collection ? result(collection, target, fromIndex) : result; } var getLength = baseProperty('length'); function getMatchData(object) { var result = pairs(object), length = result.length; while (length--) { result[length][2] = isStrictComparable(result[length][1]); } return result; } function getNative(object, key) { var value = object == null ? undefined : object[key]; return isNative(value) ? value : undefined; } function getView(start, end, transforms) { var index = -1, length = transforms ? transforms.length : 0; while (++index < length) { var data = transforms[index], size = data.size; switch (data.type) { case 'drop': start += size; break; case 'dropRight': end -= size; break; case 'take': end = nativeMin(end, start + size); break; case 'takeRight': start = nativeMax(start, end - size); break; } } return { 'start': start, 'end': end }; } function initCloneArray(array) { var length = array.length, result = new array.constructor(length); if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { result.index = array.index; result.input = array.input; } return result; } function initCloneObject(object) { var Ctor = object.constructor; if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) { Ctor = Object; } return new Ctor; } function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: return bufferClone(object); case boolTag: case dateTag: return new Ctor(+object); case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: var buffer = object.buffer; return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length); case numberTag: case stringTag: return new Ctor(object); case regexpTag: var result = new Ctor(object.source, reFlags.exec(object)); result.lastIndex = object.lastIndex; } return result; } function invokePath(object, path, args) { if (object != null && !isKey(path, object)) { path = toPath(path); object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); path = last(path); } var func = object == null ? object : object[path]; return func == null ? undefined : func.apply(object, args); } function isArrayLike(value) { return value != null && isLength(getLength(value)); } function isIndex(value, length) { value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; length = length == null ? MAX_SAFE_INTEGER : length; return value > -1 && value % 1 == 0 && value < length; } function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object)) { var other = object[index]; return value === value ? (value === other) : (other !== other); } return false; } function isKey(value, object) { var type = typeof value; if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { return true; } if (isArray(value)) { return false; } var result = !reIsDeepProp.test(value); return result || (object != null && value in toObject(object)); } function isLaziable(func) { var funcName = getFuncName(func); if (!(funcName in LazyWrapper.prototype)) { return false; } var other = lodash[funcName]; if (func === other) { return true; } var data = getData(other); return !!data && func === data[0]; } function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } function isStrictComparable(value) { return value === value && !isObject(value); } function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < ARY_FLAG; var isCombo = (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) || (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) || (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG); if (!(isCommon || isCombo)) { return data; } if (srcBitmask & BIND_FLAG) { data[2] = source[2]; newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG; } var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value); data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]); } value = source[5]; if (value) { partials = data[5]; data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value); data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]); } value = source[7]; if (value) { data[7] = arrayCopy(value); } if (srcBitmask & ARY_FLAG) { data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); } if (data[9] == null) { data[9] = source[9]; } data[0] = source[0]; data[1] = newBitmask; return data; } function pickByArray(object, props) { object = toObject(object); var index = -1, length = props.length, result = {}; while (++index < length) { var key = props[index]; if (key in object) { result[key] = object[key]; } } return result; } function pickByCallback(object, predicate) { var result = {}; baseForIn(object, function(value, key, object) { if (predicate(value, key, object)) { result[key] = value; } }); return result; } function reorder(array, indexes) { var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = arrayCopy(array); while (length--) { var index = indexes[length]; array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; } return array; } var setData = (function() { var count = 0, lastCalled = 0; return function(key, value) { var stamp = now(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return key; } } else { count = 0; } return baseSetData(key, value); }; }()); function shimIsPlainObject(value) { var Ctor, support = lodash.support; if (!(isObjectLike(value) && objToString.call(value) == objectTag) || (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) { return false; } var result; baseForIn(value, function(subValue, key) { result = key; }); return result === undefined || hasOwnProperty.call(value, result); } function shimKeys(object) { var props = keysIn(object), propsLength = props.length, length = propsLength && object.length; var allowIndexes = !!length && isLength(length) && (isArray(object) || isArguments(object)); var index = -1, result = []; while (++index < propsLength) { var key = props[index]; if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { result.push(key); } } return result; } function toIterable(value) { if (value == null) { return []; } if (!isArrayLike(value)) { return values(value); } return isObject(value) ? value : Object(value); } function toObject(value) { return isObject(value) ? value : Object(value); } function toPath(value) { if (isArray(value)) { return value; } var result = []; baseToString(value).replace(rePropName, function(match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); }); return result; } function wrapperClone(wrapper) { return wrapper instanceof LazyWrapper ? wrapper.clone() : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__)); } function chunk(array, size, guard) { if (guard ? isIterateeCall(array, size, guard) : size == null) { size = 1; } else { size = nativeMax(+size || 1, 1); } var index = 0, length = array ? array.length : 0, resIndex = -1, result = Array(ceil(length / size)); while (index < length) { result[++resIndex] = baseSlice(array, index, (index += size)); } return result; } function compact(array) { var index = -1, length = array ? array.length : 0, resIndex = -1, result = []; while (++index < length) { var value = array[index]; if (value) { result[++resIndex] = value; } } return result; } var difference = restParam(function(array, values) { return isArrayLike(array) ? baseDifference(array, baseFlatten(values, false, true)) : []; }); function drop(array, n, guard) { var length = array ? array.length : 0; if (!length) { return []; } if (guard ? isIterateeCall(array, n, guard) : n == null) { n = 1; } return baseSlice(array, n < 0 ? 0 : n); } function dropRight(array, n, guard) { var length = array ? array.length : 0; if (!length) { return []; } if (guard ? isIterateeCall(array, n, guard) : n == null) { n = 1; } n = length - (+n || 0); return baseSlice(array, 0, n < 0 ? 0 : n); } function dropRightWhile(array, predicate, thisArg) { return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true) : []; } function dropWhile(array, predicate, thisArg) { return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), true) : []; } function fill(array, value, start, end) { var length = array ? array.length : 0; if (!length) { return []; } if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { start = 0; end = length; } return baseFill(array, value, start, end); } var findIndex = createFindIndex(); var findLastIndex = createFindIndex(true); function first(array) { return array ? array[0] : undefined; } function flatten(array, isDeep, guard) { var length = array ? array.length : 0; if (guard && isIterateeCall(array, isDeep, guard)) { isDeep = false; } return length ? baseFlatten(array, isDeep) : []; } function flattenDeep(array) { var length = array ? array.length : 0; return length ? baseFlatten(array, true) : []; } function indexOf(array, value, fromIndex) { var length = array ? array.length : 0; if (!length) { return -1; } if (typeof fromIndex == 'number') { fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; } else if (fromIndex) { var index = binaryIndex(array, value), other = array[index]; if (value === value ? (value === other) : (other !== other)) { return index; } return -1; } return baseIndexOf(array, value, fromIndex || 0); } function initial(array) { return dropRight(array, 1); } var intersection = restParam(function(arrays) { var othLength = arrays.length, othIndex = othLength, caches = Array(length), indexOf = getIndexOf(), isCommon = indexOf == baseIndexOf, result = []; while (othIndex--) { var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : []; caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null; } var array = arrays[0], index = -1, length = array ? array.length : 0, seen = caches[0]; outer: while (++index < length) { value = array[index]; if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) { var othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) { continue outer; } } if (seen) { seen.push(value); } result.push(value); } } return result; }); function last(array) { var length = array ? array.length : 0; return length ? array[length - 1] : undefined; } function lastIndexOf(array, value, fromIndex) { var length = array ? array.length : 0; if (!length) { return -1; } var index = length; if (typeof fromIndex == 'number') { index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1; } else if (fromIndex) { index = binaryIndex(array, value, true) - 1; var other = array[index]; if (value === value ? (value === other) : (other !== other)) { return index; } return -1; } if (value !== value) { return indexOfNaN(array, index, true); } while (index--) { if (array[index] === value) { return index; } } return -1; } function pull() { var args = arguments, array = args[0]; if (!(array && array.length)) { return array; } var index = 0, indexOf = getIndexOf(), length = args.length; while (++index < length) { var fromIndex = 0, value = args[index]; while ((fromIndex = indexOf(array, value, fromIndex)) > -1) { splice.call(array, fromIndex, 1); } } return array; } var pullAt = restParam(function(array, indexes) { indexes = baseFlatten(indexes); var result = baseAt(array, indexes); basePullAt(array, indexes.sort(baseCompareAscending)); return result; }); function remove(array, predicate, thisArg) { var result = []; if (!(array && array.length)) { return result; } var index = -1, indexes = [], length = array.length; predicate = getCallback(predicate, thisArg, 3); while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result.push(value); indexes.push(index); } } basePullAt(array, indexes); return result; } function rest(array) { return drop(array, 1); } function slice(array, start, end) { var length = array ? array.length : 0; if (!length) { return []; } if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { start = 0; end = length; } return baseSlice(array, start, end); } var sortedIndex = createSortedIndex(); var sortedLastIndex = createSortedIndex(true); function take(array, n, guard) { var length = array ? array.length : 0; if (!length) { return []; } if (guard ? isIterateeCall(array, n, guard) : n == null) { n = 1; } return baseSlice(array, 0, n < 0 ? 0 : n); } function takeRight(array, n, guard) { var length = array ? array.length : 0; if (!length) { return []; } if (guard ? isIterateeCall(array, n, guard) : n == null) { n = 1; } n = length - (+n || 0); return baseSlice(array, n < 0 ? 0 : n); } function takeRightWhile(array, predicate, thisArg) { return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true) : []; } function takeWhile(array, predicate, thisArg) { return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3)) : []; } var union = restParam(function(arrays) { return baseUniq(baseFlatten(arrays, false, true)); }); function uniq(array, isSorted, iteratee, thisArg) { var length = array ? array.length : 0; if (!length) { return []; } if (isSorted != null && typeof isSorted != 'boolean') { thisArg = iteratee; iteratee = isIterateeCall(array, isSorted, thisArg) ? null : isSorted; isSorted = false; } var callback = getCallback(); if (!(iteratee == null && callback === baseCallback)) { iteratee = callback(iteratee, thisArg, 3); } return (isSorted && getIndexOf() == baseIndexOf) ? sortedUniq(array, iteratee) : baseUniq(array, iteratee); } function unzip(array) { if (!(array && array.length)) { return []; } var index = -1, length = 0; array = arrayFilter(array, function(group) { if (isArrayLike(group)) { length = nativeMax(group.length, length); return true; } }); var result = Array(length); while (++index < length) { result[index] = arrayMap(array, baseProperty(index)); } return result; } function unzipWith(array, iteratee, thisArg) { var length = array ? array.length : 0; if (!length) { return []; } var result = unzip(array); if (iteratee == null) { return result; } iteratee = bindCallback(iteratee, thisArg, 4); return arrayMap(result, function(group) { return arrayReduce(group, iteratee, undefined, true); }); } var without = restParam(function(array, values) { return isArrayLike(array) ? baseDifference(array, values) : []; }); function xor() { var index = -1, length = arguments.length; while (++index < length) { var array = arguments[index]; if (isArrayLike(array)) { var result = result ? baseDifference(result, array).concat(baseDifference(array, result)) : array; } } return result ? baseUniq(result) : []; } var zip = restParam(unzip); function zipObject(props, values) { var index = -1, length = props ? props.length : 0, result = {}; if (length && !values && !isArray(props[0])) { values = []; } while (++index < length) { var key = props[index]; if (values) { result[key] = values[index]; } else if (key) { result[key[0]] = key[1]; } } return result; } var zipWith = restParam(function(arrays) { var length = arrays.length, iteratee = length > 2 ? arrays[length - 2] : undefined, thisArg = length > 1 ? arrays[length - 1] : undefined; if (length > 2 && typeof iteratee == 'function') { length -= 2; } else { iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined; thisArg = undefined; } arrays.length = length; return unzipWith(arrays, iteratee, thisArg); }); function chain(value) { var result = lodash(value); result.__chain__ = true; return result; } function tap(value, interceptor, thisArg) { interceptor.call(thisArg, value); return value; } function thru(value, interceptor, thisArg) { return interceptor.call(thisArg, value); } function wrapperChain() { return chain(this); } function wrapperCommit() { return new LodashWrapper(this.value(), this.__chain__); } function wrapperPlant(value) { var result, parent = this; while (parent instanceof baseLodash) { var clone = wrapperClone(parent); if (result) { previous.__wrapped__ = clone; } else { result = clone; } var previous = clone; parent = parent.__wrapped__; } previous.__wrapped__ = value; return result; } function wrapperReverse() { var value = this.__wrapped__; if (value instanceof LazyWrapper) { if (this.__actions__.length) { value = new LazyWrapper(this); } return new LodashWrapper(value.reverse(), this.__chain__); } return this.thru(function(value) { return value.reverse(); }); } function wrapperToString() { return (this.value() + ''); } function wrapperValue() { return baseWrapperValue(this.__wrapped__, this.__actions__); } var at = restParam(function(collection, props) { return baseAt(collection, baseFlatten(props)); }); var countBy = createAggregator(function(result, value, key) { hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); }); function every(collection, predicate, thisArg) { var func = isArray(collection) ? arrayEvery : baseEvery; if (thisArg && isIterateeCall(collection, predicate, thisArg)) { predicate = null; } if (typeof predicate != 'function' || thisArg !== undefined) { predicate = getCallback(predicate, thisArg, 3); } return func(collection, predicate); } function filter(collection, predicate, thisArg) { var func = isArray(collection) ? arrayFilter : baseFilter; predicate = getCallback(predicate, thisArg, 3); return func(collection, predicate); } var find = createFind(baseEach); var findLast = createFind(baseEachRight, true); function findWhere(collection, source) { return find(collection, baseMatches(source)); } var forEach = createForEach(arrayEach, baseEach); var forEachRight = createForEach(arrayEachRight, baseEachRight); var groupBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { result[key].push(value); } else { result[key] = [value]; } }); function includes(collection, target, fromIndex, guard) { var length = collection ? getLength(collection) : 0; if (!isLength(length)) { collection = values(collection); length = collection.length; } if (!length) { return false; } if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) { fromIndex = 0; } else { fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); } return (typeof collection == 'string' || !isArray(collection) && isString(collection)) ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1) : (getIndexOf(collection, target, fromIndex) > -1); } var indexBy = createAggregator(function(result, value, key) { result[key] = value; }); var invoke = restParam(function(collection, path, args) { var index = -1, isFunc = typeof path == 'function', isProp = isKey(path), result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value) { var func = isFunc ? path : ((isProp && value != null) ? value[path] : null); result[++index] = func ? func.apply(value, args) : invokePath(value, path, args); }); return result; }); function map(collection, iteratee, thisArg) { var func = isArray(collection) ? arrayMap : baseMap; iteratee = getCallback(iteratee, thisArg, 3); return func(collection, iteratee); } var partition = createAggregator(function(result, value, key) { result[key ? 0 : 1].push(value); }, function() { return [[], []]; }); function pluck(collection, path) { return map(collection, property(path)); } var reduce = createReduce(arrayReduce, baseEach); var reduceRight = createReduce(arrayReduceRight, baseEachRight); function reject(collection, predicate, thisArg) { var func = isArray(collection) ? arrayFilter : baseFilter; predicate = getCallback(predicate, thisArg, 3); return func(collection, function(value, index, collection) { return !predicate(value, index, collection); }); } function sample(collection, n, guard) { if (guard ? isIterateeCall(collection, n, guard) : n == null) { collection = toIterable(collection); var length = collection.length; return length > 0 ? collection[baseRandom(0, length - 1)] : undefined; } var index = -1, result = toArray(collection), length = result.length, lastIndex = length - 1; n = nativeMin(n < 0 ? 0 : (+n || 0), length); while (++index < n) { var rand = baseRandom(index, lastIndex), value = result[rand]; result[rand] = result[index]; result[index] = value; } result.length = n; return result; } function shuffle(collection) { return sample(collection, POSITIVE_INFINITY); } function size(collection) { var length = collection ? getLength(collection) : 0; return isLength(length) ? length : keys(collection).length; } function some(collection, predicate, thisArg) { var func = isArray(collection) ? arraySome : baseSome; if (thisArg && isIterateeCall(collection, predicate, thisArg)) { predicate = null; } if (typeof predicate != 'function' || thisArg !== undefined) { predicate = getCallback(predicate, thisArg, 3); } return func(collection, predicate); } function sortBy(collection, iteratee, thisArg) { if (collection == null) { return []; } if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { iteratee = null; } var index = -1; iteratee = getCallback(iteratee, thisArg, 3); var result = baseMap(collection, function(value, key, collection) { return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value }; }); return baseSortBy(result, compareAscending); } var sortByAll = restParam(function(collection, iteratees) { if (collection == null) { return []; } var guard = iteratees[2]; if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) { iteratees.length = 1; } return baseSortByOrder(collection, baseFlatten(iteratees), []); }); function sortByOrder(collection, iteratees, orders, guard) { if (collection == null) { return []; } if (guard && isIterateeCall(iteratees, orders, guard)) { orders = null; } if (!isArray(iteratees)) { iteratees = iteratees == null ? [] : [iteratees]; } if (!isArray(orders)) { orders = orders == null ? [] : [orders]; } return baseSortByOrder(collection, iteratees, orders); } function where(collection, source) { return filter(collection, baseMatches(source)); } var now = nativeNow || function() { return new Date().getTime(); }; function after(n, func) { if (typeof func != 'function') { if (typeof n == 'function') { var temp = n; n = func; func = temp; } else { throw new TypeError(FUNC_ERROR_TEXT); } } n = nativeIsFinite(n = +n) ? n : 0; return function() { if (--n < 1) { return func.apply(this, arguments); } }; } function ary(func, n, guard) { if (guard && isIterateeCall(func, n, guard)) { n = null; } n = (func && n == null) ? func.length : nativeMax(+n || 0, 0); return createWrapper(func, ARY_FLAG, null, null, null, null, n); } function before(n, func) { var result; if (typeof func != 'function') { if (typeof n == 'function') { var temp = n; n = func; func = temp; } else { throw new TypeError(FUNC_ERROR_TEXT); } } return function() { if (--n > 0) { result = func.apply(this, arguments); } if (n <= 1) { func = null; } return result; }; } var bind = restParam(function(func, thisArg, partials) { var bitmask = BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, bind.placeholder); bitmask |= PARTIAL_FLAG; } return createWrapper(func, bitmask, thisArg, partials, holders); }); var bindAll = restParam(function(object, methodNames) { methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object); var index = -1, length = methodNames.length; while (++index < length) { var key = methodNames[index]; object[key] = createWrapper(object[key], BIND_FLAG, object); } return object; }); var bindKey = restParam(function(object, key, partials) { var bitmask = BIND_FLAG | BIND_KEY_FLAG; if (partials.length) { var holders = replaceHolders(partials, bindKey.placeholder); bitmask |= PARTIAL_FLAG; } return createWrapper(key, bitmask, object, partials, holders); }); var curry = createCurry(CURRY_FLAG); var curryRight = createCurry(CURRY_RIGHT_FLAG); function debounce(func, wait, options) { var args, maxTimeoutId, result, stamp, thisArg, timeoutId, trailingCall, lastCalled = 0, maxWait = false, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } wait = wait < 0 ? 0 : (+wait || 0); if (options === true) { var leading = true; trailing = false; } else if (isObject(options)) { leading = options.leading; maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait); trailing = 'trailing' in options ? options.trailing : trailing; } function cancel() { if (timeoutId) { clearTimeout(timeoutId); } if (maxTimeoutId) { clearTimeout(maxTimeoutId); } maxTimeoutId = timeoutId = trailingCall = undefined; } function delayed() { var remaining = wait - (now() - stamp); if (remaining <= 0 || remaining > wait) { if (maxTimeoutId) { clearTimeout(maxTimeoutId); } var isCalled = trailingCall; maxTimeoutId = timeoutId = trailingCall = undefined; if (isCalled) { lastCalled = now(); result = func.apply(thisArg, args); if (!timeoutId && !maxTimeoutId) { args = thisArg = null; } } } else { timeoutId = setTimeout(delayed, remaining); } } function maxDelayed() { if (timeoutId) { clearTimeout(timeoutId); } maxTimeoutId = timeoutId = trailingCall = undefined; if (trailing || (maxWait !== wait)) { lastCalled = now(); result = func.apply(thisArg, args); if (!timeoutId && !maxTimeoutId) { args = thisArg = null; } } } function debounced() { args = arguments; stamp = now(); thisArg = this; trailingCall = trailing && (timeoutId || !leading); if (maxWait === false) { var leadingCall = leading && !timeoutId; } else { if (!maxTimeoutId && !leading) { lastCalled = stamp; } var remaining = maxWait - (stamp - lastCalled), isCalled = remaining <= 0 || remaining > maxWait; if (isCalled) { if (maxTimeoutId) { maxTimeoutId = clearTimeout(maxTimeoutId); } lastCalled = stamp; result = func.apply(thisArg, args); } else if (!maxTimeoutId) { maxTimeoutId = setTimeout(maxDelayed, remaining); } } if (isCalled && timeoutId) { timeoutId = clearTimeout(timeoutId); } else if (!timeoutId && wait !== maxWait) { timeoutId = setTimeout(delayed, wait); } if (leadingCall) { isCalled = true; result = func.apply(thisArg, args); } if (isCalled && !timeoutId && !maxTimeoutId) { args = thisArg = null; } return result; } debounced.cancel = cancel; return debounced; } var defer = restParam(function(func, args) { return baseDelay(func, 1, args); }); var delay = restParam(function(func, wait, args) { return baseDelay(func, wait, args); }); var flow = createFlow(); var flowRight = createFlow(true); function memoize(func, resolver) { if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result); return result; }; memoized.cache = new memoize.Cache; return memoized; } function negate(predicate) { if (typeof predicate != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return function() { return !predicate.apply(this, arguments); }; } function once(func) { return before(2, func); } var partial = createPartial(PARTIAL_FLAG); var partialRight = createPartial(PARTIAL_RIGHT_FLAG); var rearg = restParam(function(func, indexes) { return createWrapper(func, REARG_FLAG, null, null, null, baseFlatten(indexes)); }); function restParam(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), rest = Array(length); while (++index < length) { rest[index] = args[start + index]; } switch (start) { case 0: return func.call(this, rest); case 1: return func.call(this, args[0], rest); case 2: return func.call(this, args[0], args[1], rest); } var otherArgs = Array(start + 1); index = -1; while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = rest; return func.apply(this, otherArgs); }; } function spread(func) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return function(array) { return func.apply(this, array); }; } function throttle(func, wait, options) { var leading = true, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (options === false) { leading = false; } else if (isObject(options)) { leading = 'leading' in options ? !!options.leading : leading; trailing = 'trailing' in options ? !!options.trailing : trailing; } debounceOptions.leading = leading; debounceOptions.maxWait = +wait; debounceOptions.trailing = trailing; return debounce(func, wait, debounceOptions); } function wrap(value, wrapper) { wrapper = wrapper == null ? identity : wrapper; return createWrapper(wrapper, PARTIAL_FLAG, null, [value], []); } function clone(value, isDeep, customizer, thisArg) { if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) { isDeep = false; } else if (typeof isDeep == 'function') { thisArg = customizer; customizer = isDeep; isDeep = false; } return typeof customizer == 'function' ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1)) : baseClone(value, isDeep); } function cloneDeep(value, customizer, thisArg) { return typeof customizer == 'function' ? baseClone(value, true, bindCallback(customizer, thisArg, 1)) : baseClone(value, true); } function gt(value, other) { return value > other; } function gte(value, other) { return value >= other; } function isArguments(value) { return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag; } var isArray = nativeIsArray || function(value) { return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; }; function isBoolean(value) { return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag); } function isDate(value) { return isObjectLike(value) && objToString.call(value) == dateTag; } function isElement(value) { return !!value && value.nodeType === 1 && isObjectLike(value) && (objToString.call(value).indexOf('Element') > -1); } if (!support.dom) { isElement = function(value) { return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value); }; } function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) || (isObjectLike(value) && isFunction(value.splice)))) { return !value.length; } return !keys(value).length; } function isEqual(value, other, customizer, thisArg) { customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined; var result = customizer ? customizer(value, other) : undefined; return result === undefined ? baseIsEqual(value, other, customizer) : !!result; } function isError(value) { return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag; } var isFinite = nativeNumIsFinite || function(value) { return typeof value == 'number' && nativeIsFinite(value); }; var isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) { return objToString.call(value) == funcTag; }; function isObject(value) { var type = typeof value; return !!value && (type == 'object' || type == 'function'); } function isMatch(object, source, customizer, thisArg) { customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined; return baseIsMatch(object, getMatchData(source), customizer); } function isNaN(value) { return isNumber(value) && value != +value; } function isNative(value) { if (value == null) { return false; } if (objToString.call(value) == funcTag) { return reIsNative.test(fnToString.call(value)); } return isObjectLike(value) && reIsHostCtor.test(value); } function isNull(value) { return value === null; } function isNumber(value) { return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag); } var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { if (!(value && objToString.call(value) == objectTag)) { return false; } var valueOf = getNative(value, 'valueOf'), objProto = valueOf && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); return objProto ? (value == objProto || getPrototypeOf(value) == objProto) : shimIsPlainObject(value); }; function isRegExp(value) { return isObjectLike(value) && objToString.call(value) == regexpTag; } function isString(value) { return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag); } function isTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; } function isUndefined(value) { return value === undefined; } function lt(value, other) { return value < other; } function lte(value, other) { return value <= other; } function toArray(value) { var length = value ? getLength(value) : 0; if (!isLength(length)) { return values(value); } if (!length) { return []; } return arrayCopy(value); } function toPlainObject(value) { return baseCopy(value, keysIn(value)); } var assign = createAssigner(function(object, source, customizer) { return customizer ? assignWith(object, source, customizer) : baseAssign(object, source); }); function create(prototype, properties, guard) { var result = baseCreate(prototype); if (guard && isIterateeCall(prototype, properties, guard)) { properties = null; } return properties ? baseAssign(result, properties) : result; } var defaults = restParam(function(args) { var object = args[0]; if (object == null) { return object; } args.push(assignDefaults); return assign.apply(undefined, args); }); var findKey = createFindKey(baseForOwn); var findLastKey = createFindKey(baseForOwnRight); var forIn = createForIn(baseFor); var forInRight = createForIn(baseForRight); var forOwn = createForOwn(baseForOwn); var forOwnRight = createForOwn(baseForOwnRight); function functions(object) { return baseFunctions(object, keysIn(object)); } function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, toPath(path), path + ''); return result === undefined ? defaultValue : result; } function has(object, path) { if (object == null) { return false; } var result = hasOwnProperty.call(object, path); if (!result && !isKey(path)) { path = toPath(path); object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); if (object == null) { return false; } path = last(path); result = hasOwnProperty.call(object, path); } return result || (isLength(object.length) && isIndex(path, object.length) && (isArray(object) || isArguments(object))); } function invert(object, multiValue, guard) { if (guard && isIterateeCall(object, multiValue, guard)) { multiValue = null; } var index = -1, props = keys(object), length = props.length, result = {}; while (++index < length) { var key = props[index], value = object[key]; if (multiValue) { if (hasOwnProperty.call(result, value)) { result[value].push(key); } else { result[value] = [key]; } } else { result[value] = key; } } return result; } var keys = !nativeKeys ? shimKeys : function(object) { var Ctor = object == null ? null : object.constructor; if ((typeof Ctor == 'function' && Ctor.prototype === object) || (typeof object != 'function' && isArrayLike(object))) { return shimKeys(object); } return isObject(object) ? nativeKeys(object) : []; }; function keysIn(object) { if (object == null) { return []; } if (!isObject(object)) { object = Object(object); } var length = object.length; length = (length && isLength(length) && (isArray(object) || isArguments(object)) && length) || 0; var Ctor = object.constructor, index = -1, isProto = typeof Ctor == 'function' && Ctor.prototype === object, result = Array(length), skipIndexes = length > 0; while (++index < length) { result[index] = (index + ''); } for (var key in object) { if (!(skipIndexes && isIndex(key, length)) && !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } return result; } var mapKeys = createObjectMapper(true); var mapValues = createObjectMapper(); var merge = createAssigner(baseMerge); var omit = restParam(function(object, props) { if (object == null) { return {}; } if (typeof props[0] != 'function') { var props = arrayMap(baseFlatten(props), String); return pickByArray(object, baseDifference(keysIn(object), props)); } var predicate = bindCallback(props[0], props[1], 3); return pickByCallback(object, function(value, key, object) { return !predicate(value, key, object); }); }); function pairs(object) { object = toObject(object); var index = -1, props = keys(object), length = props.length, result = Array(length); while (++index < length) { var key = props[index]; result[index] = [key, object[key]]; } return result; } var pick = restParam(function(object, props) { if (object == null) { return {}; } return typeof props[0] == 'function' ? pickByCallback(object, bindCallback(props[0], props[1], 3)) : pickByArray(object, baseFlatten(props)); }); function result(object, path, defaultValue) { var result = object == null ? undefined : object[path]; if (result === undefined) { if (object != null && !isKey(path, object)) { path = toPath(path); object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); result = object == null ? undefined : object[last(path)]; } result = result === undefined ? defaultValue : result; } return isFunction(result) ? result.call(object) : result; } function set(object, path, value) { if (object == null) { return object; } var pathKey = (path + ''); path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = path[index]; if (isObject(nested)) { if (index == lastIndex) { nested[key] = value; } else if (nested[key] == null) { nested[key] = isIndex(path[index + 1]) ? [] : {}; } } nested = nested[key]; } return object; } function transform(object, iteratee, accumulator, thisArg) { var isArr = isArray(object) || isTypedArray(object); iteratee = getCallback(iteratee, thisArg, 4); if (accumulator == null) { if (isArr || isObject(object)) { var Ctor = object.constructor; if (isArr) { accumulator = isArray(object) ? new Ctor : []; } else { accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : null); } } else { accumulator = {}; } } (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) { return iteratee(accumulator, value, index, object); }); return accumulator; } function values(object) { return baseValues(object, keys(object)); } function valuesIn(object) { return baseValues(object, keysIn(object)); } function inRange(value, start, end) { start = +start || 0; if (typeof end === 'undefined') { end = start; start = 0; } else { end = +end || 0; } return value >= nativeMin(start, end) && value < nativeMax(start, end); } function random(min, max, floating) { if (floating && isIterateeCall(min, max, floating)) { max = floating = null; } var noMin = min == null, noMax = max == null; if (floating == null) { if (noMax && typeof min == 'boolean') { floating = min; min = 1; } else if (typeof max == 'boolean') { floating = max; noMax = true; } } if (noMin && noMax) { max = 1; noMax = false; } min = +min || 0; if (noMax) { max = min; min = 0; } else { max = +max || 0; } if (floating || min % 1 || max % 1) { var rand = nativeRandom(); return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max); } return baseRandom(min, max); } var camelCase = createCompounder(function(result, word, index) { word = word.toLowerCase(); return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word); }); function capitalize(string) { string = baseToString(string); return string && (string.charAt(0).toUpperCase() + string.slice(1)); } function deburr(string) { string = baseToString(string); return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, ''); } function endsWith(string, target, position) { string = baseToString(string); target = (target + ''); var length = string.length; position = position === undefined ? length : nativeMin(position < 0 ? 0 : (+position || 0), length); position -= target.length; return position >= 0 && string.indexOf(target, position) == position; } function escape(string) { string = baseToString(string); return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; } function escapeRegExp(string) { string = baseToString(string); return (string && reHasRegExpChars.test(string)) ? string.replace(reRegExpChars, '\\$&') : string; } var kebabCase = createCompounder(function(result, word, index) { return result + (index ? '-' : '') + word.toLowerCase(); }); function pad(string, length, chars) { string = baseToString(string); length = +length; var strLength = string.length; if (strLength >= length || !nativeIsFinite(length)) { return string; } var mid = (length - strLength) / 2, leftLength = floor(mid), rightLength = ceil(mid); chars = createPadding('', rightLength, chars); return chars.slice(0, leftLength) + string + chars; } var padLeft = createPadDir(); var padRight = createPadDir(true); function parseInt(string, radix, guard) { if (guard && isIterateeCall(string, radix, guard)) { radix = 0; } return nativeParseInt(string, radix); } if (nativeParseInt(whitespace + '08') != 8) { parseInt = function(string, radix, guard) { if (guard ? isIterateeCall(string, radix, guard) : radix == null) { radix = 0; } else if (radix) { radix = +radix; } string = trim(string); return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10)); }; } function repeat(string, n) { var result = ''; string = baseToString(string); n = +n; if (n < 1 || !string || !nativeIsFinite(n)) { return result; } do { if (n % 2) { result += string; } n = floor(n / 2); string += string; } while (n); return result; } var snakeCase = createCompounder(function(result, word, index) { return result + (index ? '_' : '') + word.toLowerCase(); }); var startCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1)); }); function startsWith(string, target, position) { string = baseToString(string); position = position == null ? 0 : nativeMin(position < 0 ? 0 : (+position || 0), string.length); return string.lastIndexOf(target, position) == position; } function template(string, options, otherOptions) { var settings = lodash.templateSettings; if (otherOptions && isIterateeCall(string, options, otherOptions)) { options = otherOptions = null; } string = baseToString(string); options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults); var imports = assignWith(baseAssign({}, options.imports), settings.imports, assignOwnDefaults), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys); var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '"; var reDelimiters = RegExp((options.escape || reNoMatch).source + '|' + interpolate.source + '|' + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + (options.evaluate || reNoMatch).source + '|$', 'g'); var sourceURL = '//# sourceURL=' + ('sourceURL' in options ? options.sourceURL : ('lodash.templateSources[' + (++templateCounter) + ']')) + '\n'; string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { interpolateValue || (interpolateValue = esTemplateValue); source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); if (escapeValue) { isEscaping = true; source += "' +\n__e(" + escapeValue + ") +\n'"; } if (evaluateValue) { isEvaluating = true; source += "';\n" + evaluateValue + ";\n__p += '"; } if (interpolateValue) { source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; } index = offset + match.length; return match; }); source += "';\n"; var variable = options.variable; if (!variable) { source = 'with (obj) {\n' + source + '\n}\n'; } source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source).replace(reEmptyStringMiddle, '$1').replace(reEmptyStringTrailing, '$1;'); source = 'function(' + (variable || 'obj') + ') {\n' + (variable ? '' : 'obj || (obj = {});\n') + "var __t, __p = ''" + (isEscaping ? ', __e = _.escape' : '') + (isEvaluating ? ', __j = Array.prototype.join;\n' + "function print() { __p += __j.call(arguments, '') }\n" : ';\n') + source + 'return __p\n}'; var result = attempt(function() { return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues); }); result.source = source; if (isError(result)) { throw result; } return result; } function trim(string, chars, guard) { var value = string; string = baseToString(string); if (!string) { return string; } if (guard ? isIterateeCall(value, chars, guard) : chars == null) { return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1); } chars = (chars + ''); return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1); } function trimLeft(string, chars, guard) { var value = string; string = baseToString(string); if (!string) { return string; } if (guard ? isIterateeCall(value, chars, guard) : chars == null) { return string.slice(trimmedLeftIndex(string)); } return string.slice(charsLeftIndex(string, (chars + ''))); } function trimRight(string, chars, guard) { var value = string; string = baseToString(string); if (!string) { return string; } if (guard ? isIterateeCall(value, chars, guard) : chars == null) { return string.slice(0, trimmedRightIndex(string) + 1); } return string.slice(0, charsRightIndex(string, (chars + '')) + 1); } function trunc(string, options, guard) { if (guard && isIterateeCall(string, options, guard)) { options = null; } var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION; if (options != null) { if (isObject(options)) { var separator = 'separator' in options ? options.separator : separator; length = 'length' in options ? (+options.length || 0) : length; omission = 'omission' in options ? baseToString(options.omission) : omission; } else { length = +options || 0; } } string = baseToString(string); if (length >= string.length) { return string; } var end = length - omission.length; if (end < 1) { return omission; } var result = string.slice(0, end); if (separator == null) { return result + omission; } if (isRegExp(separator)) { if (string.slice(end).search(separator)) { var match, newEnd, substring = string.slice(0, end); if (!separator.global) { separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g'); } separator.lastIndex = 0; while ((match = separator.exec(substring))) { newEnd = match.index; } result = result.slice(0, newEnd == null ? end : newEnd); } } else if (string.indexOf(separator, end) != end) { var index = result.lastIndexOf(separator); if (index > -1) { result = result.slice(0, index); } } return result + omission; } function unescape(string) { string = baseToString(string); return (string && reHasEscapedHtml.test(string)) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string; } function words(string, pattern, guard) { if (guard && isIterateeCall(string, pattern, guard)) { pattern = null; } string = baseToString(string); return string.match(pattern || reWords) || []; } var attempt = restParam(function(func, args) { try { return func.apply(undefined, args); } catch (e) { return isError(e) ? e : new Error(e); } }); function callback(func, thisArg, guard) { if (guard && isIterateeCall(func, thisArg, guard)) { thisArg = null; } return isObjectLike(func) ? matches(func) : baseCallback(func, thisArg); } function constant(value) { return function() { return value; }; } function identity(value) { return value; } function matches(source) { return baseMatches(baseClone(source, true)); } function matchesProperty(path, srcValue) { return baseMatchesProperty(path, baseClone(srcValue, true)); } var method = restParam(function(path, args) { return function(object) { return invokePath(object, path, args); }; }); var methodOf = restParam(function(object, args) { return function(path) { return invokePath(object, path, args); }; }); function mixin(object, source, options) { if (options == null) { var isObj = isObject(source), props = isObj ? keys(source) : null, methodNames = (props && props.length) ? baseFunctions(source, props) : null; if (!(methodNames ? methodNames.length : isObj)) { methodNames = false; options = source; source = object; object = this; } } if (!methodNames) { methodNames = baseFunctions(source, keys(source)); } var chain = true, index = -1, isFunc = isFunction(object), length = methodNames.length; if (options === false) { chain = false; } else if (isObject(options) && 'chain' in options) { chain = options.chain; } while (++index < length) { var methodName = methodNames[index], func = source[methodName]; object[methodName] = func; if (isFunc) { object.prototype[methodName] = (function(func) { return function() { var chainAll = this.__chain__; if (chain || chainAll) { var result = object(this.__wrapped__), actions = result.__actions__ = arrayCopy(this.__actions__); actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); result.__chain__ = chainAll; return result; } var args = [this.value()]; push.apply(args, arguments); return func.apply(object, args); }; }(func)); } } return object; } function noConflict() { context._ = oldDash; return this; } function noop() {} function property(path) { return isKey(path) ? baseProperty(path) : basePropertyDeep(path); } function propertyOf(object) { return function(path) { return baseGet(object, toPath(path), path + ''); }; } function range(start, end, step) { if (step && isIterateeCall(start, end, step)) { end = step = null; } start = +start || 0; step = step == null ? 1 : (+step || 0); if (end == null) { end = start; start = 0; } else { end = +end || 0; } var index = -1, length = nativeMax(ceil((end - start) / (step || 1)), 0), result = Array(length); while (++index < length) { result[index] = start; start += step; } return result; } function times(n, iteratee, thisArg) { n = floor(n); if (n < 1 || !nativeIsFinite(n)) { return []; } var index = -1, result = Array(nativeMin(n, MAX_ARRAY_LENGTH)); iteratee = bindCallback(iteratee, thisArg, 1); while (++index < n) { if (index < MAX_ARRAY_LENGTH) { result[index] = iteratee(index); } else { iteratee(index); } } return result; } function uniqueId(prefix) { var id = ++idCounter; return baseToString(prefix) + id; } function add(augend, addend) { return (+augend || 0) + (+addend || 0); } var max = createExtremum(gt, NEGATIVE_INFINITY); var min = createExtremum(lt, POSITIVE_INFINITY); function sum(collection, iteratee, thisArg) { if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { iteratee = null; } var callback = getCallback(), noIteratee = iteratee == null; if (!(noIteratee && callback === baseCallback)) { noIteratee = false; iteratee = callback(iteratee, thisArg, 3); } return noIteratee ? arraySum(isArray(collection) ? collection : toIterable(collection)) : baseSum(collection, iteratee); } lodash.prototype = baseLodash.prototype; LodashWrapper.prototype = baseCreate(baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; MapCache.prototype['delete'] = mapDelete; MapCache.prototype.get = mapGet; MapCache.prototype.has = mapHas; MapCache.prototype.set = mapSet; SetCache.prototype.push = cachePush; memoize.Cache = MapCache; lodash.after = after; lodash.ary = ary; lodash.assign = assign; lodash.at = at; lodash.before = before; lodash.bind = bind; lodash.bindAll = bindAll; lodash.bindKey = bindKey; lodash.callback = callback; lodash.chain = chain; lodash.chunk = chunk; lodash.compact = compact; lodash.constant = constant; lodash.countBy = countBy; lodash.create = create; lodash.curry = curry; lodash.curryRight = curryRight; lodash.debounce = debounce; lodash.defaults = defaults; lodash.defer = defer; lodash.delay = delay; lodash.difference = difference; lodash.drop = drop; lodash.dropRight = dropRight; lodash.dropRightWhile = dropRightWhile; lodash.dropWhile = dropWhile; lodash.fill = fill; lodash.filter = filter; lodash.flatten = flatten; lodash.flattenDeep = flattenDeep; lodash.flow = flow; lodash.flowRight = flowRight; lodash.forEach = forEach; lodash.forEachRight = forEachRight; lodash.forIn = forIn; lodash.forInRight = forInRight; lodash.forOwn = forOwn; lodash.forOwnRight = forOwnRight; lodash.functions = functions; lodash.groupBy = groupBy; lodash.indexBy = indexBy; lodash.initial = initial; lodash.intersection = intersection; lodash.invert = invert; lodash.invoke = invoke; lodash.keys = keys; lodash.keysIn = keysIn; lodash.map = map; lodash.mapKeys = mapKeys; lodash.mapValues = mapValues; lodash.matches = matches; lodash.matchesProperty = matchesProperty; lodash.memoize = memoize; lodash.merge = merge; lodash.method = method; lodash.methodOf = methodOf; lodash.mixin = mixin; lodash.negate = negate; lodash.omit = omit; lodash.once = once; lodash.pairs = pairs; lodash.partial = partial; lodash.partialRight = partialRight; lodash.partition = partition; lodash.pick = pick; lodash.pluck = pluck; lodash.property = property; lodash.propertyOf = propertyOf; lodash.pull = pull; lodash.pullAt = pullAt; lodash.range = range; lodash.rearg = rearg; lodash.reject = reject; lodash.remove = remove; lodash.rest = rest; lodash.restParam = restParam; lodash.set = set; lodash.shuffle = shuffle; lodash.slice = slice; lodash.sortBy = sortBy; lodash.sortByAll = sortByAll; lodash.sortByOrder = sortByOrder; lodash.spread = spread; lodash.take = take; lodash.takeRight = takeRight; lodash.takeRightWhile = takeRightWhile; lodash.takeWhile = takeWhile; lodash.tap = tap; lodash.throttle = throttle; lodash.thru = thru; lodash.times = times; lodash.toArray = toArray; lodash.toPlainObject = toPlainObject; lodash.transform = transform; lodash.union = union; lodash.uniq = uniq; lodash.unzip = unzip; lodash.unzipWith = unzipWith; lodash.values = values; lodash.valuesIn = valuesIn; lodash.where = where; lodash.without = without; lodash.wrap = wrap; lodash.xor = xor; lodash.zip = zip; lodash.zipObject = zipObject; lodash.zipWith = zipWith; lodash.backflow = flowRight; lodash.collect = map; lodash.compose = flowRight; lodash.each = forEach; lodash.eachRight = forEachRight; lodash.extend = assign; lodash.iteratee = callback; lodash.methods = functions; lodash.object = zipObject; lodash.select = filter; lodash.tail = rest; lodash.unique = uniq; mixin(lodash, lodash); lodash.add = add; lodash.attempt = attempt; lodash.camelCase = camelCase; lodash.capitalize = capitalize; lodash.clone = clone; lodash.cloneDeep = cloneDeep; lodash.deburr = deburr; lodash.endsWith = endsWith; lodash.escape = escape; lodash.escapeRegExp = escapeRegExp; lodash.every = every; lodash.find = find; lodash.findIndex = findIndex; lodash.findKey = findKey; lodash.findLast = findLast; lodash.findLastIndex = findLastIndex; lodash.findLastKey = findLastKey; lodash.findWhere = findWhere; lodash.first = first; lodash.get = get; lodash.gt = gt; lodash.gte = gte; lodash.has = has; lodash.identity = identity; lodash.includes = includes; lodash.indexOf = indexOf; lodash.inRange = inRange; lodash.isArguments = isArguments; lodash.isArray = isArray; lodash.isBoolean = isBoolean; lodash.isDate = isDate; lodash.isElement = isElement; lodash.isEmpty = isEmpty; lodash.isEqual = isEqual; lodash.isError = isError; lodash.isFinite = isFinite; lodash.isFunction = isFunction; lodash.isMatch = isMatch; lodash.isNaN = isNaN; lodash.isNative = isNative; lodash.isNull = isNull; lodash.isNumber = isNumber; lodash.isObject = isObject; lodash.isPlainObject = isPlainObject; lodash.isRegExp = isRegExp; lodash.isString = isString; lodash.isTypedArray = isTypedArray; lodash.isUndefined = isUndefined; lodash.kebabCase = kebabCase; lodash.last = last; lodash.lastIndexOf = lastIndexOf; lodash.lt = lt; lodash.lte = lte; lodash.max = max; lodash.min = min; lodash.noConflict = noConflict; lodash.noop = noop; lodash.now = now; lodash.pad = pad; lodash.padLeft = padLeft; lodash.padRight = padRight; lodash.parseInt = parseInt; lodash.random = random; lodash.reduce = reduce; lodash.reduceRight = reduceRight; lodash.repeat = repeat; lodash.result = result; lodash.runInContext = runInContext; lodash.size = size; lodash.snakeCase = snakeCase; lodash.some = some; lodash.sortedIndex = sortedIndex; lodash.sortedLastIndex = sortedLastIndex; lodash.startCase = startCase; lodash.startsWith = startsWith; lodash.sum = sum; lodash.template = template; lodash.trim = trim; lodash.trimLeft = trimLeft; lodash.trimRight = trimRight; lodash.trunc = trunc; lodash.unescape = unescape; lodash.uniqueId = uniqueId; lodash.words = words; lodash.all = every; lodash.any = some; lodash.contains = includes; lodash.eq = isEqual; lodash.detect = find; lodash.foldl = reduce; lodash.foldr = reduceRight; lodash.head = first; lodash.include = includes; lodash.inject = reduce; mixin(lodash, (function() { var source = {}; baseForOwn(lodash, function(func, methodName) { if (!lodash.prototype[methodName]) { source[methodName] = func; } }); return source; }()), false); lodash.sample = sample; lodash.prototype.sample = function(n) { if (!this.__chain__ && n == null) { return sample(this.value()); } return this.thru(function(value) { return sample(value, n); }); }; lodash.VERSION = VERSION; arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { lodash[methodName].placeholder = lodash; }); arrayEach(['dropWhile', 'filter', 'map', 'takeWhile'], function(methodName, type) { var isFilter = type != LAZY_MAP_FLAG, isDropWhile = type == LAZY_DROP_WHILE_FLAG; LazyWrapper.prototype[methodName] = function(iteratee, thisArg) { var filtered = this.__filtered__, result = (filtered && isDropWhile) ? new LazyWrapper(this) : this.clone(), iteratees = result.__iteratees__ || (result.__iteratees__ = []); iteratees.push({ 'done': false, 'count': 0, 'index': 0, 'iteratee': getCallback(iteratee, thisArg, 1), 'limit': -1, 'type': type }); result.__filtered__ = filtered || isFilter; return result; }; }); arrayEach(['drop', 'take'], function(methodName, index) { var whileName = methodName + 'While'; LazyWrapper.prototype[methodName] = function(n) { var filtered = this.__filtered__, result = (filtered && !index) ? this.dropWhile() : this.clone(); n = n == null ? 1 : nativeMax(floor(n) || 0, 0); if (filtered) { if (index) { result.__takeCount__ = nativeMin(result.__takeCount__, n); } else { last(result.__iteratees__).limit = n; } } else { var views = result.__views__ || (result.__views__ = []); views.push({ 'size': n, 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') }); } return result; }; LazyWrapper.prototype[methodName + 'Right'] = function(n) { return this.reverse()[methodName](n).reverse(); }; LazyWrapper.prototype[methodName + 'RightWhile'] = function(predicate, thisArg) { return this.reverse()[whileName](predicate, thisArg).reverse(); }; }); arrayEach(['first', 'last'], function(methodName, index) { var takeName = 'take' + (index ? 'Right' : ''); LazyWrapper.prototype[methodName] = function() { return this[takeName](1).value()[0]; }; }); arrayEach(['initial', 'rest'], function(methodName, index) { var dropName = 'drop' + (index ? '' : 'Right'); LazyWrapper.prototype[methodName] = function() { return this[dropName](1); }; }); arrayEach(['pluck', 'where'], function(methodName, index) { var operationName = index ? 'filter' : 'map', createCallback = index ? baseMatches : property; LazyWrapper.prototype[methodName] = function(value) { return this[operationName](createCallback(value)); }; }); LazyWrapper.prototype.compact = function() { return this.filter(identity); }; LazyWrapper.prototype.reject = function(predicate, thisArg) { predicate = getCallback(predicate, thisArg, 1); return this.filter(function(value) { return !predicate(value); }); }; LazyWrapper.prototype.slice = function(start, end) { start = start == null ? 0 : (+start || 0); var result = this; if (start < 0) { result = this.takeRight(-start); } else if (start) { result = this.drop(start); } if (end !== undefined) { end = (+end || 0); result = end < 0 ? result.dropRight(-end) : result.take(end - start); } return result; }; LazyWrapper.prototype.toArray = function() { return this.drop(0); }; baseForOwn(LazyWrapper.prototype, function(func, methodName) { var lodashFunc = lodash[methodName]; if (!lodashFunc) { return; } var checkIteratee = /^(?:filter|map|reject)|While$/.test(methodName), retUnwrapped = /^(?:first|last)$/.test(methodName); lodash.prototype[methodName] = function() { var args = arguments, chainAll = this.__chain__, value = this.__wrapped__, isHybrid = !!this.__actions__.length, isLazy = value instanceof LazyWrapper, iteratee = args[0], useLazy = isLazy || isArray(value); if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) { isLazy = useLazy = false; } var onlyLazy = isLazy && !isHybrid; if (retUnwrapped && !chainAll) { return onlyLazy ? func.call(value) : lodashFunc.call(lodash, this.value()); } var interceptor = function(value) { var otherArgs = [value]; push.apply(otherArgs, args); return lodashFunc.apply(lodash, otherArgs); }; if (useLazy) { var wrapper = onlyLazy ? value : new LazyWrapper(this), result = func.apply(wrapper, args); if (!retUnwrapped && (isHybrid || result.__actions__)) { var actions = result.__actions__ || (result.__actions__ = []); actions.push({ 'func': thru, 'args': [interceptor], 'thisArg': lodash }); } return new LodashWrapper(result, chainAll); } return this.thru(interceptor); }; }); arrayEach(['concat', 'join', 'pop', 'push', 'replace', 'shift', 'sort', 'splice', 'split', 'unshift'], function(methodName) { var func = (/^(?:replace|split)$/.test(methodName) ? stringProto : arrayProto)[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', retUnwrapped = /^(?:join|pop|replace|shift)$/.test(methodName); lodash.prototype[methodName] = function() { var args = arguments; if (retUnwrapped && !this.__chain__) { return func.apply(this.value(), args); } return this[chainName](function(value) { return func.apply(value, args); }); }; }); baseForOwn(LazyWrapper.prototype, function(func, methodName) { var lodashFunc = lodash[methodName]; if (lodashFunc) { var key = lodashFunc.name, names = realNames[key] || (realNames[key] = []); names.push({ 'name': methodName, 'func': lodashFunc }); } }); realNames[createHybridWrapper(null, BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': null }]; LazyWrapper.prototype.clone = lazyClone; LazyWrapper.prototype.reverse = lazyReverse; LazyWrapper.prototype.value = lazyValue; lodash.prototype.chain = wrapperChain; lodash.prototype.commit = wrapperCommit; lodash.prototype.plant = wrapperPlant; lodash.prototype.reverse = wrapperReverse; lodash.prototype.toString = wrapperToString; lodash.prototype.run = lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; lodash.prototype.collect = lodash.prototype.map; lodash.prototype.head = lodash.prototype.first; lodash.prototype.select = lodash.prototype.filter; lodash.prototype.tail = lodash.prototype.rest; return lodash; } var _ = runInContext(); if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { root._ = _; define(function() { return _; }); } else if (freeExports && freeModule) { if (moduleExports) { (freeModule.exports = _)._ = _; } else { freeExports._ = _; } } else { root._ = _; } }.call(this)); })(require("github:jspm/nodelibs-process@0.1.1.js")); global.define = __define; return module.exports; }); System.registerDynamic("github:jspm/nodelibs-buffer@0.1.0/index.js", ["npm:buffer@3.2.2.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = System._nodeRequire ? System._nodeRequire('buffer') : require("npm:buffer@3.2.2.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/object/keys.js", ["npm:lodash@3.9.3/internal/getNative.js", "npm:lodash@3.9.3/internal/isArrayLike.js", "npm:lodash@3.9.3/lang/isObject.js", "npm:lodash@3.9.3/internal/shimKeys.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var getNative = require("npm:lodash@3.9.3/internal/getNative.js"), isArrayLike = require("npm:lodash@3.9.3/internal/isArrayLike.js"), isObject = require("npm:lodash@3.9.3/lang/isObject.js"), shimKeys = require("npm:lodash@3.9.3/internal/shimKeys.js"); var nativeKeys = getNative(Object, 'keys'); var keys = !nativeKeys ? shimKeys : function(object) { var Ctor = object == null ? null : object.constructor; if ((typeof Ctor == 'function' && Ctor.prototype === object) || (typeof object != 'function' && isArrayLike(object))) { return shimKeys(object); } return isObject(object) ? nativeKeys(object) : []; }; module.exports = keys; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseIsMatch.js", ["npm:lodash@3.9.3/internal/baseIsEqual.js", "npm:lodash@3.9.3/internal/toObject.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var baseIsEqual = require("npm:lodash@3.9.3/internal/baseIsEqual.js"), toObject = require("npm:lodash@3.9.3/internal/toObject.js"); function baseIsMatch(object, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = toObject(object); while (index--) { var data = matchData[index]; if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object)) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined && !(key in object)) { return false; } } else { var result = customizer ? customizer(objValue, srcValue, key) : undefined; if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) { return false; } } } return true; } module.exports = baseIsMatch; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseEvery.js", ["npm:lodash@3.9.3/internal/baseEach.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var baseEach = require("npm:lodash@3.9.3/internal/baseEach.js"); function baseEvery(collection, predicate) { var result = true; baseEach(collection, function(value, index, collection) { result = !!predicate(value, index, collection); return result; }); return result; } module.exports = baseEvery; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3.js", ["npm:lodash@3.9.3/index.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:lodash@3.9.3/index.js"); global.define = __define; return module.exports; }); System.registerDynamic("github:jspm/nodelibs-buffer@0.1.0.js", ["github:jspm/nodelibs-buffer@0.1.0/index.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("github:jspm/nodelibs-buffer@0.1.0/index.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/assignWith.js", ["npm:lodash@3.9.3/object/keys.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var keys = require("npm:lodash@3.9.3/object/keys.js"); function assignWith(object, source, customizer) { var index = -1, props = keys(source), length = props.length; while (++index < length) { var key = props[index], value = object[key], result = customizer(value, source[key], key, object, source); if ((result === result ? (result !== value) : (value === value)) || (value === undefined && !(key in object))) { object[key] = result; } } return object; } module.exports = assignWith; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseMatches.js", ["npm:lodash@3.9.3/internal/baseIsMatch.js", "npm:lodash@3.9.3/internal/getMatchData.js", "npm:lodash@3.9.3/internal/toObject.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var baseIsMatch = require("npm:lodash@3.9.3/internal/baseIsMatch.js"), getMatchData = require("npm:lodash@3.9.3/internal/getMatchData.js"), toObject = require("npm:lodash@3.9.3/internal/toObject.js"); function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { var key = matchData[0][0], value = matchData[0][1]; return function(object) { if (object == null) { return false; } return object[key] === value && (value !== undefined || (key in toObject(object))); }; } return function(object) { return baseIsMatch(object, matchData); }; } module.exports = baseMatches; global.define = __define; return module.exports; }); System.registerDynamic("npm:readable-stream@1.1.13/lib/_stream_readable.js", ["npm:isarray@0.0.1.js", "github:jspm/nodelibs-buffer@0.1.0.js", "github:jspm/nodelibs-events@0.1.1.js", "npm:stream-browserify@1.0.0/index.js", "npm:core-util-is@1.0.1.js", "npm:inherits@2.0.1.js", "@empty", "npm:readable-stream@1.1.13/lib/_stream_duplex.js", "npm:string_decoder@0.10.31.js", "npm:readable-stream@1.1.13/lib/_stream_duplex.js", "npm:string_decoder@0.10.31.js", "github:jspm/nodelibs-buffer@0.1.0.js", "github:jspm/nodelibs-process@0.1.1.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function(Buffer, process) { module.exports = Readable; var isArray = require("npm:isarray@0.0.1.js"); var Buffer = require("github:jspm/nodelibs-buffer@0.1.0.js").Buffer; Readable.ReadableState = ReadableState; var EE = require("github:jspm/nodelibs-events@0.1.1.js").EventEmitter; if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { return emitter.listeners(type).length; }; var Stream = require("npm:stream-browserify@1.0.0/index.js"); var util = require("npm:core-util-is@1.0.1.js"); util.inherits = require("npm:inherits@2.0.1.js"); var StringDecoder; var debug = require("@empty"); if (debug && debug.debuglog) { debug = debug.debuglog('stream'); } else { debug = function() {}; } util.inherits(Readable, Stream); function ReadableState(options, stream) { var Duplex = require("npm:readable-stream@1.1.13/lib/_stream_duplex.js"); options = options || {}; var hwm = options.highWaterMark; var defaultHwm = options.objectMode ? 16 : 16 * 1024; this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; this.highWaterMark = ~~this.highWaterMark; this.buffer = []; this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; this.sync = true; this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.objectMode = !!options.objectMode; if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; this.defaultEncoding = options.defaultEncoding || 'utf8'; this.ranOut = false; this.awaitDrain = 0; this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = require("npm:string_decoder@0.10.31.js").StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } function Readable(options) { var Duplex = require("npm:readable-stream@1.1.13/lib/_stream_duplex.js"); if (!(this instanceof Readable)) return new Readable(options); this._readableState = new ReadableState(options, this); this.readable = true; Stream.call(this); } Readable.prototype.push = function(chunk, encoding) { var state = this._readableState; if (util.isString(chunk) && !state.objectMode) { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = new Buffer(chunk, encoding); encoding = ''; } } return readableAddChunk(this, state, chunk, encoding, false); }; Readable.prototype.unshift = function(chunk) { var state = this._readableState; return readableAddChunk(this, state, chunk, '', true); }; function readableAddChunk(stream, state, chunk, encoding, addToFront) { var er = chunkInvalid(state, chunk); if (er) { stream.emit('error', er); } else if (util.isNullOrUndefined(chunk)) { state.reading = false; if (!state.ended) onEofChunk(stream, state); } else if (state.objectMode || chunk && chunk.length > 0) { if (state.ended && !addToFront) { var e = new Error('stream.push() after EOF'); stream.emit('error', e); } else if (state.endEmitted && addToFront) { var e = new Error('stream.unshift() after end event'); stream.emit('error', e); } else { if (state.decoder && !addToFront && !encoding) chunk = state.decoder.write(chunk); if (!addToFront) state.reading = false; if (state.flowing && state.length === 0 && !state.sync) { stream.emit('data', chunk); stream.read(0); } else { state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk); else state.buffer.push(chunk); if (state.needReadable) emitReadable(stream); } maybeReadMore(stream, state); } } else if (!addToFront) { state.reading = false; } return needMoreData(state); } function needMoreData(state) { return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } Readable.prototype.setEncoding = function(enc) { if (!StringDecoder) StringDecoder = require("npm:string_decoder@0.10.31.js").StringDecoder; this._readableState.decoder = new StringDecoder(enc); this._readableState.encoding = enc; return this; }; var MAX_HWM = 0x800000; function roundUpToNextPowerOf2(n) { if (n >= MAX_HWM) { n = MAX_HWM; } else { n--; for (var p = 1; p < 32; p <<= 1) n |= n >> p; n++; } return n; } function howMuchToRead(n, state) { if (state.length === 0 && state.ended) return 0; if (state.objectMode) return n === 0 ? 0 : 1; if (isNaN(n) || util.isNull(n)) { if (state.flowing && state.buffer.length) return state.buffer[0].length; else return state.length; } if (n <= 0) return 0; if (n > state.highWaterMark) state.highWaterMark = roundUpToNextPowerOf2(n); if (n > state.length) { if (!state.ended) { state.needReadable = true; return 0; } else return state.length; } return n; } Readable.prototype.read = function(n) { debug('read', n); var state = this._readableState; var nOrig = n; if (!util.isNumber(n) || n > 0) state.emittedReadable = false; if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { debug('read: emitReadable', state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this); else emitReadable(this); return null; } n = howMuchToRead(n, state); if (n === 0 && state.ended) { if (state.length === 0) endReadable(this); return null; } var doRead = state.needReadable; debug('need readable', doRead); if (state.length === 0 || state.length - n < state.highWaterMark) { doRead = true; debug('length less than watermark', doRead); } if (state.ended || state.reading) { doRead = false; debug('reading or ended', doRead); } if (doRead) { debug('do read'); state.reading = true; state.sync = true; if (state.length === 0) state.needReadable = true; this._read(state.highWaterMark); state.sync = false; } if (doRead && !state.reading) n = howMuchToRead(nOrig, state); var ret; if (n > 0) ret = fromList(n, state); else ret = null; if (util.isNull(ret)) { state.needReadable = true; n = 0; } state.length -= n; if (state.length === 0 && !state.ended) state.needReadable = true; if (nOrig !== n && state.ended && state.length === 0) endReadable(this); if (!util.isNull(ret)) this.emit('data', ret); return ret; }; function chunkInvalid(state, chunk) { var er = null; if (!util.isBuffer(chunk) && !util.isString(chunk) && !util.isNullOrUndefined(chunk) && !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); } return er; } function onEofChunk(stream, state) { if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } state.ended = true; emitReadable(stream); } function emitReadable(stream) { var state = stream._readableState; state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; if (state.sync) process.nextTick(function() { emitReadable_(stream); }); else emitReadable_(stream); } } function emitReadable_(stream) { debug('emit readable'); stream.emit('readable'); flow(stream); } function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; process.nextTick(function() { maybeReadMore_(stream, state); }); } } function maybeReadMore_(stream, state) { var len = state.length; while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) break; else len = state.length; } state.readingMore = false; } Readable.prototype._read = function(n) { this.emit('error', new Error('not implemented')); }; Readable.prototype.pipe = function(dest, pipeOpts) { var src = this; var state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [state.pipes, dest]; break; default: state.pipes.push(dest); break; } state.pipesCount += 1; debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : cleanup; if (state.endEmitted) process.nextTick(endFn); else src.once('end', endFn); dest.on('unpipe', onunpipe); function onunpipe(readable) { debug('onunpipe'); if (readable === src) { cleanup(); } } function onend() { debug('onend'); dest.end(); } var ondrain = pipeOnDrain(src); dest.on('drain', ondrain); function cleanup() { debug('cleanup'); dest.removeListener('close', onclose); dest.removeListener('finish', onfinish); dest.removeListener('drain', ondrain); dest.removeListener('error', onerror); dest.removeListener('unpipe', onunpipe); src.removeListener('end', onend); src.removeListener('end', cleanup); src.removeListener('data', ondata); if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } src.on('data', ondata); function ondata(chunk) { debug('ondata'); var ret = dest.write(chunk); if (false === ret) { debug('false write response, pause', src._readableState.awaitDrain); src._readableState.awaitDrain++; src.pause(); } } function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EE.listenerCount(dest, 'error') === 0) dest.emit('error', er); } if (!dest._events || !dest._events.error) dest.on('error', onerror); else if (isArray(dest._events.error)) dest._events.error.unshift(onerror); else dest._events.error = [onerror, dest._events.error]; function onclose() { dest.removeListener('finish', onfinish); unpipe(); } dest.once('close', onclose); function onfinish() { debug('onfinish'); dest.removeListener('close', onclose); unpipe(); } dest.once('finish', onfinish); function unpipe() { debug('unpipe'); src.unpipe(dest); } dest.emit('pipe', src); if (!state.flowing) { debug('pipe resume'); src.resume(); } return dest; }; function pipeOnDrain(src) { return function() { var state = src._readableState; debug('pipeOnDrain', state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) { state.flowing = true; flow(src); } }; } Readable.prototype.unpipe = function(dest) { var state = this._readableState; if (state.pipesCount === 0) return this; if (state.pipesCount === 1) { if (dest && dest !== state.pipes) return this; if (!dest) dest = state.pipes; state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit('unpipe', this); return this; } if (!dest) { var dests = state.pipes; var len = state.pipesCount; state.pipes = null; state.pipesCount = 0; state.flowing = false; for (var i = 0; i < len; i++) dests[i].emit('unpipe', this); return this; } var i = indexOf(state.pipes, dest); if (i === -1) return this; state.pipes.splice(i, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit('unpipe', this); return this; }; Readable.prototype.on = function(ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); if (ev === 'data' && false !== this._readableState.flowing) { this.resume(); } if (ev === 'readable' && this.readable) { var state = this._readableState; if (!state.readableListening) { state.readableListening = true; state.emittedReadable = false; state.needReadable = true; if (!state.reading) { var self = this; process.nextTick(function() { debug('readable nexttick read 0'); self.read(0); }); } else if (state.length) { emitReadable(this, state); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; Readable.prototype.resume = function() { var state = this._readableState; if (!state.flowing) { debug('resume'); state.flowing = true; if (!state.reading) { debug('resume read 0'); this.read(0); } resume(this, state); } return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; process.nextTick(function() { resume_(stream, state); }); } } function resume_(stream, state) { state.resumeScheduled = false; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); } Readable.prototype.pause = function() { debug('call pause flowing=%j', this._readableState.flowing); if (false !== this._readableState.flowing) { debug('pause'); this._readableState.flowing = false; this.emit('pause'); } return this; }; function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); if (state.flowing) { do { var chunk = stream.read(); } while (null !== chunk && state.flowing); } } Readable.prototype.wrap = function(stream) { var state = this._readableState; var paused = false; var self = this; stream.on('end', function() { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) self.push(chunk); } self.push(null); }); stream.on('data', function(chunk) { debug('wrapped data'); if (state.decoder) chunk = state.decoder.write(chunk); if (!chunk || !state.objectMode && !chunk.length) return; var ret = self.push(chunk); if (!ret) { paused = true; stream.pause(); } }); for (var i in stream) { if (util.isFunction(stream[i]) && util.isUndefined(this[i])) { this[i] = function(method) { return function() { return stream[method].apply(stream, arguments); }; }(i); } } var events = ['error', 'close', 'destroy', 'pause', 'resume']; forEach(events, function(ev) { stream.on(ev, self.emit.bind(self, ev)); }); self._read = function(n) { debug('wrapped _read', n); if (paused) { paused = false; stream.resume(); } }; return self; }; Readable._fromList = fromList; function fromList(n, state) { var list = state.buffer; var length = state.length; var stringMode = !!state.decoder; var objectMode = !!state.objectMode; var ret; if (list.length === 0) return null; if (length === 0) ret = null; else if (objectMode) ret = list.shift(); else if (!n || n >= length) { if (stringMode) ret = list.join(''); else ret = Buffer.concat(list, length); list.length = 0; } else { if (n < list[0].length) { var buf = list[0]; ret = buf.slice(0, n); list[0] = buf.slice(n); } else if (n === list[0].length) { ret = list.shift(); } else { if (stringMode) ret = ''; else ret = new Buffer(n); var c = 0; for (var i = 0, l = list.length; i < l && c < n; i++) { var buf = list[0]; var cpy = Math.min(n - c, buf.length); if (stringMode) ret += buf.slice(0, cpy); else buf.copy(ret, c, 0, cpy); if (cpy < buf.length) list[0] = buf.slice(cpy); else list.shift(); c += cpy; } } } return ret; } function endReadable(stream) { var state = stream._readableState; if (state.length > 0) throw new Error('endReadable called on non-empty stream'); if (!state.endEmitted) { state.ended = true; process.nextTick(function() { if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit('end'); } }); } } function forEach(xs, f) { for (var i = 0, l = xs.length; i < l; i++) { f(xs[i], i); } } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; } })(require("github:jspm/nodelibs-buffer@0.1.0.js").Buffer, require("github:jspm/nodelibs-process@0.1.1.js")); global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/object/assign.js", ["npm:lodash@3.9.3/internal/assignWith.js", "npm:lodash@3.9.3/internal/baseAssign.js", "npm:lodash@3.9.3/internal/createAssigner.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var assignWith = require("npm:lodash@3.9.3/internal/assignWith.js"), baseAssign = require("npm:lodash@3.9.3/internal/baseAssign.js"), createAssigner = require("npm:lodash@3.9.3/internal/createAssigner.js"); var assign = createAssigner(function(object, source, customizer) { return customizer ? assignWith(object, source, customizer) : baseAssign(object, source); }); module.exports = assign; global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/internal/baseCallback.js", ["npm:lodash@3.9.3/internal/baseMatches.js", "npm:lodash@3.9.3/internal/baseMatchesProperty.js", "npm:lodash@3.9.3/internal/bindCallback.js", "npm:lodash@3.9.3/utility/identity.js", "npm:lodash@3.9.3/utility/property.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var baseMatches = require("npm:lodash@3.9.3/internal/baseMatches.js"), baseMatchesProperty = require("npm:lodash@3.9.3/internal/baseMatchesProperty.js"), bindCallback = require("npm:lodash@3.9.3/internal/bindCallback.js"), identity = require("npm:lodash@3.9.3/utility/identity.js"), property = require("npm:lodash@3.9.3/utility/property.js"); function baseCallback(func, thisArg, argCount) { var type = typeof func; if (type == 'function') { return thisArg === undefined ? func : bindCallback(func, thisArg, argCount); } if (func == null) { return identity; } if (type == 'object') { return baseMatches(func); } return thisArg === undefined ? property(func) : baseMatchesProperty(func, thisArg); } module.exports = baseCallback; global.define = __define; return module.exports; }); System.registerDynamic("npm:readable-stream@1.1.13/readable.js", ["npm:readable-stream@1.1.13/lib/_stream_readable.js", "npm:stream-browserify@1.0.0/index.js", "npm:readable-stream@1.1.13/lib/_stream_writable.js", "npm:readable-stream@1.1.13/lib/_stream_duplex.js", "npm:readable-stream@1.1.13/lib/_stream_transform.js", "npm:readable-stream@1.1.13/lib/_stream_passthrough.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; exports = module.exports = require("npm:readable-stream@1.1.13/lib/_stream_readable.js"); exports.Stream = require("npm:stream-browserify@1.0.0/index.js"); exports.Readable = exports; exports.Writable = require("npm:readable-stream@1.1.13/lib/_stream_writable.js"); exports.Duplex = require("npm:readable-stream@1.1.13/lib/_stream_duplex.js"); exports.Transform = require("npm:readable-stream@1.1.13/lib/_stream_transform.js"); exports.PassThrough = require("npm:readable-stream@1.1.13/lib/_stream_passthrough.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:lodash@3.9.3/collection/every.js", ["npm:lodash@3.9.3/internal/arrayEvery.js", "npm:lodash@3.9.3/internal/baseCallback.js", "npm:lodash@3.9.3/internal/baseEvery.js", "npm:lodash@3.9.3/lang/isArray.js", "npm:lodash@3.9.3/internal/isIterateeCall.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; var arrayEvery = require("npm:lodash@3.9.3/internal/arrayEvery.js"), baseCallback = require("npm:lodash@3.9.3/internal/baseCallback.js"), baseEvery = require("npm:lodash@3.9.3/internal/baseEvery.js"), isArray = require("npm:lodash@3.9.3/lang/isArray.js"), isIterateeCall = require("npm:lodash@3.9.3/internal/isIterateeCall.js"); function every(collection, predicate, thisArg) { var func = isArray(collection) ? arrayEvery : baseEvery; if (thisArg && isIterateeCall(collection, predicate, thisArg)) { predicate = null; } if (typeof predicate != 'function' || thisArg !== undefined) { predicate = baseCallback(predicate, thisArg, 3); } return func(collection, predicate); } module.exports = every; global.define = __define; return module.exports; }); System.registerDynamic("npm:stream-browserify@1.0.0/index.js", ["github:jspm/nodelibs-events@0.1.1.js", "npm:inherits@2.0.1.js", "npm:readable-stream@1.1.13/readable.js", "npm:readable-stream@1.1.13/writable.js", "npm:readable-stream@1.1.13/duplex.js", "npm:readable-stream@1.1.13/transform.js", "npm:readable-stream@1.1.13/passthrough.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = Stream; var EE = require("github:jspm/nodelibs-events@0.1.1.js").EventEmitter; var inherits = require("npm:inherits@2.0.1.js"); inherits(Stream, EE); Stream.Readable = require("npm:readable-stream@1.1.13/readable.js"); Stream.Writable = require("npm:readable-stream@1.1.13/writable.js"); Stream.Duplex = require("npm:readable-stream@1.1.13/duplex.js"); Stream.Transform = require("npm:readable-stream@1.1.13/transform.js"); Stream.PassThrough = require("npm:readable-stream@1.1.13/passthrough.js"); Stream.Stream = Stream; function Stream() { EE.call(this); } Stream.prototype.pipe = function(dest, options) { var source = this; function ondata(chunk) { if (dest.writable) { if (false === dest.write(chunk) && source.pause) { source.pause(); } } } source.on('data', ondata); function ondrain() { if (source.readable && source.resume) { source.resume(); } } dest.on('drain', ondrain); if (!dest._isStdio && (!options || options.end !== false)) { source.on('end', onend); source.on('close', onclose); } var didOnEnd = false; function onend() { if (didOnEnd) return; didOnEnd = true; dest.end(); } function onclose() { if (didOnEnd) return; didOnEnd = true; if (typeof dest.destroy === 'function') dest.destroy(); } function onerror(er) { cleanup(); if (EE.listenerCount(this, 'error') === 0) { throw er; } } source.on('error', onerror); dest.on('error', onerror); function cleanup() { source.removeListener('data', ondata); dest.removeListener('drain', ondrain); source.removeListener('end', onend); source.removeListener('close', onclose); source.removeListener('error', onerror); dest.removeListener('error', onerror); source.removeListener('end', cleanup); source.removeListener('close', cleanup); dest.removeListener('close', cleanup); } source.on('end', cleanup); source.on('close', cleanup); dest.on('close', cleanup); dest.emit('pipe', source); return dest; }; global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLElement.js", ["npm:lodash@3.9.3/object/create.js", "npm:lodash@3.9.3/lang/isObject.js", "npm:lodash@3.9.3/lang/isArray.js", "npm:lodash@3.9.3/lang/isFunction.js", "npm:lodash@3.9.3/collection/every.js", "npm:xmlbuilder@2.6.4/lib/XMLNode.js", "npm:xmlbuilder@2.6.4/lib/XMLAttribute.js", "npm:xmlbuilder@2.6.4/lib/XMLProcessingInstruction.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLAttribute, XMLElement, XMLNode, XMLProcessingInstruction, create, every, isArray, isFunction, isObject, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; create = require("npm:lodash@3.9.3/object/create.js"); isObject = require("npm:lodash@3.9.3/lang/isObject.js"); isArray = require("npm:lodash@3.9.3/lang/isArray.js"); isFunction = require("npm:lodash@3.9.3/lang/isFunction.js"); every = require("npm:lodash@3.9.3/collection/every.js"); XMLNode = require("npm:xmlbuilder@2.6.4/lib/XMLNode.js"); XMLAttribute = require("npm:xmlbuilder@2.6.4/lib/XMLAttribute.js"); XMLProcessingInstruction = require("npm:xmlbuilder@2.6.4/lib/XMLProcessingInstruction.js"); module.exports = XMLElement = (function(superClass) { extend(XMLElement, superClass); function XMLElement(parent, name, attributes) { XMLElement.__super__.constructor.call(this, parent); if (name == null) { throw new Error("Missing element name"); } this.name = this.stringify.eleName(name); this.children = []; this.instructions = []; this.attributes = {}; if (attributes != null) { this.attribute(attributes); } } XMLElement.prototype.clone = function() { var att, attName, clonedSelf, i, len, pi, ref, ref1; clonedSelf = create(XMLElement.prototype, this); if (clonedSelf.isRoot) { clonedSelf.documentObject = null; } clonedSelf.attributes = {}; ref = this.attributes; for (attName in ref) { if (!hasProp.call(ref, attName)) continue; att = ref[attName]; clonedSelf.attributes[attName] = att.clone(); } clonedSelf.instructions = []; ref1 = this.instructions; for (i = 0, len = ref1.length; i < len; i++) { pi = ref1[i]; clonedSelf.instructions.push(pi.clone()); } clonedSelf.children = []; this.children.forEach(function(child) { var clonedChild; clonedChild = child.clone(); clonedChild.parent = clonedSelf; return clonedSelf.children.push(clonedChild); }); return clonedSelf; }; XMLElement.prototype.attribute = function(name, value) { var attName, attValue; if (name != null) { name = name.valueOf(); } if (isObject(name)) { for (attName in name) { if (!hasProp.call(name, attName)) continue; attValue = name[attName]; this.attribute(attName, attValue); } } else { if (isFunction(value)) { value = value.apply(); } if (!this.options.skipNullAttributes || (value != null)) { this.attributes[name] = new XMLAttribute(this, name, value); } } return this; }; XMLElement.prototype.removeAttribute = function(name) { var attName, i, len; if (name == null) { throw new Error("Missing attribute name"); } name = name.valueOf(); if (isArray(name)) { for (i = 0, len = name.length; i < len; i++) { attName = name[i]; delete this.attributes[attName]; } } else { delete this.attributes[name]; } return this; }; XMLElement.prototype.instruction = function(target, value) { var i, insTarget, insValue, instruction, len; if (target != null) { target = target.valueOf(); } if (value != null) { value = value.valueOf(); } if (isArray(target)) { for (i = 0, len = target.length; i < len; i++) { insTarget = target[i]; this.instruction(insTarget); } } else if (isObject(target)) { for (insTarget in target) { if (!hasProp.call(target, insTarget)) continue; insValue = target[insTarget]; this.instruction(insTarget, insValue); } } else { if (isFunction(value)) { value = value.apply(); } instruction = new XMLProcessingInstruction(this, target, value); this.instructions.push(instruction); } return this; }; XMLElement.prototype.toString = function(options, level) { var att, child, i, indent, instruction, j, len, len1, name, newline, offset, pretty, r, ref, ref1, ref2, ref3, ref4, ref5, space; pretty = (options != null ? options.pretty : void 0) || false; indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; level || (level = 0); space = new Array(level + offset + 1).join(indent); r = ''; ref3 = this.instructions; for (i = 0, len = ref3.length; i < len; i++) { instruction = ref3[i]; r += instruction.toString(options, level + 1); } if (pretty) { r += space; } r += '<' + this.name; ref4 = this.attributes; for (name in ref4) { if (!hasProp.call(ref4, name)) continue; att = ref4[name]; r += att.toString(options); } if (this.children.length === 0 || every(this.children, function(e) { return e.value === ''; })) { r += '/>'; if (pretty) { r += newline; } } else if (pretty && this.children.length === 1 && (this.children[0].value != null)) { r += '>'; r += this.children[0].value; r += '</' + this.name + '>'; r += newline; } else { r += '>'; if (pretty) { r += newline; } ref5 = this.children; for (j = 0, len1 = ref5.length; j < len1; j++) { child = ref5[j]; r += child.toString(options, level + 1); } if (pretty) { r += space; } r += '</' + this.name + '>'; if (pretty) { r += newline; } } return r; }; XMLElement.prototype.att = function(name, value) { return this.attribute(name, value); }; XMLElement.prototype.ins = function(target, value) { return this.instruction(target, value); }; XMLElement.prototype.a = function(name, value) { return this.attribute(name, value); }; XMLElement.prototype.i = function(target, value) { return this.instruction(target, value); }; return XMLElement; })(XMLNode); }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("npm:stream-browserify@1.0.0.js", ["npm:stream-browserify@1.0.0/index.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:stream-browserify@1.0.0/index.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLNode.js", ["npm:lodash@3.9.3/lang/isObject.js", "npm:lodash@3.9.3/lang/isArray.js", "npm:lodash@3.9.3/lang/isFunction.js", "npm:lodash@3.9.3/lang/isEmpty.js", "npm:xmlbuilder@2.6.4/lib/XMLElement.js", "npm:xmlbuilder@2.6.4/lib/XMLCData.js", "npm:xmlbuilder@2.6.4/lib/XMLComment.js", "npm:xmlbuilder@2.6.4/lib/XMLDeclaration.js", "npm:xmlbuilder@2.6.4/lib/XMLDocType.js", "npm:xmlbuilder@2.6.4/lib/XMLRaw.js", "npm:xmlbuilder@2.6.4/lib/XMLText.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLElement, XMLNode, XMLRaw, XMLText, isArray, isEmpty, isFunction, isObject, hasProp = {}.hasOwnProperty; isObject = require("npm:lodash@3.9.3/lang/isObject.js"); isArray = require("npm:lodash@3.9.3/lang/isArray.js"); isFunction = require("npm:lodash@3.9.3/lang/isFunction.js"); isEmpty = require("npm:lodash@3.9.3/lang/isEmpty.js"); XMLElement = null; XMLCData = null; XMLComment = null; XMLDeclaration = null; XMLDocType = null; XMLRaw = null; XMLText = null; module.exports = XMLNode = (function() { function XMLNode(parent) { this.parent = parent; this.options = this.parent.options; this.stringify = this.parent.stringify; if (XMLElement === null) { XMLElement = require("npm:xmlbuilder@2.6.4/lib/XMLElement.js"); XMLCData = require("npm:xmlbuilder@2.6.4/lib/XMLCData.js"); XMLComment = require("npm:xmlbuilder@2.6.4/lib/XMLComment.js"); XMLDeclaration = require("npm:xmlbuilder@2.6.4/lib/XMLDeclaration.js"); XMLDocType = require("npm:xmlbuilder@2.6.4/lib/XMLDocType.js"); XMLRaw = require("npm:xmlbuilder@2.6.4/lib/XMLRaw.js"); XMLText = require("npm:xmlbuilder@2.6.4/lib/XMLText.js"); } } XMLNode.prototype.clone = function() { throw new Error("Cannot clone generic XMLNode"); }; XMLNode.prototype.element = function(name, attributes, text) { var item, j, key, lastChild, len, ref, val; lastChild = null; if (attributes == null) { attributes = {}; } attributes = attributes.valueOf(); if (!isObject(attributes)) { ref = [attributes, text], text = ref[0], attributes = ref[1]; } if (name != null) { name = name.valueOf(); } if (isArray(name)) { for (j = 0, len = name.length; j < len; j++) { item = name[j]; lastChild = this.element(item); } } else if (isFunction(name)) { lastChild = this.element(name.apply()); } else if (isObject(name)) { for (key in name) { if (!hasProp.call(name, key)) continue; val = name[key]; if (isFunction(val)) { val = val.apply(); } if ((isObject(val)) && (isEmpty(val))) { val = null; } if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) { lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val); } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && key.indexOf(this.stringify.convertPIKey) === 0) { lastChild = this.instruction(key.substr(this.stringify.convertPIKey.length), val); } else if (isObject(val)) { if (!this.options.ignoreDecorators && this.stringify.convertListKey && key.indexOf(this.stringify.convertListKey) === 0 && isArray(val)) { lastChild = this.element(val); } else { lastChild = this.element(key); lastChild.element(val); } } else { lastChild = this.element(key, val); } } } else { if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) { lastChild = this.text(text); } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) { lastChild = this.cdata(text); } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) { lastChild = this.comment(text); } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) { lastChild = this.raw(text); } else { lastChild = this.node(name, attributes, text); } } if (lastChild == null) { throw new Error("Could not create any elements with: " + name); } return lastChild; }; XMLNode.prototype.insertBefore = function(name, attributes, text) { var child, i, removed; if (this.isRoot) { throw new Error("Cannot insert elements at root level"); } i = this.parent.children.indexOf(this); removed = this.parent.children.splice(i); child = this.parent.element(name, attributes, text); Array.prototype.push.apply(this.parent.children, removed); return child; }; XMLNode.prototype.insertAfter = function(name, attributes, text) { var child, i, removed; if (this.isRoot) { throw new Error("Cannot insert elements at root level"); } i = this.parent.children.indexOf(this); removed = this.parent.children.splice(i + 1); child = this.parent.element(name, attributes, text); Array.prototype.push.apply(this.parent.children, removed); return child; }; XMLNode.prototype.remove = function() { var i, ref; if (this.isRoot) { throw new Error("Cannot remove the root element"); } i = this.parent.children.indexOf(this); [].splice.apply(this.parent.children, [i, i - i + 1].concat(ref = [])), ref; return this.parent; }; XMLNode.prototype.node = function(name, attributes, text) { var child, ref; if (name != null) { name = name.valueOf(); } if (attributes == null) { attributes = {}; } attributes = attributes.valueOf(); if (!isObject(attributes)) { ref = [attributes, text], text = ref[0], attributes = ref[1]; } child = new XMLElement(this, name, attributes); if (text != null) { child.text(text); } this.children.push(child); return child; }; XMLNode.prototype.text = function(value) { var child; child = new XMLText(this, value); this.children.push(child); return this; }; XMLNode.prototype.cdata = function(value) { var child; child = new XMLCData(this, value); this.children.push(child); return this; }; XMLNode.prototype.comment = function(value) { var child; child = new XMLComment(this, value); this.children.push(child); return this; }; XMLNode.prototype.raw = function(value) { var child; child = new XMLRaw(this, value); this.children.push(child); return this; }; XMLNode.prototype.declaration = function(version, encoding, standalone) { var doc, xmldec; doc = this.document(); xmldec = new XMLDeclaration(doc, version, encoding, standalone); doc.xmldec = xmldec; return doc.root(); }; XMLNode.prototype.doctype = function(pubID, sysID) { var doc, doctype; doc = this.document(); doctype = new XMLDocType(doc, pubID, sysID); doc.doctype = doctype; return doctype; }; XMLNode.prototype.up = function() { if (this.isRoot) { throw new Error("The root node has no parent. Use doc() if you need to get the document object."); } return this.parent; }; XMLNode.prototype.root = function() { var child; if (this.isRoot) { return this; } child = this.parent; while (!child.isRoot) { child = child.parent; } return child; }; XMLNode.prototype.document = function() { return this.root().documentObject; }; XMLNode.prototype.end = function(options) { return this.document().toString(options); }; XMLNode.prototype.prev = function() { var i; if (this.isRoot) { throw new Error("Root node has no siblings"); } i = this.parent.children.indexOf(this); if (i < 1) { throw new Error("Already at the first node"); } return this.parent.children[i - 1]; }; XMLNode.prototype.next = function() { var i; if (this.isRoot) { throw new Error("Root node has no siblings"); } i = this.parent.children.indexOf(this); if (i === -1 || i === this.parent.children.length - 1) { throw new Error("Already at the last node"); } return this.parent.children[i + 1]; }; XMLNode.prototype.importXMLBuilder = function(xmlbuilder) { var clonedRoot; clonedRoot = xmlbuilder.root().clone(); clonedRoot.parent = this; clonedRoot.isRoot = false; this.children.push(clonedRoot); return this; }; XMLNode.prototype.ele = function(name, attributes, text) { return this.element(name, attributes, text); }; XMLNode.prototype.nod = function(name, attributes, text) { return this.node(name, attributes, text); }; XMLNode.prototype.txt = function(value) { return this.text(value); }; XMLNode.prototype.dat = function(value) { return this.cdata(value); }; XMLNode.prototype.com = function(value) { return this.comment(value); }; XMLNode.prototype.doc = function() { return this.document(); }; XMLNode.prototype.dec = function(version, encoding, standalone) { return this.declaration(version, encoding, standalone); }; XMLNode.prototype.dtd = function(pubID, sysID) { return this.doctype(pubID, sysID); }; XMLNode.prototype.e = function(name, attributes, text) { return this.element(name, attributes, text); }; XMLNode.prototype.n = function(name, attributes, text) { return this.node(name, attributes, text); }; XMLNode.prototype.t = function(value) { return this.text(value); }; XMLNode.prototype.d = function(value) { return this.cdata(value); }; XMLNode.prototype.c = function(value) { return this.comment(value); }; XMLNode.prototype.r = function(value) { return this.raw(value); }; XMLNode.prototype.u = function() { return this.up(); }; return XMLNode; })(); }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("github:jspm/nodelibs-stream@0.1.0/index.js", ["npm:stream-browserify@1.0.0.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = System._nodeRequire ? System._nodeRequire('stream') : require("npm:stream-browserify@1.0.0.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLDeclaration.js", ["npm:lodash@3.9.3/object/create.js", "npm:lodash@3.9.3/lang/isObject.js", "npm:xmlbuilder@2.6.4/lib/XMLNode.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLDeclaration, XMLNode, create, isObject, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; create = require("npm:lodash@3.9.3/object/create.js"); isObject = require("npm:lodash@3.9.3/lang/isObject.js"); XMLNode = require("npm:xmlbuilder@2.6.4/lib/XMLNode.js"); module.exports = XMLDeclaration = (function(superClass) { extend(XMLDeclaration, superClass); function XMLDeclaration(parent, version, encoding, standalone) { var ref; XMLDeclaration.__super__.constructor.call(this, parent); if (isObject(version)) { ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone; } if (!version) { version = '1.0'; } if (version != null) { this.version = this.stringify.xmlVersion(version); } if (encoding != null) { this.encoding = this.stringify.xmlEncoding(encoding); } if (standalone != null) { this.standalone = this.stringify.xmlStandalone(standalone); } } XMLDeclaration.prototype.clone = function() { return create(XMLDeclaration.prototype, this); }; XMLDeclaration.prototype.toString = function(options, level) { var indent, newline, offset, pretty, r, ref, ref1, ref2, space; pretty = (options != null ? options.pretty : void 0) || false; indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; level || (level = 0); space = new Array(level + offset + 1).join(indent); r = ''; if (pretty) { r += space; } r += '<?xml'; if (this.version != null) { r += ' version="' + this.version + '"'; } if (this.encoding != null) { r += ' encoding="' + this.encoding + '"'; } if (this.standalone != null) { r += ' standalone="' + this.standalone + '"'; } r += '?>'; if (pretty) { r += newline; } return r; }; return XMLDeclaration; })(XMLNode); }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("github:jspm/nodelibs-stream@0.1.0.js", ["github:jspm/nodelibs-stream@0.1.0/index.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("github:jspm/nodelibs-stream@0.1.0/index.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/XMLBuilder.js", ["npm:xmlbuilder@2.6.4/lib/XMLStringifier.js", "npm:xmlbuilder@2.6.4/lib/XMLDeclaration.js", "npm:xmlbuilder@2.6.4/lib/XMLDocType.js", "npm:xmlbuilder@2.6.4/lib/XMLElement.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLBuilder, XMLDeclaration, XMLDocType, XMLElement, XMLStringifier; XMLStringifier = require("npm:xmlbuilder@2.6.4/lib/XMLStringifier.js"); XMLDeclaration = require("npm:xmlbuilder@2.6.4/lib/XMLDeclaration.js"); XMLDocType = require("npm:xmlbuilder@2.6.4/lib/XMLDocType.js"); XMLElement = require("npm:xmlbuilder@2.6.4/lib/XMLElement.js"); module.exports = XMLBuilder = (function() { function XMLBuilder(name, options) { var root, temp; if (name == null) { throw new Error("Root element needs a name"); } if (options == null) { options = {}; } this.options = options; this.stringify = new XMLStringifier(options); temp = new XMLElement(this, 'doc'); root = temp.element(name); root.isRoot = true; root.documentObject = this; this.rootObject = root; if (!options.headless) { root.declaration(options); if ((options.pubID != null) || (options.sysID != null)) { root.doctype(options); } } } XMLBuilder.prototype.root = function() { return this.rootObject; }; XMLBuilder.prototype.end = function(options) { return this.toString(options); }; XMLBuilder.prototype.toString = function(options) { var indent, newline, offset, pretty, r, ref, ref1, ref2; pretty = (options != null ? options.pretty : void 0) || false; indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; r = ''; if (this.xmldec != null) { r += this.xmldec.toString(options); } if (this.doctype != null) { r += this.doctype.toString(options); } r += this.rootObject.toString(options); if (pretty && r.slice(-newline.length) === newline) { r = r.slice(0, -newline.length); } return r; }; return XMLBuilder; })(); }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("npm:sax@0.6.1/lib/sax.js", ["github:jspm/nodelibs-stream@0.1.0.js", "github:jspm/nodelibs-string_decoder@0.1.0.js", "github:jspm/nodelibs-buffer@0.1.0.js", "github:jspm/nodelibs-process@0.1.1.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function(Buffer, process) { ; (function(sax) { sax.parser = function(strict, opt) { return new SAXParser(strict, opt); }; sax.SAXParser = SAXParser; sax.SAXStream = SAXStream; sax.createStream = createStream; sax.MAX_BUFFER_LENGTH = 64 * 1024; var buffers = ["comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script"]; sax.EVENTS = ["text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "closecdata", "error", "end", "ready", "script", "opennamespace", "closenamespace"]; function SAXParser(strict, opt) { if (!(this instanceof SAXParser)) return new SAXParser(strict, opt); var parser = this; clearBuffers(parser); parser.q = parser.c = ""; parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH; parser.opt = opt || {}; parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags; parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase"; parser.tags = []; parser.closed = parser.closedRoot = parser.sawRoot = false; parser.tag = parser.error = null; parser.strict = !!strict; parser.noscript = !!(strict || parser.opt.noscript); parser.state = S.BEGIN; parser.ENTITIES = Object.create(sax.ENTITIES); parser.attribList = []; if (parser.opt.xmlns) parser.ns = Object.create(rootNS); parser.trackPosition = parser.opt.position !== false; if (parser.trackPosition) { parser.position = parser.line = parser.column = 0; } emit(parser, "onready"); } if (!Object.create) Object.create = function(o) { function f() { this.__proto__ = o; } f.prototype = o; return new f; }; if (!Object.getPrototypeOf) Object.getPrototypeOf = function(o) { return o.__proto__; }; if (!Object.keys) Object.keys = function(o) { var a = []; for (var i in o) if (o.hasOwnProperty(i)) a.push(i); return a; }; function checkBufferLength(parser) { var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10), maxActual = 0; for (var i = 0, l = buffers.length; i < l; i++) { var len = parser[buffers[i]].length; if (len > maxAllowed) { switch (buffers[i]) { case "textNode": closeText(parser); break; case "cdata": emitNode(parser, "oncdata", parser.cdata); parser.cdata = ""; break; case "script": emitNode(parser, "onscript", parser.script); parser.script = ""; break; default: error(parser, "Max buffer length exceeded: " + buffers[i]); } } maxActual = Math.max(maxActual, len); } parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual) + parser.position; } function clearBuffers(parser) { for (var i = 0, l = buffers.length; i < l; i++) { parser[buffers[i]] = ""; } } function flushBuffers(parser) { closeText(parser); if (parser.cdata !== "") { emitNode(parser, "oncdata", parser.cdata); parser.cdata = ""; } if (parser.script !== "") { emitNode(parser, "onscript", parser.script); parser.script = ""; } } SAXParser.prototype = { end: function() { end(this); }, write: write, resume: function() { this.error = null; return this; }, close: function() { return this.write(null); }, flush: function() { flushBuffers(this); } }; try { var Stream = require("github:jspm/nodelibs-stream@0.1.0.js").Stream; } catch (ex) { var Stream = function() {}; } var streamWraps = sax.EVENTS.filter(function(ev) { return ev !== "error" && ev !== "end"; }); function createStream(strict, opt) { return new SAXStream(strict, opt); } function SAXStream(strict, opt) { if (!(this instanceof SAXStream)) return new SAXStream(strict, opt); Stream.apply(this); this._parser = new SAXParser(strict, opt); this.writable = true; this.readable = true; var me = this; this._parser.onend = function() { me.emit("end"); }; this._parser.onerror = function(er) { me.emit("error", er); me._parser.error = null; }; this._decoder = null; streamWraps.forEach(function(ev) { Object.defineProperty(me, "on" + ev, { get: function() { return me._parser["on" + ev]; }, set: function(h) { if (!h) { me.removeAllListeners(ev); return me._parser["on" + ev] = h; } me.on(ev, h); }, enumerable: true, configurable: false }); }); } SAXStream.prototype = Object.create(Stream.prototype, {constructor: {value: SAXStream}}); SAXStream.prototype.write = function(data) { if (typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function' && Buffer.isBuffer(data)) { if (!this._decoder) { var SD = require("github:jspm/nodelibs-string_decoder@0.1.0.js").StringDecoder; this._decoder = new SD('utf8'); } data = this._decoder.write(data); } this._parser.write(data.toString()); this.emit("data", data); return true; }; SAXStream.prototype.end = function(chunk) { if (chunk && chunk.length) this.write(chunk); this._parser.end(); return true; }; SAXStream.prototype.on = function(ev, handler) { var me = this; if (!me._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) { me._parser["on" + ev] = function() { var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments); args.splice(0, 0, ev); me.emit.apply(me, args); }; } return Stream.prototype.on.call(me, ev, handler); }; var whitespace = "\r\n\t ", number = "0124356789", letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", quote = "'\"", entity = number + letter + "#", attribEnd = whitespace + ">", CDATA = "[CDATA[", DOCTYPE = "DOCTYPE", XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace", XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/", rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }; whitespace = charClass(whitespace); number = charClass(number); letter = charClass(letter); var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/; var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/; quote = charClass(quote); entity = charClass(entity); attribEnd = charClass(attribEnd); function charClass(str) { return str.split("").reduce(function(s, c) { s[c] = true; return s; }, {}); } function isRegExp(c) { return Object.prototype.toString.call(c) === '[object RegExp]'; } function is(charclass, c) { return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]; } function not(charclass, c) { return !is(charclass, c); } var S = 0; sax.STATE = { BEGIN: S++, TEXT: S++, TEXT_ENTITY: S++, OPEN_WAKA: S++, SGML_DECL: S++, SGML_DECL_QUOTED: S++, DOCTYPE: S++, DOCTYPE_QUOTED: S++, DOCTYPE_DTD: S++, DOCTYPE_DTD_QUOTED: S++, COMMENT_STARTING: S++, COMMENT: S++, COMMENT_ENDING: S++, COMMENT_ENDED: S++, CDATA: S++, CDATA_ENDING: S++, CDATA_ENDING_2: S++, PROC_INST: S++, PROC_INST_BODY: S++, PROC_INST_ENDING: S++, OPEN_TAG: S++, OPEN_TAG_SLASH: S++, ATTRIB: S++, ATTRIB_NAME: S++, ATTRIB_NAME_SAW_WHITE: S++, ATTRIB_VALUE: S++, ATTRIB_VALUE_QUOTED: S++, ATTRIB_VALUE_CLOSED: S++, ATTRIB_VALUE_UNQUOTED: S++, ATTRIB_VALUE_ENTITY_Q: S++, ATTRIB_VALUE_ENTITY_U: S++, CLOSE_TAG: S++, CLOSE_TAG_SAW_WHITE: S++, SCRIPT: S++, SCRIPT_ENDING: S++ }; sax.ENTITIES = { "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 }; Object.keys(sax.ENTITIES).forEach(function(key) { var e = sax.ENTITIES[key]; var s = typeof e === 'number' ? String.fromCharCode(e) : e; sax.ENTITIES[key] = s; }); for (var S in sax.STATE) sax.STATE[sax.STATE[S]] = S; S = sax.STATE; function emit(parser, event, data) { parser[event] && parser[event](data); } function emitNode(parser, nodeType, data) { if (parser.textNode) closeText(parser); emit(parser, nodeType, data); } function closeText(parser) { parser.textNode = textopts(parser.opt, parser.textNode); if (parser.textNode) emit(parser, "ontext", parser.textNode); parser.textNode = ""; } function textopts(opt, text) { if (opt.trim) text = text.trim(); if (opt.normalize) text = text.replace(/\s+/g, " "); return text; } function error(parser, er) { closeText(parser); if (parser.trackPosition) { er += "\nLine: " + parser.line + "\nColumn: " + parser.column + "\nChar: " + parser.c; } er = new Error(er); parser.error = er; emit(parser, "onerror", er); return parser; } function end(parser) { if (!parser.closedRoot) strictFail(parser, "Unclosed root tag"); if ((parser.state !== S.BEGIN) && (parser.state !== S.TEXT)) error(parser, "Unexpected end"); closeText(parser); parser.c = ""; parser.closed = true; emit(parser, "onend"); SAXParser.call(parser, parser.strict, parser.opt); return parser; } function strictFail(parser, message) { if (typeof parser !== 'object' || !(parser instanceof SAXParser)) throw new Error('bad call to strictFail'); if (parser.strict) error(parser, message); } function newTag(parser) { if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase](); var parent = parser.tags[parser.tags.length - 1] || parser, tag = parser.tag = { name: parser.tagName, attributes: {} }; if (parser.opt.xmlns) tag.ns = parent.ns; parser.attribList.length = 0; } function qname(name, attribute) { var i = name.indexOf(":"), qualName = i < 0 ? ["", name] : name.split(":"), prefix = qualName[0], local = qualName[1]; if (attribute && name === "xmlns") { prefix = "xmlns"; local = ""; } return { prefix: prefix, local: local }; } function attrib(parser) { if (!parser.strict) parser.attribName = parser.attribName[parser.looseCase](); if (parser.attribList.indexOf(parser.attribName) !== -1 || parser.tag.attributes.hasOwnProperty(parser.attribName)) { return parser.attribName = parser.attribValue = ""; } if (parser.opt.xmlns) { var qn = qname(parser.attribName, true), prefix = qn.prefix, local = qn.local; if (prefix === "xmlns") { if (local === "xml" && parser.attribValue !== XML_NAMESPACE) { strictFail(parser, "xml: prefix must be bound to " + XML_NAMESPACE + "\n" + "Actual: " + parser.attribValue); } else if (local === "xmlns" && parser.attribValue !== XMLNS_NAMESPACE) { strictFail(parser, "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\n" + "Actual: " + parser.attribValue); } else { var tag = parser.tag, parent = parser.tags[parser.tags.length - 1] || parser; if (tag.ns === parent.ns) { tag.ns = Object.create(parent.ns); } tag.ns[local] = parser.attribValue; } } parser.attribList.push([parser.attribName, parser.attribValue]); } else { parser.tag.attributes[parser.attribName] = parser.attribValue; emitNode(parser, "onattribute", { name: parser.attribName, value: parser.attribValue }); } parser.attribName = parser.attribValue = ""; } function openTag(parser, selfClosing) { if (parser.opt.xmlns) { var tag = parser.tag; var qn = qname(parser.tagName); tag.prefix = qn.prefix; tag.local = qn.local; tag.uri = tag.ns[qn.prefix] || ""; if (tag.prefix && !tag.uri) { strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(parser.tagName)); tag.uri = qn.prefix; } var parent = parser.tags[parser.tags.length - 1] || parser; if (tag.ns && parent.ns !== tag.ns) { Object.keys(tag.ns).forEach(function(p) { emitNode(parser, "onopennamespace", { prefix: p, uri: tag.ns[p] }); }); } for (var i = 0, l = parser.attribList.length; i < l; i++) { var nv = parser.attribList[i]; var name = nv[0], value = nv[1], qualName = qname(name, true), prefix = qualName.prefix, local = qualName.local, uri = prefix == "" ? "" : (tag.ns[prefix] || ""), a = { name: name, value: value, prefix: prefix, local: local, uri: uri }; if (prefix && prefix != "xmlns" && !uri) { strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(prefix)); a.uri = prefix; } parser.tag.attributes[name] = a; emitNode(parser, "onattribute", a); } parser.attribList.length = 0; } parser.tag.isSelfClosing = !!selfClosing; parser.sawRoot = true; parser.tags.push(parser.tag); emitNode(parser, "onopentag", parser.tag); if (!selfClosing) { if (!parser.noscript && parser.tagName.toLowerCase() === "script") { parser.state = S.SCRIPT; } else { parser.state = S.TEXT; } parser.tag = null; parser.tagName = ""; } parser.attribName = parser.attribValue = ""; parser.attribList.length = 0; } function closeTag(parser) { if (!parser.tagName) { strictFail(parser, "Weird empty close tag."); parser.textNode += "</>"; parser.state = S.TEXT; return; } if (parser.script) { if (parser.tagName !== "script") { parser.script += "</" + parser.tagName + ">"; parser.tagName = ""; parser.state = S.SCRIPT; return; } emitNode(parser, "onscript", parser.script); parser.script = ""; } var t = parser.tags.length; var tagName = parser.tagName; if (!parser.strict) tagName = tagName[parser.looseCase](); var closeTo = tagName; while (t--) { var close = parser.tags[t]; if (close.name !== closeTo) { strictFail(parser, "Unexpected close tag"); } else break; } if (t < 0) { strictFail(parser, "Unmatched closing tag: " + parser.tagName); parser.textNode += "</" + parser.tagName + ">"; parser.state = S.TEXT; return; } parser.tagName = tagName; var s = parser.tags.length; while (s-- > t) { var tag = parser.tag = parser.tags.pop(); parser.tagName = parser.tag.name; emitNode(parser, "onclosetag", parser.tagName); var x = {}; for (var i in tag.ns) x[i] = tag.ns[i]; var parent = parser.tags[parser.tags.length - 1] || parser; if (parser.opt.xmlns && tag.ns !== parent.ns) { Object.keys(tag.ns).forEach(function(p) { var n = tag.ns[p]; emitNode(parser, "onclosenamespace", { prefix: p, uri: n }); }); } } if (t === 0) parser.closedRoot = true; parser.tagName = parser.attribValue = parser.attribName = ""; parser.attribList.length = 0; parser.state = S.TEXT; } function parseEntity(parser) { var entity = parser.entity, entityLC = entity.toLowerCase(), num, numStr = ""; if (parser.ENTITIES[entity]) return parser.ENTITIES[entity]; if (parser.ENTITIES[entityLC]) return parser.ENTITIES[entityLC]; entity = entityLC; if (entity.charAt(0) === "#") { if (entity.charAt(1) === "x") { entity = entity.slice(2); num = parseInt(entity, 16); numStr = num.toString(16); } else { entity = entity.slice(1); num = parseInt(entity, 10); numStr = num.toString(10); } } entity = entity.replace(/^0+/, ""); if (numStr.toLowerCase() !== entity) { strictFail(parser, "Invalid character entity"); return "&" + parser.entity + ";"; } return String.fromCodePoint(num); } function write(chunk) { var parser = this; if (this.error) throw this.error; if (parser.closed) return error(parser, "Cannot write after close. Assign an onready handler."); if (chunk === null) return end(parser); var i = 0, c = ""; while (parser.c = c = chunk.charAt(i++)) { if (parser.trackPosition) { parser.position++; if (c === "\n") { parser.line++; parser.column = 0; } else parser.column++; } switch (parser.state) { case S.BEGIN: if (c === "<") { parser.state = S.OPEN_WAKA; parser.startTagPosition = parser.position; } else if (not(whitespace, c)) { strictFail(parser, "Non-whitespace before first tag."); parser.textNode = c; parser.state = S.TEXT; } continue; case S.TEXT: if (parser.sawRoot && !parser.closedRoot) { var starti = i - 1; while (c && c !== "<" && c !== "&") { c = chunk.charAt(i++); if (c && parser.trackPosition) { parser.position++; if (c === "\n") { parser.line++; parser.column = 0; } else parser.column++; } } parser.textNode += chunk.substring(starti, i - 1); } if (c === "<") { parser.state = S.OPEN_WAKA; parser.startTagPosition = parser.position; } else { if (not(whitespace, c) && (!parser.sawRoot || parser.closedRoot)) strictFail(parser, "Text data outside of root node."); if (c === "&") parser.state = S.TEXT_ENTITY; else parser.textNode += c; } continue; case S.SCRIPT: if (c === "<") { parser.state = S.SCRIPT_ENDING; } else parser.script += c; continue; case S.SCRIPT_ENDING: if (c === "/") { parser.state = S.CLOSE_TAG; } else { parser.script += "<" + c; parser.state = S.SCRIPT; } continue; case S.OPEN_WAKA: if (c === "!") { parser.state = S.SGML_DECL; parser.sgmlDecl = ""; } else if (is(whitespace, c)) {} else if (is(nameStart, c)) { parser.state = S.OPEN_TAG; parser.tagName = c; } else if (c === "/") { parser.state = S.CLOSE_TAG; parser.tagName = ""; } else if (c === "?") { parser.state = S.PROC_INST; parser.procInstName = parser.procInstBody = ""; } else { strictFail(parser, "Unencoded <"); if (parser.startTagPosition + 1 < parser.position) { var pad = parser.position - parser.startTagPosition; c = new Array(pad).join(" ") + c; } parser.textNode += "<" + c; parser.state = S.TEXT; } continue; case S.SGML_DECL: if ((parser.sgmlDecl + c).toUpperCase() === CDATA) { emitNode(parser, "onopencdata"); parser.state = S.CDATA; parser.sgmlDecl = ""; parser.cdata = ""; } else if (parser.sgmlDecl + c === "--") { parser.state = S.COMMENT; parser.comment = ""; parser.sgmlDecl = ""; } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) { parser.state = S.DOCTYPE; if (parser.doctype || parser.sawRoot) strictFail(parser, "Inappropriately located doctype declaration"); parser.doctype = ""; parser.sgmlDecl = ""; } else if (c === ">") { emitNode(parser, "onsgmldeclaration", parser.sgmlDecl); parser.sgmlDecl = ""; parser.state = S.TEXT; } else if (is(quote, c)) { parser.state = S.SGML_DECL_QUOTED; parser.sgmlDecl += c; } else parser.sgmlDecl += c; continue; case S.SGML_DECL_QUOTED: if (c === parser.q) { parser.state = S.SGML_DECL; parser.q = ""; } parser.sgmlDecl += c; continue; case S.DOCTYPE: if (c === ">") { parser.state = S.TEXT; emitNode(parser, "ondoctype", parser.doctype); parser.doctype = true; } else { parser.doctype += c; if (c === "[") parser.state = S.DOCTYPE_DTD; else if (is(quote, c)) { parser.state = S.DOCTYPE_QUOTED; parser.q = c; } } continue; case S.DOCTYPE_QUOTED: parser.doctype += c; if (c === parser.q) { parser.q = ""; parser.state = S.DOCTYPE; } continue; case S.DOCTYPE_DTD: parser.doctype += c; if (c === "]") parser.state = S.DOCTYPE; else if (is(quote, c)) { parser.state = S.DOCTYPE_DTD_QUOTED; parser.q = c; } continue; case S.DOCTYPE_DTD_QUOTED: parser.doctype += c; if (c === parser.q) { parser.state = S.DOCTYPE_DTD; parser.q = ""; } continue; case S.COMMENT: if (c === "-") parser.state = S.COMMENT_ENDING; else parser.comment += c; continue; case S.COMMENT_ENDING: if (c === "-") { parser.state = S.COMMENT_ENDED; parser.comment = textopts(parser.opt, parser.comment); if (parser.comment) emitNode(parser, "oncomment", parser.comment); parser.comment = ""; } else { parser.comment += "-" + c; parser.state = S.COMMENT; } continue; case S.COMMENT_ENDED: if (c !== ">") { strictFail(parser, "Malformed comment"); parser.comment += "--" + c; parser.state = S.COMMENT; } else parser.state = S.TEXT; continue; case S.CDATA: if (c === "]") parser.state = S.CDATA_ENDING; else parser.cdata += c; continue; case S.CDATA_ENDING: if (c === "]") parser.state = S.CDATA_ENDING_2; else { parser.cdata += "]" + c; parser.state = S.CDATA; } continue; case S.CDATA_ENDING_2: if (c === ">") { if (parser.cdata) emitNode(parser, "oncdata", parser.cdata); emitNode(parser, "onclosecdata"); parser.cdata = ""; parser.state = S.TEXT; } else if (c === "]") { parser.cdata += "]"; } else { parser.cdata += "]]" + c; parser.state = S.CDATA; } continue; case S.PROC_INST: if (c === "?") parser.state = S.PROC_INST_ENDING; else if (is(whitespace, c)) parser.state = S.PROC_INST_BODY; else parser.procInstName += c; continue; case S.PROC_INST_BODY: if (!parser.procInstBody && is(whitespace, c)) continue; else if (c === "?") parser.state = S.PROC_INST_ENDING; else parser.procInstBody += c; continue; case S.PROC_INST_ENDING: if (c === ">") { emitNode(parser, "onprocessinginstruction", { name: parser.procInstName, body: parser.procInstBody }); parser.procInstName = parser.procInstBody = ""; parser.state = S.TEXT; } else { parser.procInstBody += "?" + c; parser.state = S.PROC_INST_BODY; } continue; case S.OPEN_TAG: if (is(nameBody, c)) parser.tagName += c; else { newTag(parser); if (c === ">") openTag(parser); else if (c === "/") parser.state = S.OPEN_TAG_SLASH; else { if (not(whitespace, c)) strictFail(parser, "Invalid character in tag name"); parser.state = S.ATTRIB; } } continue; case S.OPEN_TAG_SLASH: if (c === ">") { openTag(parser, true); closeTag(parser); } else { strictFail(parser, "Forward-slash in opening tag not followed by >"); parser.state = S.ATTRIB; } continue; case S.ATTRIB: if (is(whitespace, c)) continue; else if (c === ">") openTag(parser); else if (c === "/") parser.state = S.OPEN_TAG_SLASH; else if (is(nameStart, c)) { parser.attribName = c; parser.attribValue = ""; parser.state = S.ATTRIB_NAME; } else strictFail(parser, "Invalid attribute name"); continue; case S.ATTRIB_NAME: if (c === "=") parser.state = S.ATTRIB_VALUE; else if (c === ">") { strictFail(parser, "Attribute without value"); parser.attribValue = parser.attribName; attrib(parser); openTag(parser); } else if (is(whitespace, c)) parser.state = S.ATTRIB_NAME_SAW_WHITE; else if (is(nameBody, c)) parser.attribName += c; else strictFail(parser, "Invalid attribute name"); continue; case S.ATTRIB_NAME_SAW_WHITE: if (c === "=") parser.state = S.ATTRIB_VALUE; else if (is(whitespace, c)) continue; else { strictFail(parser, "Attribute without value"); parser.tag.attributes[parser.attribName] = ""; parser.attribValue = ""; emitNode(parser, "onattribute", { name: parser.attribName, value: "" }); parser.attribName = ""; if (c === ">") openTag(parser); else if (is(nameStart, c)) { parser.attribName = c; parser.state = S.ATTRIB_NAME; } else { strictFail(parser, "Invalid attribute name"); parser.state = S.ATTRIB; } } continue; case S.ATTRIB_VALUE: if (is(whitespace, c)) continue; else if (is(quote, c)) { parser.q = c; parser.state = S.ATTRIB_VALUE_QUOTED; } else { strictFail(parser, "Unquoted attribute value"); parser.state = S.ATTRIB_VALUE_UNQUOTED; parser.attribValue = c; } continue; case S.ATTRIB_VALUE_QUOTED: if (c !== parser.q) { if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_Q; else parser.attribValue += c; continue; } attrib(parser); parser.q = ""; parser.state = S.ATTRIB_VALUE_CLOSED; continue; case S.ATTRIB_VALUE_CLOSED: if (is(whitespace, c)) { parser.state = S.ATTRIB; } else if (c === ">") openTag(parser); else if (c === "/") parser.state = S.OPEN_TAG_SLASH; else if (is(nameStart, c)) { strictFail(parser, "No whitespace between attributes"); parser.attribName = c; parser.attribValue = ""; parser.state = S.ATTRIB_NAME; } else strictFail(parser, "Invalid attribute name"); continue; case S.ATTRIB_VALUE_UNQUOTED: if (not(attribEnd, c)) { if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_U; else parser.attribValue += c; continue; } attrib(parser); if (c === ">") openTag(parser); else parser.state = S.ATTRIB; continue; case S.CLOSE_TAG: if (!parser.tagName) { if (is(whitespace, c)) continue; else if (not(nameStart, c)) { if (parser.script) { parser.script += "</" + c; parser.state = S.SCRIPT; } else { strictFail(parser, "Invalid tagname in closing tag."); } } else parser.tagName = c; } else if (c === ">") closeTag(parser); else if (is(nameBody, c)) parser.tagName += c; else if (parser.script) { parser.script += "</" + parser.tagName; parser.tagName = ""; parser.state = S.SCRIPT; } else { if (not(whitespace, c)) strictFail(parser, "Invalid tagname in closing tag"); parser.state = S.CLOSE_TAG_SAW_WHITE; } continue; case S.CLOSE_TAG_SAW_WHITE: if (is(whitespace, c)) continue; if (c === ">") closeTag(parser); else strictFail(parser, "Invalid characters in closing tag"); continue; case S.TEXT_ENTITY: case S.ATTRIB_VALUE_ENTITY_Q: case S.ATTRIB_VALUE_ENTITY_U: switch (parser.state) { case S.TEXT_ENTITY: var returnState = S.TEXT, buffer = "textNode"; break; case S.ATTRIB_VALUE_ENTITY_Q: var returnState = S.ATTRIB_VALUE_QUOTED, buffer = "attribValue"; break; case S.ATTRIB_VALUE_ENTITY_U: var returnState = S.ATTRIB_VALUE_UNQUOTED, buffer = "attribValue"; break; } if (c === ";") { parser[buffer] += parseEntity(parser); parser.entity = ""; parser.state = returnState; } else if (is(entity, c)) parser.entity += c; else { strictFail(parser, "Invalid character entity"); parser[buffer] += "&" + parser.entity + c; parser.entity = ""; parser.state = returnState; } continue; default: throw new Error(parser, "Unknown state: " + parser.state); } } if (parser.position >= parser.bufferCheckPosition) checkBufferLength(parser); return parser; } if (!String.fromCodePoint) { (function() { var stringFromCharCode = String.fromCharCode; var floor = Math.floor; var fromCodePoint = function() { var MAX_SIZE = 0x4000; var codeUnits = []; var highSurrogate; var lowSurrogate; var index = -1; var length = arguments.length; if (!length) { return ''; } var result = ''; while (++index < length) { var codePoint = Number(arguments[index]); if (!isFinite(codePoint) || codePoint < 0 || codePoint > 0x10FFFF || floor(codePoint) != codePoint) { throw RangeError('Invalid code point: ' + codePoint); } if (codePoint <= 0xFFFF) { codeUnits.push(codePoint); } else { codePoint -= 0x10000; highSurrogate = (codePoint >> 10) + 0xD800; lowSurrogate = (codePoint % 0x400) + 0xDC00; codeUnits.push(highSurrogate, lowSurrogate); } if (index + 1 == length || codeUnits.length > MAX_SIZE) { result += stringFromCharCode.apply(null, codeUnits); codeUnits.length = 0; } } return result; }; if (Object.defineProperty) { Object.defineProperty(String, 'fromCodePoint', { 'value': fromCodePoint, 'configurable': true, 'writable': true }); } else { String.fromCodePoint = fromCodePoint; } }()); } })(typeof exports === "undefined" ? sax = {} : exports); })(require("github:jspm/nodelibs-buffer@0.1.0.js").Buffer, require("github:jspm/nodelibs-process@0.1.1.js")); global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4/lib/index.js", ["npm:lodash@3.9.3/object/assign.js", "npm:xmlbuilder@2.6.4/lib/XMLBuilder.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function() { var XMLBuilder, assign; assign = require("npm:lodash@3.9.3/object/assign.js"); XMLBuilder = require("npm:xmlbuilder@2.6.4/lib/XMLBuilder.js"); module.exports.create = function(name, xmldec, doctype, options) { options = assign({}, xmldec, doctype, options); return new XMLBuilder(name, options).root(); }; }).call(this); global.define = __define; return module.exports; }); System.registerDynamic("npm:sax@0.6.1.js", ["npm:sax@0.6.1/lib/sax.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:sax@0.6.1/lib/sax.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:xmlbuilder@2.6.4.js", ["npm:xmlbuilder@2.6.4/lib/index.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:xmlbuilder@2.6.4/lib/index.js"); global.define = __define; return module.exports; }); System.registerDynamic("npm:xml2js@0.4.9/lib/xml2js.js", ["npm:sax@0.6.1.js", "github:jspm/nodelibs-events@0.1.1.js", "npm:xmlbuilder@2.6.4.js", "npm:xml2js@0.4.9/lib/bom.js", "npm:xml2js@0.4.9/lib/processors.js", "github:jspm/nodelibs-process@0.1.1.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; (function(process) { (function() { var bom, builder, escapeCDATA, events, isEmpty, processName, processors, requiresCDATA, sax, wrapCDATA, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty, bind = function(fn, me) { return function() { return fn.apply(me, arguments); }; }; sax = require("npm:sax@0.6.1.js"); events = require("github:jspm/nodelibs-events@0.1.1.js"); builder = require("npm:xmlbuilder@2.6.4.js"); bom = require("npm:xml2js@0.4.9/lib/bom.js"); processors = require("npm:xml2js@0.4.9/lib/processors.js"); isEmpty = function(thing) { return typeof thing === "object" && (thing != null) && Object.keys(thing).length === 0; }; processName = function(processors, processedName) { var i, len, process; for (i = 0, len = processors.length; i < len; i++) { process = processors[i]; processedName = process(processedName); } return processedName; }; requiresCDATA = function(entry) { return entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0; }; wrapCDATA = function(entry) { return "<![CDATA[" + (escapeCDATA(entry)) + "]]>"; }; escapeCDATA = function(entry) { return entry.replace(']]>', ']]]]><![CDATA[>'); }; exports.processors = processors; exports.defaults = { "0.1": { explicitCharkey: false, trim: true, normalize: true, normalizeTags: false, attrkey: "@", charkey: "#", explicitArray: false, ignoreAttrs: false, mergeAttrs: false, explicitRoot: false, validator: null, xmlns: false, explicitChildren: false, childkey: '@@', charsAsChildren: false, async: false, strict: true, attrNameProcessors: null, tagNameProcessors: null, valueProcessors: null, emptyTag: '' }, "0.2": { explicitCharkey: false, trim: false, normalize: false, normalizeTags: false, attrkey: "$", charkey: "_", explicitArray: true, ignoreAttrs: false, mergeAttrs: false, explicitRoot: true, validator: null, xmlns: false, explicitChildren: false, preserveChildrenOrder: false, childkey: '$$', charsAsChildren: false, async: false, strict: true, attrNameProcessors: null, tagNameProcessors: null, valueProcessors: null, rootName: 'root', xmldec: { 'version': '1.0', 'encoding': 'UTF-8', 'standalone': true }, doctype: null, renderOpts: { 'pretty': true, 'indent': ' ', 'newline': '\n' }, headless: false, chunkSize: 10000, emptyTag: '', cdata: false } }; exports.ValidationError = (function(superClass) { extend(ValidationError, superClass); function ValidationError(message) { this.message = message; } return ValidationError; })(Error); exports.Builder = (function() { function Builder(opts) { var key, ref, value; this.options = {}; ref = exports.defaults["0.2"]; for (key in ref) { if (!hasProp.call(ref, key)) continue; value = ref[key]; this.options[key] = value; } for (key in opts) { if (!hasProp.call(opts, key)) continue; value = opts[key]; this.options[key] = value; } } Builder.prototype.buildObject = function(rootObj) { var attrkey, charkey, render, rootElement, rootName; attrkey = this.options.attrkey; charkey = this.options.charkey; if ((Object.keys(rootObj).length === 1) && (this.options.rootName === exports.defaults['0.2'].rootName)) { rootName = Object.keys(rootObj)[0]; rootObj = rootObj[rootName]; } else { rootName = this.options.rootName; } render = (function(_this) { return function(element, obj) { var attr, child, entry, index, key, value; if (typeof obj !== 'object') { if (_this.options.cdata && requiresCDATA(obj)) { element.raw(wrapCDATA(obj)); } else { element.txt(obj); } } else { for (key in obj) { if (!hasProp.call(obj, key)) continue; child = obj[key]; if (key === attrkey) { if (typeof child === "object") { for (attr in child) { value = child[attr]; element = element.att(attr, value); } } } else if (key === charkey) { if (_this.options.cdata && requiresCDATA(child)) { element = element.raw(wrapCDATA(child)); } else { element = element.txt(child); } } else if (Array.isArray(child)) { for (index in child) { if (!hasProp.call(child, index)) continue; entry = child[index]; if (typeof entry === 'string') { if (_this.options.cdata && requiresCDATA(entry)) { element = element.ele(key).raw(wrapCDATA(entry)).up(); } else { element = element.ele(key, entry).up(); } } else { element = arguments.callee(element.ele(key), entry).up(); } } } else if (typeof child === "object") { element = arguments.callee(element.ele(key), child).up(); } else { if (typeof child === 'string' && _this.options.cdata && requiresCDATA(child)) { element = element.ele(key).raw(wrapCDATA(child)).up(); } else { element = element.ele(key, child.toString()).up(); } } } } return element; }; })(this); rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, {headless: this.options.headless}); return render(rootElement, rootObj).end(this.options.renderOpts); }; return Builder; })(); exports.Parser = (function(superClass) { extend(Parser, superClass); function Parser(opts) { this.parseString = bind(this.parseString, this); this.reset = bind(this.reset, this); this.assignOrPush = bind(this.assignOrPush, this); this.processAsync = bind(this.processAsync, this); var key, ref, value; if (!(this instanceof exports.Parser)) { return new exports.Parser(opts); } this.options = {}; ref = exports.defaults["0.2"]; for (key in ref) { if (!hasProp.call(ref, key)) continue; value = ref[key]; this.options[key] = value; } for (key in opts) { if (!hasProp.call(opts, key)) continue; value = opts[key]; this.options[key] = value; } if (this.options.xmlns) { this.options.xmlnskey = this.options.attrkey + "ns"; } if (this.options.normalizeTags) { if (!this.options.tagNameProcessors) { this.options.tagNameProcessors = []; } this.options.tagNameProcessors.unshift(processors.normalize); } this.reset(); } Parser.prototype.processAsync = function() { var chunk; if (this.remaining.length <= this.options.chunkSize) { chunk = this.remaining; this.remaining = ''; this.saxParser = this.saxParser.write(chunk); return this.saxParser.close(); } else { chunk = this.remaining.substr(0, this.options.chunkSize); this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length); this.saxParser = this.saxParser.write(chunk); return setImmediate(this.processAsync); } }; Parser.prototype.assignOrPush = function(obj, key, newValue) { if (!(key in obj)) { if (!this.options.explicitArray) { return obj[key] = newValue; } else { return obj[key] = [newValue]; } } else { if (!(obj[key] instanceof Array)) { obj[key] = [obj[key]]; } return obj[key].push(newValue); } }; Parser.prototype.reset = function() { var attrkey, charkey, ontext, stack; this.removeAllListeners(); this.saxParser = sax.parser(this.options.strict, { trim: false, normalize: false, xmlns: this.options.xmlns }); this.saxParser.errThrown = false; this.saxParser.onerror = (function(_this) { return function(error) { _this.saxParser.resume(); if (!_this.saxParser.errThrown) { _this.saxParser.errThrown = true; return _this.emit("error", error); } }; })(this); this.saxParser.ended = false; this.EXPLICIT_CHARKEY = this.options.explicitCharkey; this.resultObject = null; stack = []; attrkey = this.options.attrkey; charkey = this.options.charkey; this.saxParser.onopentag = (function(_this) { return function(node) { var key, newValue, obj, processedKey, ref; obj = {}; obj[charkey] = ""; if (!_this.options.ignoreAttrs) { ref = node.attributes; for (key in ref) { if (!hasProp.call(ref, key)) continue; if (!(attrkey in obj) && !_this.options.mergeAttrs) { obj[attrkey] = {}; } newValue = node.attributes[key]; processedKey = _this.options.attrNameProcessors ? processName(_this.options.attrNameProcessors, key) : key; if (_this.options.mergeAttrs) { _this.assignOrPush(obj, processedKey, newValue); } else { obj[attrkey][processedKey] = newValue; } } } obj["#name"] = _this.options.tagNameProcessors ? processName(_this.options.tagNameProcessors, node.name) : node.name; if (_this.options.xmlns) { obj[_this.options.xmlnskey] = { uri: node.uri, local: node.local }; } return stack.push(obj); }; })(this); this.saxParser.onclosetag = (function(_this) { return function() { var cdata, emptyStr, err, key, node, nodeName, obj, objClone, old, s, xpath; obj = stack.pop(); nodeName = obj["#name"]; if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) { delete obj["#name"]; } if (obj.cdata === true) { cdata = obj.cdata; delete obj.cdata; } s = stack[stack.length - 1]; if (obj[charkey].match(/^\s*$/) && !cdata) { emptyStr = obj[charkey]; delete obj[charkey]; } else { if (_this.options.trim) { obj[charkey] = obj[charkey].trim(); } if (_this.options.normalize) { obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim(); } obj[charkey] = _this.options.valueProcessors ? processName(_this.options.valueProcessors, obj[charkey]) : obj[charkey]; if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) { obj = obj[charkey]; } } if (isEmpty(obj)) { obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr; } if (_this.options.validator != null) { xpath = "/" + ((function() { var i, len, results; results = []; for (i = 0, len = stack.length; i < len; i++) { node = stack[i]; results.push(node["#name"]); } return results; })()).concat(nodeName).join("/"); try { obj = _this.options.validator(xpath, s && s[nodeName], obj); } catch (_error) { err = _error; _this.emit("error", err); } } if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === 'object') { if (!_this.options.preserveChildrenOrder) { node = {}; if (_this.options.attrkey in obj) { node[_this.options.attrkey] = obj[_this.options.attrkey]; delete obj[_this.options.attrkey]; } if (!_this.options.charsAsChildren && _this.options.charkey in obj) { node[_this.options.charkey] = obj[_this.options.charkey]; delete obj[_this.options.charkey]; } if (Object.getOwnPropertyNames(obj).length > 0) { node[_this.options.childkey] = obj; } obj = node; } else if (s) { s[_this.options.childkey] = s[_this.options.childkey] || []; objClone = {}; for (key in obj) { if (!hasProp.call(obj, key)) continue; objClone[key] = obj[key]; } s[_this.options.childkey].push(objClone); delete obj["#name"]; if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) { obj = obj[charkey]; } } } if (stack.length > 0) { return _this.assignOrPush(s, nodeName, obj); } else { if (_this.options.explicitRoot) { old = obj; obj = {}; obj[nodeName] = old; } _this.resultObject = obj; _this.saxParser.ended = true; return _this.emit("end", _this.resultObject); } }; })(this); ontext = (function(_this) { return function(text) { var charChild, s; s = stack[stack.length - 1]; if (s) { s[charkey] += text; if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && text.replace(/\\n/g, '').trim() !== '') { s[_this.options.childkey] = s[_this.options.childkey] || []; charChild = {'#name': '__text__'}; charChild[charkey] = text; s[_this.options.childkey].push(charChild); } return s; } }; })(this); this.saxParser.ontext = ontext; return this.saxParser.oncdata = (function(_this) { return function(text) { var s; s = ontext(text); if (s) { return s.cdata = true; } }; })(this); }; Parser.prototype.parseString = function(str, cb) { var err; if ((cb != null) && typeof cb === "function") { this.on("end", function(result) { this.reset(); return cb(null, result); }); this.on("error", function(err) { this.reset(); return cb(err); }); } str = str.toString(); if (str.trim() === '') { this.emit("end", null); return true; } try { str = bom.stripBOM(str); if (this.options.async) { this.remaining = str; setImmediate(this.processAsync); this.saxParser; } return this.saxParser.write(str).close(); } catch (_error) { err = _error; if (!(this.saxParser.errThrown || this.saxParser.ended)) { this.emit('error', err); return this.saxParser.errThrown = true; } else if (this.saxParser.ended) { throw err; } } }; return Parser; })(events.EventEmitter); exports.parseString = function(str, a, b) { var cb, options, parser; if (b != null) { if (typeof b === 'function') { cb = b; } if (typeof a === 'object') { options = a; } } else { if (typeof a === 'function') { cb = a; } options = {}; } parser = new exports.Parser(options); return parser.parseString(str, cb); }; }).call(this); })(require("github:jspm/nodelibs-process@0.1.1.js")); global.define = __define; return module.exports; }); System.registerDynamic("npm:xml2js@0.4.9.js", ["npm:xml2js@0.4.9/lib/xml2js.js"], true, function(require, exports, module) { var global = this, __define = global.define; global.define = undefined; module.exports = require("npm:xml2js@0.4.9/lib/xml2js.js"); global.define = __define; return module.exports; }); System.register("github:Bizboard/arva-utils@master/ObjectHelper.js", ["npm:lodash@3.9.3.js"], function($__export) { "use strict"; var __moduleName = "github:Bizboard/arva-utils@master/ObjectHelper.js"; var _, ObjectHelper; return { setters: [function($__m) { _ = $__m.default; }], execute: function() { ObjectHelper = function() { function ObjectHelper() {} return ($traceurRuntime.createClass)(ObjectHelper, {}, { hideMethodsAndPrivatePropertiesFromObject: function(object) { for (var propName in object) { var prototype = Object.getPrototypeOf(object); var descriptor = prototype ? Object.getOwnPropertyDescriptor(prototype, propName) : undefined; if (descriptor && (descriptor.get || descriptor.set) && !propName.startsWith('_')) { continue; } var property = object[propName]; if (typeof property === 'function' || propName.startsWith('_')) { ObjectHelper.hidePropertyFromObject(object, propName); } } }, hideMethodsFromObject: function(object) { for (var propName in object) { var property = object[propName]; if (typeof property === 'function') { ObjectHelper.hidePropertyFromObject(object, propName); } } }, hidePropertyFromObject: function(object, propName) { var prototype = object; var descriptor = Object.getOwnPropertyDescriptor(object, propName); while (!descriptor) { prototype = Object.getPrototypeOf(prototype); if (prototype.constructor.name === 'Object' || prototype.constructor.name === 'Array') { return; } descriptor = Object.getOwnPropertyDescriptor(prototype, propName); } descriptor.enumerable = false; Object.defineProperty(prototype, propName, descriptor); Object.defineProperty(object, propName, descriptor); }, hideAllPropertiesFromObject: function(object) { for (var propName in object) { ObjectHelper.hidePropertyFromObject(object, propName); } }, addHiddenPropertyToObject: function(object, propName, prop) { var writable = arguments[3] !== (void 0) ? arguments[3] : true; var useAccessors = arguments[4] !== (void 0) ? arguments[4] : true; return ObjectHelper.addPropertyToObject(object, propName, prop, false, writable, undefined, useAccessors); }, addPropertyToObject: function(object, propName, prop) { var enumerable = arguments[3] !== (void 0) ? arguments[3] : true; var writable = arguments[4] !== (void 0) ? arguments[4] : true; var setCallback = arguments[5] !== (void 0) ? arguments[5] : null; var useAccessors = arguments[6] !== (void 0) ? arguments[6] : true; if (!writable || !useAccessors) { var descriptor = { enumerable: enumerable, writable: writable, value: prop }; Object.defineProperty(object, propName, descriptor); } else { ObjectHelper.addGetSetPropertyWithShadow(object, propName, prop, enumerable, writable, setCallback); } }, addGetSetPropertyWithShadow: function(object, propName, prop) { var enumerable = arguments[3] !== (void 0) ? arguments[3] : true; var writable = arguments[4] !== (void 0) ? arguments[4] : true; var setCallback = arguments[5] !== (void 0) ? arguments[5] : null; ObjectHelper.buildPropertyShadow(object, propName, prop); ObjectHelper.buildGetSetProperty(object, propName, enumerable, writable, setCallback); }, buildPropertyShadow: function(object, propName, prop) { var shadow = {}; try { if ('shadow' in object) { shadow = object.shadow; } } catch (error) { return; } shadow[propName] = prop; Object.defineProperty(object, 'shadow', { writable: true, configurable: true, enumerable: false, value: shadow }); }, buildGetSetProperty: function(object, propName) { var enumerable = arguments[2] !== (void 0) ? arguments[2] : true; var writable = arguments[3] !== (void 0) ? arguments[3] : true; var setCallback = arguments[4] !== (void 0) ? arguments[4] : null; var descriptor = { enumerable: enumerable, configurable: true, get: function() { return object.shadow[propName]; }, set: function(value) { if (writable) { object.shadow[propName] = value; if (setCallback && typeof setCallback === 'function') { setCallback({ propertyName: propName, newValue: value }); } } else { throw new ReferenceError('Attempted to write to non-writable property ' + propName + '.'); } } }; Object.defineProperty(object, propName, descriptor); }, bindAllMethods: function(object, bindTarget) { var methodNames = ObjectHelper.getMethodNames(object); methodNames.forEach(function(name) { object[name] = object[name].bind(bindTarget); }); }, getMethodNames: function(object) { var methodNames = arguments[1] !== (void 0) ? arguments[1] : []; var propNames = Object.getOwnPropertyNames(object).filter(function(c) { return typeof object[c] === 'function'; }); methodNames = methodNames.concat(propNames); var prototype = Object.getPrototypeOf(object); if (prototype.constructor.name !== 'Object' && prototype.constructor.name !== 'Array') { return ObjectHelper.getMethodNames(prototype, methodNames); } return methodNames; }, getEnumerableProperties: function(object) { return ObjectHelper.getPrototypeEnumerableProperties(object, object); }, getPrototypeEnumerableProperties: function(rootObject, prototype) { var result = {}; var propNames = Object.keys(prototype); var $__4 = true; var $__5 = false; var $__6 = undefined; try { for (var $__2 = void 0, $__1 = (propNames.values())[$traceurRuntime.toProperty(Symbol.iterator)](); !($__4 = ($__2 = $__1.next()).done); $__4 = true) { var name = $__2.value; { var value = rootObject[name]; if (value !== null && value !== undefined && typeof value !== 'function') { if (typeof value === 'object') { result[name] = ObjectHelper.getEnumerableProperties(value); } else { result[name] = value; } } } } } catch ($__7) { $__5 = true; $__6 = $__7; } finally { try { if (!$__4 && $__1.return != null) { $__1.return(); } } finally { if ($__5) { throw $__6; } } } var descriptorNames = Object.getOwnPropertyNames(prototype); descriptorNames = descriptorNames.filter(function(name) { return propNames.indexOf(name) < 0; }); var $__11 = true; var $__12 = false; var $__13 = undefined; try { for (var $__9 = void 0, $__8 = (descriptorNames.values())[$traceurRuntime.toProperty(Symbol.iterator)](); !($__11 = ($__9 = $__8.next()).done); $__11 = true) { var name$__15 = $__9.value; { var descriptor = Object.getOwnPropertyDescriptor(prototype, name$__15); if (descriptor && descriptor.enumerable) { var value$__16 = rootObject[name$__15]; if (value$__16 !== null && value$__16 !== undefined && typeof value$__16 !== 'function') { if (typeof value$__16 === 'object') { result[name$__15] = ObjectHelper.getEnumerableProperties(value$__16); } else { result[name$__15] = value$__16; } } } } } } catch ($__14) { $__12 = true; $__13 = $__14; } finally { try { if (!$__11 && $__8.return != null) { $__8.return(); } } finally { if ($__12) { throw $__13; } } } var superPrototype = Object.getPrototypeOf(prototype); var ignorableTypes = ['Object', 'Array', 'EventEmitter']; if (ignorableTypes.indexOf(superPrototype.constructor.name) === -1) { var prototypeEnumerables = ObjectHelper.getPrototypeEnumerableProperties(rootObject, superPrototype); _.merge(result, prototypeEnumerables); } return result; } }); }(); $__export("ObjectHelper", ObjectHelper); } }; }); System.register("github:Bizboard/arva-utils@master/request/RequestClient.js", [], function($__export) { "use strict"; var __moduleName = "github:Bizboard/arva-utils@master/request/RequestClient.js"; function GetRequest(url) { return new Promise(function(resolve, reject) { var req = new XMLHttpRequest(); req.open('GET', url, true); req.onload = function() { if (req.status === 200) { resolve(req.response); } else { reject(Error(req.statusText)); } }; req.onerror = function() { reject(Error('Network Error')); }; req.send(); }); } function PostRequest(options) { if (!options) { options = {}; } if (!options.headers) { options.headers = new Map(); } if (!options.data) { options.data = ''; } return new Promise(function(resolve, reject) { var req = new XMLHttpRequest(); req.open('POST', options.url, true); var $__3 = true; var $__4 = false; var $__5 = undefined; try { for (var $__1 = void 0, $__0 = (options.headers.entries())[$traceurRuntime.toProperty(Symbol.iterator)](); !($__3 = ($__1 = $__0.next()).done); $__3 = true) { var entry = $__1.value; req.setRequestHeader(entry[0], entry[1]); } } catch ($__6) { $__4 = true; $__5 = $__6; } finally { try { if (!$__3 && $__0.return != null) { $__0.return(); } } finally { if ($__4) { throw $__5; } } } req.onload = function() { if (req.status === 200) { var responseDate = req.getResponseHeader('Date'); resolve({ response: req.response, timestamp: responseDate }); } else { reject(Error(req.statusText)); } }; req.onerror = function() { reject(Error('Network Error')); }; req.send(options.data); }); } function ExistsRequest(url) { var req = new XMLHttpRequest(); req.open('OPTIONS', url, false); req.send(); return req.status !== 404; } $__export("GetRequest", GetRequest); $__export("PostRequest", PostRequest); $__export("ExistsRequest", ExistsRequest); return { setters: [], execute: function() { } }; }); System.register("github:Bizboard/arva-utils@master/request/XmlParser.js", [], function($__export) { "use strict"; var __moduleName = "github:Bizboard/arva-utils@master/request/XmlParser.js"; function ParseStringToXml(text) { try { var xml = null; if (window.DOMParser) { var parser = new DOMParser(); xml = parser.parseFromString(text, 'text/xml'); var found = xml.getElementsByTagName('parsererror'); if (!found || !found.length || !found[0].childNodes.length) { return xml; } return null; } else { if (typeof ActiveXObject !== 'function') { var ActiveXObject = function() {}; } xml = new ActiveXObject('Microsoft.XMLDOM'); xml.async = false; xml.loadXML(text); return xml; } } catch (e) { console.log('Error parsing the string to xml.'); } } $__export("ParseStringToXml", ParseStringToXml); return { setters: [], execute: function() { } }; }); System.register("github:Bizboard/arva-utils@master/request/UrlParser.js", [], function($__export) { "use strict"; var __moduleName = "github:Bizboard/arva-utils@master/request/UrlParser.js"; function UrlParser(url) { var e = /^([a-z][a-z0-9+.-]*):(?:\/\/((?:(?=((?:[a-z0-9-._~!$&'()*+,;=:]|%[0-9A-F]{2})*))(\3)@)?(?=(\[[0-9A-F:.]{2,}\]|(?:[a-z0-9-._~!$&'()*+,;=]|%[0-9A-F]{2})*))\5(?::(?=(\d*))\6)?)(\/(?=((?:[a-z0-9-._~!$&'()*+,;=:@\/]|%[0-9A-F]{2})*))\8)?|(\/?(?!\/)(?=((?:[a-z0-9-._~!$&'()*+,;=:@\/]|%[0-9A-F]{2})*))\10)?)(?:\?(?=((?:[a-z0-9-._~!$&'()*+,;=:@\/?]|%[0-9A-F]{2})*))\11)?(?:#(?=((?:[a-z0-9-._~!$&'()*+,;=:@\/?]|%[0-9A-F]{2})*))\12)?$/i; if (url.match(e)) { return { url: RegExp['$&'], protocol: RegExp.$1, host: RegExp.$2, path: RegExp.$8, hash: RegExp.$12 }; } else { return null; } } $__export("UrlParser", UrlParser); return { setters: [], execute: function() { } }; }); System.register("Worker/SoapClient.js", ["Worker/xmljs.js", "npm:xml2js@0.4.9.js", "npm:lodash@3.9.3.js", "github:Bizboard/arva-utils@master/ObjectHelper.js", "github:Bizboard/arva-utils@master/request/RequestClient.js", "github:Bizboard/arva-utils@master/request/XmlParser.js"], function($__export) { "use strict"; var __moduleName = "Worker/SoapClient.js"; var XML2JS, xmljs, _, ObjectHelper, PostRequest, ParseStringToXml, SoapClient; return { setters: [function($__m) { XML2JS = $__m.default; }, function($__m) { xmljs = $__m.default; }, function($__m) { _ = $__m.default; }, function($__m) { ObjectHelper = $__m.ObjectHelper; }, function($__m) { PostRequest = $__m.PostRequest; }, function($__m) { ParseStringToXml = $__m.ParseStringToXml; }], execute: function() { SoapClient = function() { function SoapClient() { ObjectHelper.bindAllMethods(this, this); ObjectHelper.hideMethodsAndPrivatePropertiesFromObject(this); ObjectHelper.hidePropertyFromObject(Object.getPrototypeOf(this), 'length'); } return ($traceurRuntime.createClass)(SoapClient, { _applySoapTemplate: function(properties) { return _.template('<?xml version="1.0" encoding="utf-8"?>' + '<soap:Envelope ' + ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' + ' xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' + ' xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' + '<soap:Body>' + '<<%= method %> xmlns="http://schemas.microsoft.com/sharepoint/soap/">' + '<%= params %>' + '</<%= method %>>' + '</soap:Body>' + '</soap:Envelope>')(properties); }, _serializeParams: function(params) { if (!params || params.length == 0) return ""; var data = {"root": params}; var creator = new XML2JS(); var payload = creator.json2xml_str(data); return payload.replace("<root>", "").replace("</root>", ""); }, _handleError: function(error) { return "Error!"; }, call: function(config) { var request; config = config || {}; request = { url: config.url, headers: config.headers, data: this._applySoapTemplate({ method: config.method, params: this._serializeParams(config.params) }) }; var context = this; return new Promise(function(resolve, reject) { PostRequest(request).then(function(soapresult) { var parseString = xmljs.parseString; parseString(soapresult.response, function(err, result) { resolve({ data: result, timestamp: soapresult.timestamp }); }); }, function(error) { reject(context._handleError(error)); }); }); } }, {}); }(); $__export("SoapClient", SoapClient); } }; }); System.register("Worker/SharePointClient.js", ["npm:lodash@3.9.3.js", "npm:eventemitter3@1.1.0.js", "Worker/SoapClient.js", "github:Bizboard/arva-utils@master/request/RequestClient.js", "github:Bizboard/arva-utils@master/request/UrlParser.js"], function($__export) { "use strict"; var __moduleName = "Worker/SharePointClient.js"; var _, EventEmitter, SoapClient, ExistsRequest, UrlParser, soapClient, window, global, tempKeys, SharePointClient; return { setters: [function($__m) { _ = $__m.default; }, function($__m) { EventEmitter = $__m.default; }, function($__m) { SoapClient = $__m.SoapClient; }, function($__m) { ExistsRequest = $__m.ExistsRequest; }, function($__m) { UrlParser = $__m.UrlParser; }], execute: function() { soapClient = new SoapClient(); window = this; global = this; tempKeys = []; SharePointClient = function($__super) { function SharePointClient(options) { $traceurRuntime.superConstructor(SharePointClient).call(this); this.settings = {}; this.interval = 3000; this.retriever = null; this.cache = []; try { var $__9 = this._intializeSettings(options), settings = $__9.settings, isChild = $__9.isChild; this.settings = settings; this._handleInit(this.settings); if (!isChild) { this._refresh(); } } catch (exception) { this.dispose(); } } return ($traceurRuntime.createClass)(SharePointClient, { get refreshTimer() { return this._refreshTimer; }, set refreshTimer(value) { this._refreshTimer = value; }, set: function(options) { return this._handleSet(options); }, remove: function(options) { return this._handleRemove(options); }, dispose: function() { clearTimeout(this.refreshTimer); }, _intializeSettings: function(args) { var url = UrlParser(args.endPoint); if (!url) throw new Error('Invalid DataSource path provided!'); var newPath = url.protocol + '://' + url.host + '/'; var pathParts = url.path.split('/'); var identifiedParts = []; var isChild = this._isChildItem(url.path); if (!isChild) { identifiedParts.unshift(pathParts.splice(pathParts.length - 1, 1)[0]); try { while (!ExistsRequest(newPath + pathParts.join('/') + '/' + this._getListService())) { identifiedParts.unshift(pathParts.splice(pathParts.length - 1, 1)[0]); } } catch (error) { console.log('SharePoint URL detection error:', error); } } else { identifiedParts[0] = pathParts[pathParts.length - 2]; identifiedParts[1] = pathParts[pathParts.length - 1]; pathParts.splice(pathParts.length - 2, 2); } if (identifiedParts.length < 1) { throw { endPoint: pathParts.join('/') + '/' + identifiedParts[0], message: 'Parameters could not be correctly extracted for polling. Assuming invalid state.' }; } else { var resultconfig = { endPoint: newPath + pathParts.join('/'), listName: identifiedParts[0], itemId: identifiedParts[1] }; if (args.query) resultconfig.query = args.query; if (args.limit) resultconfig.limit = args.limit; if (args.orderBy) resultconfig.orderBy = args.orderBy; return { settings: resultconfig, isChild: isChild }; } }, _handleInit: function(args) { if (!args.listName) return; this.retriever = this._getListItemsDefaultConfiguration(); this.retriever.url = this._parsePath(args.endPoint, this._getListService()) + ("?view=" + args.listName); this.retriever.params = { 'listName': args.listName, 'viewFields': {'ViewFields': ''}, 'queryOptions': {'QueryOptions': { 'IncludeMandatoryColumns': 'FALSE', 'ViewAttributes': {'_Scope': 'RecursiveAll'} }} }; if (args.query) { this.retriever.params.query = args.query; } if (args.orderBy) { if (this.retriever.params.query) { this.retriever.params.query.OrderBy = {"FieldRef": { "_Ascending": "TRUE", "_Name": args.orderBy }}; } else { this.retriever.params.query = {Query: {OrderBy: {"FieldRef": { "_Ascending": "TRUE", "_Name": args.orderBy }}}}; } } if (args.limit) { this.retriever.params.rowLimit = args.limit; } }, _handleSet: function(newData) { var $__0 = this; var configuration = this._updateListItemsDefaultConfiguration(); configuration.url = this._parsePath(this.settings.endPoint, this._getListService()) + ("?update=" + this.settings.listName + "}"); var fieldCollection = []; var method = ''; var isLocal = _.findIndex(tempKeys, function(key) { return key.localId == newData.id; }); if (isLocal > -1) { newData.id = tempKeys[isLocal].remoteId; } if (!newData.id && this.childID) { newData.id = this.childID; } if (newData.id) { fieldCollection.push({ "_Name": "ID", "__text": newData.id }); method = "Update"; } else { fieldCollection.push({ "_Name": "ID", "__text": 'New' }); method = 'New'; } for (var prop in newData) { var fieldValue = newData[prop]; if (prop == "id" || typeof(fieldValue) == "undefined") continue; if (prop == "priority" || prop == "_temporary-identifier") continue; if (typeof fieldValue === 'object') { if (fieldValue.id && fieldValue.value) { fieldValue = (fieldValue.id + ";#"); } else if (fieldValue.length !== undefined && fieldValue[0] && fieldValue[0].id && fieldValue[0].value) { var IDs = _.pluck(fieldValue, 'id'); fieldValue = IDs.join(';#;#'); } else { continue; } } fieldCollection.push({ "_Name": prop, "__text": fieldValue }); } configuration.params = { "listName": this.settings.listName, "updates": {"Batch": { "Method": { "Field": fieldCollection, "_ID": "1", "_Cmd": method }, "_OnError": "Continue", "_ListVersion": "1", "_ViewName": "" }} }; soapClient.call(configuration).then(function(result) { var data = $__0._getResults(result.data); if (data.length == 1) { if (newData['_temporary-identifier']) { tempKeys.push({ localId: newData['_temporary-identifier'], remoteId: data[0].id }); } var messages = $__0._updateCache(data); var $__5 = true; var $__6 = false; var $__7 = undefined; try { for (var $__3 = void 0, $__2 = (messages)[$traceurRuntime.toProperty(Symbol.iterator)](); !($__5 = ($__3 = $__2.next()).done); $__5 = true) { var message = $__3.value; { $__0.emit('message', message); } } } catch ($__8) { $__6 = true; $__7 = $__8; } finally { try { if (!$__5 && $__2.return != null) { $__2.return(); } } finally { if ($__6) { throw $__7; } } } } }, function(error) { console.log(error); }); }, _handleRemove: function(record) { var $__0 = this; var configuration = this._updateListItemsDefaultConfiguration(); configuration.url = this._parsePath(this.settings.endPoint, this._getListService()) + ("?remove=" + this.settings.listName + "}"); var fieldCollection = []; var isLocal = _.findIndex(tempKeys, function(key) { return key.localId == record.id; }); if (isLocal > -1) { record.id = tempKeys[isLocal].remoteId; } fieldCollection.push({ "_Name": "ID", "__text": record.id }); configuration.params = { "listName": this.settings.listName, "updates": {"Batch": { "Method": { "Field": fieldCollection, "_ID": '1', "_Cmd": 'Delete' }, "_OnError": 'Continue', "_ListVersion": '1', "_ViewName": '' }} }; soapClient.call(configuration).then(function() { $__0.emit('message', { event: 'child_removed', result: record }); }, function(error) { console.log(error); }); }, _updateCache: function(data) { var messages = []; var $__10 = this, $__11 = function(record) { var isLocal = _.findIndex(tempKeys, function(key) { return key.remoteId == data.id; }); if (isLocal > -1) { data[record].id = tempKeys[isLocal].localId; } var isCached = _.findIndex($__10.cache, function(item) { return data[record].id == item.id; }); if (isCached == -1) { $__10.cache.push(data[record]); var previousSiblingId = $__10.cache.length == 0 ? null : $__10.cache[$__10.cache.length - 1]; messages.push({ event: 'child_added', result: data[record], previousSiblingId: previousSiblingId ? previousSiblingId.id : null }); } else { if (!_.isEqual(data[record], $__10.cache[isCached])) { $__10.cache.splice(isCached, 1, data[record]); var previousSibling = isCached == 0 ? null : $__10.cache[isCached - 1]; messages.push({ event: 'child_changed', result: data[record], previousSiblingId: previousSibling ? previousSibling.id : null }); } } }; for (var record in data) { $__11(record); } return messages; }, _setLastUpdated: function(lastChangeToken) { this.retriever.params.changeToken = lastChangeToken; }, _refresh: function() { var $__0 = this; if (this.retriever) { soapClient.call(this.retriever).then(function(result) { var changes = result.data["soap:Envelope"]["soap:Body"][0].GetListItemChangesSinceTokenResponse[0].GetListItemChangesSinceTokenResult[0].listitems[0].Changes[0]; var lastChangedToken = changes.$.LastChangeToken; var isFirstResponse = !$__0.retriever.params.changeToken; $__0._setLastUpdated(lastChangedToken); var hasDeletions = $__0._handleDeleted(changes); var data = $__0._getResults(result.data); var messages = $__0._updateCache(data); if (hasDeletions || data.length > 0) { $__0.emit('message', { event: 'value', result: $__0.cache }); } else if (isFirstResponse) { $__0.emit('message', { event: 'value', result: null }); } var $__5 = true; var $__6 = false; var $__7 = undefined; try { for (var $__3 = void 0, $__2 = (messages)[$traceurRuntime.toProperty(Symbol.iterator)](); !($__5 = ($__3 = $__2.next()).done); $__5 = true) { var message = $__3.value; { $__0.emit('message', message); } } } catch ($__8) { $__6 = true; $__7 = $__8; } finally { try { if (!$__5 && $__2.return != null) { $__2.return(); } } finally { if ($__6) { throw $__7; } } } $__0.refreshTimer = setTimeout($__0._refresh.bind($__0), $__0.interval); }).catch(function(err) { $__0.emit('error', err); $__0.refreshTimer = setTimeout($__0._refresh.bind($__0), $__0.interval); }); } }, _handleDeleted: function(result) { var changes = result.Id || null; if (changes && changes.length > 0) { var $__12 = this, $__13 = function(change) { if (changes[change].$.ChangeType == "Delete") { var recordId = changes[change]._; var isLocal = _.findIndex(tempKeys, function(key) { return key.remoteId == recordId; }); if (isLocal > -1) { recordId = tempKeys[isLocal].localId; } var cacheItem = _.findIndex($__12.cache, function(item) { return item.id == recordId; }); $__12.emit('message', { event: 'child_removed', result: $__12.cache[cacheItem] }); $__12.cache.splice(cacheItem, 1); } }; for (var change in changes) { $__13(change); } return true; } return false; }, _getResults: function(result) { var arrayOfObjects = []; var node = null; if (result["soap:Envelope"]["soap:Body"][0].GetListItemChangesSinceTokenResponse) { node = result["soap:Envelope"]["soap:Body"][0].GetListItemChangesSinceTokenResponse[0].GetListItemChangesSinceTokenResult[0].listitems[0]["rs:data"][0]; if (node) { if (node.$.ItemCount !== '0') { for (var row in node['z:row']) { var raw = node['z:row'][row].$; var record = this._formatRecord(raw); arrayOfObjects.push(record); } } } } else if (result["soap:Envelope"]["soap:Body"][0].UpdateListItemsResponse) { var error = result["soap:Envelope"]["soap:Body"][0].UpdateListItemsResponse[0].UpdateListItemsResult[0].Results[0].Result[0].ErrorCode; if (error == '0x00000000') { node = result["soap:Envelope"]["soap:Body"][0].UpdateListItemsResponse[0].UpdateListItemsResult[0].Results[0]; if (node) { for (var row$__14 in node.Result) { var raw$__15 = node.Result[row$__14]["z:row"][0].$; var record$__16 = this._formatRecord(raw$__15); arrayOfObjects.push(record$__16); } } } } return arrayOfObjects; }, _formatRecord: function(record) { var result = {}; for (var attribute in record) { var name = attribute.replace('ows_', ''); if (name == 'xmlns:z') { continue; } var value = record[attribute]; if (value === '') { continue; } if (name == "ID") { name = "id"; result[name] = value; } else if (value.indexOf(";#") > -1) { var keys = value.split(";#"); var pairs = keys.length / 2; var assignable = pairs > 1 ? [] : {}; for (var pair = 0; pair < keys.length; pair += 2) { if (pairs > 1) assignable.push({ id: keys[pair], value: keys[pair + 1] }); else assignable = { id: keys[pair], value: keys[pair + 1] }; } result[name] = assignable; } else if (!isNaN(value)) { result[name] = parseFloat(value); } else { result[name] = value; } } return result; }, _parsePath: function() { var path = arguments[0] !== (void 0) ? arguments[0] : ''; var endPoint = arguments[1] !== (void 0) ? arguments[1] : ''; var url = UrlParser(path); if (!url) console.log('Invalid datasource path provided!'); var pathParts = url.path.split('/'); var newPath = url.protocol + '://' + url.host + '/'; for (var i = 0; i < pathParts.length; i++) newPath += pathParts[i] + '/'; newPath += endPoint; return newPath; }, _updateListItemsDefaultConfiguration: function() { return { url: '', service: 'Lists', method: 'UpdateListItems', params: '', headers: new Map([['SOAPAction', 'http://schemas.microsoft.com/sharepoint/soap/UpdateListItems'], ['Content-Type', 'text/xml']]) }; }, _getListItemsDefaultConfiguration: function() { return { url: '', service: 'Lists', method: 'GetListItemChangesSinceToken', params: '', headers: new Map([['SOAPAction', 'http://schemas.microsoft.com/sharepoint/soap/GetListItemChangesSinceToken'], ['Content-Type', 'text/xml']]) }; }, _getListService: function() { return '_vti_bin/Lists.asmx'; }, _getUserGroupService: function() { return '_vti_bin/UserGroup.asmx'; }, _isChildItem: function(path) { if (path[path.length - 1] === '/') { path = path.substring(0, path.length - 2); } var parts = path.split('/'); if (parts.length) { var lastArgument = parts[parts.length - 1]; var isNumeric = function(n) { return !isNaN(parseFloat(n)) && isFinite(n); }; if (isNumeric(lastArgument)) { this.childID = lastArgument; return true; } else { return false; } } return true; } }, {}, $__super); }(EventEmitter); $__export("SharePointClient", SharePointClient); } }; }); System.register("Worker/Manager.js", ["Worker/SharePointClient.js"], function($__export) { "use strict"; var __moduleName = "Worker/Manager.js"; var SharePointClient, clients; return { setters: [function($__m) { SharePointClient = $__m.SharePointClient; }], execute: function() { clients = {}; onmessage = function(messageEvent) { var message = messageEvent.data; var $__0 = message, subscriberID = $__0.subscriberID, operation = $__0.operation; var client = clients[subscriberID]; var clientExisted = !!client; if (!clientExisted) { client = clients[subscriberID] = new SharePointClient(message); } switch (operation) { case 'init': client.on('message', function(message) { message.subscriberID = subscriberID; postMessage(message); }); break; case 'set': client.set(message.model); if (!clientExisted) { client.dispose(); } break; case 'remove': client.remove(message.model); if (!clientExisted) { client.dispose(); } break; case 'get_cache': var cacheData = client.cache; postMessage({ subscriberID: subscriberID, event: 'cache_data', cache: cacheData }); break; } }; } }; }); }) (function(factory) { factory(); }); //# sourceMappingURL=worker.js.map
34.875888
580
0.544009
dbf67dd1c951d91524f9806ffe9a9e7396211c75
656
js
JavaScript
client/app/components/contactUs/index.js
sapir-levy/Tea-Party
7091d6a269405e35089fe161d6a8794c3044facf
[ "Apache-2.0" ]
null
null
null
client/app/components/contactUs/index.js
sapir-levy/Tea-Party
7091d6a269405e35089fe161d6a8794c3044facf
[ "Apache-2.0" ]
null
null
null
client/app/components/contactUs/index.js
sapir-levy/Tea-Party
7091d6a269405e35089fe161d6a8794c3044facf
[ "Apache-2.0" ]
null
null
null
import angular from 'angular'; import uiRouter from 'angular-ui-router'; import './contact.css'; const contactModule = angular.module('contactUs', [ uiRouter ]); class ContactController { constructor() { "ngInject" this.name = 'contactUs'; window.scrollTo(0 , 0); } } contactModule.component('contactUs', { bindings: {}, template: require('./contactUs.html'), controller: ContactController, controllerAs: 'contactUsCtrl' }); contactModule.config(($stateProvider) => { "ngInject"; $stateProvider .state('contactUs', { url: '/contact', component: 'contactUs' }); }); export default contactModule.name;
18.742857
51
0.669207
dbf824f889fb151d9c6739aae5616a0439abfbe0
731
js
JavaScript
magic.js
abdih17/Algorithms-Arrays
35b9848ef3a43c06636ad1c2fc53bfd781e00706
[ "MIT" ]
null
null
null
magic.js
abdih17/Algorithms-Arrays
35b9848ef3a43c06636ad1c2fc53bfd781e00706
[ "MIT" ]
null
null
null
magic.js
abdih17/Algorithms-Arrays
35b9848ef3a43c06636ad1c2fc53bfd781e00706
[ "MIT" ]
null
null
null
// 2. A magic index in an array A[0…n-1] is defined to be an index // such that A[i] = i. Given a sorted array of distinct integers, write // a method to find a magic index if one exists, in an array A. // FOLLOW UP: What if the values are not distinct? // Answer to follow-up => Just check for A[A[0]] with A[0] ;) // .. // Time Complexity: O(N) var found = false; var i = 1; var magic = function(arr) { for (i; i < arr.length; i++) { if (arr[i] === i) { found = true; break; } } } // # test array var arr = [1, 1, 3, 3, 4, 5, 5, 7, 7, 8, 8, 12]; // # call the function magic(arr); if (found) { console.log("Found at " + i + "th index"); } else { console.log("Nopes") }
23.580645
71
0.555404
dbf89eb51800629b3de8576dcbe532c37a806b7d
239
js
JavaScript
src/marketPlace/courseOrder.js
mnath75/LMSTEAM
9ff8c69183b77a7643bdee500fe197d4f1234ad3
[ "MIT" ]
null
null
null
src/marketPlace/courseOrder.js
mnath75/LMSTEAM
9ff8c69183b77a7643bdee500fe197d4f1234ad3
[ "MIT" ]
null
null
null
src/marketPlace/courseOrder.js
mnath75/LMSTEAM
9ff8c69183b77a7643bdee500fe197d4f1234ad3
[ "MIT" ]
null
null
null
import React, {useEffect, useState} from 'react' export default function CourseOrder() { return ( <> <div className={'container-fluid py-4 '}> </div> </> ) }
10.863636
53
0.447699
dbf8ba785fe3a86bf79f9386761e9aca3688252b
2,886
js
JavaScript
src/products/product-repo.js
ElrikSouza/pw20212tpbackend
d9de1f2d51460c3cf4f7f28bd3b7352588907931
[ "MIT" ]
null
null
null
src/products/product-repo.js
ElrikSouza/pw20212tpbackend
d9de1f2d51460c3cf4f7f28bd3b7352588907931
[ "MIT" ]
null
null
null
src/products/product-repo.js
ElrikSouza/pw20212tpbackend
d9de1f2d51460c3cf4f7f28bd3b7352588907931
[ "MIT" ]
null
null
null
import { v4 } from "uuid"; import { NotFound } from "../errors/errors.js"; import { ImagesService } from "../image-upload/images-service.js"; import { Products } from "./product.model.js"; import Sequelize from "sequelize"; const createProduct = async (product, product_img) => { let img_filename = null; if (product_img.buffer != null) { img_filename = await ImagesService.saveImage( product_img.buffer, product_img.mimeType, v4() ); } try { await Products.create({ nome: product.nome, preco: product.preco, estoque: product.estoque, img_filename, }); } catch (err) { await ImagesService.deleteImage(img_filename); throw err; } }; const getOneProductQuery = (productId, attributes) => { const query = { where: { id: productId } }; if (attributes) { query["attributes"] = attributes; } return query; }; const getOneProduct = async (productId, attributes) => { const query = getOneProductQuery(productId, attributes); const result = await Products.findOne(query); if (result == null) { throw new NotFound("Produto nao encontrado"); } return result; }; const deleteOneProduct = async (productId) => { const product = await getOneProduct(productId, ["id"]); await product.destroy(); if (product.img_filename) { ImagesService.deleteImage(product.img_filename); } }; const editableFieldsProduct = ["nome", "preco", "estoque", "img_filename"]; const mergeProduct = (original, changes) => { for (const field of editableFieldsProduct) { if (changes[field]) { original[field] = changes[field]; } } }; const updateOneProduct = async (productId, product_img, changes) => { const product = await getOneProduct(productId); if (product_img.buffer != null) { const { img_filename } = await getOneProduct(productId, ["img_filename"]); const newFilename = await ImagesService.replaceImage( img_filename, product_img.buffer, product_img.mimeType, v4() ); changes.img_filename = newFilename; } mergeProduct(product, changes); await product.save(); }; const getAllProductsQueryParams = (query) => { const queryParams = { limit: 10 }; if (query.nome) { queryParams["where"] = { nome: { [Sequelize.Op.like]: `%${query.nome}%` } }; } if (query.page) { const page = Number.parseInt(query.page); if (page < 1) { throw new BadRequest("Page deve ser um inteiro positivo"); } queryParams["offset"] = (page - 1) * 10; } return queryParams; }; const getAllProducts = async (query) => { const params = getAllProductsQueryParams(query); const { count, rows: products } = await Products.findAndCountAll(params); return { products, count }; }; export const ProductsRepo = { createProduct, getOneProduct, deleteOneProduct, updateOneProduct, getAllProducts, };
23.85124
80
0.662162
dbf94d83b1573e0df4199a9815bc51258dd24619
819
js
JavaScript
app/components/modals/change-image-modal.js
AyushSarode/open-event-frontend
0a682034737f1c0f75323eaf8bbc564aa1026b9b
[ "Apache-2.0" ]
2,913
2017-04-15T18:09:01.000Z
2022-03-31T14:40:21.000Z
app/components/modals/change-image-modal.js
AyushSarode/open-event-frontend
0a682034737f1c0f75323eaf8bbc564aa1026b9b
[ "Apache-2.0" ]
7,946
2017-04-21T17:02:37.000Z
2022-03-31T21:16:36.000Z
app/components/modals/change-image-modal.js
maheshschand/open-event-frontend
eafd0dde2545519c20c5b26fc365b97a6dc767da
[ "Apache-2.0" ]
2,401
2017-04-07T03:10:32.000Z
2022-03-26T03:08:52.000Z
import classic from 'ember-classic-decorator'; import { action } from '@ember/object'; import ModalBase from 'open-event-frontend/components/modals/modal-base'; @classic export default class ChangeImageModal extends ModalBase { isSmall = true; @action updatePlaceholder() { this.placeholder.then(placeholder => { placeholder.save() .then(() => { this.set('isOpen', false); this.notify.success(this.l10n.t('Placeholder has been saved successfully.'), { id: 'placeholder_sav' }); }) .catch(e => { console.error('Error while saving placeholder.', e); this.notify.error(this.l10n.t('An unexpected error has occurred. Placeholder not saved.'), { id: 'placeholder_err' }); }); }); } }
29.25
102
0.605617
dbfa2659c51f33fb628fbdd16c1bb61df6e4bec5
4,929
js
JavaScript
client/src/hooks/useHome.js
GabrielCarames/argview-data-visualization
6474a37db2fdd08b7e684e876b854472a5449504
[ "Apache-2.0" ]
6
2022-01-06T01:57:33.000Z
2022-01-18T08:37:53.000Z
client/src/hooks/useHome.js
GabrielCarames/argview-data-visualization
6474a37db2fdd08b7e684e876b854472a5449504
[ "Apache-2.0" ]
null
null
null
client/src/hooks/useHome.js
GabrielCarames/argview-data-visualization
6474a37db2fdd08b7e684e876b854472a5449504
[ "Apache-2.0" ]
null
null
null
import { useEffect, useState } from "react"; import useLocationWeather from "./useLocationWeather"; import useDefaultWeather from "./useDefaultWeather"; const useHome = () => { const [currentHourBAWeather, setCurrentHourBAWeather] = useState([]) useEffect(() => { checkCurrentHour() const currentBAWeather = JSON.parse(localStorage.getItem('currentHourBAWeather')) const currentHour = localStorage.getItem('currentHour') if(!currentBAWeather) askForGeoLocation() else if(currentHour < new Date().getHours()) { const userPosition = JSON.parse(localStorage.getItem('userLocation')) getFiveDaysForecast(userPosition) } else setCurrentHourBAWeather(currentBAWeather) }, []) const formatProvince = (str) => { var splitStr = str.replaceAll("_", " ").toLowerCase().split(' '); for (var i = 0; i < splitStr.length; i++) { splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1); } return splitStr.join(' '); } const askForGeoLocation = () => { navigator.geolocation.getCurrentPosition(function(position) { const coords = {coords: {latitude: position.coords.latitude, longitude: position.coords.longitude}} localStorage.setItem('userLocation', JSON.stringify(coords)) getFiveDaysForecast(position) }, () => getTodayWeatherData()); } const checkCurrentHour = () => { const card = document.getElementById('card') if(new Date().getHours() >= 18 && new Date().getHours() <= 6) card.className = 'card night' } const esDateToDayNameenDate = (esDate) => { let formatedMonth = "" if(esDate.split("/")[1] === "ENE")formatedMonth = "JAN" if(esDate.split("/")[1] === "DIC") esDate.split("/")[1] = "DEC" const formatedDate = `${esDate.split("/")[0]}/${formatedMonth}/${esDate.split("/")[2]}` return new Date(formatedDate).toLocaleString('es-ar', {weekday:'long'}) } const esDateToDayAndMonthhenDate = (esDate) => { const formatedDate = `${esDate.split("/")[0]}/${esDate.split("/")[1]}` return formatedDate } const currentHourLocationsFilter = (weather) => { const currentHour = new Date().getHours() let currentHourWeather = [] weather.forEach((item, id) => { const hour = item.hour.replace('Hs','') if(hour > (currentHour - 2) && hour < (currentHour + 2)) { currentHourWeather.push(weather[id]) } }) return currentHourWeather } const currentDayLocationsFilter = (weather) => { let currentDayWeather = [] let currentDay = new Date().getDate() if(currentDay.length === 1) currentDay = "0" + currentDay weather.forEach((item) => { if(JSON.parse(item.date.split("/")[0]) === currentDay) { currentDayWeather.push(item) } }) return currentDayWeather } const filterUserLocationWeather = (userLocationWeather, weather) => { const currentDayWeather = currentDayLocationsFilter(userLocationWeather) const currentHourWeather = currentHourLocationsFilter(userLocationWeather) localStorage.setItem('currentHourBAWeather', JSON.stringify(currentHourWeather)) localStorage.setItem('currentDayBAWeather', JSON.stringify(currentDayWeather)) localStorage.setItem('BAWeather', JSON.stringify(userLocationWeather)) localStorage.setItem('weather', JSON.stringify(weather)) localStorage.setItem('currentHour', new Date().getHours()) setCurrentHourBAWeather(currentHourWeather) } const csvFiveDaysWeatherToArray = (string) => { const csv = string.split("\n") delete csv[0] const json = [] for (let [_, value] of Object.entries(csv)) { var data_splitted = value.split(",") var content = {} content["station_name"] = data_splitted[0] content["date"] = data_splitted[1] content["hour"] = data_splitted[2] content["temperature"] = data_splitted[3] content["wind_direction"] = data_splitted[4] content["wind_speed"] = data_splitted[5] content["precipitation_mm"] = data_splitted[6] content["location"] = data_splitted[7] if(data_splitted.length === 8) json.push(content) } return json } const {getFiveDaysForecast} = useLocationWeather(filterUserLocationWeather, csvFiveDaysWeatherToArray) const {getTodayWeatherData} = useDefaultWeather(filterUserLocationWeather, csvFiveDaysWeatherToArray) return {currentHourBAWeather, formatProvince, esDateToDayNameenDate, esDateToDayAndMonthhenDate, currentHourLocationsFilter, currentDayLocationsFilter} } export default useHome
42.86087
155
0.631974
dbfadb5a0eb6c8e84455dd14ea58d3021eff3e6a
776
js
JavaScript
api/controllers/PublicController.js
craigvantonder/sails-jquery-bootstrap-blog
843121da2b8b4a5ae7e47b414ff36501eca1dcb1
[ "MIT" ]
8
2016-02-24T14:19:23.000Z
2018-09-06T08:47:17.000Z
api/controllers/PublicController.js
craigvantonder/sails-jquery-bootstrap-blog
843121da2b8b4a5ae7e47b414ff36501eca1dcb1
[ "MIT" ]
null
null
null
api/controllers/PublicController.js
craigvantonder/sails-jquery-bootstrap-blog
843121da2b8b4a5ae7e47b414ff36501eca1dcb1
[ "MIT" ]
2
2018-08-14T11:33:40.000Z
2018-09-06T08:47:17.000Z
/** * PublicController * * @description :: Server-side logic for managing public pages * @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers */ module.exports = { showLanding: function (req, res) { console.log(req.session); // extras = {}; // extras.styles = '<link rel="stylesheet" href="' + sails.config.appUrl + '/assets/nolink/styles/example1.css">' + // '<link rel="stylesheet" href="' + sails.config.appUrl + '/assets/nolink/styles/example2.css">'; // extras.scripts = '<script src="' + sails.config.appUrl + '/assets/nolink/styles/example1.js"></script>' + // '<script src="' + sails.config.appUrl + '/assets/nolink/styles/example2.js"></script>'; res.view('landing', { title: 'Welcome' }); } };
32.333333
117
0.626289
dbfc75882908935f002e8842d9ef9cf8f97c4527
963
js
JavaScript
Mvc/Scripts/Pages/mixins.test.for.databinding.js
rippo/React.Tests
ca07eb3c37a251c172e3f1c7c77264bd3bc9852d
[ "MIT" ]
null
null
null
Mvc/Scripts/Pages/mixins.test.for.databinding.js
rippo/React.Tests
ca07eb3c37a251c172e3f1c7c77264bd3bc9852d
[ "MIT" ]
null
null
null
Mvc/Scripts/Pages/mixins.test.for.databinding.js
rippo/React.Tests
ca07eb3c37a251c172e3f1c7c77264bd3bc9852d
[ "MIT" ]
null
null
null
var app = app || {}; app.components = app.components || {}; (function(){ 'use strict'; var MixInTest = app.components.MixInTest = React.createClass({displayName: "MixInTest", mixins: [React.addons.LinkedStateMixin], getInitialState: function() { return { newValue:'' }; }, handleChange: function(e) { console.log(this.state.newValue); }, render: function() { return ( React.createElement("div", null, React.createElement("input", {valueLink: this.linkState('newValue'), type: "text"}), React.createElement("input", {onClick: this.handleChange, type: "button", value: "Save"}) ) ); } }); React.render( React.createElement(MixInTest, null), document.getElementById("mixin") ) })();
25.342105
105
0.498442
dbfcae26e438256bd2c475aa24afec3010da93bf
3,214
js
JavaScript
Documentation/html/search/all_9.js
billcshi/MagicLeapCard
f6ef56ecf0fcc9634f4ace21691f941d734baf04
[ "MIT" ]
null
null
null
Documentation/html/search/all_9.js
billcshi/MagicLeapCard
f6ef56ecf0fcc9634f4ace21691f941d734baf04
[ "MIT" ]
1
2020-03-11T18:44:24.000Z
2020-03-11T18:44:24.000Z
Documentation/html/search/all_9.js
billcshi/MagicLeapCard
f6ef56ecf0fcc9634f4ace21691f941d734baf04
[ "MIT" ]
1
2021-07-18T00:09:06.000Z
2021-07-18T00:09:06.000Z
var searchData= [ ['id_198',['id',['../class_card_info_1_1_new_card.html#ab0d88e0ac5dc3560076a0cae20f64be3',1,'CardInfo::NewCard']]], ['idle_199',['Idle',['../namespace_game_world.html#a873363129b1d9b17330a9b9a2832c1eeae599161956d626eda4cb0a5ffb85271c',1,'GameWorld']]], ['idle_5fphase_200',['Idle_Phase',['../namespace_game_logic.html#a09f4a33ac72feaf9113eec3f027e4392a6e6638450d15584497fc8aaa07d87747',1,'GameLogic']]], ['idlebtnprefab_201',['IdleBtnPrefab',['../class_u_i_1_1_content_u_i_manager.html#a562694a48946edc7494915a45fd7f584',1,'UI::ContentUIManager']]], ['imagetrackingstart_202',['ImageTrackingStart',['../namespace_game_logic.html#a09f4a33ac72feaf9113eec3f027e4392a53f88d5b98a66e3f8c93b4217a4799f8',1,'GameLogic']]], ['imagetrackingstop_203',['ImageTrackingStop',['../namespace_game_logic.html#a09f4a33ac72feaf9113eec3f027e4392a53675b5126b805d66adb2742cb56f928',1,'GameLogic']]], ['init_204',['Init',['../namespace_game_logic.html#abf753ce51dfb04d1b8632f96114ce839a95b19f7739b0b7ea7d6b07586be54f36',1,'GameLogic.Init()'],['../namespace_game_logic.html#a09f4a33ac72feaf9113eec3f027e4392a95b19f7739b0b7ea7d6b07586be54f36',1,'GameLogic.Init()']]], ['inputcontroller_205',['InputController',['../namespace_input_controller.html',1,'']]], ['instructionui_206',['InstructionUI',['../class_game_logic_1_1_human_player.html#aeb3044cd9a1617a707c9e636e5b006a5',1,'GameLogic.HumanPlayer.InstructionUI()'],['../class_u_i_1_1_content_u_i_manager.html#a37577be9319de5da10b8a1c2d2987521',1,'UI.ContentUIManager.InstructionUI()']]], ['interactiveterrain_207',['InteractiveTerrain',['../class_game_world_1_1_interactive_terrain.html',1,'GameWorld']]], ['interactiveterrain_2ecs_208',['InteractiveTerrain.cs',['../_interactive_terrain_8cs.html',1,'']]], ['is_5fdefensed_209',['is_defensed',['../class_monsters_1_1_maria___brute.html#a21c80e513ac2b633d8aed1e5ab451c18',1,'Monsters::Maria_Brute']]], ['isaccessible_210',['isAccessible',['../class_game_world_1_1_hex_tile_map.html#a75df4554fa37d66e13a99f295a65300a',1,'GameWorld::HexTileMap']]], ['isalive_211',['isAlive',['../class_monsters_1_1_monster.html#a434fff4cfb8e57c64dd54822d697fb9d',1,'Monsters::Monster']]], ['isexiled_212',['isExiled',['../class_monsters_1_1_monster.html#a227af31f289abc9dc39d29934a3eba87',1,'Monsters::Monster']]], ['isidle_213',['isIdle',['../class_monsters_1_1_monster.html#a5300b6fd365fb88d91cb1e09fbd9a771',1,'Monsters::Monster']]], ['isjoined_214',['isJoined',['../class_project___network_1_1_host_join_switcher.html#a6bf63badb364f1f099ad079a583edc82',1,'Project_Network::HostJoinSwitcher']]], ['ismonster_215',['isMonster',['../class_card_info_1_1_new_card.html#a360b09c2ccc6dd5c09728933c67e545e',1,'CardInfo::NewCard']]], ['ismonsteron_216',['isMonsterOn',['../class_terrain_scanning_1_1_hex_tile.html#a0bc6cb4da101a94eac4133f4d17b784d',1,'TerrainScanning::HexTile']]], ['isobstacle_217',['isObstacle',['../class_terrain_scanning_1_1_hex_tile.html#a7a9612f440f2cd1c433a682ab8e3eb6e',1,'TerrainScanning::HexTile']]], ['isserverfirst_218',['isServerFirst',['../class_game_logic_1_1_multiplayer_game_manager.html#aad25a9ec19bfd3c59c0d5d31aaa756fb',1,'GameLogic::MultiplayerGameManager']]] ];
128.56
284
0.801493
dbfd6965dad93d91aafbf676eac36cdae267b0eb
3,107
js
JavaScript
information-security-and-quality-assurance/issue-tracker/routes/api.js
theforbiddenpool/fcc-projects
194c931584bac56a8d1273f9489bdd24dc0dfec6
[ "MIT" ]
null
null
null
information-security-and-quality-assurance/issue-tracker/routes/api.js
theforbiddenpool/fcc-projects
194c931584bac56a8d1273f9489bdd24dc0dfec6
[ "MIT" ]
4
2020-10-19T16:05:21.000Z
2020-10-19T16:06:50.000Z
information-security-and-quality-assurance/issue-tracker/routes/api.js
theforbiddenpool/fcc-projects
194c931584bac56a8d1273f9489bdd24dc0dfec6
[ "MIT" ]
null
null
null
/* * * * Complete the API routing below * * */ 'use strict'; const expect = require('chai').expect; const MongoClient = require('mongodb').MongoClient; const ObjectId = require('mongodb').ObjectID; let db; MongoClient.connect(process.env.MONGO_URI, { useUnifiedTopology: true }) .then(client => db = client.db('issue-tracker')) .catch(error => console.error(err)) function sendBadRequest(res, message) { res.status(400) .type('text') .send(message) } function sendInternalError(res, message = 'Database error') { res.status(500) .type('text') .send(message) } module.exports = function (app) { app.route('/api/issues/:project') .get(async function (req, res){ const project = req.params.project; if(req.query.open) { req.query.open = (req.query.open == 'true') ? true : false } try { const docs = await db.collection('issues').find({ project, ...req.query }).toArray() res.json(docs) } catch { sendInternalError(res) } }) .post(async function (req, res){ const project = req.params.project; if(!req.body.issue_title || !req.body.issue_text || !req.body.created_by) { sendBadRequest(res, 'required fields missing') return } try { const doc = await db.collection('issues').insertOne({ project, ...req.body, created_on: new Date(), updated_on: new Date(), open: true }) res.json(doc.ops[0]) } catch { sendInternalError(res) } }) .put(async function (req, res){ const project = req.params.project; if(!req.body._id || Object.keys(req.body).length <= 1) { sendBadRequest(res, 'no updated field sent') return } const { _id, ...toUpdateFields } = req.body for(const key in toUpdateFields) { if(!toUpdateFields[key]) { delete toUpdateFields[key] } } try { const doc = await db.collection('issues').findOneAndUpdate( { _id: new ObjectId(_id) }, { $set: { updated_on: new Date(), ...toUpdateFields }} ) console.log(doc) if(doc.lastErrorObject.updatedExisting) { res.send('successfully updated') } else { sendBadRequest(res, _id+' does not exist') } } catch { sendInternalError(res, 'could not update '+_id) } }) .delete(async function (req, res){ const project = req.params.project; if(!req.body._id) { sendBadRequest(res, '_id error') return } try { const doc = await db.collection('issues').deleteOne({ _id: new ObjectId(req.body._id )}) if(doc.deletedCount == 0) { res.send(req.body._id+' does not exist') } else { res.send('deleted '+req.body._id) } } catch { sendInternalError(res, 'could not delete '+req.body._id) } }); };
23.537879
96
0.547152
dbfdcebced7640df62eb08ee2c34239dd8cc5096
2,840
js
JavaScript
repository/blood_post_repository.js
Hmasum18/BloodDonors-backend
332ee786d09ddb13df70b86f7bd9800fe7fec984
[ "MIT" ]
null
null
null
repository/blood_post_repository.js
Hmasum18/BloodDonors-backend
332ee786d09ddb13df70b86f7bd9800fe7fec984
[ "MIT" ]
null
null
null
repository/blood_post_repository.js
Hmasum18/BloodDonors-backend
332ee786d09ddb13df70b86f7bd9800fe7fec984
[ "MIT" ]
null
null
null
import {db_query} from "../database/oracle_db.js"; export default class BloodPostRepository{ insertOne = async (postInfo, autoCommit = true) => { let columns = Object.keys(postInfo); columns = columns.join(', '); let params = Object.values(postInfo); // console.log("BloodPostRepository:insertOne():") // console.log(columns, params) const query = ` insert into blood_post (${columns}) values (:1, :2, :3, :4, :5, :6, :7) ` return await db_query(query, params, autoCommit ); } findOne = async function (id, autoCommit = true) { const query = ` select BP.post_id "post_id", BP.blood_group "blood_group", BP.amount "amount", BP.contact "contact", BP.due_time "due_time", BP.additional_info "additional_info", P.created "created", U.id "user_id", U.name "user_name", BP.location_id "location_id" from blood_post BP join post P on(BP.post_id = P.id) join users U on (P.user_id = U.id) where BP.post_id = '${id}' and P.active = 1 ` return await db_query(query, [], autoCommit); } async findAll(autoCommit = true) { const query = ` select BP.post_id "post_id", BP.blood_group "blood_group", BP.amount "amount", BP.contact "contact", BP.due_time "due_time", BP.additional_info "additional_info", P.created "created", U.id "user_id", U.name "user_name", BP.location_id "location_id" from blood_post BP join post P on(BP.post_id = P.id) join users U on (P.user_id = U.id) where P.active = 1 order by P.created desc ` return await db_query(query, [], autoCommit); } async findAllByUser(user_id, autoCommit = true) { const query = ` select BP.post_id "post_id", BP.blood_group "blood_group", BP.amount "amount", BP.contact "contact", BP.due_time "due_time", BP.additional_info "additional_info", P.created "created", U.id "user_id", U.name "user_name", BP.location_id "location_id" from blood_post BP join (select * from post where user_id = :user_id) P on(BP.post_id = P.id) join users U on (P.user_id = U.id) where P.active = 1 order by P.created desc ` return await db_query(query, {user_id}, autoCommit); } }
35.061728
140
0.510211
dbfeb7ac6eed00568991401fccd0e95972a6fc12
1,322
js
JavaScript
test/cli.js
DScheglov/jsonschema-builder
a1eb58a95eed36b4b6cdfdbc160a72d0af28b706
[ "MIT" ]
4
2017-02-07T16:00:56.000Z
2020-09-29T14:46:31.000Z
test/cli.js
DScheglov/jsonschema-builder
a1eb58a95eed36b4b6cdfdbc160a72d0af28b706
[ "MIT" ]
null
null
null
test/cli.js
DScheglov/jsonschema-builder
a1eb58a95eed36b4b6cdfdbc160a72d0af28b706
[ "MIT" ]
null
null
null
'use strict'; const assert = require('assert'); const child_process = require('child_process'); describe('node index', function (done) { it('should process ./models', function(done) { child_process.exec('node index test/models', function(err, stdout, stderr) { assert.ok(!err); assert.equal(stderr, ''); let out = eval(stdout); assert.deepEqual(out, [{ id: '#model-mixed', title: 'modelMixed', type: 'object', properties: { title: { type: 'string' }, data: { type: 'mixed' }, _id: { type: 'string', pattern: '^[0-9a-fA-F]{24}$' }, __v: { type: 'number' } } }, { id: '#the-model-mixed', title: 'the_model_mixed', type: 'object', properties: { title: { type: 'string' }, data: { type: 'mixed' }, _id: { type: 'string', pattern: '^[0-9a-fA-F]{24}$' }, __v: { type: 'number' } } }, { id: '#mixed-model', title: 'MixedModel', type: 'object', properties: { title: { type: 'string' }, data: { type: 'mixed' }, _id: { type: 'string', pattern: '^[0-9a-fA-F]{24}$' }, __v: { type: 'number' } } }]); done(); }); }); });
25.921569
80
0.464448
e001c68365bc0e717cfe00439fb775524c872f45
292
js
JavaScript
modules/javascript-codes/modules/default-parameter/01-defaultParameter.js
drigols/Studies
9c293156935b491ded24be6b511daac67fd43538
[ "MIT" ]
1
2020-09-06T22:17:19.000Z
2020-09-06T22:17:19.000Z
modules/javascript-codes/modules/default-parameter/01-defaultParameter.js
drigols/Studies
9c293156935b491ded24be6b511daac67fd43538
[ "MIT" ]
null
null
null
modules/javascript-codes/modules/default-parameter/01-defaultParameter.js
drigols/Studies
9c293156935b491ded24be6b511daac67fd43538
[ "MIT" ]
null
null
null
/* * Rodrigo Leite - Software Engineer * 19/11/2017 */ function employee(name = 'anonymous', business = 'Google') { console.log(`Nome: ${name}, ${business}`); // eslint-disable-line no-console } employee(); employee(undefined, 'IBM'); employee('drigols'); employee('Rodrigo', 'Amazon');
19.466667
78
0.667808
e0035f52f867fa3014f98e71de9c880a8d2a9bef
621
js
JavaScript
test/donor.js
karmelyoei/bloodBank-API
3f46722043dabc2106687bd3a8652134dcb6979c
[ "MIT" ]
1
2020-12-04T09:06:09.000Z
2020-12-04T09:06:09.000Z
test/donor.js
karmelyoei/bloodBank-API
3f46722043dabc2106687bd3a8652134dcb6979c
[ "MIT" ]
null
null
null
test/donor.js
karmelyoei/bloodBank-API
3f46722043dabc2106687bd3a8652134dcb6979c
[ "MIT" ]
null
null
null
const tape = require('tape'); const supertest = require('supertest'); const app = require('../src/app'); tape('test the donors End point', test => { supertest(app) .get('/donors') .expect(200) .end((err, result) => { test.equal( result.body[0].name, 'Farah', 'this is the second test of the donors Endpoint' ); test.end(); }); }); tape('test POST donors endpoint', test => { supertest(app) .post('/donors') .expect(200) .end((err, result) => { test.equal(result.body, 1, 'testing the insert of post donors'); test.end(); }); });
22.178571
70
0.553945
e003f36f640144e4a8c62d429ee5e6716ceebd8b
759
js
JavaScript
src/index.js
dewsign/maxfactor-vue-support
018265c6fe39670716a5978783af065f673cfae8
[ "MIT" ]
null
null
null
src/index.js
dewsign/maxfactor-vue-support
018265c6fe39670716a5978783af065f673cfae8
[ "MIT" ]
null
null
null
src/index.js
dewsign/maxfactor-vue-support
018265c6fe39670716a5978783af065f673cfae8
[ "MIT" ]
null
null
null
// Modules import FormatNumber from './Modules/FormatNumber' import DateOrdinal from './Modules/DateOrdinal' import AjaxStore from './Store/AjaxStore' // Vue Mixins import FormMixin from './Mixins/FormMixin' // Vue Filters import DefaultFilter from './Filters/DefaultFilter' import MoneyFilter from './Filters/MoneyFilter' import PercentageFilter from './Filters/PercentageFilter' const Maxfactor = { install(Vue) { Vue.mixin(FormMixin) Vue.filter('default', DefaultFilter) Vue.filter('money', MoneyFilter) Vue.filter('percentage', PercentageFilter) }, } export default Maxfactor export { FormatNumber, DateOrdinal, AjaxStore, FormMixin, DefaultFilter, MoneyFilter, PercentageFilter, }
22.323529
57
0.715415
e0052334833c751965603ae4ccc16d310a3d0131
1,967
js
JavaScript
src/main/resources/static/js/app/badge.js
linuzilla/dns-analyzer
a6e0525effb2a01948e7f3dc9c834a0408d97ed7
[ "MIT" ]
null
null
null
src/main/resources/static/js/app/badge.js
linuzilla/dns-analyzer
a6e0525effb2a01948e7f3dc9c834a0408d97ed7
[ "MIT" ]
null
null
null
src/main/resources/static/js/app/badge.js
linuzilla/dns-analyzer
a6e0525effb2a01948e7f3dc9c834a0408d97ed7
[ "MIT" ]
null
null
null
function delete_instance_message(imDelUrl, id) { var actionUrl = imDelUrl + '/' + id; ncuCommonLib.delete(actionUrl, function (err, data) { }); } function update_badge(badgeUrl, imDelUrl, checkEvent) { function update_badge_function() { ncuCommonLib.get(badgeUrl, function(err,data) { if (err == null && data != null) { if (data.badge != null) { $.each(data.badge, function (index, element) { $(index).html(element); }); } if (data.messages != null && data.messages.length > 0) { var list = new Array(); list.push('<div class="container"><div class="row"><div class="col-lg-12">'); for (var i = 0; i < data.messages.length; i++) { var contents = new Array(); contents.push('<div class="alert alert-dismissible alert-danger">'); contents.push('<button type="button" class="close" data-dismiss="alert" onclick="'); contents.push("delete_instance_message('"); contents.push(imDelUrl + "',"); contents.push(data.messages[i].id + ');">&times;</button>'); contents.push('<p class="mb-0" >'); contents.push('<small>[' + data.messages[i].time + ']</small> &nbsp; ' + data.messages[i].message); contents.push('</p></div>'); list.push(contents.join('')); } list.push('</div></div></div>'); $('#instance_message').html(list.join('')); } } else { $('#instance_message').html(''); } }); } update_badge_function(); if (checkEvent) { setInterval(update_badge_function, 60000); } }
40.979167
123
0.464667
e0055b0b27fcab0e756412888042e7ace04d4ea4
384
js
JavaScript
public/blocks/pmenu/pmenu.js
PavelZubkov/student-project-control
1bf054c601f38ab3727fa50d661194db44fa7526
[ "MIT" ]
null
null
null
public/blocks/pmenu/pmenu.js
PavelZubkov/student-project-control
1bf054c601f38ab3727fa50d661194db44fa7526
[ "MIT" ]
null
null
null
public/blocks/pmenu/pmenu.js
PavelZubkov/student-project-control
1bf054c601f38ab3727fa50d661194db44fa7526
[ "MIT" ]
null
null
null
'use strict'; $(function() { const con = new __control(); const el = con.getElem(); el.appendTo('.pmenu__control'); $.post( '/projects/get', function(data, textStatus, jqXHR) { if (textStatus === 'success') { const list = new __list( { projects: data } ); con.setList(list); list.getElem().appendTo('.pmenu__list'); } } ); });
24
54
0.554688
e005e5729a1dfe1980ff8bed7dcd35ef494c4ecd
357
js
JavaScript
projects/hslayers-server/server.js
hslayers/hslayers-ng
adc2ccffc1c76e7465909fb814d7ae05c85215c3
[ "MIT" ]
42
2016-01-12T13:57:51.000Z
2022-02-02T14:08:00.000Z
projects/hslayers-server/server.js
hslayers/hslayers-ng
adc2ccffc1c76e7465909fb814d7ae05c85215c3
[ "MIT" ]
1,378
2016-01-12T15:53:43.000Z
2022-03-31T16:17:55.000Z
projects/hslayers-server/server.js
hslayers/hslayers-ng
adc2ccffc1c76e7465909fb814d7ae05c85215c3
[ "MIT" ]
17
2016-01-30T21:14:01.000Z
2021-12-14T13:52:52.000Z
#!/usr/bin/env node require('dotenv').config(); const path = require('path'); const fs = require("fs"); if (!process.env.DB_PATH) process.env.DB_PATH = 'data/hslayers-server.db'; let dbdir = path.dirname(process.env.DB_PATH); if (!fs.existsSync(dbdir)) { fs.mkdirSync(dbdir); } require('./src/proxy'); require('./src/share'); require('./src/layman');
22.3125
50
0.67507
e00625327f564320391b6d45df9a796a0b05cd07
434
js
JavaScript
app/containers/FilterBar/selectors.js
irff/athena
491eb5f6b061cc946e3bb87910efdc70fa0ada12
[ "MIT" ]
null
null
null
app/containers/FilterBar/selectors.js
irff/athena
491eb5f6b061cc946e3bb87910efdc70fa0ada12
[ "MIT" ]
null
null
null
app/containers/FilterBar/selectors.js
irff/athena
491eb5f6b061cc946e3bb87910efdc70fa0ada12
[ "MIT" ]
null
null
null
import { createSelector } from 'reselect'; /** * Direct selector to the filterBar state domain */ const selectFilterBarDomain = () => state => state.get('filterBar'); /** * Other specific selectors */ /** * Default selector used by FilterBar */ const selectFilterBar = () => createSelector( selectFilterBarDomain(), (substate) => substate.toJS() ); export default selectFilterBar; export { selectFilterBarDomain, };
16.692308
68
0.693548
e0063d9eaf381a28e71b0f60664fa7784fb94e10
408
js
JavaScript
src/index.js
verymadmax/brackets
f3d3323826442322c484306c09eefe07624eacf5
[ "MIT" ]
null
null
null
src/index.js
verymadmax/brackets
f3d3323826442322c484306c09eefe07624eacf5
[ "MIT" ]
null
null
null
src/index.js
verymadmax/brackets
f3d3323826442322c484306c09eefe07624eacf5
[ "MIT" ]
null
null
null
module.exports = function check(str, bracketsConfig) { var strArr = str.split(''); var brack = bracketsConfig; for (var i=0;i<strArr.length;i++){ for (var j = 0; j < brack.length; j++){ if(strArr[i] === brack[j][0] && strArr[i+1] === brack[j][1]){ strArr.splice(i,2); if (strArr.length == 0){ return true; } i = -1; } } } return false; }
24
67
0.509804
e006b869a5b51af4debd627ea4efd9d4e906d296
302
js
JavaScript
src/components/header/logo.js
etarasova/my-website
20d7ff64fba94c9cf49ccd3722e906097ca13409
[ "MIT" ]
1
2020-04-30T20:49:21.000Z
2020-04-30T20:49:21.000Z
src/components/header/logo.js
etarasova/my-website
20d7ff64fba94c9cf49ccd3722e906097ca13409
[ "MIT" ]
2
2020-05-01T14:21:36.000Z
2022-02-10T22:17:20.000Z
src/components/header/logo.js
etarasova/my-website
20d7ff64fba94c9cf49ccd3722e906097ca13409
[ "MIT" ]
1
2020-04-30T20:50:52.000Z
2020-04-30T20:50:52.000Z
import React from "react" import avatar from "../../assets/images/avatar.jpg" const Logo = props => ( <div id="logo"> <span className="image avatar48"><img src={avatar} alt=""/></span> <h1 id="title">Elena Tarasova</h1> <p>Junior Software Developer</p> </div> ) export default Logo
20.133333
70
0.642384
e008005a8a0aa447aadbd4ff2e6b6f12d7289e35
1,186
js
JavaScript
src/routes/product.js
D3AH/APIStock
229f4e665e46fa383b5562b252a13a164af11ace
[ "MIT" ]
null
null
null
src/routes/product.js
D3AH/APIStock
229f4e665e46fa383b5562b252a13a164af11ace
[ "MIT" ]
null
null
null
src/routes/product.js
D3AH/APIStock
229f4e665e46fa383b5562b252a13a164af11ace
[ "MIT" ]
null
null
null
'use strict'; var express = require('express'); var ProductController = require('../controllers/product'); var md_auth = require('../middlewares/authenticated'); var api = express.Router(); /** * GET */ api.get('/search', md_auth.ensureAut, ProductController.searchProduct); api.get('/', ProductController.listProducts); /** * POST */ api.post('/add', // [md_auth.ensureAut, // md_auth.ensureAutAdmin], ProductController.addProduct); /** * PUT */ api.put('/update/:id', [md_auth.ensureAut, md_auth.ensureAutAdmin], ProductController.updateProduct); api.put('/stock/add/:code', // [md_auth.ensureAut, // md_auth.ensureAutAdmin], ProductController.addStock); api.put('/stock/reduce/:code', [md_auth.ensureAut, md_auth.ensureAutAdmin], ProductController.reduceStock); api.put('/shopping/add/:code', md_auth.ensureAut, ProductController.addShopping); api.put('/shopping/reduce/:code', md_auth.ensureAut, ProductController.removeShopping); /** * DELETE */ api.delete('/delete/:id', [md_auth.ensureAut, md_auth.ensureAutAdmin], ProductController.removeProduct); module.exports = api;
19.129032
58
0.677909
e008824033c0dc0b907d232904f3dcfe78c3e91b
17,035
js
JavaScript
public/js/directory.js
CollinWood12/wattserp
5eb7f175c7e5aed2d4b7a1e920483bfacd782124
[ "MIT" ]
null
null
null
public/js/directory.js
CollinWood12/wattserp
5eb7f175c7e5aed2d4b7a1e920483bfacd782124
[ "MIT" ]
null
null
null
public/js/directory.js
CollinWood12/wattserp
5eb7f175c7e5aed2d4b7a1e920483bfacd782124
[ "MIT" ]
null
null
null
var rate_tier_count = 0; var rate_interval_count = 0; var chart_colors = ['rgba(75, 192, 192, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(153, 102, 255, 0.2)', 'rgba(255, 99, 132, 0.2)', 'rgba(255, 159, 64, 0.2)', 'rgba(255, 206, 86, 0.2)']; var chart_colors2 = ['#d41f36', '#3a9922', '#c66906', '#fdfd00', '#1465a5']; var chart_hours = ['12 AM', '1 AM', '2 AM', '3 AM', '4 AM', '5 AM', '6 AM', '7 AM', '8 AM', '9 AM', '10 AM', '11 AM', '12 PM', '1 PM', '2 PM', '3 PM', '4 PM', '5 PM', '6 PM', '7 PM', '8 PM', '9 PM', '10 PM', '11 PM']; $(document).ready(function(){ var context; //show/hide administrate repository panes $('#directory_functions_list .sidebar_function a').on('click', function(){ $('#administrate_directory .directory_function_container').each(function(){ $(this).hide(); }); switch($(this).attr('id')){ case 'contacts_button': $('#administrate_directory #contacts').show(); break; case 'news_button': $('#administrate_directory #news').show(); break; case 'locations_button': $('#administrate_directory #locations').show(); break; case 'stakeholder_button': $('#administrate_directory #stakeholder').show(); break; case 'projects_button': $('#administrate_directory #projects').show(); break; case 'rates_button': $('#administrate_directory #rates').show(); break; default: break; } }); /********************** * DIRECTORY CONTACTS *********************/ if($('#directory_contact_form .help-block').length){ $('#administrate_directory .directory_function_container').each(function(){ $(this).hide(); }); $('#administrate_directory #contacts').show(); } $(document).on('click', '.edit_contact', function(){ var context = $(this).parent().parent(); $('#directory_contact_form #first_name').val(context.find('.contact_first_name').html()); $('#directory_contact_form #last_name').val(context.find('.contact_last_name').html()); if (context.find('.directory_contact_title').length){ $('#directory_contact_form #title').val(context.find('.directory_contact_title').html().trim()); } if (context.find('.dc_work_phone .phone').length){ $('#directory_contact_form #work_phone').val(context.find('.dc_work_phone .phone').html().trim().replace(/\D/g,'')); } if (context.find('.dc_cell_phone .phone').length){ $('#directory_contact_form #cell_phone').val(context.find('.dc_cell_phone .phone').html().trim().replace(/\D/g,'')); } if (context.find('.dc_email1 a').length){ $('#directory_contact_form #email1').val(context.find('.dc_email1 a').html().trim()); } console.log(context.find('.dc_email1 a').html().trim()); if (context.find('.dc_email2 a').length){ $('#directory_contact_form #email2').val(context.find('.dc_email2 a').html().trim()); } $('#directory_contact_form .crm_form').attr('action', 'http://' + public_domain + '/pages/directory/update_contact'); $('#directory_contact_form #submit_contact_form').attr('value', 'Edit Contact'); var contact_id = context.attr('id'); $('#directory_contact_form #contact_id').val(contact_id); }); /****************************** * DIRECTORY NEWS *****************************/ $('.edit_news').on('click', function(e){ e.preventDefault(); if (!$('#news_save_edit').length){ var curr_context = $(this).parent().parent(); var curr_content = curr_context.find('p').html(); curr_context.find('.news_left_side').append("<textarea class='form-control' id='edit_news'></textarea>"); curr_context.find('.news_left_side').append("<a href='#' id='news_save_edit' class='crm_btn'>Save</a>"); curr_context.find('.news_left_side').append("<a href='#' id='news_cancel_edit' class='crm_btn2'>Cancel</a>"); curr_context.find('p').remove(); $('#edit_news').html(curr_content); } return false; }); $(document).on('click', '#news_save_edit', function(e){ e.preventDefault(); var curr_context = $(this).parent().parent(); var news_id = curr_context.attr('id'); var curr_content = curr_context.find('textarea').val(); var parameters = {'id' : news_id, 'news' : curr_content}; go_ajax2(parameters, 'http://' + project_domain + '/pages/directory/save_news', 0); setTimeout(function(){ if (rtn){ curr_context.find('textarea').remove(); curr_context.find('#news_save_edit').remove(); curr_context.find('#news_cancel_edit').remove(); curr_context.find('.news_left_side').append("<p></p>"); curr_context.find('p').html(curr_content); } },1000); }); $(document).on('click', '#news_cancel_edit', function(e){ e.preventDefault(); var curr_context = $(this).parent().parent(); var curr_content = curr_context.find('textarea').html(); curr_context.find('textarea').remove(); curr_context.find('#news_save_edit').remove(); curr_context.find('#news_cancel_edit').remove(); curr_context.find('.news_left_side').append("<p></p>"); curr_context.find('p').html(curr_content); }); $('.delete_news').on('click', function(e){ e.preventDefault(); var curr_context = $(this).parent().parent(); var news_id = curr_context.attr('id'); var parameters = {'id' : news_id}; go_ajax2(parameters, 'http://' + project_domain + '/pages/directory/delete_news', 0); setTimeout(function(){ if (rtn){ curr_context.remove(); } },1000); }); /****************************** * DIRECTORY LOCATIONS *****************************/ if($('#directory_location_form .help-block').length){ $('#administrate_directory .directory_function_container').each(function(){ $(this).hide(); }); $('#administrate_directory #locations').show(); } $(document).on('click', '.edit_location', function(){ var context = $(this).parent().parent(); $('#directory_location_form #address').val(context.find('.directory_address').html()); $('#directory_location_form #city').val(context.find('.directory_city').html()); $('#directory_location_form #state').val(context.find('.directory_state').html()); $('#directory_location_form #zip').val(context.find('.directory_zip').html()); $('#directory_location_form .crm_form').attr('action', 'http://' + public_domain + '/pages/directory/update_address'); $('#directory_location_form #submit_address_form').attr('value', 'Edit Location'); var location_id = context.attr('id'); $('#directory_location_form #address_id').val(location_id); }); /****************************** * STAKEHOLDER CORRESPONDENCE *****************************/ $('.edit_stakeholdercorrespondence').on('click', function(e){ e.preventDefault(); if (!$('#sc_save_edit').length){ var curr_context = $(this).parent().parent(); var curr_content = curr_context.find('p').html(); curr_context.find('.sc_left_side').append("<textarea class='form-control' id='edit_correspondence'></textarea>"); curr_context.find('.sc_left_side').append("<a href='#' id='sc_save_edit' class='crm_btn'>Save</a>"); curr_context.find('.sc_left_side').append("<a href='#' id='sc_cancel_edit' class='crm_btn2'>Cancel</a>"); curr_context.find('p').remove(); $('#edit_correspondence').html(curr_content); } return false; }); $(document).on('click', '#sc_save_edit', function(e){ e.preventDefault(); var curr_context = $(this).parent().parent(); var sc_id = curr_context.attr('id'); var curr_content = curr_context.find('textarea').val(); console.log(curr_content); var parameters = {'id' : sc_id, 'message' : curr_content}; go_ajax2(parameters, 'http://' + project_domain + '/pages/directory/save_stakeholdercorrespondence', 0); setTimeout(function(){ if (rtn){ curr_context.find('textarea').remove(); curr_context.find('#sc_save_edit').remove(); curr_context.find('#sc_cancel_edit').remove(); curr_context.find('.sc_left_side').append("<p></p>"); curr_context.find('p').html(curr_content); } },1000); }); $(document).on('click', '#sc_cancel_edit', function(e){ e.preventDefault(); var curr_context = $(this).parent().parent(); var curr_content = curr_context.find('textarea').html(); curr_context.find('textarea').remove(); curr_context.find('#sc_save_edit').remove(); curr_context.find('#sc_cancel_edit').remove(); curr_context.find('.sc_left_side').append("<p></p>"); curr_context.find('p').html(curr_content); }); $('.delete_stakeholdercorrespondence').on('click', function(e){ e.preventDefault(); var curr_context = $(this).parent().parent(); var sc_id = curr_context.attr('id'); var parameters = {'id' : sc_id}; go_ajax2(parameters, 'http://' + project_domain + '/pages/directory/delete_stakeholdercorrespondence', 0); setTimeout(function(){ if (rtn){ curr_context.remove(); } },1000); }); /*************************** * MANAGE RATES FORMS **************************/ $("select[name='service_charge_type']").on('change', function(){ $('#fixed_charge_container').hide(); $('#daily_charge_container').hide(); switch($(this).val()){ case 'fixed_monthly_charge': $('#fixed_charge_container').show(); break; case 'daily_charge': $('#daily_charge_container').show(); break; default: break; } }); $("select[name='rate_type']").on('change', function(){ $('#flat_rate_container').hide(); $('#tou_rate_container').hide(); $('#tiered_rate_container').hide(); switch($(this).val()){ case 'time_of_use': $('#tou_rate_container').show(); break; case 'flat_rate': $('#flat_rate_container').show(); break; case 'tiered': $('#tiered_rate_container').show(); break; default: break; } }); $("select[name='demand']").on('change', function(){ $('#demand_add_period').hide(); switch($(this).val()){ case 'yes': $('#demand_add_period').css('display', 'inline-block'); break; case 'no': $(this).parent().find('.demand_period_row').each(function(){ $(this).remove(); }); break; default: break; } }); $(document).on('click', '#demand_add_period', function(){ var context = $(this).parent(); var new_demand = $('#demand_period_row').clone().appendTo(context).prop('id', "").addClass('demand_period_row'); new_demand.insertBefore('#demand_add_period'); $('.timepicker').datetimepicker({ format: 'h A' }); }); $(document).on('click', '#usage_add_period', function(){ var context = $(this).parent(); var new_usage = $('#kwh_period_row').clone().appendTo(context).prop('id', "").addClass('kwh_period_row'); new_usage.insertBefore('#usage_add_period'); $('.timepicker').datetimepicker({ format: 'h A' }); }); $(document).on('change', "select[name='max_demand']", function(){ var context = $(this); if(context.val() == "no_max"){ context.parent().parent().find('.demand_limit').hide(); } else{ context.parent().parent().find('.demand_limit').show(); } }); $(document).on('change', "select[name='max_kwh']", function(){ var context = $(this); if(context.val() == "no_max"){ context.parent().parent().find('.kwh_limit').hide(); } else{ context.parent().parent().find('.kwh_limit').show(); } }); $(document).on('click', '.delete_demand_period', function(){ $(this).parent().parent().remove(); }); $(document).on('click', '.delete_usage_period', function(){ $(this).parent().parent().remove(); }); $(document).on('change', '.adjustor_type', function(){ var choice = $('option:selected', this).text(); var context = $(this).parent().parent().parent(); context.find('.adjust_amount_group').hide(); if (choice != "None"){ context.find('.adjustor_amount_label').text(choice); context.find('.adjust_amount_group').show(); } }); $(document).on('click', '#add_tier', function(e){ e.preventDefault(); rate_tier_count++; var container = $(this).parent(); $('#tiered_row').find('.tier_label').html('Tier ' + rate_tier_count); container.append($('#tiered_row').clone().attr('id', 'tiered_row_' + rate_tier_count)); $('#tiered_row_' + rate_tier_count).find('#rate_tier').attr('id', 'rate_tier' + rate_tier_count).attr('name', 'rate_tier' + rate_tier_count); $('#tiered_row_' + rate_tier_count).find('#tier_cost').attr('id', 'tier_cost' + rate_tier_count).attr('name', 'tier_cost' + rate_tier_count); if (rate_tier_count != 1){ var temp = rate_tier_count-1; $("#tiered_row_" + temp).find('.remove_tier').remove(); } return false; }); $(document).on('click', '.remove_tier', function(){ rate_tier_count--; var temp = rate_tier_count; var el = $(this); var context = $(this).parent().parent().remove(); $("#tiered_row_" + temp).find('.col-md-1').append(el); }); $(document).on('click', '#add_interval', function(e){ e.preventDefault(); rate_interval_count++; var container = $(this).parent(); container.append($('#interval_row').clone().attr('id', 'interval_row_' + rate_interval_count)); $('#interval_row_' + rate_interval_count).find('#interval_name').attr('id', 'interval_name' + rate_interval_count).attr('name', 'interval_name' + rate_interval_count); $('#interval_row_' + rate_interval_count).find('#rate_interval_start').attr('id', 'rate_interval_start' + rate_interval_count).attr('name', 'rate_interval_start' + rate_interval_count); $('#interval_row_' + rate_interval_count).find('#rate_interval_end').attr('id', 'rate_interval_end' + rate_interval_count).attr('name', 'rate_interval_end' + rate_interval_count); $('#interval_row_' + rate_interval_count).find('#interval_cost').attr('id', 'interval_cost' + rate_interval_count).attr('name', 'interval_cost' + rate_interval_count); if (rate_interval_count != 1){ var temp = rate_interval_count-1; $("#interval_row_" + temp).find('.remove_interval').remove(); } $('.timepicker').datetimepicker({ format: 'h A' }); return false; }); $(document).on('click', '.remove_interval', function(){ rate_interval_count--; var temp = rate_interval_count; var el = $(this); var context = $(this).parent().parent().remove(); $("#interval_row_" + temp).find('.col-md-1').append(el); }); $(document).on('change', ".interval_cost", function(){ update_tou(); }); $(document).on('change', ".rate_interval_end", function(){ update_tou(); }); $(document).on('change', ".rate_interval_start", function(){ update_tou(); }); $(document).on('change', "[name='rate_tier']", function(){ var index_arr = []; var context = $(this).parent().parent(); var index = context.attr('id').split('_')[2]; var val = $(this).val(); var exists_flag = 0; for(var i = 1; i < rate_tier_count; i++){ if (index_arr[i] == index){ //update exists_flag = 1; } } if (exists_flag == 0){ tiered_chart.data.datasets.push({label: val, data: val, backgroundColor: chart_colors[index-1]}); var chart_height = $('#tiered_chart').height(); $('#tiered_chart').height(chart_height + 75); } tiered_chart.update(); }); }); function update_tou(){ var interval_arr = { touindex: 5, touname: "test", toucost: "cost", toudata: new Array() }; var ints_arr = new Array(); var go_flag = 0; var counter = 0; var index = 0; var name, cost = ""; $("#intervals .interval_row").each(function(){ tou_chart.data.datasets.pop(); }); $("#intervals .interval_row").each(function(){ index = $(this).attr('id').split('_')[2]; name = $(this).find("[name='interval_name" + index + "']").val(); cost = $(this).find("[name='interval_cost" + index + "']").val(); for (var j = 0; j < chart_hours.length; j++){ if (chart_hours[j] == $(this).find("[name='rate_interval_start" + index + "']").val()){ go_flag = 1; } if (chart_hours[j] == $(this).find("[name='rate_interval_end" + index + "']").val()){ go_flag = 0; } if (go_flag){ ints_arr[j] = cost*100; } else{ ints_arr[j] = 0; } } /*if (go_flag){ for (var j = 0; j < chart_hours.length; j++){ if (chart_hours[j] == $(this).find("[name='rate_interval_end" + index + "']").val()){ go_flag = 0; } if (go_flag){ ints_arr[j] = cost*100; } } }*/ console.log(ints_arr); interval_arr.touindex = index; interval_arr.touname = name; interval_arr.toucost = cost; interval_arr.toudata = ints_arr; tou_chart.data.datasets.push({label: interval_arr.touname, data: interval_arr.toudata, order: i, barThickness: 'flex', maxBarThickness: 100, barPercentage: .8, backgroundColor: chart_colors2[index-1]}); }); //tou_chart.data.datasets.pop(); //tou_chart.data.datasets.pop(); tou_chart.data.datasets.push({label: 'Solar Approximation', data: [0, 0, 0, 0, 0, 0, 2, 6, 12, 22, 35, 44, 50, 52, 50, 44, 35, 22, 12, 6, 2, 0], type: 'line'}); tou_chart.update(); } function ShallowCopy(o) { var copy = Object.create(o); for (prop in o) { if (o.hasOwnProperty(prop)) { copy[prop] = o[prop]; } } return copy; } function removeData(chart) { chart.data.labels.pop(); chart.data.datasets.forEach((dataset) => { dataset.data.pop(); }); chart.update(); }
36.321962
217
0.631993
e008a2a5db48d616e31e2df3a9c9a5ee8780f135
2,106
js
JavaScript
src/components/AuthLayout.js
MishaHnatyshyn/supermarket-self-service-app
fbd7b23b35842729b93a836837558ce901c18e13
[ "Apache-2.0" ]
null
null
null
src/components/AuthLayout.js
MishaHnatyshyn/supermarket-self-service-app
fbd7b23b35842729b93a836837558ce901c18e13
[ "Apache-2.0" ]
5
2020-04-26T17:50:36.000Z
2022-02-27T00:28:46.000Z
src/components/AuthLayout.js
MishaHnatyshyn/supermarket-self-service-app
fbd7b23b35842729b93a836837558ce901c18e13
[ "Apache-2.0" ]
1
2020-11-17T21:29:00.000Z
2020-11-17T21:29:00.000Z
import React from 'react'; import { Image, StyleSheet, View, } from 'react-native'; import PropTypes from 'prop-types'; import { $white } from '../constants/Colors'; import Layout from '../constants/Layout'; import CachableImage from './CachableImage'; const { width } = Layout.window; const logo = require('../assets/images/logo.png'); export default function AuthLayout({ children, isRegistration }) { return ( <View style={{ ...styles.container, padding: isRegistration ? '10% 3%' : '25% 3%' }}> <CachableImage source="https://i.pinimg.com/564x/f5/d0/51/f5d051306fcdce6da21ece1d903e49a1.jpg" style={styles.background} /> <View style={styles.block}> <View style={styles.logo}> <Image source={logo} style={styles.picture} /> </View> <View style={styles.form}> {children} </View> </View> </View> ); } AuthLayout.defaultProps = { isRegistration: false, }; AuthLayout.propTypes = { children: PropTypes.node.isRequired, isRegistration: PropTypes.bool, }; const styles = StyleSheet.create({ container: { width: '100%', height: '100%', position: 'relative', backgroundColor: '#fff', }, background: { position: 'absolute', bottom: 0, top: 0, right: 0, left: 0, opacity: 0.75, zIndex: -1, }, logo: { width: 90, height: 85, backgroundColor: $white, borderRadius: 20, zIndex: 1, alignItems: 'center', justifyContent: 'center', padding: 10, shadowColor: '#000', shadowOffset: { width: 0, height: 5, }, shadowOpacity: 0.34, shadowRadius: 6.27, elevation: 10, }, picture: { width: 65, height: 55, }, scrollContainer: { width: '100%', }, block: { flexDirection: 'column', width: '100%', alignItems: 'center', justifyContent: 'space-between', }, form: { width: width - 30, backgroundColor: $white, borderRadius: 40, marginTop: 25, alignItems: 'center', justifyContent: 'space-around', padding: 15, }, });
21.06
89
0.594967
e008cc571bf6a455497ea6e46b615d6762b34c82
381
js
JavaScript
jsonp/320803.js
c-tsy/data_location
f7db57bf8cfec889b7d90f5d30b3a062490b2125
[ "MIT" ]
null
null
null
jsonp/320803.js
c-tsy/data_location
f7db57bf8cfec889b7d90f5d30b3a062490b2125
[ "MIT" ]
null
null
null
jsonp/320803.js
c-tsy/data_location
f7db57bf8cfec889b7d90f5d30b3a062490b2125
[ "MIT" ]
null
null
null
if(_area_jsonp_320803){_area_jsonp_320803({"320803001":"淮城街道","320803002":"河下街道","320803004":"山阳街道","320803101":"平桥镇","320803104":"朱桥镇","320803106":"施河镇","320803107":"车桥镇","320803109":"流均镇","320803110":"博里镇","320803112":"复兴镇","320803113":"苏嘴镇","320803114":"钦工镇","320803115":"顺河镇","320803121":"漕运镇","320803122":"石塘镇","320803400":"白马湖农场","320803401":"经济开发区","320803402":"淮安新材料产业园"})}
381
381
0.698163
e00aab6424e7ff6fe5534438b754e87b474a2f63
3,233
js
JavaScript
public/script/madmin-console.js
bustardcelly/madmin
4456008157cc70cadd39417dabd4620e0ac469bb
[ "MIT" ]
null
null
null
public/script/madmin-console.js
bustardcelly/madmin
4456008157cc70cadd39417dabd4620e0ac469bb
[ "MIT" ]
null
null
null
public/script/madmin-console.js
bustardcelly/madmin
4456008157cc70cadd39417dabd4620e0ac469bb
[ "MIT" ]
1
2018-09-22T04:10:01.000Z
2018-09-22T04:10:01.000Z
/*global define:false */ define(['jquery', 'script/controller/route-console-controller'], function($, routeConsoleControllerFactory) { var routeConsoleControllers = [], activeConsoleController; function activateConsole(consoleController) { if(typeof activeConsoleController !== 'undefined' ) { deactivateConsole(activeConsoleController); } consoleController.activate(); activeConsoleController = consoleController; } function deactivateConsole(consoleController) { consoleController.deactivate(); if( activeConsoleController === consoleController ) { activeConsoleController = undefined; } } function generateEditHandler(consoleController) { return function(event) { activateConsole(consoleController); }; } function generateCloseHandler(consoleController) { return function(event) { deactivateConsole(consoleController); }; } function generateDeleteHandler(consoleController) { return function(event) { var $routeElement = consoleController.$element; undecorate($routeElement); $routeElement.remove(); }; } function assignHandlers(consoleController) { $(consoleController).on('edit', generateEditHandler(consoleController)); $(consoleController).on('close', generateCloseHandler(consoleController)); $(consoleController).on('delete', generateDeleteHandler(consoleController)); } function removeHandlers(consoleController) { $(consoleController).off('edit'); $(consoleController).off('close'); $(consoleController).off('delete'); } function getControllerFromElement($element) { var index = routeConsoleControllers.length, consoleController; while( --index > -1 ) { consoleController = routeConsoleControllers[index]; if(consoleController.$element === $element) { return consoleController; } } return undefined; } function decorate($routeElement) { var controller = routeConsoleControllerFactory.mediate($routeElement); assignHandlers(controller); routeConsoleControllers.push(controller); } function undecorate($routeElement) { var controller = getControllerFromElement($routeElement), index = (controller) ? routeConsoleControllers.indexOf(controller) : -1; removeHandlers(controller); if( index > -1 ) { routeConsoleControllers.splice(index, 1); } } function decorateAll(selector) { $(selector).each(function(index, el) { decorate($(el)); }); } function undecorateAll(selector) { $(selector).each(function(index, el) { undecorate($(el)); }); } return { init: function() { decorateAll('div.route-item'); }, addNewRoute: function(routeJSON) { var routeConsoleController = routeConsoleControllerFactory.create(routeJSON), $fragment = routeConsoleController.$element; routeConsoleControllers.push(routeConsoleController); assignHandlers(routeConsoleController); $fragment.insertBefore($('#add-route-button')); // activate. activateConsole(routeConsoleController); }, close: function() { undecorateAll('div.route-item'); } }; });
28.359649
83
0.691308
e00cccdfa679c8e87aa090e0904c94c854a60319
231
js
JavaScript
src/components/theme-legacy/raw-link.js
cfowles/mop-frontend
3ea1477e588ef754a9155f4917f8e5b93dca3d90
[ "BSD-3-Clause" ]
null
null
null
src/components/theme-legacy/raw-link.js
cfowles/mop-frontend
3ea1477e588ef754a9155f4917f8e5b93dca3d90
[ "BSD-3-Clause" ]
null
null
null
src/components/theme-legacy/raw-link.js
cfowles/mop-frontend
3ea1477e588ef754a9155f4917f8e5b93dca3d90
[ "BSD-3-Clause" ]
null
null
null
// Theme-legacy thanks page doesn't render this // but this component needs to exist because a theme-giraffe component exists // and our theme-switching build process requires both const RawLink = () => null export default RawLink
38.5
77
0.779221
e00dab020ad5344f607d9639249e2f3b7f07f5b2
7,716
js
JavaScript
dist/js/chunk-146c7137.e29fc705.js
ArilexWang/basketballbackend
313506cce0e14c9535e18b26b868a859021d5d73
[ "MIT" ]
null
null
null
dist/js/chunk-146c7137.e29fc705.js
ArilexWang/basketballbackend
313506cce0e14c9535e18b26b868a859021d5d73
[ "MIT" ]
null
null
null
dist/js/chunk-146c7137.e29fc705.js
ArilexWang/basketballbackend
313506cce0e14c9535e18b26b868a859021d5d73
[ "MIT" ]
null
null
null
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-146c7137"],{"365c":function(t,e,n){"use strict";n.d(e,"i",(function(){return a})),n.d(e,"j",(function(){return l})),n.d(e,"h",(function(){return r})),n.d(e,"k",(function(){return u})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return s})),n.d(e,"d",(function(){return d})),n.d(e,"e",(function(){return f})),n.d(e,"g",(function(){return p})),n.d(e,"f",(function(){return h})),n.d(e,"b",(function(){return m}));n("d3b7");var o=n("56d7"),c=o["default"].$app.database();function a(t){return new Promise((function(e,n){c.collection(t).get().then((function(t){e(t)})).catch((function(t){n(t)}))}))}function l(t,e,n){return new Promise((function(o,a){c.collection(t).orderBy(e,n).get().then((function(t){o(t)})).catch((function(t){a(t)}))}))}function r(t,e){return new Promise((function(n,o){c.collection(t).doc(e).get().then((function(t){n(t)})).catch((function(t){o(t)}))}))}function u(t,e){var n=t._id;return console.log(n),delete t._id,new Promise((function(o,a){c.collection(e).doc(n).update(t).then((function(t){o(t)})).catch((function(t){a(t)}))}))}function i(t,e){return new Promise((function(n,o){console.log("info",t),c.collection(e).doc(t._id).remove().then((function(t){n(t)})).catch((function(t){o(t)}))}))}function s(t,e){return new Promise((function(n,o){c.collection(e).add(t).then((function(t){n(t)})).catch((function(t){o(t)}))}))}function d(t){return new Promise((function(e,n){c.collection(t).count().then((function(t){e(t)})).catch((function(t){n(t)}))}))}function f(t,e){return new Promise((function(n,o){c.collection(t).where(e).count().then((function(t){n(t)})).catch((function(t){o(t)}))}))}function p(t,e){return new Promise((function(n,o){c.collection(t).where(e).get().then((function(t){n(t)})).catch((function(t){o(t)}))}))}function h(t,e,n,o,a,l){return new Promise((function(r,u){c.collection(t).where(o).limit(n).skip(e).orderBy(a,l).get().then((function(t){r(t)})).catch((function(t){u(t)}))}))}function m(t,e){return new Promise((function(n,c){o["default"].$app.callFunction({name:t,data:e}).then((function(t){n(t)})).catch((function(t){c(t)}))}))}},"51fe":function(t,e,n){"use strict";n("c6ff")},a434:function(t,e,n){"use strict";var o=n("23e7"),c=n("23cb"),a=n("a691"),l=n("50c4"),r=n("7b0b"),u=n("65f0"),i=n("8418"),s=n("1dde"),d=n("ae40"),f=s("splice"),p=d("splice",{ACCESSORS:!0,0:0,1:2}),h=Math.max,m=Math.min,b=9007199254740991,w="Maximum allowed length exceeded";o({target:"Array",proto:!0,forced:!f||!p},{splice:function(t,e){var n,o,s,d,f,p,g=r(this),v=l(g.length),$=c(t,v),y=arguments.length;if(0===y?n=o=0:1===y?(n=0,o=v-$):(n=y-2,o=m(h(a(e),0),v-$)),v+n-o>b)throw TypeError(w);for(s=u(g,o),d=0;d<o;d++)f=$+d,f in g&&i(s,d,g[f]);if(s.length=o,n<o){for(d=$;d<v-o;d++)f=d+o,p=d+n,f in g?g[p]=g[f]:delete g[p];for(d=v;d>v-o+n;d--)delete g[d-1]}else if(n>o)for(d=v-o;d>$;d--)f=d+o-1,p=d+n-1,f in g?g[p]=g[f]:delete g[p];for(d=0;d<n;d++)g[d+$]=arguments[d+2];return g.length=v-o+n,s}})},c6ff:function(t,e,n){},d968:function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"home-container"},[n("div",{staticClass:"home-content"},[n("el-row",{attrs:{type:"flex",align:"middle"}},[n("el-col",{attrs:{span:8}},[n("el-select",{attrs:{placeholder:"请选择"},on:{change:t.selectChanged},model:{value:t.selectedValue,callback:function(e){t.selectedValue=e},expression:"selectedValue"}},t._l(t.selectOptions,(function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),n("el-col",{attrs:{span:8}},[n("el-button",{attrs:{size:"mini"},on:{click:t.handleAdd}},[t._v("新增时间段")])],1),n("el-col",{attrs:{span:8}},[n("el-button",{attrs:{size:"mini"},on:{click:t.handleUpdate}},[t._v("保存")])],1)],1),n("el-table",{staticStyle:{"margin-top":"10px"},attrs:{data:t.data.period,"default-sort":{prop:"startHour"},height:"450",border:""}},[n("el-table-column",{attrs:{prop:"name",label:"开始时",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-input",{attrs:{type:"number"},model:{value:e.row.startHour,callback:function(n){t.$set(e.row,"startHour",n)},expression:"scope.row.startHour"}})]}}])}),n("el-table-column",{attrs:{prop:"price",label:"开始分",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-input",{attrs:{type:"number"},model:{value:e.row.startMinute,callback:function(n){t.$set(e.row,"startMinute",n)},expression:"scope.row.startMinute"}})]}}])}),n("el-table-column",{attrs:{prop:"value",label:"结束时",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-input",{attrs:{type:"number"},model:{value:e.row.endHour,callback:function(n){t.$set(e.row,"endHour",n)},expression:"scope.row.endHour"}})]}}])}),n("el-table-column",{attrs:{prop:"type",label:"结束分",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-input",{attrs:{type:"number"},model:{value:e.row.endMinute,callback:function(n){t.$set(e.row,"endMinute",n)},expression:"scope.row.endMinute"}})]}}])}),n("el-table-column",{attrs:{prop:"type",label:"半场价格",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-input",{attrs:{type:"number"},model:{value:e.row.halfPrice,callback:function(n){t.$set(e.row,"halfPrice",n)},expression:"scope.row.halfPrice"}})]}}])}),n("el-table-column",{attrs:{prop:"type",label:"全场价格",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-input",{attrs:{type:"number"},model:{value:e.row.fullPrice,callback:function(n){t.$set(e.row,"fullPrice",n)},expression:"scope.row.fullPrice"}})]}}])}),n("el-table-column",{attrs:{label:"操作",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(n){return t.handleDelete(e.$index)}}},[t._v("删除")])]}}])})],1)],1)])},c=[],a=(n("4160"),n("a434"),n("159b"),n("365c")),l={name:"week",data:function(){return{data:{},datas:[],newData:[{}],collection:"week",selectOptions:[{value:"0",label:"星期日"},{value:"1",label:"星期一"},{value:"2",label:"星期二"},{value:"3",label:"星期三"},{value:"4",label:"星期四"},{value:"5",label:"星期五"},{value:"6",label:"星期六"}],selectedValue:"0"}},created:function(){var t=this;Object(a["h"])(this.$data.collection,this.$data.selectedValue).then((function(e){console.log(e),t.$data.data=e.data[0]}))},methods:{handleUpdate:function(){var t=this;this.$confirm("是否提交修改","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$data.data.period.forEach((function(t){t.startHour=parseInt(t.startHour),t.endHour=parseInt(t.endHour),t.halfPrice=parseInt(t.halfPrice),t.fullPrice=parseInt(t.fullPrice),t.startMinute=parseInt(t.startMinute),t.endMinute=parseInt(t.endMinute)})),t.$data.data.period.sort((function(t,e){return t.startHour-e.startHour})),Object(a["k"])(t.$data.data,t.$data.collection).then((function(e){1==e.updated?t.$message({type:"success",message:"已保存!"}):t.$message({type:"fail",message:"保存失败!"})}))})).catch((function(e){console.log(e),t.$router.go(0),t.$message({type:"info",message:"保存失败"})}))},handleDelete:function(t){var e=this;this.$confirm("是否删除当前时间段","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){console.log(t),e.$data.data.period.splice(t,1),console.log(e.$data.data)}))},handleAdd:function(){this.$data.data.period.push({})},selectChanged:function(t){var e=this;console.log(t,this.$data.selectOptions[t]),Object(a["h"])(this.$data.collection,this.$data.selectedValue).then((function(t){console.log(t),e.$data.data=t.data[0]}))}}},r=l,u=(n("51fe"),n("2877")),i=Object(u["a"])(r,o,c,!1,null,"2e00a7c7",null);e["default"]=i.exports}}]); //# sourceMappingURL=chunk-146c7137.e29fc705.js.map
3,858
7,664
0.660964
e00ef179537f5e0a71e7e0a0ad5a458c5cf1baa9
3,914
js
JavaScript
lib/__tests/lexer.js
bramus/csstree
41f276e8862d8223eeaa01a3d113ab70bb13d2d9
[ "MIT" ]
1,421
2016-09-12T23:05:48.000Z
2022-03-29T15:31:27.000Z
lib/__tests/lexer.js
bramus/csstree
41f276e8862d8223eeaa01a3d113ab70bb13d2d9
[ "MIT" ]
179
2016-09-12T22:11:21.000Z
2022-02-27T20:14:08.000Z
lib/__tests/lexer.js
bramus/csstree
41f276e8862d8223eeaa01a3d113ab70bb13d2d9
[ "MIT" ]
96
2016-09-20T13:48:29.000Z
2022-03-12T20:42:30.000Z
import assert from 'assert'; import { lexer, createLexer, fork } from 'css-tree'; describe('lexer', () => { it('should not override generic types when used', () => { const customLexer = createLexer({ generic: true, types: { length: 'foo' } }); assert.strictEqual(customLexer.matchType('length', 'foo').matched, null); assert.notStrictEqual(customLexer.matchType('length', '1px').matched, null); }); it('should not use generic type names when generics are not used', () => { const customLexer = createLexer({ types: { length: 'foo' } }); assert.notStrictEqual(customLexer.matchType('length', 'foo').matched, null); assert.strictEqual(customLexer.matchType('length', '1px').matched, null); }); it('validate()', () => { const customLexer = createLexer({ generic: true, types: { ref: '<string>', valid: '<number> <ref>', invalid: '<foo>' }, properties: { ref: '<valid>', valid: '<ident> <\'ref\'>', invalid: '<invalid>' } }); assert.deepStrictEqual(customLexer.validate(), { types: [ 'invalid' ], properties: [ 'invalid' ] }); }); describe('should allow append definitions', function() { const customSyntax = fork({ properties: { color: '| foo', new: '| foo' }, types: { length: '| foo', box: '| foo', new: '| foo' } }); it('properties', () => { assert.notStrictEqual(customSyntax.lexer.matchProperty('color', 'foo').matched, null); assert.notStrictEqual(customSyntax.lexer.matchProperty('new', 'foo').matched, null); }); it('types', () => { assert.notStrictEqual(customSyntax.lexer.matchType('box', 'foo').matched, null); assert.notStrictEqual(customSyntax.lexer.matchType('new', 'foo').matched, null); }); it('should not append to generic', () => { assert.strictEqual(customSyntax.lexer.matchType('length', 'foo').matched, null); }); }); it('default syntax shouldn\'t to be broken', () => { assert.strictEqual(lexer.validate(), null); }); describe('dump & recovery', () => { const customLexer = createLexer({ generic: true, types: { foo: '<number>' }, properties: { test: '<foo>+' } }); it('custom syntax should not affect base syntax', () => { assert.strictEqual(lexer.validate(), null); assert.strictEqual(lexer.matchProperty('test', '1 2 3').matched, null); assert.notStrictEqual(lexer.matchProperty('color', 'red').matched, null); }); it('custom syntax should be valid and correct', () => { assert.strictEqual(customLexer.validate(), null); }); it('custom syntax should match own grammar only', () => { assert.notStrictEqual(customLexer.matchProperty('test', '1 2 3').matched, null); assert.strictEqual(customLexer.matchProperty('color', 'red').matched, null); }); it('recovery syntax from dump', () => { const recoverySyntax = fork(prev => ({ ...prev, ...customLexer.dump() })); assert.strictEqual(recoverySyntax.lexer.validate(), null); assert.notStrictEqual(recoverySyntax.lexer.matchProperty('test', '1 2 3').matched, null); }); }); });
32.616667
101
0.495657
e00f819bea8493d23978d0e41e788c730f7c6387
591
js
JavaScript
api_server/modules/users/test/gitlens_user/multiple_email_hashes_test.js
reneelpetit/codestream-server
03a9b7ee578ec42534038ef3b77662f44ab25b6b
[ "Apache-2.0" ]
1
2021-11-07T18:53:39.000Z
2021-11-07T18:53:39.000Z
api_server/modules/users/test/gitlens_user/multiple_email_hashes_test.js
reneelpetit/codestream-server
03a9b7ee578ec42534038ef3b77662f44ab25b6b
[ "Apache-2.0" ]
null
null
null
api_server/modules/users/test/gitlens_user/multiple_email_hashes_test.js
reneelpetit/codestream-server
03a9b7ee578ec42534038ef3b77662f44ab25b6b
[ "Apache-2.0" ]
null
null
null
'use strict'; const GitLensUserTest = require('./gitlens_user_test'); class MultipleEmailHashesTest extends GitLensUserTest { get description () { return 'should be ok to provide multiple email hashes when creating a GitLens user'; } // before the test runs... before (callback) { // add more email hashes super.before(error => { if (error) { return callback(error); } this.data.emailHashes = [ ...this.data.emailHashes, this.userFactory.randomEmail(), this.userFactory.randomEmail() ]; callback(); }); } } module.exports = MultipleEmailHashesTest;
21.888889
86
0.693739
e00f9f021fc1084a30636279c8269c5fce75b6fa
23,154
js
JavaScript
releases/0.10.0/docs/user_guide/bokeh-plot-2f1dd061e4b85e6d21f8267486e34080.js
Daniel-Mietchen/docs.bokeh.org
5aab9ea64e7b6f9267e356bb6920e0342260444d
[ "BSD-3-Clause" ]
null
null
null
releases/0.10.0/docs/user_guide/bokeh-plot-2f1dd061e4b85e6d21f8267486e34080.js
Daniel-Mietchen/docs.bokeh.org
5aab9ea64e7b6f9267e356bb6920e0342260444d
[ "BSD-3-Clause" ]
null
null
null
releases/0.10.0/docs/user_guide/bokeh-plot-2f1dd061e4b85e6d21f8267486e34080.js
Daniel-Mietchen/docs.bokeh.org
5aab9ea64e7b6f9267e356bb6920e0342260444d
[ "BSD-3-Clause" ]
null
null
null
(function(global) { if (typeof (window._bokeh_onload_callbacks) === "undefined"){ window._bokeh_onload_callbacks = []; } function load_lib(url, callback){ window._bokeh_onload_callbacks.push(callback); if (window._bokeh_is_loading){ console.log("Bokeh: BokehJS is being loaded, scheduling callback at", new Date()); return null; } console.log("Bokeh: BokehJS not loaded, scheduling load and callback at", new Date()); window._bokeh_is_loading = true; var s = document.createElement('script'); s.src = url; s.async = true; s.onreadystatechange = s.onload = function(){ Bokeh.embed.inject_css("https://cdn.bokeh.org/bokeh/release/bokeh-0.10.0.min.css"); window._bokeh_onload_callbacks.forEach(function(callback){callback()}); }; s.onerror = function(){ console.warn("failed to load library " + url); }; document.getElementsByTagName("head")[0].appendChild(s); } bokehjs_url = "https://cdn.bokeh.org/bokeh/release/bokeh-0.10.0.min.js" var elt = document.getElementById("b2fd3a34-bdea-42f1-86b5-c5296e9d354a"); if(elt==null) { console.log("Bokeh: ERROR: autoload.js configured with elementid 'b2fd3a34-bdea-42f1-86b5-c5296e9d354a' but no matching script tag was found. ") return false; } // These will be set for the static case var all_models = [{"attributes": {"fill_color": {"field": "color"}, "tags": [], "doc": null, "fill_alpha": {"field": "fill_alpha"}, "height": {"units": "data", "field": "height"}, "width": {"units": "data", "field": "width"}, "y": {"field": "y"}, "x": {"field": "x"}, "id": "c2298bb5-6373-4e34-b7b9-041b4f7e6046"}, "type": "Rect", "id": "c2298bb5-6373-4e34-b7b9-041b4f7e6046"}, {"attributes": {"fill_color": {"field": "color"}, "tags": [], "doc": null, "fill_alpha": {"field": "fill_alpha"}, "height": {"units": "data", "field": "height"}, "width": {"units": "data", "field": "width"}, "y": {"field": "y"}, "x": {"field": "x"}, "id": "778d2071-deb8-4833-83ff-6f1769b88df6"}, "type": "Rect", "id": "778d2071-deb8-4833-83ff-6f1769b88df6"}, {"attributes": {"fill_color": {"field": "color"}, "tags": [], "doc": null, "fill_alpha": {"field": "fill_alpha"}, "height": {"units": "data", "field": "height"}, "width": {"units": "data", "field": "width"}, "y": {"field": "y"}, "x": {"field": "x"}, "id": "de2a7778-ad84-4f64-b71a-f455a11a3be7"}, "type": "Rect", "id": "de2a7778-ad84-4f64-b71a-f455a11a3be7"}, {"attributes": {"end": 63.800000000000004, "callback": null, "doc": null, "tags": [], "start": 0.0, "id": "b026d7ef-0b6b-45a0-8733-f9ecb0b5d3d6"}, "type": "Range1d", "id": "b026d7ef-0b6b-45a0-8733-f9ecb0b5d3d6"}, {"attributes": {"column_names": ["width", "y", "color", "x", "fill_alpha", "height"], "tags": [], "doc": null, "selected": {"2d": {"indices": []}, "1d": {"indices": []}, "0d": {"indices": [], "flag": false}}, "callback": null, "data": {"color": ["#f22c40"], "fill_alpha": [0.8], "height": [13.0], "width": [3.1499999999999986], "y": [6.5], "x": [10.55]}, "id": "8777514e-00ad-4a47-b1e6-1f2f9fb32d3c"}, "type": "ColumnDataSource", "id": "8777514e-00ad-4a47-b1e6-1f2f9fb32d3c"}, {"attributes": {"column_names": ["width", "y", "color", "x", "fill_alpha", "height"], "tags": [], "doc": null, "selected": {"2d": {"indices": []}, "1d": {"indices": []}, "0d": {"indices": [], "flag": false}}, "callback": null, "data": {"color": ["#f22c40"], "fill_alpha": [0.8], "height": [10.0], "width": [3.1499999999999986], "y": [5.0], "x": [38.75]}, "id": "ff86ad06-8f78-4270-b9ca-6260faf420d6"}, "type": "ColumnDataSource", "id": "ff86ad06-8f78-4270-b9ca-6260faf420d6"}, {"attributes": {"geometries": [], "tags": [], "doc": null, "id": "ac598d59-cfc9-4512-b443-83cac4533495"}, "type": "ToolEvents", "id": "ac598d59-cfc9-4512-b443-83cac4533495"}, {"attributes": {"nonselection_glyph": null, "data_source": {"type": "ColumnDataSource", "id": "92f6a4fd-20e4-475c-be83-1796eb9b22d0"}, "tags": [], "doc": null, "selection_glyph": null, "id": "ac6ace88-5e12-4fbc-a219-f13d1f914faa", "glyph": {"type": "Rect", "id": "ac2b958e-4fdb-47d8-b046-5bebfb888b6a"}}, "type": "GlyphRenderer", "id": "ac6ace88-5e12-4fbc-a219-f13d1f914faa"}, {"attributes": {"fill_color": {"field": "color"}, "tags": [], "doc": null, "fill_alpha": {"field": "fill_alpha"}, "height": {"units": "data", "field": "height"}, "width": {"units": "data", "field": "width"}, "y": {"field": "y"}, "x": {"field": "x"}, "id": "7fcfa83d-2098-4d31-a702-ce73e40b53ab"}, "type": "Rect", "id": "7fcfa83d-2098-4d31-a702-ce73e40b53ab"}, {"attributes": {"plot": {"subtype": "Chart", "type": "Plot", "id": "f052776b-0e2a-4c6b-b75a-5794460a002f"}, "tags": [], "doc": null, "id": "c49cf3c7-fdd9-43e3-8c41-7e473ec78c8e"}, "type": "HelpTool", "id": "c49cf3c7-fdd9-43e3-8c41-7e473ec78c8e"}, {"attributes": {"nonselection_glyph": null, "data_source": {"type": "ColumnDataSource", "id": "953a0131-da18-44a3-8416-15ebc5717588"}, "tags": [], "doc": null, "selection_glyph": null, "id": "df630bff-670b-4bae-bf32-fb6def08bfba", "glyph": {"type": "Rect", "id": "5995de68-8cca-4e60-9f91-23613e2662d7"}}, "type": "GlyphRenderer", "id": "df630bff-670b-4bae-bf32-fb6def08bfba"}, {"attributes": {"nonselection_glyph": null, "data_source": {"type": "ColumnDataSource", "id": "4f28da13-3834-430f-894d-1ea588a58b7e"}, "tags": [], "doc": null, "selection_glyph": null, "id": "b6270692-5c4b-4d96-9232-874d240b60b7", "glyph": {"type": "Rect", "id": "0cb31797-92cd-40be-9d17-edfaa724ac04"}}, "type": "GlyphRenderer", "id": "b6270692-5c4b-4d96-9232-874d240b60b7"}, {"attributes": {"nonselection_glyph": null, "data_source": {"type": "ColumnDataSource", "id": "248ec2a4-a00e-42f0-9d25-09ce5efeef3b"}, "tags": [], "doc": null, "selection_glyph": null, "id": "5b5efa86-eae0-42e0-8b20-b6e872622cea", "glyph": {"type": "Rect", "id": "d0725dd9-ac7b-4ad8-8307-a3f9665db6fc"}}, "type": "GlyphRenderer", "id": "5b5efa86-eae0-42e0-8b20-b6e872622cea"}, {"attributes": {"plot": {"subtype": "Chart", "type": "Plot", "id": "f052776b-0e2a-4c6b-b75a-5794460a002f"}, "tags": [], "doc": null, "id": "02e5dd95-edb2-4cf3-9c46-1b3610331e16"}, "type": "ResetTool", "id": "02e5dd95-edb2-4cf3-9c46-1b3610331e16"}, {"attributes": {"plot": {"subtype": "Chart", "type": "Plot", "id": "f052776b-0e2a-4c6b-b75a-5794460a002f"}, "tags": [], "doc": null, "axis_label": "Count( Mpg )", "formatter": {"type": "BasicTickFormatter", "id": "01dd581a-2e54-4ab0-a1c9-87d8175b7428"}, "ticker": {"type": "BasicTicker", "id": "4f62db88-9c43-4957-a9bb-fbc3087a2522"}, "id": "6cbbfa45-1dd3-4018-9a86-ca9a85d548fe"}, "type": "LinearAxis", "id": "6cbbfa45-1dd3-4018-9a86-ca9a85d548fe"}, {"attributes": {"nonselection_glyph": null, "data_source": {"type": "ColumnDataSource", "id": "ff86ad06-8f78-4270-b9ca-6260faf420d6"}, "tags": [], "doc": null, "selection_glyph": null, "id": "f08364aa-504a-4b90-a928-d67d25391143", "glyph": {"type": "Rect", "id": "88c032db-4271-471a-b80a-9fe5e5d3e6d0"}}, "type": "GlyphRenderer", "id": "f08364aa-504a-4b90-a928-d67d25391143"}, {"attributes": {"end": 49.405, "callback": null, "doc": null, "tags": [], "start": 6.195000000000001, "id": "d37fad7b-1aaf-413b-8df2-b230497da653"}, "type": "Range1d", "id": "d37fad7b-1aaf-413b-8df2-b230497da653"}, {"attributes": {"fill_color": {"field": "color"}, "tags": [], "doc": null, "fill_alpha": {"field": "fill_alpha"}, "height": {"units": "data", "field": "height"}, "width": {"units": "data", "field": "width"}, "y": {"field": "y"}, "x": {"field": "x"}, "id": "0cb31797-92cd-40be-9d17-edfaa724ac04"}, "type": "Rect", "id": "0cb31797-92cd-40be-9d17-edfaa724ac04"}, {"attributes": {"plot": {"subtype": "Chart", "type": "Plot", "id": "f052776b-0e2a-4c6b-b75a-5794460a002f"}, "tags": [], "doc": null, "dimension": 1, "ticker": {"type": "BasicTicker", "id": "4f62db88-9c43-4957-a9bb-fbc3087a2522"}, "id": "6982ff10-9d0c-47c0-abc3-5cb150bab38e"}, "type": "Grid", "id": "6982ff10-9d0c-47c0-abc3-5cb150bab38e"}, {"attributes": {"fill_color": {"field": "color"}, "tags": [], "doc": null, "fill_alpha": {"field": "fill_alpha"}, "height": {"units": "data", "field": "height"}, "width": {"units": "data", "field": "width"}, "y": {"field": "y"}, "x": {"field": "x"}, "id": "5995de68-8cca-4e60-9f91-23613e2662d7"}, "type": "Rect", "id": "5995de68-8cca-4e60-9f91-23613e2662d7"}, {"attributes": {"plot": {"subtype": "Chart", "type": "Plot", "id": "f052776b-0e2a-4c6b-b75a-5794460a002f"}, "dimensions": ["width", "height"], "tags": [], "doc": null, "id": "1e13cd88-90e0-46a9-b432-2d85c9bb8164"}, "type": "WheelZoomTool", "id": "1e13cd88-90e0-46a9-b432-2d85c9bb8164"}, {"attributes": {"nonselection_glyph": null, "data_source": {"type": "ColumnDataSource", "id": "254b70bf-db63-4a7b-b3af-0866f10ebb73"}, "tags": [], "doc": null, "selection_glyph": null, "id": "184c27e2-cfe2-461c-8583-3e97dac26749", "glyph": {"type": "Rect", "id": "7fcfa83d-2098-4d31-a702-ce73e40b53ab"}}, "type": "GlyphRenderer", "id": "184c27e2-cfe2-461c-8583-3e97dac26749"}, {"attributes": {"nonselection_glyph": null, "data_source": {"type": "ColumnDataSource", "id": "b0b08036-123d-4b93-a27b-dc6ca6acf92c"}, "tags": [], "doc": null, "selection_glyph": null, "id": "4901d6a5-0b4a-463c-934f-6317280c9b4f", "glyph": {"type": "Rect", "id": "de2a7778-ad84-4f64-b71a-f455a11a3be7"}}, "type": "GlyphRenderer", "id": "4901d6a5-0b4a-463c-934f-6317280c9b4f"}, {"attributes": {"column_names": ["width", "y", "color", "x", "fill_alpha", "height"], "tags": [], "doc": null, "selected": {"2d": {"indices": []}, "1d": {"indices": []}, "0d": {"indices": [], "flag": false}}, "callback": null, "data": {"color": ["#f22c40"], "fill_alpha": [0.8], "height": [44.0], "width": [3.1499999999999986], "y": [22.0], "x": [23.1]}, "id": "254b70bf-db63-4a7b-b3af-0866f10ebb73"}, "type": "ColumnDataSource", "id": "254b70bf-db63-4a7b-b3af-0866f10ebb73"}, {"attributes": {"fill_color": {"field": "color"}, "tags": [], "doc": null, "fill_alpha": {"field": "fill_alpha"}, "height": {"units": "data", "field": "height"}, "width": {"units": "data", "field": "width"}, "y": {"field": "y"}, "x": {"field": "x"}, "id": "88c032db-4271-471a-b80a-9fe5e5d3e6d0"}, "type": "Rect", "id": "88c032db-4271-471a-b80a-9fe5e5d3e6d0"}, {"attributes": {"nonselection_glyph": null, "data_source": {"type": "ColumnDataSource", "id": "8777514e-00ad-4a47-b1e6-1f2f9fb32d3c"}, "tags": [], "doc": null, "selection_glyph": null, "id": "13d14b5d-6136-4432-afda-89605ac9ea13", "glyph": {"type": "Rect", "id": "49d3ef8d-5ccc-4ff8-b57c-136d1bd7d1de"}}, "type": "GlyphRenderer", "id": "13d14b5d-6136-4432-afda-89605ac9ea13"}, {"attributes": {"doc": null, "id": "8f76139d-cc01-4e5e-a2a3-b0f89c8b5f10", "tags": []}, "type": "BasicTickFormatter", "id": "8f76139d-cc01-4e5e-a2a3-b0f89c8b5f10"}, {"attributes": {"nonselection_glyph": null, "data_source": {"type": "ColumnDataSource", "id": "eb57e76c-77a2-445d-a8d2-fb2042abb646"}, "tags": [], "doc": null, "selection_glyph": null, "id": "da3e6fd5-9826-4e03-8210-56bb146e8ca8", "glyph": {"type": "Rect", "id": "c2298bb5-6373-4e34-b7b9-041b4f7e6046"}}, "type": "GlyphRenderer", "id": "da3e6fd5-9826-4e03-8210-56bb146e8ca8"}, {"attributes": {"fill_color": {"field": "color"}, "tags": [], "doc": null, "fill_alpha": {"field": "fill_alpha"}, "height": {"units": "data", "field": "height"}, "width": {"units": "data", "field": "width"}, "y": {"field": "y"}, "x": {"field": "x"}, "id": "f98fdd1f-8d3a-463b-9ce9-88a2499c4bd3"}, "type": "Rect", "id": "f98fdd1f-8d3a-463b-9ce9-88a2499c4bd3"}, {"attributes": {"column_names": ["width", "y", "color", "x", "fill_alpha", "height"], "tags": [], "doc": null, "selected": {"2d": {"indices": []}, "1d": {"indices": []}, "0d": {"indices": [], "flag": false}}, "callback": null, "data": {"color": ["#f22c40"], "fill_alpha": [0.8], "height": [38.0], "width": [3.1499999999999986], "y": [19.0], "x": [29.35]}, "id": "ade636b7-497f-453b-8695-962121b2761d"}, "type": "ColumnDataSource", "id": "ade636b7-497f-453b-8695-962121b2761d"}, {"attributes": {"nonselection_glyph": null, "data_source": {"type": "ColumnDataSource", "id": "8f3a4671-88b4-4dd0-8127-a8a98f7aa026"}, "tags": [], "doc": null, "selection_glyph": null, "id": "e89c5e6f-f527-4337-9379-faec126369a1", "glyph": {"type": "Rect", "id": "2fd41667-8adc-4a2e-9c40-7d5e7a410d0b"}}, "type": "GlyphRenderer", "id": "e89c5e6f-f527-4337-9379-faec126369a1"}, {"attributes": {"fill_color": {"field": "color"}, "tags": [], "doc": null, "fill_alpha": {"field": "fill_alpha"}, "height": {"units": "data", "field": "height"}, "width": {"units": "data", "field": "width"}, "y": {"field": "y"}, "x": {"field": "x"}, "id": "2fd41667-8adc-4a2e-9c40-7d5e7a410d0b"}, "type": "Rect", "id": "2fd41667-8adc-4a2e-9c40-7d5e7a410d0b"}, {"attributes": {"column_names": ["width", "y", "color", "x", "fill_alpha", "height"], "tags": [], "doc": null, "selected": {"2d": {"indices": []}, "1d": {"indices": []}, "0d": {"indices": [], "flag": false}}, "callback": null, "data": {"color": ["#f22c40"], "fill_alpha": [0.8], "height": [49.0], "width": [3.1499999999999986], "y": [24.5], "x": [26.25]}, "id": "b0b08036-123d-4b93-a27b-dc6ca6acf92c"}, "type": "ColumnDataSource", "id": "b0b08036-123d-4b93-a27b-dc6ca6acf92c"}, {"attributes": {"column_names": ["width", "y", "color", "x", "fill_alpha", "height"], "tags": [], "doc": null, "selected": {"2d": {"indices": []}, "1d": {"indices": []}, "0d": {"indices": [], "flag": false}}, "callback": null, "data": {"color": ["#f22c40"], "fill_alpha": [0.8], "height": [58.0], "width": [3.1499999999999986], "y": [29.0], "x": [16.85]}, "id": "1855c6f6-3fcc-4fc9-b938-45fe16de7ec1"}, "type": "ColumnDataSource", "id": "1855c6f6-3fcc-4fc9-b938-45fe16de7ec1"}, {"attributes": {"fill_color": {"field": "color"}, "tags": [], "doc": null, "fill_alpha": {"field": "fill_alpha"}, "height": {"units": "data", "field": "height"}, "width": {"units": "data", "field": "width"}, "y": {"field": "y"}, "x": {"field": "x"}, "id": "49d3ef8d-5ccc-4ff8-b57c-136d1bd7d1de"}, "type": "Rect", "id": "49d3ef8d-5ccc-4ff8-b57c-136d1bd7d1de"}, {"attributes": {"plot": {"subtype": "Chart", "type": "Plot", "id": "f052776b-0e2a-4c6b-b75a-5794460a002f"}, "dimensions": ["width", "height"], "tags": [], "doc": null, "id": "11578a10-affd-43c6-97f4-6d83fa34623a"}, "type": "BoxZoomTool", "id": "11578a10-affd-43c6-97f4-6d83fa34623a"}, {"attributes": {"nonselection_glyph": null, "data_source": {"type": "ColumnDataSource", "id": "ade636b7-497f-453b-8695-962121b2761d"}, "tags": [], "doc": null, "selection_glyph": null, "id": "a20e42a8-3017-4c43-b0af-b8c7cc062569", "glyph": {"type": "Rect", "id": "778d2071-deb8-4833-83ff-6f1769b88df6"}}, "type": "GlyphRenderer", "id": "a20e42a8-3017-4c43-b0af-b8c7cc062569"}, {"attributes": {"fill_color": {"field": "color"}, "tags": [], "doc": null, "fill_alpha": {"field": "fill_alpha"}, "height": {"units": "data", "field": "height"}, "width": {"units": "data", "field": "width"}, "y": {"field": "y"}, "x": {"field": "x"}, "id": "d0725dd9-ac7b-4ad8-8307-a3f9665db6fc"}, "type": "Rect", "id": "d0725dd9-ac7b-4ad8-8307-a3f9665db6fc"}, {"attributes": {"doc": null, "id": "01dd581a-2e54-4ab0-a1c9-87d8175b7428", "tags": []}, "type": "BasicTickFormatter", "id": "01dd581a-2e54-4ab0-a1c9-87d8175b7428"}, {"attributes": {"fill_color": {"field": "color"}, "tags": [], "doc": null, "fill_alpha": {"field": "fill_alpha"}, "height": {"units": "data", "field": "height"}, "width": {"units": "data", "field": "width"}, "y": {"field": "y"}, "x": {"field": "x"}, "id": "ac2b958e-4fdb-47d8-b046-5bebfb888b6a"}, "type": "Rect", "id": "ac2b958e-4fdb-47d8-b046-5bebfb888b6a"}, {"attributes": {"tags": [], "doc": null, "mantissas": [2, 5, 10], "id": "4f62db88-9c43-4957-a9bb-fbc3087a2522"}, "type": "BasicTicker", "id": "4f62db88-9c43-4957-a9bb-fbc3087a2522"}, {"attributes": {"plot": {"subtype": "Chart", "type": "Plot", "id": "f052776b-0e2a-4c6b-b75a-5794460a002f"}, "tags": [], "doc": null, "axis_label": "mpg", "formatter": {"type": "BasicTickFormatter", "id": "8f76139d-cc01-4e5e-a2a3-b0f89c8b5f10"}, "ticker": {"type": "BasicTicker", "id": "c2ceea5a-d7a1-4813-85f4-832a1619425c"}, "id": "406fc489-5182-461d-9047-9ac77af1d863"}, "type": "LinearAxis", "id": "406fc489-5182-461d-9047-9ac77af1d863"}, {"attributes": {"column_names": ["width", "y", "color", "x", "fill_alpha", "height"], "tags": [], "doc": null, "selected": {"2d": {"indices": []}, "1d": {"indices": []}, "0d": {"indices": [], "flag": false}}, "callback": null, "data": {"color": ["#f22c40"], "fill_alpha": [0.8], "height": [55.0], "width": [3.1499999999999986], "y": [27.5], "x": [19.95]}, "id": "eb57e76c-77a2-445d-a8d2-fb2042abb646"}, "type": "ColumnDataSource", "id": "eb57e76c-77a2-445d-a8d2-fb2042abb646"}, {"attributes": {"column_names": ["width", "y", "color", "x", "fill_alpha", "height"], "tags": [], "doc": null, "selected": {"2d": {"indices": []}, "1d": {"indices": []}, "0d": {"indices": [], "flag": false}}, "callback": null, "data": {"color": ["#f22c40"], "fill_alpha": [0.8], "height": [4.0], "width": [3.1499999999999986], "y": [2.0], "x": [41.9]}, "id": "248ec2a4-a00e-42f0-9d25-09ce5efeef3b"}, "type": "ColumnDataSource", "id": "248ec2a4-a00e-42f0-9d25-09ce5efeef3b"}, {"attributes": {"tags": [], "doc": null, "mantissas": [2, 5, 10], "id": "c2ceea5a-d7a1-4813-85f4-832a1619425c"}, "type": "BasicTicker", "id": "c2ceea5a-d7a1-4813-85f4-832a1619425c"}, {"attributes": {"nonselection_glyph": null, "data_source": {"type": "ColumnDataSource", "id": "1855c6f6-3fcc-4fc9-b938-45fe16de7ec1"}, "tags": [], "doc": null, "selection_glyph": null, "id": "71c97f90-15d3-44e0-aff4-7a4d95c2aabe", "glyph": {"type": "Rect", "id": "f98fdd1f-8d3a-463b-9ce9-88a2499c4bd3"}}, "type": "GlyphRenderer", "id": "71c97f90-15d3-44e0-aff4-7a4d95c2aabe"}, {"attributes": {"column_names": ["width", "y", "color", "x", "fill_alpha", "height"], "tags": [], "doc": null, "selected": {"2d": {"indices": []}, "1d": {"indices": []}, "0d": {"indices": [], "flag": false}}, "callback": null, "data": {"color": ["#f22c40"], "fill_alpha": [0.8], "height": [37.0], "width": [3.1499999999999986], "y": [18.5], "x": [32.485]}, "id": "92f6a4fd-20e4-475c-be83-1796eb9b22d0"}, "type": "ColumnDataSource", "id": "92f6a4fd-20e4-475c-be83-1796eb9b22d0"}, {"attributes": {"plot": {"subtype": "Chart", "type": "Plot", "id": "f052776b-0e2a-4c6b-b75a-5794460a002f"}, "dimensions": ["width", "height"], "tags": [], "doc": null, "id": "8198b320-ad97-4bf3-9672-a1519fb8f5b0"}, "type": "PanTool", "id": "8198b320-ad97-4bf3-9672-a1519fb8f5b0"}, {"attributes": {"column_names": ["width", "y", "color", "x", "fill_alpha", "height"], "tags": [], "doc": null, "selected": {"2d": {"indices": []}, "1d": {"indices": []}, "0d": {"indices": [], "flag": false}}, "callback": null, "data": {"color": ["#f22c40"], "fill_alpha": [0.8], "height": [4.0], "width": [3.1499999999999986], "y": [2.0], "x": [45.05]}, "id": "8f3a4671-88b4-4dd0-8127-a8a98f7aa026"}, "type": "ColumnDataSource", "id": "8f3a4671-88b4-4dd0-8127-a8a98f7aa026"}, {"attributes": {"plot": {"subtype": "Chart", "type": "Plot", "id": "f052776b-0e2a-4c6b-b75a-5794460a002f"}, "tags": [], "doc": null, "id": "9d653489-c020-4f43-bda5-b30859241542"}, "type": "ResizeTool", "id": "9d653489-c020-4f43-bda5-b30859241542"}, {"attributes": {"column_names": ["width", "y", "color", "x", "fill_alpha", "height"], "tags": [], "doc": null, "selected": {"2d": {"indices": []}, "1d": {"indices": []}, "0d": {"indices": [], "flag": false}}, "callback": null, "data": {"color": ["#f22c40"], "fill_alpha": [0.8], "height": [24.0], "width": [3.1499999999999986], "y": [12.0], "x": [35.635000000000005]}, "id": "4f28da13-3834-430f-894d-1ea588a58b7e"}, "type": "ColumnDataSource", "id": "4f28da13-3834-430f-894d-1ea588a58b7e"}, {"attributes": {"column_names": ["width", "y", "color", "x", "fill_alpha", "height"], "tags": [], "doc": null, "selected": {"2d": {"indices": []}, "1d": {"indices": []}, "0d": {"indices": [], "flag": false}}, "callback": null, "data": {"color": ["#f22c40"], "fill_alpha": [0.8], "height": [56.0], "width": [3.1499999999999986], "y": [28.0], "x": [13.7]}, "id": "953a0131-da18-44a3-8416-15ebc5717588"}, "type": "ColumnDataSource", "id": "953a0131-da18-44a3-8416-15ebc5717588"}, {"subtype": "Chart", "type": "Plot", "id": "f052776b-0e2a-4c6b-b75a-5794460a002f", "attributes": {"x_range": {"type": "Range1d", "id": "d37fad7b-1aaf-413b-8df2-b230497da653"}, "title_text_font_style": "bold", "title_text_font_size": {"value": "12pt"}, "tags": [], "plot_width": 550, "renderers": [{"type": "GlyphRenderer", "id": "13d14b5d-6136-4432-afda-89605ac9ea13"}, {"type": "GlyphRenderer", "id": "df630bff-670b-4bae-bf32-fb6def08bfba"}, {"type": "GlyphRenderer", "id": "71c97f90-15d3-44e0-aff4-7a4d95c2aabe"}, {"type": "GlyphRenderer", "id": "da3e6fd5-9826-4e03-8210-56bb146e8ca8"}, {"type": "GlyphRenderer", "id": "184c27e2-cfe2-461c-8583-3e97dac26749"}, {"type": "GlyphRenderer", "id": "4901d6a5-0b4a-463c-934f-6317280c9b4f"}, {"type": "GlyphRenderer", "id": "a20e42a8-3017-4c43-b0af-b8c7cc062569"}, {"type": "GlyphRenderer", "id": "ac6ace88-5e12-4fbc-a219-f13d1f914faa"}, {"type": "GlyphRenderer", "id": "b6270692-5c4b-4d96-9232-874d240b60b7"}, {"type": "GlyphRenderer", "id": "f08364aa-504a-4b90-a928-d67d25391143"}, {"type": "GlyphRenderer", "id": "5b5efa86-eae0-42e0-8b20-b6e872622cea"}, {"type": "GlyphRenderer", "id": "e89c5e6f-f527-4337-9379-faec126369a1"}, {"type": "LinearAxis", "id": "406fc489-5182-461d-9047-9ac77af1d863"}, {"type": "LinearAxis", "id": "6cbbfa45-1dd3-4018-9a86-ca9a85d548fe"}, {"type": "Grid", "id": "6982ff10-9d0c-47c0-abc3-5cb150bab38e"}], "plot_height": 350, "right": [], "tool_events": {"type": "ToolEvents", "id": "ac598d59-cfc9-4512-b443-83cac4533495"}, "responsive": false, "tools": [{"type": "PanTool", "id": "8198b320-ad97-4bf3-9672-a1519fb8f5b0"}, {"type": "WheelZoomTool", "id": "1e13cd88-90e0-46a9-b432-2d85c9bb8164"}, {"type": "BoxZoomTool", "id": "11578a10-affd-43c6-97f4-6d83fa34623a"}, {"type": "PreviewSaveTool", "id": "c7067635-eb79-473c-845e-2fa784b5796b"}, {"type": "ResizeTool", "id": "9d653489-c020-4f43-bda5-b30859241542"}, {"type": "ResetTool", "id": "02e5dd95-edb2-4cf3-9c46-1b3610331e16"}, {"type": "HelpTool", "id": "c49cf3c7-fdd9-43e3-8c41-7e473ec78c8e"}], "id": "f052776b-0e2a-4c6b-b75a-5794460a002f", "title": "MPG Distribution", "y_range": {"type": "Range1d", "id": "b026d7ef-0b6b-45a0-8733-f9ecb0b5d3d6"}, "extra_y_ranges": {}, "below": [{"type": "LinearAxis", "id": "406fc489-5182-461d-9047-9ac77af1d863"}], "extra_x_ranges": {}, "above": [], "doc": null, "left": [{"type": "LinearAxis", "id": "6cbbfa45-1dd3-4018-9a86-ca9a85d548fe"}]}}, {"attributes": {"plot": {"subtype": "Chart", "type": "Plot", "id": "f052776b-0e2a-4c6b-b75a-5794460a002f"}, "tags": [], "doc": null, "id": "c7067635-eb79-473c-845e-2fa784b5796b"}, "type": "PreviewSaveTool", "id": "c7067635-eb79-473c-845e-2fa784b5796b"}]; if(typeof(Bokeh) !== "undefined") { console.log("Bokeh: BokehJS loaded, going straight to plotting"); Bokeh.embed.inject_plot("b2fd3a34-bdea-42f1-86b5-c5296e9d354a", all_models); } else { load_lib(bokehjs_url, function() { console.log("Bokeh: BokehJS plotting callback run at", new Date()) Bokeh.embed.inject_plot("b2fd3a34-bdea-42f1-86b5-c5296e9d354a", all_models); }); } }(this));
492.638298
21,395
0.628747
e00fe0ed7fed679faa5bbe388bc6a91c74d609b2
127
js
JavaScript
www/js/controller.js
lakmalniranga/ionic-boilerplate
f588009545199a21198aa27adf0d808d35f03473
[ "MIT" ]
null
null
null
www/js/controller.js
lakmalniranga/ionic-boilerplate
f588009545199a21198aa27adf0d808d35f03473
[ "MIT" ]
null
null
null
www/js/controller.js
lakmalniranga/ionic-boilerplate
f588009545199a21198aa27adf0d808d35f03473
[ "MIT" ]
null
null
null
app.controller('HomeCtrl', ['$scope', function($scope){ }]); app.controller('AnotherCtrl', ['$scope', function($scope){ }]);
18.142857
58
0.637795
e00fefb7137a3816ecad5bd75ea2ffc9f2bfcfc8
1,382
js
JavaScript
test/server/api/services/admin/beneficiariesSpec.js
jbournonville/gadael
3e60daf688e0002888f7624b56a304d018aef8d2
[ "MIT" ]
56
2016-02-28T09:49:04.000Z
2021-07-21T06:54:25.000Z
test/server/api/services/admin/beneficiariesSpec.js
jbournonville/gadael
3e60daf688e0002888f7624b56a304d018aef8d2
[ "MIT" ]
39
2017-06-07T07:49:58.000Z
2022-01-26T10:13:52.000Z
test/server/api/services/admin/beneficiariesSpec.js
jbournonville/gadael
3e60daf688e0002888f7624b56a304d018aef8d2
[ "MIT" ]
27
2017-11-17T18:22:21.000Z
2021-04-09T19:05:36.000Z
'use strict'; var app = require('../../../../../api/Headless.api.js'); describe('users admin API service', function UsersTestSuite() { it("should connect to the database", function(done) { app.connect(function() { done(); }); }); it("verify beneficiaries query", function(done) { var find = app.db.models.Beneficiary.find({}); find.populate('right'); find.select('right document ref').sort('right.name'); find.exec(function(err, list) { done(); }); }); it("request users list", function(done) { var list = app.getService('admin/users/list'); list.getResultPromise().then(function(val) { expect(list.httpstatus).toEqual(200); done(); }); }); it("request beneficiaries list", function(done) { var list = app.getService('admin/beneficiaries/list'); list.getResultPromise({ account: null }).then(function(val) { // not used expect(list.httpstatus).toEqual(500); done(); }, function(err) { // account is mandatory parameter // the promise will return error expect(list.httpstatus).toEqual(500); done(); }); }); it("should disconnect from the database", function(done) { app.disconnect(function() { done(); }); }); });
25.592593
69
0.557887
e0103829a085665bfe7b3e86981fed931e0bd610
244
js
JavaScript
playground/resources/tune.json/odd2.js
gibber-cc/Gibber
05f17b5058cbfa970d287e7d70594f242199f1e2
[ "MIT" ]
374
2017-07-05T18:46:34.000Z
2022-03-19T10:58:46.000Z
playground/resources/tune.json/odd2.js
gibber-cc/Gibber
05f17b5058cbfa970d287e7d70594f242199f1e2
[ "MIT" ]
41
2017-06-11T16:34:04.000Z
2022-02-16T19:02:35.000Z
playground/resources/tune.json/odd2.js
gibber-cc/Gibber
05f17b5058cbfa970d287e7d70594f242199f1e2
[ "MIT" ]
32
2017-06-08T03:09:09.000Z
2022-02-17T22:16:22.000Z
{"frequencies":[261.6255653006,290.69507255622,294.32876096318,306.59245933664,313.95067836072,327.03195662575,348.83408706747,363.36884069528,392.4383479509,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"ODD-2"}
244
244
0.840164
e0109718afe4855f089949b22141b58ed519d1eb
1,939
js
JavaScript
08dom/07removingReplacingElements.js
hn3ir/Hannah-FED
dc2f6fd2020cdf72c7ae78def475b5cb8f0da493
[ "MIT" ]
null
null
null
08dom/07removingReplacingElements.js
hn3ir/Hannah-FED
dc2f6fd2020cdf72c7ae78def475b5cb8f0da493
[ "MIT" ]
null
null
null
08dom/07removingReplacingElements.js
hn3ir/Hannah-FED
dc2f6fd2020cdf72c7ae78def475b5cb8f0da493
[ "MIT" ]
null
null
null
// Replacing Items // Create a new element to replace the original with const newHeading = document.createElement('h2'); //add ID newHeading.id = 'task-title' // new textnode newHeading.appendChild(document.createTextNode('New Tasks Heading')); console.log(newHeading); // First, get the old element thats to be replaced const oldHeading = document.getElementById('task-title'); // second, grab the parent of element that's to be replaced const cardAction = document.querySelector('.card-action'); // finally, and thirdly, to replace old element with new cardAction.replaceChild(newHeading, oldHeading); // Removing items const lis = document.querySelectorAll('li'); // variable for list-items const list = document.querySelector('ul'); // variable for the ul // remove list-item using remove() lis[0].remove(); // remove child element list.removeChild(lis[3]); // classes and attributes const firstLi = document.querySelector('li:first-child'); console.log(firstLi.children[0]); const link = firstLi.children[0]; let val; // classes val = link.className; //gives us the string of classes val = link.classList; // not actually an Array, but a Dom-tokenList which is set up like an array val = link.classList[0]; val = link.classList.add('test'); // to add a class val = link.classList.remove('test'); // removes a class val = link; // other attributes val = link.getAttribute('href'); // gives us value of attribute val = link.setAttribute('href', 'https://google.com'); // changes the value of attribute // first parameter is the actual attribute // second parameter sets the new value val = link.hasAttribute('href'); // returns a boolean value; checks if theres an attribute or not val = link.setAttribute('title', 'TaskListo4MyBros'); val = link.hasAttribute('title'); val = link.removeAttribute('title'); // removes attribute // output console.log(val);
24.858974
80
0.712739
e0113bf687f808f7401db8044298ce1518445394
534
js
JavaScript
elements/utils/mixins/main-dom-element.js
ucd-library/ucdlib-theme
13eb2894d54539e59c8f346518d57711ed21a066
[ "MIT" ]
null
null
null
elements/utils/mixins/main-dom-element.js
ucd-library/ucdlib-theme
13eb2894d54539e59c8f346518d57711ed21a066
[ "MIT" ]
39
2021-07-13T15:40:20.000Z
2022-03-29T14:32:52.000Z
elements/utils/mixins/main-dom-element.js
ucd-library/ucdlib-theme
13eb2894d54539e59c8f346518d57711ed21a066
[ "MIT" ]
null
null
null
/** * @function MainDomElement * @param {Class} superClass - LitElement or child class. * @description set render context for lit element to main DOM instead of the * default shadow root * * @returns {Class} LitElement updated createRenderRoot function. */ const MainDomElement = (superClass) => class extends superClass { /** * @method createRenderRoot * @description set the root element to render into * * @returns {LitElement} */ createRenderRoot() { return this; } }; export {MainDomElement};
23.217391
77
0.694757
e0119d0f8114b8b93a94cbc146c4f0427658a358
1,688
js
JavaScript
src/Confluence.js
pustovitDmytro/atlassian
6bfcbbbdd8eea571c08a8c17ce86acce424d6a18
[ "MIT" ]
null
null
null
src/Confluence.js
pustovitDmytro/atlassian
6bfcbbbdd8eea571c08a8c17ce86acce424d6a18
[ "MIT" ]
91
2021-04-23T21:14:18.000Z
2022-03-29T00:03:56.000Z
src/Confluence.js
pustovitDmytro/atlassian
6bfcbbbdd8eea571c08a8c17ce86acce424d6a18
[ "MIT" ]
3
2021-04-23T21:12:08.000Z
2021-09-20T10:59:47.000Z
import path from 'path'; import fs from 'fs-extra'; import { pause } from 'myrmidon'; import Api from './api/ConfluenceApi'; const CONFLUENCE_LOG_POLLING_INTERVAL = 500; export default class Confluence extends Api { constructor(config, logger) { super(config.host, { username : config.email, password : config.token }); this.userId = config.userId; this.host = config.host; this.initLogger(logger); } async getPages(space) { return this.pagesList(space); } async resolveLongTask(taskId) { const task = await this.getLongTask(taskId); if (task.finished) return task; await pause(CONFLUENCE_LOG_POLLING_INTERVAL); return this.resolveLongTask(taskId); } async exportPage(pageId, filename) { const pdfpageexport = await this.pdfpageexport(pageId); if (!pdfpageexport?.taskId) throw new Error('Task has not been started by pdfpageexport'); const task = await this.resolveLongTask(pdfpageexport.taskId); const downloadUrl = task.text.match(/<a class="space-export-download-path" href="([^">]*)">/i)[1]; const filePath = path.resolve(filename); const writer = fs.createWriteStream(filePath); this.logger.log('verbose', { downloadUrl: `${this.host}${downloadUrl}` }); const stream = await this.downloadFile(downloadUrl); stream.pipe(writer); await new Promise((resolve, reject) => { writer.on('finish', resolve); writer.on('error', reject); }); this.logger.log('info', `written to ${filePath}`); return filePath; } }
29.103448
106
0.626185
e0147afa072ed0ee12f1a681e112c83d385f41a0
1,272
js
JavaScript
!Work/190310-inherit-prototypes/test011.js
lilliputten/webpack-bem-sample-v01-1903
46dcfa516e03f4c91c420b84544522facde60b19
[ "MIT" ]
null
null
null
!Work/190310-inherit-prototypes/test011.js
lilliputten/webpack-bem-sample-v01-1903
46dcfa516e03f4c91c420b84544522facde60b19
[ "MIT" ]
null
null
null
!Work/190310-inherit-prototypes/test011.js
lilliputten/webpack-bem-sample-v01-1903
46dcfa516e03f4c91c420b84544522facde60b19
[ "MIT" ]
null
null
null
/* eslint-disable no-debugger */ const inherit = require('inherit'); /** Block1A ** {{{ */ const Block1A = inherit({ __constructor: function() { console.log('Block1A:__constructor'); // debugger; this.__base && this.__base.apply(this, arguments); }, method1: function() { console.log('Block1A:method1'); // debugger; this.__base && this.__base.apply(this, arguments); }, });/*}}}*/ /** Block1B ** {{{ */ const Block1B = inherit({ __constructor: function() { console.log('Block1B:__constructor'); // debugger; this.__base && this.__base.apply(this, arguments); }, method1: function() { console.log('Block1B:method1'); // debugger; this.__base && this.__base.apply(this, arguments); }, });/*}}}*/ /** Block2 ** {{{ */ const Block2 = inherit(Block1A, { __constructor: function() { console.log('Block2:__constructor'); // debugger; this.__base && this.__base.apply(this, arguments); }, method1: function() { console.log('Block2:method1'); // debugger; this.__base && this.__base.apply(this, arguments); }, });/*}}}*/ debugger; const blockA = new Block1A(); console.log(// inherit, Block1A, blockA, 'blockA:method1:', blockA.method1 && blockA.method1(), '\n'); debugger;
22.714286
56
0.615566
e014d5f7767af064851d28b2a86d469e5b6d5eda
2,861
js
JavaScript
test/required-params.test.js
JamieREvans/RequiredParams
4c2ce6053584b5438564c72efd2db5949e799aa4
[ "MIT" ]
null
null
null
test/required-params.test.js
JamieREvans/RequiredParams
4c2ce6053584b5438564c72efd2db5949e799aa4
[ "MIT" ]
null
null
null
test/required-params.test.js
JamieREvans/RequiredParams
4c2ce6053584b5438564c72efd2db5949e799aa4
[ "MIT" ]
null
null
null
require('rootpath')(); var request = require('supertest')(require('test/test-app.js')); var expect = require('chai').expect; describe('Required Params', function() { describe('GET /endpoint', function() { describe('without the required parameters', function() { it('should return 422 with the missing parameters, skipping default parameters', function(done) { request .get('/endpoint') .expect(function(response) { expect(response.body.missing_params).to.contain('q'); }) .expect(422, done); }); }); describe('with the required parameters', function() { it('should return 200', function(done) { request .get('/endpoint') .query({ q: '', limit: 5, offset: 0 }) .expect(function(response) { expect(response.body).to.equal('hello world - 0 - 5'); }) .expect(200, done); }); }); describe('with the only a query', function() { it('should return 200 and a 30 limit and 0 offset', function(done) { request .get('/endpoint') .query({ q: '' }) .expect(function(response) { expect(response.body).to.equal('hello world - 0 - 30'); }) .expect(200, done); }); }); }); describe('POST /endpoint', function() { describe('without the required parameters', function() { it('should return 422 with the missing parameters', function(done) { request .post('/endpoint') .send({}) .expect(function(response) { expect(response.body.missing_params).to.contain('username', 'email'); }) .expect(422, done); }); }); describe('with the required parameters', function() { it('should return 201', function(done) { request .post('/endpoint') .send({ email: '', username: '' }) .expect(function(response) { expect(response.body).to.equal('created'); }) .expect(201, done); }); }); }); describe('POST /endpoint/nested', function() { describe('without the required parameters', function() { it('should return 422 with the missing parameters', function(done) { request .post('/endpoint/nested') .send({}) .expect(function(response) { expect(response.body.missing_params).to.contain('user.first_name', 'user.email'); }) .expect(422, done); }); }); describe('with the required parameters', function() { it('should return 201', function(done) { request .post('/endpoint/nested') .send( { user: { email: 'hello', first_name: 'hi' } }) .expect('"hola"') .expect(201, done); }); }); }); });
32.511364
103
0.537225
e01576a5446c56be6ccd0b7fb3c2b4ac1eb4d6d7
471
js
JavaScript
frontend/src/pages/Home.js
WernerBudtke/mytinerary-budtke
6e008c451a7c2e0b7a73e1a0ff6630d392e762b3
[ "MIT" ]
null
null
null
frontend/src/pages/Home.js
WernerBudtke/mytinerary-budtke
6e008c451a7c2e0b7a73e1a0ff6630d392e762b3
[ "MIT" ]
1
2021-10-19T14:02:34.000Z
2021-10-19T14:02:34.000Z
frontend/src/pages/Home.js
WernerBudtke/mytinerary-budtke
6e008c451a7c2e0b7a73e1a0ff6630d392e762b3
[ "MIT" ]
null
null
null
import Header from '../components/Header' import Footer from '../components/Footer' import Mainhome from '../components/Mainhome' import { useEffect } from 'react' const Home = () =>{ useEffect(() =>{ window.scrollTo(0,0) document.title = "myTinerary - Home" return () => document.title = "myTinerary" },[]) return ( <> <Header/> <Mainhome/> <Footer/> </> ) } export default Home
24.789474
50
0.545648
e018c43d43ad5b72603b52450fa83fd37f426c93
459
js
JavaScript
public/js/stats/linelength.js
maconard/watson-code-reviewer
de1479150f36222426227d741364b25f19218ac1
[ "Apache-2.0" ]
1
2019-07-19T18:00:07.000Z
2019-07-19T18:00:07.000Z
public/js/stats/linelength.js
maconard/watson-code-reviewer
de1479150f36222426227d741364b25f19218ac1
[ "Apache-2.0" ]
null
null
null
public/js/stats/linelength.js
maconard/watson-code-reviewer
de1479150f36222426227d741364b25f19218ac1
[ "Apache-2.0" ]
1
2019-07-15T17:30:20.000Z
2019-07-15T17:30:20.000Z
statRules.lineLength = function(stats, code) { let totalLines = 0.0; let maxLineLen = 0; let count = 0; for (let i in code.lines) { let len = code.lines[i].length; totalLines += len; count++; stats.lines[i].lineLength = len; if (len > maxLineLen) maxLineLen = len; } stats.numLines = count; stats.maxLineLength = maxLineLen; stats.avgLineLength = totalLines / count; }
24.157895
48
0.572985
e01a2e30b4cecc9fb7e37287a07bab620e81a923
487
js
JavaScript
src/measures/correlations.js
yarden-livnat/cg-core
75e11b5910a5f9b8e96279c561f259ad4053818c
[ "MIT" ]
null
null
null
src/measures/correlations.js
yarden-livnat/cg-core
75e11b5910a5f9b8e96279c561f259ad4053818c
[ "MIT" ]
null
null
null
src/measures/correlations.js
yarden-livnat/cg-core
75e11b5910a5f9b8e96279c561f259ad4053818c
[ "MIT" ]
null
null
null
/** * Created by yarden on 5/31/16. */ import * as d3 from 'd3'; function variance(a) { if (a.var == undefined) { if (a.mean == undefined) a.mean = d3.mean(a); let ss = 0; for (let v of a) { ss += v * v; } a.var = ss - a.length * a.mean; } return a.var; } export function pearson(a, b) { let n = a.length, cov = -n * a.mean * b.mean; for (let i=0; i<n; i++) { cov += a[i] * b[i]; } return cov*cov / (variance(a) * variance(b)); }
16.233333
50
0.49692
e01b2690d667bd89d288a9c53250d453e812c969
3,583
js
JavaScript
src/pages/sol-lewitt/wall-drawing-16.js
kimdhoe/dhk.github.io
2963215f4f10b9b05bb60fb87ca2a98af35940f5
[ "MIT" ]
null
null
null
src/pages/sol-lewitt/wall-drawing-16.js
kimdhoe/dhk.github.io
2963215f4f10b9b05bb60fb87ca2a98af35940f5
[ "MIT" ]
12
2021-03-01T20:34:39.000Z
2022-02-26T14:06:54.000Z
src/pages/sol-lewitt/wall-drawing-16.js
kimdhoe/dhk.github.io
2963215f4f10b9b05bb60fb87ca2a98af35940f5
[ "MIT" ]
null
null
null
import React from 'react' import { css } from 'glamor' import random from 'canvas-sketch-util/random' import Layout from '../../components/layout' const LINE_SPACING = 5 const WIDTH = 512 const BAND_WIDTH = WIDTH / random.range(1.5, 3) class Sol16 extends React.Component { canvas = React.createRef() componentDidMount () { const canvas = this.canvas.current const context = canvas.getContext('2d') const makePaths = () => { const paths = [] const diagonalLength = Math.sqrt(2 * WIDTH * WIDTH) for (let x = 0; x <= diagonalLength; x += LINE_SPACING) { const a = { x, y: 0 } const b = { x, y: BAND_WIDTH } paths.push([ a, b ]) } return paths } const drawBand = () => { paths.forEach(([ a, b ]) => { context.beginPath() context.moveTo(a.x, a.y) context.lineTo(b.x, b.y) context.strokeStyle = '#aaa' context.lineWidth = 1 context.stroke() }) } const paths = makePaths() context.fillStyle = 'white' context.fillRect(0, 0, WIDTH, WIDTH) context.save() context.translate(0, WIDTH / 2 - BAND_WIDTH / 2) drawBand() context.restore() context.save() context.translate(WIDTH / 2 + BAND_WIDTH / 2, 0) context.rotate(Math.PI / 2) drawBand() context.restore() const offset = Math.sqrt(BAND_WIDTH * BAND_WIDTH / 2) / 2 context.translate(-offset, WIDTH - offset) context.rotate(Math.PI / -4) drawBand() } render () { return ( <Layout> <div> <h2 style={{ textAlign: 'center' }}> [Sol LeWitt] Wall Drawing #16 (1969) </h2> <div className={styles.art}> <canvas ref={this.canvas} width={WIDTH} height={WIDTH} /> </div> <div className={styles.labelWrapper}> <div className={styles.label}> <p className={styles.artist}> SOL LEWITT </p> <p className={styles.artwork}> <span className={styles.italic}>Wall drawing</span> , dhk.party </p> <p className={styles.medium}> Digital (HTML5 Canvas) </p> </div> </div> <p className={styles.paragraph}> 이 작품에 대한 솔 르윗의 지시사항은 다음과 같다. </p> <blockquote className={styles.instructionContent}> Bands of lines 12 inches (30 cm) wide,<br /> in three directions (vertical, horizontal, diagonal right) intersecting.<br /><br /> 세 가지 방향(수직, 수평, 우대각)으로 교차하는 30cm 폭의 줄무늬 띠. </blockquote> <p> 폭이 무작위로 정해지는 세 개의 줄무의 띠들이 벽면 정중앙에서 교차하도록 했다. </p> </div> </Layout> ) } } const styles = { art: css({ margin: '40px 0', textAlign: 'center', }), labelWrapper: css({ display: 'flex', justifyContent: 'center', }), label: css({ marginBottom: '30px', }), artist: css({ margin: 0, padding: 0, fontWeight: 'bold', textDecoration: 'underline', }), artwork: css({ margin: 0, padding: 0, }), medium: css({ margin: 0, padding: 0, }), italic: css({ fontStyle: 'italic', }), paragraph: css({ }), instruction: css({ }), instructionContent: css({ paddingLeft: '20px', borderLeft: 'solid 7px #f1f3f5', fontFamily: 'monospace', fontSize: '1.1em', }), code: css({ }) } export default Sol16
22.534591
96
0.52777
e01d31aa0423d81f49b813ac48c70aa1125d7054
17,417
js
JavaScript
src/chartmogul/chartmogul-router.js
Dakad/dashyAPINode
c9f809d31d33c58c5a95b87e8e930c67ba90295d
[ "MIT" ]
null
null
null
src/chartmogul/chartmogul-router.js
Dakad/dashyAPINode
c9f809d31d33c58c5a95b87e8e930c67ba90295d
[ "MIT" ]
null
null
null
src/chartmogul/chartmogul-router.js
Dakad/dashyAPINode
c9f809d31d33c58c5a95b87e8e930c67ba90295d
[ "MIT" ]
null
null
null
/** * @overview SubRouter to handle the all path related to /chartmogul * * @module router/chartmogul * @requires config * @requires components/util * @requires components/pusher * @requires router/base * @requires feeder/chartmogul * */ // ------------------------------------------------------------------- // Dependencies // npm const Config = require('config'); // Built-in // Mine const Util = require('../components/util'); const Pusher = require('../components/pusher'); const BaseRouter = require('../base/baserouter'); // ------------------------------------------------------------------- // Properties /** * SubRouter to handle the all path related to /chartmogul * * @extends router/baase */ class ChartMogulRouter extends BaseRouter { /** * Creates an instance of ChartMogulRouter. * @param {module:feeder/chartmogul} feed - The feeder for this router. */ constructor(feed) { super(feed, '/chartmogul', 90); } /** * The firstMiddleware where the request must go first. * Config the request for ChartMogul depending on theparams received. * * @param {Application.Context} ctx The context of the request and response. * @param {Function} next The next middleware to call. * @return {Function} the next middleware() * */ async configByParams(ctx, next) { // Check query const dates = Util.getAllDates(); ctx.state.config = Object.assign(ctx.state.config, { 'last-start-date': Util.convertDate(dates.firstInPastMonth), 'last-end-date': Util.convertDate(dates.dateInPastMonth), 'start-date': Util.convertDate(dates.endInPastMonth), 'end-date': Util.convertDate(dates.today), 'interval': 'month', }); return next(); } /** @override */ handler() { super.handler(); this.router_.use(this.configByParams); /** * * @api {GET} /chartmogul Get the list of routes * @apiName GetAllRoutesForChartMogul * @apiGroup ChartMogul * @apiVersion 0.1.0 * * * @apiSuccess (200) {Object} routes All routes callables for /chartmogul * * @apiSuccessExample {JSON} routes { title : 'METHOD /url' } * * */ /** * * @api {GET} /chartmogul/leads Get the leads for the month * @apiName GetLeadsMonth * @apiGroup ChartMogul * @apiVersion 0.1.0 * * * @apiSuccess (200) {Object} leads description * * @apiSuccessExample {JSON} Success-Response: { "item": [{ "value" : {number} Current value for this month. }, { "value" : {number} Value for the same periode on previous month. }] } * * */ this.router_.get('/leads', async(ctx, next) => { ctx.state.data = await this.feed_.fetchNbLeads(ctx.state.config); return next(); }); /** * * @api {GET} /chartmogul/mrr Get the MRR * @apiName GetMRR * @apiGroup ChartMogul * @apiVersion 0.1.0 * * * @apiSuccess (200) {Object} mrr description * * @apiSuccessExample {JSON} Success-Response: { "item":[{ "value" : {number} Current value for this month. "prefix" : "€" }, { "value" : {number} Value for the previous month. }] } * * */ this.router_.get('/mrr', async({ state}, next) => { state.data = await this.feed_.fetchMrr(state.config, next); return next(); }); /** * * @api {GET} /chartmogul/customers Get the customers count for the month * @apiName GetMonthCustomers * @apiGroup ChartMogul * @apiVersion 0.1.0 * * * @apiSuccess (200) {Object} customers description * * @apiSuccessExample {JSON} Success-Response: { "item": { "value" : {number} Current value for this month. }, { "value" : {number} Value for the previous month. } } * * */ this.router_.get('/customers', async({ state, }, next) => { state.data = await this.feed_.fetchNbCustomers(state.config, next); return next(); }); /** * * @api {GET} /chartmogul/mrr/churn Get Net MRR Churn * @apiName GetMRRNetChurn * @apiGroup ChartMogul * @apiVersion 0.1.0 * * * @apiSuccess (200) {Object} churn Resuts * * @apiSuccessExample {JSON} Success-Response: { "item":[{ "value" : {number} Current value for this month, "prefix" : "%" }, { "value" : {number} Value for the previous month. }], "type" : "reverse" } * * */ this.router_.get('/mrr/churn', async({ state, }, next) => { state.data = await this.feed_.fetchNetMRRChurnRate(state.config, next); return next(); }); /** * * @api {GET} /chartmogul/mrr/net Get Net MRR * @apiName GetMRRNet * @apiGroup ChartMogul * @apiVersion 0.1.0 * * * @apiSuccess (200) html HTML Output * * @apiSuccessExample {JSON} Success-Response: { "item":[ { "text": HTMLtext with the current value and the best move ever made. } ], } * * */ this.router_.get('/mrr/net', async({ state, }, next) => { state.data = await this.feed_.fetchNetMRRMovement(state.config, next); return next(); }); /** * * @api {GET} /chartmogul/mrr/moves Get the MRR Movements * @apiName GetMRRMoves * @apiGroup ChartMogul * @apiVersion 0.1.0 * * * @apiSuccess (200) {Object} mrrMoves The 5 moves * * @apiSuccessExample {JSON} Success-Response: { "format": "currency", "items": [ { "label": "New Business", "value": {Number} Current value for the month }, { "label": "Expansion", "value": {Number} Current value for the month }, { "label": "Contraction", "value": {Number} Current value for the month }, { "label": "Churn", "value": {Number} Current value for the month }, { "label": "Reactivation", "value": {Number} Current value for the month } ], "unit": "EUR" } * * */ this.router_.get('/mrr/move', async({ state, }, next) => { state.data = await this.feed_.fetchMRRMovements(state.config, next); return next(); }); /** * * @api {GET} /chartmogul/arr Get the ARR * @apiName GetARR * @apiGroup ChartMogul * @apiVersion 0.1.0 * * * @apiSuccess (200) {Object} arr The Annualized Run Rate * * @apiSuccessExample {JSON} Success-Response: { "item":[ { "value": {number} arr The current value for the month. "prefix" : "€" }, { "value": {number} arr The value of the previous month. } ], } * * */ this.router_.get('/arr', async({ state, }, next) => { state.data = await this.feed_.fetchArr(state.config, next); return next(); }); /** * * @api {GET} /chartmogul/arpa Get the ARPA * @apiName GetARPA * @apiGroup ChartMogul * @apiVersion 0.1.0 * * * @apiSuccess (200) {Object} arpa The Average Revenue Per Account * * @apiSuccessExample {JSON} Success-Response: { "item":[ { "value": {number} arr The current value for the month. "prefix" : "€" }, { "value": {number} arr The value of the previous month. } ], } * * */ this.router_.get('/arpa', async({ state, }, next) => { state.data = await this.feed_.fetchArpa(state.config, next); return next(); }); /** * * @api {GET} /chartmogul/leads/today Get the leads for today * @apiName GetLeadsToday * @apiGroup ChartMogul * @apiVersion 0.1.0 * * * @apiSuccess (200) {Object} leads description * * @apiSuccessExample {JSON} Success-Response: { item :[{ "value" : {number} Current value for today since 00:00:00. }, { "value" : {number} The AVG on the last 30 days without today leads. } } * * */ this.router_.get('/leads/today', async({ state, }, next) => { state.data = await this.feed_.fetchNbLeadsToday(state.config); return next(); }); // LeaderBoard of 5 Most Plans Subscribed /** * * @api {GET} /chartmogul/plans/top Get the top plans * @apiName GetTopPlansByCustomers * @apiGroup ChartMogul * @apiVersion 0.4.0 * * * * @apiSuccess (200) {Array} plans The top plans sorted by the customers * count. * * @apiParam {string} [filter] To only keep or add ! before the filter * value to exclude. * * @apiSuccessExample {JSON} Success-Response: { "format" : "decimal", "items": [ { "label": {String} Plan' name, "value": {number} Plan subscribers } ] } * * */ this.router_.get('/plans/top', async({ state, }, next) => { const firstInMonth = new Date(); if (firstInMonth.getDate() === 1) { firstInMonth.setDate(0); // Start from the end last month } firstInMonth.setDate(1); state.config['start-date'] = Util.convertDate(firstInMonth); state.data = await this.feed_.fetchMostPlansPurchased(state.config); return next(); }); // Pages HTML for the 5 last Customers /** * * @api {GET} /chartmogul/customers/latest Get the latest customers * @apiName GetLatestCustomers * @apiGroup ChartMogul * @apiVersion 0.2.0 * * * * @apiSuccess (200) {Object} latestCustomers The latest customers sorted * by their subscription date. limited to 5 customers * * @apiParam {string=html,json} [out="html"] The output format. * * @apiSuccessExample {JSON} Formatted-JSON:Success-Response: [{ country : {string} ISO-3611-2 Country country_full: {string} Full name of the country, name : {string} The customer name, company : {string} The customer company date : {string} The customer subscription datetime mrr : {number} The incommint MRR for this customer }] * * @apiSuccessExample {JSON} Formatted-HTML:Success-Response: { "text": "<div> <img src="/assets/img/flags/${ISO3611Code}.png" alt="Flag of ${country}" style="fl:left;m: 0 5px;w:150px;h:150px;"> <h1 style="m:0 10px 15px 0;"> <u>${customer.company|customer.name}</u> </h1> <h2 style="m-bottom:5px;"> <img src="/assets/img/icons/datetime.png" alt="DateTime" style="fl:left;w:25px;h:25px;m:0 5px;"/> ${customer.subscription_date} </h2> <h2 style="m-bottom:5px;"> <img src="/assets/img/icons/world.png" alt="City" style="fl:left;w:30px;h:30px;m:0 5px;"/> ${customer.city||customer.country.toUpperCase()} </h2> <h2 style="m-bottom:5px;"> <img src="assets/img/icons/euro.png" alt="MRR" style="fl:left;w:25px;h:25px;m:0 5px;"/> ${customer.mrr}/Month </h2> </div>", type": {number=0,1} Usually 0, if set to 1, it's fresh } * */ this.router_.get('/customers/(last|latest)', async({ state, }, next) => { state.data = await this.feed_.fetchLatestCustomers(state.config); return next(); }); // Pages HTML for the 5 last Leads /** * * @api {GET} /chartmogul/leads/latest Get the latest leads * @apiName GetLatestleads * @apiGroup ChartMogul * @apiVersion 0.2.0 * * * * @apiSuccess (200) {Object} latestleads The latest leads sorted * by their free_tial_started date limited to 5 leads * * @apiParam {string=html,json} [format="html"] The output format. * * @apiSuccessExample {JSON} Formatted-JSON:Success-Response: [{ country : {string} ISO-3611-2 Country country_full: {string} Full name of the country, name : {string} The lead name, company : {string} The lead company date : {string} The starting lead datetime }] * * @apiSuccessExample {JSON} Formatted-HTML:Success-Response: { "text": "<div> <img src="/assets/img/flags/${ISO3611Code}.png" alt="Flag of ${country}" style="fl:left;m: 0 5px;w:150px;h:150px;"> <h1 style="m:0 10px 15px 0;"> <u>${lead.company|lead.name}</u> </h1> <h2 style="m-bottom:5px;"> <img src="/assets/img/icons/datetime.png" alt="DateTime" style="fl:left;w:25px;h:25px;m:0 5px;"/> ${lead.subscription_date} </h2> <h2 style="m-bottom:5px;"> <img src="/assets/img/icons/world.png" alt="City" style="fl:left;w:30px;h:30px;m:0 5px;"/> ${lead.city||lead.country.toUpperCase()} </h2> </div>", type": {number=0,1} Usually 0, if set to 1, it's fresh } * */ this.router_.get('/leads/(last|latest)', async({ state, }, next) => { state.config.onlyLead = true; state.data = await this.feed_.fetchLatestCustomers(state.config); return next(); }); /** * * @api {GET} /chartmogul/customers/country * Get Customer count grouped by their Country * @apiName GetCustomersCountry * @apiGroup ChartMogul * @apiVersion 0.4.0 * * @apiParam {string=html,json} [out="html"] The output format. * * @apiSuccess (200) {Object} list The list of country with the higher * new customer * * * @apiSuccessExample {JSON} Formatted-JSON:Success-Response: [{ ISO-3611-2 Country : Customer count }] * * @apiSuccessExample {JSON} Formatted-HTML:Success-Response: { "item" : [ { "text" : "<table> <tbody> <tr> <td> <img src="assets/flags/${icon_flag}.png" alt="Flag of ${country}"> </td> <td>${country name}</td> <td >${customer count}</td> </tr> </tbody> </table>" } ] } ] * */ this.router_.get('/customers/country', async({ state, }, next) => { state.data = await this.feed_.fetchCountriesByCustomers(state.config); return next(); }); } /** @override */ handlerPusher() { const widgets = Config.geckoBoard.widgets; [ [ widgets.leadsMonth.id, // Leads Month this.feed_.fetchNbLeads, widgets.leadsMonth.pushTime, ], [ widgets.leadsToday.id, // Leads Today this.feed_.fetchNbLeadsToday, widgets.leadsToday.pushTime, ], [ widgets.latestCustomers.id, // Last Customers Month [this.feed_.fetchLatestCustomers, {onlyLead: false}], widgets.latestCustomers.pushTime, ], [ widgets.latestLeads.id, // Last Leads Month [this.feed_.fetchLatestCustomers, {onlyLead: true}], widgets.latestLeads.pushTime, ], ].forEach((p) => this.listPushers_.push(new Pusher(...p, this.feed_))); }; }; // ------------------------------------------------------------------- // Exports module.exports = ChartMogulRouter;
27.515008
79
0.486938
e01dca6f1c340608e1fdd547978c19d45862c69c
2,457
js
JavaScript
api/src/models/user.model.js
EvelynAnyebe/team-stats
cfb1a39f1c4fe3b0c1e7523737bd76425d23fbfd
[ "MIT" ]
null
null
null
api/src/models/user.model.js
EvelynAnyebe/team-stats
cfb1a39f1c4fe3b0c1e7523737bd76425d23fbfd
[ "MIT" ]
10
2022-02-11T17:54:13.000Z
2022-02-12T15:28:00.000Z
api/src/models/user.model.js
EvelynAnyebe/team-stats
cfb1a39f1c4fe3b0c1e7523737bd76425d23fbfd
[ "MIT" ]
null
null
null
const mongoose = require('mongoose'); const bcrypt = require('bcrypt'); const jwt = require('jsonwebtoken'); const { Schema, model } = mongoose; const UserSchema = Schema( { userName: { type: String, }, email: { type: String, required: true, unique: true, }, password: { type: String, required: true, minLength: 8, select: false, }, firstName: { type: String, minLength: 2, }, lastName: { type: String, minLength: 2, }, otherNames: String, gender: String, dob: Date, phone: { type: String, minLength: 11, maxLength: 15, }, address: { houseNumber: String, address: String, street: String, city: String, postCode: String, country: String, region: String, location: { type: Array, "default": [] } }, teamMembers: [{ name: String, latitude: Number, longitude: Number }] }, { timestamps: true } ); if (!UserSchema.options.toObject) { UserSchema.options.toObject = {}; } UserSchema.options.toObject.transform = function (doc, ret, options) { delete ret.__v; delete ret.password; return ret; }; UserSchema.pre('save', async function (next) { try { if (!this.isModified('password')) { return next(); } const hashedPassword = await bcrypt.hash( this.password, await bcrypt.genSalt() ); this.password = hashedPassword; return next(); } catch (err) { return next(err); } }); UserSchema.methods.comparePassword = async function (candidatePassword) { try { const isMatch = await bcrypt.compare(candidatePassword, this.password); return isMatch; } catch (err) { return err; } }; UserSchema.methods.GetAccessToken = async (user, time = '7d') => { try { const token = await jwt.sign(user, process.env.JWT_SECRET, { expiresIn: time, issuer: 'Team-stats', }); return token; } catch (err) { return err; } }; module.exports = model('User', UserSchema);
23.179245
79
0.496133
e01e61f2914637829e056a0e24f4b78536870578
3,479
js
JavaScript
public/js/base.js
ft4733520/Laravel-Angular
68c1d5bf9a22257bc9552f7e49956d343eb3cbb1
[ "MIT" ]
null
null
null
public/js/base.js
ft4733520/Laravel-Angular
68c1d5bf9a22257bc9552f7e49956d343eb3cbb1
[ "MIT" ]
null
null
null
public/js/base.js
ft4733520/Laravel-Angular
68c1d5bf9a22257bc9552f7e49956d343eb3cbb1
[ "MIT" ]
null
null
null
;(function() { 'use strict'; angular.module('xiaohu',[ 'ui.router', ]) .config([ '$interpolateProvider', '$stateProvider', '$urlRouterProvider', function($interpolateProvider, $stateProvider, $urlRouterProvider) { $interpolateProvider.startSymbol('[:'); $interpolateProvider.endSymbol(':]'); $urlRouterProvider.otherwise('/home'); $stateProvider .state('home',{ url: '/home', templateUrl: 'home.tpl', //如果没有,则会在跟目录下找文件 localhost:8000/home.tpl }) .state('signup',{ url: '/signup', templateUrl: 'signup.tpl', }) .state('login',{ url: '/login', templateUrl: 'login.tpl', }) .state('question',{ abstract: true, url: '/question', template: '<div ui-view></div>', }) .state('question.add',{ url: '/add', templateUrl: 'question.add.tpl', }) } ]) // .controller('TestController', function($scope){ // $scope.name = 'Bob'; // }) .service('UserService', [ '$state', '$http', function($state,$http){ var me = this; me.signup_data = {}; me.signup = function() { $http.post('/api/signup', me.signup_data) .then(function(res){ if(res.data.status){ me.signup_data = {}; $state.go('login'); }else{ $state.go('signup'); } },function(err){ console.log('error',err); }) } me.login = function() { $http.post('/api/login', me.signup_data) .then(function(res){ if(res.data.status) { $state.go('home'); // location.href='/'; }else{ me.login_failed=true; } },function(err){ console.log('error',err); }) } me.username_exists = function() { $http.post('/api/user/exist', {username: me.signup_data.username}) .then(function(res){ if(res.data.status && res.data.data.count) me.signup_username_exists = true; else me.signup_username_exists = false; },function(err){ console.log('error',err); }) } } ]) .controller('SignupController',[ '$scope', 'UserService', function($scope, UserService) { $scope.User = UserService; $scope.$watch(function(){ return UserService.signup_data; }, function(n,o){ if (n.username != o.username) UserService.username_exists(); },true); } ]) .controller('LoginController',[ '$scope', 'UserService', function($scope, UserService){ $scope.User = UserService; } ]) .service('QuestionService',[ '$state', '$http', function($state,$http){ var me = this; me.new_question = {}; me.go_add_question = function(){ $state.go('question.add'); } me.add = function() { if(!me.new_question.title) return; $http.post('/api/question/add',me.new_question) .then(function(res){ if(res.data.status) me.new_question = {}; $state.go('home'); },function(err){ }) } } ]) .controller('QuestionAddController',[ '$scope', 'QuestionService', function($scope, QuestionService){ $scope.Question = QuestionService; } ]) /*rootScope*/ })();
20.464706
78
0.509917
e01e83ca217cd2faa6b48b7c62c4a06d642199f6
3,584
js
JavaScript
components/RoomCard.js
cadupuy/airbnb-front
2412c55595be32721fa685e9b2dd3d68ec1d2e6d
[ "MIT" ]
null
null
null
components/RoomCard.js
cadupuy/airbnb-front
2412c55595be32721fa685e9b2dd3d68ec1d2e6d
[ "MIT" ]
null
null
null
components/RoomCard.js
cadupuy/airbnb-front
2412c55595be32721fa685e9b2dd3d68ec1d2e6d
[ "MIT" ]
null
null
null
import React from "react"; import { useNavigation } from "@react-navigation/core"; import { Entypo } from "@expo/vector-icons"; import { Button, Text, Image, StyleSheet, TouchableOpacity, View, FlatList, } from "react-native"; import colors from "../assets/colors"; const RoomCard = ({ room }) => { const navigation = useNavigation(); return ( <View style={styles.container} onPress={() => { navigation.navigate("Settings"); }} > <View style={styles.roomCard}> <Image source={{ uri: room.photos[0].url, }} style={styles.roomPicture} resizeMode="cover" ></Image> <Text style={styles.roomPrice}>{room.price} €</Text> </View> <View style={styles.roomDetails}> <View style={{ flex: 1 }}> <Text numberOfLines={1} style={styles.roomTitle}> {room.title} </Text> <View style={styles.rating}> <Entypo name="star" size={20} style={styles.star} color={ room.ratingValue > 0 ? colors.yellowStar : colors.ligthgreyStar } /> <Entypo name="star" size={20} style={styles.star} color={ room.ratingValue > 1 ? colors.yellowStar : colors.ligthgreyStar } /> <Entypo name="star" size={20} style={styles.star} color={ room.ratingValue > 2 ? colors.yellowStar : colors.ligthgreyStar } /> <Entypo name="star" size={20} style={styles.star} color={ room.ratingValue > 3 ? colors.yellowStar : colors.ligthgreyStar } /> <Entypo name="star" size={20} style={styles.star} color={ room.ratingValue > 4 ? colors.yellowStar : colors.ligthgreyStar } /> <Text style={styles.reviews}>{room.reviews} reviews</Text> </View> </View> <View> <Image source={{ uri: room.user.account.photo.url, }} style={styles.avatar} resizeMode="contain" ></Image> </View> </View> </View> ); }; const styles = StyleSheet.create({ color: { color: colors.grey, }, dark: { color: colors.black, }, container: { borderBottomWidth: 2, paddingBottom: 10, marginBottom: 20, borderColor: colors.ligthgreyText, }, roomCard: { position: "relative", }, roomPicture: { width: "100%", height: 200, }, roomTitle: { fontSize: 20, }, roomPrice: { position: "absolute", backgroundColor: colors.black, bottom: 10, color: colors.white, paddingBottom: 15, paddingTop: 15, paddingRight: 20, paddingLeft: 20, fontSize: 18, }, avatar: { width: 75, height: 75, borderRadius: 50, marginLeft: 10, }, roomDetails: { flexDirection: "row", justifyContent: "space-between", paddingTop: 10, alignItems: "center", }, rating: { flexDirection: "row", alignItems: "center", marginTop: 15, }, star: { marginRight: 4, }, reviews: { marginLeft: 5, color: colors.grey, }, }); export default RoomCard;
21.207101
79
0.490513
e01e9113cb04d8a23f047f19d71638ecd294a26a
704
js
JavaScript
public/index.js
afeiship/react-ant-menu-burger
9a5e4421bfa512fa60dc668e1b5648555b7c402b
[ "MIT" ]
null
null
null
public/index.js
afeiship/react-ant-menu-burger
9a5e4421bfa512fa60dc668e1b5648555b7c402b
[ "MIT" ]
null
null
null
public/index.js
afeiship/react-ant-menu-burger
9a5e4421bfa512fa60dc668e1b5648555b7c402b
[ "MIT" ]
null
null
null
import ReactDemokit from '@jswork/react-demokit'; import React from 'react'; import ReactDOM from 'react-dom'; import ReactAntMenuBurger from '../src/main'; import ReactAdminIcons from '@jswork/react-admin-icons'; import './assets/style.scss'; class App extends React.Component { render() { return ( <ReactDemokit className="p-3 app-container" url="https://github.com/afeiship/react-ant-menu-burger"> <ReactAntMenuBurger elements={[ <ReactAdminIcons value="shrink-right" />, <ReactAdminIcons value="spread-left" /> ]} /> </ReactDemokit> ); } } ReactDOM.render(<App />, document.getElementById('app'));
27.076923
64
0.636364
e01f0e7839ea8e7f5b6e0b748ce7afcf873324b5
3,069
js
JavaScript
Client/pages/mine/mycenter/mycenter.js
TateYdq/DietRegimen
66c88e84b7c4d9226db1d9567d300b1c6f7344b7
[ "MIT" ]
null
null
null
Client/pages/mine/mycenter/mycenter.js
TateYdq/DietRegimen
66c88e84b7c4d9226db1d9567d300b1c6f7344b7
[ "MIT" ]
null
null
null
Client/pages/mine/mycenter/mycenter.js
TateYdq/DietRegimen
66c88e84b7c4d9226db1d9567d300b1c6f7344b7
[ "MIT" ]
null
null
null
// pages/mine/mycenter/mycenter.js const apiRequest = require("../../../utils/api_request.js") const app = getApp() Page({ /** * 页面的初始数据 */ data: { isLogin:false, userAvatarUrl: null, myUserInfo:{} }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { this.setData({ isLogin: app.globalData.isLogin }); console.log(app.globalData.isLogin) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { this.setData({ myUserInfo: app.globalData.myUserInfo }); }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { }, getWechatUserInfo: function (e) { console.log(e) app.globalData.userInfo = e.detail.userInfo this.setData({ myUserInfo: e.detail.userInfo, hasUserInfo: true }) }, setMyInfo: function(){ if(this.data.isLogin == false){ wx.showToast({ title: '请先登录', icon: "none", duration: 1000, }) return } wx.navigateTo({ url: '../myinfo/myinfo', }) }, gotoCollectFood: function() { if (this.data.isLogin == false) { wx.showToast({ title: '请先登录', icon: "none", duration: 1000, }) return } wx.navigateTo({ url: '../collectFood/collect_food', }) }, gotoCollectDisease: function() { if (this.data.isLogin == false) { wx.showToast({ title: '请先登录', icon: "none", duration: 1000, }) return } wx.navigateTo({ url: '../collectDisease/collect_disease', }) }, //隐藏功能,清除所有缓存 clearAllCache: function(){ try { wx.clearStorageSync() wx.showToast({ title: '已清除缓存', icon: "success", duration: 1000, }) app.globalData.isLogin = false wx.reLaunch({ url: 'mycenter' }) } catch (e) { // Do something when catch error } }, login: function (e) { app.globalData.userInfo = e.detail.userInfo apiRequest.login(this.callbackLogin) }, callbackLogin: function(res){ if(res.code == 2000){ this.setData({ isLogin: true, userAvatarUrl: app.globalData.userInfo.avatarUrl }); apiRequest.getUserInfo(this.callbackGetUserInfo) } }, callbackGetUserInfo: function(res){ console.log(res) if (res.code == 2000) { app.globalData.myUserInfo = res["user_info"] this.setData({ myUserInfo: app.globalData.myUserInfo }); } else if (res.code == 4003) { wx.showToast({ title: '请先登录', duration: 2000, }) } else{ wx.showToast({ title: '失败', icon: 'fail', duration: 2000, }) } } })
17.739884
59
0.531769
e01fce14a977337506e503381ba05d87a9f603a6
557
js
JavaScript
src/services/movie/mappers/movies.js
awinogrodzki/tmdb-client
157a092959e831bcb9a896596b67100cfae69f39
[ "MIT" ]
1
2017-10-27T22:09:01.000Z
2017-10-27T22:09:01.000Z
src/services/movie/mappers/movies.js
awinogrodzki/cherryscope-client
157a092959e831bcb9a896596b67100cfae69f39
[ "MIT" ]
null
null
null
src/services/movie/mappers/movies.js
awinogrodzki/cherryscope-client
157a092959e831bcb9a896596b67100cfae69f39
[ "MIT" ]
null
null
null
import movieService from 'services/movie'; export const mapMovies = (results, imageSize) => results.map(item => ({ id: item.id, title: item.title, originalTitle: item.original_title, imageUrl: movieService.getImageUrl(item.poster_path, imageSize), voteAverage: item.vote_average, voteCount: item.vote_count, releaseDate: item.release_date, })); export const mapMoviesResponse = (data, imageSize = 500) => ({ movies: mapMovies(data.results, imageSize), page: data.page, pageCount: data.total_pages, itemCount: data.total_results, });
29.315789
71
0.737882
db9d8bb083649efab073334219b84a624e5e9dee
414
js
JavaScript
src/templates/blog-post.js
JesusGerardoAguiar/Felicia
c2d1494b113c9d5a8be46dfa70bdb7524950431d
[ "MIT" ]
null
null
null
src/templates/blog-post.js
JesusGerardoAguiar/Felicia
c2d1494b113c9d5a8be46dfa70bdb7524950431d
[ "MIT" ]
null
null
null
src/templates/blog-post.js
JesusGerardoAguiar/Felicia
c2d1494b113c9d5a8be46dfa70bdb7524950431d
[ "MIT" ]
null
null
null
import React from "react" import { Link, graphql } from "gatsby" import { MDXRenderer } from "gatsby-plugin-mdx" import Bio from "../components/bio" import Layout from "../components/layout" import SEO from "../components/seo" import { rhythm, scale } from "../utils/typography" class BlogPostTemplate extends React.Component { render() { return ( <></> ) } } export default BlogPostTemplate
20.7
51
0.690821
db9eb17a100f3658d3911cd6cc10908fae67a266
897
js
JavaScript
d7/d13/class_ext_1_1_net_1_1_observable_direct_event.js
extnet/docs5.ext.net
e99e4d3894640fb1f66882443fe7348fc3181f55
[ "Apache-2.0" ]
null
null
null
d7/d13/class_ext_1_1_net_1_1_observable_direct_event.js
extnet/docs5.ext.net
e99e4d3894640fb1f66882443fe7348fc3181f55
[ "Apache-2.0" ]
null
null
null
d7/d13/class_ext_1_1_net_1_1_observable_direct_event.js
extnet/docs5.ext.net
e99e4d3894640fb1f66882443fe7348fc3181f55
[ "Apache-2.0" ]
null
null
null
var class_ext_1_1_net_1_1_observable_direct_event = [ [ "Clear", "d7/d13/class_ext_1_1_net_1_1_observable_direct_event.html#afe3c588c1e4dc4d71d861932a4f877b7", null ], [ "After", "d7/d13/class_ext_1_1_net_1_1_observable_direct_event.html#a0b50e92c624a2a11728159b9bf837fcb", null ], [ "Before", "d7/d13/class_ext_1_1_net_1_1_observable_direct_event.html#a631e6f6fb390364e91e52a5541c5d6c8", null ], [ "Complete", "d7/d13/class_ext_1_1_net_1_1_observable_direct_event.html#a947d89ee13e987ac905812c97e78af51", null ], [ "ConfigOptions", "d7/d13/class_ext_1_1_net_1_1_observable_direct_event.html#a72af495d22d88e9f012296770a7bfc6a", null ], [ "Failure", "d7/d13/class_ext_1_1_net_1_1_observable_direct_event.html#a08bccbb664f817d5e99ff555420105b0", null ], [ "Success", "d7/d13/class_ext_1_1_net_1_1_observable_direct_event.html#ab4e821e570744ca098912fc12d46de4c", null ] ];
89.7
125
0.820513
dba09ed9420ac2eb61b7509be40353f9cab40487
47
js
JavaScript
test/merge-rakaz/js/amd1.min.js
artzstudio/Boot
4c0ba6df1a6e1af2f631f13591583f90f1dbda5e
[ "MIT" ]
3
2015-11-30T13:41:40.000Z
2016-03-25T20:22:50.000Z
test/merge-rakaz/js/amd1.min.js
artz/Boot
4c0ba6df1a6e1af2f631f13591583f90f1dbda5e
[ "MIT" ]
1
2016-04-04T15:14:41.000Z
2016-04-04T15:14:41.000Z
test/merge-rakaz/js/amd1.min.js
artzstudio/Boot
4c0ba6df1a6e1af2f631f13591583f90f1dbda5e
[ "MIT" ]
2
2016-09-09T08:09:08.000Z
2016-09-21T20:52:33.000Z
Boot.define(function(){ return { amd: 1 }; });
23.5
46
0.595745
dba0b62082e3780efdfe515f3c8a0156d4d40226
326
js
JavaScript
tests/map.js
aredridel/bennu
4e7235d2fb2d5fe9f4bd1311616d0134a5ff0b2c
[ "MIT" ]
138
2015-01-02T12:59:04.000Z
2022-02-01T16:58:53.000Z
tests/map.js
aredridel/bennu
4e7235d2fb2d5fe9f4bd1311616d0134a5ff0b2c
[ "MIT" ]
5
2015-01-09T22:55:49.000Z
2017-01-10T18:08:02.000Z
tests/map.js
aredridel/bennu
4e7235d2fb2d5fe9f4bd1311616d0134a5ff0b2c
[ "MIT" ]
12
2015-01-09T22:48:52.000Z
2021-12-15T08:32:32.000Z
var parse = require('../index').parse; exports.simple = function(test) { var result = parse.anyToken .map(function(x) { return (+x) + 5; }) .map(function(x) { return x / 2; }); test.deepEqual( parse.run(result, "3"), 4); test.done(); };
20.375
38
0.457055
dba11132dc8f6be327d9373b0b1bdfd0c5761753
791
js
JavaScript
rollup.config.js
bastienrobert/primitives
f13308b969100b513fe1fc55542106b80552e364
[ "MIT" ]
null
null
null
rollup.config.js
bastienrobert/primitives
f13308b969100b513fe1fc55542106b80552e364
[ "MIT" ]
5
2019-10-12T15:04:36.000Z
2021-05-08T14:52:50.000Z
rollup.config.js
bastienrobert/primitives
f13308b969100b513fe1fc55542106b80552e364
[ "MIT" ]
null
null
null
import typescript from 'rollup-plugin-typescript2' import resolve from 'rollup-plugin-node-resolve' import commonjs from 'rollup-plugin-commonjs' import { terser } from 'rollup-plugin-terser' import bundleSize from 'rollup-plugin-bundle-size' import pkg from './package.json' const production = !process.env.ROLLUP_WATCH export default [ { input: 'src/index.ts', output: [ { file: pkg.main, format: 'cjs' }, { file: pkg.module, format: 'es' } ], plugins: [typescript(), production && bundleSize()] }, { input: 'src/index.ts', output: { file: pkg.browser, name: 'Geometries', format: 'umd' }, plugins: [ resolve({ extensions: ['.ts'] }), typescript(), commonjs(), terser(), production && bundleSize() ] } ]
24.71875
69
0.629583
dba1af4b32ffb737e389d0dd1264693d80635563
23,171
js
JavaScript
public/3.js
HuanDang-Dev/Nha-Tro-Tot
bcedb1f264a03c1a2192553a897acdb154f6b95c
[ "MIT" ]
null
null
null
public/3.js
HuanDang-Dev/Nha-Tro-Tot
bcedb1f264a03c1a2192553a897acdb154f6b95c
[ "MIT" ]
null
null
null
public/3.js
HuanDang-Dev/Nha-Tro-Tot
bcedb1f264a03c1a2192553a897acdb154f6b95c
[ "MIT" ]
null
null
null
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[3],{ /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/motel/ViewMotel.vue?vue&type=script&lang=js&": /*!**************************************************************************************************************************************************************************!*\ !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/motel/ViewMotel.vue?vue&type=script&lang=js& ***! \**************************************************************************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _components_NavigationComponent_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/NavigationComponent.vue */ "./resources/js/components/components/NavigationComponent.vue"); /* harmony import */ var _components_FooterComponent_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/FooterComponent.vue */ "./resources/js/components/components/FooterComponent.vue"); /* harmony import */ var _components_ContactComponent_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/ContactComponent.vue */ "./resources/js/components/components/ContactComponent.vue"); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["default"] = ({ name: "viewMotel", components: { NavigationComponent: _components_NavigationComponent_vue__WEBPACK_IMPORTED_MODULE_0__["default"], FooterComponent: _components_FooterComponent_vue__WEBPACK_IMPORTED_MODULE_1__["default"], ContactComponent: _components_ContactComponent_vue__WEBPACK_IMPORTED_MODULE_2__["default"] }, data: function data() { return { images: ["/images/nhatro1.jpg", "/images/nhatro2.jpg", "/images/nhatro3.jpg"], timer: null, currentIndex: 0, title: "Hoàng Anh Dương", name: "Tuấn Hùng", date: "01/07/2000", status: true, like: 40, rating: 4, giatien: "10Triệu", dientich: "50", des: { vitri: "Cầu giấy", ganTruongDH: "Trường Đại học Công nghệ", csvc: "Có máy nóng lạnh, điều hòa" } }; }, mounted: function mounted() { this.startSlide(); }, methods: { startSlide: function startSlide() { this.timer = setInterval(this.next, 4000); }, next: function next() { this.currentIndex += 1; }, prev: function prev() { this.currentIndex -= 1; }, countLike: function countLike() { this.like += 1; } }, computed: { currentImg: function currentImg() { return this.images[Math.abs(this.currentIndex) % this.images.length]; } } }); /***/ }), /***/ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/motel/ViewMotel.vue?vue&type=style&index=0&id=00cfccba&scoped=true&lang=css&": /*!*********************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/css-loader??ref--6-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/motel/ViewMotel.vue?vue&type=style&index=0&id=00cfccba&scoped=true&lang=css& ***! \*********************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(/*! ../../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, "\nul li[data-v-00cfccba] {\r\n list-style: none;\n}\nimg[data-v-00cfccba] {\r\n height:600px;\r\n width:100%\n}\n.prev[data-v-00cfccba], .next[data-v-00cfccba] {\r\n cursor: pointer;\r\n position: absolute;\r\n top: 40%;\r\n width: auto;\r\n padding: 16px;\r\n color: white;\r\n font-weight: bold;\r\n font-size: 18px;\r\n transition: 0.7s ease;\r\n border-radius: 0 4px 4px 0;\r\n text-decoration: none;\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n -ms-user-select: none;\r\n user-select: none;\n}\n.next[data-v-00cfccba] {\r\n right: 0;\n}\n.prev[data-v-00cfccba] {\r\n left: 0;\n}\n.prev[data-v-00cfccba]:hover, .next[data-v-00cfccba]:hover {\r\n background-color: rgba(0,0,0,0.9);\n}\n.btn-like[data-v-00cfccba] {\r\n right: 0;\r\n border: none;\r\n background-color: initial;\r\n top: -5px;\n}\n.btn-rating[data-v-00cfccba] {\r\n right: 40%;\r\n border: none;\r\n background-color: initial;\n}\ni[data-v-00cfccba] {\r\n font-size: 20px;\n}\n.btn-i-like[data-v-00cfccba] {\r\n font-size: 30px;\n}\nbutton[data-v-00cfccba]:focus{\r\n outline: none;\n}\r\n", ""]); // exports /***/ }), /***/ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/motel/ViewMotel.vue?vue&type=style&index=0&id=00cfccba&scoped=true&lang=css&": /*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/style-loader!./node_modules/css-loader??ref--6-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/motel/ViewMotel.vue?vue&type=style&index=0&id=00cfccba&scoped=true&lang=css& ***! \*************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../../node_modules/css-loader??ref--6-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src??ref--6-2!../../../../node_modules/vue-loader/lib??vue-loader-options!./ViewMotel.vue?vue&type=style&index=0&id=00cfccba&scoped=true&lang=css& */ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/motel/ViewMotel.vue?vue&type=style&index=0&id=00cfccba&scoped=true&lang=css&"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/motel/ViewMotel.vue?vue&type=template&id=00cfccba&scoped=true&": /*!******************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/motel/ViewMotel.vue?vue&type=template&id=00cfccba&scoped=true& ***! \******************************************************************************************************************************************************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "div", { staticClass: "viewMotel" }, [ _c("NavigationComponent"), _vm._v(" "), _c("div", { staticClass: "main-body pt-4 text-dark" }, [ _c("div", { staticClass: "container" }, [ _c("div", { staticClass: "row m-0 p-0 bg-white" }, [ _c("div", { staticClass: "card-body" }, [ _c("div", { staticClass: "row" }, [ _c( "div", { staticClass: "position-relative mx-5 w-100" }, [ _vm._l([_vm.currentIndex], function(i) { return _c("div", { key: i }, [ _c("img", { attrs: { src: _vm.currentImg } }) ]) }), _vm._v(" "), _c( "a", { staticClass: "prev", attrs: { href: "#" }, on: { click: _vm.prev } }, [_vm._v("❮ ")] ), _vm._v(" "), _c( "a", { staticClass: "next", attrs: { href: "#" }, on: { click: _vm.next } }, [_vm._v("❯ ")] ) ], 2 ) ]), _vm._v(" "), _c("h3", { staticClass: "card-title text-left ml-5 mt-4" }, [ _vm._v(_vm._s(_vm.title)) ]), _vm._v(" "), _c("div", { staticClass: " text-left mx-5 " }, [ _c("div", { staticClass: "d-flex position-relative" }, [ _c("h5", { staticClass: "text-danger mr-2" }, [ _vm._v(_vm._s(_vm.giatien) + " ") ]), _vm._v(" "), _c("span", [_vm._v(" - ")]), _vm._v(" "), _c("h5", { staticClass: "ml-2" }, [ _vm._v(" " + _vm._s(_vm.dientich) + "m"), _c("sup", [_vm._v("2")]) ]), _vm._v(" "), _c( "div", { staticClass: "position-absolute btn-rating" }, [ _vm._v("Rating: "), _vm._l(_vm.rating, function(item) { return _c("span", { key: item.id }, [ _c("i", { staticClass: "fas fa-star text-warning" }) ]) }) ], 2 ), _vm._v(" "), _c( "button", { staticClass: "position-absolute btn-like text-primary", on: { click: function($event) { return _vm.countLike() } } }, [ _c("i", { staticClass: "far fa-thumbs-up text-primary btn-i-like" }), _vm._v(_vm._s(_vm.like)) ] ) ]), _vm._v(" "), _c("div", [ _c("p", [_vm._v("Vị trí địa lý: " + _vm._s(_vm.des.vitri))]), _vm._v(" "), _c("p", [ _vm._v( "Nhà trọ gần trường đại học: " + _vm._s(_vm.des.ganTruongDH) ) ]), _vm._v(" "), _c("p", [ _vm._v("Điều kiện cơ sở vật chất: " + _vm._s(_vm.des.csvc)) ]) ]) ]) ]) ]) ]) ]), _vm._v(" "), _c("div", { staticClass: "container-fluid py-4 second-background" }, [ _c("div", { staticClass: "container" }, [ _c("div", { staticClass: "row m-0 p-0" }, [ _c( "div", { staticClass: "col-12 m-0 p-0" }, [_c("ContactComponent")], 1 ) ]) ]) ]), _vm._v(" "), _c("FooterComponent") ], 1 ) } var staticRenderFns = [] render._withStripped = true /***/ }), /***/ "./resources/js/components/motel/ViewMotel.vue": /*!*****************************************************!*\ !*** ./resources/js/components/motel/ViewMotel.vue ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _ViewMotel_vue_vue_type_template_id_00cfccba_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ViewMotel.vue?vue&type=template&id=00cfccba&scoped=true& */ "./resources/js/components/motel/ViewMotel.vue?vue&type=template&id=00cfccba&scoped=true&"); /* harmony import */ var _ViewMotel_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ViewMotel.vue?vue&type=script&lang=js& */ "./resources/js/components/motel/ViewMotel.vue?vue&type=script&lang=js&"); /* empty/unused harmony star reexport *//* harmony import */ var _ViewMotel_vue_vue_type_style_index_0_id_00cfccba_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ViewMotel.vue?vue&type=style&index=0&id=00cfccba&scoped=true&lang=css& */ "./resources/js/components/motel/ViewMotel.vue?vue&type=style&index=0&id=00cfccba&scoped=true&lang=css&"); /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); /* normalize component */ var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])( _ViewMotel_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], _ViewMotel_vue_vue_type_template_id_00cfccba_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"], _ViewMotel_vue_vue_type_template_id_00cfccba_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], false, null, "00cfccba", null ) /* hot reload */ if (false) { var api; } component.options.__file = "resources/js/components/motel/ViewMotel.vue" /* harmony default export */ __webpack_exports__["default"] = (component.exports); /***/ }), /***/ "./resources/js/components/motel/ViewMotel.vue?vue&type=script&lang=js&": /*!******************************************************************************!*\ !*** ./resources/js/components/motel/ViewMotel.vue?vue&type=script&lang=js& ***! \******************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ViewMotel_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./ViewMotel.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/motel/ViewMotel.vue?vue&type=script&lang=js&"); /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ViewMotel_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); /***/ }), /***/ "./resources/js/components/motel/ViewMotel.vue?vue&type=style&index=0&id=00cfccba&scoped=true&lang=css&": /*!**************************************************************************************************************!*\ !*** ./resources/js/components/motel/ViewMotel.vue?vue&type=style&index=0&id=00cfccba&scoped=true&lang=css& ***! \**************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ViewMotel_vue_vue_type_style_index_0_id_00cfccba_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/style-loader!../../../../node_modules/css-loader??ref--6-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src??ref--6-2!../../../../node_modules/vue-loader/lib??vue-loader-options!./ViewMotel.vue?vue&type=style&index=0&id=00cfccba&scoped=true&lang=css& */ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/motel/ViewMotel.vue?vue&type=style&index=0&id=00cfccba&scoped=true&lang=css&"); /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ViewMotel_vue_vue_type_style_index_0_id_00cfccba_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ViewMotel_vue_vue_type_style_index_0_id_00cfccba_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ViewMotel_vue_vue_type_style_index_0_id_00cfccba_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ViewMotel_vue_vue_type_style_index_0_id_00cfccba_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /***/ }), /***/ "./resources/js/components/motel/ViewMotel.vue?vue&type=template&id=00cfccba&scoped=true&": /*!************************************************************************************************!*\ !*** ./resources/js/components/motel/ViewMotel.vue?vue&type=template&id=00cfccba&scoped=true& ***! \************************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ViewMotel_vue_vue_type_template_id_00cfccba_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./ViewMotel.vue?vue&type=template&id=00cfccba&scoped=true& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/motel/ViewMotel.vue?vue&type=template&id=00cfccba&scoped=true&"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ViewMotel_vue_vue_type_template_id_00cfccba_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ViewMotel_vue_vue_type_template_id_00cfccba_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); /***/ }) }]);
56.514634
1,171
0.577101
dba23fca21742f80a68c677a4f8f7b089ed6776c
231
js
JavaScript
babel.config.js
magicdawn/clash-config-manager
6a42b764373e7874ed870f2452610c74b7fe22f7
[ "MIT" ]
34
2020-09-25T10:30:52.000Z
2022-03-25T10:02:27.000Z
babel.config.js
magicdawn/clash-config-manager
6a42b764373e7874ed870f2452610c74b7fe22f7
[ "MIT" ]
5
2020-10-01T14:50:08.000Z
2021-01-01T07:14:17.000Z
babel.config.js
magicdawn/clash-config-manager
6a42b764373e7874ed870f2452610c74b7fe22f7
[ "MIT" ]
4
2021-03-24T06:28:48.000Z
2022-03-15T10:14:26.000Z
module.exports = { sourceType: 'unambiguous', presets: [ // Our default preset [ 'poi/babel', { env: { targets: { electron: '11', }, }, }, ], ], }
13.588235
28
0.367965
dba2fc025b585fb4c383d4932e0ea9d6218319a5
7,141
js
JavaScript
dist/js/Card.min.js
Biangkerok32/html5-solitaire-js
1a069df6848d7b03793724a6afc9fa99e1940496
[ "MIT" ]
47
2015-01-07T22:52:24.000Z
2022-02-23T09:26:39.000Z
dist/js/Card.min.js
Biangkerok32/html5-solitaire-js
1a069df6848d7b03793724a6afc9fa99e1940496
[ "MIT" ]
2
2015-03-03T06:30:26.000Z
2015-09-22T13:07:18.000Z
dist/js/Card.min.js
Biangkerok32/html5-solitaire-js
1a069df6848d7b03793724a6afc9fa99e1940496
[ "MIT" ]
44
2015-01-06T11:04:59.000Z
2022-03-10T03:50:04.000Z
function Card(b,d,a){this.color=0;this.status=ST_UNSELECTED;this.number=d;this.colorNumber=0;this.cardtype=b;this.selectable=false;this.visible=false;this.deck=null;this.position={x:0,y:0};this.jQueryElt=jQuery("<div/>");this.zIndex=0;this.dblclickTimeout=null;this.dragging=false;this.dragEnabled=false;this.dropEnabled=false;this.oldCssPosition=null;this.width=0;this.height=0;this.deckNum=0;if(typeof a!==undefined){for(var c in a){this[c]=a[c]}}this.init()}Card.prototype.init=function(){this.colorNumber=this.number%13;if(this.colorNumber===0&&(this.cardtype.indexOf("ace")<0)){this.colorNumber=13}switch(this.cardtype){case"club":case"spade":this.color=BLACK;break;case"diamond":case"heart":this.color=RED;break;case"king":case"ace":default:this.color=ANY;break}this.jQueryElt.addClass("card").removeClass("visible");if(this.visible===true){this.jQueryElt.css({cursor:"pointer"});if(this.cardtype.indexOf("ace")>-1){this.jQueryElt.removeClass("card").addClass("pack "+this.cardtype).addClass("visible")}else{if(this.cardtype=="king"){this.jQueryElt.removeClass("card").addClass("pack king").addClass("visible")}else{this.jQueryElt.css("background-position",-(game.spriteXStart+((this.colorNumber-1)*game.xSpace))+"px -"+game.backsY[this.cardtype]+"px")}}}else{this.jQueryElt.css("background-position","-"+game.cardBackX+"px -"+game.backYMisc+"px")}this.jQueryElt.appendTo("#playground");this.width=this.jQueryElt.width();this.height=this.jQueryElt.height();this.position={x1:this.jQueryElt.position().left,y1:this.jQueryElt.position().top,x2:this.jQueryElt.position().left+this.jQueryElt.width(),y2:this.jQueryElt.position().top+this.jQueryElt.height()}};Card.prototype.setDeckNum=function(a){this.deckNum=a};Card.prototype.getDeckNum=function(){return this.deckNum};Card.prototype.setDeck=function(a){this.deck=a};Card.prototype.getDeck=function(){return this.deck};Card.prototype.setCard=function(a){this.color=a.color;this.number=a.number;this.type=a.type};Card.prototype.getCard=function(){return{color:this.color,number:this.number,cardtype:this.cardtype}};Card.prototype.getColorNumber=function(){return this.colorNumber};Card.prototype.getColor=function(){return this.color};Card.prototype.setColor=function(a){this.color=a};Card.prototype.setNumber=function(a){this.number=a};Card.prototype.getNumber=function(){return this.number};Card.prototype.setCardType=function(a){this.cardtype=a};Card.prototype.setVisible=function(a){var b=this;this.visible=a;if(this.visible===true){this.jQueryElt.removeClass("rotate").css({cursor:"pointer"});setTimeout(function(){b.jQueryElt.addClass("rotate")},5);setTimeout(function(){b.jQueryElt.css("background-position",-(game.spriteXStart+((b.colorNumber-1)*game.xSpace))+"px -"+game.backsY[b.cardtype]+"px")},250);this.dropEnabled=this.dragEnabled=true}else{this.jQueryElt.css({"background-position":"-"+game.cardBackX+"px -"+game.backYMisc+"px",cursor:"normal"});this.dropEnabled=this.dragEnabled=false}};Card.prototype.isVisible=function(){return this.visible};Card.prototype.getCardType=function(){return this.cardtype};Card.prototype.setStatus=function(a){this.status=a};Card.prototype.toggleStatus=function(){this.setStatus(this.status===ST_SELECTED?ST_UNSELECTED:ST_SELECTED)};Card.prototype.onClick=function(a){game.clickCard(this)};Card.prototype.onDoubleClick=function(b){Console.log("doubleclick detected");var a=this.deck.getDeckType();if((a===DECK_BOTTOM)||(a===DECK_WASTE)&&(this.deck.getTop()===this)){Console.log("flick possible !");game.addToAce(this)}};Card.prototype.onOver=function(a){Console.log(""+a+"over "+this);if(this.deck!==null){if(this.deck.acceptCard(a)){this.jQueryElt.css("opacity",0.5)}}else{var b=game.bottomDecks[this.deckNum];if(b.acceptCard(a)){this.jQueryElt.css("opacity",0.5)}}};Card.prototype.onOut=function(a){Console.log("out "+this);this.jQueryElt.css("opacity",1)};Card.prototype.onStoppedDragging=function(){Console.log("stopped dropping");this.deck.toggleDragging(this,false)};Card.prototype.onCancelDragging=function(){Console.log("stopped dragging "+this);var a=this.deck;a.toggleDragging(this,false);a.setOldPositionFromCard(this);setTimeout(function(){game.blockedSelection=false},300)};Card.prototype.onStartDragging=function(){Console.log("started dragging "+this);game.blockedSelection=true;this.deck.toggleDragging(this,true)};Card.prototype.onDropping=function(a){Console.log("dropped ",a," over ",this);var b=(this.deck!==null)?this.deck:game.bottomDecks[this.deckNum];if(b.acceptCard(a)){Console.log("accepted !");game.cardPos={x:this.position.x,y:this.position.y};game.swapDeck(a,b);game.selectedCard=null}else{Console.log("refused :"+a+" over "+this);a.onCancelDragging()}};Card.prototype.onDragging=function(a,b){this.deck.setPositionFromCard(this,a,b)};Card.prototype.toggleDragging=function(a){if(a){this.jQueryElt.addClass("dragged");game.maxDepth++;this.depth(game.maxDepth)}else{this.jQueryElt.removeClass("dragged")}};Card.prototype.toggleSelected=function(){this.jQueryElt.toggleClass("selected")};Card.prototype.toggleMoving=function(){this.jQueryElt.removeClass("moving");this.jQueryElt.addClass("moving")};Card.prototype.enableSelection=function(a){if(this.selectable===a||typeof a!=="boolean"){return}this.selectable=a;if(this.selectable===true){this.jQueryElt.bind(EventsManager.EVENT_DOWN,jQuery.proxy(function(b){if(game.blockedSelection===true||(b.button&&(b.button!==0))){return}this.oldCssPosition={left:this.jQueryElt.css("left"),top:this.jQueryElt.css("top")};EventsManager.setDraggingElement(this,(CM.isiOS?b.originalEvent.touches[0]:b))},this))}else{this.jQueryElt.unbind(EventsManager.EVENT_DOWN)}};Card.prototype.enableDragAndDrop=function(a,b){if(a!==null){this.dragEnabled=a}if(b!==null){this.dropEnabled=b}};Card.prototype.toString=function(){return this.colorNumber+" de "+this.cardtype};Card.prototype.setPosition=function(b,f,c,d){var a=this.position,e=this;if(typeof c!=="undefined"){if(b===null){this.jQueryElt.addClass("visible")}else{a.x=c;a.y=d;this.jQueryElt.css({top:f+"px",left:b+"px"});this.jQueryElt.addClass("visible");setTimeout(function(){e.jQueryElt.css({top:d+"px",left:c+"px"})},25)}}else{if(b!=null){a.x=b;a.y=f;this.jQueryElt.addClass("visible").css({top:a.y+"px",left:a.x+"px"})}else{this.jQueryElt.addClass("visible")}}a.x1=a.x;a.y1=a.y;a.x2=a.x1+this.width;a.y2=a.y1+this.height;if(this.oldCssPosition==null){this.oldCssPosition={left:a.x+"px",top:a.y+"px"}}};Card.prototype.saveOldPosition=function(a,b){this.oldCssPosition={left:a+"px",top:b+"px"}};Card.prototype.setOldPosition=function(){var a=this.position;a.x1=a.x=parseInt(this.oldCssPosition.left);a.y1=a.y=parseInt(this.oldCssPosition.top);a.x2=a.x1+this.width;a.y2=a.y1+this.height;this.jQueryElt.css(this.oldCssPosition)};Card.prototype.getPosition=function(){return this.position};Card.prototype.hide=function(){this.jQueryElt.removeClass("visible")};Card.prototype.depth=function(a){if(typeof a==="undefined"||this.zIndex>a){return this.zIndex}else{this.zIndex=a;this.jQueryElt.css("z-index",this.zIndex)}};Card.prototype.getStateInfo=function(){return{number:this.number,cardtype:this.cardtype,visible:this.visible}};
7,141
7,141
0.775382
dba3b37352bacd217b147771d67e62b8d84a1d78
4,474
js
JavaScript
SW_withReact/public/javascripts/form.js
ajrauen/SampleJobQuestions
7aaef9cdd7115ebbb5ee5afded16ff0396284e28
[ "MIT" ]
null
null
null
SW_withReact/public/javascripts/form.js
ajrauen/SampleJobQuestions
7aaef9cdd7115ebbb5ee5afded16ff0396284e28
[ "MIT" ]
null
null
null
SW_withReact/public/javascripts/form.js
ajrauen/SampleJobQuestions
7aaef9cdd7115ebbb5ee5afded16ff0396284e28
[ "MIT" ]
null
null
null
var appData = [ { name: "Mark-Paul Gosselaar", photo_url: "", id:"1" }, { name: "Delta Burke", photo_url: "images/avatars/delta.png", id:"2" }, { name: "Alf", photo_url: "images/avatars/alf.png", id:"3" }, { name: "Jaleel White", photo_url: "images/avatars/jaleel.png", id:"4" }, { name: "Ralph Macchio", photo_url: "images/avatars/ralph.png", id:"5" }, { name: "Candace Cameron", photo_url: "images/avatars/candace.png", id:"6" }, { name: "Patrick Duffy", photo_url: "images/avatars/pduff.png", id:"7" }, { name: "Arnold Schwartzengger", photo_url: "images/avatars/arnold.png", id:"8" } ]; function veryBadFindAndRemoveFromArrayByID(ID){ var i = 0, len = appData.length; for(i;i<len;i++){ if(appData[i].id === ID){ appData.splice(i,1); return; } } } var MainContent = React.createClass({ render: function() { return ( <div id="main-content"> <FormExample data={this.props.data} /> <hr/> <div id="personGrid" className="gridContainer"/> </div> ); } }); var FormExample = React.createClass({ onClickHandler:function(evt){ evt.preventDefault(); var newPerson = { name:document.getElementById('Full Name_Input').value, photo_url:document.getElementById('Photo URL_Input').value, id: Math.floor(Math.random()*100000000 + 1).toString() }; appData.unshift(newPerson); React.render( <GridContainer data={appData} />, $('#personGrid')[0] ); }, render: function() { var reset = true; var handle = this.onChangeHandler; return ( <form> {this.props.data.map(function(m,idx){ return <LabelInput label={m.label}/> })} <button onClick={this.onClickHandler}>Create</button> </form> ); } }); var LabelInput = React.createClass({ getInitialState: function() { return { value:"" }; }, onChangeHandler:function(evt){ this.setState({value:evt.target.value}); }, render: function() { return ( <div> <label>{ this.props.label}</label> <input id={this.props.label + "_Input"} onChange={this.onChangeHandler} value={this.state.value} /> </div> ); } }); var GridContainer = React.createClass({ render: function() { return ( <div className="gridContainer"> {this.props.data.map(function(m,idx){ return <GridItem data={m} /> })} </div> ); } }); var GridItem = React.createClass({ render: function() { return ( <div className="grid_item"> <div className="grid_item_container"> <LeftPictureFrame photo_url={this.props.data.photo_url} /> <RightPictureFrame data={this.props.data} /> </div> </div> ); } }); var LeftPictureFrame = React.createClass({ render: function() { return ( <div className="person_left_container"> <div className="image_container"> <img src={this.props.photo_url ? this.props.photo_url : '/images/default.png'} /> </div> </div> ); } }); var RightPictureFrame = React.createClass({ removeGridItem:function(evt){ veryBadFindAndRemoveFromArrayByID(evt.target.getAttribute('data-personid')); React.render( <GridContainer data={appData} />, $('#personGrid')[0] ); }, render: function() { return ( <div className="person_right_container"> <div className="grid_item_close_container"> <button className="close_btn" data-personid={this.props.data.id} onClick={this.removeGridItem}></button> </div> <label>{this.props.data.name}</label> </div> ); } }); React.render( <MainContent data={[ {label:"Full Name",type:"input"}, {label:"Photo URL",type:"input"} ]} />, document.body ); React.render( <GridContainer data={appData} />, $('#personGrid')[0] );
26.630952
124
0.519669
dba427252f168960cf7a3155ff22351503da6836
2,784
js
JavaScript
build/translations/de.js
nhiennt/ckeditor5-build-decoupled-document
a9aad8723f0d745c4ea149b9f295c80ffddca5e9
[ "MIT" ]
null
null
null
build/translations/de.js
nhiennt/ckeditor5-build-decoupled-document
a9aad8723f0d745c4ea149b9f295c80ffddca5e9
[ "MIT" ]
null
null
null
build/translations/de.js
nhiennt/ckeditor5-build-decoupled-document
a9aad8723f0d745c4ea149b9f295c80ffddca5e9
[ "MIT" ]
null
null
null
(function(d){d['de']=Object.assign(d['de']||{},{a:"Datei kann nicht hochgeladen werden:",b:"Bild Werkzeugleiste",c:"Tabelle Werkzeugleiste",d:"Schriftgröße",e:"Standard",f:"Sehr klein",g:"Klein",h:"Groß",i:"Sehr groß",j:"Schriftart",k:"Kursiv",l:"Linksbündig",m:"Rechtsbündig",n:"Zentriert",o:"Blocksatz",p:"Textausrichtung",q:"Text-Ausrichtung Toolbar",r:"Fett",s:"Unterstrichen",t:"Durchgestrichen",u:"Bild oder Datei einfügen",v:"Überschrift auswählen",w:"Überschrift",x:"Blockzitat",y:"Bild-Steuerelement",z:"Bild in voller Größe",aa:"Seitenbild",ab:"linksbündiges Bild",ac:"zentriertes Bild",ad:"rechtsbündiges Bild",ae:"Bild einfügen",af:"Einzug vergrößern",ag:"Einzug verkleinern",ah:"Nummerierte Liste",ai:"Aufzählungsliste",aj:"Tabelle einfügen",ak:"Kopfspalte",al:"Spalte links einfügen",am:"Spalte rechts einfügen",an:"Spalte löschen",ao:"Spalte",ap:"Kopfzeile",aq:"Zeile unten einfügen",ar:"Zeile oben einfügen",as:"Zeile löschen",at:"Zeile",au:"Zelle verbinden",av:"Zelle rechts verbinden",aw:"Zelle unten verbinden",ax:"Zelle links verbinden",ay:"Zelle vertikal teilen",az:"Zelle horizontal teilen",ba:"Zellen verbinden",bb:"Gelber Marker",bc:"Grüner Marker",bd:"Pinker Marker",be:"Blauer Marker",bf:"Rote Schriftfarbe",bg:"Grüne Schriftfarbe",bh:"Texthervorhebung entfernen",bi:"Texthervorhebung",bj:"Text hervorheben Werkzeugleiste",bk:"Bildunterschrift eingeben",bl:"Hochladen fehlgeschlagen",bm:"Medien-Widget",bn:"Upload läuft",bo:"Widget Werkzeugleiste",bp:"Medium einfügen",bq:"Die Url darf nicht leer sein",br:"Diese Medien-Url wird nicht unterstützt",bs:"Link",bt:"Schwarz",bu:"Dunkelgrau",bv:"Grau",bw:"Hellgrau",bx:"Weiß",by:"Rot",bz:"Orange",ca:"Gelb",cb:"Hellgrün",cc:"Grün",cd:"Aquamarinblau",ce:"Türkis",cf:"Hellblau",cg:"Blau",ch:"Violett",ci:"Die URL des angepassten Bildes konnte nicht abgerufen werden.",cj:"Das angepasste Bild konnte nicht ausgewählt werden.",ck:"Das Bild konnte an der aktuellen Position nicht eingefügt werden.",cl:"Einfügen des Bildes fehlgeschlagen",cm:"Alternativ Text ändern",cn:"Dropdown-Liste Werkzeugleiste",co:"Rückgängig",cp:"Wiederherstellen",cq:"Rich-Text-Editor, %0",cr:"Speichern",cs:"Abbrechen",ct:"Medien-URL in das Eingabefeld einfügen.",cu:"Tipp: Zum schnelleren Einbetten können Sie die Medien-URL in den Inhalt einfügen.",cv:"Medien-Url",cw:"Link entfernen",cx:"Link bearbeiten",cy:"Link im neuen Tab öffnen",cz:"Dieser Link hat keine Adresse",da:"Editor Werkzeugleiste",db:"Mehr anzeigen",dc:"Link Adresse",dd:"%0 von %1",de:"vorherige",df:"Nächste",dg:"Textalternative",dh:"In neuem Tab öffnen",di:"Herunterladbar",dj:"Absatz",dk:"Überschrift 1",dl:"Überschrift 2",dm:"Überschrift 3",dn:"Überschrift 4",do:"Überschrift 5",dp:"Überschrift 6"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
2,784
2,784
0.757543
dba475afe4c6c508d2722fa8b66d2f662e2781ca
451
js
JavaScript
packages/egg-beidou/test/example/redux/saga/index.js
canvasT/beidou
5fde1f2366d3a0b7464f36f890c57c9467a2fd8c
[ "MIT" ]
2,922
2017-06-13T09:42:37.000Z
2022-03-23T07:51:05.000Z
packages/egg-beidou/test/example/redux/saga/index.js
canvasT/beidou
5fde1f2366d3a0b7464f36f890c57c9467a2fd8c
[ "MIT" ]
281
2017-12-16T16:31:57.000Z
2022-03-01T13:10:58.000Z
packages/egg-beidou/test/example/redux/saga/index.js
canvasT/beidou
5fde1f2366d3a0b7464f36f890c57c9467a2fd8c
[ "MIT" ]
346
2017-07-17T13:16:08.000Z
2022-03-31T09:11:37.000Z
import createSagaMiddleware from 'redux-saga'; import { put, takeLatest } from 'redux-saga/effects'; import actions from '../actions'; // create the saga middleware export const sagaMiddleware = createSagaMiddleware(); function* greet() { yield put(actions.success('everyone')); } function* mySaga() { yield takeLatest(actions.greet, greet); } export default mySaga; // entry point export const run = () => { sagaMiddleware.run(mySaga); };
20.5
53
0.720621
dba89a682f5a9885d8817b2a193b88bac197f0b6
4,541
js
JavaScript
app.js
yhkaplan/Shop
2ee7deb42af2c1b49b1d16609916ff6d468509b7
[ "MIT" ]
8
2020-09-22T10:51:09.000Z
2021-01-22T17:36:13.000Z
app.js
yhkaplan/Shop
2ee7deb42af2c1b49b1d16609916ff6d468509b7
[ "MIT" ]
null
null
null
app.js
yhkaplan/Shop
2ee7deb42af2c1b49b1d16609916ff6d468509b7
[ "MIT" ]
null
null
null
const faker = require('faker') const express = require('express') const app = express() const port = 3000 // SFSymbols to stand in as product images productImages = ['headphones', 'gift', 'alarm', 'lightbulb', 'bandage', 'metronome', 'paperclip', 'book', 'pencil', 'flag'] function sample(array) { const index = Math.floor(array.length * Math.random()) return array[index] } const logger = (req, res, next) => { console.log(`Request made to: ${req.url}`) next() } app.use(logger) app.get('/home_content', (req, res) => { res.send({ 'sections': [ { 'kind': 'banner', 'ab_test_set': 'a', 'id': 0 }, { 'kind': 'shortcut', 'ab_test_set': 'a', 'id': 1 }, { 'kind': 'featured_product', 'title': faker.lorem.words(), 'subtitle': faker.lorem.sentence(), 'id': 2 }, { 'kind': 'article', 'title': 'Articles', 'id': 3 }, { 'kind': 'featured_product', 'title': faker.lorem.words(), 'subtitle': faker.lorem.sentence(), 'id': 4 }, { 'kind': 'featured_product', 'title': faker.lorem.words(), 'subtitle': faker.lorem.sentence(), 'id': 5 }, { 'kind': 'featured_product', 'title': faker.lorem.words(), 'subtitle': faker.lorem.sentence(), 'id': 4 } ] }) }) app.get('/featured_products', (req, res) => { res.send({ 'products': [ { 'image_url': sample(productImages), 'id': faker.random.uuid(), 'name': faker.commerce.productName(), 'price': faker.commerce.price() }, { 'image_url': sample(productImages), 'id': faker.random.uuid(), 'name': faker.commerce.productName(), 'price': faker.commerce.price() }, { 'image_url': sample(productImages), 'id': faker.random.uuid(), 'name': faker.commerce.productName(), 'price': faker.commerce.price() }, { 'image_url': sample(productImages), 'id': faker.random.uuid(), 'name': faker.commerce.productName(), 'price': faker.commerce.price() }, { 'image_url': sample(productImages), 'id': faker.random.uuid(), 'name': faker.commerce.productName(), 'price': faker.commerce.price() }, { 'image_url': sample(productImages), 'id': faker.random.uuid(), 'name': faker.commerce.productName(), 'price': faker.commerce.price() } ] }) }) app.get('/shortcuts', (req, res) => { res.send({ 'shortcuts': [ { 'image_url': sample(productImages), 'id': faker.random.uuid(), 'title': 'Theme' }, { 'image_url': sample(productImages), 'id': faker.random.uuid(), 'title': 'Stories' }, { 'image_url': sample(productImages), 'id': faker.random.uuid(), 'title': 'Gift' }, { 'image_url': sample(productImages), 'id': faker.random.uuid(), 'title': 'Ranking' } ] }) }) app.get('/articles', (req, res) => { res.send({ 'articles': [ { 'image_url': sample(productImages), 'id': faker.random.uuid(), 'title': faker.lorem.words(), 'subtitle': faker.lorem.paragraph() }, { 'image_url': sample(productImages), 'id': faker.random.uuid(), 'title': faker.lorem.words(), 'subtitle': faker.lorem.paragraph() }, { 'image_url': sample(productImages), 'id': faker.random.uuid(), 'title': faker.lorem.words(), 'subtitle': faker.lorem.paragraph() } ] }) }) app.get('/banners', (req, res) => { res.send({ 'banners': [ { 'image_url': sample(productImages), 'id': faker.random.uuid() }, { 'image_url': sample(productImages), 'id': faker.random.uuid() }, { 'image_url': sample(productImages), 'id': faker.random.uuid() }, { 'image_url': sample(productImages), 'id': faker.random.uuid() }, { 'image_url': sample(productImages), 'id': faker.random.uuid() }, { 'image_url': sample(productImages), 'id': faker.random.uuid() } ] }) }) app.listen(port, () => console.log(`Listening at http://localhost:${port}`))
23.9
123
0.49967
dba8f87c8d8d1b2af706b68c6ef95b48e135dce7
3,058
js
JavaScript
src/after_all.js
borisyankov/binary-bot
acffc84842fdc2dca3f74ca47a875df96fa8bedd
[ "MIT" ]
null
null
null
src/after_all.js
borisyankov/binary-bot
acffc84842fdc2dca3f74ca47a875df96fa8bedd
[ "MIT" ]
null
null
null
src/after_all.js
borisyankov/binary-bot
acffc84842fdc2dca3f74ca47a875df96fa8bedd
[ "MIT" ]
null
null
null
(function AfterAll(){ var supportedLanguages = ['zh_tw', 'de', 'id', 'zh_cn', 'it', 'vi', 'ar', 'pl', 'ru', 'pt', 'es', 'fr', 'en']; var parseQueryString = function parseQueryString() { var str = window.location.search; var objURL = {}; str.replace( new RegExp( "([^?=&]+)(=([^&]*))?", "g" ), function( $0, $1, $2, $3 ){ objURL[ $1 ] = $3; } ); return objURL; }; $('#language').change(function change(e){ localStorage.lang = e.target.value; window.location.search = '?l=' + e.target.value; }); var queryStr = parseQueryString(); if ( queryStr.hasOwnProperty('l') && queryStr.l !== '' && supportedLanguages.indexOf(queryStr.l) >= 0 ) { window.lang = queryStr.l; localStorage.lang = queryStr.l; } else if (localStorage.lang){ window.lang = localStorage.lang; } else { window.lang = 'en'; } $('#language').val(window.lang); window.i18n = i18next; i18n._ = function _(str, opt){ var key = sha1(str); var result = i18n.t(key); return (result === '') ? str : result; }; $.ajaxPrefilter(function( options, originalOptions, jqXHR ) { options.async = true; }); i18n.xml = function xml(dom){ for ( var i in dom.children ) { if ( dom.children.hasOwnProperty(i) && !isNaN(+i) ) { var child = dom.children[i]; var str = child.getAttribute('i18n-text'); var key; var hasTranslation = false; if ( str === null ) { key = child.getAttribute('i18n'); if ( key !== null ) { hasTranslation = true; } } else { key = sha1(str); hasTranslation = true; } var result = i18n.t(key); if ( hasTranslation ) { child.setAttribute('name', (result === '') ? str : result); } if ( child.children.length > 0 ) { i18n.xml(child); } } } return dom; }; $.get('www/i18n/' + lang + '.json', function(translation) { var resources = { en: { translation: translation }, }; i18n.init({ lng: 'en', fallbackLng: 'en', ns: [ 'translation' ], defaultNS: [ 'translation' ], resources: resources }, function() { // be careful with assignments if ( typeof Bot !== 'undefined' ) { Bot.config = Bot.Config(); Bot.utils = Bot.Utils(); Bot.globals = Bot.Globals(); Bot.Version(); Bot.conditions = Bot.Conditions(); Bot.Markets(); Bot.Trade(); Bot.Definitions(); Bot.CodeGenerators(); var script = document.createElement( 'script' ); script.type = 'text/javascript'; var blocklyLang; if ( lang === 'zh_tw' ) { blocklyLang = 'zh-hant'; } else if ( lang === 'zh_cn' ) { blocklyLang = 'zh-hans'; } else { blocklyLang = lang; } script.src = 'node_modules/blockly/msg/js/' + blocklyLang + '.js'; $('body').append(script); Bot.View(function(){ Bot.tours.introduction = Bot.Introduction(); Bot.tours.welcome = Bot.Welcome(); Bot.tours.welcome.welcome(); }); } $('[data-i18n-text]').each(function(){ $(this).text(i18n._($(this).attr('data-i18n-text'))); }); }); }); })();
25.272727
111
0.567037
dba91d94e8aa997da6b66b194fe7aed0c143f479
2,472
js
JavaScript
server/examples/sql/sparkjdbc.js
ckadner/eclairjs
e354253af9a92cb868783060feb6fb7a6ee12403
[ "Apache-2.0" ]
138
2016-10-10T22:18:46.000Z
2022-01-20T18:47:52.000Z
server/examples/sql/sparkjdbc.js
ckadner/eclairjs
e354253af9a92cb868783060feb6fb7a6ee12403
[ "Apache-2.0" ]
27
2016-10-12T19:58:45.000Z
2022-02-16T13:55:39.000Z
server/examples/sql/sparkjdbc.js
ckadner/eclairjs
e354253af9a92cb868783060feb6fb7a6ee12403
[ "Apache-2.0" ]
25
2016-09-30T18:08:58.000Z
2020-07-07T03:05:53.000Z
/* * Copyright 2015 IBM Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * The example requires a mySQL database "eclairjstesting" with a people table * the JDBC drivers must be added to the java class path * * Note to run this example you must include the JDBC driver class must be visible to the primordial class loader * on the client session and on all executors. This is because Java’s DriverManager class does a security check * that results in it ignoring all drivers not visible to the primordial class loader when one goes to open a connection. * as described https://spark.apache.org/docs/latest/sql-programming-guide.html#jdbc-to-other-databases and http://stackoverflow.com/questions/29552799/spark-unable-to-find-jdbc-driver * Another option is to include the --driver-class-path option on the command line for example: * <path to EclairJS>/bin/eclairjs.sh --conf spark.executor.extraClassPath= <path to JDBC jar file> --driver-class-path <path to JDBC jar file> <path to EclairJS>/examples/sql/sparkjdbc.js */ var SparkConf = require('eclairjs/SparkConf'); var SparkContext = require('eclairjs/SparkContext'); var SQLContext = require('eclairjs/sql/SQLContext'); var SparkSession = require('eclairjs/sql/SparkSession'); var spark = SparkSession .builder() .appName("JavaScript Spark JDBC Example") .getOrCreate(); var url="jdbc:mysql://localhost:3306/eclairjstesting"; var prop = {}; prop["user"] = "root"; prop["password"] = "eclairjstestPW"; var peopleDF = spark.read().jdbc(url, "people", prop); peopleDF.show(); var peopleDF = spark.read().jdbc(url, "people", ["age > 20"], prop); peopleDF.show(); var writer = peopleDF.write(); try { writer.jdbc(url, "peoplewritetest", prop); } catch (e) { print(" exception " + e); print("saving in overwrite mode"); writer.mode('overwrite').jdbc(url, "peoplewritetest", prop); } //scala> val males = sqlContext.read.jdbc(url,"person",Array("gender='M'"),prop)
43.368421
189
0.735032
dba9e5cc84e74f61c7ae039708072d64b136201a
22,718
js
JavaScript
common/js/libs/ui/notifications.js
YouComedy/YCM-frontend
899e3fc7f1f4b12016eb45e6d84800cf3ad3d5d8
[ "Apache-2.0" ]
3
2016-11-04T07:12:38.000Z
2017-11-22T16:55:35.000Z
common/js/libs/ui/notifications.js
YouComedy/YCM-frontend
899e3fc7f1f4b12016eb45e6d84800cf3ad3d5d8
[ "Apache-2.0" ]
1
2016-11-10T07:47:28.000Z
2016-11-20T11:43:48.000Z
common/js/libs/ui/notifications.js
YouComedy/YCM-frontend
899e3fc7f1f4b12016eb45e6d84800cf3ad3d5d8
[ "Apache-2.0" ]
null
null
null
// http://demo.sofcase.net/jnotifier-codecanyon/ // https://github.com/diy/intercom.js ; (function (a, APP, _, doc ) { var $ = a, Notify = APP.Notify; Notify.set({ "timer" : 10E3, "lastfocus" : +new Date, "visible" : 0 }); Notify.visibleCounter = function(val){ var current = Notify.get("visible"); if(!val) return current; Notify.set("visible", current + val); } $.win.on({ 'focus' : function(){ if( +new Date > Notify.get("lastfocus") ) { $("#notifier-box .message-box").each(function(i, block){ setTimeout(function(){ $(block).fadeOut(function(){ $(block).remove(); Notify.onClose(); }); }, 4E3 * (i + 1)); }); Notify.set("lastfocus", +new Date); } Notify.set({ "timer" : 10E3 }); }, 'blur' : function(){ Notify.set('timer', 0); } }); var NotifyStack = []; Notify.onClose = function(){ Notify.visibleCounter( -1 ); var notify = NotifyStack.shift(); notify && Notify.show.apply(null, notify); } Notify.show = function( header, content, img, opts ){ if($.isIphone()) return; var action = ""; if( typeof header === 'object' ) { content = header.content || header.html; img = header.img; opts = header.opts; action = header.action; header = header.title; } if( header && !content ) { content = header; header = ""; } !(opts = opts || {}).click && (opts.click = function(e){ if(!$(e.target).is("a")) window.location.href = APP.User.url() + "/news"; }); var visible = Notify.visibleCounter(); if(visible >= 3) { NotifyStack.push([header, content, img, opts]); } else { showNotification(header, content, img, opts); Notify.visibleCounter( 1 ); } if( APP.News && APP.News.Records ) { var newsitem = new APP.News.Records.model({action : action, html : content, timestamp: new Date}); // newsitem.$el.addClass("_new"); if(APP.News.Records.filterBy === "comment") { if( content.indexOf("комментарий") > -1 ) { newsitem.view().prepend( true ); } } else { newsitem.view().prepend( true ); } } } Notify.showAll = function( arr ){ arr && arr.length && _.each( arr, function( msg ){ Notify.show( msg ); }); } // Суперглобальная нотификация // Показывает огромную штуку над хедером Notify.global = function( msg ) { var tip = $(".notifyTop"), height = tip.innerHeight(), aprop = 'marginTop', anim = {}, body_anim = {}, visibile = parseInt(tip.css(aprop)) >= 0; $('.notifyTop__content').text(msg) if( visibile ) { anim[aprop] = height * -1; body_anim['paddingTop'] = "-=" + height; } else { anim[aprop] = 0; body_anim['paddingTop'] = "+=" +height; } $('body').animate(body_anim, function(){ tip.animate(anim); }); } // Нотификация текущего пульзователя // Показывается около его ника в правом верхнем // углу, со списком новостей и их количеством. Notify.summary = function( data ){ var title = []; data = data || {}; // { // 'like' : rnd(0,100), // 'comment' : rnd(0, 100), // 'follow' : rnd(0, 100), // 'repost' : rnd(0, 100) // } var stats = { 'like' : data.like || 0, 'comment' : data.comment || 0, 'follow' : data.follow || 0, 'repost' : data.repost || 0 } _.each( stats , function( num, key ){ title.push("<a href='/news/"+key+"'><b><i class='icon-smallnews-"+key+"'></i>" + num + "</b></a>"); }); title.length && //$("#header-user-link") $("#menu .navbar-inner .navbar__profile .dropdown").errorTip({ // Контент title : title.join(""), // Класс в котором переопределны все свойства classname : 'summary-tooltip', // Сдвигаем ее на 60 пикселей offsetX: -60, place : 'in bottom', // Есть какой-то баг в бутстрепе при пересчете размеров тултипа // Поэтому выставляем ширину тултипа руками, благо она известна. // @todo найти и исправить эту ошибку actualWidth : 210, //Время через которое скрываем нотифайку hide: Notify.get('timer') }) .attr("href", $("#header-user-link").attr("href") + "/news"); } Notify.subscribtions = (function(){ function createCounter(){ var $c = $("#subscriptions-counter"); if(!$c.length) { $c = $('<span id="subscriptions-counter" class="single-counter"></span>'); $c.appendTo("#menu a.menu__counterwrapper"); } return $c; } var $counter = createCounter(), counterVal = 0; counterVal = Number($counter.text()) || 0; if(counterVal == 0) $counter.hide(); return function( count ){ if($counter.is(":hidden")) counterVal = 0; if( count > counterVal ) { if(!$counter.length) $counter = createCounter(); var count_text; if (count > 99){ count_text = '&infin;'; $counter.css('font-size', 25); } else { count_text = count; $counter.css('font-size', 12); } $counter.html(count_text); counterVal = count; if($counter.is(":hidden")) $counter.show().css('opacity', 0).width(0).animate({width: '22px', opacity: 1}, 500); } } })(); var canvas; function apply (url) { var link = $('link[rel$=icon]'); if(link.attr("href") == url) return; link.replaceWith(''); $('head').append( $('<link rel="shortcut icon" type="image/x-icon"/>') .attr('href', url)); } /** * jQuery.favicon * * @param {String} iconURL * @param {String} alternateURL * @param {Function} onDraw * * function (iconURL) * function (iconURL, onDraw) * function (iconURL, alternateURL, onDraw) */ $.favicon = function(iconURL, alternateURL, onDraw) { if (arguments.length == 2) { // alternateURL is optional onDraw = alternateURL; } if (onDraw) { canvas = canvas || $('<canvas />')[0]; if (canvas.getContext) { var img = $('<img />')[0]; img.onload = function () { canvas.height = canvas.width = this.width; var ctx = canvas.getContext('2d'); ctx.drawImage(this, 0, 0); onDraw(ctx); apply(canvas.toDataURL('image/png')); }; img.src = iconURL; } else { apply(alternateURL || iconURL); } } else { apply(iconURL); } return this; }; Notify.faviconAlert = function(){ if(Notify._faviconTimer) return; var is_active = true; Notify._faviconTimer = setInterval(function(){ Notify.setFavicon(is_active = !is_active) }, 1333); }; Notify.clearFaviconAlert = function(){ Notify.setFavicon(false); clearInterval(Notify._faviconTimer); Notify._faviconTimer = null; }; Notify.setFavicon = function(is_blinking){ var icons = ['/favicon.ico', '/favicon-new.ico']; $.favicon(icons[~~is_blinking]); }; // mHeader, mContent, mImage, mOptions function showNotification(b, c, d, e) { var f, g, h, i, j, k, l; e = a.extend({ lifeTime: Notify.get('timer') || 0, click: undefined, close: undefined, customClass: "" }, e); // Основной контейнер для списка увеломлений f = a("#notifier-box"); if (!f.length) { f = a("<div>", { id: "notifier-box" }).appendTo(document.body) } // Блок одного уведомления g = a("<div>", { "class": "message-box", css: { display: "none" } }); // Заголовок messageHeader = a("<div>", { "class": "message-header", html: b }); // Контент h = a("<div>", { "class": "message-body", //html : c //html : "<i class='news_icon news_icon_like'></i><p>%actor% %action% %username%</p><span class='newslist__time'>{{= timestamp }}</span>" }); // i = a("<div>", { html: c //html: "<i class='news_icon news_icon_like'></i><p>%actor% %action% %username%</p><span class='newslist__time'>{{= timestamp }}</span>" }); j = a("<a>", { "class": "message-close", href: "#", title: "Закрыть" // click: function () { // a(this).parent().fadeOut(500, function () { // a(this).remove() // }) // } }).on("click", function(){ a(this).parent().fadeOut(500, function () { a(this).remove() }); return false; }); if (typeof d != "undefined") { k = a("<div>", { "class": "thumb" }); l = a("<img>", { src: d }) } g.appendTo(f).fadeIn(500); j.appendTo(g); messageHeader.appendTo(g); h.appendTo(g); if (typeof k != "undefined") { k.appendTo(h); l.appendTo(k) } i.appendTo(h); if (e.lifeTime > 0) { setTimeout(function () { a(g).fadeOut(500, function () { a(this).remove(); Notify.onClose(); }) }, e.lifeTime) } if (e.customClass != "") { g.addClass(e.customClass) } if (typeof e.click != "undefined") { g.click(function (a) { if (!$(a.target).is(".message-close")) { e.click.call(this ,a); } }) } if (typeof e.close != "undefined") { g.click(function (a) { if ($(a.target).is(".message-close")) { e.close.call(this); return false; } }) } g.click(function (e) { var target = $(e.target); //if(!target.is("")) g.fadeOut(500, function(){ g.remove(); Notify.onClose(); }); }) return this } var _popoverLikeBtn = '.item__buttonWrap[data-vote="like"]', // _popoverLikeBtn = '.item__button:has(.item__buttonWrap[data-vote="like"])', _popoverDislikeBtn = '.item__dislike'; var _popoversList = { "like_fst" : { content : "С первым лайком! Каждая оценка делает рекомендации точнее.", selector : _popoverLikeBtn, context : "#i", place : "in bottom" }, "like_share" : { content : "Понравилась шутка? Скинь ссылку другу!", selector : _popoverLikeBtn, context : "#i", place : "bottom" }, "like_subscribe" : { content : [ "Подписывайтесь на пользователей, чтобы следить за их шутками!", "<a href='/user/{username}' data-href='/user/{user_id}/follow' data-follow='{user_id}' data-uid='{user_id}' onclick='APP.User.setFollow(this,{success:function(){$.alertInfo(\"Вы успешно подписались на {username}\")}});return false'>Подписаться!</a>" ].join(""), selector : _popoverLikeBtn, context : "#i", place : "bottom" }, "like_repost" : { content : "Делайте репост, чтобы добавить шутку в свою ленту. Если у вас есть подписчики, то они увидят ее в своей ленте.", selector : _popoverLikeBtn, context : "#i", place : "bottom" }, "like_upload" : { content : "Загружайте шутки, чтобы тоже получать лайки! <br><a href='/add'>Добавить шутку</a>", selector : _popoverLikeBtn, context : "#i", place : "bottom" }, "like_nodislike" : { content : "Ставьте дислайки, чтобы больше не видеть плохие шутки в своих рекомендациях!", selector : _popoverLikeBtn, context : "#i", place : "bottom" }, "like_repeat_share" : { content : "Крутыми шутками надо делиться! Скиньте ссылку другу или поделитесь ею в социальной сети.", selector : ".b-share", context : "#i" }, "dislike_fst" : { content : "Воу! Первый дислайк! Дислайки помогают нам убирать \"негодный\" контент из ваших рекомендаций.", selector : _popoverDislikeBtn, context : "#i" }, "repost_fst" : { content : "Ае, ваш первый репост! Теперь ваши подписчики его увидят. Нет подписчиков? <a href='/friends/invite'>пригласите друзей</a>, с ними веселее.", selector : "#upload" }, "repost_all" : { content : "Похоже, вам понравилась шутка :) Поделитесь ей с друзьями, чтобы поднять им настроение!", selector: "#upload", }, // "" : { // content : "", // selector : "" // }} "have_to_vote" : { content : "Стой! Не забудь оставить оценку!", selector : _popoverLikeBtn, context : "#i", place : "in bottom" }, } var _popoverTPL = [ '<div class="popover _black _banana">', '<div class="popover-banana"></div>', '<a class="popover-close" onclick="try{event.stopPropagation();window.event&&(window.event.cancelBubble=!0);}catch(e){};$(this.parentNode).fadeOut(function(){$(this).remove()});return false;"></a>', '<div class="arrow"></div>', '<div class="popover-inner">', '<div class="popover-content"></div>', '</div>', '</div>' ].join(""); Notify.insertPopover = function( opts ) { var popover = _popoversList[opts.type]; if( popover ) { popover = $.extend({ place : "in bottom", template : _popoverTPL }, popover); var selector = popover.selector, context; if( opts.id && popover.context ) { context = popover.context + opts.id; } else { context = document; } var element = $( context ).find( selector ); popover.content = stringTpl(popover.content, opts); element.popover2( popover ).popover("show"); return false; } } var _blockTPL = [ '<div class="panel _clear bannerPanel {type}">', '<div class="bannerPanel__imageWrap {imgClass}">', '<img class="bannerPanel__image" src="/common/img/blocks/{img}" alt="">', '</div>', '<a href="#" onclick="$(this.parentNode).fadeOut(function(){$(this).remove()});$.post(\'/closeBlock?type={type}\');return !1;" class="btnClose"></a>', '<div class="bannerPanel__content">', '<h3 class="bannerPanel__title">{header}</h3>', '<div class="bannerPanel__text">{content}</div>', '</div>', '</div>' ].join(''); var _blocksList = { "block_first_popular" : { appear : "prependTo", header : "Используйте фильтры времени", content : "Находясь в популярном, вы можете использовать фильтры времени в правом верхнем углу, чтобы видеть больше шуток (“новое”) или только самые сливки (“24 часа”).", img : "1-9.png" }, "block_first_comments" : { header : "Оставляйте комментарии", content : "Не стесняйтесь оставлять комментарии, ведь это еще одна возможность заработать лайки на YouComedy. Кто знает, может именно ваш комментарий станет началом какого-нибудь интересного обсуждения ;)", img : "1-6.png" }, "block_first_return" : { header : "Заходите ежедневно", content : "1) Получить порцию свежих шуток<br>2) Проверить свои новости<br>3) Залить на сайт новую шутку и получить еще больше лайков", img : "1-1.png" }, "block_first_add_mypage" : { // appear : "prependTo", header : "Добавляйте больше шуток", content : "Знаете много хороших шуток, а может создаете их сами? Добавляйте шутки на сайт, чтобы заработать лайки и стать популярным!", img : "1-4.png", btn : "<a href='/add' class='button _xlarge'>Добавить шутку</a>" }, "block_first_hall" : { header : "На каком вы месте в рейтинге?", content : "Узнать насколько вы круты можно в разделе Зал славы. Также в данном разделе вы найдете много интересных каналов и сможете посмотреть топ шуток за все время.", img : "1-5.png", btn : "<a href='/hall' class='button _xlarge'>В зал славы</a>" }, /*"block_first_add" : { header : "Ваша лента", content : "YouComedy - это отличное место для ваших шуток. Собирайте весь любимый юмор в своей ленте, делитесь с друзьями и все это не засоряя свои социальные ленты.", img : "feed.png", btn : "<a href='/subscriptions' class='button _xlarge'>В мою ленту</a>" },*/ "block_first_recommend" : { header : "Улучшай свои рекомендации", content : "Ставьте больше лайков и дислайков, так мы сможем точнее подбирать шутки именно для вас. Чем больше мы знаем о вашем вкусе, тем круче шутки в рекомендациях ;)", img : "1-8.png" }, "block_first_be_active" : { header : "Как стать популярным?", content : "Проявляйте активность, чтобы вас заметили. Ставьте лайки, делайти репосты, подписывайтесь на пользователей и оставляйте комментарии. Не забывайте грузить шутки, главное, чтобы они были свежие и смешные ;)", img : "1-7.png" }, "block_first_dislike" : { header : "Не понравилась шутка<br>или комментарий?", content : "Специально для таких случаев мы сделали кнопку “дислайк”. Нажмите на нее, чтобы понизить шутку или комментарий в общем рейтинге и помочь нам лучше понять ваш вкус.", img : "1-3.png" }, "block_first_my_feed" : { appear : "prependTo", header : "Моя лента", content : "Это – ваша лента! Здесь будут шутки людей, на которых вы подписались. Мы уже позаботились о том, чтобы вы видели в своей ленте обновления ваших друзей из социальных сетей и популярных пользователей YouComedy.<br><br>P.S. Если чьи-то шутки перестали вам нравиться, вы всегда можете отписаться от них в профиле пользователя.", img : "1-2.png", imgClass: "_bottom" }, "guest_block" : { header : "Мы будем тебя помнить!", content : "Создай аккаунт на YouComedy чтобы мы не забыли твои интересы и сохраняли твои отметки 'нравится'.<br><br>P.S. Ты также сможешь оставлять и оценивать комментарии, добавлять на сайт шутки, подписываться на пользователей и теги, и многое-многое другое!", img : "1-2.png", imgClass: "_bottom" }, "block_calibration_1" : { custom: true, content : ['<div class="calibrate_1 _clear">', '<div class="calibrateLamp"></div>', '</div>'].join('') }, "block_calibration_2" : { custom: true, content: ['<div class="calibrate_2 _clear">', '<img src="/common/img/quest/hi.png">', '<p style="font-size:30px">Не хотели бы вы поговорить об<br>алгоритме рекомендаций?</p>', '<img src="/common/img/quest/niger.png">', '<p>Каждый раз, ставя лайк или дислайк, вы помогаете<br>нашему Мега-Мозгу лучше понять ваше чувство юмора.</p>', '<img src="/common/img/quest/krang.png">', '<p>Так вы улучшаете не только свои рекомендации,<br>но и влияете на рейтинг авторов и их шуток.</p>', '<p style="font-size:72px">.<br>.<br>.</p>', '<p style="font-size:40px;margin-top:80px">', 'ГИПНОЖАБА ПОВЕЛЕВАЕТ:</p>', '<p style="font-size:50px;margin:10px 0 -60px"><b>С</b><b>Т</b><b>А</b><b>В</b><b>Ь</b>&nbsp;<b>Л</b><b>А</b><b>Й</b><b>К</b><b>И</b><b>!</b></p>', '<img src="/common/img/quest/hypnofrog.gif">', '</div>'].join('') } }; Notify.insertBlock = function( data ) { var items_count = APP.Globals.Items.items_count; var resp_count = APP.Globals.Items.resp_count; var offset = items_count - resp_count; $.each(data, function(i){ var opts = data[i]; var block = _blocksList[ opts.type ]; if( block ) { block.img = block.img || "first_visit.png"; opts = $.extend(block, opts); opts.btn = opts.btn || ""; var $block = $(doc.createElement('div')); if (opts.custom){ $block.html(opts.content); } else { $block.html(stringTpl(_blockTPL, opts)); var textBlock = $block.find(".bannerPanel__text").html( block.content ); var contentBlock = $block.find(".bannerPanel__content"); if( opts.btn ) { contentBlock.append("<br/>" + opts.btn); } } if (opts.position){ (opts.position > resp_count) && (opts.position = resp_count); $('#container').find('.item').eq(opts.position - 1 + offset).before($block[0].firstChild); } else { $($block[0].firstChild)[block.appear || "appendTo"]("#container"); } } }); } })(this.jQuery, this.APP, this._, document);
30.090066
338
0.509288