code
stringlengths
2
1.05M
'use strict'; var React = require('react'); var mui = require('material-ui'); var SvgIcon = mui.SvgIcon; var createClass = require('create-react-class'); var ImageFilter8 = createClass({ displayName: 'ImageFilter8', render: function render() { return React.createElement( SvgIcon, this.props, React.createElement('path', { d: 'M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zm-8-2h2c1.1 0 2-.89 2-2v-1.5c0-.83-.67-1.5-1.5-1.5.83 0 1.5-.67 1.5-1.5V7c0-1.11-.9-2-2-2h-2c-1.1 0-2 .89-2 2v1.5c0 .83.67 1.5 1.5 1.5-.83 0-1.5.67-1.5 1.5V13c0 1.11.9 2 2 2zm0-8h2v2h-2V7zm0 4h2v2h-2v-2z' }) ); } }); module.exports = ImageFilter8;
/* post-css settings are in postcss.config.js */ import MiniCssExtractPlugin from 'mini-css-extract-plugin' import { SRC } from '../paths' import { isProd } from '../envVariables' export default [ { test: /\.module\.css$/, include: SRC, use: [ isProd ? MiniCssExtractPlugin.loader : 'style-loader', { loader: 'css-loader', options: { modules: true, importLoaders: 1, }, }, { loader: 'postcss-loader', options: { // sourceMap: isDev, }, }, ], }, { test: /^((?!\.module\.).)*\.css$/, use: [ isProd ? MiniCssExtractPlugin.loader : 'style-loader', { loader: 'css-loader', options: { importLoaders: 1, }, }, 'postcss-loader', ], }, ]
'use strict'; /* https://github.com/angular/protractor/blob/master/docs/toc.md */ describe('my app', function() { browser.get('index.html'); it('should automatically redirect to /dashboard when location hash/fragment is empty', function() { expect(browser.getLocationAbsUrl()).toMatch("/dashboard"); }); describe('view1', function() { beforeEach(function() { browser.get('index.html#/dashboard'); }); it('should render dashboard when user navigates to /dashboard', function() { expect(element.all(by.css('[ng-view] p')).first().getText()). toMatch(/partial for view 1/); }); }); describe('room', function() { beforeEach(function() { browser.get('index.html#/room'); }); it('should render room when user navigates to /room', function() { expect(element.all(by.css('[ng-view] p')).first().getText()). toMatch(/partial for view 2/); }); }); });
// The main application script, ties everything together. var bodyParser = require('body-parser'); var path = require('path'); var cookieParser = require('cookie-parser'); var express = require('express'); var logger = require('morgan'); var favicon = require('serve-favicon'); var app = express(); var auth = require('./server/controllers/auth'); var usersRouter = require('./server/routes/users'); var documentsRouter = require('./server/routes/documents'); // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'pug'); app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); app.use(cookieParser()); app.use('/users', usersRouter); app.use('/documents', documentsRouter); app.get('*', (req, res) => res.status(200).send({ message: 'Welcome to the beginning of nothingness.', })); // authentication middleware app.use(auth.authenticate); // catch 404 and forward to error handler app.use(function (req, res, next) { var err = new Error('Not Found'); err.status = 404; next(err); }); // error handler app.use(function (err, req, res, next) { // set locals, only providing error in development res.locals.message = err.message; res.locals.error = req.app.get('env') === 'development' ? err : {}; // render the error page res.status(err.status || 500); res.render('error'); }); module.exports = app;
var boardUri; var threadId; var board = false; var replyButton; var fullRefresh = false; var refreshButton; var lastReplyId = 0; var lastRefreshWaiting = 0; var refreshLabel; var autoRefresh; var refreshTimer; var lastRefresh; var currentRefresh; var manualRefresh; var foundPosts; var hiddenCaptcha = !document.getElementById('captchaDiv'); var markedPosting; var limitRefreshWait = 10 * 60; var originalButtonText; var messageLimit; var unreadPosts = 0; var originalTitle = document.title; var lastPost; var highLightedIds = []; var idsRelation = {}; var postCellTemplate = '<div class="innerPost"><div class="postInfo title">' + '<input type="checkbox" class="deletionCheckBox"> <span class="labelSubject">' + '</span> <a class="linkName"></a> <img class="imgFlag"> <span class="labelRole">' + '</span> <span class="labelCreated"></span> <span class="spanId"> Id: <span ' + 'class="labelId"></span></span> <a class="linkPreview">[Preview]</a> <a ' + 'class="linkSelf">No.</a> <a class="linkQuote"></a> <span class="panelBacklinks">' + '</span></div>' + '<div>' + '<span class="panelIp"> <span class="panelRange"> Broad' + 'range(1/2 octets): <span class="labelBroadRange"> </span> <br>' + 'Narrow range(3/4 octets): <span class="labelNarrowRange"> </span> <br>' + '</span> Ip: <span class="labelIp"></span></span>' + '</div>' + '<div class="panelUploads"></div><div class="divMessage"></div>' + '<div class="divBanMessage"></div><div class="labelLastEdit"></div></div>'; var uploadCell = '<div class="uploadDetails"><a class="nameLink" target="blank">' + 'Open file</a> (<span class="sizeLabel"></span> <span class="dimensionLabel">' + '</span> <a class="originalNameLink"></a>)</div>' + '<div class="divHash"><span>MD5: <span class="labelHash"></span></span></div>' + '<a class="imgLink" ' + 'target="blank"></a>'; var sizeOrders = [ 'B', 'KB', 'MB', 'GB', 'TB' ]; var guiEditInfo = 'Edited last time by {$login} on {$date}.'; if (!DISABLE_JS) { document.onscroll = function() { if (!unreadPosts) { return; } var rect = lastPost.getBoundingClientRect(); if (rect.bottom < window.innerHeight) { unreadPosts = 0; document.title = originalTitle; } }; boardUri = document.getElementById('boardIdentifier').value; var divPosts = document.getElementsByClassName('divPosts')[0]; if (document.getElementById('divUpload')) { setDragAndDrop(); } document.getElementsByClassName('divRefresh')[0].style.display = 'block'; messageLimit = +document.getElementById('labelMessageLength').innerHTML; refreshLabel = document.getElementById('labelRefresh'); refreshButton = document.getElementById('refreshButton'); threadId = document.getElementsByClassName('opCell')[0].id; var refreshURL = document.getElementById('divMod') ? '/mod.js?boardUri=' + boardUri + '&threadId=' + threadId + '&json=1' : '/' + boardUri + '/thread/' + threadId + '.json'; if (document.getElementById('controlThreadIdentifier')) { document.getElementById('settingsJsButon').style.display = 'inline'; document.getElementById('settingsFormButon').style.display = 'none'; if (document.getElementById('ipDeletionForm')) { document.getElementById('deleteFromIpJsButton').style.display = 'inline'; document.getElementById('deleteFromIpFormButton').style.display = 'none'; } if (document.getElementById('formTransfer')) { document.getElementById('transferJsButton').style.display = 'inline'; document.getElementById('transferFormButton').style.display = 'none'; } } var savedPassword = getSavedPassword(); if (savedPassword && savedPassword.length) { document.getElementById('fieldPostingPassword').value = savedPassword; document.getElementById('deletionFieldPassword').value = savedPassword; } replyButton = document.getElementById('jsButton'); replyButton.style.display = 'inline'; replyButton.disabled = false; if (document.getElementById('captchaDiv')) { document.getElementById('reloadCaptchaButton').style.display = 'inline'; } document.getElementById('reloadCaptchaButtonReport').style.display = 'inline'; document.getElementById('formButton').style.display = 'none'; var replies = document.getElementsByClassName('postCell'); if (replies && replies.length) { lastReplyId = replies[replies.length - 1].id; } changeRefresh(); var hash = window.location.hash.substring(1); if (hash.indexOf('q') === 0 && hash.length > 1) { document.getElementById('fieldMessage').value = '>>' + hash.substring(1) + '\n'; } else if (hash.length > 1) { markPost(hash); } var postingQuotes = document.getElementsByClassName('linkQuote'); for (var i = 0; i < postingQuotes.length; i++) { processPostingQuote(postingQuotes[i]); } var ids = document.getElementsByClassName('labelId'); for (i = 0; i < ids.length; i++) { processIdLabel(ids[i]); } } function processIdLabel(label) { var id = label.innerHTML; var array = idsRelation[id] || []; idsRelation[id] = array; var cell = label.parentNode.parentNode.parentNode; array.push(cell); label.onmouseover = function() { label.innerHTML = id + ' (' + array.length + ')'; } label.onmouseout = function() { label.innerHTML = id; } label.onclick = function() { var index = highLightedIds.indexOf(id); if (index > -1) { highLightedIds.splice(index, 1); } else { highLightedIds.push(id); } for (var i = 0; i < array.length; i++) { var cellToChange = array[i]; if (cellToChange.className === 'innerOP') { continue; } cellToChange.className = index > -1 ? 'innerPost' : 'markedPost'; } }; } function transfer() { var informedBoard = document.getElementById("fieldDestinationBoard").value .trim(); var originThread = document.getElementById("transferThreadIdentifier").value; var originBoard = document.getElementById("transferBoardIdentifier").value; apiRequest('transferThread', { boardUri : boardUri, threadId : threadId, boardUriDestination : informedBoard }, function setLock(status, data) { if (status === 'ok') { alert('Thread moved.'); var redirect = '/' + informedBoard + '/thread/'; window.location.pathname = redirect + data + '.html'; } else { alert(status + ': ' + JSON.stringify(data)); } }); } function markPost(id) { if (isNaN(id)) { return; } if (markedPosting && markedPosting.className === 'markedPost') { markedPosting.setAttribute('class', 'innerPost'); } var container = document.getElementById(id); if (!container || container.className !== 'postCell') { return; } markedPosting = container.getElementsByClassName('innerPost')[0]; if (markedPosting) { markedPosting.setAttribute('class', 'markedPost'); } } function processPostingQuote(link) { link.onclick = function() { var toQuote = link.href.match(/#q(\d+)/); showQr(toQuote[1]); document.getElementById('fieldMessage').value += '>>' + toQuote[1] + '\n'; }; } function saveThreadSettings() { apiRequest('changeThreadSettings', { boardUri : boardUri, threadId : threadId, pin : document.getElementById('checkboxPin').checked, lock : document.getElementById('checkboxLock').checked, cyclic : document.getElementById('checkboxCyclic').checked }, function setLock(status, data) { if (status === 'ok') { alert('Settings saved.'); location.reload(true); } else { alert(status + ': ' + JSON.stringify(data)); } }); } var replyCallback = function(status, data) { if (status === 'ok') { document.getElementById('fieldMessage').value = ''; document.getElementById('fieldSubject').value = ''; clearQRAfterPosting(); clearSelectedFiles(); setTimeout(function() { refreshPosts(); }, 2000); } else { alert(status + ': ' + JSON.stringify(data)); } }; replyCallback.stop = function() { replyButton.innerHTML = originalButtonText; setQRReplyText(originalButtonText); replyButton.disabled = false; setQRReplyEnabled(true); }; replyCallback.progress = function(info) { if (info.lengthComputable) { var newText = 'Uploading ' + Math.floor((info.loaded / info.total) * 100) + '%'; replyButton.innerHTML = newText; setQRReplyText(newText); } }; function padDateField(value) { if (value < 10) { value = '0' + value; } return value; } function formatDateToDisplay(d) { var day = padDateField(d.getUTCDate()); var weekDays = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ]; var month = padDateField(d.getUTCMonth() + 1); var year = d.getUTCFullYear(); var weekDay = weekDays[d.getUTCDay()]; var hour = padDateField(d.getUTCHours()); var minute = padDateField(d.getUTCMinutes()); var second = padDateField(d.getUTCSeconds()); var toReturn = month + '/' + day + '/' + year; return toReturn + ' (' + weekDay + ') ' + hour + ':' + minute + ':' + second; } function formatFileSize(size) { var orderIndex = 0; while (orderIndex < sizeOrders.length - 1 && size > 1024) { orderIndex++; size /= 1024; } return size.toFixed(2) + ' ' + sizeOrders[orderIndex]; } function removeElement(element) { element.parentNode.removeChild(element); } function setLastEditedLabel(post, cell) { var editedLabel = cell.getElementsByClassName('labelLastEdit')[0]; if (post.lastEditTime) { var formatedDate = formatDateToDisplay(new Date(post.lastEditTime)); editedLabel.innerHTML = guiEditInfo.replace('{$date}', formatedDate) .replace('{$login}', post.lastEditLogin); } else { removeElement(editedLabel); } } function setUploadLinks(cell, file) { var thumbLink = cell.getElementsByClassName('imgLink')[0]; thumbLink.href = file.path; thumbLink.setAttribute('data-filemime', file.mime); var img = document.createElement('img'); img.src = file.thumb; thumbLink.appendChild(img); var nameLink = cell.getElementsByClassName('nameLink')[0]; nameLink.href = file.path; var originalLink = cell.getElementsByClassName('originalNameLink')[0]; originalLink.innerHTML = file.originalName; originalLink.href = file.path; originalLink.setAttribute('download', file.originalName); } function getUploadCellBase() { var cell = document.createElement('div'); cell.innerHTML = uploadCell; cell.setAttribute('class', 'uploadCell'); return cell; } function setUploadCell(node, files) { if (!files) { return; } for (var i = 0; i < files.length; i++) { var file = files[i]; var cell = getUploadCellBase(); setUploadLinks(cell, file); var sizeString = formatFileSize(file.size); cell.getElementsByClassName('sizeLabel')[0].innerHTML = sizeString; var dimensionLabel = cell.getElementsByClassName('dimensionLabel')[0]; if (file.width) { dimensionLabel.innerHTML = file.width + 'x' + file.height; } else { removeElement(dimensionLabel); } if (file.md5) { cell.getElementsByClassName('labelHash')[0].innerHTML = file.md5; } else { removeElement(cell.getElementsByClassName('divHash')[0]); } node.appendChild(cell); } } function setPostHideableElements(postCell, post) { var subjectLabel = postCell.getElementsByClassName('labelSubject')[0]; if (post.subject) { subjectLabel.innerHTML = post.subject; } else { removeElement(subjectLabel); } if (post.id) { var labelId = postCell.getElementsByClassName('labelId')[0]; labelId.setAttribute('style', 'background-color: #' + post.id); labelId.innerHTML = post.id; processIdLabel(labelId); } else { var spanId = postCell.getElementsByClassName('spanId')[0]; spanId.parentNode.removeChild(spanId); } var banMessageLabel = postCell.getElementsByClassName('divBanMessage')[0]; if (!post.banMessage) { banMessageLabel.parentNode.removeChild(banMessageLabel); } else { banMessageLabel.innerHTML = post.banMessage; } setLastEditedLabel(post, postCell); var imgFlag = postCell.getElementsByClassName('imgFlag')[0]; if (post.flag) { imgFlag.src = post.flag; imgFlag.title = post.flagName; if (post.flagCode) { imgFlag.className += ' flag' + post.flagCode; } } else { removeElement(imgFlag); } if (!post.ip) { removeElement(postCell.getElementsByClassName('panelIp')[0]); } else { postCell.getElementsByClassName('labelIp')[0].innerHTML = post.ip; if (!post.broadRange) { removeElement(postCell.getElementsByClassName('panelRange')[0]); } else { postCell.getElementsByClassName('labelBroadRange')[0].innerHTML = post.broadRange; postCell.getElementsByClassName('labelNarrowRange')[0].innerHTML = post.narrowRange; } } } function setPostLinks(postCell, post, boardUri, link, threadId, linkQuote, deletionCheckbox) { var linkStart = '/' + boardUri + '/thread/' + threadId + '.html#'; link.href = linkStart + post.postId; linkQuote.href = linkStart + 'q' + post.postId; var checkboxName = boardUri + '-' + threadId + '-' + post.postId; deletionCheckbox.setAttribute('name', checkboxName); var linkPreview = '/' + boardUri + '/preview/' + post.postId + '.html'; postCell.getElementsByClassName('linkPreview')[0].href = linkPreview; } function setRoleSignature(postingCell, posting) { var labelRole = postingCell.getElementsByClassName('labelRole')[0]; if (posting.signedRole) { labelRole.innerHTML = posting.signedRole; } else { labelRole.parentNode.removeChild(labelRole); } } function setPostComplexElements(postCell, post, boardUri, threadId) { setRoleSignature(postCell, post); var link = postCell.getElementsByClassName('linkSelf')[0]; var linkQuote = postCell.getElementsByClassName('linkQuote')[0]; linkQuote.innerHTML = post.postId; var deletionCheckbox = postCell.getElementsByClassName('deletionCheckBox')[0]; setPostLinks(postCell, post, boardUri, link, threadId, linkQuote, deletionCheckbox); setUploadCell(postCell.getElementsByClassName('panelUploads')[0], post.files); } function setPostInnerElements(boardUri, threadId, post, postCell) { var linkName = postCell.getElementsByClassName('linkName')[0]; linkName.innerHTML = post.name; if (post.email) { linkName.href = 'mailto:' + post.email; } else { linkName.className += ' noEmailName'; } var labelCreated = postCell.getElementsByClassName('labelCreated')[0]; labelCreated.innerHTML = formatDateToDisplay(new Date(post.creation)); postCell.getElementsByClassName('divMessage')[0].innerHTML = post.markdown; setPostHideableElements(postCell, post); setPostComplexElements(postCell, post, boardUri, threadId); } function addPost(post) { if (!fullRefresh) { unreadPosts++; } var postCell = document.createElement('div'); postCell.innerHTML = postCellTemplate; postCell.id = post.postId; postCell.setAttribute('class', 'postCell'); if (post.files && post.files.length > 1) { postCell.className += ' multipleUploads'; } setPostInnerElements(boardUri, threadId, post, postCell); var messageLinks = postCell.getElementsByClassName('divMessage')[0] .getElementsByTagName('a'); for (var i = 0; i < messageLinks.length; i++) { processLinkForEmbed(messageLinks[i]); } var links = postCell.getElementsByClassName('imgLink'); var temporaryImageLinks = []; for (i = 0; i < links.length; i++) { temporaryImageLinks.push(links[i]); } for (i = 0; i < temporaryImageLinks.length; i++) { processImageLink(temporaryImageLinks[i]); } var shownFiles = postCell.getElementsByClassName('uploadCell'); for (var i = 0; i < shownFiles.length; i++) { processFileForHiding(shownFiles[i]); } var hiddenMedia = getHiddenMedia(); for (i = 0; i < hiddenMedia.length; i++) { updateHiddenFiles(hiddenMedia[i], true); } lastPost = postCell; divPosts.appendChild(postCell); postCell.setAttribute('data-boarduri', boardUri); addToKnownPostsForBackLinks(postCell); var quotes = postCell.getElementsByClassName('quoteLink'); for (i = 0; i < quotes.length; i++) { var quote = quotes[i]; processQuote(quote); } setHideMenu(postCell.getElementsByClassName('deletionCheckBox')[0]); processPostingQuote(postCell.getElementsByClassName('linkQuote')[0]); } var refreshCallback = function(error, data) { if (error) { return; } if (fullRefresh) { lastReplyId = 0; unreadPosts = 0; while (divPosts.firstChild) { divPosts.removeChild(divPosts.firstChild); } document.title = originalTitle; } var receivedData = JSON.parse(data); var posts = receivedData.posts; foundPosts = false; if (posts && posts.length) { var lastPost = posts[posts.length - 1]; if (lastPost.postId > lastReplyId) { foundPosts = true; for (var i = 0; i < posts.length; i++) { var post = posts[i]; if (post.postId > lastReplyId) { addPost(post); lastReplyId = post.postId; } } if (!fullRefresh) { document.title = '(' + unreadPosts + ') ' + originalTitle; } } } if (autoRefresh) { startTimer(manualRefresh || foundPosts ? 5 : lastRefresh * 2); } }; refreshCallback.stop = function() { refreshButton.disabled = false; }; function refreshPosts(manual, full) { manualRefresh = manual; fullRefresh = full; if (autoRefresh) { clearInterval(refreshTimer); } refreshButton.disabled = true; localRequest(refreshURL, refreshCallback); } function sendReplyData(files, captchaId) { var forcedAnon = !document.getElementById('fieldName'); var hiddenFlags = !document.getElementById('flagsDiv'); if (!hiddenFlags) { var combo = document.getElementById('flagCombobox'); var selectedFlag = combo.options[combo.selectedIndex].value; } if (!forcedAnon) { var typedName = document.getElementById('fieldName').value.trim(); } var typedEmail = document.getElementById('fieldEmail').value.trim(); var typedMessage = document.getElementById('fieldMessage').value.trim(); var typedSubject = document.getElementById('fieldSubject').value.trim(); var typedPassword = document.getElementById('fieldPostingPassword').value .trim(); var threadId = document.getElementById('threadIdentifier').value; if (!typedMessage.length && !files.length) { alert('A message or a file is mandatory.'); return; } else if (!forcedAnon && typedName.length > 32) { alert('Name is too long, keep it under 32 characters.'); return; } else if (typedMessage.length > messageLimit) { alert('Message is too long, keep it under ' + messageLimit + ' characters.'); return; } else if (typedEmail.length > 64) { alert('E-mail is too long, keep it under 64 characters.'); return; } else if (typedSubject.length > 128) { alert('Subject is too long, keep it under 128 characters.'); return; } else if (typedPassword.length > 8) { alert('Password is too long, keep it under 8 characters.'); return; } if (typedPassword.length) { savePassword(typedPassword); } var spoilerCheckBox = document.getElementById('checkboxSpoiler'); var noFlagCheckBox = document.getElementById('checkboxNoFlag'); originalButtonText = replyButton.innerHTML; replyButton.innerHTML = 'Uploading 0%'; setQRReplyText(replyButton.innerHTML); replyButton.disabled = true; setQRReplyEnabled(false); apiRequest('replyThread', { name : forcedAnon ? null : typedName, flag : hiddenFlags ? null : selectedFlag, captcha : captchaId, subject : typedSubject, noFlag : noFlagCheckBox ? noFlagCheckBox.checked : false, spoiler : spoilerCheckBox ? spoilerCheckBox.checked : false, password : typedPassword, message : typedMessage, email : typedEmail, files : files, boardUri : boardUri, threadId : threadId }, replyCallback); } function processFilesToPost(captchaId) { getFilestToUpload(function gotFiles(files) { sendReplyData(files, captchaId); }); } function postReply() { if (hiddenCaptcha) { processFilesToPost(); } else { var typedCaptcha = document.getElementById('fieldCaptcha').value.trim(); if (typedCaptcha.length !== 6 && typedCaptcha.length !== 24) { alert('Captchas are exactly 6 (24 if no cookies) characters long.'); return; } else if (/\W/.test(typedCaptcha)) { alert('Invalid captcha.'); return; } if (typedCaptcha.length == 24) { processFilesToPost(typedCaptcha); } else { var parsedCookies = getCookies(); apiRequest('solveCaptcha', { captchaId : parsedCookies.captchaid, answer : typedCaptcha }, function solvedCaptcha(status, data) { processFilesToPost(parsedCookies.captchaid); }); } } } function startTimer(time) { if (time > limitRefreshWait) { time = limitRefreshWait; } currentRefresh = time; lastRefresh = time; labelRefresh.innerHTML = currentRefresh; refreshTimer = setInterval(function checkTimer() { currentRefresh--; if (!currentRefresh) { clearInterval(refreshTimer); refreshPosts(); labelRefresh.innerHTML = ''; } else { labelRefresh.innerHTML = currentRefresh; } }, 1000); } function changeRefresh() { autoRefresh = document.getElementById('checkboxChangeRefresh').checked; if (!autoRefresh) { labelRefresh.innerHTML = ''; clearInterval(refreshTimer); } else { startTimer(5); } } function deleteFromIp() { var typedIp = document.getElementById('ipField').value.trim(); var typedBoards = document.getElementById('fieldBoards').value.trim(); if (!typedIp.length) { alert('An ip is mandatory'); return; } apiRequest('deleteFromIp', { ip : typedIp, boards : typedBoards }, function requestComplete(status, data) { if (status === 'ok') { document.getElementById('ipField').value = ''; document.getElementById('fieldBoards').value = ''; alert('Postings deleted.'); } else { alert(status + ': ' + JSON.stringify(data)); } }); }
'use strict'; (function() { // Contacts Controller Spec describe('Contacts Controller Tests', function() { // Initialize global variables var ContactsController, scope, $httpBackend, $stateParams, $location; // The $resource service augments the response object with methods for updating and deleting the resource. // If we were to use the standard toEqual matcher, our tests would fail because the test values would not match // the responses exactly. To solve the problem, we define a new toEqualData Jasmine matcher. // When the toEqualData matcher compares two objects, it takes only object properties into // account and ignores methods. beforeEach(function() { jasmine.addMatchers({ toEqualData: function(util, customEqualityTesters) { return { compare: function(actual, expected) { return { pass: angular.equals(actual, expected) }; } }; } }); }); // Then we can start by loading the main application module beforeEach(module(ApplicationConfiguration.applicationModuleName)); // The injector ignores leading and trailing underscores here (i.e. _$httpBackend_). // This allows us to inject a service but then attach it to a variable // with the same name as the service. beforeEach(inject(function($controller, $rootScope, _$location_, _$stateParams_, _$httpBackend_) { // Set a new global scope scope = $rootScope.$new(); // Point global variables to injected services $stateParams = _$stateParams_; $httpBackend = _$httpBackend_; $location = _$location_; // Initialize the Contacts controller. ContactsController = $controller('ContactsController', { $scope: scope }); })); it('Should do some controller test', inject(function() { // The test logic // ... })); }); }());
var Tone = require('tone'); /** * A "robotic" effect that adds a low-pitched buzzing to the sound, reminiscent of the * voice of the daleks from Dr. Who. * In audio terms it is a feedback comb filter with a short delay time. * The effect value controls the length of this delay time, changing the pitch of the buzz * A value of 0 mutes the effect. * Other values change the pitch of the effect, in units of 10 steps per semitone. * The effect value is not clamped (but probably should be). * Exterminate. * @constructor */ function RoboticEffect () { Tone.Effect.call(this); this.value = 0; var time = this._delayTimeForValue(100); this.feedbackCombFilter = new Tone.FeedbackCombFilter(time, 0.9); this.effectSend.chain(this.feedbackCombFilter, this.effectReturn); } Tone.extend(RoboticEffect, Tone.Effect); /** * Set the effect value * @param {number} val - the new value to set the effect to */ RoboticEffect.prototype.set = function (val) { this.value = val; // mute the effect if value is 0 if (this.value == 0) { this.wet.value = 0; } else { this.wet.value = 1; } // set delay time using the value var time = this._delayTimeForValue(this.value); this.feedbackCombFilter.delayTime.rampTo(time, 1/60); }; /** * Change the effect value * @param {number} val - the value to change the effect by */ RoboticEffect.prototype.changeBy = function (val) { this.set(this.value + val); }; /** * Compute the delay time for an effect value. * Convert the effect value to a musical note (in units of 10 per semitone), * and return the period (single cycle duration) of the frequency of that note. * @param {number} val - the effect value * @returns {number} a delay time in seconds */ RoboticEffect.prototype._delayTimeForValue = function (val) { var midiNote = ((val - 100) / 10) + 36; var freq = Tone.Frequency(midiNote, 'midi').eval(); return 1 / freq; }; module.exports = RoboticEffect;
class FunctionDeclaration { constructor (options) { this.type = 'FunctionDeclaration' Object.assign(this, options) } } module.exports = FunctionDeclaration
const isDev = process.env.NODE_ENV === 'development'; module.exports = { name: 'epii avatar', path: { root: __dirname, }, extern: isDev ? undefined : 'react' };
"use strict"; var event_list_component_1 = require("./events/event-list.component"); // import { HomeComponent } from './'; // import { Name2Component } from './'; // import { Name3Component } from './'; // import { Name4Component } from './'; // import { PageNotFoundComponent } from './'; exports.Approutes = [ { path: 'Events', component: event_list_component_1.EventListComponent }, { path: '', redirectTo: 'Events', pathMatch: 'full' } ]; //# sourceMappingURL=routes.js.map
export const arrowRightThick = {"viewBox":"0 0 24 24","children":[{"name":"path","attribs":{"d":"M10.586 6.586c-.781.779-.781 2.047 0 2.828l1.586 1.586h-7.244c-1.104 0-2 .895-2 2 0 1.104.896 2 2 2h7.244l-1.586 1.586c-.781.779-.781 2.047 0 2.828.391.391.902.586 1.414.586s1.023-.195 1.414-.586l6.414-6.414-6.414-6.414c-.781-.781-2.047-.781-2.828 0z"},"children":[]}]};
'use strict'; var gscDatacat = gscDatacat || {}; /** * Create a new Response object * * @class */ gscDatacat.Response = function() { /** * Object to hold this context * @type gscDatacat.Response */ var _self = this; /** * Status of the response */ this.success = true; /** * Array of messages */ this.messages = []; /** * Place holder for response data */ this.data = null; /** * Set the status of the operation to success (true) or error (false) * * @param {Boolean} status * @return {gscDatacat.Response} */ this.setStatus = function(status) { if (status === undefined) { return; } this.success = status; return _self; }; /** * Set data content of response * * @param {Object} data * @param {Boolean} [status=true] * @return {gscDatacat.Response} */ this.setData = function(data, status) { if (data === undefined) { return; } if (status === undefined) { status = true; } this.setStatus(status); return _self; }; /** * Add a message to the response object * * @param {type} message * @param {type} [status=true] * @returns {undefined} */ this.addMessage = function(message, status) { if (message === undefined) { return; } if (status === undefined) { status = true; } this.messages.push(message); return _self; }; }; /** * Create a new response success object * * @param {Object} [data] - Optional data object * @param {String} [message] - Optional message * @returns {gscDatacat.Response} */ gscDatacat.Response.getSuccess = function(data, message) { var r = new gscDatacat.Response(); if (message !== undefined) { r.addMessage(message); } if (data !== undefined) { r.setData(data); } r.setStatus(true); return r; }; /** * Create a new response error object * * @param {Object} [data] - Optional data object * @param {String} [message] - Optional message * @returns {gscDatacat.Response} */ gscDatacat.Response.getError = function(data, message) { var r = new gscDatacat.Response(); if (message !== undefined) { r.addMessage(message); } if (data !== undefined) { r.setData(data); } r.setStatus(false); return r; };
/** * Created by aditya on 22/01/15. */ /* AngularJS v1.3.10 (c) 2010-2014 Google, Inc. http://angularjs.org License: MIT */ (function(M,Y,t){'use strict';function T(b){return function(){var a=arguments[0],c;c="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.3.10/"+(b?b+"/":"")+a;for(a=1;a<arguments.length;a++){c=c+(1==a?"?":"&")+"p"+(a-1)+"=";var d=encodeURIComponent,e;e=arguments[a];e="function"==typeof e?e.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof e?"undefined":"string"!=typeof e?JSON.stringify(e):e;c+=d(e)}return Error(c)}}function Ta(b){if(null==b||Ua(b))return!1;var a=b.length;return b.nodeType=== oa&&a?!0:F(b)||D(b)||0===a||"number"===typeof a&&0<a&&a-1 in b}function s(b,a,c){var d,e;if(b)if(G(b))for(d in b)"prototype"==d||"length"==d||"name"==d||b.hasOwnProperty&&!b.hasOwnProperty(d)||a.call(c,b[d],d,b);else if(D(b)||Ta(b)){var f="object"!==typeof b;d=0;for(e=b.length;d<e;d++)(f||d in b)&&a.call(c,b[d],d,b)}else if(b.forEach&&b.forEach!==s)b.forEach(a,c,b);else for(d in b)b.hasOwnProperty(d)&&a.call(c,b[d],d,b);return b}function Ed(b,a,c){for(var d=Object.keys(b).sort(),e=0;e<d.length;e++)a.call(c, b[d[e]],d[e]);return d}function kc(b){return function(a,c){b(c,a)}}function Fd(){return++nb}function lc(b,a){a?b.$$hashKey=a:delete b.$$hashKey}function z(b){for(var a=b.$$hashKey,c=1,d=arguments.length;c<d;c++){var e=arguments[c];if(e)for(var f=Object.keys(e),g=0,h=f.length;g<h;g++){var l=f[g];b[l]=e[l]}}lc(b,a);return b}function ba(b){return parseInt(b,10)}function H(){}function pa(b){return b}function da(b){return function(){return b}}function A(b){return"undefined"===typeof b}function y(b){return"undefined"!== typeof b}function I(b){return null!==b&&"object"===typeof b}function F(b){return"string"===typeof b}function V(b){return"number"===typeof b}function qa(b){return"[object Date]"===Da.call(b)}function G(b){return"function"===typeof b}function ob(b){return"[object RegExp]"===Da.call(b)}function Ua(b){return b&&b.window===b}function Va(b){return b&&b.$evalAsync&&b.$watch}function Wa(b){return"boolean"===typeof b}function mc(b){return!(!b||!(b.nodeName||b.prop&&b.attr&&b.find))}function Gd(b){var a={}; b=b.split(",");var c;for(c=0;c<b.length;c++)a[b[c]]=!0;return a}function ua(b){return Q(b.nodeName||b[0]&&b[0].nodeName)}function Xa(b,a){var c=b.indexOf(a);0<=c&&b.splice(c,1);return a}function Ea(b,a,c,d){if(Ua(b)||Va(b))throw Ka("cpws");if(a){if(b===a)throw Ka("cpi");c=c||[];d=d||[];if(I(b)){var e=c.indexOf(b);if(-1!==e)return d[e];c.push(b);d.push(a)}if(D(b))for(var f=a.length=0;f<b.length;f++)e=Ea(b[f],null,c,d),I(b[f])&&(c.push(b[f]),d.push(e)),a.push(e);else{var g=a.$$hashKey;D(a)?a.length= 0:s(a,function(b,c){delete a[c]});for(f in b)b.hasOwnProperty(f)&&(e=Ea(b[f],null,c,d),I(b[f])&&(c.push(b[f]),d.push(e)),a[f]=e);lc(a,g)}}else if(a=b)D(b)?a=Ea(b,[],c,d):qa(b)?a=new Date(b.getTime()):ob(b)?(a=new RegExp(b.source,b.toString().match(/[^\/]*$/)[0]),a.lastIndex=b.lastIndex):I(b)&&(e=Object.create(Object.getPrototypeOf(b)),a=Ea(b,e,c,d));return a}function ra(b,a){if(D(b)){a=a||[];for(var c=0,d=b.length;c<d;c++)a[c]=b[c]}else if(I(b))for(c in a=a||{},b)if("$"!==c.charAt(0)||"$"!==c.charAt(1))a[c]= b[c];return a||b}function fa(b,a){if(b===a)return!0;if(null===b||null===a)return!1;if(b!==b&&a!==a)return!0;var c=typeof b,d;if(c==typeof a&&"object"==c)if(D(b)){if(!D(a))return!1;if((c=b.length)==a.length){for(d=0;d<c;d++)if(!fa(b[d],a[d]))return!1;return!0}}else{if(qa(b))return qa(a)?fa(b.getTime(),a.getTime()):!1;if(ob(b)&&ob(a))return b.toString()==a.toString();if(Va(b)||Va(a)||Ua(b)||Ua(a)||D(a))return!1;c={};for(d in b)if("$"!==d.charAt(0)&&!G(b[d])){if(!fa(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!c.hasOwnProperty(d)&& "$"!==d.charAt(0)&&a[d]!==t&&!G(a[d]))return!1;return!0}return!1}function Ya(b,a,c){return b.concat(Za.call(a,c))}function nc(b,a){var c=2<arguments.length?Za.call(arguments,2):[];return!G(a)||a instanceof RegExp?a:c.length?function(){return arguments.length?a.apply(b,Ya(c,arguments,0)):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}}function Hd(b,a){var c=a;"string"===typeof b&&"$"===b.charAt(0)&&"$"===b.charAt(1)?c=t:Ua(a)?c="$WINDOW":a&&Y===a?c="$DOCUMENT":Va(a)&& (c="$SCOPE");return c}function $a(b,a){if("undefined"===typeof b)return t;V(a)||(a=a?2:null);return JSON.stringify(b,Hd,a)}function oc(b){return F(b)?JSON.parse(b):b}function va(b){b=B(b).clone();try{b.empty()}catch(a){}var c=B("<div>").append(b).html();try{return b[0].nodeType===pb?Q(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+Q(b)})}catch(d){return Q(c)}}function pc(b){try{return decodeURIComponent(b)}catch(a){}}function qc(b){var a={},c,d;s((b||"").split("&"),function(b){b&& (c=b.replace(/\+/g,"%20").split("="),d=pc(c[0]),y(d)&&(b=y(c[1])?pc(c[1]):!0,rc.call(a,d)?D(a[d])?a[d].push(b):a[d]=[a[d],b]:a[d]=b))});return a}function Nb(b){var a=[];s(b,function(b,d){D(b)?s(b,function(b){a.push(Fa(d,!0)+(!0===b?"":"="+Fa(b,!0)))}):a.push(Fa(d,!0)+(!0===b?"":"="+Fa(b,!0)))});return a.length?a.join("&"):""}function qb(b){return Fa(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Fa(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi, ":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,a?"%20":"+")}function Id(b,a){var c,d,e=rb.length;b=B(b);for(d=0;d<e;++d)if(c=rb[d]+a,F(c=b.attr(c)))return c;return null}function Jd(b,a){var c,d,e={};s(rb,function(a){a+="app";!c&&b.hasAttribute&&b.hasAttribute(a)&&(c=b,d=b.getAttribute(a))});s(rb,function(a){a+="app";var e;!c&&(e=b.querySelector("["+a.replace(":","\\:")+"]"))&&(c=e,d=e.getAttribute(a))});c&&(e.strictDi=null!==Id(c,"strict-di"),a(c,d?[d]:[],e))}function sc(b, a,c){I(c)||(c={});c=z({strictDi:!1},c);var d=function(){b=B(b);if(b.injector()){var d=b[0]===Y?"document":va(b);throw Ka("btstrpd",d.replace(/</,"&lt;").replace(/>/,"&gt;"));}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);c.debugInfoEnabled&&a.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);a.unshift("ng");d=Ob(a,c.strictDi);d.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return d}, e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;M&&e.test(M.name)&&(c.debugInfoEnabled=!0,M.name=M.name.replace(e,""));if(M&&!f.test(M.name))return d();M.name=M.name.replace(f,"");ga.resumeBootstrap=function(b){s(b,function(b){a.push(b)});d()}}function Kd(){M.name="NG_ENABLE_DEBUG_INFO!"+M.name;M.location.reload()}function Ld(b){b=ga.element(b).injector();if(!b)throw Ka("test");return b.get("$$testability")}function tc(b,a){a=a||"_";return b.replace(Md,function(b,d){return(d?a:"")+b.toLowerCase()})} function Nd(){var b;uc||((sa=M.jQuery)&&sa.fn.on?(B=sa,z(sa.fn,{scope:La.scope,isolateScope:La.isolateScope,controller:La.controller,injector:La.injector,inheritedData:La.inheritedData}),b=sa.cleanData,sa.cleanData=function(a){var c;if(Pb)Pb=!1;else for(var d=0,e;null!=(e=a[d]);d++)(c=sa._data(e,"events"))&&c.$destroy&&sa(e).triggerHandler("$destroy");b(a)}):B=R,ga.element=B,uc=!0)}function Qb(b,a,c){if(!b)throw Ka("areq",a||"?",c||"required");return b}function sb(b,a,c){c&&D(b)&&(b=b[b.length-1]); Qb(G(b),a,"not a function, got "+(b&&"object"===typeof b?b.constructor.name||"Object":typeof b));return b}function Ma(b,a){if("hasOwnProperty"===b)throw Ka("badname",a);}function vc(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,f=a.length,g=0;g<f;g++)d=a[g],b&&(b=(e=b)[d]);return!c&&G(b)?nc(e,b):b}function tb(b){var a=b[0];b=b[b.length-1];var c=[a];do{a=a.nextSibling;if(!a)break;c.push(a)}while(a!==b);return B(c)}function ha(){return Object.create(null)}function Od(b){function a(a,b,c){return a[b]|| (a[b]=c())}var c=T("$injector"),d=T("ng");b=a(b,"angular",Object);b.$$minErr=b.$$minErr||T;return a(b,"module",function(){var b={};return function(f,g,h){if("hasOwnProperty"===f)throw d("badname","module");g&&b.hasOwnProperty(f)&&(b[f]=null);return a(b,f,function(){function a(c,d,e,f){f||(f=b);return function(){f[e||"push"]([c,d,arguments]);return u}}if(!g)throw c("nomod",f);var b=[],d=[],e=[],q=a("$injector","invoke","push",d),u={_invokeQueue:b,_configBlocks:d,_runBlocks:e,requires:g,name:f,provider:a("$provide", "provider"),factory:a("$provide","factory"),service:a("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),animation:a("$animateProvider","register"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:q,run:function(a){e.push(a);return this}};h&&q(h);return u})}})}function Pd(b){z(b,{bootstrap:sc,copy:Ea,extend:z,equals:fa,element:B,forEach:s,injector:Ob,noop:H,bind:nc,toJson:$a, fromJson:oc,identity:pa,isUndefined:A,isDefined:y,isString:F,isFunction:G,isObject:I,isNumber:V,isElement:mc,isArray:D,version:Qd,isDate:qa,lowercase:Q,uppercase:ub,callbacks:{counter:0},getTestability:Ld,$$minErr:T,$$csp:ab,reloadWithDebugInfo:Kd});bb=Od(M);try{bb("ngLocale")}catch(a){bb("ngLocale",[]).provider("$locale",Rd)}bb("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:Sd});a.provider("$compile",wc).directive({a:Td,input:xc,textarea:xc,form:Ud,script:Vd,select:Wd,style:Xd, option:Yd,ngBind:Zd,ngBindHtml:$d,ngBindTemplate:ae,ngClass:be,ngClassEven:ce,ngClassOdd:de,ngCloak:ee,ngController:fe,ngForm:ge,ngHide:he,ngIf:ie,ngInclude:je,ngInit:ke,ngNonBindable:le,ngPluralize:me,ngRepeat:ne,ngShow:oe,ngStyle:pe,ngSwitch:qe,ngSwitchWhen:re,ngSwitchDefault:se,ngOptions:te,ngTransclude:ue,ngModel:ve,ngList:we,ngChange:xe,pattern:yc,ngPattern:yc,required:zc,ngRequired:zc,minlength:Ac,ngMinlength:Ac,maxlength:Bc,ngMaxlength:Bc,ngValue:ye,ngModelOptions:ze}).directive({ngInclude:Ae}).directive(vb).directive(Cc); a.provider({$anchorScroll:Be,$animate:Ce,$browser:De,$cacheFactory:Ee,$controller:Fe,$document:Ge,$exceptionHandler:He,$filter:Dc,$interpolate:Ie,$interval:Je,$http:Ke,$httpBackend:Le,$location:Me,$log:Ne,$parse:Oe,$rootScope:Pe,$q:Qe,$$q:Re,$sce:Se,$sceDelegate:Te,$sniffer:Ue,$templateCache:Ve,$templateRequest:We,$$testability:Xe,$timeout:Ye,$window:Ze,$$rAF:$e,$$asyncCallback:af,$$jqLite:bf})}])}function cb(b){return b.replace(cf,function(a,b,d,e){return e?d.toUpperCase():d}).replace(df,"Moz$1")} function Ec(b){b=b.nodeType;return b===oa||!b||9===b}function Fc(b,a){var c,d,e=a.createDocumentFragment(),f=[];if(Rb.test(b)){c=c||e.appendChild(a.createElement("div"));d=(ef.exec(b)||["",""])[1].toLowerCase();d=ia[d]||ia._default;c.innerHTML=d[1]+b.replace(ff,"<$1></$2>")+d[2];for(d=d[0];d--;)c=c.lastChild;f=Ya(f,c.childNodes);c=e.firstChild;c.textContent=""}else f.push(a.createTextNode(b));e.textContent="";e.innerHTML="";s(f,function(a){e.appendChild(a)});return e}function R(b){if(b instanceof R)return b;var a;F(b)&&(b=U(b),a=!0);if(!(this instanceof R)){if(a&&"<"!=b.charAt(0))throw Sb("nosel");return new R(b)}if(a){a=Y;var c;b=(c=gf.exec(b))?[a.createElement(c[1])]:(c=Fc(b,a))?c.childNodes:[]}Gc(this,b)}function Tb(b){return b.cloneNode(!0)}function wb(b,a){a||xb(b);if(b.querySelectorAll)for(var c=b.querySelectorAll("*"),d=0,e=c.length;d<e;d++)xb(c[d])}function Hc(b,a,c,d){if(y(d))throw Sb("offargs");var e=(d=yb(b))&&d.events,f=d&&d.handle;if(f)if(a)s(a.split(" "),function(a){if(y(c)){var d= e[a];Xa(d||[],c);if(d&&0<d.length)return}b.removeEventListener(a,f,!1);delete e[a]});else for(a in e)"$destroy"!==a&&b.removeEventListener(a,f,!1),delete e[a]}function xb(b,a){var c=b.ng339,d=c&&zb[c];d&&(a?delete d.data[a]:(d.handle&&(d.events.$destroy&&d.handle({},"$destroy"),Hc(b)),delete zb[c],b.ng339=t))}function yb(b,a){var c=b.ng339,c=c&&zb[c];a&&!c&&(b.ng339=c=++hf,c=zb[c]={events:{},data:{},handle:t});return c}function Ub(b,a,c){if(Ec(b)){var d=y(c),e=!d&&a&&!I(a),f=!a;b=(b=yb(b,!e))&&b.data; if(d)b[a]=c;else{if(f)return b;if(e)return b&&b[a];z(b,a)}}}function Ab(b,a){return b.getAttribute?-1<(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+a+" "):!1}function Bb(b,a){a&&b.setAttribute&&s(a.split(" "),function(a){b.setAttribute("class",U((" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+U(a)+" "," ")))})}function Cb(b,a){if(a&&b.setAttribute){var c=(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");s(a.split(" "),function(a){a= U(a);-1===c.indexOf(" "+a+" ")&&(c+=a+" ")});b.setAttribute("class",U(c))}}function Gc(b,a){if(a)if(a.nodeType)b[b.length++]=a;else{var c=a.length;if("number"===typeof c&&a.window!==a){if(c)for(var d=0;d<c;d++)b[b.length++]=a[d]}else b[b.length++]=a}}function Ic(b,a){return Db(b,"$"+(a||"ngController")+"Controller")}function Db(b,a,c){9==b.nodeType&&(b=b.documentElement);for(a=D(a)?a:[a];b;){for(var d=0,e=a.length;d<e;d++)if((c=B.data(b,a[d]))!==t)return c;b=b.parentNode||11===b.nodeType&&b.host}} function Jc(b){for(wb(b,!0);b.firstChild;)b.removeChild(b.firstChild)}function Kc(b,a){a||wb(b);var c=b.parentNode;c&&c.removeChild(b)}function jf(b,a){a=a||M;if("complete"===a.document.readyState)a.setTimeout(b);else B(a).on("load",b)}function Lc(b,a){var c=Eb[a.toLowerCase()];return c&&Mc[ua(b)]&&c}function kf(b,a){var c=b.nodeName;return("INPUT"===c||"TEXTAREA"===c)&&Nc[a]}function lf(b,a){var c=function(c,e){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=a[e||c.type],g=f?f.length: 0;if(g){if(A(c.immediatePropagationStopped)){var h=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0;c.stopPropagation&&c.stopPropagation();h&&h.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};1<g&&(f=ra(f));for(var l=0;l<g;l++)c.isImmediatePropagationStopped()||f[l].call(b,c)}};c.elem=b;return c}function bf(){this.$get=function(){return z(R,{hasClass:function(b,a){b.attr&&(b=b[0]);return Ab(b,a)},addClass:function(b, a){b.attr&&(b=b[0]);return Cb(b,a)},removeClass:function(b,a){b.attr&&(b=b[0]);return Bb(b,a)}})}}function Na(b,a){var c=b&&b.$$hashKey;if(c)return"function"===typeof c&&(c=b.$$hashKey()),c;c=typeof b;return c="function"==c||"object"==c&&null!==b?b.$$hashKey=c+":"+(a||Fd)():c+":"+b}function db(b,a){if(a){var c=0;this.nextUid=function(){return++c}}s(b,this.put,this)}function mf(b){return(b=b.toString().replace(Oc,"").match(Pc))?"function("+(b[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function Vb(b, a,c){var d;if("function"===typeof b){if(!(d=b.$inject)){d=[];if(b.length){if(a)throw F(c)&&c||(c=b.name||mf(b)),Ga("strictdi",c);a=b.toString().replace(Oc,"");a=a.match(Pc);s(a[1].split(nf),function(a){a.replace(of,function(a,b,c){d.push(c)})})}b.$inject=d}}else D(b)?(a=b.length-1,sb(b[a],"fn"),d=b.slice(0,a)):sb(b,"fn",!0);return d}function Ob(b,a){function c(a){return function(b,c){if(I(b))s(b,kc(a));else return a(b,c)}}function d(a,b){Ma(a,"service");if(G(b)||D(b))b=q.instantiate(b);if(!b.$get)throw Ga("pget", a);return n[a+"Provider"]=b}function e(a,b){return function(){var c=r.invoke(b,this);if(A(c))throw Ga("undef",a);return c}}function f(a,b,c){return d(a,{$get:!1!==c?e(a,b):b})}function g(a){var b=[],c;s(a,function(a){function d(a){var b,c;b=0;for(c=a.length;b<c;b++){var e=a[b],f=q.get(e[0]);f[e[1]].apply(f,e[2])}}if(!m.get(a)){m.put(a,!0);try{F(a)?(c=bb(a),b=b.concat(g(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):G(a)?b.push(q.invoke(a)):D(a)?b.push(q.invoke(a)):sb(a,"module")}catch(e){throw D(a)&& (a=a[a.length-1]),e.message&&e.stack&&-1==e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ga("modulerr",a,e.stack||e.message||e);}}});return b}function h(b,c){function d(a,e){if(b.hasOwnProperty(a)){if(b[a]===l)throw Ga("cdep",a+" <- "+k.join(" <- "));return b[a]}try{return k.unshift(a),b[a]=l,b[a]=c(a,e)}catch(f){throw b[a]===l&&delete b[a],f;}finally{k.shift()}}function e(b,c,f,g){"string"===typeof f&&(g=f,f=null);var h=[],k=Vb(b,a,g),l,q,n;q=0;for(l=k.length;q<l;q++){n=k[q];if("string"!== typeof n)throw Ga("itkn",n);h.push(f&&f.hasOwnProperty(n)?f[n]:d(n,g))}D(b)&&(b=b[l]);return b.apply(c,h)}return{invoke:e,instantiate:function(a,b,c){var d=Object.create((D(a)?a[a.length-1]:a).prototype||null);a=e(a,d,b,c);return I(a)||G(a)?a:d},get:d,annotate:Vb,has:function(a){return n.hasOwnProperty(a+"Provider")||b.hasOwnProperty(a)}}}a=!0===a;var l={},k=[],m=new db([],!0),n={$provide:{provider:c(d),factory:c(f),service:c(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}), value:c(function(a,b){return f(a,da(b),!1)}),constant:c(function(a,b){Ma(a,"constant");n[a]=b;u[a]=b}),decorator:function(a,b){var c=q.get(a+"Provider"),d=c.$get;c.$get=function(){var a=r.invoke(d,c);return r.invoke(b,null,{$delegate:a})}}}},q=n.$injector=h(n,function(a,b){ga.isString(b)&&k.push(b);throw Ga("unpr",k.join(" <- "));}),u={},r=u.$injector=h(u,function(a,b){var c=q.get(a+"Provider",b);return r.invoke(c.$get,c,t,a)});s(g(b),function(a){r.invoke(a||H)});return r}function Be(){var b=!0;this.disableAutoScrolling= function(){b=!1};this.$get=["$window","$location","$rootScope",function(a,c,d){function e(a){var b=null;Array.prototype.some.call(a,function(a){if("a"===ua(a))return b=a,!0});return b}function f(b){if(b){b.scrollIntoView();var c;c=g.yOffset;G(c)?c=c():mc(c)?(c=c[0],c="fixed"!==a.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):V(c)||(c=0);c&&(b=b.getBoundingClientRect().top,a.scrollBy(0,b-c))}else a.scrollTo(0,0)}function g(){var a=c.hash(),b;a?(b=h.getElementById(a))?f(b):(b=e(h.getElementsByName(a)))? f(b):"top"===a&&f(null):f(null)}var h=a.document;b&&d.$watch(function(){return c.hash()},function(a,b){a===b&&""===a||jf(function(){d.$evalAsync(g)})});return g}]}function af(){this.$get=["$$rAF","$timeout",function(b,a){return b.supported?function(a){return b(a)}:function(b){return a(b,0,!1)}}]}function pf(b,a,c,d){function e(a){try{a.apply(null,Za.call(arguments,1))}finally{if(v--,0===v)for(;w.length;)try{w.pop()()}catch(b){c.error(b)}}}function f(a,b){(function N(){s(L,function(a){a()});C=b(N, a)})()}function g(){h();l()}function h(){x=b.history.state;x=A(x)?null:x;fa(x,J)&&(x=J);J=x}function l(){if(E!==m.url()||P!==x)E=m.url(),P=x,s(W,function(a){a(m.url(),x)})}function k(a){try{return decodeURIComponent(a)}catch(b){return a}}var m=this,n=a[0],q=b.location,u=b.history,r=b.setTimeout,O=b.clearTimeout,p={};m.isMock=!1;var v=0,w=[];m.$$completeOutstandingRequest=e;m.$$incOutstandingRequestCount=function(){v++};m.notifyWhenNoOutstandingRequests=function(a){s(L,function(a){a()});0===v?a(): w.push(a)};var L=[],C;m.addPollFn=function(a){A(C)&&f(100,r);L.push(a);return a};var x,P,E=q.href,S=a.find("base"),X=null;h();P=x;m.url=function(a,c,e){A(e)&&(e=null);q!==b.location&&(q=b.location);u!==b.history&&(u=b.history);if(a){var f=P===e;if(E===a&&(!d.history||f))return m;var g=E&&Ha(E)===Ha(a);E=a;P=e;!d.history||g&&f?(g||(X=a),c?q.replace(a):g?(c=q,e=a.indexOf("#"),a=-1===e?"":a.substr(e+1),c.hash=a):q.href=a):(u[c?"replaceState":"pushState"](e,"",a),h(),P=x);return m}return X||q.href.replace(/%27/g, "'")};m.state=function(){return x};var W=[],wa=!1,J=null;m.onUrlChange=function(a){if(!wa){if(d.history)B(b).on("popstate",g);B(b).on("hashchange",g);wa=!0}W.push(a);return a};m.$$checkUrlChange=l;m.baseHref=function(){var a=S.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""};var ea={},y="",ca=m.baseHref();m.cookies=function(a,b){var d,e,f,g;if(a)b===t?n.cookie=encodeURIComponent(a)+"=;path="+ca+";expires=Thu, 01 Jan 1970 00:00:00 GMT":F(b)&&(d=(n.cookie=encodeURIComponent(a)+"="+encodeURIComponent(b)+ ";path="+ca).length+1,4096<d&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!"));else{if(n.cookie!==y)for(y=n.cookie,d=y.split("; "),ea={},f=0;f<d.length;f++)e=d[f],g=e.indexOf("="),0<g&&(a=k(e.substring(0,g)),ea[a]===t&&(ea[a]=k(e.substring(g+1))));return ea}};m.defer=function(a,b){var c;v++;c=r(function(){delete p[c];e(a)},b||0);p[c]=!0;return c};m.defer.cancel=function(a){return p[a]?(delete p[a],O(a),e(H),!0):!1}}function De(){this.$get=["$window", "$log","$sniffer","$document",function(b,a,c,d){return new pf(b,d,a,c)}]}function Ee(){this.$get=function(){function b(b,d){function e(a){a!=n&&(q?q==a&&(q=a.n):q=a,f(a.n,a.p),f(a,n),n=a,n.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(b in a)throw T("$cacheFactory")("iid",b);var g=0,h=z({},d,{id:b}),l={},k=d&&d.capacity||Number.MAX_VALUE,m={},n=null,q=null;return a[b]={put:function(a,b){if(k<Number.MAX_VALUE){var c=m[a]||(m[a]={key:a});e(c)}if(!A(b))return a in l||g++,l[a]=b,g>k&&this.remove(q.key), b},get:function(a){if(k<Number.MAX_VALUE){var b=m[a];if(!b)return;e(b)}return l[a]},remove:function(a){if(k<Number.MAX_VALUE){var b=m[a];if(!b)return;b==n&&(n=b.p);b==q&&(q=b.n);f(b.n,b.p);delete m[a]}delete l[a];g--},removeAll:function(){l={};g=0;m={};n=q=null},destroy:function(){m=h=l=null;delete a[b]},info:function(){return z({},h,{size:g})}}}var a={};b.info=function(){var b={};s(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function Ve(){this.$get=["$cacheFactory", function(b){return b("templates")}]}function wc(b,a){function c(a,b){var c=/^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/,d={};s(a,function(a,e){var f=a.match(c);if(!f)throw ja("iscp",b,e,a);d[e]={mode:f[1][0],collection:"*"===f[2],optional:"?"===f[3],attrName:f[4]||e}});return d}var d={},e=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,f=/(([\w\-]+)(?:\:([^;]+))?;?)/,g=Gd("ngSrc,ngSrcset,src,srcset"),h=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,l=/^(on[a-z]+|formaction)$/;this.directive=function n(a,e){Ma(a,"directive");F(a)?(Qb(e, "directiveFactory"),d.hasOwnProperty(a)||(d[a]=[],b.factory(a+"Directive",["$injector","$exceptionHandler",function(b,e){var f=[];s(d[a],function(d,g){try{var h=b.invoke(d);G(h)?h={compile:da(h)}:!h.compile&&h.link&&(h.compile=da(h.link));h.priority=h.priority||0;h.index=g;h.name=h.name||a;h.require=h.require||h.controller&&h.name;h.restrict=h.restrict||"EA";I(h.scope)&&(h.$$isolateBindings=c(h.scope,h.name));f.push(h)}catch(l){e(l)}});return f}])),d[a].push(e)):s(a,kc(n));return this};this.aHrefSanitizationWhitelist= function(b){return y(b)?(a.aHrefSanitizationWhitelist(b),this):a.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(b){return y(b)?(a.imgSrcSanitizationWhitelist(b),this):a.imgSrcSanitizationWhitelist()};var k=!0;this.debugInfoEnabled=function(a){return y(a)?(k=a,this):k};this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(a,b,c,r,O,p,v,w,L,C,x){function P(a,b){try{a.addClass(b)}catch(c){}} function E(a,b,c,d,e){a instanceof B||(a=B(a));s(a,function(b,c){b.nodeType==pb&&b.nodeValue.match(/\S+/)&&(a[c]=B(b).wrap("<span></span>").parent()[0])});var f=S(a,b,a,c,d,e);E.$$addScopeClass(a);var g=null;return function(b,c,d){Qb(b,"scope");d=d||{};var e=d.parentBoundTranscludeFn,h=d.transcludeControllers;d=d.futureParentElement;e&&e.$$boundTransclude&&(e=e.$$boundTransclude);g||(g=(d=d&&d[0])?"foreignobject"!==ua(d)&&d.toString().match(/SVG/)?"svg":"html":"html");d="html"!==g?B(Wb(g,B("<div>").append(a).html())): c?La.clone.call(a):a;if(h)for(var l in h)d.data("$"+l+"Controller",h[l].instance);E.$$addScopeInfo(d,b);c&&c(d,b);f&&f(b,d,d,e);return d}}function S(a,b,c,d,e,f){function g(a,c,d,e){var f,l,k,q,n,p,w;if(r)for(w=Array(c.length),q=0;q<h.length;q+=3)f=h[q],w[f]=c[f];else w=c;q=0;for(n=h.length;q<n;)l=w[h[q++]],c=h[q++],f=h[q++],c?(c.scope?(k=a.$new(),E.$$addScopeInfo(B(l),k)):k=a,p=c.transcludeOnThisElement?X(a,c.transclude,e,c.elementTranscludeOnThisElement):!c.templateOnThisElement&&e?e:!e&&b?X(a, b):null,c(f,k,l,d,p)):f&&f(a,l.childNodes,t,e)}for(var h=[],l,k,q,n,r,p=0;p<a.length;p++){l=new Xb;k=W(a[p],[],l,0===p?d:t,e);(f=k.length?ea(k,a[p],l,b,c,null,[],[],f):null)&&f.scope&&E.$$addScopeClass(l.$$element);l=f&&f.terminal||!(q=a[p].childNodes)||!q.length?null:S(q,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||l)h.push(p,f,l),n=!0,r=r||f;f=null}return n?g:null}function X(a,b,c,d){return function(d,e,f,g,h){d||(d=a.$new(!1,h),d.$$transcluded=!0);return b(d,e, {parentBoundTranscludeFn:c,transcludeControllers:f,futureParentElement:g})}}function W(a,b,c,d,g){var h=c.$attr,l;switch(a.nodeType){case oa:ca(b,ya(ua(a)),"E",d,g);for(var k,q,n,r=a.attributes,p=0,w=r&&r.length;p<w;p++){var O=!1,L=!1;k=r[p];l=k.name;q=U(k.value);k=ya(l);if(n=fb.test(k))l=l.replace(Rc,"").substr(8).replace(/_(.)/g,function(a,b){return b.toUpperCase()});var u=k.replace(/(Start|End)$/,"");A(u)&&k===u+"Start"&&(O=l,L=l.substr(0,l.length-5)+"end",l=l.substr(0,l.length-6));k=ya(l.toLowerCase()); h[k]=l;if(n||!c.hasOwnProperty(k))c[k]=q,Lc(a,k)&&(c[k]=!0);Pa(a,b,q,k,n);ca(b,k,"A",d,g,O,L)}a=a.className;I(a)&&(a=a.animVal);if(F(a)&&""!==a)for(;l=f.exec(a);)k=ya(l[2]),ca(b,k,"C",d,g)&&(c[k]=U(l[3])),a=a.substr(l.index+l[0].length);break;case pb:M(b,a.nodeValue);break;case 8:try{if(l=e.exec(a.nodeValue))k=ya(l[1]),ca(b,k,"M",d,g)&&(c[k]=U(l[2]))}catch(v){}}b.sort(N);return b}function wa(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ja("uterdir",b,c);a.nodeType== oa&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return B(d)}function J(a,b,c){return function(d,e,f,g,h){e=wa(e[0],b,c);return a(d,e,f,g,h)}}function ea(a,d,e,f,g,l,k,n,r){function w(a,b,c,d){if(a){c&&(a=J(a,c,d));a.require=K.require;a.directiveName=z;if(S===K||K.$$isolateScope)a=Z(a,{isolateScope:!0});k.push(a)}if(b){c&&(b=J(b,c,d));b.require=K.require;b.directiveName=z;if(S===K||K.$$isolateScope)b=Z(b,{isolateScope:!0});n.push(b)}}function L(a, b,c,d){var e,f="data",g=!1,l=c,k;if(F(b)){k=b.match(h);b=b.substring(k[0].length);k[3]&&(k[1]?k[3]=null:k[1]=k[3]);"^"===k[1]?f="inheritedData":"^^"===k[1]&&(f="inheritedData",l=c.parent());"?"===k[2]&&(g=!0);e=null;d&&"data"===f&&(e=d[b])&&(e=e.instance);e=e||l[f]("$"+b+"Controller");if(!e&&!g)throw ja("ctreq",b,a);return e||null}D(b)&&(e=[],s(b,function(b){e.push(L(a,b,c,d))}));return e}function v(a,c,f,g,h){function l(a,b,c){var d;Va(a)||(c=b,b=a,a=t);H&&(d=P);c||(c=H?W.parent():W);return h(a, b,d,c,wa)}var r,w,u,x,P,eb,W,J;d===f?(J=e,W=e.$$element):(W=B(f),J=new Xb(W,e));S&&(x=c.$new(!0));h&&(eb=l,eb.$$boundTransclude=h);C&&(X={},P={},s(C,function(a){var b={$scope:a===S||a.$$isolateScope?x:c,$element:W,$attrs:J,$transclude:eb};u=a.controller;"@"==u&&(u=J[a.name]);b=p(u,b,!0,a.controllerAs);P[a.name]=b;H||W.data("$"+a.name+"Controller",b.instance);X[a.name]=b}));if(S){E.$$addScopeInfo(W,x,!0,!(ka&&(ka===S||ka===S.$$originalDirective)));E.$$addScopeClass(W,!0);g=X&&X[S.name];var xa=x;g&& g.identifier&&!0===S.bindToController&&(xa=g.instance);s(x.$$isolateBindings=S.$$isolateBindings,function(a,d){var e=a.attrName,f=a.optional,g,h,l,k;switch(a.mode){case "@":J.$observe(e,function(a){xa[d]=a});J.$$observers[e].$$scope=c;J[e]&&(xa[d]=b(J[e])(c));break;case "=":if(f&&!J[e])break;h=O(J[e]);k=h.literal?fa:function(a,b){return a===b||a!==a&&b!==b};l=h.assign||function(){g=xa[d]=h(c);throw ja("nonassign",J[e],S.name);};g=xa[d]=h(c);f=function(a){k(a,xa[d])||(k(a,g)?l(c,a=xa[d]):xa[d]=a); return g=a};f.$stateful=!0;f=a.collection?c.$watchCollection(J[e],f):c.$watch(O(J[e],f),null,h.literal);x.$on("$destroy",f);break;case "&":h=O(J[e]),xa[d]=function(a){return h(c,a)}}})}X&&(s(X,function(a){a()}),X=null);g=0;for(r=k.length;g<r;g++)w=k[g],$(w,w.isolateScope?x:c,W,J,w.require&&L(w.directiveName,w.require,W,P),eb);var wa=c;S&&(S.template||null===S.templateUrl)&&(wa=x);a&&a(wa,f.childNodes,t,h);for(g=n.length-1;0<=g;g--)w=n[g],$(w,w.isolateScope?x:c,W,J,w.require&&L(w.directiveName,w.require, W,P),eb)}r=r||{};for(var x=-Number.MAX_VALUE,P,C=r.controllerDirectives,X,S=r.newIsolateScopeDirective,ka=r.templateDirective,ea=r.nonTlbTranscludeDirective,ca=!1,A=!1,H=r.hasElementTranscludeDirective,aa=e.$$element=B(d),K,z,N,Aa=f,Q,M=0,R=a.length;M<R;M++){K=a[M];var Pa=K.$$start,fb=K.$$end;Pa&&(aa=wa(d,Pa,fb));N=t;if(x>K.priority)break;if(N=K.scope)K.templateUrl||(I(N)?(Oa("new/isolated scope",S||P,K,aa),S=K):Oa("new/isolated scope",S,K,aa)),P=P||K;z=K.name;!K.templateUrl&&K.controller&&(N=K.controller, C=C||{},Oa("'"+z+"' controller",C[z],K,aa),C[z]=K);if(N=K.transclude)ca=!0,K.$$tlb||(Oa("transclusion",ea,K,aa),ea=K),"element"==N?(H=!0,x=K.priority,N=aa,aa=e.$$element=B(Y.createComment(" "+z+": "+e[z]+" ")),d=aa[0],V(g,Za.call(N,0),d),Aa=E(N,f,x,l&&l.name,{nonTlbTranscludeDirective:ea})):(N=B(Tb(d)).contents(),aa.empty(),Aa=E(N,f));if(K.template)if(A=!0,Oa("template",ka,K,aa),ka=K,N=G(K.template)?K.template(aa,e):K.template,N=Sc(N),K.replace){l=K;N=Rb.test(N)?Tc(Wb(K.templateNamespace,U(N))):[]; d=N[0];if(1!=N.length||d.nodeType!==oa)throw ja("tplrt",z,"");V(g,aa,d);R={$attr:{}};N=W(d,[],R);var ba=a.splice(M+1,a.length-(M+1));S&&y(N);a=a.concat(N).concat(ba);Qc(e,R);R=a.length}else aa.html(N);if(K.templateUrl)A=!0,Oa("template",ka,K,aa),ka=K,K.replace&&(l=K),v=T(a.splice(M,a.length-M),aa,e,g,ca&&Aa,k,n,{controllerDirectives:C,newIsolateScopeDirective:S,templateDirective:ka,nonTlbTranscludeDirective:ea}),R=a.length;else if(K.compile)try{Q=K.compile(aa,e,Aa),G(Q)?w(null,Q,Pa,fb):Q&&w(Q.pre, Q.post,Pa,fb)}catch(qf){c(qf,va(aa))}K.terminal&&(v.terminal=!0,x=Math.max(x,K.priority))}v.scope=P&&!0===P.scope;v.transcludeOnThisElement=ca;v.elementTranscludeOnThisElement=H;v.templateOnThisElement=A;v.transclude=Aa;r.hasElementTranscludeDirective=H;return v}function y(a){for(var b=0,c=a.length;b<c;b++){var d=b,e;e=z(Object.create(a[b]),{$$isolateScope:!0});a[d]=e}}function ca(b,e,f,g,h,l,k){if(e===h)return null;h=null;if(d.hasOwnProperty(e)){var q;e=a.get(e+"Directive");for(var r=0,p=e.length;r< p;r++)try{if(q=e[r],(g===t||g>q.priority)&&-1!=q.restrict.indexOf(f)){if(l){var w={$$start:l,$$end:k};q=z(Object.create(q),w)}b.push(q);h=q}}catch(O){c(O)}}return h}function A(b){if(d.hasOwnProperty(b))for(var c=a.get(b+"Directive"),e=0,f=c.length;e<f;e++)if(b=c[e],b.multiElement)return!0;return!1}function Qc(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;s(a,function(d,e){"$"!=e.charAt(0)&&(b[e]&&b[e]!==d&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});s(b,function(b,f){"class"==f?(P(e,b),a["class"]= (a["class"]?a["class"]+" ":"")+b):"style"==f?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==f.charAt(0)||a.hasOwnProperty(f)||(a[f]=b,d[f]=c[f])})}function T(a,b,c,d,e,f,g,h){var l=[],k,q,n=b[0],p=a.shift(),w=z({},p,{templateUrl:null,transclude:null,replace:null,$$originalDirective:p}),O=G(p.templateUrl)?p.templateUrl(b,c):p.templateUrl,u=p.templateNamespace;b.empty();r(L.getTrustedResourceUrl(O)).then(function(r){var L,v;r=Sc(r);if(p.replace){r=Rb.test(r)?Tc(Wb(u, U(r))):[];L=r[0];if(1!=r.length||L.nodeType!==oa)throw ja("tplrt",p.name,O);r={$attr:{}};V(d,b,L);var x=W(L,[],r);I(p.scope)&&y(x);a=x.concat(a);Qc(c,r)}else L=n,b.html(r);a.unshift(w);k=ea(a,L,c,e,b,p,f,g,h);s(d,function(a,c){a==L&&(d[c]=b[0])});for(q=S(b[0].childNodes,e);l.length;){r=l.shift();v=l.shift();var C=l.shift(),E=l.shift(),x=b[0];if(!r.$$destroyed){if(v!==n){var J=v.className;h.hasElementTranscludeDirective&&p.replace||(x=Tb(L));V(C,B(v),x);P(B(x),J)}v=k.transcludeOnThisElement?X(r,k.transclude, E):E;k(q,r,x,d,v)}}l=null});return function(a,b,c,d,e){a=e;b.$$destroyed||(l?l.push(b,c,d,a):(k.transcludeOnThisElement&&(a=X(b,k.transclude,e)),k(q,b,c,d,a)))}}function N(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function Oa(a,b,c,d){if(b)throw ja("multidir",b.name,c.name,a,va(d));}function M(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=a.parent();var b=!!a.length;b&&E.$$addBindingClass(a);return function(a,c){var e=c.parent(); b||E.$$addBindingClass(e);E.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function Wb(a,b){a=Q(a||"html");switch(a){case "svg":case "math":var c=Y.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function R(a,b){if("srcdoc"==b)return L.HTML;var c=ua(a);if("xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b||"ngSrc"==b))return L.RESOURCE_URL}function Pa(a,c,d,e,f){var h=R(a,e);f=g[e]||f;var k=b(d,!0, h,f);if(k){if("multiple"===e&&"select"===ua(a))throw ja("selmulti",va(a));c.push({priority:100,compile:function(){return{pre:function(a,c,g){c=g.$$observers||(g.$$observers={});if(l.test(e))throw ja("nodomevents");var n=g[e];n!==d&&(k=n&&b(n,!0,h,f),d=n);k&&(g[e]=k(a),(c[e]||(c[e]=[])).$$inter=!0,(g.$$observers&&g.$$observers[e].$$scope||a).$watch(k,function(a,b){"class"===e&&a!=b?g.$updateClass(a,b):g.$set(e,a)}))}}}})}}function V(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g< h;g++)if(a[g]==d){a[g++]=c;h=g+e-1;for(var l=a.length;g<l;g++,h++)h<l?a[g]=a[h]:delete a[g];a.length-=e-1;a.context===d&&(a.context=c);break}f&&f.replaceChild(c,d);a=Y.createDocumentFragment();a.appendChild(d);B(c).data(B(d).data());sa?(Pb=!0,sa.cleanData([d])):delete B.cache[d[B.expando]];d=1;for(e=b.length;d<e;d++)f=b[d],B(f).remove(),a.appendChild(f),delete b[d];b[0]=c;b.length=1}function Z(a,b){return z(function(){return a.apply(null,arguments)},a,b)}function $(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h, va(d))}}var Xb=function(a,b){if(b){var c=Object.keys(b),d,e,f;d=0;for(e=c.length;d<e;d++)f=c[d],this[f]=b[f]}else this.$attr={};this.$$element=a};Xb.prototype={$normalize:ya,$addClass:function(a){a&&0<a.length&&C.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&C.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=Uc(a,b);c&&c.length&&C.addClass(this.$$element,c);(c=Uc(b,a))&&c.length&&C.removeClass(this.$$element,c)},$set:function(a,b,d,e){var f=this.$$element[0],g= Lc(f,a),h=kf(f,a),f=a;g?(this.$$element.prop(a,b),e=g):h&&(this[h]=b,f=h);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=tc(a,"-"));g=ua(this.$$element);if("a"===g&&"href"===a||"img"===g&&"src"===a)this[a]=b=x(b,"src"===a);else if("img"===g&&"srcset"===a){for(var g="",h=U(b),l=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,l=/\s/.test(h)?l:/(,)/,h=h.split(l),l=Math.floor(h.length/2),k=0;k<l;k++)var q=2*k,g=g+x(U(h[q]),!0),g=g+(" "+U(h[q+1]));h=U(h[2*k]).split(/\s/);g+=x(U(h[0]),!0);2===h.length&& (g+=" "+U(h[1]));this[a]=b=g}!1!==d&&(null===b||b===t?this.$$element.removeAttr(e):this.$$element.attr(e,b));(a=this.$$observers)&&s(a[f],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=ha()),e=d[a]||(d[a]=[]);e.push(b);v.$evalAsync(function(){!e.$$inter&&c.hasOwnProperty(a)&&b(c[a])});return function(){Xa(e,b)}}};var Aa=b.startSymbol(),ka=b.endSymbol(),Sc="{{"==Aa||"}}"==ka?pa:function(a){return a.replace(/\{\{/g,Aa).replace(/}}/g,ka)},fb= /^ngAttr[A-Z]/;E.$$addBindingInfo=k?function(a,b){var c=a.data("$binding")||[];D(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:H;E.$$addBindingClass=k?function(a){P(a,"ng-binding")}:H;E.$$addScopeInfo=k?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:H;E.$$addScopeClass=k?function(a,b){P(a,b?"ng-isolate-scope":"ng-scope")}:H;return E}]}function ya(b){return cb(b.replace(Rc,""))}function Uc(b,a){var c="",d=b.split(/\s+/),e=a.split(/\s+/),f=0;a:for(;f<d.length;f++){for(var g= d[f],h=0;h<e.length;h++)if(g==e[h])continue a;c+=(0<c.length?" ":"")+g}return c}function Tc(b){b=B(b);var a=b.length;if(1>=a)return b;for(;a--;)8===b[a].nodeType&&rf.call(b,a,1);return b}function Fe(){var b={},a=!1,c=/^(\S+)(\s+as\s+(\w+))?$/;this.register=function(a,c){Ma(a,"controller");I(a)?z(b,a):b[a]=c};this.allowGlobals=function(){a=!0};this.$get=["$injector","$window",function(d,e){function f(a,b,c,d){if(!a||!I(a.$scope))throw T("$controller")("noscp",d,b);a.$scope[b]=c}return function(g,h, l,k){var m,n,q;l=!0===l;k&&F(k)&&(q=k);F(g)&&(k=g.match(c),n=k[1],q=q||k[3],g=b.hasOwnProperty(n)?b[n]:vc(h.$scope,n,!0)||(a?vc(e,n,!0):t),sb(g,n,!0));if(l)return l=(D(g)?g[g.length-1]:g).prototype,m=Object.create(l||null),q&&f(h,q,m,n||g.name),z(function(){d.invoke(g,m,h,n);return m},{instance:m,identifier:q});m=d.instantiate(g,h,n);q&&f(h,q,m,n||g.name);return m}}]}function Ge(){this.$get=["$window",function(b){return B(b.document)}]}function He(){this.$get=["$log",function(b){return function(a, c){b.error.apply(b,arguments)}}]}function Yb(b,a){if(F(b)){var c=b.replace(sf,"").trim();if(c){var d=a("Content-Type");(d=d&&0===d.indexOf(Vc))||(d=(d=c.match(tf))&&uf[d[0]].test(c));d&&(b=oc(c))}}return b}function Wc(b){var a=ha(),c,d,e;if(!b)return a;s(b.split("\n"),function(b){e=b.indexOf(":");c=Q(U(b.substr(0,e)));d=U(b.substr(e+1));c&&(a[c]=a[c]?a[c]+", "+d:d)});return a}function Xc(b){var a=I(b)?b:t;return function(c){a||(a=Wc(b));return c?(c=a[Q(c)],void 0===c&&(c=null),c):a}}function Yc(b, a,c,d){if(G(d))return d(b,a,c);s(d,function(d){b=d(b,a,c)});return b}function Ke(){var b=this.defaults={transformResponse:[Yb],transformRequest:[function(a){return I(a)&&"[object File]"!==Da.call(a)&&"[object Blob]"!==Da.call(a)&&"[object FormData]"!==Da.call(a)?$a(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ra(Zb),put:ra(Zb),patch:ra(Zb)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"},a=!1;this.useApplyAsync=function(b){return y(b)?(a=!!b,this):a};var c=this.interceptors= [];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(d,e,f,g,h,l){function k(a){function c(a){var b=z({},a);b.data=a.data?Yc(a.data,a.headers,a.status,e.transformResponse):a.data;a=a.status;return 200<=a&&300>a?b:h.reject(b)}function d(a){var b,c={};s(a,function(a,d){G(a)?(b=a(),null!=b&&(c[d]=b)):c[d]=a});return c}if(!ga.isObject(a))throw T("$http")("badreq",a);var e=z({method:"get",transformRequest:b.transformRequest,transformResponse:b.transformResponse}, a);e.headers=function(a){var c=b.headers,e=z({},a.headers),f,g,c=z({},c.common,c[Q(a.method)]);a:for(f in c){a=Q(f);for(g in e)if(Q(g)===a)continue a;e[f]=c[f]}return d(e)}(a);e.method=ub(e.method);var f=[function(a){var d=a.headers,e=Yc(a.data,Xc(d),t,a.transformRequest);A(e)&&s(d,function(a,b){"content-type"===Q(b)&&delete d[b]});A(a.withCredentials)&&!A(b.withCredentials)&&(a.withCredentials=b.withCredentials);return m(a,e).then(c,c)},t],g=h.when(e);for(s(u,function(a){(a.request||a.requestError)&& f.unshift(a.request,a.requestError);(a.response||a.responseError)&&f.push(a.response,a.responseError)});f.length;){a=f.shift();var l=f.shift(),g=g.then(a,l)}g.success=function(a){g.then(function(b){a(b.data,b.status,b.headers,e)});return g};g.error=function(a){g.then(null,function(b){a(b.data,b.status,b.headers,e)});return g};return g}function m(c,f){function l(b,c,d,e){function f(){m(c,b,d,e)}P&&(200<=b&&300>b?P.put(X,[b,c,Wc(d),e]):P.remove(X));a?g.$applyAsync(f):(f(),g.$$phase||g.$apply())}function m(a, b,d,e){b=Math.max(b,0);(200<=b&&300>b?C.resolve:C.reject)({data:a,status:b,headers:Xc(d),config:c,statusText:e})}function w(a){m(a.data,a.status,ra(a.headers()),a.statusText)}function u(){var a=k.pendingRequests.indexOf(c);-1!==a&&k.pendingRequests.splice(a,1)}var C=h.defer(),x=C.promise,P,E,s=c.headers,X=n(c.url,c.params);k.pendingRequests.push(c);x.then(u,u);!c.cache&&!b.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(P=I(c.cache)?c.cache:I(b.cache)?b.cache:q);P&&(E=P.get(X),y(E)?E&& G(E.then)?E.then(w,w):D(E)?m(E[1],E[0],ra(E[2]),E[3]):m(E,200,{},"OK"):P.put(X,x));A(E)&&((E=Zc(c.url)?e.cookies()[c.xsrfCookieName||b.xsrfCookieName]:t)&&(s[c.xsrfHeaderName||b.xsrfHeaderName]=E),d(c.method,X,f,l,s,c.timeout,c.withCredentials,c.responseType));return x}function n(a,b){if(!b)return a;var c=[];Ed(b,function(a,b){null===a||A(a)||(D(a)||(a=[a]),s(a,function(a){I(a)&&(a=qa(a)?a.toISOString():$a(a));c.push(Fa(b)+"="+Fa(a))}))});0<c.length&&(a+=(-1==a.indexOf("?")?"?":"&")+c.join("&")); return a}var q=f("$http"),u=[];s(c,function(a){u.unshift(F(a)?l.get(a):l.invoke(a))});k.pendingRequests=[];(function(a){s(arguments,function(a){k[a]=function(b,c){return k(z(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){s(arguments,function(a){k[a]=function(b,c,d){return k(z(d||{},{method:a,url:b,data:c}))}})})("post","put","patch");k.defaults=b;return k}]}function vf(){return new M.XMLHttpRequest}function Le(){this.$get=["$browser","$window","$document",function(b,a,c){return wf(b, vf,b.defer,a.angular.callbacks,c[0])}]}function wf(b,a,c,d,e){function f(a,b,c){var f=e.createElement("script"),m=null;f.type="text/javascript";f.src=a;f.async=!0;m=function(a){f.removeEventListener("load",m,!1);f.removeEventListener("error",m,!1);e.body.removeChild(f);f=null;var g=-1,u="unknown";a&&("load"!==a.type||d[b].called||(a={type:"error"}),u=a.type,g="error"===a.type?404:200);c&&c(g,u)};f.addEventListener("load",m,!1);f.addEventListener("error",m,!1);e.body.appendChild(f);return m}return function(e, h,l,k,m,n,q,u){function r(){v&&v();w&&w.abort()}function O(a,d,e,f,g){C!==t&&c.cancel(C);v=w=null;a(d,e,f,g);b.$$completeOutstandingRequest(H)}b.$$incOutstandingRequestCount();h=h||b.url();if("jsonp"==Q(e)){var p="_"+(d.counter++).toString(36);d[p]=function(a){d[p].data=a;d[p].called=!0};var v=f(h.replace("JSON_CALLBACK","angular.callbacks."+p),p,function(a,b){O(k,a,d[p].data,"",b);d[p]=H})}else{var w=a();w.open(e,h,!0);s(m,function(a,b){y(a)&&w.setRequestHeader(b,a)});w.onload=function(){var a=w.statusText|| "",b="response"in w?w.response:w.responseText,c=1223===w.status?204:w.status;0===c&&(c=b?200:"file"==Ba(h).protocol?404:0);O(k,c,b,w.getAllResponseHeaders(),a)};e=function(){O(k,-1,null,null,"")};w.onerror=e;w.onabort=e;q&&(w.withCredentials=!0);if(u)try{w.responseType=u}catch(L){if("json"!==u)throw L;}w.send(l||null)}if(0<n)var C=c(r,n);else n&&G(n.then)&&n.then(r)}}function Ie(){var b="{{",a="}}";this.startSymbol=function(a){return a?(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this): a};this.$get=["$parse","$exceptionHandler","$sce",function(c,d,e){function f(a){return"\\\\\\"+a}function g(f,g,u,r){function O(c){return c.replace(k,b).replace(m,a)}function p(a){try{var b=a;a=u?e.getTrusted(u,b):e.valueOf(b);var c;if(r&&!y(a))c=a;else if(null==a)c="";else{switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=$a(a)}c=a}return c}catch(g){c=$b("interr",f,g.toString()),d(c)}}r=!!r;for(var v,w,L=0,C=[],x=[],P=f.length,E=[],s=[];L<P;)if(-1!=(v=f.indexOf(b,L))&&-1!= (w=f.indexOf(a,v+h)))L!==v&&E.push(O(f.substring(L,v))),L=f.substring(v+h,w),C.push(L),x.push(c(L,p)),L=w+l,s.push(E.length),E.push("");else{L!==P&&E.push(O(f.substring(L)));break}if(u&&1<E.length)throw $b("noconcat",f);if(!g||C.length){var X=function(a){for(var b=0,c=C.length;b<c;b++){if(r&&A(a[b]))return;E[s[b]]=a[b]}return E.join("")};return z(function(a){var b=0,c=C.length,e=Array(c);try{for(;b<c;b++)e[b]=x[b](a);return X(e)}catch(g){a=$b("interr",f,g.toString()),d(a)}},{exp:f,expressions:C,$$watchDelegate:function(a, b,c){var d;return a.$watchGroup(x,function(c,e){var f=X(c);G(b)&&b.call(this,f,c!==e?d:f,a);d=f},c)}})}}var h=b.length,l=a.length,k=new RegExp(b.replace(/./g,f),"g"),m=new RegExp(a.replace(/./g,f),"g");g.startSymbol=function(){return b};g.endSymbol=function(){return a};return g}]}function Je(){this.$get=["$rootScope","$window","$q","$$q",function(b,a,c,d){function e(e,h,l,k){var m=a.setInterval,n=a.clearInterval,q=0,u=y(k)&&!k,r=(u?d:c).defer(),O=r.promise;l=y(l)?l:0;O.then(null,null,e);O.$$intervalId= m(function(){r.notify(q++);0<l&&q>=l&&(r.resolve(q),n(O.$$intervalId),delete f[O.$$intervalId]);u||b.$apply()},h);f[O.$$intervalId]=r;return O}var f={};e.cancel=function(b){return b&&b.$$intervalId in f?(f[b.$$intervalId].reject("canceled"),a.clearInterval(b.$$intervalId),delete f[b.$$intervalId],!0):!1};return e}]}function Rd(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3, lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January February March April May June July August September October November December".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a", fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return 1===b?"one":"other"}}}}function ac(b){b=b.split("/");for(var a=b.length;a--;)b[a]=qb(b[a]);return b.join("/")}function $c(b,a){var c=Ba(b);a.$$protocol=c.protocol;a.$$host=c.hostname;a.$$port=ba(c.port)||xf[c.protocol]||null}function ad(b,a){var c="/"!==b.charAt(0);c&&(b="/"+b);var d=Ba(b);a.$$path=decodeURIComponent(c&&"/"===d.pathname.charAt(0)? d.pathname.substring(1):d.pathname);a.$$search=qc(d.search);a.$$hash=decodeURIComponent(d.hash);a.$$path&&"/"!=a.$$path.charAt(0)&&(a.$$path="/"+a.$$path)}function za(b,a){if(0===a.indexOf(b))return a.substr(b.length)}function Ha(b){var a=b.indexOf("#");return-1==a?b:b.substr(0,a)}function bd(b){return b.replace(/(#.+)|#$/,"$1")}function bc(b){return b.substr(0,Ha(b).lastIndexOf("/")+1)}function cc(b,a){this.$$html5=!0;a=a||"";var c=bc(b);$c(b,this);this.$$parse=function(a){var b=za(c,a);if(!F(b))throw Fb("ipthprfx", a,c);ad(b,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Nb(this.$$search),b=this.$$hash?"#"+qb(this.$$hash):"";this.$$url=ac(this.$$path)+(a?"?"+a:"")+b;this.$$absUrl=c+this.$$url.substr(1)};this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;(f=za(b,d))!==t?(g=f,g=(f=za(a,f))!==t?c+(za("/",f)||f):b+g):(f=za(c,d))!==t?g=c+f:c==d+"/"&&(g=c);g&&this.$$parse(g);return!!g}}function dc(b,a){var c=bc(b);$c(b,this);this.$$parse= function(d){d=za(b,d)||za(c,d);var e;"#"===d.charAt(0)?(e=za(a,d),A(e)&&(e=d)):e=this.$$html5?d:"";ad(e,this);d=this.$$path;var f=/^\/[A-Z]:(\/.*)/;0===e.indexOf(b)&&(e=e.replace(b,""));f.exec(e)||(d=(e=f.exec(d))?e[1]:d);this.$$path=d;this.$$compose()};this.$$compose=function(){var c=Nb(this.$$search),e=this.$$hash?"#"+qb(this.$$hash):"";this.$$url=ac(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+(this.$$url?a+this.$$url:"")};this.$$parseLinkUrl=function(a,c){return Ha(b)==Ha(a)?(this.$$parse(a),!0): !1}}function cd(b,a){this.$$html5=!0;dc.apply(this,arguments);var c=bc(b);this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;b==Ha(d)?f=d:(g=za(c,d))?f=b+a+g:c===d+"/"&&(f=c);f&&this.$$parse(f);return!!f};this.$$compose=function(){var c=Nb(this.$$search),e=this.$$hash?"#"+qb(this.$$hash):"";this.$$url=ac(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+a+this.$$url}}function Gb(b){return function(){return this[b]}}function dd(b,a){return function(c){if(A(c))return this[b]; this[b]=a(c);this.$$compose();return this}}function Me(){var b="",a={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(a){return y(a)?(b=a,this):b};this.html5Mode=function(b){return Wa(b)?(a.enabled=b,this):I(b)?(Wa(b.enabled)&&(a.enabled=b.enabled),Wa(b.requireBase)&&(a.requireBase=b.requireBase),Wa(b.rewriteLinks)&&(a.rewriteLinks=b.rewriteLinks),this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(c,d,e,f,g){function h(a,b,c){var e=k.url(), f=k.$$state;try{d.url(a,b,c),k.$$state=d.state()}catch(g){throw k.url(e),k.$$state=f,g;}}function l(a,b){c.$broadcast("$locationChangeSuccess",k.absUrl(),a,k.$$state,b)}var k,m;m=d.baseHref();var n=d.url(),q;if(a.enabled){if(!m&&a.requireBase)throw Fb("nobase");q=n.substring(0,n.indexOf("/",n.indexOf("//")+2))+(m||"/");m=e.history?cc:cd}else q=Ha(n),m=dc;k=new m(q,"#"+b);k.$$parseLinkUrl(n,n);k.$$state=d.state();var u=/^\s*(javascript|mailto):/i;f.on("click",function(b){if(a.rewriteLinks&&!b.ctrlKey&& !b.metaKey&&2!=b.which){for(var e=B(b.target);"a"!==ua(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var h=e.prop("href"),l=e.attr("href")||e.attr("xlink:href");I(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=Ba(h.animVal).href);u.test(h)||!h||e.attr("target")||b.isDefaultPrevented()||!k.$$parseLinkUrl(h,l)||(b.preventDefault(),k.absUrl()!=d.url()&&(c.$apply(),g.angular["ff-684208-preventDefault"]=!0))}});k.absUrl()!=n&&d.url(k.absUrl(),!0);var r=!0;d.onUrlChange(function(a,b){c.$evalAsync(function(){var d= k.absUrl(),e=k.$$state,f;k.$$parse(a);k.$$state=b;f=c.$broadcast("$locationChangeStart",a,d,b,e).defaultPrevented;k.absUrl()===a&&(f?(k.$$parse(d),k.$$state=e,h(d,!1,e)):(r=!1,l(d,e)))});c.$$phase||c.$digest()});c.$watch(function(){var a=bd(d.url()),b=bd(k.absUrl()),f=d.state(),g=k.$$replace,q=a!==b||k.$$html5&&e.history&&f!==k.$$state;if(r||q)r=!1,c.$evalAsync(function(){var b=k.absUrl(),d=c.$broadcast("$locationChangeStart",b,a,k.$$state,f).defaultPrevented;k.absUrl()===b&&(d?(k.$$parse(a),k.$$state= f):(q&&h(b,g,f===k.$$state?null:k.$$state),l(a,f)))});k.$$replace=!1});return k}]}function Ne(){var b=!0,a=this;this.debugEnabled=function(a){return y(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||H;a=!1;try{a=!!e.apply}catch(l){}return a?function(){var a= [];s(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a,arguments)}}()}}]}function ta(b,a){if("__defineGetter__"===b||"__defineSetter__"===b||"__lookupGetter__"===b||"__lookupSetter__"===b||"__proto__"===b)throw la("isecfld",a);return b}function ma(b,a){if(b){if(b.constructor===b)throw la("isecfn",a);if(b.window===b)throw la("isecwindow", a);if(b.children&&(b.nodeName||b.prop&&b.attr&&b.find))throw la("isecdom",a);if(b===Object)throw la("isecobj",a);}return b}function ec(b){return b.constant}function gb(b,a,c,d,e){ma(b,e);ma(a,e);c=c.split(".");for(var f,g=0;1<c.length;g++){f=ta(c.shift(),e);var h=0===g&&a&&a[f]||b[f];h||(h={},b[f]=h);b=ma(h,e)}f=ta(c.shift(),e);ma(b[f],e);return b[f]=d}function Qa(b){return"constructor"==b}function ed(b,a,c,d,e,f,g){ta(b,f);ta(a,f);ta(c,f);ta(d,f);ta(e,f);var h=function(a){return ma(a,f)},l=g||Qa(b)? h:pa,k=g||Qa(a)?h:pa,m=g||Qa(c)?h:pa,n=g||Qa(d)?h:pa,q=g||Qa(e)?h:pa;return function(f,g){var h=g&&g.hasOwnProperty(b)?g:f;if(null==h)return h;h=l(h[b]);if(!a)return h;if(null==h)return t;h=k(h[a]);if(!c)return h;if(null==h)return t;h=m(h[c]);if(!d)return h;if(null==h)return t;h=n(h[d]);return e?null==h?t:h=q(h[e]):h}}function yf(b,a){return function(c,d){return b(c,d,ma,a)}}function zf(b,a,c){var d=a.expensiveChecks,e=d?Af:Bf,f=e[b];if(f)return f;var g=b.split("."),h=g.length;if(a.csp)f=6>h?ed(g[0], g[1],g[2],g[3],g[4],c,d):function(a,b){var e=0,f;do f=ed(g[e++],g[e++],g[e++],g[e++],g[e++],c,d)(a,b),b=t,a=f;while(e<h);return f};else{var l="";d&&(l+="s = eso(s, fe);\nl = eso(l, fe);\n");var k=d;s(g,function(a,b){ta(a,c);var e=(b?"s":'((l&&l.hasOwnProperty("'+a+'"))?l:s)')+"."+a;if(d||Qa(a))e="eso("+e+", fe)",k=!0;l+="if(s == null) return undefined;\ns="+e+";\n"});l+="return s;";a=new Function("s","l","eso","fe",l);a.toString=da(l);k&&(a=yf(a,c));f=a}f.sharedGetter=!0;f.assign=function(a,c,d){return gb(a, d,b,c,b)};return e[b]=f}function fc(b){return G(b.valueOf)?b.valueOf():Cf.call(b)}function Oe(){var b=ha(),a=ha();this.$get=["$filter","$sniffer",function(c,d){function e(a){var b=a;a.sharedGetter&&(b=function(b,c){return a(b,c)},b.literal=a.literal,b.constant=a.constant,b.assign=a.assign);return b}function f(a,b){for(var c=0,d=a.length;c<d;c++){var e=a[c];e.constant||(e.inputs?f(e.inputs,b):-1===b.indexOf(e)&&b.push(e))}return b}function g(a,b){return null==a||null==b?a===b:"object"===typeof a&& (a=fc(a),"object"===typeof a)?!1:a===b||a!==a&&b!==b}function h(a,b,c,d){var e=d.$$inputs||(d.$$inputs=f(d.inputs,[])),h;if(1===e.length){var l=g,e=e[0];return a.$watch(function(a){var b=e(a);g(b,l)||(h=d(a),l=b&&fc(b));return h},b,c)}for(var k=[],q=0,n=e.length;q<n;q++)k[q]=g;return a.$watch(function(a){for(var b=!1,c=0,f=e.length;c<f;c++){var l=e[c](a);if(b||(b=!g(l,k[c])))k[c]=l&&fc(l)}b&&(h=d(a));return h},b,c)}function l(a,b,c,d){var e,f;return e=a.$watch(function(a){return d(a)},function(a, c,d){f=a;G(b)&&b.apply(this,arguments);y(a)&&d.$$postDigest(function(){y(f)&&e()})},c)}function k(a,b,c,d){function e(a){var b=!0;s(a,function(a){y(a)||(b=!1)});return b}var f,g;return f=a.$watch(function(a){return d(a)},function(a,c,d){g=a;G(b)&&b.call(this,a,c,d);e(a)&&d.$$postDigest(function(){e(g)&&f()})},c)}function m(a,b,c,d){var e;return e=a.$watch(function(a){return d(a)},function(a,c,d){G(b)&&b.apply(this,arguments);e()},c)}function n(a,b){if(!b)return a;var c=a.$$watchDelegate,c=c!==k&& c!==l?function(c,d){var e=a(c,d);return b(e,c,d)}:function(c,d){var e=a(c,d),f=b(e,c,d);return y(e)?f:e};a.$$watchDelegate&&a.$$watchDelegate!==h?c.$$watchDelegate=a.$$watchDelegate:b.$stateful||(c.$$watchDelegate=h,c.inputs=[a]);return c}var q={csp:d.csp,expensiveChecks:!1},u={csp:d.csp,expensiveChecks:!0};return function(d,f,g){var v,w,L;switch(typeof d){case "string":L=d=d.trim();var C=g?a:b;v=C[L];v||(":"===d.charAt(0)&&":"===d.charAt(1)&&(w=!0,d=d.substring(2)),g=g?u:q,v=new gc(g),v=(new hb(v, c,g)).parse(d),v.constant?v.$$watchDelegate=m:w?(v=e(v),v.$$watchDelegate=v.literal?k:l):v.inputs&&(v.$$watchDelegate=h),C[L]=v);return n(v,f);case "function":return n(d,f);default:return n(H,f)}}}]}function Qe(){this.$get=["$rootScope","$exceptionHandler",function(b,a){return fd(function(a){b.$evalAsync(a)},a)}]}function Re(){this.$get=["$browser","$exceptionHandler",function(b,a){return fd(function(a){b.defer(a)},a)}]}function fd(b,a){function c(a,b,c){function d(b){return function(c){e||(e=!0, b.call(a,c))}}var e=!1;return[d(b),d(c)]}function d(){this.$$state={status:0}}function e(a,b){return function(c){b.call(a,c)}}function f(c){!c.processScheduled&&c.pending&&(c.processScheduled=!0,b(function(){var b,d,e;e=c.pending;c.processScheduled=!1;c.pending=t;for(var f=0,g=e.length;f<g;++f){d=e[f][0];b=e[f][c.status];try{G(b)?d.resolve(b(c.value)):1===c.status?d.resolve(c.value):d.reject(c.value)}catch(h){d.reject(h),a(h)}}}))}function g(){this.promise=new d;this.resolve=e(this,this.resolve); this.reject=e(this,this.reject);this.notify=e(this,this.notify)}var h=T("$q",TypeError);d.prototype={then:function(a,b,c){var d=new g;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,a,b,c]);0<this.$$state.status&&f(this.$$state);return d.promise},"catch":function(a){return this.then(null,a)},"finally":function(a,b){return this.then(function(b){return k(b,!0,a)},function(b){return k(b,!1,a)},b)}};g.prototype={resolve:function(a){this.promise.$$state.status||(a===this.promise? this.$$reject(h("qcycle",a)):this.$$resolve(a))},$$resolve:function(b){var d,e;e=c(this,this.$$resolve,this.$$reject);try{if(I(b)||G(b))d=b&&b.then;G(d)?(this.promise.$$state.status=-1,d.call(b,e[0],e[1],this.notify)):(this.promise.$$state.value=b,this.promise.$$state.status=1,f(this.promise.$$state))}catch(g){e[1](g),a(g)}},reject:function(a){this.promise.$$state.status||this.$$reject(a)},$$reject:function(a){this.promise.$$state.value=a;this.promise.$$state.status=2;f(this.promise.$$state)},notify:function(c){var d= this.promise.$$state.pending;0>=this.promise.$$state.status&&d&&d.length&&b(function(){for(var b,e,f=0,g=d.length;f<g;f++){e=d[f][0];b=d[f][3];try{e.notify(G(b)?b(c):c)}catch(h){a(h)}}})}};var l=function(a,b){var c=new g;b?c.resolve(a):c.reject(a);return c.promise},k=function(a,b,c){var d=null;try{G(c)&&(d=c())}catch(e){return l(e,!1)}return d&&G(d.then)?d.then(function(){return l(a,b)},function(a){return l(a,!1)}):l(a,b)},m=function(a,b,c,d){var e=new g;e.resolve(a);return e.promise.then(b,c,d)}, n=function u(a){if(!G(a))throw h("norslvr",a);if(!(this instanceof u))return new u(a);var b=new g;a(function(a){b.resolve(a)},function(a){b.reject(a)});return b.promise};n.defer=function(){return new g};n.reject=function(a){var b=new g;b.reject(a);return b.promise};n.when=m;n.all=function(a){var b=new g,c=0,d=D(a)?[]:{};s(a,function(a,e){c++;m(a).then(function(a){d.hasOwnProperty(e)||(d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});0===c&&b.resolve(d);return b.promise}; return n}function $e(){this.$get=["$window","$timeout",function(b,a){var c=b.requestAnimationFrame||b.webkitRequestAnimationFrame,d=b.cancelAnimationFrame||b.webkitCancelAnimationFrame||b.webkitCancelRequestAnimationFrame,e=!!c,f=e?function(a){var b=c(a);return function(){d(b)}}:function(b){var c=a(b,16.66,!1);return function(){a.cancel(c)}};f.supported=e;return f}]}function Pe(){var b=10,a=T("$rootScope"),c=null,d=null;this.digestTtl=function(a){arguments.length&&(b=a);return b};this.$get=["$injector", "$exceptionHandler","$parse","$browser",function(e,f,g,h){function l(){this.$id=++nb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=this;this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$isolateBindings=null}function k(b){if(r.$$phase)throw a("inprog",r.$$phase);r.$$phase=b}function m(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function n(){} function q(){for(;v.length;)try{v.shift()()}catch(a){f(a)}d=null}function u(){null===d&&(d=h.defer(function(){r.$apply(q)}))}l.prototype={constructor:l,$new:function(a,b){function c(){d.$$destroyed=!0}var d;b=b||this;a?(d=new l,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=function(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$id=++nb;this.$$ChildScope=null},this.$$ChildScope.prototype=this),d=new this.$$ChildScope); d.$parent=b;d.$$prevSibling=b.$$childTail;b.$$childHead?(b.$$childTail.$$nextSibling=d,b.$$childTail=d):b.$$childHead=b.$$childTail=d;(a||b!=this)&&d.$on("$destroy",c);return d},$watch:function(a,b,d){var e=g(a);if(e.$$watchDelegate)return e.$$watchDelegate(this,b,d,e);var f=this.$$watchers,h={fn:b,last:n,get:e,exp:a,eq:!!d};c=null;G(b)||(h.fn=H);f||(f=this.$$watchers=[]);f.unshift(h);return function(){Xa(f,h);c=null}},$watchGroup:function(a,b){function c(){h=!1;l?(l=!1,b(e,e,g)):b(e,d,g)}var d=Array(a.length), e=Array(a.length),f=[],g=this,h=!1,l=!0;if(!a.length){var k=!0;g.$evalAsync(function(){k&&b(e,e,g)});return function(){k=!1}}if(1===a.length)return this.$watch(a[0],function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});s(a,function(a,b){var l=g.$watch(a,function(a,f){e[b]=a;d[b]=f;h||(h=!0,g.$evalAsync(c))});f.push(l)});return function(){for(;f.length;)f.shift()()}},$watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!A(e)){if(I(e))if(Ta(e))for(f!==q&&(f=q,u=f.length=0,k++),a=e.length,u!== a&&(k++,f.length=u=a),b=0;b<a;b++)h=f[b],g=e[b],d=h!==h&&g!==g,d||h===g||(k++,f[b]=g);else{f!==m&&(f=m={},u=0,k++);a=0;for(b in e)e.hasOwnProperty(b)&&(a++,g=e[b],h=f[b],b in f?(d=h!==h&&g!==g,d||h===g||(k++,f[b]=g)):(u++,f[b]=g,k++));if(u>a)for(b in k++,f)e.hasOwnProperty(b)||(u--,delete f[b])}else f!==e&&(f=e,k++);return k}}c.$stateful=!0;var d=this,e,f,h,l=1<b.length,k=0,n=g(a,c),q=[],m={},p=!0,u=0;return this.$watch(n,function(){p?(p=!1,b(e,e,d)):b(e,h,d);if(l)if(I(e))if(Ta(e)){h=Array(e.length); for(var a=0;a<e.length;a++)h[a]=e[a]}else for(a in h={},e)rc.call(e,a)&&(h[a]=e[a]);else h=e})},$digest:function(){var e,g,l,m,u,v,s=b,t,W=[],y,J;k("$digest");h.$$checkUrlChange();this===r&&null!==d&&(h.defer.cancel(d),q());c=null;do{v=!1;for(t=this;O.length;){try{J=O.shift(),J.scope.$eval(J.expression,J.locals)}catch(B){f(B)}c=null}a:do{if(m=t.$$watchers)for(u=m.length;u--;)try{if(e=m[u])if((g=e.get(t))!==(l=e.last)&&!(e.eq?fa(g,l):"number"===typeof g&&"number"===typeof l&&isNaN(g)&&isNaN(l)))v= !0,c=e,e.last=e.eq?Ea(g,null):g,e.fn(g,l===n?g:l,t),5>s&&(y=4-s,W[y]||(W[y]=[]),W[y].push({msg:G(e.exp)?"fn: "+(e.exp.name||e.exp.toString()):e.exp,newVal:g,oldVal:l}));else if(e===c){v=!1;break a}}catch(A){f(A)}if(!(m=t.$$childHead||t!==this&&t.$$nextSibling))for(;t!==this&&!(m=t.$$nextSibling);)t=t.$parent}while(t=m);if((v||O.length)&&!s--)throw r.$$phase=null,a("infdig",b,W);}while(v||O.length);for(r.$$phase=null;p.length;)try{p.shift()()}catch(ca){f(ca)}},$destroy:function(){if(!this.$$destroyed){var a= this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;if(this!==r){for(var b in this.$$listenerCount)m(this,this.$$listenerCount[b],b);a.$$childHead==this&&(a.$$childHead=this.$$nextSibling);a.$$childTail==this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=H;this.$on=this.$watch=this.$watchGroup= function(){return H};this.$$listeners={};this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=this.$$watchers=null}}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){r.$$phase||O.length||h.defer(function(){O.length&&r.$digest()});O.push({scope:this,expression:a,locals:b})},$$postDigest:function(a){p.push(a)},$apply:function(a){try{return k("$apply"),this.$eval(a)}catch(b){f(b)}finally{r.$$phase=null;try{r.$digest()}catch(c){throw f(c),c; }}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&v.push(b);u()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,m(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,g=!1,h={name:a,targetScope:e,stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1}, l=Ya([h],arguments,1),k,m;do{d=e.$$listeners[a]||c;h.currentScope=e;k=0;for(m=d.length;k<m;k++)if(d[k])try{d[k].apply(null,l)}catch(n){f(n)}else d.splice(k,1),k--,m--;if(g)return h.currentScope=null,h;e=e.$parent}while(e);h.currentScope=null;return h},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var g=Ya([e],arguments,1),h,l;c=d;){e.currentScope=c;d=c.$$listeners[a]|| [];h=0;for(l=d.length;h<l;h++)if(d[h])try{d[h].apply(null,g)}catch(k){f(k)}else d.splice(h,1),h--,l--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=null;return e}};var r=new l,O=r.$$asyncQueue=[],p=r.$$postDigestQueue=[],v=r.$$applyAsyncQueue=[];return r}]}function Sd(){var b=/^\s*(https?|ftp|mailto|tel|file):/,a=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(a){return y(a)? (b=a,this):b};this.imgSrcSanitizationWhitelist=function(b){return y(b)?(a=b,this):a};this.$get=function(){return function(c,d){var e=d?a:b,f;f=Ba(c).href;return""===f||f.match(e)?c:"unsafe:"+f}}}function Df(b){if("self"===b)return b;if(F(b)){if(-1<b.indexOf("***"))throw Ca("iwcard",b);b=gd(b).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*");return new RegExp("^"+b+"$")}if(ob(b))return new RegExp("^"+b.source+"$");throw Ca("imatcher");}function hd(b){var a=[];y(b)&&s(b,function(b){a.push(Df(b))}); return a}function Te(){this.SCE_CONTEXTS=na;var b=["self"],a=[];this.resourceUrlWhitelist=function(a){arguments.length&&(b=hd(a));return b};this.resourceUrlBlacklist=function(b){arguments.length&&(a=hd(b));return a};this.$get=["$injector",function(c){function d(a,b){return"self"===a?Zc(b):!!a.exec(b.href)}function e(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()}; return b}var f=function(a){throw Ca("unsafe");};c.has("$sanitize")&&(f=c.get("$sanitize"));var g=e(),h={};h[na.HTML]=e(g);h[na.CSS]=e(g);h[na.URL]=e(g);h[na.JS]=e(g);h[na.RESOURCE_URL]=e(h[na.URL]);return{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw Ca("icontext",a,b);if(null===b||b===t||""===b)return b;if("string"!==typeof b)throw Ca("itype",a);return new c(b)},getTrusted:function(c,e){if(null===e||e===t||""===e)return e;var g=h.hasOwnProperty(c)?h[c]:null;if(g&&e instanceof g)return e.$$unwrapTrustedValue();if(c===na.RESOURCE_URL){var g=Ba(e.toString()),n,q,u=!1;n=0;for(q=b.length;n<q;n++)if(d(b[n],g)){u=!0;break}if(u)for(n=0,q=a.length;n<q;n++)if(d(a[n],g)){u=!1;break}if(u)return e;throw Ca("insecurl",e.toString());}if(c===na.HTML)return f(e);throw Ca("unsafe");},valueOf:function(a){return a instanceof g?a.$$unwrapTrustedValue():a}}}]}function Se(){var b=!0;this.enabled=function(a){arguments.length&&(b=!!a);return b};this.$get=["$parse","$sceDelegate",function(a,c){if(b&& 8>Ra)throw Ca("iequirks");var d=ra(na);d.isEnabled=function(){return b};d.trustAs=c.trustAs;d.getTrusted=c.getTrusted;d.valueOf=c.valueOf;b||(d.trustAs=d.getTrusted=function(a,b){return b},d.valueOf=pa);d.parseAs=function(b,c){var e=a(c);return e.literal&&e.constant?e:a(c,function(a){return d.getTrusted(b,a)})};var e=d.parseAs,f=d.getTrusted,g=d.trustAs;s(na,function(a,b){var c=Q(b);d[cb("parse_as_"+c)]=function(b){return e(a,b)};d[cb("get_trusted_"+c)]=function(b){return f(a,b)};d[cb("trust_as_"+ c)]=function(b){return g(a,b)}});return d}]}function Ue(){this.$get=["$window","$document",function(b,a){var c={},d=ba((/android (\d+)/.exec(Q((b.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||{}).userAgent),f=a[0]||{},g,h=/^(Moz|webkit|ms)(?=[A-Z])/,l=f.body&&f.body.style,k=!1,m=!1;if(l){for(var n in l)if(k=h.exec(n)){g=k[0];g=g.substr(0,1).toUpperCase()+g.substr(1);break}g||(g="WebkitOpacity"in l&&"webkit");k=!!("transition"in l||g+"Transition"in l);m=!!("animation"in l||g+"Animation"in l);!d||k&&m||(k=F(f.body.style.webkitTransition),m=F(f.body.style.webkitAnimation))}return{history:!(!b.history||!b.history.pushState||4>d||e),hasEvent:function(a){if("input"===a&&11>=Ra)return!1;if(A(c[a])){var b=f.createElement("div");c[a]="on"+a in b}return c[a]},csp:ab(),vendorPrefix:g,transitions:k,animations:m,android:d}}]}function We(){this.$get=["$templateCache","$http","$q",function(b,a,c){function d(e,f){d.totalPendingRequests++;var g=a.defaults&&a.defaults.transformResponse;D(g)?g=g.filter(function(a){return a!== Yb}):g===Yb&&(g=null);return a.get(e,{cache:b,transformResponse:g}).finally(function(){d.totalPendingRequests--}).then(function(a){return a.data},function(a){if(!f)throw ja("tpload",e);return c.reject(a)})}d.totalPendingRequests=0;return d}]}function Xe(){this.$get=["$rootScope","$browser","$location",function(b,a,c){return{findBindings:function(a,b,c){a=a.getElementsByClassName("ng-binding");var g=[];s(a,function(a){var d=ga.element(a).data("$binding");d&&s(d,function(d){c?(new RegExp("(^|\\s)"+ gd(b)+"(\\s|\\||$)")).test(d)&&g.push(a):-1!=d.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,c){for(var g=["ng-","data-ng-","ng\\:"],h=0;h<g.length;++h){var l=a.querySelectorAll("["+g[h]+"model"+(c?"=":"*=")+'"'+b+'"]');if(l.length)return l}},getLocation:function(){return c.url()},setLocation:function(a){a!==c.url()&&(c.url(a),b.$digest())},whenStable:function(b){a.notifyWhenNoOutstandingRequests(b)}}}]}function Ye(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler", function(b,a,c,d,e){function f(f,l,k){var m=y(k)&&!k,n=(m?d:c).defer(),q=n.promise;l=a.defer(function(){try{n.resolve(f())}catch(a){n.reject(a),e(a)}finally{delete g[q.$$timeoutId]}m||b.$apply()},l);q.$$timeoutId=l;g[l]=n;return q}var g={};f.cancel=function(b){return b&&b.$$timeoutId in g?(g[b.$$timeoutId].reject("canceled"),delete g[b.$$timeoutId],a.defer.cancel(b.$$timeoutId)):!1};return f}]}function Ba(b){Ra&&(Z.setAttribute("href",b),b=Z.href);Z.setAttribute("href",b);return{href:Z.href,protocol:Z.protocol? Z.protocol.replace(/:$/,""):"",host:Z.host,search:Z.search?Z.search.replace(/^\?/,""):"",hash:Z.hash?Z.hash.replace(/^#/,""):"",hostname:Z.hostname,port:Z.port,pathname:"/"===Z.pathname.charAt(0)?Z.pathname:"/"+Z.pathname}}function Zc(b){b=F(b)?Ba(b):b;return b.protocol===id.protocol&&b.host===id.host}function Ze(){this.$get=da(M)}function Dc(b){function a(c,d){if(I(c)){var e={};s(c,function(b,c){e[c]=a(c,b)});return e}return b.factory(c+"Filter",d)}this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+ "Filter")}}];a("currency",jd);a("date",kd);a("filter",Ef);a("json",Ff);a("limitTo",Gf);a("lowercase",Hf);a("number",ld);a("orderBy",md);a("uppercase",If)}function Ef(){return function(b,a,c){if(!D(b))return b;var d;switch(typeof a){case "function":break;case "boolean":case "number":case "string":d=!0;case "object":a=Jf(a,c,d);break;default:return b}return b.filter(a)}}function Jf(b,a,c){var d=I(b)&&"$"in b;!0===a?a=fa:G(a)||(a=function(a,b){if(I(a)||I(b))return!1;a=Q(""+a);b=Q(""+b);return-1!==a.indexOf(b)}); return function(e){return d&&!I(e)?Ia(e,b.$,a,!1):Ia(e,b,a,c)}}function Ia(b,a,c,d,e){var f=typeof b,g=typeof a;if("string"===g&&"!"===a.charAt(0))return!Ia(b,a.substring(1),c,d);if(D(b))return b.some(function(b){return Ia(b,a,c,d)});switch(f){case "object":var h;if(d){for(h in b)if("$"!==h.charAt(0)&&Ia(b[h],a,c,!0))return!0;return e?!1:Ia(b,a,c,!1)}if("object"===g){for(h in a)if(e=a[h],!G(e)&&(f="$"===h,!Ia(f?b:b[h],e,c,f,f)))return!1;return!0}return c(b,a);case "function":return!1;default:return c(b, a)}}function jd(b){var a=b.NUMBER_FORMATS;return function(b,d,e){A(d)&&(d=a.CURRENCY_SYM);A(e)&&(e=a.PATTERNS[1].maxFrac);return null==b?b:nd(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,e).replace(/\u00A4/g,d)}}function ld(b){var a=b.NUMBER_FORMATS;return function(b,d){return null==b?b:nd(b,a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function nd(b,a,c,d,e){if(!isFinite(b)||I(b))return"";var f=0>b;b=Math.abs(b);var g=b+"",h="",l=[],k=!1;if(-1!==g.indexOf("e")){var m=g.match(/([\d\.]+)e(-?)(\d+)/);m&& "-"==m[2]&&m[3]>e+1?b=0:(h=g,k=!0)}if(k)0<e&&1>b&&(h=b.toFixed(e),b=parseFloat(h));else{g=(g.split(od)[1]||"").length;A(e)&&(e=Math.min(Math.max(a.minFrac,g),a.maxFrac));b=+(Math.round(+(b.toString()+"e"+e)).toString()+"e"+-e);var g=(""+b).split(od),k=g[0],g=g[1]||"",n=0,q=a.lgSize,u=a.gSize;if(k.length>=q+u)for(n=k.length-q,m=0;m<n;m++)0===(n-m)%u&&0!==m&&(h+=c),h+=k.charAt(m);for(m=n;m<k.length;m++)0===(k.length-m)%q&&0!==m&&(h+=c),h+=k.charAt(m);for(;g.length<e;)g+="0";e&&"0"!==e&&(h+=d+g.substr(0, e))}0===b&&(f=!1);l.push(f?a.negPre:a.posPre,h,f?a.negSuf:a.posSuf);return l.join("")}function Hb(b,a,c){var d="";0>b&&(d="-",b=-b);for(b=""+b;b.length<a;)b="0"+b;c&&(b=b.substr(b.length-a));return d+b}function $(b,a,c,d){c=c||0;return function(e){e=e["get"+b]();if(0<c||e>-c)e+=c;0===e&&-12==c&&(e=12);return Hb(e,a,d)}}function Ib(b,a){return function(c,d){var e=c["get"+b](),f=ub(a?"SHORT"+b:b);return d[f][e]}}function pd(b){var a=(new Date(b,0,1)).getDay();return new Date(b,0,(4>=a?5:12)-a)}function qd(b){return function(a){var c= pd(a.getFullYear());a=+new Date(a.getFullYear(),a.getMonth(),a.getDate()+(4-a.getDay()))-+c;a=1+Math.round(a/6048E5);return Hb(a,b)}}function kd(b){function a(a){var b;if(b=a.match(c)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,l=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=ba(b[9]+b[10]),g=ba(b[9]+b[11]));h.call(a,ba(b[1]),ba(b[2])-1,ba(b[3]));f=ba(b[4]||0)-f;g=ba(b[5]||0)-g;h=ba(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));l.call(a,f,g,h,b)}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; return function(c,e,f){var g="",h=[],l,k;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;F(c)&&(c=Kf.test(c)?ba(c):a(c));V(c)&&(c=new Date(c));if(!qa(c))return c;for(;e;)(k=Lf.exec(e))?(h=Ya(h,k,1),e=h.pop()):(h.push(e),e=null);f&&"UTC"===f&&(c=new Date(c.getTime()),c.setMinutes(c.getMinutes()+c.getTimezoneOffset()));s(h,function(a){l=Mf[a];g+=l?l(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function Ff(){return function(b,a){A(a)&&(a=2);return $a(b,a)}}function Gf(){return function(b, a){V(b)&&(b=b.toString());return D(b)||F(b)?(a=Infinity===Math.abs(Number(a))?Number(a):ba(a))?0<a?b.slice(0,a):b.slice(a):F(b)?"":[]:b}}function md(b){return function(a,c,d){function e(a,b){return b?function(b,c){return a(c,b)}:a}function f(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}function g(a){return null===a?"null":"function"===typeof a.valueOf&&(a=a.valueOf(),f(a))||"function"===typeof a.toString&&(a=a.toString(),f(a))?a:""}function h(a,b){var c= typeof a,d=typeof b;c===d&&"object"===c&&(a=g(a),b=g(b));return c===d?("string"===c&&(a=a.toLowerCase(),b=b.toLowerCase()),a===b?0:a<b?-1:1):c<d?-1:1}if(!Ta(a))return a;c=D(c)?c:[c];0===c.length&&(c=["+"]);c=c.map(function(a){var c=!1,d=a||pa;if(F(a)){if("+"==a.charAt(0)||"-"==a.charAt(0))c="-"==a.charAt(0),a=a.substring(1);if(""===a)return e(h,c);d=b(a);if(d.constant){var f=d();return e(function(a,b){return h(a[f],b[f])},c)}}return e(function(a,b){return h(d(a),d(b))},c)});return Za.call(a).sort(e(function(a, b){for(var d=0;d<c.length;d++){var e=c[d](a,b);if(0!==e)return e}return 0},d))}}function Ja(b){G(b)&&(b={link:b});b.restrict=b.restrict||"AC";return da(b)}function rd(b,a,c,d,e){var f=this,g=[],h=f.$$parentForm=b.parent().controller("form")||Jb;f.$error={};f.$$success={};f.$pending=t;f.$name=e(a.name||a.ngForm||"")(c);f.$dirty=!1;f.$pristine=!0;f.$valid=!0;f.$invalid=!1;f.$submitted=!1;h.$addControl(f);f.$rollbackViewValue=function(){s(g,function(a){a.$rollbackViewValue()})};f.$commitViewValue=function(){s(g, function(a){a.$commitViewValue()})};f.$addControl=function(a){Ma(a.$name,"input");g.push(a);a.$name&&(f[a.$name]=a)};f.$$renameControl=function(a,b){var c=a.$name;f[c]===a&&delete f[c];f[b]=a;a.$name=b};f.$removeControl=function(a){a.$name&&f[a.$name]===a&&delete f[a.$name];s(f.$pending,function(b,c){f.$setValidity(c,null,a)});s(f.$error,function(b,c){f.$setValidity(c,null,a)});s(f.$$success,function(b,c){f.$setValidity(c,null,a)});Xa(g,a)};sd({ctrl:this,$element:b,set:function(a,b,c){var d=a[b]; d?-1===d.indexOf(c)&&d.push(c):a[b]=[c]},unset:function(a,b,c){var d=a[b];d&&(Xa(d,c),0===d.length&&delete a[b])},parentForm:h,$animate:d});f.$setDirty=function(){d.removeClass(b,Sa);d.addClass(b,Kb);f.$dirty=!0;f.$pristine=!1;h.$setDirty()};f.$setPristine=function(){d.setClass(b,Sa,Kb+" ng-submitted");f.$dirty=!1;f.$pristine=!0;f.$submitted=!1;s(g,function(a){a.$setPristine()})};f.$setUntouched=function(){s(g,function(a){a.$setUntouched()})};f.$setSubmitted=function(){d.addClass(b,"ng-submitted"); f.$submitted=!0;h.$setSubmitted()}}function hc(b){b.$formatters.push(function(a){return b.$isEmpty(a)?a:a.toString()})}function ib(b,a,c,d,e,f){var g=Q(a[0].type);if(!e.android){var h=!1;a.on("compositionstart",function(a){h=!0});a.on("compositionend",function(){h=!1;l()})}var l=function(b){k&&(f.defer.cancel(k),k=null);if(!h){var e=a.val();b=b&&b.type;"password"===g||c.ngTrim&&"false"===c.ngTrim||(e=U(e));(d.$viewValue!==e||""===e&&d.$$hasNativeValidators)&&d.$setViewValue(e,b)}};if(e.hasEvent("input"))a.on("input", l);else{var k,m=function(a,b,c){k||(k=f.defer(function(){k=null;b&&b.value===c||l(a)}))};a.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&19>b||37<=b&&40>=b||m(a,this,this.value)});if(e.hasEvent("paste"))a.on("paste cut",m)}a.on("change",l);d.$render=function(){a.val(d.$isEmpty(d.$viewValue)?"":d.$viewValue)}}function Lb(b,a){return function(c,d){var e,f;if(qa(c))return c;if(F(c)){'"'==c.charAt(0)&&'"'==c.charAt(c.length-1)&&(c=c.substring(1,c.length-1));if(Nf.test(c))return new Date(c);b.lastIndex= 0;if(e=b.exec(c))return e.shift(),f=d?{yyyy:d.getFullYear(),MM:d.getMonth()+1,dd:d.getDate(),HH:d.getHours(),mm:d.getMinutes(),ss:d.getSeconds(),sss:d.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},s(e,function(b,c){c<a.length&&(f[a[c]]=+b)}),new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0)}return NaN}}function jb(b,a,c,d){return function(e,f,g,h,l,k,m){function n(a){return a&&!(a.getTime&&a.getTime()!==a.getTime())}function q(a){return y(a)?qa(a)?a:c(a):t}td(e,f,g,h); ib(e,f,g,h,l,k);var u=h&&h.$options&&h.$options.timezone,r;h.$$parserName=b;h.$parsers.push(function(b){return h.$isEmpty(b)?null:a.test(b)?(b=c(b,r),"UTC"===u&&b.setMinutes(b.getMinutes()-b.getTimezoneOffset()),b):t});h.$formatters.push(function(a){if(a&&!qa(a))throw Mb("datefmt",a);if(n(a)){if((r=a)&&"UTC"===u){var b=6E4*r.getTimezoneOffset();r=new Date(r.getTime()+b)}return m("date")(a,d,u)}r=null;return""});if(y(g.min)||g.ngMin){var s;h.$validators.min=function(a){return!n(a)||A(s)||c(a)>=s}; g.$observe("min",function(a){s=q(a);h.$validate()})}if(y(g.max)||g.ngMax){var p;h.$validators.max=function(a){return!n(a)||A(p)||c(a)<=p};g.$observe("max",function(a){p=q(a);h.$validate()})}}}function td(b,a,c,d){(d.$$hasNativeValidators=I(a[0].validity))&&d.$parsers.push(function(b){var c=a.prop("validity")||{};return c.badInput&&!c.typeMismatch?t:b})}function ud(b,a,c,d,e){if(y(d)){b=b(d);if(!b.constant)throw T("ngModel")("constexpr",c,d);return b(a)}return e}function ic(b,a){b="ngClass"+b;return["$animate", function(c){function d(a,b){var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],m=0;m<b.length;m++)if(e==b[m])continue a;c.push(e)}return c}function e(a){if(!D(a)){if(F(a))return a.split(" ");if(I(a)){var b=[];s(a,function(a,c){a&&(b=b.concat(c.split(" ")))});return b}}return a}return{restrict:"AC",link:function(f,g,h){function l(a,b){var c=g.data("$classCounts")||{},d=[];s(a,function(a){if(0<b||c[a])c[a]=(c[a]||0)+b,c[a]===+(0<b)&&d.push(a)});g.data("$classCounts",c);return d.join(" ")}function k(b){if(!0=== a||f.$index%2===a){var k=e(b||[]);if(!m){var u=l(k,1);h.$addClass(u)}else if(!fa(b,m)){var r=e(m),u=d(k,r),k=d(r,k),u=l(u,1),k=l(k,-1);u&&u.length&&c.addClass(g,u);k&&k.length&&c.removeClass(g,k)}}m=ra(b)}var m;f.$watch(h[b],k,!0);h.$observe("class",function(a){k(f.$eval(h[b]))});"ngClass"!==b&&f.$watch("$index",function(c,d){var g=c&1;if(g!==(d&1)){var k=e(f.$eval(h[b]));g===a?(g=l(k,1),h.$addClass(g)):(g=l(k,-1),h.$removeClass(g))}})}}}]}function sd(b){function a(a,b){b&&!f[a]?(k.addClass(e,a), f[a]=!0):!b&&f[a]&&(k.removeClass(e,a),f[a]=!1)}function c(b,c){b=b?"-"+tc(b,"-"):"";a(kb+b,!0===c);a(vd+b,!1===c)}var d=b.ctrl,e=b.$element,f={},g=b.set,h=b.unset,l=b.parentForm,k=b.$animate;f[vd]=!(f[kb]=e.hasClass(kb));d.$setValidity=function(b,e,f){e===t?(d.$pending||(d.$pending={}),g(d.$pending,b,f)):(d.$pending&&h(d.$pending,b,f),wd(d.$pending)&&(d.$pending=t));Wa(e)?e?(h(d.$error,b,f),g(d.$$success,b,f)):(g(d.$error,b,f),h(d.$$success,b,f)):(h(d.$error,b,f),h(d.$$success,b,f));d.$pending?(a(xd, !0),d.$valid=d.$invalid=t,c("",null)):(a(xd,!1),d.$valid=wd(d.$error),d.$invalid=!d.$valid,c("",d.$valid));e=d.$pending&&d.$pending[b]?t:d.$error[b]?!1:d.$$success[b]?!0:null;c(b,e);l.$setValidity(b,e,d)}}function wd(b){if(b)for(var a in b)return!1;return!0}var Of=/^\/(.+)\/([a-z]*)$/,Q=function(b){return F(b)?b.toLowerCase():b},rc=Object.prototype.hasOwnProperty,ub=function(b){return F(b)?b.toUpperCase():b},Ra,B,sa,Za=[].slice,rf=[].splice,Pf=[].push,Da=Object.prototype.toString,Ka=T("ng"),ga=M.angular|| (M.angular={}),bb,nb=0;Ra=Y.documentMode;H.$inject=[];pa.$inject=[];var D=Array.isArray,U=function(b){return F(b)?b.trim():b},gd=function(b){return b.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},ab=function(){if(y(ab.isActive_))return ab.isActive_;var b=!(!Y.querySelector("[ng-csp]")&&!Y.querySelector("[data-ng-csp]"));if(!b)try{new Function("")}catch(a){b=!0}return ab.isActive_=b},rb=["ng-","data-ng-","ng:","x-ng-"],Md=/[A-Z]/g,uc=!1,Pb,oa=1,pb=3,Qd={full:"1.3.10",major:1, minor:3,dot:10,codeName:"heliotropic-sundial"};R.expando="ng339";var zb=R.cache={},hf=1;R._data=function(b){return this.cache[b[this.expando]]||{}};var cf=/([\:\-\_]+(.))/g,df=/^moz([A-Z])/,Qf={mouseleave:"mouseout",mouseenter:"mouseover"},Sb=T("jqLite"),gf=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Rb=/<|&#?\w+;/,ef=/<([\w:]+)/,ff=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ia={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>", "</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ia.optgroup=ia.option;ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead;ia.th=ia.td;var La=R.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;"complete"===Y.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),R(M).on("load",a))},toString:function(){var b=[];s(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<= b?B(this[b]):B(this[this.length+b])},length:0,push:Pf,sort:[].sort,splice:[].splice},Eb={};s("multiple selected checked disabled readOnly required open".split(" "),function(b){Eb[Q(b)]=b});var Mc={};s("input select option textarea button form details".split(" "),function(b){Mc[b]=!0});var Nc={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};s({data:Ub,removeData:xb},function(b,a){R[a]=b});s({data:Ub,inheritedData:Db,scope:function(b){return B.data(b,"$scope")|| Db(b.parentNode||b,["$isolateScope","$scope"])},isolateScope:function(b){return B.data(b,"$isolateScope")||B.data(b,"$isolateScopeNoTemplate")},controller:Ic,injector:function(b){return Db(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Ab,css:function(b,a,c){a=cb(a);if(y(c))b.style[a]=c;else return b.style[a]},attr:function(b,a,c){var d=Q(a);if(Eb[d])if(y(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||H).specified? d:t;else if(y(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),null===b?t:b},prop:function(b,a,c){if(y(c))b[a]=c;else return b[a]},text:function(){function b(a,b){if(A(b)){var d=a.nodeType;return d===oa||d===pb?a.textContent:""}a.textContent=b}b.$dv="";return b}(),val:function(b,a){if(A(a)){if(b.multiple&&"select"===ua(b)){var c=[];s(b.options,function(a){a.selected&&c.push(a.value||a.text)});return 0===c.length?null:c}return b.value}b.value=a},html:function(b,a){if(A(a))return b.innerHTML; wb(b,!0);b.innerHTML=a},empty:Jc},function(b,a){R.prototype[a]=function(a,d){var e,f,g=this.length;if(b!==Jc&&(2==b.length&&b!==Ab&&b!==Ic?a:d)===t){if(I(a)){for(e=0;e<g;e++)if(b===Ub)b(this[e],a);else for(f in a)b(this[e],f,a[f]);return this}e=b.$dv;g=e===t?Math.min(g,1):g;for(f=0;f<g;f++){var h=b(this[f],a,d);e=e?e+h:h}return e}for(e=0;e<g;e++)b(this[e],a,d);return this}});s({removeData:xb,on:function a(c,d,e,f){if(y(f))throw Sb("onargs");if(Ec(c)){var g=yb(c,!0);f=g.events;var h=g.handle;h||(h= g.handle=lf(c,f));for(var g=0<=d.indexOf(" ")?d.split(" "):[d],l=g.length;l--;){d=g[l];var k=f[d];k||(f[d]=[],"mouseenter"===d||"mouseleave"===d?a(c,Qf[d],function(a){var c=a.relatedTarget;c&&(c===this||this.contains(c))||h(a,d)}):"$destroy"!==d&&c.addEventListener(d,h,!1),k=f[d]);k.push(e)}}},off:Hc,one:function(a,c,d){a=B(a);a.on(c,function f(){a.off(c,d);a.off(c,f)});a.on(c,d)},replaceWith:function(a,c){var d,e=a.parentNode;wb(a);s(new R(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c, a);d=c})},children:function(a){var c=[];s(a.childNodes,function(a){a.nodeType===oa&&c.push(a)});return c},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,c){var d=a.nodeType;if(d===oa||11===d){c=new R(c);for(var d=0,e=c.length;d<e;d++)a.appendChild(c[d])}},prepend:function(a,c){if(a.nodeType===oa){var d=a.firstChild;s(new R(c),function(c){a.insertBefore(c,d)})}},wrap:function(a,c){c=B(c).eq(0).clone()[0];var d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)}, remove:Kc,detach:function(a){Kc(a,!0)},after:function(a,c){var d=a,e=a.parentNode;c=new R(c);for(var f=0,g=c.length;f<g;f++){var h=c[f];e.insertBefore(h,d.nextSibling);d=h}},addClass:Cb,removeClass:Bb,toggleClass:function(a,c,d){c&&s(c.split(" "),function(c){var f=d;A(f)&&(f=!Ab(a,c));(f?Cb:Bb)(a,c)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},find:function(a,c){return a.getElementsByTagName?a.getElementsByTagName(c):[]},clone:Tb, triggerHandler:function(a,c,d){var e,f,g=c.type||c,h=yb(a);if(h=(h=h&&h.events)&&h[g])e={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:H,type:g,target:a},c.type&&(e=z(e,c)),c=ra(h),f=d?[e].concat(d):[e],s(c,function(c){e.isImmediatePropagationStopped()||c.apply(a, f)})}},function(a,c){R.prototype[c]=function(c,e,f){for(var g,h=0,l=this.length;h<l;h++)A(g)?(g=a(this[h],c,e,f),y(g)&&(g=B(g))):Gc(g,a(this[h],c,e,f));return y(g)?g:this};R.prototype.bind=R.prototype.on;R.prototype.unbind=R.prototype.off});db.prototype={put:function(a,c){this[Na(a,this.nextUid)]=c},get:function(a){return this[Na(a,this.nextUid)]},remove:function(a){var c=this[a=Na(a,this.nextUid)];delete this[a];return c}};var Pc=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,nf=/,/,of=/^\s*(_?)(\S+?)\1\s*$/, Oc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ga=T("$injector");Ob.$$annotate=Vb;var Rf=T("$animate"),Ce=["$provide",function(a){this.$$selectors={};this.register=function(c,d){var e=c+"-animation";if(c&&"."!=c.charAt(0))throw Rf("notcsel",c);this.$$selectors[c.substr(1)]=e;a.factory(e,d)};this.classNameFilter=function(a){1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null);return this.$$classNameFilter};this.$get=["$$q","$$asyncCallback","$rootScope",function(a,d,e){function f(d){var f, g=a.defer();g.promise.$$cancelFn=function(){f&&f()};e.$$postDigest(function(){f=d(function(){g.resolve()})});return g.promise}function g(a,c){var d=[],e=[],f=ha();s((a.attr("class")||"").split(/\s+/),function(a){f[a]=!0});s(c,function(a,c){var g=f[c];!1===a&&g?e.push(c):!0!==a||g||d.push(c)});return 0<d.length+e.length&&[d.length?d:null,e.length?e:null]}function h(a,c,d){for(var e=0,f=c.length;e<f;++e)a[c[e]]=d}function l(){m||(m=a.defer(),d(function(){m.resolve();m=null}));return m.promise}function k(a, c){if(ga.isObject(c)){var d=z(c.from||{},c.to||{});a.css(d)}}var m;return{animate:function(a,c,d){k(a,{from:c,to:d});return l()},enter:function(a,c,d,e){k(a,e);d?d.after(a):c.prepend(a);return l()},leave:function(a,c){a.remove();return l()},move:function(a,c,d,e){return this.enter(a,c,d,e)},addClass:function(a,c,d){return this.setClass(a,c,[],d)},$$addClassImmediately:function(a,c,d){a=B(a);c=F(c)?c:D(c)?c.join(" "):"";s(a,function(a){Cb(a,c)});k(a,d);return l()},removeClass:function(a,c,d){return this.setClass(a, [],c,d)},$$removeClassImmediately:function(a,c,d){a=B(a);c=F(c)?c:D(c)?c.join(" "):"";s(a,function(a){Bb(a,c)});k(a,d);return l()},setClass:function(a,c,d,e){var k=this,l=!1;a=B(a);var m=a.data("$$animateClasses");m?e&&m.options&&(m.options=ga.extend(m.options||{},e)):(m={classes:{},options:e},l=!0);e=m.classes;c=D(c)?c:c.split(" ");d=D(d)?d:d.split(" ");h(e,c,!0);h(e,d,!1);l&&(m.promise=f(function(c){var d=a.data("$$animateClasses");a.removeData("$$animateClasses");if(d){var e=g(a,d.classes);e&& k.$$setClassImmediately(a,e[0],e[1],d.options)}c()}),a.data("$$animateClasses",m));return m.promise},$$setClassImmediately:function(a,c,d,e){c&&this.$$addClassImmediately(a,c);d&&this.$$removeClassImmediately(a,d);k(a,e);return l()},enabled:H,cancel:H}}]}],ja=T("$compile");wc.$inject=["$provide","$$sanitizeUriProvider"];var Rc=/^((?:x|data)[\:\-_])/i,Vc="application/json",Zb={"Content-Type":Vc+";charset=utf-8"},tf=/^\[|^\{(?!\{)/,uf={"[":/]$/,"{":/}$/},sf=/^\)\]\}',?\n/,$b=T("$interpolate"),Sf=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/, xf={http:80,https:443,ftp:21},Fb=T("$location"),Tf={$$html5:!1,$$replace:!1,absUrl:Gb("$$absUrl"),url:function(a){if(A(a))return this.$$url;var c=Sf.exec(a);(c[1]||""===a)&&this.path(decodeURIComponent(c[1]));(c[2]||c[1]||""===a)&&this.search(c[3]||"");this.hash(c[5]||"");return this},protocol:Gb("$$protocol"),host:Gb("$$host"),port:Gb("$$port"),path:dd("$$path",function(a){a=null!==a?a.toString():"";return"/"==a.charAt(0)?a:"/"+a}),search:function(a,c){switch(arguments.length){case 0:return this.$$search; case 1:if(F(a)||V(a))a=a.toString(),this.$$search=qc(a);else if(I(a))a=Ea(a,{}),s(a,function(c,e){null==c&&delete a[e]}),this.$$search=a;else throw Fb("isrcharg");break;default:A(c)||null===c?delete this.$$search[a]:this.$$search[a]=c}this.$$compose();return this},hash:dd("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};s([cd,dc,cc],function(a){a.prototype=Object.create(Tf);a.prototype.state=function(c){if(!arguments.length)return this.$$state; if(a!==cc||!this.$$html5)throw Fb("nostate");this.$$state=A(c)?null:c;return this}});var la=T("$parse"),Uf=Function.prototype.call,Vf=Function.prototype.apply,Wf=Function.prototype.bind,lb=ha();s({"null":function(){return null},"true":function(){return!0},"false":function(){return!1},undefined:function(){}},function(a,c){a.constant=a.literal=a.sharedGetter=!0;lb[c]=a});lb["this"]=function(a){return a};lb["this"].sharedGetter=!0;var mb=z(ha(),{"+":function(a,c,d,e){d=d(a,c);e=e(a,c);return y(d)?y(e)? d+e:d:y(e)?e:t},"-":function(a,c,d,e){d=d(a,c);e=e(a,c);return(y(d)?d:0)-(y(e)?e:0)},"*":function(a,c,d,e){return d(a,c)*e(a,c)},"/":function(a,c,d,e){return d(a,c)/e(a,c)},"%":function(a,c,d,e){return d(a,c)%e(a,c)},"===":function(a,c,d,e){return d(a,c)===e(a,c)},"!==":function(a,c,d,e){return d(a,c)!==e(a,c)},"==":function(a,c,d,e){return d(a,c)==e(a,c)},"!=":function(a,c,d,e){return d(a,c)!=e(a,c)},"<":function(a,c,d,e){return d(a,c)<e(a,c)},">":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a, c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"!":function(a,c,d){return!d(a,c)},"=":!0,"|":!0}),Xf={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},gc=function(a){this.options=a};gc.prototype={constructor:gc,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index<this.text.length;)if(a=this.text.charAt(this.index),'"'===a||"'"===a)this.readString(a);else if(this.isNumber(a)|| "."===a&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdent(a))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;else{var c=a+this.peek(),d=c+this.peek(2),e=mb[c],f=mb[d];mb[a]||e||f?(a=f?d:e?c:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},is:function(a,c){return-1!== c.indexOf(a)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,c,d){d=d||this.index;c=y(c)?"s "+c+"-"+this.index+" ["+this.text.substring(c, d)+"]":" "+d;throw la("lexerr",a,c,this.text);},readNumber:function(){for(var a="",c=this.index;this.index<this.text.length;){var d=Q(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var e=this.peek();if("e"==d&&this.isExpOperator(e))a+=d;else if(this.isExpOperator(d)&&e&&this.isNumber(e)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||e&&this.isNumber(e)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:c, text:a,constant:!0,value:Number(a)})},readIdent:function(){for(var a=this.index;this.index<this.text.length;){var c=this.text.charAt(this.index);if(!this.isIdent(c)&&!this.isNumber(c))break;this.index++}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var c=this.index;this.index++;for(var d="",e=a,f=!1;this.index<this.text.length;){var g=this.text.charAt(this.index),e=e+g;if(f)"u"===g?(f=this.text.substring(this.index+1,this.index+5),f.match(/[\da-f]{4}/i)|| this.throwError("Invalid unicode escape [\\u"+f+"]"),this.index+=4,d+=String.fromCharCode(parseInt(f,16))):d+=Xf[g]||g,f=!1;else if("\\"===g)f=!0;else{if(g===a){this.index++;this.tokens.push({index:c,text:e,constant:!0,value:d});return}d+=g}this.index++}this.throwError("Unterminated quote",c)}};var hb=function(a,c,d){this.lexer=a;this.$filter=c;this.options=d};hb.ZERO=z(function(){return 0},{sharedGetter:!0,constant:!0});hb.prototype={constructor:hb,parse:function(a){this.text=a;this.tokens=this.lexer.lex(a); a=this.statements();0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]);a.literal=!!a.literal;a.constant=!!a.constant;return a},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.peek().identifier&&this.peek().text in lb?a=lb[this.consume().text]:this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression", this.peek());for(var c,d;c=this.expect("(","[",".");)"("===c.text?(a=this.functionCall(a,d),d=null):"["===c.text?(d=a,a=this.objectIndex(a)):"."===c.text?(d=a,a=this.fieldAccess(a)):this.throwError("IMPOSSIBLE");return a},throwError:function(a,c){throw la("syntax",c.text,a,c.index+1,this.text,this.text.substring(c.index));},peekToken:function(){if(0===this.tokens.length)throw la("ueoe",this.text);return this.tokens[0]},peek:function(a,c,d,e){return this.peekAhead(0,a,c,d,e)},peekAhead:function(a, c,d,e,f){if(this.tokens.length>a){a=this.tokens[a];var g=a.text;if(g===c||g===d||g===e||g===f||!(c||d||e||f))return a}return!1},expect:function(a,c,d,e){return(a=this.peek(a,c,d,e))?(this.tokens.shift(),a):!1},consume:function(a){if(0===this.tokens.length)throw la("ueoe",this.text);var c=this.expect(a);c||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return c},unaryFn:function(a,c){var d=mb[a];return z(function(a,f){return d(a,f,c)},{constant:c.constant,inputs:[c]})},binaryFn:function(a, c,d,e){var f=mb[c];return z(function(c,e){return f(c,e,a,d)},{constant:a.constant&&d.constant,inputs:!e&&[a,d]})},identifier:function(){for(var a=this.consume().text;this.peek(".")&&this.peekAhead(1).identifier&&!this.peekAhead(2,"(");)a+=this.consume().text+this.consume().text;return zf(a,this.options,this.text)},constant:function(){var a=this.consume().value;return z(function(){return a},{constant:!0,literal:!0})},statements:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")", ";","]")&&a.push(this.filterChain()),!this.expect(";"))return 1===a.length?a[0]:function(c,d){for(var e,f=0,g=a.length;f<g;f++)e=a[f](c,d);return e}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},filter:function(a){var c=this.$filter(this.consume().text),d,e;if(this.peek(":"))for(d=[],e=[];this.expect(":");)d.push(this.expression());var f=[a].concat(d||[]);return z(function(f,h){var l=a(f,h);if(e){e[0]=l;for(l=d.length;l--;)e[l+1]=d[l](f,h);return c.apply(t, e)}return c(l)},{constant:!c.$stateful&&f.every(ec),inputs:!c.$stateful&&f})},expression:function(){return this.assignment()},assignment:function(){var a=this.ternary(),c,d;return(d=this.expect("="))?(a.assign||this.throwError("implies assignment but ["+this.text.substring(0,d.index)+"] can not be assigned to",d),c=this.ternary(),z(function(d,f){return a.assign(d,c(d,f),f)},{inputs:[a,c]})):a},ternary:function(){var a=this.logicalOR(),c;if(this.expect("?")&&(c=this.assignment(),this.consume(":"))){var d= this.assignment();return z(function(e,f){return a(e,f)?c(e,f):d(e,f)},{constant:a.constant&&c.constant&&d.constant})}return a},logicalOR:function(){for(var a=this.logicalAND(),c;c=this.expect("||");)a=this.binaryFn(a,c.text,this.logicalAND(),!0);return a},logicalAND:function(){for(var a=this.equality(),c;c=this.expect("&&");)a=this.binaryFn(a,c.text,this.equality(),!0);return a},equality:function(){for(var a=this.relational(),c;c=this.expect("==","!=","===","!==");)a=this.binaryFn(a,c.text,this.relational()); return a},relational:function(){for(var a=this.additive(),c;c=this.expect("<",">","<=",">=");)a=this.binaryFn(a,c.text,this.additive());return a},additive:function(){for(var a=this.multiplicative(),c;c=this.expect("+","-");)a=this.binaryFn(a,c.text,this.multiplicative());return a},multiplicative:function(){for(var a=this.unary(),c;c=this.expect("*","/","%");)a=this.binaryFn(a,c.text,this.unary());return a},unary:function(){var a;return this.expect("+")?this.primary():(a=this.expect("-"))?this.binaryFn(hb.ZERO, a.text,this.unary()):(a=this.expect("!"))?this.unaryFn(a.text,this.unary()):this.primary()},fieldAccess:function(a){var c=this.identifier();return z(function(d,e,f){d=f||a(d,e);return null==d?t:c(d)},{assign:function(d,e,f){var g=a(d,f);g||a.assign(d,g={},f);return c.assign(g,e)}})},objectIndex:function(a){var c=this.text,d=this.expression();this.consume("]");return z(function(e,f){var g=a(e,f),h=d(e,f);ta(h,c);return g?ma(g[h],c):t},{assign:function(e,f,g){var h=ta(d(e,g),c),l=ma(a(e,g),c);l||a.assign(e, l={},g);return l[h]=f}})},functionCall:function(a,c){var d=[];if(")"!==this.peekToken().text){do d.push(this.expression());while(this.expect(","))}this.consume(")");var e=this.text,f=d.length?[]:null;return function(g,h){var l=c?c(g,h):y(c)?t:g,k=a(g,h,l)||H;if(f)for(var m=d.length;m--;)f[m]=ma(d[m](g,h),e);ma(l,e);if(k){if(k.constructor===k)throw la("isecfn",e);if(k===Uf||k===Vf||k===Wf)throw la("isecff",e);}l=k.apply?k.apply(l,f):k(f[0],f[1],f[2],f[3],f[4]);return ma(l,e)}},arrayDeclaration:function(){var a= [];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return z(function(c,d){for(var e=[],f=0,g=a.length;f<g;f++)e.push(a[f](c,d));return e},{literal:!0,constant:a.every(ec),inputs:a})},object:function(){var a=[],c=[];if("}"!==this.peekToken().text){do{if(this.peek("}"))break;var d=this.consume();d.constant?a.push(d.value):d.identifier?a.push(d.text):this.throwError("invalid key",d);this.consume(":");c.push(this.expression())}while(this.expect(",")) }this.consume("}");return z(function(d,f){for(var g={},h=0,l=c.length;h<l;h++)g[a[h]]=c[h](d,f);return g},{literal:!0,constant:c.every(ec),inputs:c})}};var Bf=ha(),Af=ha(),Cf=Object.prototype.valueOf,Ca=T("$sce"),na={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},ja=T("$compile"),Z=Y.createElement("a"),id=Ba(M.location.href);Dc.$inject=["$provide"];jd.$inject=["$locale"];ld.$inject=["$locale"];var od=".",Mf={yyyy:$("FullYear",4),yy:$("FullYear",2,0,!0),y:$("FullYear",1),MMMM:Ib("Month"), MMM:Ib("Month",!0),MM:$("Month",2,1),M:$("Month",1,1),dd:$("Date",2),d:$("Date",1),HH:$("Hours",2),H:$("Hours",1),hh:$("Hours",2,-12),h:$("Hours",1,-12),mm:$("Minutes",2),m:$("Minutes",1),ss:$("Seconds",2),s:$("Seconds",1),sss:$("Milliseconds",3),EEEE:Ib("Day"),EEE:Ib("Day",!0),a:function(a,c){return 12>a.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=-1*a.getTimezoneOffset();return a=(0<=a?"+":"")+(Hb(Math[0<a?"floor":"ceil"](a/60),2)+Hb(Math.abs(a%60),2))},ww:qd(2),w:qd(1)},Lf=/((?:[^yMdHhmsaZEw']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|w+))(.*)/, Kf=/^\-?\d+$/;kd.$inject=["$locale"];var Hf=da(Q),If=da(ub);md.$inject=["$parse"];var Td=da({restrict:"E",compile:function(a,c){if(!c.href&&!c.xlinkHref&&!c.name)return function(a,c){var f="[object SVGAnimatedString]"===Da.call(c.prop("href"))?"xlink:href":"href";c.on("click",function(a){c.attr(f)||a.preventDefault()})}}}),vb={};s(Eb,function(a,c){if("multiple"!=a){var d=ya("ng-"+c);vb[d]=function(){return{restrict:"A",priority:100,link:function(a,f,g){a.$watch(g[d],function(a){g.$set(c,!!a)})}}}}}); s(Nc,function(a,c){vb[c]=function(){return{priority:100,link:function(a,e,f){if("ngPattern"===c&&"/"==f.ngPattern.charAt(0)&&(e=f.ngPattern.match(Of))){f.$set("ngPattern",new RegExp(e[1],e[2]));return}a.$watch(f[c],function(a){f.$set(c,a)})}}}});s(["src","srcset","href"],function(a){var c=ya("ng-"+a);vb[c]=function(){return{priority:99,link:function(d,e,f){var g=a,h=a;"href"===a&&"[object SVGAnimatedString]"===Da.call(e.prop("href"))&&(h="xlinkHref",f.$attr[h]="xlink:href",g=null);f.$observe(c,function(c){c? (f.$set(h,c),Ra&&g&&e.prop(g,f[h])):"href"===a&&f.$set(h,null)})}}}});var Jb={$addControl:H,$$renameControl:function(a,c){a.$name=c},$removeControl:H,$setValidity:H,$setDirty:H,$setPristine:H,$setSubmitted:H};rd.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var yd=function(a){return["$timeout",function(c){return{name:"form",restrict:a?"EAC":"E",controller:rd,compile:function(a){a.addClass(Sa).addClass(kb);return{pre:function(a,d,g,h){if(!("action"in g)){var l=function(c){a.$apply(function(){h.$commitViewValue(); h.$setSubmitted()});c.preventDefault()};d[0].addEventListener("submit",l,!1);d.on("$destroy",function(){c(function(){d[0].removeEventListener("submit",l,!1)},0,!1)})}var k=h.$$parentForm,m=h.$name;m&&(gb(a,null,m,h,m),g.$observe(g.name?"name":"ngForm",function(c){m!==c&&(gb(a,null,m,t,m),m=c,gb(a,null,m,h,m),k.$$renameControl(h,m))}));d.on("$destroy",function(){k.$removeControl(h);m&&gb(a,null,m,t,m);z(h,Jb)})}}}}}]},Ud=yd(),ge=yd(!0),Nf=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/, Yf=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,Zf=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,$f=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,zd=/^(\d{4})-(\d{2})-(\d{2})$/,Ad=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,jc=/^(\d{4})-W(\d\d)$/,Bd=/^(\d{4})-(\d\d)$/,Cd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Dd={text:function(a,c,d,e,f,g){ib(a,c,d,e,f,g);hc(e)},date:jb("date",zd,Lb(zd,["yyyy", "MM","dd"]),"yyyy-MM-dd"),"datetime-local":jb("datetimelocal",Ad,Lb(Ad,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:jb("time",Cd,Lb(Cd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:jb("week",jc,function(a,c){if(qa(a))return a;if(F(a)){jc.lastIndex=0;var d=jc.exec(a);if(d){var e=+d[1],f=+d[2],g=d=0,h=0,l=0,k=pd(e),f=7*(f-1);c&&(d=c.getHours(),g=c.getMinutes(),h=c.getSeconds(),l=c.getMilliseconds());return new Date(e,0,k.getDate()+f,d,g,h,l)}}return NaN},"yyyy-Www"),month:jb("month", Bd,Lb(Bd,["yyyy","MM"]),"yyyy-MM"),number:function(a,c,d,e,f,g){td(a,c,d,e);ib(a,c,d,e,f,g);e.$$parserName="number";e.$parsers.push(function(a){return e.$isEmpty(a)?null:$f.test(a)?parseFloat(a):t});e.$formatters.push(function(a){if(!e.$isEmpty(a)){if(!V(a))throw Mb("numfmt",a);a=a.toString()}return a});if(d.min||d.ngMin){var h;e.$validators.min=function(a){return e.$isEmpty(a)||A(h)||a>=h};d.$observe("min",function(a){y(a)&&!V(a)&&(a=parseFloat(a,10));h=V(a)&&!isNaN(a)?a:t;e.$validate()})}if(d.max|| d.ngMax){var l;e.$validators.max=function(a){return e.$isEmpty(a)||A(l)||a<=l};d.$observe("max",function(a){y(a)&&!V(a)&&(a=parseFloat(a,10));l=V(a)&&!isNaN(a)?a:t;e.$validate()})}},url:function(a,c,d,e,f,g){ib(a,c,d,e,f,g);hc(e);e.$$parserName="url";e.$validators.url=function(a,c){var d=a||c;return e.$isEmpty(d)||Yf.test(d)}},email:function(a,c,d,e,f,g){ib(a,c,d,e,f,g);hc(e);e.$$parserName="email";e.$validators.email=function(a,c){var d=a||c;return e.$isEmpty(d)||Zf.test(d)}},radio:function(a,c, d,e){A(d.name)&&c.attr("name",++nb);c.on("click",function(a){c[0].checked&&e.$setViewValue(d.value,a&&a.type)});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e,f,g,h,l){var k=ud(l,a,"ngTrueValue",d.ngTrueValue,!0),m=ud(l,a,"ngFalseValue",d.ngFalseValue,!1);c.on("click",function(a){e.$setViewValue(c[0].checked,a&&a.type)});e.$render=function(){c[0].checked=e.$viewValue};e.$isEmpty=function(a){return!1===a};e.$formatters.push(function(a){return fa(a, k)});e.$parsers.push(function(a){return a?k:m})},hidden:H,button:H,submit:H,reset:H,file:H},xc=["$browser","$sniffer","$filter","$parse",function(a,c,d,e){return{restrict:"E",require:["?ngModel"],link:{pre:function(f,g,h,l){l[0]&&(Dd[Q(h.type)]||Dd.text)(f,g,h,l[0],c,a,d,e)}}}}],ag=/^(true|false|\d+)$/,ye=function(){return{restrict:"A",priority:100,compile:function(a,c){return ag.test(c.ngValue)?function(a,c,f){f.$set("value",a.$eval(f.ngValue))}:function(a,c,f){a.$watch(f.ngValue,function(a){f.$set("value", a)})}}}},Zd=["$compile",function(a){return{restrict:"AC",compile:function(c){a.$$addBindingClass(c);return function(c,e,f){a.$$addBindingInfo(e,f.ngBind);e=e[0];c.$watch(f.ngBind,function(a){e.textContent=a===t?"":a})}}}}],ae=["$interpolate","$compile",function(a,c){return{compile:function(d){c.$$addBindingClass(d);return function(d,f,g){d=a(f.attr(g.$attr.ngBindTemplate));c.$$addBindingInfo(f,d.expressions);f=f[0];g.$observe("ngBindTemplate",function(a){f.textContent=a===t?"":a})}}}}],$d=["$sce", "$parse","$compile",function(a,c,d){return{restrict:"A",compile:function(e,f){var g=c(f.ngBindHtml),h=c(f.ngBindHtml,function(a){return(a||"").toString()});d.$$addBindingClass(e);return function(c,e,f){d.$$addBindingInfo(e,f.ngBindHtml);c.$watch(h,function(){e.html(a.getTrustedHtml(g(c))||"")})}}}}],xe=da({restrict:"A",require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),be=ic("",!0),de=ic("Odd",0),ce=ic("Even",1),ee=Ja({compile:function(a,c){c.$set("ngCloak", t);a.removeClass("ng-cloak")}}),fe=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Cc={},bg={blur:!0,focus:!0};s("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var c=ya("ng-"+a);Cc[c]=["$parse","$rootScope",function(d,e){return{restrict:"A",compile:function(f,g){var h=d(g[c],null,!0);return function(c,d){d.on(a,function(d){var f=function(){h(c,{$event:d})}; bg[a]&&e.$$phase?c.$evalAsync(f):c.$apply(f)})}}}}]});var ie=["$animate",function(a){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,f,g){var h,l,k;c.$watch(e.ngIf,function(c){c?l||g(function(c,f){l=f;c[c.length++]=Y.createComment(" end ngIf: "+e.ngIf+" ");h={clone:c};a.enter(c,d.parent(),d)}):(k&&(k.remove(),k=null),l&&(l.$destroy(),l=null),h&&(k=tb(h.clone),a.leave(k).then(function(){k=null}),h=null))})}}}],je=["$templateRequest","$anchorScroll", "$animate","$sce",function(a,c,d,e){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:ga.noop,compile:function(f,g){var h=g.ngInclude||g.src,l=g.onload||"",k=g.autoscroll;return function(f,g,q,s,r){var t=0,p,v,w,L=function(){v&&(v.remove(),v=null);p&&(p.$destroy(),p=null);w&&(d.leave(w).then(function(){v=null}),v=w,w=null)};f.$watch(e.parseAsResourceUrl(h),function(e){var h=function(){!y(k)||k&&!f.$eval(k)||c()},q=++t;e?(a(e,!0).then(function(a){if(q===t){var c=f.$new(); s.template=a;a=r(c,function(a){L();d.enter(a,null,g).then(h)});p=c;w=a;p.$emit("$includeContentLoaded",e);f.$eval(l)}},function(){q===t&&(L(),f.$emit("$includeContentError",e))}),f.$emit("$includeContentRequested",e)):(L(),s.template=null)})}}}}],Ae=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,f){/SVG/.test(d[0].toString())?(d.empty(),a(Fc(f.template,Y).childNodes)(c,function(a){d.append(a)},{futureParentElement:d})):(d.html(f.template),a(d.contents())(c))}}}], ke=Ja({priority:450,compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),we=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,c,d,e){var f=c.attr(d.$attr.ngList)||", ",g="false"!==d.ngTrim,h=g?U(f):f;e.$parsers.push(function(a){if(!A(a)){var c=[];a&&s(a.split(h),function(a){a&&c.push(g?U(a):a)});return c}});e.$formatters.push(function(a){return D(a)?a.join(f):t});e.$isEmpty=function(a){return!a||!a.length}}}},kb="ng-valid",vd="ng-invalid",Sa="ng-pristine", Kb="ng-dirty",xd="ng-pending",Mb=new T("ngModel"),cg=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,c,d,e,f,g,h,l,k,m){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=t;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success= {};this.$pending=t;this.$name=m(d.name||"",!1)(a);var n=f(d.ngModel),q=n.assign,u=n,r=q,O=null,p=this;this.$$setOptions=function(a){if((p.$options=a)&&a.getterSetter){var c=f(d.ngModel+"()"),g=f(d.ngModel+"($$$p)");u=function(a){var d=n(a);G(d)&&(d=c(a));return d};r=function(a,c){G(n(a))?g(a,{$$$p:p.$modelValue}):q(a,p.$modelValue)}}else if(!n.assign)throw Mb("nonassign",d.ngModel,va(e));};this.$render=H;this.$isEmpty=function(a){return A(a)||""===a||null===a||a!==a};var v=e.inheritedData("$formController")|| Jb,w=0;sd({ctrl:this,$element:e,set:function(a,c){a[c]=!0},unset:function(a,c){delete a[c]},parentForm:v,$animate:g});this.$setPristine=function(){p.$dirty=!1;p.$pristine=!0;g.removeClass(e,Kb);g.addClass(e,Sa)};this.$setDirty=function(){p.$dirty=!0;p.$pristine=!1;g.removeClass(e,Sa);g.addClass(e,Kb);v.$setDirty()};this.$setUntouched=function(){p.$touched=!1;p.$untouched=!0;g.setClass(e,"ng-untouched","ng-touched")};this.$setTouched=function(){p.$touched=!0;p.$untouched=!1;g.setClass(e,"ng-touched", "ng-untouched")};this.$rollbackViewValue=function(){h.cancel(O);p.$viewValue=p.$$lastCommittedViewValue;p.$render()};this.$validate=function(){if(!V(p.$modelValue)||!isNaN(p.$modelValue)){var a=p.$$rawModelValue,c=p.$valid,d=p.$modelValue,e=p.$options&&p.$options.allowInvalid;p.$$runValidators(p.$error[p.$$parserName||"parse"]?!1:t,a,p.$$lastCommittedViewValue,function(f){e||c===f||(p.$modelValue=f?a:t,p.$modelValue!==d&&p.$$writeModelToScope())})}};this.$$runValidators=function(a,c,d,e){function f(){var a= !0;s(p.$validators,function(e,f){var g=e(c,d);a=a&&g;h(f,g)});return a?!0:(s(p.$asyncValidators,function(a,c){h(c,null)}),!1)}function g(){var a=[],e=!0;s(p.$asyncValidators,function(f,g){var l=f(c,d);if(!l||!G(l.then))throw Mb("$asyncValidators",l);h(g,t);a.push(l.then(function(){h(g,!0)},function(a){e=!1;h(g,!1)}))});a.length?k.all(a).then(function(){l(e)},H):l(!0)}function h(a,c){m===w&&p.$setValidity(a,c)}function l(a){m===w&&e(a)}w++;var m=w;(function(a){var c=p.$$parserName||"parse";if(a=== t)h(c,null);else if(h(c,a),!a)return s(p.$validators,function(a,c){h(c,null)}),s(p.$asyncValidators,function(a,c){h(c,null)}),!1;return!0})(a)?f()?g():l(!1):l(!1)};this.$commitViewValue=function(){var a=p.$viewValue;h.cancel(O);if(p.$$lastCommittedViewValue!==a||""===a&&p.$$hasNativeValidators)p.$$lastCommittedViewValue=a,p.$pristine&&this.$setDirty(),this.$$parseAndValidate()};this.$$parseAndValidate=function(){var c=p.$$lastCommittedViewValue,d=A(c)?t:!0;if(d)for(var e=0;e<p.$parsers.length;e++)if(c= p.$parsers[e](c),A(c)){d=!1;break}V(p.$modelValue)&&isNaN(p.$modelValue)&&(p.$modelValue=u(a));var f=p.$modelValue,g=p.$options&&p.$options.allowInvalid;p.$$rawModelValue=c;g&&(p.$modelValue=c,p.$modelValue!==f&&p.$$writeModelToScope());p.$$runValidators(d,c,p.$$lastCommittedViewValue,function(a){g||(p.$modelValue=a?c:t,p.$modelValue!==f&&p.$$writeModelToScope())})};this.$$writeModelToScope=function(){r(a,p.$modelValue);s(p.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};this.$setViewValue= function(a,c){p.$viewValue=a;p.$options&&!p.$options.updateOnDefault||p.$$debounceViewValueCommit(c)};this.$$debounceViewValueCommit=function(c){var d=0,e=p.$options;e&&y(e.debounce)&&(e=e.debounce,V(e)?d=e:V(e[c])?d=e[c]:V(e["default"])&&(d=e["default"]));h.cancel(O);d?O=h(function(){p.$commitViewValue()},d):l.$$phase?p.$commitViewValue():a.$apply(function(){p.$commitViewValue()})};a.$watch(function(){var c=u(a);if(c!==p.$modelValue){p.$modelValue=p.$$rawModelValue=c;for(var d=p.$formatters,e=d.length, f=c;e--;)f=d[e](f);p.$viewValue!==f&&(p.$viewValue=p.$$lastCommittedViewValue=f,p.$render(),p.$$runValidators(t,c,f,H))}return c})}],ve=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:cg,priority:1,compile:function(c){c.addClass(Sa).addClass("ng-untouched").addClass(kb);return{pre:function(a,c,f,g){var h=g[0],l=g[1]||Jb;h.$$setOptions(g[2]&&g[2].$options);l.$addControl(h);f.$observe("name",function(a){h.$name!==a&&l.$$renameControl(h,a)});a.$on("$destroy", function(){l.$removeControl(h)})},post:function(c,e,f,g){var h=g[0];if(h.$options&&h.$options.updateOn)e.on(h.$options.updateOn,function(a){h.$$debounceViewValueCommit(a&&a.type)});e.on("blur",function(e){h.$touched||(a.$$phase?c.$evalAsync(h.$setTouched):c.$apply(h.$setTouched))})}}}}}],dg=/(\s+|^)default(\s+|$)/,ze=function(){return{restrict:"A",controller:["$scope","$attrs",function(a,c){var d=this;this.$options=a.$eval(c.ngModelOptions);this.$options.updateOn!==t?(this.$options.updateOnDefault= !1,this.$options.updateOn=U(this.$options.updateOn.replace(dg,function(){d.$options.updateOnDefault=!0;return" "}))):this.$options.updateOnDefault=!0}]}},le=Ja({terminal:!0,priority:1E3}),me=["$locale","$interpolate",function(a,c){var d=/{}/g,e=/^when(Minus)?(.+)$/;return{restrict:"EA",link:function(f,g,h){function l(a){g.text(a||"")}var k=h.count,m=h.$attr.when&&g.attr(h.$attr.when),n=h.offset||0,q=f.$eval(m)||{},u={},m=c.startSymbol(),r=c.endSymbol(),t=m+k+"-"+n+r,p=ga.noop,v;s(h,function(a,c){var d= e.exec(c);d&&(d=(d[1]?"-":"")+Q(d[2]),q[d]=g.attr(h.$attr[c]))});s(q,function(a,e){u[e]=c(a.replace(d,t))});f.$watch(k,function(c){c=parseFloat(c);var d=isNaN(c);d||c in q||(c=a.pluralCat(c-n));c===v||d&&isNaN(v)||(p(),p=f.$watch(u[c],l),v=c)})}}}],ne=["$parse","$animate",function(a,c){var d=T("ngRepeat"),e=function(a,c,d,e,k,m,n){a[d]=e;k&&(a[k]=m);a.$index=c;a.$first=0===c;a.$last=c===n-1;a.$middle=!(a.$first||a.$last);a.$odd=!(a.$even=0===(c&1))};return{restrict:"A",multiElement:!0,transclude:"element", priority:1E3,terminal:!0,$$tlb:!0,compile:function(f,g){var h=g.ngRepeat,l=Y.createComment(" end ngRepeat: "+h+" "),k=h.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!k)throw d("iexp",h);var m=k[1],n=k[2],q=k[3],u=k[4],k=m.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/);if(!k)throw d("iidexp",m);var r=k[3]||k[1],y=k[2];if(q&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(q)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(q)))throw d("badident", q);var p,v,w,A,z={$id:Na};u?p=a(u):(w=function(a,c){return Na(c)},A=function(a){return a});return function(a,f,g,k,m){p&&(v=function(c,d,e){y&&(z[y]=c);z[r]=d;z.$index=e;return p(a,z)});var u=ha();a.$watchCollection(n,function(g){var k,p,n=f[0],E,z=ha(),H,S,N,D,G,C,I;q&&(a[q]=g);if(Ta(g))G=g,p=v||w;else{p=v||A;G=[];for(I in g)g.hasOwnProperty(I)&&"$"!=I.charAt(0)&&G.push(I);G.sort()}H=G.length;I=Array(H);for(k=0;k<H;k++)if(S=g===G?k:G[k],N=g[S],D=p(S,N,k),u[D])C=u[D],delete u[D],z[D]=C,I[k]=C;else{if(z[D])throw s(I, function(a){a&&a.scope&&(u[a.id]=a)}),d("dupes",h,D,N);I[k]={id:D,scope:t,clone:t};z[D]=!0}for(E in u){C=u[E];D=tb(C.clone);c.leave(D);if(D[0].parentNode)for(k=0,p=D.length;k<p;k++)D[k].$$NG_REMOVED=!0;C.scope.$destroy()}for(k=0;k<H;k++)if(S=g===G?k:G[k],N=g[S],C=I[k],C.scope){E=n;do E=E.nextSibling;while(E&&E.$$NG_REMOVED);C.clone[0]!=E&&c.move(tb(C.clone),null,B(n));n=C.clone[C.clone.length-1];e(C.scope,k,r,N,y,S,H)}else m(function(a,d){C.scope=d;var f=l.cloneNode(!1);a[a.length++]=f;c.enter(a, null,B(n));n=f;C.clone=a;z[C.id]=C;e(C.scope,k,r,N,y,S,H)});u=z})}}}}],oe=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(c,d,e){c.$watch(e.ngShow,function(c){a[c?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],he=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(c,d,e){c.$watch(e.ngHide,function(c){a[c?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],pe=Ja(function(a,c,d){a.$watchCollection(d.ngStyle, function(a,d){d&&a!==d&&s(d,function(a,d){c.css(d,"")});a&&c.css(a)})}),qe=["$animate",function(a){return{restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(c,d,e,f){var g=[],h=[],l=[],k=[],m=function(a,c){return function(){a.splice(c,1)}};c.$watch(e.ngSwitch||e.on,function(c){var d,e;d=0;for(e=l.length;d<e;++d)a.cancel(l[d]);d=l.length=0;for(e=k.length;d<e;++d){var r=tb(h[d].clone);k[d].$destroy();(l[d]=a.leave(r)).then(m(l,d))}h.length=0;k.length=0;(g= f.cases["!"+c]||f.cases["?"])&&s(g,function(c){c.transclude(function(d,e){k.push(e);var f=c.element;d[d.length++]=Y.createComment(" end ngSwitchWhen: ");h.push({clone:d});a.enter(d,f.parent(),f)})})})}}}],re=Ja({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,c,d,e,f){e.cases["!"+d.ngSwitchWhen]=e.cases["!"+d.ngSwitchWhen]||[];e.cases["!"+d.ngSwitchWhen].push({transclude:f,element:c})}}),se=Ja({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0, link:function(a,c,d,e,f){e.cases["?"]=e.cases["?"]||[];e.cases["?"].push({transclude:f,element:c})}}),ue=Ja({restrict:"EAC",link:function(a,c,d,e,f){if(!f)throw T("ngTransclude")("orphan",va(c));f(function(a){c.empty();c.append(a)})}}),Vd=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,d){"text/ng-template"==d.type&&a.put(d.id,c[0].text)}}}],eg=T("ngOptions"),te=da({restrict:"A",terminal:!0}),Wd=["$compile","$parse",function(a,c){var d=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/, e={$setViewValue:H};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(a,c,d){var l=this,k={},m=e,n;l.databound=d.ngModel;l.init=function(a,c,d){m=a;n=d};l.addOption=function(c,d){Ma(c,'"option value"');k[c]=!0;m.$viewValue==c&&(a.val(c),n.parent()&&n.remove());d&&d[0].hasAttribute("selected")&&(d[0].selected=!0)};l.removeOption=function(a){this.hasOption(a)&&(delete k[a],m.$viewValue===a&&this.renderUnknownOption(a))};l.renderUnknownOption=function(c){c= "? "+Na(c)+" ?";n.val(c);a.prepend(n);a.val(c);n.prop("selected",!0)};l.hasOption=function(a){return k.hasOwnProperty(a)};c.$on("$destroy",function(){l.renderUnknownOption=H})}],link:function(e,g,h,l){function k(a,c,d,e){d.$render=function(){var a=d.$viewValue;e.hasOption(a)?(C.parent()&&C.remove(),c.val(a),""===a&&p.prop("selected",!0)):A(a)&&p?c.val(""):e.renderUnknownOption(a)};c.on("change",function(){a.$apply(function(){C.parent()&&C.remove();d.$setViewValue(c.val())})})}function m(a,c,d){var e; d.$render=function(){var a=new db(d.$viewValue);s(c.find("option"),function(c){c.selected=y(a.get(c.value))})};a.$watch(function(){fa(e,d.$viewValue)||(e=ra(d.$viewValue),d.$render())});c.on("change",function(){a.$apply(function(){var a=[];s(c.find("option"),function(c){c.selected&&a.push(c.value)});d.$setViewValue(a)})})}function n(e,f,g){function h(a,c,d){T[x]=d;G&&(T[G]=c);return a(e,T)}function k(a){var c;if(u)if(M&&D(a)){c=new db([]);for(var d=0;d<a.length;d++)c.put(h(M,null,a[d]),!0)}else c= new db(a);else M&&(a=h(M,null,a));return function(d,e){var f;f=M?M:B?B:F;return u?y(c.remove(h(f,d,e))):a===h(f,d,e)}}function l(){v||(e.$$postDigest(p),v=!0)}function m(a,c,d){a[c]=a[c]||0;a[c]+=d?1:-1}function p(){v=!1;var a={"":[]},c=[""],d,l,n,r,t;n=g.$viewValue;r=P(e)||[];var B=G?Object.keys(r).sort():r,x,A,D,F,N={};t=k(n);var J=!1,U,V;Q={};for(F=0;D=B.length,F<D;F++){x=F;if(G&&(x=B[F],"$"===x.charAt(0)))continue;A=r[x];d=h(I,x,A)||"";(l=a[d])||(l=a[d]=[],c.push(d));d=t(x,A);J=J||d;A=h(C,x,A); A=y(A)?A:"";V=M?M(e,T):G?B[F]:F;M&&(Q[V]=x);l.push({id:V,label:A,selected:d})}u||(z||null===n?a[""].unshift({id:"",label:"",selected:!J}):J||a[""].unshift({id:"?",label:"",selected:!0}));x=0;for(B=c.length;x<B;x++){d=c[x];l=a[d];R.length<=x?(n={element:H.clone().attr("label",d),label:l.label},r=[n],R.push(r),f.append(n.element)):(r=R[x],n=r[0],n.label!=d&&n.element.attr("label",n.label=d));J=null;F=0;for(D=l.length;F<D;F++)d=l[F],(t=r[F+1])?(J=t.element,t.label!==d.label&&(m(N,t.label,!1),m(N,d.label, !0),J.text(t.label=d.label),J.prop("label",t.label)),t.id!==d.id&&J.val(t.id=d.id),J[0].selected!==d.selected&&(J.prop("selected",t.selected=d.selected),Ra&&J.prop("selected",t.selected))):(""===d.id&&z?U=z:(U=w.clone()).val(d.id).prop("selected",d.selected).attr("selected",d.selected).prop("label",d.label).text(d.label),r.push(t={element:U,label:d.label,id:d.id,selected:d.selected}),m(N,d.label,!0),J?J.after(U):n.element.append(U),J=U);for(F++;r.length>F;)d=r.pop(),m(N,d.label,!1),d.element.remove()}for(;R.length> x;){l=R.pop();for(F=1;F<l.length;++F)m(N,l[F].label,!1);l[0].element.remove()}s(N,function(a,c){0<a?q.addOption(c):0>a&&q.removeOption(c)})}var n;if(!(n=r.match(d)))throw eg("iexp",r,va(f));var C=c(n[2]||n[1]),x=n[4]||n[6],A=/ as /.test(n[0])&&n[1],B=A?c(A):null,G=n[5],I=c(n[3]||""),F=c(n[2]?n[1]:x),P=c(n[7]),M=n[8]?c(n[8]):null,Q={},R=[[{element:f,label:""}]],T={};z&&(a(z)(e),z.removeClass("ng-scope"),z.remove());f.empty();f.on("change",function(){e.$apply(function(){var a=P(e)||[],c;if(u)c=[],s(f.val(), function(d){d=M?Q[d]:d;c.push("?"===d?t:""===d?null:h(B?B:F,d,a[d]))});else{var d=M?Q[f.val()]:f.val();c="?"===d?t:""===d?null:h(B?B:F,d,a[d])}g.$setViewValue(c);p()})});g.$render=p;e.$watchCollection(P,l);e.$watchCollection(function(){var a=P(e),c;if(a&&D(a)){c=Array(a.length);for(var d=0,f=a.length;d<f;d++)c[d]=h(C,d,a[d])}else if(a)for(d in c={},a)a.hasOwnProperty(d)&&(c[d]=h(C,d,a[d]));return c},l);u&&e.$watchCollection(function(){return g.$modelValue},l)}if(l[1]){var q=l[0];l=l[1];var u=h.multiple, r=h.ngOptions,z=!1,p,v=!1,w=B(Y.createElement("option")),H=B(Y.createElement("optgroup")),C=w.clone();h=0;for(var x=g.children(),G=x.length;h<G;h++)if(""===x[h].value){p=z=x.eq(h);break}q.init(l,z,C);u&&(l.$isEmpty=function(a){return!a||0===a.length});r?n(e,g,l):u?m(e,g,l):k(e,g,l,q)}}}}],Yd=["$interpolate",function(a){var c={addOption:H,removeOption:H};return{restrict:"E",priority:100,compile:function(d,e){if(A(e.value)){var f=a(d.text(),!0);f||e.$set("value",d.text())}return function(a,d,e){var k= d.parent(),m=k.data("$selectController")||k.parent().data("$selectController");m&&m.databound||(m=c);f?a.$watch(f,function(a,c){e.$set("value",a);c!==a&&m.removeOption(c);m.addOption(a,d)}):m.addOption(e.value,d);d.on("$destroy",function(){m.removeOption(e.value)})}}}}],Xd=da({restrict:"E",terminal:!1}),zc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){e&&(d.required=!0,e.$validators.required=function(a,c){return!d.required||!e.$isEmpty(c)},d.$observe("required",function(){e.$validate()}))}}}, yc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f,g=d.ngPattern||d.pattern;d.$observe("pattern",function(a){F(a)&&0<a.length&&(a=new RegExp("^"+a+"$"));if(a&&!a.test)throw T("ngPattern")("noregexp",g,a,va(c));f=a||t;e.$validate()});e.$validators.pattern=function(a){return e.$isEmpty(a)||A(f)||f.test(a)}}}}},Bc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=-1;d.$observe("maxlength",function(a){a=ba(a);f=isNaN(a)?-1:a;e.$validate()}); e.$validators.maxlength=function(a,c){return 0>f||e.$isEmpty(a)||c.length<=f}}}}},Ac=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=0;d.$observe("minlength",function(a){f=ba(a)||0;e.$validate()});e.$validators.minlength=function(a,c){return e.$isEmpty(c)||c.length>=f}}}}};M.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):(Nd(),Pd(ga),B(Y).ready(function(){Jd(Y,sc)}))})(window,document);!window.angular.$$csp()&&window.angular.element(document).find("head").prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}</style>'); //# sourceMappingURL=angular.min.js.map
import React from 'react'; import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; const pageFilename = 'api/grid-list-tile'; const requireRaw = require.context('!raw-loader!./', false, /\/grid-list-tile\.md$/); export default function Page({ docs }) { return <MarkdownDocs docs={docs} />; } Page.getInitialProps = () => { const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); return { demos, docs }; };
module.exports = { entry: "./index", output: { path: ".", filename: "mui.js" }, module: { loaders: [ { test: /\.jsx$/, loader: 'babel-loader' } ] } };
var nodemailer = require("nodemailer"); var Order = require('../models/Order'); var qs = require('querystring'); module.exports = { sendEmailserver: sendEmailserver, }; function sendEmailserver(req, res) { console.log("send Mail"); var body = ''; req.on('data', function (data) { body += data; if (body.length > 1e6) { // FLOOD ATTACK OR FAULTY CLIENT, NUKE REQUEST req.connection.destroy(); } }); req.on('end', function () { var POST = qs.parse(body); var email = POST.email; if (POST.type == "order") { var text = 'שלום וברכה!' + "\n" + "אנו שמחים שקניתה אצלינו" + "\n" + "הזמנתך תגיע בעוד כשלושה ימים" + "\n" + "נשמח לעמוד לשירותך תמיד" + "\n" + "צוות plastictableware"; console.log(text); var mailOptions = { from: 'plastictableware.cs@gmail.com', // sender address to: email, subject: 'הזמנתך התקבלה', // Subject line text: text //, // plaintext body }; } else { var mailOptions = { from: 'plastictableware.cs@gmail.com', // sender address to: 'plastictableware.cs@gmail.com', subject: ' מ פניה ' + email, // Subject line text: POST.content //, // plaintext body }; } console.log("mailOptions~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", mailOptions); var transporter = nodemailer.createTransport({ service: 'gmail', auth: { user: 'plastictableware.cs@gmail.com', // Your email id pass: 'plastictableware' // Your password } }); transporter.sendMail(mailOptions, function (error, info) { if (error) { return console.log(error); } console.log('Message sent: ' + info.response); }); res.send('הזמנתך התקבלה!'); }); }
'use strict' const cleanWords = require('../../../util/clean-words') module.exports = ({ title }) => cleanWords(title)
// All material copyright ESRI, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.8/esri/copyright.txt for details. //>>built define(["require","exports","../../support/geometryUtils","./gl-matrix","./Util"],function(n,r,h,c,g){function p(c,a){var b=a[0]-c[0],e=a[1]-c[1],d=a[2]-c[2];c=a[3]-c[3];return b*b+e*e+d*d+c*c}function k(c,a){return c[0]===a[0]&&c[1]===a[1]&&c[2]===a[2]}function q(c,a){return c[0]===a[0]&&c[1]===a[1]&&c[2]===a[2]&&c[3]===a[3]}n=function(){function b(a,b,e){this._viewUp=c.vec3d.create();this._viewForward=c.vec3d.create();this._viewRight=c.vec3d.create();this._viewport=c.vec4d.create();this._padding= c.vec4d.create();this._fov=55/180*Math.PI;this._near=0;this._far=1E3;this._viewDirty=!0;this._viewMatrix=c.mat4d.create();this._projectionDirty=!0;this._projectionMatrix=c.mat4d.create();this._viewProjectionDirty=!0;this._viewProjectionMatrix=c.mat4d.create();this._viewInverseTransposeMatrixDirty=!0;this._viewInverseTransposeMatrix=c.mat4d.create();this._frustumPlanesDirty=!0;this._frustumPlanes=[h.plane.create(),h.plane.create(),h.plane.create(),h.plane.create(),h.plane.create(),h.plane.create()]; this._fullViewport=null;this.aboveGround=!0;this._eye=c.vec3d.create(a);this._center=c.vec3d.create(b);this._up=void 0!==e?c.vec3d.create(e):c.vec3d.create([0,0,1]);this._padding=c.vec4d.create()}Object.defineProperty(b.prototype,"eye",{get:function(){return this._eye},set:function(a){this._compareAndSetView(a,this._eye)},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"center",{get:function(){return this._center},set:function(a){this._compareAndSetView(a,this._center)},enumerable:!0, configurable:!0});Object.defineProperty(b.prototype,"up",{get:function(){return this._up},set:function(a){this._compareAndSetView(a,this._up)},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"viewMatrix",{get:function(){this._ensureViewClean();return this._viewMatrix},set:function(a){c.mat4d.set(a,this._viewMatrix);this._viewDirty=!1;this._frustumPlanesDirty=this._viewProjectionDirty=this._viewInverseTransposeMatrixDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype, "viewForward",{get:function(){this._ensureViewClean();return this._viewForward},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"viewUp",{get:function(){this._ensureViewClean();return this._viewUp},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"viewRight",{get:function(){this._ensureViewClean();return this._viewRight},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"near",{get:function(){return this._near},set:function(a){this._near!==a&&(this._near= a,this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0)},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"far",{get:function(){return this._far},set:function(a){this._far!==a&&(this._far=a,this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0)},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"viewport",{get:function(){return this._viewport},set:function(a){this.x=a[0];this.y=a[1];this.width=a[2];this.height=a[3]},enumerable:!0, configurable:!0});Object.defineProperty(b.prototype,"x",{get:function(){return this._viewport[0]},set:function(a){a+=this._padding[3];this._viewport[0]!==a&&(this._viewport[0]=a,this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0)},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"y",{get:function(){return this._viewport[1]},set:function(a){a+=this._padding[2];this._viewport[1]!==a&&(this._viewport[1]=a,this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty= !0)},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"width",{get:function(){return this._viewport[2]},set:function(a){this._viewport[2]!==a&&(this._viewport[2]=a,this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0)},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"height",{get:function(){return this._viewport[3]},set:function(a){this._viewport[3]!==a&&(this._viewport[3]=a,this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty= !0)},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"fullWidth",{get:function(){return this._viewport[2]+this._padding[1]+this._padding[3]},set:function(a){this.width=a-(this._padding[1]+this._padding[3])},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"fullHeight",{get:function(){return this._viewport[3]+this._padding[0]+this._padding[2]},set:function(a){this.height=a-(this._padding[0]+this._padding[2])},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype, "fullViewport",{get:function(){this._fullViewport||(this._fullViewport=c.vec4d.create());this._fullViewport[0]=this._viewport[0]-this._padding[3];this._fullViewport[1]=this._viewport[1]-this._padding[2];this._fullViewport[2]=this.fullWidth;this._fullViewport[3]=this.fullHeight;return this._fullViewport},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"aspect",{get:function(){return this.width/this.height},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"padding", {get:function(){return this._padding},set:function(a){if(this._padding[0]!==a[0]||this._padding[1]!==a[1]||this._padding[2]!==a[2]||this._padding[3]!==a[3])this._viewport[0]+=a[3]-this._padding[3],this._viewport[1]+=a[2]-this._padding[2],this._viewport[2]-=a[1]+a[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=a[0]+a[2]-(this._padding[0]+this._padding[2]),c.vec4d.set(a,this._padding),this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0},enumerable:!0,configurable:!0}); Object.defineProperty(b.prototype,"viewProjectionMatrix",{get:function(){this._viewProjectionDirty&&(c.mat4d.multiply(this.projectionMatrix,this.viewMatrix,this._viewProjectionMatrix),this._viewProjectionDirty=!1);return this._viewProjectionMatrix},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"projectionMatrix",{get:function(){if(this._projectionDirty){var a=this.width,b=this.height,e=this.near*Math.tan(this.fovY/2),d=e*this.aspect;c.mat4d.frustum(-d*(1+2*this._padding[3]/a), d*(1+2*this._padding[1]/a),-e*(1+2*this._padding[2]/b),e*(1+2*this._padding[0]/b),this.near,this.far,this._projectionMatrix);this._projectionDirty=!1}return this._projectionMatrix},set:function(a){c.mat4d.set(a,this._projectionMatrix);this._projectionDirty=!1;this._frustumPlanesDirty=this._viewProjectionDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"fov",{get:function(){return this._fov},set:function(a){this._fov=a;this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty= !0},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"fovX",{get:function(){return g.fovd2fovx(this._fov,this.width,this.height)},set:function(a){this._fov=g.fovx2fovd(a,this.width,this.height);this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"fovY",{get:function(){return g.fovd2fovy(this._fov,this.width,this.height)},set:function(a){this._fov=g.fovy2fovd(a,this.width,this.height);this._frustumPlanesDirty= this._viewProjectionDirty=this._projectionDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"distance",{get:function(){return c.vec3d.dist(this._center,this._eye)},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"frustumPoints",{get:function(){return this.computeFrustumPoints()},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"frustumPlanes",{get:function(){this._frustumPlanesDirty&&(this._frustumPlanes=this._computeFrustumPlanes(this._frustumPlanes), this._frustumPlanesDirty=!1);return this._frustumPlanes},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"viewInverseTransposeMatrix",{get:function(){if(this._viewInverseTransposeMatrixDirty||this._viewDirty)this._viewInverseTransposeMatrix||(this._viewInverseTransposeMatrix=c.mat4d.create()),c.mat4d.inverse(this.viewMatrix,this._viewInverseTransposeMatrix),c.mat4d.transpose(this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1;return this._viewInverseTransposeMatrix}, enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"perPixelRatio",{get:function(){return Math.tan(this.fovX/2)/this.width},enumerable:!0,configurable:!0});b.prototype.copyFrom=function(a){c.vec3d.set(a._eye,this._eye);c.vec3d.set(a._center,this._center);c.vec3d.set(a._up,this._up);c.vec4d.set(a._viewport,this._viewport);c.vec4d.set(a._padding,this._padding);this._near=a._near;this._far=a._far;this._fov=a._fov;this.aboveGround=a.aboveGround;a._viewDirty?this._viewDirty=!0:(c.mat4d.set(a._viewMatrix, this._viewMatrix),c.vec3d.set(a._viewRight,this._viewRight),c.vec3d.set(a._viewUp,this._viewUp),c.vec3d.set(a._viewForward,this._viewForward),this._viewDirty=!1);a._projectionDirty?this._projectionDirty=!0:(c.mat4d.set(a._projectionMatrix,this._projectionMatrix),this._projectionDirty=!1);this._viewProjectionDirty=!0;a._frustumPlanesDirty?this._frustumPlanesDirty=!0:(a.copyFrustumPlanes(this._frustumPlanes),this._frustumPlanesDirty=!1);a._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty= !0:(this._viewInverseTransposeMatrix?c.mat4d.set(a._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix):this._viewInverseTransposeMatrix=c.mat4d.create(a._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1);a._fullViewport?this._fullViewport?c.vec4d.set(a._fullViewport,this._fullViewport):this._fullViewport=c.vec4d.create(a._fullViewport):this._fullViewport=null;return this};b.prototype.copyViewFrom=function(a){this.eye=a.eye;this.center=a.center;this.up=a.up};b.prototype.copy= function(){var a=new b;a.copyFrom(this);return a};b.prototype.equivalent=function(a){return k(this._eye,a._eye)&&k(this._center,a._center)&&k(this._up,a._up)&&q(this._viewport,a._viewport)&&q(this._padding,a._padding)&&this._near===a._near&&this._far===a._far&&this._fov===a._fov};b.prototype.almostEquals=function(a,b,e){void 0===e&&(e=!1);b=c.vec3d.dist(this._eye,this._center)*(b||5E-4);b*=b;e?(c.vec3d.direction(a._center,a._eye,f),c.vec3d.direction(this._center,this._eye,l),e=1E-10):(c.vec3d.set(a._center, f),c.vec3d.set(this._center,l),e=b);return c.vec3d.dist2(a._eye,this._eye)<b&&c.vec3d.dist2(f,l)<e&&.001>Math.abs(a._fov-this._fov)&&.5>p(a._padding,this._padding)&&.5>p(a._viewport,this._viewport)};b.prototype.markViewDirty=function(){this._viewProjectionDirty=this._frustumPlanesDirty=this._viewDirty=!0};b.prototype.computePixelSizeAt=function(a){return this.computePixelSizeAtDist(c.vec3d.dist(a,this._eye))};b.prototype.computePixelSizeAtDist=function(a){return 2*a*Math.tan(this.fovX/2)/this.width}; b.prototype.computeDistanceFromRadius=function(a,c){return a/Math.tan(Math.min(this.fovX,this.fovY)/(2*(c||1)))};b.prototype.copyFrustumPlanes=function(a){if(!a){a=Array(6);for(var b=0;6>b;++b)a[b]=c.vec4d.create()}for(var e=this.frustumPlanes,b=0;6>b;b++)c.vec4d.set(e[b],a[b]);return a};b.prototype.computeFrustumPoints=function(a){if(!a){a=Array(8);for(var b=0;8>b;++b)a[b]=c.vec3d.create()}g.matrixToFrustumPoints(this.viewMatrix,this.projectionMatrix,a);return a};b.prototype.setGLViewport=function(a){var c= this.viewport,b=this.padding;a.setViewport(c[0]-b[3],c[1]-b[2],c[2]+b[1]+b[3],c[3]+b[0]+b[2])};b.prototype.applyProjection=function(a,b,e){void 0===e&&(e=!1);a!==d&&c.vec3d.set(a,d);d[3]=1;e&&(b[2]=-d[2]);c.mat4d.multiplyVec4(this.projectionMatrix,d);c.vec3d.scale(d,1/Math.abs(d[3]));a=this.fullViewport;b[0]=g.lerp(0,a[0]+a[2],.5+.5*d[0]);b[1]=g.lerp(0,a[1]+a[3],.5+.5*d[1]);e||(b[2]=.5*(d[2]+1));return b};b.prototype.projectPoint=function(a,b){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=1;c.mat4d.multiplyVec4(this.viewProjectionMatrix, d);c.vec3d.scale(d,1/Math.abs(d[3]));a=this.fullViewport;b[0]=g.lerp(0,a[0]+a[2],.5+.5*d[0]);b[1]=g.lerp(0,a[1]+a[3],.5+.5*d[1]);b[2]=.5*(d[2]+1);return b};b.prototype.unprojectPoint=function(a,b,e){void 0===e&&(e=!1);if(e)return console.error("Camera.unprojectPoint() not yet implemented for linear Z"),null;c.mat4d.multiply(this.projectionMatrix,this.viewMatrix,m);if(!c.mat4d.inverse(m))return null;e=this.fullViewport;d[0]=2*(a[0]-e[0])/e[2]-1;d[1]=2*(a[1]-e[1])/e[3]-1;d[2]=2*a[2]-1;d[3]=1;c.mat4d.multiplyVec4(m, d);if(0===d[3])return null;b[0]=d[0]/d[3];b[1]=d[1]/d[3];b[2]=d[2]/d[3];return b};b.prototype.computeUp=function(a){"global"===a?this.computeUpGlobal():this.computeUpLocal()};b.prototype.computeUpGlobal=function(){c.vec3d.subtract(this.center,this.eye,f);var a=c.vec3d.length(this.center);1>a?(c.vec3d.set3(0,0,1,this.up),this.markViewDirty()):Math.abs(c.vec3d.dot(f,this.center))>.9999*c.vec3d.length(f)*a||(c.vec3d.cross(f,this.center,this.up),c.vec3d.cross(this.up,f,this.up),c.vec3d.normalize(this.up), this.markViewDirty())};b.prototype.computeUpLocal=function(){c.vec3d.direction(this.center,this.eye,f);.9999>=Math.abs(f[2])&&(c.vec3d.scale(f,f[2]),c.vec3d.set3(-f[0],-f[1],1-f[2],this.up),c.vec3d.normalize(this.up),this.markViewDirty())};b.prototype._compareAndSetView=function(a,b){k(a,b)||(c.vec3d.set(a,b),this._viewProjectionDirty=this._frustumPlanesDirty=this._viewDirty=!0)};b.prototype._computeFrustumPlanes=function(a){if(!a){a=Array(6);for(var b=0;6>b;++b)a[b]=h.plane.create()}g.matrixToFrustumPlanes(this.viewMatrix, this.projectionMatrix,a);return a};b.prototype._ensureViewClean=function(){this._viewDirty&&(c.mat4d.lookAt(this._eye,this._center,this._up,this._viewMatrix),c.vec3d.set3(-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10],this._viewForward),c.vec3d.set3(this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9],this._viewUp),c.vec3d.set3(this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8],this._viewRight),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)};return b}(); var d=c.vec4d.create(),m=c.mat4d.create(),f=c.vec3d.create(),l=c.vec3d.create();return n});
/* * Merge objects into the first one */ exports.merge = function (defaults) { for (var i = 1; i < arguments.length; i++) { for (var opt in arguments[i]) { defaults[opt] = arguments[i][opt]; } } return defaults; };
(function ($) { $.enableActionButtons = function() { $('.formsContainer .formItem:eq('+ $.currentItem +') .continue',$.jq).removeClass('disabled'); $('.formsContainer .formItem:eq('+ $.currentItem +') .submit',$.jq).removeClass('disabled'); } $.disableActionButtons = function() { $('.formsContainer .formItem:eq('+ $.currentItem +') .continue',$.jq).addClass('disabled'); $('.formsContainer .formItem:eq('+ $.currentItem +') .submit',$.jq).addClass('disabled'); } $.setInitForm = function( frm ) { return $.jq.html( '<h4 class="title"></h4>'+ '<div class="auxlabel">auxlabel text</div>'+ '<hr/>'+ '<form class="form-horizontal">'+ '<div class="formsContainer">'+ '</div>'+ '</form>'+ '<div class="contactPager col-sm-offset-2">'+ '<ul class="pagination pagination-md"></ul>'+ '</div>' ).promise(); } $.setCurrentForm = function() { var frm = $.formItems[$.currentItem]; $('.title',$.jq).text(frm.label); $('.formsContainer .formItem',$.jq).css('visibility','hidden'); if ( $('.formItem',$.jq).length > $.currentItem ) $('.formsContainer:eq('+ $.currentItem +')',$.jq).css('visibility','visible'); else { var htmlForm = '<div class="formItem">'; $.each( frm.inputs, function(i,item) { htmlForm += '<div id="'+ item.id +'" class="form-group">'+ '<label for="'+ $.currentItem +'.'+ i +'" class="col-sm-2 control-label">'+ item.label + ( (item.required)? ' '+ $.config.requiredLabelSuffix : '' ) +'</label>'+ '<div class="col-sm-4">'+ '<input id="'+ $.currentItem +'.'+ i +'" type="'+ item.type +'" class="form-control" '+ ( (item.required)? 'required' : '' ) +'>'+ '</div>'+ '</div>'; }); htmlForm +='<button type="button" class="submit btn btn-warning col-sm-offset-2 disabled">'+ $.config.submitButtonLabel +'</button>'+ '<button type="button" class="continue btn btn-info col-sm-offset-1 disabled">'+ $.config.continueButtonLabel +'</button>'+ '</div>'; // // Input change // $('.formsContainer',$.jq).append(htmlForm).promise().done( function() { $('.formsContainer .formItem:eq('+ $.currentItem +') input',$.jq).change( function(){ var inputInd = $(this).attr('id').split('.')[1]; frm.inputs[inputInd].value = $(this).val(); $('.auxlabel',$.jq).text( 'Input ['+ inputInd +'] cambiado por ['+ frm.inputs[inputInd].value +']' ); $.enableActionButtons(); $.each(frm.inputs, function(i,item) { if ( item.required && (item.value == '' || typeof(item.value) === 'undefined') ) { $.disableActionButtons(); } }); }); }); } switch( frm.type ) { case 'simple-choice': { } } } $.fn.setFunction = function () { $.totalItems++; $(".contactPager").pagy( "page", $.totalItems, $.totalItems); $( '.contactPager', $.jq ).css('visibility','visible'); //$(".contactPager").pagy("lastPage"); return; }; $.fn.contactform = function( conf ) { $.jq = this; $.id = this.attr('id'); $.formItems = []; $.currentItem = 0; $.config = $.extend( { continueButtonLabel: 'Continuar &rarr;', submitButtonLabel: 'Enviar', requiredLabelSuffix: '(*)' }, conf ); $.totalItems = 1; $.formItems.push($.config.form); $.setInitForm( $.config.form ).done( function(){ $.setCurrentForm(); }); jQuery(function($) { $( '.contactPager', $.jq ).pagy({ totalItems: 1, currentPage: 1, page: function(page) { $('button.continue', $.jq ).html( 'Continuar ('+ page +') &rarr;'); return true; } }); $( '.contactPager', $.jq ).css('visibility','hidden'); }); }; })(jQuery);
version https://git-lfs.github.com/spec/v1 oid sha256:b83701461fa9436c0fccaaa3c6878651f714a75f787014e6ae3c2cdc7fde6dd4 size 19091
var express = require('express'), controller = App.require('controllers/login'), router = express.Router(); router.get('/', controller.show); router.post('/', controller.login); router.get('/logout', controller.logout); module.exports = router;
'use strict'; var JSONP = { loadData: function (url) { // Create the script node var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; // Place the script in the page to execute and retrieve data document.body.appendChild(script); } }; module.exports = JSONP; //function characterLoad(data) { // window.data.character = data; // renderApp(); //} // //function directiveTreeCategoryLoad(data) { // window.data.directiveTreeCategories = data; // // Don't load trees until categories are loaded // loadData(directiveTreeUrl); //} // //function directiveTreeLoad(data) { // window.data.directiveTrees = data; // // Don't load tiers until trees are loaded // loadData(directiveTierUrl); //} // //function directiveTierLoad(data) { // window.data.directiveTiers = data; // loadData(directiveUrl); //} // //function directiveLoad(data) { // window.data.directives = data; // renderApp(); //} // //loadData(characterUrl); //// Kick off the load chain //loadData(directiveTreeCategoryUrl);
/** * If individual components are tested on their own then might not need to test this module that brings them togethere. * - converting video/audio to webm * - converting video/audio to text with audio side effect * - read video/audio metadata * * * */
/** * Person_ClassBonusController * * @description :: Server-side logic for managing Person_classbonuses * @help :: See http://links.sailsjs.org/docs/controllers */ module.exports = { Delete: function (req, res) { var ids = req.param("class_bonus_ids"); if ( ids == null ) { return res.send(400); } console.log(JSON.parse(ids)); JSON.parse(ids).forEach(function (each_id) { Person_ClassBonus.destroy({class_bonus_id: each_id}).exec(function(err) { console.log("deleted class bonus with id: ", each_id); }); }); return res.send(ids); }, createIfNotExists: function(req, res) { var cbParams = req.allParams(); delete cbParams.id; Person_ClassBonus.findOrCreate(cbParams, cbParams).exec(function(err, record) { if ( err ) { return res.send(400, err); } return res.send(record); }); }, };
/** * Selfbits API V2 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: 2.0.0 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); //# sourceMappingURL=SendVerificationEmailResponse.js.map
/* * Kendo UI Web v2012.2.710 (http://kendoui.com) * Copyright 2012 Telerik AD. All rights reserved. * * Kendo UI Web commercial licenses may be obtained at http://kendoui.com/web-license * If you do not own a commercial license, this file shall be governed by the * GNU General Public License (GPL) version 3. * For GPL requirements, please review: http://www.gnu.org/copyleft/gpl.html */ (function( window, undefined ) { kendo.cultures["ar-LB"] = { name: "ar-LB", numberFormat: { pattern: ["n-"], decimals: 2, ",": ",", ".": ".", groupSize: [3], percent: { pattern: ["-n %","n %"], decimals: 2, ",": ",", ".": ".", groupSize: [3], symbol: "%" }, currency: { pattern: ["$n-","$ n"], decimals: 2, ",": ",", ".": ".", groupSize: [3], symbol: "ل.ل.‏" } }, calendars: { standard: { days: { names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"], namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"], namesShort: ["ح","ن","ث","ر","خ","ج","س"] }, months: { names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""], namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""] }, AM: ["ص","ص","ص"], PM: ["م","م","م"], patterns: { d: "dd/MM/yyyy", D: "dd MMMM, yyyy", F: "dd MMMM, yyyy hh:mm:ss tt", g: "dd/MM/yyyy hh:mm tt", G: "dd/MM/yyyy hh:mm:ss tt", m: "dd MMMM", M: "dd MMMM", s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss", t: "hh:mm tt", T: "hh:mm:ss tt", u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'", y: "MMMM, yyyy", Y: "MMMM, yyyy" }, "/": "/", ":": ":", firstDay: 1 } } } })(this); ;
// The `Manager` class is a wrapper around an [nssocket](https://github.com/nodejitsu/nssocket) server. // Through this class, editors notify the backend of changes to file buffers. // // The Sublime Text plugin maintains a single TCP socet connection accross all tabs and windows. import nssocket from 'nssocket'; import logger from '../support/logger'; import { EventEmitter } from 'events'; export default class Manager extends EventEmitter { constructor(options) { super(); this.options = options || {}; this.port = this.options.port || 48627; this.logger = this.options.logger || logger.silentLogger(); // Create an nssocket server this.server = nssocket.createServer(socket => { this.socket = socket; this.logger.info("editor connected"); this.socket.data(['editor', 'reset'], this.handleReset.bind(this)); this.socket.data(['editor', 'update'], this.handleUpdate.bind(this)); return this.socket.on('close', () => { return this.logger.warn("editor disconnected"); }); }); } start(callback) { return this.server.listen(this.port, () => { this.logger.info(`editor server listening on ${this.port}`); if (callback) { return callback(); } }); } stop(callback) { return this.server.close(callback); } // A `buffer:reset` message is emitted by the editor when changes to a file are discarded. handleReset(data) { data = data || {}; let { path } = data; this.logger.debug("buffer reset", path); return this.emit('buffer:reset', {path}); } // A `buffer:update` message is emitted by the editor when a file buffer is changed. handleUpdate(data) { data = data || {}; if (!data.path) { this.logger.warn('Regecting update (invalid format)'); return; } let { path } = data; let { buffer } = data; let timestamp = data.created_at; this.logger.info(`buffer updated for ${path}`); return this.emit('buffer:update', { path, buffer, timestamp }); } }
"use strict"; var application_root = __dirname, express = require('express'), path = require('path'), bodyParser = require('body-parser'), methodOverride = require('method-override'), http = require('http'), swig = require('swig'), app = express(); require('node-jsx').install({extension: '.jsx'}) app.engine('html', swig.renderFile) app.set('view engine', 'html'); app.set('views', application_root + '/views') app.use(bodyParser.json()); app.use(methodOverride()); app.use('/public', express.static(path.join(application_root, 'public'))); app.get('/health', function (req, res) { res.status(200).send('ok!'); }); // routes var baseRoutes = require('./routes/baseRoutes')(app); // 404 app.get('*', function(req, res, next){ res.status(404).render('layouts/404'); }); // 500 app.use(function(err, req, res, next){ console.error(err.stack); res.status(500).render('layouts/500'); }); var server = app.listen(3000, function () { let host = server.address().address; let port = server.address().port; console.log(`Example app listening at http://${host}:${port}`); });
/* @flow */ import arrayEach from './arrayEach' const basicStatics = { name: true, length: true, prototype: true, caller: true, callee: true, arguments: true, arity: true } const mergableStatics = [ 'childContextTypes', 'contextTypes', 'defaultProps', 'propTypes' ] export default function hoistStatics(target: Object, source: Object): Object { if (typeof source === 'string') { return target } const statics = Object.getOwnPropertyNames(source).filter( property => !basicStatics[property] ) arrayEach(statics, property => { if (!target.hasOwnProperty(property)) { try { // Avoid failures from read-only properties const descriptor = Object.getOwnPropertyDescriptor(source, property) Object.defineProperty(target, property, descriptor) } catch (e) {} } }) arrayEach(mergableStatics, property => { if (source[property]) { const targetStatics = target[property] || {} target[property] = { ...source[property], ...targetStatics } } }) return target }
import { Category } from '../../../stories/storiesHierarchy'; const PageWithScrollConstants = (function () { const SAFETY = 5; const pageHeight = 500; const pageBottomPadding = 48; const headerContainerHeight = 156; const minimizedHeaderContainerHeight = 67; const scrollTrigger = headerContainerHeight - minimizedHeaderContainerHeight + SAFETY; const maxScrollNoTrigger = headerContainerHeight - minimizedHeaderContainerHeight - SAFETY; return { scrollTrigger, maxScrollNoTrigger, minimizedHeaderContainerHeight, headerContainerHeight, pageBottomPadding, pageHeight, }; })(); export const storySettings = { category: Category.COMPONENTS, storyName: 'Page', dataHook: 'story-page', PageWithScrollConstants, };
let foo = 10; let bar = 20; export { foo as default, bar };
'use strict'; var config = require('./build/build.config.js'); var karmaConfig = require('./build/karma.config.js'); var protractorConfig = require('./build/protractor.config.js'); var gulp = require('gulp'); var $ = require('gulp-load-plugins')(); var runSequence = require('run-sequence'); var browserSync = require('browser-sync'); var reload = browserSync.reload; var pkg = require('./package'); var karma = require('karma').server; var del = require('del'); var _ = require('lodash'); /* jshint camelcase:false*/ var webdriverStandalone = require('gulp-protractor').webdriver_standalone; var webdriverUpdate = require('gulp-protractor').webdriver_update; //update webdriver if necessary, this task will be used by e2e task gulp.task('webdriver:update', webdriverUpdate); // run unit tests and watch files gulp.task('tdd', function(cb) { karma.start(_.assign({}, karmaConfig, { singleRun: false, action: 'watch', browsers: ['PhantomJS'] }), cb); }); // run unit tests with travis CI gulp.task('travis', ['build'], function(cb) { karma.start(_.assign({}, karmaConfig, { singleRun: true, browsers: ['PhantomJS'] }), cb); }); // optimize images and put them in the dist folder gulp.task('images', function() { return gulp.src(config.images) .pipe($.imagemin({ progressive: true, interlaced: true })) .pipe(gulp.dest(config.dist + '/assets/images')) .pipe($.size({ title: 'images' })); }); //generate angular templates using html2js gulp.task('templates', function() { return gulp.src(config.tpl) .pipe($.changed(config.tmp)) .pipe($.html2js({ outputModuleName: 'templates', base: 'client', useStrict: true })) .pipe($.concat('templates.js')) .pipe(gulp.dest(config.tmp)) .pipe($.size({ title: 'templates' })); }); //generate css files from scss sources gulp.task('sass', function() { return gulp.src(config.mainScss) .pipe($.sass()) .on('error', $.sass.logError) .pipe(gulp.dest(config.tmp)) .pipe($.size({ title: 'sass' })); }); //generate css files from less sources gulp.task('less', function () { return gulp.src(config.less) .pipe(less()) .pipe(gulp.dest(config.tmp)) .pipe($.size({ title: 'less' })); }); //build files for creating a dist release gulp.task('build:dist', ['clean'], function(cb) { runSequence(['jshint', 'build', 'copy', 'copy:assets', 'images', 'test:unit'], 'html', cb); }); //build files for development gulp.task('build', ['clean'], function(cb) { runSequence(['sass', 'templates'], cb); //runSequence(['less', 'templates'], cb); }); //generate a minified css files, 2 js file, change theirs name to be unique, and generate sourcemaps gulp.task('html', function() { var assets = $.useref.assets({ searchPath: '{build,client}' }); return gulp.src(config.index) .pipe(assets) .pipe($.sourcemaps.init()) .pipe($.if('**/*main.js', $.ngAnnotate())) .pipe($.if('*.js', $.uglify({ mangle: false, }))) .pipe($.if('*.css', $.csso())) .pipe($.if(['**/*main.js', '**/*main.css'], $.header(config.banner, { pkg: pkg }))) .pipe($.rev()) .pipe(assets.restore()) .pipe($.useref()) .pipe($.revReplace()) .pipe($.if('*.html', $.minifyHtml({ empty: true }))) .pipe($.sourcemaps.write()) .pipe(gulp.dest(config.dist)) .pipe($.size({ title: 'html' })); }); //copy assets in dist folder gulp.task('copy:assets', function() { return gulp.src(config.assets, { dot: true }).pipe(gulp.dest(config.dist + '/assets')) .pipe($.size({ title: 'copy:assets' })); }); //copy assets in dist folder gulp.task('copy', function() { return gulp.src([ config.base + '/*', '!' + config.base + '/*.html', '!' + config.base + '/src', '!' + config.base + '/test' ]).pipe(gulp.dest(config.dist)) .pipe($.size({ title: 'copy' })); }); //clean temporary directories gulp.task('clean', del.bind(null, [config.dist, config.tmp])); //lint files gulp.task('jshint', function() { return gulp.src(config.js) .pipe(reload({ stream: true, once: true })) .pipe($.jshint()) .pipe($.jshint.reporter('jshint-stylish')) .pipe($.if(!browserSync.active, $.jshint.reporter('fail'))); }); /* tasks supposed to be public */ //default task gulp.task('default', ['serve']); // //run unit tests and exit gulp.task('test:unit', ['build'], function(cb) { karma.start(_.assign({}, karmaConfig, { singleRun: true }), cb); }); // Run e2e tests using protractor, make sure serve task is running. gulp.task('test:e2e', ['webdriver:update'], function() { return gulp.src(protractorConfig.config.specs) .pipe($.protractor.protractor({ configFile: 'build/protractor.config.js' })) .on('error', function(e) { throw e; }); }); //run the server, watch for file changes and redo tests. gulp.task('serve:tdd', function(cb) { runSequence(['serve', 'tdd'], cb); }); //run the server after having built generated files, and watch for changes gulp.task('serve', ['build'], function() { browserSync({ port: config.port, ui: { port: config.uiPort }, notify: false, logPrefix: pkg.name, server: ['build', 'client'] }); gulp.watch(config.html, reload); gulp.watch(config.scss, ['sass', reload]); gulp.watch(config.less, ['less', reload]); gulp.watch(config.js, ['jshint']); gulp.watch(config.tpl, ['templates', reload]); gulp.watch(config.assets, reload); }); //run the app packed in the dist folder gulp.task('serve:dist', ['build:dist'], function() { browserSync({ port: config.port, ui: { port: config.uiPort }, notify: false, server: [config.dist] }); });
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * GET /login * Login page. */ exports.getPage = (req, res) => { res.render("clo_shop", { title: "Der Dorfladen" }); }; //# sourceMappingURL=clo_shop.js.map
import {describe, it} from 'mocha' import expect from 'expect' import * as ColorMath from '../src' const getLessEvaluator = (e => () => e || (e = new ColorMath.Evaluators.LessEvaluator()))() describe('LessEvaluator', () => { const expr = (e, r) => { const result = ColorMath.evaluate(e, { evaluator: getLessEvaluator(), }) if (result.error) { throw new Error(result.error) } if (typeof r === 'function') { expect(r(result.resultStr)).toBeTruthy() } else { expect(result.resultStr).toBe(r) } } it('should define colors in different formats', () => { expr('#ffcc00', '#ffcc00') expr('ffcc00', '#ffcc00') expr('#fc0', '#fc0') expr('fc0', '#fc0') expr('aquamarine', 'aquamarine') expr('skyblue', 'skyblue') expr('tomato', 'tomato') }) it('should define colors using different color models', () => { expr('rgb 127 255 212', 'rgb(127, 255, 212)') expr('rgba 135 206 235 75%', 'rgba(135, 206, 235, 75%)') expr('argb .7 255 99 71', 'argb(0.7, 255, 99, 71)') expr('hsl 159.8 100% 75%', 'hsl(159.8, 100%, 75%)') expr('hsla 197 .71 .73 55%', 'hsla(197, 0.71, 0.73, 55%)') expr('hsv 160 .5 1', 'hsv(160, 0.5, 1)') expr('hsb 197 .43 .92', 'hsv(197, 0.43, 0.92)') expr('hsva 9 .72 1 50%', 'hsva(9, 0.72, 1, 50%)') }) it('should support operations with colors', () => { expr('#444 * 2', '#444 * 2') expr('skyblue - 0xf', 'skyblue - 15') expr('~red', '(#fff - red)') expr('red | green', 'mix(red, green)') expr('red | {25%} green', 'mix(red, green, 25%)') expr('hotpink << 50%', 'desaturate(hotpink, 50%, relative)') expr('rgb 165 42 42 >> .2', 'saturate(rgb(165, 42, 42), 20%, relative)') expr('red <<< 30%', 'darken(red, 30%, relative)') expr('#fc0 >>> 70%', 'lighten(#fc0, 70%, relative)') }) it('should support blending colors', () => { expr('#222 + #444', '#222 + #444') expr('#ccc - #111', '#ccc - #111') expr('#ff6600 * #ccc', 'multiply(#ff6600, #ccc)') expr('#222 / #444', '#222 / #444') expr('#ff6600 !* #00ff00', 'screen(#ff6600, #00ff00)') expr('#ff6600 ** #999', 'overlay(#ff6600, #999)') expr('olive <* pink', 'hardlight(olive, pink)') expr('olive *> pink', 'softlight(olive, pink)') expr('ffcc00 ^* ccc', 'difference(#ffcc00, #ccc)') expr('ffcc00 ^^ ccc', 'exclusion(#ffcc00, #ccc)') expr('ffcc00 !^ ccc', 'negation(#ffcc00, #ccc)') }) it('should support operations with color channels', () => { expr('brown @red', 'red(brown)') expr('#ffcc00 @g', 'green(#ffcc00)') expr('olive @a', 'alpha(olive)') expr('aquamarine @a = .3', 'fade(aquamarine, 30%)') }) it('should support operations with numbers', () => { expr('0b01101001', '105') expr('0o151', '105') expr('105', '105') expr('0x69', '105') expr('55%', '55%') expr('5 + 10', '5 + 10') expr('-360 * 0.5 + (100 - 40)', '-360 * 0.5 + (100 - 40)') expr('0xf / 0b1010', '15 / 10') expr('2 ^ 14', 'pow(2, 14)') expr('4 ^ (2 / 4)', 'pow(4, 2 / 4)') }) it('should support list definition', () => { expr('red 0f0 blue', 'red #0f0 blue') expr('(pink >> .5) gold', '(saturate(pink, 50%, relative)) gold') }) it('should support brewer constants', () => { expr('YlOrBr', '#ffffe5 #fff7bc #fee391 #fec44f #fe9929 #ec7014 #cc4c02 #993404 #662506') expr('PRGn', '#40004b #762a83 #9970ab #c2a5cf #e7d4e8 #f7f7f7 #d9f0d3 #a6dba0 #5aae61 #1b7837 #00441b') }) it('should support variables and statements', () => { expr('$col = rgb 255 204 0', '@col: rgb(255, 204, 0)') expr('$num = 2^8 - 1', '@num: pow(2, 8) - 1') expr('$lst = #444 #888', '@lst: #444 #888') }) })
import PropTypes from 'prop-types'; import React, { PureComponent } from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { loadingData, loadedData } from '/imports/ui/redux/actions'; const defaultOps = { delay: 200, placeholder: null, wait: true, // 是否等到数据加载完毕后再显示 loose: true, // 是否移除data相关props }; const withDataReadyHandler = (ops) => (WrappedComponent) => { const options = Object.assign({}, defaultOps, ops); class C extends PureComponent { static displayName = `withDataReadyHandler(${WrappedComponent.displayName || WrappedComponent.name})` static propTypes = { isDataReady: PropTypes.bool.isRequired, loadingData: PropTypes.func.isRequired, loadedData: PropTypes.func.isRequired, } constructor(props) { super(props); this._timeout = null; this.state = { pastDelay: false, }; } componentWillMount() { if (!this.props.isDataReady) { this.props.loadingData(); } if (options.placeholder) { this._timeout = setTimeout(() => this.setState({ pastDelay: true }), options.delay); } } componentWillReceiveProps(nextProps) { if (this.props.isDataReady !== nextProps.isDataReady) { if (nextProps.isDataReady) { this.props.loadedData(); } else { this.props.loadingData(); } } } componentWillUnmount() { if (!this.props.isDataReady) { this.props.loadedData(); } if (this._timeout) { clearTimeout(this._timeout); this._timeout = null; } } render() { const { placeholder, wait, loose, } = options; const { isDataReady, loadingData, // eslint-disable-line no-shadow loadedData, // eslint-disable-line no-shadow ...rest } = this.props; const remainedProps = loose ? rest : this.props; return wait ? isDataReady ? <WrappedComponent {...remainedProps} /> : this.state.pastDelay && placeholder : <WrappedComponent {...remainedProps} />; } } const mapDispatchToProps = (dispatch) => bindActionCreators({ loadingData, loadedData, }, dispatch); return connect(null, mapDispatchToProps)(C); }; export default withDataReadyHandler;
import 'angular-material'; import angular from 'angular'; import CountdownController from './countdown-controller'; import CountdownDirective from './countdown-directive'; const module = angular.module('app.countdown-directive', ['ngMaterial']); CountdownController.register(module); CountdownDirective.register(module); export default module;
//requires var express = require('express') var app = express() var handlebars = require('express-handlebars').create({defaultLayout: 'main'}) //configs app.set('port', process.env.PORT || 80) app.engine('handlebars', handlebars.engine) app.set('view engine', 'handlebars') app.use(express.static(__dirname + '/public')) //utils //makes sure all your sessions are in order function getSession() { var session = 'fred' return session } //routes app.get('/', function (req, res) { if (getSession() == '') { res.render('landing', { title:title, layout:"bars" }); } else { res.render('app') } }) app.get('/api', function (req, res) { // this will render the landing page for the api }) app.post('/api', function (req, res) { if (getSession() == '') { res.send('API acess denied. Begone!') } else { // DB code here } }) app.listen(app.get('port'), function () { console.log('Express started on port 80 Press Ctrl-C to terminate.') })
;(function(){ // CommonJS require() function require(p){ var path = require.resolve(p) , mod = require.modules[path]; if (!mod) throw new Error('failed to require "' + p + '"'); if (!mod.exports) { mod.exports = {}; mod.call(mod.exports, mod, mod.exports, require.relative(path)); } return mod.exports; } require.modules = {}; require.resolve = function (path){ var orig = path , reg = path + '.js' , index = path + '/index.js'; return require.modules[reg] && reg || require.modules[index] && index || orig; }; require.register = function (path, fn){ require.modules[path] = fn; }; require.relative = function (parent) { return function(p){ if ('.' != p.charAt(0)) return require(p); var path = parent.split('/') , segs = p.split('/'); path.pop(); for (var i = 0; i < segs.length; i++) { var seg = segs[i]; if ('..' == seg) path.pop(); else if ('.' != seg) path.push(seg); } return require(path.join('/')); }; }; require.register("browser/debug.js", function(module, exports, require){ module.exports = function(type){ return function(){ } }; }); // module: browser/debug.js require.register("browser/diff.js", function(module, exports, require){ /* See LICENSE file for terms of use */ /* * Text diff implementation. * * This library supports the following APIS: * JsDiff.diffChars: Character by character diff * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace * JsDiff.diffLines: Line based diff * * JsDiff.diffCss: Diff targeted at CSS content * * These methods are based on the implementation proposed in * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986). * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927 */ var JsDiff = (function() { /*jshint maxparams: 5*/ function clonePath(path) { return { newPos: path.newPos, components: path.components.slice(0) }; } function removeEmpty(array) { var ret = []; for (var i = 0; i < array.length; i++) { if (array[i]) { ret.push(array[i]); } } return ret; } function escapeHTML(s) { var n = s; n = n.replace(/&/g, '&amp;'); n = n.replace(/</g, '&lt;'); n = n.replace(/>/g, '&gt;'); n = n.replace(/"/g, '&quot;'); return n; } var Diff = function(ignoreWhitespace) { this.ignoreWhitespace = ignoreWhitespace; }; Diff.prototype = { diff: function(oldString, newString) { // Handle the identity case (this is due to unrolling editLength == 0 if (newString === oldString) { return [{ value: newString }]; } if (!newString) { return [{ value: oldString, removed: true }]; } if (!oldString) { return [{ value: newString, added: true }]; } newString = this.tokenize(newString); oldString = this.tokenize(oldString); var newLen = newString.length, oldLen = oldString.length; var maxEditLength = newLen + oldLen; var bestPath = [{ newPos: -1, components: [] }]; // Seed editLength = 0 var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); if (bestPath[0].newPos+1 >= newLen && oldPos+1 >= oldLen) { return bestPath[0].components; } for (var editLength = 1; editLength <= maxEditLength; editLength++) { for (var diagonalPath = -1*editLength; diagonalPath <= editLength; diagonalPath+=2) { var basePath; var addPath = bestPath[diagonalPath-1], removePath = bestPath[diagonalPath+1]; oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; if (addPath) { // No one else is going to attempt to use this value, clear it bestPath[diagonalPath-1] = undefined; } var canAdd = addPath && addPath.newPos+1 < newLen; var canRemove = removePath && 0 <= oldPos && oldPos < oldLen; if (!canAdd && !canRemove) { bestPath[diagonalPath] = undefined; continue; } // Select the diagonal that we want to branch from. We select the prior // path whose position in the new string is the farthest from the origin // and does not pass the bounds of the diff graph if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) { basePath = clonePath(removePath); this.pushComponent(basePath.components, oldString[oldPos], undefined, true); } else { basePath = clonePath(addPath); basePath.newPos++; this.pushComponent(basePath.components, newString[basePath.newPos], true, undefined); } var oldPos = this.extractCommon(basePath, newString, oldString, diagonalPath); if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) { return basePath.components; } else { bestPath[diagonalPath] = basePath; } } } }, pushComponent: function(components, value, added, removed) { var last = components[components.length-1]; if (last && last.added === added && last.removed === removed) { // We need to clone here as the component clone operation is just // as shallow array clone components[components.length-1] = {value: this.join(last.value, value), added: added, removed: removed }; } else { components.push({value: value, added: added, removed: removed }); } }, extractCommon: function(basePath, newString, oldString, diagonalPath) { var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath; while (newPos+1 < newLen && oldPos+1 < oldLen && this.equals(newString[newPos+1], oldString[oldPos+1])) { newPos++; oldPos++; this.pushComponent(basePath.components, newString[newPos], undefined, undefined); } basePath.newPos = newPos; return oldPos; }, equals: function(left, right) { var reWhitespace = /\S/; if (this.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right)) { return true; } else { return left === right; } }, join: function(left, right) { return left + right; }, tokenize: function(value) { return value; } }; var CharDiff = new Diff(); var WordDiff = new Diff(true); var WordWithSpaceDiff = new Diff(); WordDiff.tokenize = WordWithSpaceDiff.tokenize = function(value) { return removeEmpty(value.split(/(\s+|\b)/)); }; var CssDiff = new Diff(true); CssDiff.tokenize = function(value) { return removeEmpty(value.split(/([{}:;,]|\s+)/)); }; var LineDiff = new Diff(); LineDiff.tokenize = function(value) { return value.split(/^/m); }; return { Diff: Diff, diffChars: function(oldStr, newStr) { return CharDiff.diff(oldStr, newStr); }, diffWords: function(oldStr, newStr) { return WordDiff.diff(oldStr, newStr); }, diffWordsWithSpace: function(oldStr, newStr) { return WordWithSpaceDiff.diff(oldStr, newStr); }, diffLines: function(oldStr, newStr) { return LineDiff.diff(oldStr, newStr); }, diffCss: function(oldStr, newStr) { return CssDiff.diff(oldStr, newStr); }, createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) { var ret = []; ret.push('Index: ' + fileName); ret.push('==================================================================='); ret.push('--- ' + fileName + (typeof oldHeader === 'undefined' ? '' : '\t' + oldHeader)); ret.push('+++ ' + fileName + (typeof newHeader === 'undefined' ? '' : '\t' + newHeader)); var diff = LineDiff.diff(oldStr, newStr); if (!diff[diff.length-1].value) { diff.pop(); // Remove trailing newline add } diff.push({value: '', lines: []}); // Append an empty value to make cleanup easier function contextLines(lines) { return lines.map(function(entry) { return ' ' + entry; }); } function eofNL(curRange, i, current) { var last = diff[diff.length-2], isLast = i === diff.length-2, isLastOfType = i === diff.length-3 && (current.added !== last.added || current.removed !== last.removed); // Figure out if this is the last line for the given file and missing NL if (!/\n$/.test(current.value) && (isLast || isLastOfType)) { curRange.push('\\ No newline at end of file'); } } var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1; for (var i = 0; i < diff.length; i++) { var current = diff[i], lines = current.lines || current.value.replace(/\n$/, '').split('\n'); current.lines = lines; if (current.added || current.removed) { if (!oldRangeStart) { var prev = diff[i-1]; oldRangeStart = oldLine; newRangeStart = newLine; if (prev) { curRange = contextLines(prev.lines.slice(-4)); oldRangeStart -= curRange.length; newRangeStart -= curRange.length; } } curRange.push.apply(curRange, lines.map(function(entry) { return (current.added?'+':'-') + entry; })); eofNL(curRange, i, current); if (current.added) { newLine += lines.length; } else { oldLine += lines.length; } } else { if (oldRangeStart) { // Close out any changes that have been output (or join overlapping) if (lines.length <= 8 && i < diff.length-2) { // Overlapping curRange.push.apply(curRange, contextLines(lines)); } else { // end the range and output var contextSize = Math.min(lines.length, 4); ret.push( '@@ -' + oldRangeStart + ',' + (oldLine-oldRangeStart+contextSize) + ' +' + newRangeStart + ',' + (newLine-newRangeStart+contextSize) + ' @@'); ret.push.apply(ret, curRange); ret.push.apply(ret, contextLines(lines.slice(0, contextSize))); if (lines.length <= 4) { eofNL(ret, i, current); } oldRangeStart = 0; newRangeStart = 0; curRange = []; } } oldLine += lines.length; newLine += lines.length; } } return ret.join('\n') + '\n'; }, applyPatch: function(oldStr, uniDiff) { var diffstr = uniDiff.split('\n'); var diff = []; var remEOFNL = false, addEOFNL = false; for (var i = (diffstr[0][0]==='I'?4:0); i < diffstr.length; i++) { if(diffstr[i][0] === '@') { var meh = diffstr[i].split(/@@ -(\d+),(\d+) \+(\d+),(\d+) @@/); diff.unshift({ start:meh[3], oldlength:meh[2], oldlines:[], newlength:meh[4], newlines:[] }); } else if(diffstr[i][0] === '+') { diff[0].newlines.push(diffstr[i].substr(1)); } else if(diffstr[i][0] === '-') { diff[0].oldlines.push(diffstr[i].substr(1)); } else if(diffstr[i][0] === ' ') { diff[0].newlines.push(diffstr[i].substr(1)); diff[0].oldlines.push(diffstr[i].substr(1)); } else if(diffstr[i][0] === '\\') { if (diffstr[i-1][0] === '+') { remEOFNL = true; } else if(diffstr[i-1][0] === '-') { addEOFNL = true; } } } var str = oldStr.split('\n'); for (var i = diff.length - 1; i >= 0; i--) { var d = diff[i]; for (var j = 0; j < d.oldlength; j++) { if(str[d.start-1+j] !== d.oldlines[j]) { return false; } } Array.prototype.splice.apply(str,[d.start-1,+d.oldlength].concat(d.newlines)); } if (remEOFNL) { while (!str[str.length-1]) { str.pop(); } } else if (addEOFNL) { str.push(''); } return str.join('\n'); }, convertChangesToXML: function(changes){ var ret = []; for ( var i = 0; i < changes.length; i++) { var change = changes[i]; if (change.added) { ret.push('<ins>'); } else if (change.removed) { ret.push('<del>'); } ret.push(escapeHTML(change.value)); if (change.added) { ret.push('</ins>'); } else if (change.removed) { ret.push('</del>'); } } return ret.join(''); }, // See: http://code.google.com/p/google-diff-match-patch/wiki/API convertChangesToDMP: function(changes){ var ret = [], change; for ( var i = 0; i < changes.length; i++) { change = changes[i]; ret.push([(change.added ? 1 : change.removed ? -1 : 0), change.value]); } return ret; } }; })(); if (typeof module !== 'undefined') { module.exports = JsDiff; } }); // module: browser/diff.js require.register("browser/events.js", function(module, exports, require){ /** * Module exports. */ exports.EventEmitter = EventEmitter; /** * Check if `obj` is an array. */ function isArray(obj) { return '[object Array]' == {}.toString.call(obj); } /** * Event emitter constructor. * * @api public */ function EventEmitter(){}; /** * Adds a listener. * * @api public */ EventEmitter.prototype.on = function (name, fn) { if (!this.$events) { this.$events = {}; } if (!this.$events[name]) { this.$events[name] = fn; } else if (isArray(this.$events[name])) { this.$events[name].push(fn); } else { this.$events[name] = [this.$events[name], fn]; } return this; }; EventEmitter.prototype.addListener = EventEmitter.prototype.on; /** * Adds a volatile listener. * * @api public */ EventEmitter.prototype.once = function (name, fn) { var self = this; function on () { self.removeListener(name, on); fn.apply(this, arguments); }; on.listener = fn; this.on(name, on); return this; }; /** * Removes a listener. * * @api public */ EventEmitter.prototype.removeListener = function (name, fn) { if (this.$events && this.$events[name]) { var list = this.$events[name]; if (isArray(list)) { var pos = -1; for (var i = 0, l = list.length; i < l; i++) { if (list[i] === fn || (list[i].listener && list[i].listener === fn)) { pos = i; break; } } if (pos < 0) { return this; } list.splice(pos, 1); if (!list.length) { delete this.$events[name]; } } else if (list === fn || (list.listener && list.listener === fn)) { delete this.$events[name]; } } return this; }; /** * Removes all listeners for an event. * * @api public */ EventEmitter.prototype.removeAllListeners = function (name) { if (name === undefined) { this.$events = {}; return this; } if (this.$events && this.$events[name]) { this.$events[name] = null; } return this; }; /** * Gets all listeners for a certain event. * * @api public */ EventEmitter.prototype.listeners = function (name) { if (!this.$events) { this.$events = {}; } if (!this.$events[name]) { this.$events[name] = []; } if (!isArray(this.$events[name])) { this.$events[name] = [this.$events[name]]; } return this.$events[name]; }; /** * Emits an event. * * @api public */ EventEmitter.prototype.emit = function (name) { if (!this.$events) { return false; } var handler = this.$events[name]; if (!handler) { return false; } var args = [].slice.call(arguments, 1); if ('function' == typeof handler) { handler.apply(this, args); } else if (isArray(handler)) { var listeners = handler.slice(); for (var i = 0, l = listeners.length; i < l; i++) { listeners[i].apply(this, args); } } else { return false; } return true; }; }); // module: browser/events.js require.register("browser/fs.js", function(module, exports, require){ }); // module: browser/fs.js require.register("browser/path.js", function(module, exports, require){ }); // module: browser/path.js require.register("browser/progress.js", function(module, exports, require){ /** * Expose `Progress`. */ module.exports = Progress; /** * Initialize a new `Progress` indicator. */ function Progress() { this.percent = 0; this.size(0); this.fontSize(11); this.font('helvetica, arial, sans-serif'); } /** * Set progress size to `n`. * * @param {Number} n * @return {Progress} for chaining * @api public */ Progress.prototype.size = function(n){ this._size = n; return this; }; /** * Set text to `str`. * * @param {String} str * @return {Progress} for chaining * @api public */ Progress.prototype.text = function(str){ this._text = str; return this; }; /** * Set font size to `n`. * * @param {Number} n * @return {Progress} for chaining * @api public */ Progress.prototype.fontSize = function(n){ this._fontSize = n; return this; }; /** * Set font `family`. * * @param {String} family * @return {Progress} for chaining */ Progress.prototype.font = function(family){ this._font = family; return this; }; /** * Update percentage to `n`. * * @param {Number} n * @return {Progress} for chaining */ Progress.prototype.update = function(n){ this.percent = n; return this; }; /** * Draw on `ctx`. * * @param {CanvasRenderingContext2d} ctx * @return {Progress} for chaining */ Progress.prototype.draw = function(ctx){ try { var percent = Math.min(this.percent, 100) , size = this._size , half = size / 2 , x = half , y = half , rad = half - 1 , fontSize = this._fontSize; ctx.font = fontSize + 'px ' + this._font; var angle = Math.PI * 2 * (percent / 100); ctx.clearRect(0, 0, size, size); // outer circle ctx.strokeStyle = '#9f9f9f'; ctx.beginPath(); ctx.arc(x, y, rad, 0, angle, false); ctx.stroke(); // inner circle ctx.strokeStyle = '#eee'; ctx.beginPath(); ctx.arc(x, y, rad - 1, 0, angle, true); ctx.stroke(); // text var text = this._text || (percent | 0) + '%' , w = ctx.measureText(text).width; ctx.fillText( text , x - w / 2 + 1 , y + fontSize / 2 - 1); } catch (ex) {} //don't fail if we can't render progress return this; }; }); // module: browser/progress.js require.register("browser/tty.js", function(module, exports, require){ exports.isatty = function(){ return true; }; exports.getWindowSize = function(){ if ('innerHeight' in global) { return [global.innerHeight, global.innerWidth]; } else { // In a Web Worker, the DOM Window is not available. return [640, 480]; } }; }); // module: browser/tty.js require.register("context.js", function(module, exports, require){ /** * Expose `Context`. */ module.exports = Context; /** * Initialize a new `Context`. * * @api private */ function Context(){} /** * Set or get the context `Runnable` to `runnable`. * * @param {Runnable} runnable * @return {Context} * @api private */ Context.prototype.runnable = function(runnable){ if (0 == arguments.length) return this._runnable; this.test = this._runnable = runnable; return this; }; /** * Set test timeout `ms`. * * @param {Number} ms * @return {Context} self * @api private */ Context.prototype.timeout = function(ms){ this.runnable().timeout(ms); return this; }; /** * Set test slowness threshold `ms`. * * @param {Number} ms * @return {Context} self * @api private */ Context.prototype.slow = function(ms){ this.runnable().slow(ms); return this; }; /** * Inspect the context void of `._runnable`. * * @return {String} * @api private */ Context.prototype.inspect = function(){ return JSON.stringify(this, function(key, val){ if ('_runnable' == key) return; if ('test' == key) return; return val; }, 2); }; }); // module: context.js require.register("hook.js", function(module, exports, require){ /** * Module dependencies. */ var Runnable = require('./runnable'); /** * Expose `Hook`. */ module.exports = Hook; /** * Initialize a new `Hook` with the given `title` and callback `fn`. * * @param {String} title * @param {Function} fn * @api private */ function Hook(title, fn) { Runnable.call(this, title, fn); this.type = 'hook'; } /** * Inherit from `Runnable.prototype`. */ function F(){}; F.prototype = Runnable.prototype; Hook.prototype = new F; Hook.prototype.constructor = Hook; /** * Get or set the test `err`. * * @param {Error} err * @return {Error} * @api public */ Hook.prototype.error = function(err){ if (0 == arguments.length) { var err = this._error; this._error = null; return err; } this._error = err; }; }); // module: hook.js require.register("interfaces/bdd.js", function(module, exports, require){ /** * Module dependencies. */ var Suite = require('../suite') , Test = require('../test') , utils = require('../utils'); /** * BDD-style interface: * * describe('Array', function(){ * describe('#indexOf()', function(){ * it('should return -1 when not present', function(){ * * }); * * it('should return the index when present', function(){ * * }); * }); * }); * */ module.exports = function(suite){ var suites = [suite]; suite.on('pre-require', function(context, file, mocha){ /** * Execute before running tests. */ context.before = function(fn){ suites[0].beforeAll(fn); }; /** * Execute after running tests. */ context.after = function(fn){ suites[0].afterAll(fn); }; /** * Execute before each test case. */ context.beforeEach = function(fn){ suites[0].beforeEach(fn); }; /** * Execute after each test case. */ context.afterEach = function(fn){ suites[0].afterEach(fn); }; /** * Describe a "suite" with the given `title` * and callback `fn` containing nested suites * and/or tests. */ context.describe = context.context = function(title, fn){ var suite = Suite.create(suites[0], title); suites.unshift(suite); fn.call(suite); suites.shift(); return suite; }; /** * Pending describe. */ context.xdescribe = context.xcontext = context.describe.skip = function(title, fn){ var suite = Suite.create(suites[0], title); suite.pending = true; suites.unshift(suite); fn.call(suite); suites.shift(); }; /** * Exclusive suite. */ context.describe.only = function(title, fn){ var suite = context.describe(title, fn); mocha.grep(suite.fullTitle()); return suite; }; /** * Describe a specification or test-case * with the given `title` and callback `fn` * acting as a thunk. */ context.it = context.specify = function(title, fn){ var suite = suites[0]; if (suite.pending) var fn = null; var test = new Test(title, fn); suite.addTest(test); return test; }; /** * Exclusive test-case. */ context.it.only = function(title, fn){ var test = context.it(title, fn); var reString = '^' + utils.escapeRegexp(test.fullTitle()) + '$'; mocha.grep(new RegExp(reString)); return test; }; /** * Pending test case. */ context.xit = context.xspecify = context.it.skip = function(title){ context.it(title); }; }); }; }); // module: interfaces/bdd.js require.register("interfaces/exports.js", function(module, exports, require){ /** * Module dependencies. */ var Suite = require('../suite') , Test = require('../test'); /** * TDD-style interface: * * exports.Array = { * '#indexOf()': { * 'should return -1 when the value is not present': function(){ * * }, * * 'should return the correct index when the value is present': function(){ * * } * } * }; * */ module.exports = function(suite){ var suites = [suite]; suite.on('require', visit); function visit(obj) { var suite; for (var key in obj) { if ('function' == typeof obj[key]) { var fn = obj[key]; switch (key) { case 'before': suites[0].beforeAll(fn); break; case 'after': suites[0].afterAll(fn); break; case 'beforeEach': suites[0].beforeEach(fn); break; case 'afterEach': suites[0].afterEach(fn); break; default: suites[0].addTest(new Test(key, fn)); } } else { var suite = Suite.create(suites[0], key); suites.unshift(suite); visit(obj[key]); suites.shift(); } } } }; }); // module: interfaces/exports.js require.register("interfaces/index.js", function(module, exports, require){ exports.bdd = require('./bdd'); exports.tdd = require('./tdd'); exports.qunit = require('./qunit'); exports.exports = require('./exports'); }); // module: interfaces/index.js require.register("interfaces/qunit.js", function(module, exports, require){ /** * Module dependencies. */ var Suite = require('../suite') , Test = require('../test') , utils = require('../utils'); /** * QUnit-style interface: * * suite('Array'); * * test('#length', function(){ * var arr = [1,2,3]; * ok(arr.length == 3); * }); * * test('#indexOf()', function(){ * var arr = [1,2,3]; * ok(arr.indexOf(1) == 0); * ok(arr.indexOf(2) == 1); * ok(arr.indexOf(3) == 2); * }); * * suite('String'); * * test('#length', function(){ * ok('foo'.length == 3); * }); * */ module.exports = function(suite){ var suites = [suite]; suite.on('pre-require', function(context, file, mocha){ /** * Execute before running tests. */ context.before = function(fn){ suites[0].beforeAll(fn); }; /** * Execute after running tests. */ context.after = function(fn){ suites[0].afterAll(fn); }; /** * Execute before each test case. */ context.beforeEach = function(fn){ suites[0].beforeEach(fn); }; /** * Execute after each test case. */ context.afterEach = function(fn){ suites[0].afterEach(fn); }; /** * Describe a "suite" with the given `title`. */ context.suite = function(title){ if (suites.length > 1) suites.shift(); var suite = Suite.create(suites[0], title); suites.unshift(suite); return suite; }; /** * Exclusive test-case. */ context.suite.only = function(title, fn){ var suite = context.suite(title, fn); mocha.grep(suite.fullTitle()); }; /** * Describe a specification or test-case * with the given `title` and callback `fn` * acting as a thunk. */ context.test = function(title, fn){ var test = new Test(title, fn); suites[0].addTest(test); return test; }; /** * Exclusive test-case. */ context.test.only = function(title, fn){ var test = context.test(title, fn); var reString = '^' + utils.escapeRegexp(test.fullTitle()) + '$'; mocha.grep(new RegExp(reString)); }; /** * Pending test case. */ context.test.skip = function(title){ context.test(title); }; }); }; }); // module: interfaces/qunit.js require.register("interfaces/tdd.js", function(module, exports, require){ /** * Module dependencies. */ var Suite = require('../suite') , Test = require('../test') , utils = require('../utils');; /** * TDD-style interface: * * suite('Array', function(){ * suite('#indexOf()', function(){ * suiteSetup(function(){ * * }); * * test('should return -1 when not present', function(){ * * }); * * test('should return the index when present', function(){ * * }); * * suiteTeardown(function(){ * * }); * }); * }); * */ module.exports = function(suite){ var suites = [suite]; suite.on('pre-require', function(context, file, mocha){ /** * Execute before each test case. */ context.setup = function(fn){ suites[0].beforeEach(fn); }; /** * Execute after each test case. */ context.teardown = function(fn){ suites[0].afterEach(fn); }; /** * Execute before the suite. */ context.suiteSetup = function(fn){ suites[0].beforeAll(fn); }; /** * Execute after the suite. */ context.suiteTeardown = function(fn){ suites[0].afterAll(fn); }; /** * Describe a "suite" with the given `title` * and callback `fn` containing nested suites * and/or tests. */ context.suite = function(title, fn){ var suite = Suite.create(suites[0], title); suites.unshift(suite); fn.call(suite); suites.shift(); return suite; }; /** * Pending suite. */ context.suite.skip = function(title, fn) { var suite = Suite.create(suites[0], title); suite.pending = true; suites.unshift(suite); fn.call(suite); suites.shift(); }; /** * Exclusive test-case. */ context.suite.only = function(title, fn){ var suite = context.suite(title, fn); mocha.grep(suite.fullTitle()); }; /** * Describe a specification or test-case * with the given `title` and callback `fn` * acting as a thunk. */ context.test = function(title, fn){ var suite = suites[0]; if (suite.pending) var fn = null; var test = new Test(title, fn); suite.addTest(test); return test; }; /** * Exclusive test-case. */ context.test.only = function(title, fn){ var test = context.test(title, fn); var reString = '^' + utils.escapeRegexp(test.fullTitle()) + '$'; mocha.grep(new RegExp(reString)); }; /** * Pending test case. */ context.test.skip = function(title){ context.test(title); }; }); }; }); // module: interfaces/tdd.js require.register("mocha.js", function(module, exports, require){ /*! * mocha * Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca> * MIT Licensed */ /** * Module dependencies. */ var path = require('browser/path') , utils = require('./utils'); /** * Expose `Mocha`. */ exports = module.exports = Mocha; /** * Expose internals. */ exports.utils = utils; exports.interfaces = require('./interfaces'); exports.reporters = require('./reporters'); exports.Runnable = require('./runnable'); exports.Context = require('./context'); exports.Runner = require('./runner'); exports.Suite = require('./suite'); exports.Hook = require('./hook'); exports.Test = require('./test'); /** * Return image `name` path. * * @param {String} name * @return {String} * @api private */ function image(name) { return __dirname + '/../images/' + name + '.png'; } /** * Setup mocha with `options`. * * Options: * * - `ui` name "bdd", "tdd", "exports" etc * - `reporter` reporter instance, defaults to `mocha.reporters.Dot` * - `globals` array of accepted globals * - `timeout` timeout in milliseconds * - `bail` bail on the first test failure * - `slow` milliseconds to wait before considering a test slow * - `ignoreLeaks` ignore global leaks * - `grep` string or regexp to filter tests with * * @param {Object} options * @api public */ function Mocha(options) { options = options || {}; this.files = []; this.options = options; this.grep(options.grep); this.suite = new exports.Suite('', new exports.Context); this.ui(options.ui); this.bail(options.bail); this.reporter(options.reporter); if (null != options.timeout) this.timeout(options.timeout); this.useColors(options.useColors) if (options.slow) this.slow(options.slow); this.suite.on('pre-require', function (context) { exports.afterEach = context.afterEach || context.teardown; exports.after = context.after || context.suiteTeardown; exports.beforeEach = context.beforeEach || context.setup; exports.before = context.before || context.suiteSetup; exports.describe = context.describe || context.suite; exports.it = context.it || context.test; exports.setup = context.setup || context.beforeEach; exports.suiteSetup = context.suiteSetup || context.before; exports.suiteTeardown = context.suiteTeardown || context.after; exports.suite = context.suite || context.describe; exports.teardown = context.teardown || context.afterEach; exports.test = context.test || context.it; }); } /** * Enable or disable bailing on the first failure. * * @param {Boolean} [bail] * @api public */ Mocha.prototype.bail = function(bail){ if (0 == arguments.length) bail = true; this.suite.bail(bail); return this; }; /** * Add test `file`. * * @param {String} file * @api public */ Mocha.prototype.addFile = function(file){ this.files.push(file); return this; }; /** * Set reporter to `reporter`, defaults to "dot". * * @param {String|Function} reporter name or constructor * @api public */ Mocha.prototype.reporter = function(reporter){ if ('function' == typeof reporter) { this._reporter = reporter; } else { reporter = reporter || 'dot'; var _reporter; try { _reporter = require('./reporters/' + reporter); } catch (err) {}; if (!_reporter) try { _reporter = require(reporter); } catch (err) {}; if (!_reporter && reporter === 'teamcity') console.warn('The Teamcity reporter was moved to a package named ' + 'mocha-teamcity-reporter ' + '(https://npmjs.org/package/mocha-teamcity-reporter).'); if (!_reporter) throw new Error('invalid reporter "' + reporter + '"'); this._reporter = _reporter; } return this; }; /** * Set test UI `name`, defaults to "bdd". * * @param {String} bdd * @api public */ Mocha.prototype.ui = function(name){ name = name || 'bdd'; this._ui = exports.interfaces[name]; if (!this._ui) try { this._ui = require(name); } catch (err) {}; if (!this._ui) throw new Error('invalid interface "' + name + '"'); this._ui = this._ui(this.suite); return this; }; /** * Load registered files. * * @api private */ Mocha.prototype.loadFiles = function(fn){ var self = this; var suite = this.suite; var pending = this.files.length; this.files.forEach(function(file){ file = path.resolve(file); suite.emit('pre-require', global, file, self); suite.emit('require', require(file), file, self); suite.emit('post-require', global, file, self); --pending || (fn && fn()); }); }; /** * Enable growl support. * * @api private */ Mocha.prototype._growl = function(runner, reporter) { var notify = require('growl'); runner.on('end', function(){ var stats = reporter.stats; if (stats.failures) { var msg = stats.failures + ' of ' + runner.total + ' tests failed'; notify(msg, { name: 'mocha', title: 'Failed', image: image('error') }); } else { notify(stats.passes + ' tests passed in ' + stats.duration + 'ms', { name: 'mocha' , title: 'Passed' , image: image('ok') }); } }); }; /** * Add regexp to grep, if `re` is a string it is escaped. * * @param {RegExp|String} re * @return {Mocha} * @api public */ Mocha.prototype.grep = function(re){ this.options.grep = 'string' == typeof re ? new RegExp(utils.escapeRegexp(re)) : re; return this; }; /** * Invert `.grep()` matches. * * @return {Mocha} * @api public */ Mocha.prototype.invert = function(){ this.options.invert = true; return this; }; /** * Ignore global leaks. * * @param {Boolean} ignore * @return {Mocha} * @api public */ Mocha.prototype.ignoreLeaks = function(ignore){ this.options.ignoreLeaks = !!ignore; return this; }; /** * Enable global leak checking. * * @return {Mocha} * @api public */ Mocha.prototype.checkLeaks = function(){ this.options.ignoreLeaks = false; return this; }; /** * Enable growl support. * * @return {Mocha} * @api public */ Mocha.prototype.growl = function(){ this.options.growl = true; return this; }; /** * Ignore `globals` array or string. * * @param {Array|String} globals * @return {Mocha} * @api public */ Mocha.prototype.globals = function(globals){ this.options.globals = (this.options.globals || []).concat(globals); return this; }; /** * Emit color output. * * @param {Boolean} colors * @return {Mocha} * @api public */ Mocha.prototype.useColors = function(colors){ this.options.useColors = arguments.length && colors != undefined ? colors : true; return this; }; /** * Use inline diffs rather than +/-. * * @param {Boolean} inlineDiffs * @return {Mocha} * @api public */ Mocha.prototype.useInlineDiffs = function(inlineDiffs) { this.options.useInlineDiffs = arguments.length && inlineDiffs != undefined ? inlineDiffs : false; return this; }; /** * Set the timeout in milliseconds. * * @param {Number} timeout * @return {Mocha} * @api public */ Mocha.prototype.timeout = function(timeout){ this.suite.timeout(timeout); return this; }; /** * Set slowness threshold in milliseconds. * * @param {Number} slow * @return {Mocha} * @api public */ Mocha.prototype.slow = function(slow){ this.suite.slow(slow); return this; }; /** * Makes all tests async (accepting a callback) * * @return {Mocha} * @api public */ Mocha.prototype.asyncOnly = function(){ this.options.asyncOnly = true; return this; }; /** * Run tests and invoke `fn()` when complete. * * @param {Function} fn * @return {Runner} * @api public */ Mocha.prototype.run = function(fn){ if (this.files.length) this.loadFiles(); var suite = this.suite; var options = this.options; var runner = new exports.Runner(suite); var reporter = new this._reporter(runner); runner.ignoreLeaks = false !== options.ignoreLeaks; runner.asyncOnly = options.asyncOnly; if (options.grep) runner.grep(options.grep, options.invert); if (options.globals) runner.globals(options.globals); if (options.growl) this._growl(runner, reporter); exports.reporters.Base.useColors = options.useColors; exports.reporters.Base.inlineDiffs = options.useInlineDiffs; return runner.run(fn); }; }); // module: mocha.js require.register("ms.js", function(module, exports, require){ /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} options * @return {String|Number} * @api public */ module.exports = function(val, options){ options = options || {}; if ('string' == typeof val) return parse(val); return options.long ? longFormat(val) : shortFormat(val); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str); if (!match) return; var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'y': return n * y; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'h': return n * h; case 'minutes': case 'minute': case 'm': return n * m; case 'seconds': case 'second': case 's': return n * s; case 'ms': return n; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function shortFormat(ms) { if (ms >= d) return Math.round(ms / d) + 'd'; if (ms >= h) return Math.round(ms / h) + 'h'; if (ms >= m) return Math.round(ms / m) + 'm'; if (ms >= s) return Math.round(ms / s) + 's'; return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function longFormat(ms) { return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, n, name) { if (ms < n) return; if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; return Math.ceil(ms / n) + ' ' + name + 's'; } }); // module: ms.js require.register("reporters/base.js", function(module, exports, require){ /** * Module dependencies. */ var tty = require('browser/tty') , diff = require('browser/diff') , ms = require('../ms') , utils = require('../utils'); /** * Save timer references to avoid Sinon interfering (see GH-237). */ var Date = global.Date , setTimeout = global.setTimeout , setInterval = global.setInterval , clearTimeout = global.clearTimeout , clearInterval = global.clearInterval; /** * Check if both stdio streams are associated with a tty. */ var isatty = tty.isatty(1) && tty.isatty(2); /** * Expose `Base`. */ exports = module.exports = Base; /** * Enable coloring by default. */ exports.useColors = isatty || (process.env.MOCHA_COLORS !== undefined); /** * Inline diffs instead of +/- */ exports.inlineDiffs = false; /** * Default color map. */ exports.colors = { 'pass': 90 , 'fail': 31 , 'bright pass': 92 , 'bright fail': 91 , 'bright yellow': 93 , 'pending': 36 , 'suite': 0 , 'error title': 0 , 'error message': 31 , 'error stack': 90 , 'checkmark': 32 , 'fast': 90 , 'medium': 33 , 'slow': 31 , 'green': 32 , 'light': 90 , 'diff gutter': 90 , 'diff added': 42 , 'diff removed': 41 }; /** * Default symbol map. */ exports.symbols = { ok: '✓', err: '✖', dot: '․' }; // With node.js on Windows: use symbols available in terminal default fonts if ('win32' == process.platform) { exports.symbols.ok = '\u221A'; exports.symbols.err = '\u00D7'; exports.symbols.dot = '.'; } /** * Color `str` with the given `type`, * allowing colors to be disabled, * as well as user-defined color * schemes. * * @param {String} type * @param {String} str * @return {String} * @api private */ var color = exports.color = function(type, str) { if (!exports.useColors) return str; return '\u001b[' + exports.colors[type] + 'm' + str + '\u001b[0m'; }; /** * Expose term window size, with some * defaults for when stderr is not a tty. */ exports.window = { width: isatty ? process.stdout.getWindowSize ? process.stdout.getWindowSize(1)[0] : tty.getWindowSize()[1] : 75 }; /** * Expose some basic cursor interactions * that are common among reporters. */ exports.cursor = { hide: function(){ isatty && process.stdout.write('\u001b[?25l'); }, show: function(){ isatty && process.stdout.write('\u001b[?25h'); }, deleteLine: function(){ isatty && process.stdout.write('\u001b[2K'); }, beginningOfLine: function(){ isatty && process.stdout.write('\u001b[0G'); }, CR: function(){ if (isatty) { exports.cursor.deleteLine(); exports.cursor.beginningOfLine(); } else { process.stdout.write('\r'); } } }; /** * Outut the given `failures` as a list. * * @param {Array} failures * @api public */ exports.list = function(failures){ console.error(); failures.forEach(function(test, i){ // format var fmt = color('error title', ' %s) %s:\n') + color('error message', ' %s') + color('error stack', '\n%s\n'); // msg var err = test.err , message = err.message || '' , stack = err.stack || message , index = stack.indexOf(message) + message.length , msg = stack.slice(0, index) , actual = err.actual , expected = err.expected , escape = true; // uncaught if (err.uncaught) { msg = 'Uncaught ' + msg; } // explicitly show diff if (err.showDiff && sameType(actual, expected)) { escape = false; err.actual = actual = stringify(canonicalize(actual)); err.expected = expected = stringify(canonicalize(expected)); } // actual / expected diff if ('string' == typeof actual && 'string' == typeof expected) { fmt = color('error title', ' %s) %s:\n%s') + color('error stack', '\n%s\n'); var match = message.match(/^([^:]+): expected/); msg = '\n ' + color('error message', match ? match[1] : msg); if (exports.inlineDiffs) { msg += inlineDiff(err, escape); } else { msg += unifiedDiff(err, escape); } } // indent stack trace without msg stack = stack.slice(index ? index + 1 : index) .replace(/^/gm, ' '); console.error(fmt, (i + 1), test.fullTitle(), msg, stack); }); }; /** * Initialize a new `Base` reporter. * * All other reporters generally * inherit from this reporter, providing * stats such as test duration, number * of tests passed / failed etc. * * @param {Runner} runner * @api public */ function Base(runner) { var self = this , stats = this.stats = { suites: 0, tests: 0, passes: 0, pending: 0, failures: 0 } , failures = this.failures = []; if (!runner) return; this.runner = runner; runner.stats = stats; runner.on('start', function(){ stats.start = new Date; }); runner.on('suite', function(suite){ stats.suites = stats.suites || 0; suite.root || stats.suites++; }); runner.on('test end', function(test){ stats.tests = stats.tests || 0; stats.tests++; }); runner.on('pass', function(test){ stats.passes = stats.passes || 0; var medium = test.slow() / 2; test.speed = test.duration > test.slow() ? 'slow' : test.duration > medium ? 'medium' : 'fast'; stats.passes++; }); runner.on('fail', function(test, err){ stats.failures = stats.failures || 0; stats.failures++; test.err = err; failures.push(test); }); runner.on('end', function(){ stats.end = new Date; stats.duration = new Date - stats.start; }); runner.on('pending', function(){ stats.pending++; }); } /** * Output common epilogue used by many of * the bundled reporters. * * @api public */ Base.prototype.epilogue = function(){ var stats = this.stats; var tests; var fmt; console.log(); // passes fmt = color('bright pass', ' ') + color('green', ' %d passing') + color('light', ' (%s)'); console.log(fmt, stats.passes || 0, ms(stats.duration)); // pending if (stats.pending) { fmt = color('pending', ' ') + color('pending', ' %d pending'); console.log(fmt, stats.pending); } // failures if (stats.failures) { fmt = color('fail', ' %d failing'); console.error(fmt, stats.failures); Base.list(this.failures); console.error(); } console.log(); }; /** * Pad the given `str` to `len`. * * @param {String} str * @param {String} len * @return {String} * @api private */ function pad(str, len) { str = String(str); return Array(len - str.length + 1).join(' ') + str; } /** * Returns an inline diff between 2 strings with coloured ANSI output * * @param {Error} Error with actual/expected * @return {String} Diff * @api private */ function inlineDiff(err, escape) { var msg = errorDiff(err, 'WordsWithSpace', escape); // linenos var lines = msg.split('\n'); if (lines.length > 4) { var width = String(lines.length).length; msg = lines.map(function(str, i){ return pad(++i, width) + ' |' + ' ' + str; }).join('\n'); } // legend msg = '\n' + color('diff removed', 'actual') + ' ' + color('diff added', 'expected') + '\n\n' + msg + '\n'; // indent msg = msg.replace(/^/gm, ' '); return msg; } /** * Returns a unified diff between 2 strings * * @param {Error} Error with actual/expected * @return {String} Diff * @api private */ function unifiedDiff(err, escape) { var indent = ' '; function cleanUp(line) { if (escape) { line = escapeInvisibles(line); } if (line[0] === '+') return indent + colorLines('diff added', line); if (line[0] === '-') return indent + colorLines('diff removed', line); if (line.match(/\@\@/)) return null; if (line.match(/\\ No newline/)) return null; else return indent + line; } function notBlank(line) { return line != null; } msg = diff.createPatch('string', err.actual, err.expected); var lines = msg.split('\n').splice(4); return '\n ' + colorLines('diff added', '+ expected') + ' ' + colorLines('diff removed', '- actual') + '\n\n' + lines.map(cleanUp).filter(notBlank).join('\n'); } /** * Return a character diff for `err`. * * @param {Error} err * @return {String} * @api private */ function errorDiff(err, type, escape) { var actual = escape ? escapeInvisibles(err.actual) : err.actual; var expected = escape ? escapeInvisibles(err.expected) : err.expected; return diff['diff' + type](actual, expected).map(function(str){ if (str.added) return colorLines('diff added', str.value); if (str.removed) return colorLines('diff removed', str.value); return str.value; }).join(''); } /** * Returns a string with all invisible characters in plain text * * @param {String} line * @return {String} * @api private */ function escapeInvisibles(line) { return line.replace(/\t/g, '<tab>') .replace(/\r/g, '<CR>') .replace(/\n/g, '<LF>\n'); } /** * Color lines for `str`, using the color `name`. * * @param {String} name * @param {String} str * @return {String} * @api private */ function colorLines(name, str) { return str.split('\n').map(function(str){ return color(name, str); }).join('\n'); } /** * Stringify `obj`. * * @param {Object} obj * @return {String} * @api private */ function stringify(obj) { if (obj instanceof RegExp) return obj.toString(); return JSON.stringify(obj, null, 2); } /** * Return a new object that has the keys in sorted order. * @param {Object} obj * @return {Object} * @api private */ function canonicalize(obj, stack) { stack = stack || []; if (utils.indexOf(stack, obj) !== -1) return obj; var canonicalizedObj; if ('[object Array]' == {}.toString.call(obj)) { stack.push(obj); canonicalizedObj = utils.map(obj, function(item) { return canonicalize(item, stack); }); stack.pop(); } else if (typeof obj === 'object' && obj !== null) { stack.push(obj); canonicalizedObj = {}; utils.forEach(utils.keys(obj).sort(), function(key) { canonicalizedObj[key] = canonicalize(obj[key], stack); }); stack.pop(); } else { canonicalizedObj = obj; } return canonicalizedObj; } /** * Check that a / b have the same type. * * @param {Object} a * @param {Object} b * @return {Boolean} * @api private */ function sameType(a, b) { a = Object.prototype.toString.call(a); b = Object.prototype.toString.call(b); return a == b; } }); // module: reporters/base.js require.register("reporters/doc.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , utils = require('../utils'); /** * Expose `Doc`. */ exports = module.exports = Doc; /** * Initialize a new `Doc` reporter. * * @param {Runner} runner * @api public */ function Doc(runner) { Base.call(this, runner); var self = this , stats = this.stats , total = runner.total , indents = 2; function indent() { return Array(indents).join(' '); } runner.on('suite', function(suite){ if (suite.root) return; ++indents; console.log('%s<section class="suite">', indent()); ++indents; console.log('%s<h1>%s</h1>', indent(), utils.escape(suite.title)); console.log('%s<dl>', indent()); }); runner.on('suite end', function(suite){ if (suite.root) return; console.log('%s</dl>', indent()); --indents; console.log('%s</section>', indent()); --indents; }); runner.on('pass', function(test){ console.log('%s <dt>%s</dt>', indent(), utils.escape(test.title)); var code = utils.escape(utils.clean(test.fn.toString())); console.log('%s <dd><pre><code>%s</code></pre></dd>', indent(), code); }); } }); // module: reporters/doc.js require.register("reporters/dot.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , color = Base.color; /** * Expose `Dot`. */ exports = module.exports = Dot; /** * Initialize a new `Dot` matrix test reporter. * * @param {Runner} runner * @api public */ function Dot(runner) { Base.call(this, runner); var self = this , stats = this.stats , width = Base.window.width * .75 | 0 , n = 0; runner.on('start', function(){ process.stdout.write('\n '); }); runner.on('pending', function(test){ process.stdout.write(color('pending', Base.symbols.dot)); }); runner.on('pass', function(test){ if (++n % width == 0) process.stdout.write('\n '); if ('slow' == test.speed) { process.stdout.write(color('bright yellow', Base.symbols.dot)); } else { process.stdout.write(color(test.speed, Base.symbols.dot)); } }); runner.on('fail', function(test, err){ if (++n % width == 0) process.stdout.write('\n '); process.stdout.write(color('fail', Base.symbols.dot)); }); runner.on('end', function(){ console.log(); self.epilogue(); }); } /** * Inherit from `Base.prototype`. */ function F(){}; F.prototype = Base.prototype; Dot.prototype = new F; Dot.prototype.constructor = Dot; }); // module: reporters/dot.js require.register("reporters/html-cov.js", function(module, exports, require){ /** * Module dependencies. */ var JSONCov = require('./json-cov') , fs = require('browser/fs'); /** * Expose `HTMLCov`. */ exports = module.exports = HTMLCov; /** * Initialize a new `JsCoverage` reporter. * * @param {Runner} runner * @api public */ function HTMLCov(runner) { var jade = require('jade') , file = __dirname + '/templates/coverage.jade' , str = fs.readFileSync(file, 'utf8') , fn = jade.compile(str, { filename: file }) , self = this; JSONCov.call(this, runner, false); runner.on('end', function(){ process.stdout.write(fn({ cov: self.cov , coverageClass: coverageClass })); }); } /** * Return coverage class for `n`. * * @return {String} * @api private */ function coverageClass(n) { if (n >= 75) return 'high'; if (n >= 50) return 'medium'; if (n >= 25) return 'low'; return 'terrible'; } }); // module: reporters/html-cov.js require.register("reporters/html.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , utils = require('../utils') , Progress = require('../browser/progress') , escape = utils.escape; /** * Save timer references to avoid Sinon interfering (see GH-237). */ var Date = global.Date , setTimeout = global.setTimeout , setInterval = global.setInterval , clearTimeout = global.clearTimeout , clearInterval = global.clearInterval; /** * Expose `HTML`. */ exports = module.exports = HTML; /** * Stats template. */ var statsTemplate = '<ul id="mocha-stats">' + '<li class="progress"><canvas width="40" height="40"></canvas></li>' + '<li class="passes"><a href="#">passes:</a> <em>0</em></li>' + '<li class="failures"><a href="#">failures:</a> <em>0</em></li>' + '<li class="duration">duration: <em>0</em>s</li>' + '</ul>'; /** * Initialize a new `HTML` reporter. * * @param {Runner} runner * @api public */ function HTML(runner, root) { Base.call(this, runner); var self = this , stats = this.stats , total = runner.total , stat = fragment(statsTemplate) , items = stat.getElementsByTagName('li') , passes = items[1].getElementsByTagName('em')[0] , passesLink = items[1].getElementsByTagName('a')[0] , failures = items[2].getElementsByTagName('em')[0] , failuresLink = items[2].getElementsByTagName('a')[0] , duration = items[3].getElementsByTagName('em')[0] , canvas = stat.getElementsByTagName('canvas')[0] , report = fragment('<ul id="mocha-report"></ul>') , stack = [report] , progress , ctx root = root || document.getElementById('mocha'); if (canvas.getContext) { var ratio = window.devicePixelRatio || 1; canvas.style.width = canvas.width; canvas.style.height = canvas.height; canvas.width *= ratio; canvas.height *= ratio; ctx = canvas.getContext('2d'); ctx.scale(ratio, ratio); progress = new Progress; } if (!root) return error('#mocha div missing, add it to your document'); // pass toggle on(passesLink, 'click', function(){ unhide(); var name = /pass/.test(report.className) ? '' : ' pass'; report.className = report.className.replace(/fail|pass/g, '') + name; if (report.className.trim()) hideSuitesWithout('test pass'); }); // failure toggle on(failuresLink, 'click', function(){ unhide(); var name = /fail/.test(report.className) ? '' : ' fail'; report.className = report.className.replace(/fail|pass/g, '') + name; if (report.className.trim()) hideSuitesWithout('test fail'); }); root.appendChild(stat); root.appendChild(report); if (progress) progress.size(40); runner.on('suite', function(suite){ if (suite.root) return; // suite var url = self.suiteURL(suite); var el = fragment('<li class="suite"><h1><a href="%s">%s</a></h1></li>', url, escape(suite.title)); // container stack[0].appendChild(el); stack.unshift(document.createElement('ul')); el.appendChild(stack[0]); }); runner.on('suite end', function(suite){ if (suite.root) return; stack.shift(); }); runner.on('fail', function(test, err){ if ('hook' == test.type) runner.emit('test end', test); }); runner.on('test end', function(test){ // TODO: add to stats var percent = stats.tests / this.total * 100 | 0; if (progress) progress.update(percent).draw(ctx); // update stats var ms = new Date - stats.start; text(passes, stats.passes); text(failures, stats.failures); text(duration, (ms / 1000).toFixed(2)); // test if ('passed' == test.state) { var url = self.testURL(test); var el = fragment('<li class="test pass %e"><h2>%e<span class="duration">%ems</span> <a href="%s" class="replay">‣</a></h2></li>', test.speed, test.title, test.duration, url); } else if (test.pending) { var el = fragment('<li class="test pass pending"><h2>%e</h2></li>', test.title); } else { var el = fragment('<li class="test fail"><h2>%e <a href="?grep=%e" class="replay">‣</a></h2></li>', test.title, encodeURIComponent(test.fullTitle())); var str = test.err.stack || test.err.toString(); // FF / Opera do not add the message if (!~str.indexOf(test.err.message)) { str = test.err.message + '\n' + str; } // <=IE7 stringifies to [Object Error]. Since it can be overloaded, we // check for the result of the stringifying. if ('[object Error]' == str) str = test.err.message; // Safari doesn't give you a stack. Let's at least provide a source line. if (!test.err.stack && test.err.sourceURL && test.err.line !== undefined) { str += "\n(" + test.err.sourceURL + ":" + test.err.line + ")"; } el.appendChild(fragment('<pre class="error">%e</pre>', str)); } // toggle code // TODO: defer if (!test.pending) { var h2 = el.getElementsByTagName('h2')[0]; on(h2, 'click', function(){ pre.style.display = 'none' == pre.style.display ? 'block' : 'none'; }); var pre = fragment('<pre><code>%e</code></pre>', utils.clean(test.fn.toString())); el.appendChild(pre); pre.style.display = 'none'; } // Don't call .appendChild if #mocha-report was already .shift()'ed off the stack. if (stack[0]) stack[0].appendChild(el); }); } /** * Provide suite URL * * @param {Object} [suite] */ HTML.prototype.suiteURL = function(suite){ return '?grep=' + encodeURIComponent(suite.fullTitle()); }; /** * Provide test URL * * @param {Object} [test] */ HTML.prototype.testURL = function(test){ return '?grep=' + encodeURIComponent(test.fullTitle()); }; /** * Display error `msg`. */ function error(msg) { document.body.appendChild(fragment('<div id="mocha-error">%s</div>', msg)); } /** * Return a DOM fragment from `html`. */ function fragment(html) { var args = arguments , div = document.createElement('div') , i = 1; div.innerHTML = html.replace(/%([se])/g, function(_, type){ switch (type) { case 's': return String(args[i++]); case 'e': return escape(args[i++]); } }); return div.firstChild; } /** * Check for suites that do not have elements * with `classname`, and hide them. */ function hideSuitesWithout(classname) { var suites = document.getElementsByClassName('suite'); for (var i = 0; i < suites.length; i++) { var els = suites[i].getElementsByClassName(classname); if (0 == els.length) suites[i].className += ' hidden'; } } /** * Unhide .hidden suites. */ function unhide() { var els = document.getElementsByClassName('suite hidden'); for (var i = 0; i < els.length; ++i) { els[i].className = els[i].className.replace('suite hidden', 'suite'); } } /** * Set `el` text to `str`. */ function text(el, str) { if (el.textContent) { el.textContent = str; } else { el.innerText = str; } } /** * Listen on `event` with callback `fn`. */ function on(el, event, fn) { if (el.addEventListener) { el.addEventListener(event, fn, false); } else { el.attachEvent('on' + event, fn); } } }); // module: reporters/html.js require.register("reporters/index.js", function(module, exports, require){ exports.Base = require('./base'); exports.Dot = require('./dot'); exports.Doc = require('./doc'); exports.TAP = require('./tap'); exports.JSON = require('./json'); exports.HTML = require('./html'); exports.List = require('./list'); exports.Min = require('./min'); exports.Spec = require('./spec'); exports.Nyan = require('./nyan'); exports.XUnit = require('./xunit'); exports.Markdown = require('./markdown'); exports.Progress = require('./progress'); exports.Landing = require('./landing'); exports.JSONCov = require('./json-cov'); exports.HTMLCov = require('./html-cov'); exports.JSONStream = require('./json-stream'); }); // module: reporters/index.js require.register("reporters/json-cov.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base'); /** * Expose `JSONCov`. */ exports = module.exports = JSONCov; /** * Initialize a new `JsCoverage` reporter. * * @param {Runner} runner * @param {Boolean} output * @api public */ function JSONCov(runner, output) { var self = this , output = 1 == arguments.length ? true : output; Base.call(this, runner); var tests = [] , failures = [] , passes = []; runner.on('test end', function(test){ tests.push(test); }); runner.on('pass', function(test){ passes.push(test); }); runner.on('fail', function(test){ failures.push(test); }); runner.on('end', function(){ var cov = global._$jscoverage || {}; var result = self.cov = map(cov); result.stats = self.stats; result.tests = tests.map(clean); result.failures = failures.map(clean); result.passes = passes.map(clean); if (!output) return; process.stdout.write(JSON.stringify(result, null, 2 )); }); } /** * Map jscoverage data to a JSON structure * suitable for reporting. * * @param {Object} cov * @return {Object} * @api private */ function map(cov) { var ret = { instrumentation: 'node-jscoverage' , sloc: 0 , hits: 0 , misses: 0 , coverage: 0 , files: [] }; for (var filename in cov) { var data = coverage(filename, cov[filename]); ret.files.push(data); ret.hits += data.hits; ret.misses += data.misses; ret.sloc += data.sloc; } ret.files.sort(function(a, b) { return a.filename.localeCompare(b.filename); }); if (ret.sloc > 0) { ret.coverage = (ret.hits / ret.sloc) * 100; } return ret; }; /** * Map jscoverage data for a single source file * to a JSON structure suitable for reporting. * * @param {String} filename name of the source file * @param {Object} data jscoverage coverage data * @return {Object} * @api private */ function coverage(filename, data) { var ret = { filename: filename, coverage: 0, hits: 0, misses: 0, sloc: 0, source: {} }; data.source.forEach(function(line, num){ num++; if (data[num] === 0) { ret.misses++; ret.sloc++; } else if (data[num] !== undefined) { ret.hits++; ret.sloc++; } ret.source[num] = { source: line , coverage: data[num] === undefined ? '' : data[num] }; }); ret.coverage = ret.hits / ret.sloc * 100; return ret; } /** * Return a plain-object representation of `test` * free of cyclic properties etc. * * @param {Object} test * @return {Object} * @api private */ function clean(test) { return { title: test.title , fullTitle: test.fullTitle() , duration: test.duration } } }); // module: reporters/json-cov.js require.register("reporters/json-stream.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , color = Base.color; /** * Expose `List`. */ exports = module.exports = List; /** * Initialize a new `List` test reporter. * * @param {Runner} runner * @api public */ function List(runner) { Base.call(this, runner); var self = this , stats = this.stats , total = runner.total; runner.on('start', function(){ console.log(JSON.stringify(['start', { total: total }])); }); runner.on('pass', function(test){ console.log(JSON.stringify(['pass', clean(test)])); }); runner.on('fail', function(test, err){ console.log(JSON.stringify(['fail', clean(test)])); }); runner.on('end', function(){ process.stdout.write(JSON.stringify(['end', self.stats])); }); } /** * Return a plain-object representation of `test` * free of cyclic properties etc. * * @param {Object} test * @return {Object} * @api private */ function clean(test) { return { title: test.title , fullTitle: test.fullTitle() , duration: test.duration } } }); // module: reporters/json-stream.js require.register("reporters/json.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , cursor = Base.cursor , color = Base.color; /** * Expose `JSON`. */ exports = module.exports = JSONReporter; /** * Initialize a new `JSON` reporter. * * @param {Runner} runner * @api public */ function JSONReporter(runner) { var self = this; Base.call(this, runner); var tests = [] , failures = [] , passes = []; runner.on('test end', function(test){ tests.push(test); }); runner.on('pass', function(test){ passes.push(test); }); runner.on('fail', function(test){ failures.push(test); }); runner.on('end', function(){ var obj = { stats: self.stats , tests: tests.map(clean) , failures: failures.map(clean) , passes: passes.map(clean) }; process.stdout.write(JSON.stringify(obj, null, 2)); }); } /** * Return a plain-object representation of `test` * free of cyclic properties etc. * * @param {Object} test * @return {Object} * @api private */ function clean(test) { return { title: test.title , fullTitle: test.fullTitle() , duration: test.duration } } }); // module: reporters/json.js require.register("reporters/landing.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , cursor = Base.cursor , color = Base.color; /** * Expose `Landing`. */ exports = module.exports = Landing; /** * Airplane color. */ Base.colors.plane = 0; /** * Airplane crash color. */ Base.colors['plane crash'] = 31; /** * Runway color. */ Base.colors.runway = 90; /** * Initialize a new `Landing` reporter. * * @param {Runner} runner * @api public */ function Landing(runner) { Base.call(this, runner); var self = this , stats = this.stats , width = Base.window.width * .75 | 0 , total = runner.total , stream = process.stdout , plane = color('plane', '✈') , crashed = -1 , n = 0; function runway() { var buf = Array(width).join('-'); return ' ' + color('runway', buf); } runner.on('start', function(){ stream.write('\n '); cursor.hide(); }); runner.on('test end', function(test){ // check if the plane crashed var col = -1 == crashed ? width * ++n / total | 0 : crashed; // show the crash if ('failed' == test.state) { plane = color('plane crash', '✈'); crashed = col; } // render landing strip stream.write('\u001b[4F\n\n'); stream.write(runway()); stream.write('\n '); stream.write(color('runway', Array(col).join('⋅'))); stream.write(plane) stream.write(color('runway', Array(width - col).join('⋅') + '\n')); stream.write(runway()); stream.write('\u001b[0m'); }); runner.on('end', function(){ cursor.show(); console.log(); self.epilogue(); }); } /** * Inherit from `Base.prototype`. */ function F(){}; F.prototype = Base.prototype; Landing.prototype = new F; Landing.prototype.constructor = Landing; }); // module: reporters/landing.js require.register("reporters/list.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , cursor = Base.cursor , color = Base.color; /** * Expose `List`. */ exports = module.exports = List; /** * Initialize a new `List` test reporter. * * @param {Runner} runner * @api public */ function List(runner) { Base.call(this, runner); var self = this , stats = this.stats , n = 0; runner.on('start', function(){ console.log(); }); runner.on('test', function(test){ process.stdout.write(color('pass', ' ' + test.fullTitle() + ': ')); }); runner.on('pending', function(test){ var fmt = color('checkmark', ' -') + color('pending', ' %s'); console.log(fmt, test.fullTitle()); }); runner.on('pass', function(test){ var fmt = color('checkmark', ' '+Base.symbols.dot) + color('pass', ' %s: ') + color(test.speed, '%dms'); cursor.CR(); console.log(fmt, test.fullTitle(), test.duration); }); runner.on('fail', function(test, err){ cursor.CR(); console.log(color('fail', ' %d) %s'), ++n, test.fullTitle()); }); runner.on('end', self.epilogue.bind(self)); } /** * Inherit from `Base.prototype`. */ function F(){}; F.prototype = Base.prototype; List.prototype = new F; List.prototype.constructor = List; }); // module: reporters/list.js require.register("reporters/markdown.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , utils = require('../utils'); /** * Expose `Markdown`. */ exports = module.exports = Markdown; /** * Initialize a new `Markdown` reporter. * * @param {Runner} runner * @api public */ function Markdown(runner) { Base.call(this, runner); var self = this , stats = this.stats , level = 0 , buf = ''; function title(str) { return Array(level).join('#') + ' ' + str; } function indent() { return Array(level).join(' '); } function mapTOC(suite, obj) { var ret = obj; obj = obj[suite.title] = obj[suite.title] || { suite: suite }; suite.suites.forEach(function(suite){ mapTOC(suite, obj); }); return ret; } function stringifyTOC(obj, level) { ++level; var buf = ''; var link; for (var key in obj) { if ('suite' == key) continue; if (key) link = ' - [' + key + '](#' + utils.slug(obj[key].suite.fullTitle()) + ')\n'; if (key) buf += Array(level).join(' ') + link; buf += stringifyTOC(obj[key], level); } --level; return buf; } function generateTOC(suite) { var obj = mapTOC(suite, {}); return stringifyTOC(obj, 0); } generateTOC(runner.suite); runner.on('suite', function(suite){ ++level; var slug = utils.slug(suite.fullTitle()); buf += '<a name="' + slug + '"></a>' + '\n'; buf += title(suite.title) + '\n'; }); runner.on('suite end', function(suite){ --level; }); runner.on('pass', function(test){ var code = utils.clean(test.fn.toString()); buf += test.title + '.\n'; buf += '\n```js\n'; buf += code + '\n'; buf += '```\n\n'; }); runner.on('end', function(){ process.stdout.write('# TOC\n'); process.stdout.write(generateTOC(runner.suite)); process.stdout.write(buf); }); } }); // module: reporters/markdown.js require.register("reporters/min.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base'); /** * Expose `Min`. */ exports = module.exports = Min; /** * Initialize a new `Min` minimal test reporter (best used with --watch). * * @param {Runner} runner * @api public */ function Min(runner) { Base.call(this, runner); runner.on('start', function(){ // clear screen process.stdout.write('\u001b[2J'); // set cursor position process.stdout.write('\u001b[1;3H'); }); runner.on('end', this.epilogue.bind(this)); } /** * Inherit from `Base.prototype`. */ function F(){}; F.prototype = Base.prototype; Min.prototype = new F; Min.prototype.constructor = Min; }); // module: reporters/min.js require.register("reporters/nyan.js", function(module, exports, require){ /** * Mo
/* * Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * */ /*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */ /*global define, window, $, brackets, semver */ /*unittests: ExtensionManager*/ /** * The ExtensionManager fetches/caches the extension registry and provides * information about the status of installed extensions. ExtensionManager raises the * following events: * - statusChange - indicates that an extension has been installed/uninstalled or * its status has otherwise changed. Second parameter is the id of the * extension. * - registryUpdate - indicates that an existing extension was synchronized * with new data from the registry. */ define(function (require, exports, module) { "use strict"; var _ = require("thirdparty/lodash"), FileUtils = require("file/FileUtils"), Package = require("extensibility/Package"), Async = require("utils/Async"), ExtensionLoader = require("utils/ExtensionLoader"), ExtensionUtils = require("utils/ExtensionUtils"), FileSystem = require("filesystem/FileSystem"), Strings = require("strings"), StringUtils = require("utils/StringUtils"), ThemeManager = require("view/ThemeManager"); // semver.browser is an AMD-compatible module var semver = require("extensibility/node/node_modules/semver/semver.browser"); /** * @private * @type {$.Deferred} Keeps track of the current registry download so that if a request is already * in progress and another request to download the registry comes in, we don't send yet another request. * This is primarily used when multiple view models need to download the registry at the same time. */ var pendingDownloadRegistry = null; /** * Extension status constants. */ var ENABLED = "enabled", START_FAILED = "startFailed"; /** * Extension location constants. */ var LOCATION_DEFAULT = "default", LOCATION_DEV = "dev", LOCATION_USER = "user", LOCATION_UNKNOWN = "unknown"; /** * @private * @type {Object.<string, {metadata: Object, path: string, status: string}>} * The set of all known extensions, both from the registry and locally installed. * The keys are either "name" from package.json (for extensions that have package metadata) * or the last segment of local file paths (for installed legacy extensions * with no package metadata). The fields of each record are: * registryInfo: object containing the info for this id from the main registry (containing metadata, owner, * and versions). This will be null for legacy extensions. * installInfo: object containing the info for a locally-installed extension: * metadata: the package metadata loaded from the local package.json, or null if it's a legacy extension. * This will be different from registryInfo.metadata if there's a newer version in the registry. * path: the local path to the extension folder on disk * locationType: general type of installation; one of the LOCATION_* constants above * status: the current status, one of the status constants above */ var extensions = {}; /** * Requested changes to the installed extensions. */ var _idsToRemove = [], _idsToUpdate = []; /** * @private * Synchronizes the information between the public registry and the installed * extensions. Specifically, this makes the `owner` available in each and sets * an `updateAvailable` flag. * * @param {string} id of the extension to synchronize */ function synchronizeEntry(id) { var entry = extensions[id]; // Do nothing if we only have one set of data if (!entry || !entry.installInfo || !entry.registryInfo) { return; } entry.installInfo.owner = entry.registryInfo.owner; // Assume false entry.installInfo.updateAvailable = false; entry.registryInfo.updateAvailable = false; entry.installInfo.updateCompatible = false; entry.registryInfo.updateCompatible = false; var currentVersion = entry.installInfo.metadata ? entry.installInfo.metadata.version : null; if (currentVersion && semver.lt(currentVersion, entry.registryInfo.metadata.version)) { // Note: available update may still be incompatible; we check for this when rendering the Update button in ExtensionManagerView._renderItem() entry.registryInfo.updateAvailable = true; entry.installInfo.updateAvailable = true; // Calculate updateCompatible to check if there's an update for current version of Brackets var lastCompatibleVersionInfo = _.findLast(entry.registryInfo.versions, function (versionInfo) { return semver.satisfies(brackets.metadata.apiVersion, versionInfo.brackets); }); if (lastCompatibleVersionInfo && lastCompatibleVersionInfo.version && semver.lt(currentVersion, lastCompatibleVersionInfo.version)) { entry.installInfo.updateCompatible = true; entry.registryInfo.updateCompatible = true; entry.installInfo.lastCompatibleVersion = lastCompatibleVersionInfo.version; entry.registryInfo.lastCompatibleVersion = lastCompatibleVersionInfo.version; } } $(exports).triggerHandler("registryUpdate", [id]); } /** * @private * Verifies if an extension is a theme based on the presence of the field "theme" * in the package.json. If it is a theme, then the theme file is just loaded by the * ThemeManager * * @param {string} id of the theme extension to load */ function loadTheme(id) { var extension = extensions[id]; if (extension.installInfo && extension.installInfo.metadata && extension.installInfo.metadata.theme) { ThemeManager.loadPackage(extension.installInfo); } } /** * @private * Sets our data. For unit testing only. */ function _setExtensions(newExtensions) { exports.extensions = extensions = newExtensions; Object.keys(extensions).forEach(function (id) { synchronizeEntry(id); }); } /** * @private * Clears out our existing data. For unit testing only. */ function _reset() { exports.extensions = extensions = {}; _idsToRemove = []; _idsToUpdate = []; } /** * Downloads the registry of Brackets extensions and stores the information in our * extension info. * * @return {$.Promise} a promise that's resolved with the registry JSON data * or rejected if the server can't be reached. */ function downloadRegistry() { if (pendingDownloadRegistry) { return pendingDownloadRegistry.promise(); } pendingDownloadRegistry = new $.Deferred(); $.ajax({ url: brackets.config.extension_registry, dataType: "json", cache: false }) .done(function (data) { Object.keys(data).forEach(function (id) { if (!extensions[id]) { extensions[id] = {}; } extensions[id].registryInfo = data[id]; synchronizeEntry(id); }); $(exports).triggerHandler("registryDownload"); pendingDownloadRegistry.resolve(); }) .fail(function () { pendingDownloadRegistry.reject(); }) .always(function () { // Make sure to clean up the pending registry so that new requests can be made. pendingDownloadRegistry = null; }); return pendingDownloadRegistry.promise(); } /** * @private * When an extension is loaded, fetches the package.json and stores the extension in our map. * @param {$.Event} e The event object * @param {string} path The local path of the loaded extension's folder. */ function _handleExtensionLoad(e, path) { function setData(id, metadata) { var locationType, userExtensionPath = ExtensionLoader.getUserExtensionPath(); if (path.indexOf(userExtensionPath) === 0) { locationType = LOCATION_USER; } else { var segments = path.split("/"), parent; if (segments.length > 2) { parent = segments[segments.length - 2]; } if (parent === "dev") { locationType = LOCATION_DEV; } else if (parent === "default") { locationType = LOCATION_DEFAULT; } else { locationType = LOCATION_UNKNOWN; } } if (!extensions[id]) { extensions[id] = {}; } extensions[id].installInfo = { metadata: metadata, path: path, locationType: locationType, status: (e.type === "loadFailed" ? START_FAILED : ENABLED) }; synchronizeEntry(id); loadTheme(id); $(exports).triggerHandler("statusChange", [id]); } ExtensionUtils.loadPackageJson(path) .done(function (metadata) { setData(metadata.name, metadata); }) .fail(function () { // If there's no package.json, this is a legacy extension. It was successfully loaded, // but we don't have an official ID or metadata for it, so we just create an id and // "title" for it (which is the last segment of its pathname) // and record that it's enabled. var match = path.match(/\/([^\/]+)$/), name = (match && match[1]) || path, metadata = { name: name, title: name }; setData(name, metadata); }); } /** * Determines if the given versions[] entry is compatible with the given Brackets API version, and if not * specifies why. * @param {Object} extVersion * @param {string} apiVersion * @return {{isCompatible: boolean, requiresNewer: ?boolean, compatibleVersion: ?string}} */ function getCompatibilityInfoForVersion(extVersion, apiVersion) { var requiredVersion = (extVersion.brackets || (extVersion.engines && extVersion.engines.brackets)), result = {}; result.isCompatible = !requiredVersion || semver.satisfies(apiVersion, requiredVersion); if (result.isCompatible) { result.compatibleVersion = extVersion.version; } else { // Find out reason for incompatibility if (requiredVersion.charAt(0) === '<') { result.requiresNewer = false; } else if (requiredVersion.charAt(0) === '>') { result.requiresNewer = true; } else if (requiredVersion.charAt(0) === "~") { var compareVersion = requiredVersion.slice(1); // Need to add .0s to this style of range in order to compare (since valid version // numbers must have major/minor/patch). if (compareVersion.match(/^[0-9]+$/)) { compareVersion += ".0.0"; } else if (compareVersion.match(/^[0-9]+\.[0-9]+$/)) { compareVersion += ".0"; } result.requiresNewer = semver.lt(apiVersion, compareVersion); } } return result; } /** * Finds the newest version of the entry that is compatible with the given Brackets API version, if any. * @param {Object} entry The registry entry to check. * @param {string} apiVersion The Brackets API version to check against. * @return {{isCompatible: boolean, requiresNewer: ?boolean, compatibleVersion: ?string, isLatestVersion: boolean}} * Result contains an "isCompatible" member saying whether it's compatible. If compatible, "compatibleVersion" * specifies the newest version that is compatible and "isLatestVersion" indicates if this is the absolute * latest version of the extension or not. If !isCompatible or !isLatestVersion, "requiresNewer" says whether * the latest version is incompatible due to requiring a newer (vs. older) version of Brackets. */ function getCompatibilityInfo(entry, apiVersion) { if (!entry.versions) { var fallback = getCompatibilityInfoForVersion(entry.metadata, apiVersion); if (fallback.isCompatible) { fallback.isLatestVersion = true; } return fallback; } var i = entry.versions.length - 1, latestInfo = getCompatibilityInfoForVersion(entry.versions[i], apiVersion); if (latestInfo.isCompatible) { latestInfo.isLatestVersion = true; return latestInfo; } else { // Look at earlier versions (skipping very latest version since we already checked it) for (i--; i >= 0; i--) { var compatInfo = getCompatibilityInfoForVersion(entry.versions[i], apiVersion); if (compatInfo.isCompatible) { compatInfo.isLatestVersion = false; compatInfo.requiresNewer = latestInfo.requiresNewer; return compatInfo; } } // No version is compatible, so just return info for the latest version return latestInfo; } } /** * Given an extension id and version number, returns the URL for downloading that extension from * the repository. Does not guarantee that the extension exists at that URL. * @param {string} id The extension's name from the metadata. * @param {string} version The version to download. * @return {string} The URL to download the extension from. */ function getExtensionURL(id, version) { return StringUtils.format(brackets.config.extension_url, id, version); } /** * Removes the installed extension with the given id. * @param {string} id The id of the extension to remove. * @return {$.Promise} A promise that's resolved when the extension is removed or * rejected with an error if there's a problem with the removal. */ function remove(id) { var result = new $.Deferred(); if (extensions[id] && extensions[id].installInfo) { Package.remove(extensions[id].installInfo.path) .done(function () { extensions[id].installInfo = null; result.resolve(); $(exports).triggerHandler("statusChange", [id]); }) .fail(function (err) { result.reject(err); }); } else { result.reject(StringUtils.format(Strings.EXTENSION_NOT_INSTALLED, id)); } return result.promise(); } /** * Updates an installed extension with the given package file. * @param {string} id of the extension * @param {string} packagePath path to the package file * @param {boolean=} keepFile Flag to keep extension package file, default=false * @return {$.Promise} A promise that's resolved when the extension is updated or * rejected with an error if there's a problem with the update. */ function update(id, packagePath, keepFile) { return Package.installUpdate(packagePath, id).done(function () { if (!keepFile) { FileSystem.getFileForPath(packagePath).unlink(); } }); } /** * Deletes any temporary files left behind by extensions that * were marked for update. */ function cleanupUpdates() { Object.keys(_idsToUpdate).forEach(function (id) { var installResult = _idsToUpdate[id], keepFile = installResult.keepFile, filename = installResult.localPath; if (filename && !keepFile) { FileSystem.getFileForPath(filename).unlink(); } }); _idsToUpdate = {}; } /** * Unmarks all extensions marked for removal. */ function unmarkAllForRemoval() { _idsToRemove = {}; } /** * Marks an extension for later removal, or unmarks an extension previously marked. * @param {string} id The id of the extension to mark for removal. * @param {boolean} mark Whether to mark or unmark it. */ function markForRemoval(id, mark) { if (mark) { _idsToRemove[id] = true; } else { delete _idsToRemove[id]; } $(exports).triggerHandler("statusChange", [id]); } /** * Returns true if an extension is marked for removal. * @param {string} id The id of the extension to check. * @return {boolean} true if it's been marked for removal, false otherwise. */ function isMarkedForRemoval(id) { return !!(_idsToRemove[id]); } /** * Returns true if there are any extensions marked for removal. * @return {boolean} true if there are extensions to remove */ function hasExtensionsToRemove() { return Object.keys(_idsToRemove).length > 0; } /** * If a downloaded package appears to be an update, mark the extension for update. * If an extension was previously marked for removal, marking for update will * turn off the removal mark. * @param {Object} installationResult info about the install provided by the Package.download function */ function updateFromDownload(installationResult) { if (installationResult.keepFile === undefined) { installationResult.keepFile = false; } var installationStatus = installationResult.installationStatus; if (installationStatus === Package.InstallationStatuses.ALREADY_INSTALLED || installationStatus === Package.InstallationStatuses.NEEDS_UPDATE || installationStatus === Package.InstallationStatuses.SAME_VERSION || installationStatus === Package.InstallationStatuses.OLDER_VERSION) { var id = installationResult.name; delete _idsToRemove[id]; _idsToUpdate[id] = installationResult; $(exports).triggerHandler("statusChange", [id]); } } /** * Removes the mark for an extension to be updated on restart. Also deletes the * downloaded package file. * @param {string} id The id of the extension for which the update is being removed */ function removeUpdate(id) { var installationResult = _idsToUpdate[id]; if (!installationResult) { return; } if (installationResult.localPath && !installationResult.keepFile) { FileSystem.getFileForPath(installationResult.localPath).unlink(); } delete _idsToUpdate[id]; $(exports).triggerHandler("statusChange", [id]); } /** * Returns true if an extension is marked for update. * @param {string} id The id of the extension to check. * @return {boolean} true if it's been marked for update, false otherwise. */ function isMarkedForUpdate(id) { return !!(_idsToUpdate[id]); } /** * Returns true if there are any extensions marked for update. * @return {boolean} true if there are extensions to update */ function hasExtensionsToUpdate() { return Object.keys(_idsToUpdate).length > 0; } /** * Removes extensions previously marked for removal. * @return {$.Promise} A promise that's resolved when all extensions are removed, or rejected * if one or more extensions can't be removed. When rejected, the argument will be an * array of error objects, each of which contains an "item" property with the id of the * failed extension and an "error" property with the actual error. */ function removeMarkedExtensions() { return Async.doInParallel_aggregateErrors( Object.keys(_idsToRemove), function (id) { return remove(id); } ); } /** * Updates extensions previously marked for update. * @return {$.Promise} A promise that's resolved when all extensions are updated, or rejected * if one or more extensions can't be updated. When rejected, the argument will be an * array of error objects, each of which contains an "item" property with the id of the * failed extension and an "error" property with the actual error. */ function updateExtensions() { return Async.doInParallel_aggregateErrors( Object.keys(_idsToUpdate), function (id) { var installationResult = _idsToUpdate[id]; return update(installationResult.name, installationResult.localPath, installationResult.keepFile); } ); } /** * Gets an array of extensions that are currently installed and can be updated to a new version * @return {Array.<{id: string, installVersion: string, registryVersion: string}>} * where id = extensionId * installVersion = currently installed version of extension * registryVersion = latest version compatible with current Brackets */ function getAvailableUpdates() { var result = []; Object.keys(extensions).forEach(function (extensionId) { var extensionInfo = extensions[extensionId]; // skip extensions that are not installed or are not in the registry if (!extensionInfo.installInfo || !extensionInfo.registryInfo) { return; } if (extensionInfo.registryInfo.updateCompatible) { result.push({ id: extensionId, installVersion: extensionInfo.installInfo.metadata.version, registryVersion: extensionInfo.registryInfo.lastCompatibleVersion }); } }); return result; } /** * Takes the array returned from getAvailableUpdates() as an input and removes those entries * that are no longer current - when currently installed version of an extension * is equal or newer than registryVersion returned by getAvailableUpdates(). * This function is designed to work without the necessity to download extension registry * @param {Array.<{id: string, installVersion: string, registryVersion: string}>} updates * previous output of getAvailableUpdates() * @return {Array.<{id: string, installVersion: string, registryVersion: string}>} * filtered input as function description */ function cleanAvailableUpdates(updates) { return updates.reduce(function (arr, updateInfo) { var extDefinition = extensions[updateInfo.id]; if (!extDefinition || !extDefinition.installInfo) { // extension has been uninstalled in the meantime return arr; } var installedVersion = extDefinition.installInfo.metadata.version; if (semver.lt(installedVersion, updateInfo.registryVersion)) { arr.push(updateInfo); } return arr; }, []); } // Listen to extension load and loadFailed events $(ExtensionLoader) .on("load", _handleExtensionLoad) .on("loadFailed", _handleExtensionLoad); // Public exports exports.downloadRegistry = downloadRegistry; exports.getCompatibilityInfo = getCompatibilityInfo; exports.getExtensionURL = getExtensionURL; exports.remove = remove; exports.update = update; exports.extensions = extensions; exports.cleanupUpdates = cleanupUpdates; exports.markForRemoval = markForRemoval; exports.isMarkedForRemoval = isMarkedForRemoval; exports.unmarkAllForRemoval = unmarkAllForRemoval; exports.hasExtensionsToRemove = hasExtensionsToRemove; exports.updateFromDownload = updateFromDownload; exports.removeUpdate = removeUpdate; exports.isMarkedForUpdate = isMarkedForUpdate; exports.hasExtensionsToUpdate = hasExtensionsToUpdate; exports.removeMarkedExtensions = removeMarkedExtensions; exports.updateExtensions = updateExtensions; exports.getAvailableUpdates = getAvailableUpdates; exports.cleanAvailableUpdates = cleanAvailableUpdates; exports.ENABLED = ENABLED; exports.START_FAILED = START_FAILED; exports.LOCATION_DEFAULT = LOCATION_DEFAULT; exports.LOCATION_DEV = LOCATION_DEV; exports.LOCATION_USER = LOCATION_USER; exports.LOCATION_UNKNOWN = LOCATION_UNKNOWN; // For unit testing only exports._reset = _reset; exports._setExtensions = _setExtensions; });
(function($) { $.fn.serializeObject = function() { var o = {}; var a = this.serializeArray(); $.each(a, function() { if (o[this.name] !== undefined) { if (!o[this.name].push) { o[this.name] = [o[this.name]]; } o[this.name].push(this.value || ''); } else { o[this.name] = this.value || ''; } }); return o; }; /** * Toggle whether a form fields is filled */ var toggleFilled = function(el) { if($(el).val()) { $(el).addClass('filled'); } else { $(el).removeClass('filled'); } }; /** * Add 'filled' class to form elements if they have a value */ $('input, textarea').keyup(function(e){ toggleFilled(this); }); $('select' ).change(function(e) { toggleFilled(this); }); $('input, textarea, select').blur(function(e){ toggleFilled(this); }); /** * Toggle the mobile menu */ $('.mobile-menu').click(function(e) { e.preventDefault(); $('.mobile-nav').toggleClass('open'); $(this).toggleClass('open'); }); $('.mobile-nav a').click(function(e) { $('.mobile-nav, .mobile-menu').removeClass('open'); $(this).removeClass('open'); }); $(window).resize(function(e) { $('.mobile-nav, .mobile-menu').removeClass('open'); $(this).removeClass('open'); }); /** * Initialize midnight */ $('.header').midnight(); /** * Smooth scroll window to an element */ $('a[href^="#"]').click(function(e) { e.preventDefault(); if($(this).attr('href') !== '#') { $('html, body').animate({ scrollTop: ($($.attr(this, 'href')).offset().top) - $('.header').height() }, 500); } }); /** * Handle submitting the contact for to Formspree */ $('.form-contact').submit(function(e) { e.preventDefault(); $.ajax({ url: "https://formspree.io/kjbrumm@gmail.com", method: "POST", data: $(this).serializeObject(), dataType: "json" }).done(function(data) { if(data.success) { $('.form-contact').hide(); $('.form-notice').text('Your message has been sent. We will be in touch shortly!').fadeIn(); } }); }); })(jQuery);
import { moduleForComponent, test } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; import { findWithAssert } from 'ember-native-dom-helpers'; moduleForComponent('findWithAssert', 'Integration | Test Helper | findWithAssert', { integration: true }); test('with empty query result, findWithAssert raises an error', function(assert) { this.render(hbs` <div class='hiding'>You can't find me</div> `); assert.throws(() => { findWithAssert('.hidden'); }); }); test('with a query result, findWithAssert helper is the same as find helper', function(assert) { let selector = 'input[type="text"]'; this.render(hbs` <input type="text" /> `); let expected = document.querySelector(`#ember-testing ${selector}`); let actual = findWithAssert(selector); assert.strictEqual(actual, expected, 'input found within #ember-testing'); });
App.Purchase = {};
import React from 'react' import { connect } from 'react-redux' import gameActions from '../actions/gameActions' import styled from 'styled-components' import { injectGlobal } from 'styled-components' import Fountain from '../../assets/fonts/Fountain.woff' injectGlobal` @font-face { font-family: "Fountain"; src: url('${Fountain}') format("woff"); } ` const RichyMel = styled.h1` font-family: "Fountain"; color: #fff; font-weight: normal; font-size: 1.5em; text-align: center; text-shadow: 8px 8px 2px rgba(7,14,14,0.67); margin-left: -60px; margin-top: -7px; @media (max-width:990px) and (min-width:700px) { margin-top: 2px; } ` const Counter = styled.button` color: rgb(117,252,252); font-size: .7em; font-weight: bold; box-sizing: border-box; padding: 3px; width: 187px; max-height: 25px; border-radius: 8px; text-align: center; text-decoration: none; letter-spacing: 2px; background: rgba(26,34,34, 0.7); -webkit-box-shadow: 8px 8px 5px 5px rgba(7,14,14,0.67); -moz-box-shadow: 8px 8px 5px 5px rgba(7,14,14,0.67); box-shadow: 8px 8px 5px 5px rgba(7,14,14,0.67); pointer-events: none; border: 2px solid rgb(117,252,252); margin-top: -50px; @media (max-width:990px) and (min-width:700px) { margin-left: 200px; display:block; margin-top: 10px; } ` @connect((store) => { return { gameTally: store.gameTally } }) class Stats extends React.Component { constructor() { super(); } render() { return ( <div> <Counter> GENERATIONS: {this.props.gameTally.generations} </Counter> <RichyMel>by&nbsp;&nbsp;&nbsp;RichyMel</RichyMel> </div> ) } } export default Stats
'use strict'; describe('Controller: MainCtrl', function () { // load the controller's module beforeEach(module('geekFoodApp')); var MainCtrl, scope; // Initialize the controller and a mock scope beforeEach(inject(function ($controller, $rootScope) { scope = $rootScope.$new(); MainCtrl = $controller('MainCtrl', { $scope: scope }); })); it('should attach a list of awesomeThings to the scope', function () { expect(scope.awesomeThings.length).toBe(3); }); });
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } var Auto = (function () { function Auto(data) { _classCallCheck(this, Auto); this.make = data.make; this.model = data.model; this.year = data.year; this.price = data.price; } _createClass(Auto, [{ key: 'getTotal', value: function getTotal(taxRate) { return this.price + this.price * taxRate; } }, { key: 'getDetails', value: function getDetails() { return this.year + ' ' + this.make + ' ' + this.model; } }]); return Auto; })(); exports.Auto = Auto; var Car = (function (_Auto) { _inherits(Car, _Auto); function Car(data) { _classCallCheck(this, Car); _get(Object.getPrototypeOf(Car.prototype), 'constructor', this).call(this, data); this.isElectric = data.isElectric; this.isHatchback = data.isHatchback; } _createClass(Car, [{ key: 'getDetails', value: function getDetails() { var details = _get(Object.getPrototypeOf(Car.prototype), 'getDetails', this).call(this); return details + ' Electric: ' + this.isElectric + ' Hatchback: ' + this.isHatchback; } }]); return Car; })(Auto); exports.Car = Car; var Truck = (function (_Auto2) { _inherits(Truck, _Auto2); function Truck(data) { _classCallCheck(this, Truck); _get(Object.getPrototypeOf(Truck.prototype), 'constructor', this).call(this, data); this.is4by4 = data.is4by4; } _createClass(Truck, [{ key: 'getDetails', value: function getDetails() { var details = _get(Object.getPrototypeOf(Truck.prototype), 'getDetails', this).call(this); return details + ' 4X4: ' + this.is4by4; } }]); return Truck; })(Auto); exports.Truck = Truck;
'use strict'; var chai = require('chai'); var Net = require('net'); var Socks5Client = require('socks5-client'); /* jshint unused: false */ var should = chai.should(); var expect = chai.expect; var bitcore = require('bitcore-base'); var P2P = require('../'); var Peer = P2P.Peer; var Networks = bitcore.Networks; describe('Peer', function() { it('should be able to create instance', function() { var peer = new Peer('localhost'); peer.host.should.equal('localhost'); peer.network.should.equal(Networks.livenet); peer.port.should.equal(Networks.livenet.port); }); it('should be able to create instance setting a port', function() { var peer = new Peer('localhost', 8111); peer.host.should.equal('localhost'); peer.network.should.equal(Networks.livenet); peer.port.should.equal(8111); }); it('should be able to create instance setting a network', function() { var peer = new Peer('localhost', Networks.testnet); peer.host.should.equal('localhost'); peer.network.should.equal(Networks.testnet); peer.port.should.equal(Networks.testnet.port); }); it('should be able to create instance setting port and network', function() { var peer = new Peer('localhost', 8111, Networks.testnet); peer.host.should.equal('localhost'); peer.network.should.equal(Networks.testnet); peer.port.should.equal(8111); }); it('should support creating instance without new', function() { var peer = Peer('localhost', 8111, Networks.testnet); peer.host.should.equal('localhost'); peer.network.should.equal(Networks.testnet); peer.port.should.equal(8111); }); if (typeof(window) === 'undefined'){ // Node.js Tests it('should be able to set a proxy', function() { var peer, peer2, socket; peer = new Peer('localhost'); expect(peer.proxy).to.be.undefined(); socket = peer._getSocket(); socket.should.be.instanceof(Net.Socket); peer2 = peer.setProxy('127.0.0.1', 9050); peer2.proxy.host.should.equal('127.0.0.1'); peer2.proxy.port.should.equal(9050); socket = peer2._getSocket(); socket.should.be.instanceof(Socks5Client); peer.should.equal(peer2); }); } });
$(document).ready(function(){ app.c.init(); app.v.init(); app.c.listeners(); }) ///////////////////////////////////////////////////////////////////////////////// var app={m:{},v:{},c:{}}; ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// app.c.init=function(){ app.m.metadata={"name":"Ziph","version":"0.0.1"}; }; app.c.listeners=function(){ $("input#count").click(function(){ var input=$("#input").val(); input=app.c.ziph(input); var sortable=[]; for (key in input){sortable.push([key,input[key].count]);} sortable.sort(function(a,b){return b[1]-a[1];}); var d=""; for (var i=0;i<sortable.length;i++){d+=sortable[i][0]+" "+sortable[i][1]+"<br>";} $("#output").html(d); }); }; app.c.ziph=function(sample,n){ var n=n||7; var lex={}; sample=sample.split(""); for (var i=0;i<=(sample.length-n);i++){ //then populate the lexicon var compilation=[]; for (var j=0;j<n;j++){ compilation.push(sample[i+j]) } compilation=compilation.join(""); if (!lex[compilation]){ lex[compilation]={}; lex[compilation].count=1; } else{ lex[compilation].count++; } } return lex; }; /////////////////////////////////////////// app.v.init=function(){ app.v.style(); var d=""; d+="<h1>ziph</h1>"; d+="<table width='100%' ><tr><td>"; d+="<textarea rows='10' cols='5' id='input' autofocus></textarea>"; d+="<input type='button' value='count' id='count'></input>"; d+="</td><td id='output'>"; d+="</td></tr></table>"; $("body").html(d); }; app.v.style=function(){ davis.style("body",{ "width":"100%", "margin":"0px", "padding":"0px", "text-align":"center", "background":"#555", "color":"#fff", "font-size":"3em" }); davis.style("div",{ "padding":"0", "font-size":"1.5em", "margin":"30px" }); davis.style("input[type=button]",{ "width":"100%", "font-size":"2em" }); davis.style("textarea",{ "width":"100%", "font-size":"1.5em", "margin":"0" }); davis.style("table",{ "width":"100%", "table-layout":"fixed" }); davis.style("td",{ "padding":"20px", "margin":"30px", "vertical-align":"top", "text-align":"center" }); };
'use strict'; var Model = require('../models').CivilService.County; module.exports = { up: function (queryInterface) { return queryInterface.createTable(Model.tableName, Model.attributes).then(function() { for (var i = 0; i < Model.options.indexes.length; i++) { queryInterface.addIndex(Model.tableName, Model.options.indexes[i]); } } ); }, down: function (queryInterface) { return queryInterface.dropTable(Model.tableName); } };
import React from 'react'; import Slider from 'react-slick'; import { Link, browserHistory } from 'react-router'; const Carousel = React.createClass({ clickImage(e,movieId){ // console.log(movieId) browserHistory.push('/view/'+movieId); }, render() { const settings = { infinite: false, speed: 300, slidesToShow: 4, slidesToScroll: 4, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 3, slidesToScroll: 3, infinite: true } }, { breakpoint: 600, settings: { slidesToShow: 2, slidesToScroll: 2 } }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1 } } ] } let childrens = (this.props.movies || []).map((movie, index) => { return ( <div key={index}> <img src={movie.poster.large} alt={movie.title} onClick={(event)=> this.clickImage(event,movie.imdb_id)} className="pointerClass" /> </div> ) }); return ( <div className="content-holder"> <Slider {...settings}> {childrens} </Slider> </div> ); } }); export default Carousel;
webpackJsonp([3],{435:function(e,t,u){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var d=u(439),n=o(d);t.default=n.default},439:function(e,t,u){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function d(e,t){var u=function(){t.router.push("/")};return(0,a.default)("div",{className:"page page-slide-in-down page-about"},void 0,(0,a.default)("header",{},void 0,i,(0,a.default)("button",{onClick:u},void 0,"Close")))}Object.defineProperty(t,"__esModule",{value:!0});var n=u(17),a=o(n),r=u(4),l=(o(r),{router:r.PropTypes.object}),i=(0,a.default)("h1",{},void 0,"About");d.contextTypes=l,t.default=d}}); //# sourceMappingURL=3.11c9790ea6c42da9bea3.js.map
/** * @since 2019-12-16 07:49 * @author vivaxy */ const { Readable } = require('stream'); function asyncToStream(fn) { const p = fn(); return new Readable({ read() { p.then((chunk) => { this.push(chunk); this.push(null); }); }, }); } function getData() { return new Promise((resolve) => { setTimeout(function() { resolve('ABCDEFG'); }, 1000); }); } const stream = asyncToStream(getData); setTimeout(function() { console.time('getData'); stream.on('data', function(chunk) { console.log(chunk.toString()); console.timeEnd('getData'); }); }, 500);
import $ from 'jquery'; import createFlash from '~/flash'; import GfmAutoComplete from '~/gfm_auto_complete'; import EmojiMenu from './emoji_menu'; const defaultStatusEmoji = 'speech_balloon'; document.addEventListener('DOMContentLoaded', () => { const toggleEmojiMenuButtonSelector = '.js-toggle-emoji-menu'; const toggleEmojiMenuButton = document.querySelector(toggleEmojiMenuButtonSelector); const statusEmojiField = document.getElementById('js-status-emoji-field'); const statusMessageField = document.getElementById('js-status-message-field'); const toggleNoEmojiPlaceholder = isVisible => { const placeholderElement = document.getElementById('js-no-emoji-placeholder'); placeholderElement.classList.toggle('hidden', !isVisible); }; const findStatusEmoji = () => toggleEmojiMenuButton.querySelector('gl-emoji'); const removeStatusEmoji = () => { const statusEmoji = findStatusEmoji(); if (statusEmoji) { statusEmoji.remove(); } }; const selectEmojiCallback = (emoji, emojiTag) => { statusEmojiField.value = emoji; toggleNoEmojiPlaceholder(false); removeStatusEmoji(); toggleEmojiMenuButton.innerHTML += emojiTag; }; const clearEmojiButton = document.getElementById('js-clear-user-status-button'); clearEmojiButton.addEventListener('click', () => { statusEmojiField.value = ''; statusMessageField.value = ''; removeStatusEmoji(); toggleNoEmojiPlaceholder(true); }); const emojiAutocomplete = new GfmAutoComplete(); emojiAutocomplete.setup($(statusMessageField), { emojis: true }); import(/* webpackChunkName: 'emoji' */ '~/emoji') .then(Emoji => { const emojiMenu = new EmojiMenu( Emoji, toggleEmojiMenuButtonSelector, 'js-status-emoji-menu', selectEmojiCallback, ); emojiMenu.bindEvents(); const defaultEmojiTag = Emoji.glEmojiTag(defaultStatusEmoji); statusMessageField.addEventListener('input', () => { const hasStatusMessage = statusMessageField.value.trim() !== ''; const statusEmoji = findStatusEmoji(); if (hasStatusMessage && statusEmoji) { return; } if (hasStatusMessage) { toggleNoEmojiPlaceholder(false); toggleEmojiMenuButton.innerHTML += defaultEmojiTag; } else if (statusEmoji.dataset.name === defaultStatusEmoji) { toggleNoEmojiPlaceholder(true); removeStatusEmoji(); } }); }) .catch(() => createFlash('Failed to load emoji list.')); });
/** * 网厅业务线强制建立src目录,src下有lib|mock|page|widget|util * lib存放第三方库 * mock存放假接口数据 * page存放demo页面 * widget存放与业务关联的模块 * util存放标准的kissy组件 * */ // 'use strict'; var util = require('util'); var path = require('path'); var yeoman = require('yeoman-generator'); var ClamLogo = require('./logo').ClamLogo; var ABC = require('abc-generator'); var ClamGenerator = module.exports = function ClamGenerator(args, options, config) { ABC.UIBase.apply(this, arguments); this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json'))); this.on('end', function () { var cb = this.async(); var that = this; this.prompt([{ name: 'npm_install', message: 'Install node_modules for grunt now?', default: 'Y/n', warning: '' }], function (err, props) { if (err) { return this.emit('error', err); } this.npm_install = (/^y/i).test(props.npm_install); if(this.npm_install){ this.npmInstall('', {}, function (err) { if (err) { return console.log('\n'+yellow('please run "sudo npm install"\n')); } console.log(green('\n\nnpm was installed successful. \n\n')); }); } else { console.log(yellow('\n\nplease run "npm install" before grunt\n')); console.log(green('\ndone!\n')); } }.bind(this)); }.bind(this)); }; util.inherits(ClamGenerator, ABC.UIBase); ClamGenerator.prototype.askFor = function askFor() { var cb = this.async(); // welcome message console.log(ClamLogo(this)); var abcJSON = {}; try { abcJSON = require(path.resolve(process.cwd(), 'abc.json')); } catch (e) { } if (!abcJSON.author) { abcJSON.author = { name: '', email: '' } } if(!abcJSON.name){ abcJSON.name = 'tmp'; } // have Yeoman greet the user. // console.log(this.yeoman); var folderName = path.basename(process.cwd()); // your-mojo-name => YourMojoName function parseMojoName(name){ return name.replace(/\b(\w)|(-\w)/g,function(m){ return m.toUpperCase().replace('-',''); }); } var prompts = [ { name: 'projectName', message: 'Name of Project?', default: folderName, warning: '' }, { name: 'author', message: 'Author Name:', default: abcJSON.author.name, warning: '' }, { name: 'email', message: 'Author Email:', default: abcJSON.author.email, warning: '' }, { name: 'groupName', message: 'Group Name:', default: 'video', warning: '' }, { name: 'version', message: 'Version:', default: '1.0.0', warning: '' } ]; /* * projectName:驼峰名称,比如 ProjectName * packageName:原目录名称,比如 project-name **/ this.prompt(prompts, function (err, props) { if (err) { return this.emit('error', err); } this.packageName = props.projectName;// project-name this.projectName = parseMojoName(this.packageName); //ProjectName this.author = props.author; this.email = props.email; this.version = props.version; this.groupName = props.groupName; this.config = 'http://g.tbcdn.cn/'+this.groupName+'/'+this.packageName+'/'+this.version+'/config.js'; this.srcDir = (/^y/i).test(props.srcDir); this.srcPath = '../'; this.currentBranch = 'master'; cb(); }.bind(this)); }; ClamGenerator.prototype.gruntfile = function gruntfile() { this.copy('Gruntfile_src.js','Gruntfile.js'); }; ClamGenerator.prototype.packageJSON = function packageJSON() { this.template('_package.json', 'package.json'); }; ClamGenerator.prototype.git = function git() { this.copy('_gitignore', '.gitignore'); }; ClamGenerator.prototype.app = function app() { this.mkdir('src'); this.mkdir('src/lib'); this.mkdir('src/mock'); this.mkdir('src/page'); this.mkdir('src/widget'); this.mkdir('src/util'); this.mkdir('src/service'); this.template('config.js','src/config.js'); this.copy('README.md', 'README.md'); this.mkdir('doc'); this.mkdir('build'); this.template('abc.json'); }; function consoleColor(str,num){ if (!num) { num = '32'; } return "\033[" + num +"m" + str + "\033[0m" } function green(str){ return consoleColor(str,32); } function yellow(str){ return consoleColor(str,33); } function red(str){ return consoleColor(str,31); } function blue(str){ return consoleColor(str,34); }
import { stopEventPropagation, fireClick } from './handle-dom'; import { setFocusStyle } from './handle-swmd-dom'; var handleKeyDown = function(event, params, modal) { var e = event || window.event; var keyCode = e.keyCode || e.which; if (keyCode === 13) { // ENTER var okButton = modal.querySelector('button.confirm'); fireClick(okButton, e); } else if (keyCode === 27 && params.allowEscapeKey === true) { // ESCAPE var cancelButton = modal.querySelector('button.cancel'); fireClick(cancelButton, e); } }; export default handleKeyDown;
import { THEME_DARK } from './themes'; import { svg1DAxisIcon, svg1DTilesIcon, svg2DHeatmapIcon, svg2DTilesIcon, svgArrowheadDomainsIcon, svgGeneAnnotationsIcon, svgHorizontalLineIcon, svgHorizontal1dHeatmap, svgVertical1DAxisIcon, svgVertical1DTilesIcon, svgGeoMapIcon, } from '../icons'; const osm = { type: 'osm-tiles', datatype: ['map-tiles'], local: true, orientation: '2d', hidden: true, name: 'OSM Tiles', thumbnail: svgGeoMapIcon, availableOptions: [ 'minPos', 'maxPos', 'maxZoom', 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'name', ], defaultOptions: { minPos: -180, maxPos: 180, maxZoom: 19, labelPosition: 'bottomRight', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, }, }; const mapbox = { type: 'mapbox-tiles', datatype: ['map-tiles'], local: true, orientation: '2d', hidden: true, name: 'Mapbox Tiles', thumbnail: svgGeoMapIcon, availableOptions: [ 'style', 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'name', ], defaultOptions: { style: 'mapbox.streets', labelPosition: 'bottomRight', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, }, }; export const TRACKS_INFO = [ osm, Object.assign({}, osm, { type: 'osm' }), mapbox, Object.assign({}, mapbox, { type: 'mapbox' }), { type: 'left-axis', datatype: ['axis'], local: true, orientation: '1d-vertical', name: 'Left Axis', thumbnail: svgVertical1DAxisIcon, availableOptions: ['minWidth'], defaultOptions: { minWidth: 100, }, }, { type: 'top-axis', datatype: ['axis'], local: true, orientation: '1d-horizontal', name: 'Top Axis', thumbnail: svg1DAxisIcon, defaultOptions: {}, }, { type: 'horizontal-rule', datatype: ['x-coord'], local: true, orientation: 'whole', name: 'Horizontal Rule', thumbnail: null, availableOptions: ['color'], defaultOptions: { color: 'black', }, }, { type: 'vertical-rule', datatype: ['y-coord'], local: true, orientation: 'whole', name: 'Vertical Rule', thumbnail: null, availableOptions: ['color'], defaultOptions: { color: 'black', }, }, { type: 'cross-rule', datatype: ['xy-coord'], local: true, orientation: 'whole', name: 'Cross Rule', thumbnail: null, availableOptions: ['color'], defaultOptions: { color: 'black', }, }, { type: 'simple-svg', datatype: [], local: false, orientation: '2d', exportable: true, availableOptions: ['minWidth', 'minHeight'], defaultOptions: { minWidth: 100, minHeight: 100, }, }, { type: 'heatmap', datatype: ['matrix'], local: false, orientation: '2d', thumbnail: svg2DHeatmapIcon, exportable: true, availableOptions: [ 'backgroundColor', 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelShowResolution', 'labelShowAssembly', 'labelColor', 'labelTextOpacity', 'labelBackgroundOpacity', 'colorRange', 'colorbarBackgroundColor', 'maxZoom', 'minWidth', 'minHeight', 'dataTransform', 'colorbarPosition', 'trackBorderWidth', 'trackBorderColor', 'heatmapValueScaling', 'showMousePosition', 'mousePositionColor', 'showTooltip', 'extent', 'zeroValueColor', ], defaultOptions: { backgroundColor: '#eeeeee', labelPosition: 'bottomRight', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, labelShowResolution: true, labelShowAssembly: true, colorRange: [ // corresponding to the fall colormap 'white', 'rgba(245,166,35,1.0)', 'rgba(208,2,27,1.0)', 'black', ], colorbarBackgroundColor: '#ffffff', maxZoom: null, minWidth: 100, minHeight: 100, colorbarPosition: 'topRight', trackBorderWidth: 0, trackBorderColor: 'black', heatmapValueScaling: 'log', showMousePosition: false, mousePositionColor: '#000000', showTooltip: false, extent: 'full', zeroValueColor: null, }, defaultOptionsByTheme: { [THEME_DARK]: { backgroundColor: '#000000', colorRange: [ // corresponding to the inverted fall colormap 'black', 'rgba(208,2,27,1.0)', 'rgba(245,166,35,1.0)', 'white', ], colorbarBackgroundColor: '#000000', labelColor: '#ffffff', labelBackgroundColor: '#000000', trackBorderColor: '#ffffff', mousePositionColor: '#ffffff', }, }, }, { type: 'linear-heatmap', aliases: ['horizontal-heatmap', 'vertical-heatmap'], datatype: ['matrix'], local: false, orientation: '1d-horizontal', rotatable: true, thumbnail: svg2DHeatmapIcon, defaultOptions: { backgroundColor: '#eeeeee', labelPosition: 'bottomRight', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, labelShowResolution: true, labelShowAssembly: true, labelColor: 'black', colorRange: [ // corresponding to the fall colormap 'white', 'rgba(245,166,35,1.0)', 'rgba(208,2,27,1.0)', 'black', ], maxZoom: null, minWidth: 100, minHeight: 40, trackBorderWidth: 0, trackBorderColor: 'black', }, availableOptions: [ 'backgroundColor', 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelShowResolution', 'labelShowAssembly', 'labelColor', 'labelTextOpacity', 'labelBackgroundOpacity', 'colorRange', 'maxZoom', 'minWidth', 'minHeight', 'dataTransform', 'oneDHeatmapFlipped', 'colorbarPosition', 'trackBorderWidth', 'trackBorderColor', 'heatmapValueScaling', ], }, { type: 'line', aliases: ['horizontal-line', 'vertical-line'], datatype: ['vector'], local: false, orientation: '1d-horizontal', rotatable: true, thumbnail: svgHorizontalLineIcon, availableOptions: [ 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelShowResolution', 'labelShowAssembly', 'labelColor', 'labelTextOpacity', 'labelBackgroundColor', 'labelBackgroundOpacity', 'axisLabelFormatting', 'axisPositionHorizontal', 'axisMargin', 'lineStrokeWidth', 'lineStrokeColor', 'valueScaling', 'valueScaleMin', 'valueScaleMax', 'trackBorderWidth', 'trackBorderColor', 'trackType', 'showMousePosition', 'showTooltip', 'mousePositionColor', 'aggregationMode', 'minHeight', ], defaultOptions: { labelColor: 'black', labelPosition: 'topLeft', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, labelBackgroundColor: 'white', labelShowResolution: false, labelShowAssembly: true, axisLabelFormatting: 'scientific', axisPositionHorizontal: 'right', lineStrokeColor: 'blue', lineStrokeWidth: 1, valueScaling: 'linear', trackBorderWidth: 0, trackBorderColor: 'black', labelTextOpacity: 0.4, showMousePosition: false, minHeight: 20, mousePositionColor: '#000000', showTooltip: false, }, defaultOptionsByTheme: { [THEME_DARK]: { labelColor: '#ffffff', labelBackgroundColor: '#000000', trackBorderColor: '#ffffff', mousePositionColor: '#ffffff', }, }, }, { type: '1d-heatmap', aliases: ['horizontal-1d-heatmap', 'vertical-1d-heatmap'], datatype: ['vector'], local: false, orientation: '1d-horizontal', rotatable: true, thumbnail: svgHorizontal1dHeatmap, availableOptions: [ 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelShowResolution', 'labelShowAssembly', 'labelColor', 'labelTextOpacity', 'labelBackgroundOpacity', 'axisPositionHorizontal', 'axisMargin', 'colorRange', 'valueScaling', 'trackBorderWidth', 'trackBorderColor', 'trackType', 'showMousePosition', 'showTooltip', 'mousePositionColor', 'aggregationMode', ], defaultOptions: { labelColor: 'black', labelPosition: 'topLeft', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, labelShowResolution: false, labelShowAssembly: true, axisPositionHorizontal: 'right', colorRange: [ // corresponding to the fall colormap 'white', 'rgba(245,166,35,1.0)', 'rgba(208,2,27,1.0)', 'black', ], valueScaling: 'linear', trackBorderWidth: 0, trackBorderColor: 'black', labelTextOpacity: 0.4, showMousePosition: false, mousePositionColor: '#000000', showTooltip: false, }, }, { type: 'vector-heatmap', aliases: ['horizontal-vector-heatmap', 'vertical-vector-heatmap'], datatype: ['vector'], local: false, orientation: '1d-horizontal', rotatable: true, minHeight: 1, thumbnail: null, availableOptions: [ 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelShowResolution', 'labelShowAssembly', 'labelColor', 'valueScaling', 'labelTextOpacity', 'labelBackgroundOpacity', 'colorRange', 'trackBorderWidth', 'trackBorderColor', 'trackType', 'heatmapValueScaling', ], defaultOptions: { labelPosition: 'topLeft', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, labelShowResolution: false, labelShowAssembly: true, labelColor: 'black', labelTextOpacity: 0.4, valueScaling: 'linear', trackBorderWidth: 0, trackBorderColor: 'black', heatmapValueScaling: 'log', }, }, { type: 'multivec', aliases: ['horizontal-multivec', 'vertical-multivec'], datatype: ['multivec'], local: false, orientation: '1d-horizontal', rotatable: true, thumbnail: null, availableOptions: [ 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelShowResolution', 'labelShowAssembly', 'labelColor', 'minHeight', 'valueScaling', 'labelTextOpacity', 'labelBackgroundOpacity', 'colorRange', 'trackBorderWidth', 'trackBorderColor', 'trackType', 'heatmapValueScaling', 'selectRows', 'selectRowsAggregationMode', 'selectRowsAggregationWithRelativeHeight', 'selectRowsAggregationMethod', 'colorbarBackgroundColor', 'colorbarPosition', 'zeroValueColor', ], defaultOptions: { labelPosition: 'topLeft', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, labelShowResolution: true, labelShowAssembly: true, labelColor: 'black', labelTextOpacity: 0.4, minHeight: 100, valueScaling: 'linear', trackBorderWidth: 0, trackBorderColor: 'black', heatmapValueScaling: 'log', selectRows: null, selectRowsAggregationMode: 'mean', selectRowsAggregationWithRelativeHeight: true, selectRowsAggregationMethod: 'client', colorbarBackgroundColor: '#ffffff', colorbarPosition: 'topRight', zeroValueColor: null, }, defaultOptionsByTheme: { [THEME_DARK]: { colorbarBackgroundColor: '#000000', }, }, }, { type: 'point', aliases: ['horizontal-point', 'vertical-point'], datatype: ['vector'], local: false, orientation: '1d-horizontal', rotatable: true, availableOptions: [ 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelShowResolution', 'labelShowAssembly', 'labelColor', 'labelTextOpacity', 'labelBackgroundOpacity', 'axisLabelFormatting', 'axisPositionHorizontal', 'axisMargin', 'pointColor', 'pointSize', 'valueScaling', 'trackBorderWidth', 'trackBorderColor', ], defaultOptions: { labelColor: 'black', labelPosition: 'topLeft', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, labelShowResolution: false, labelShowAssembly: true, axisLabelFormatting: 'scientific', axisPositionHorizontal: 'right', pointColor: 'red', pointSize: 3, valueScaling: 'linear', trackBorderWidth: 0, trackBorderColor: 'black', labelTextOpacity: 0.4, }, }, { type: 'divergent-bar', aliases: ['horizontal-divergent-bar', 'vertical-divergent-bar'], datatype: ['vector'], local: false, orientation: '1d-horizontal', rotatable: true, availableOptions: [ 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelShowResolution', 'labelShowAssembly', 'labelColor', 'labelTextOpacity', 'labelBackgroundOpacity', 'axisLabelFormatting', 'axisPositionHorizontal', 'axisMargin', 'barFillColorTop', 'barFillColorBottom', 'valueScaling', 'trackBorderWidth', 'trackBorderColor', 'barOpacity', ], defaultOptions: { labelColor: 'black', labelPosition: 'topLeft', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, labelShowResolution: false, labelShowAssembly: true, axisPositionHorizontal: 'right', axisLabelFormatting: 'scientific', barFillColorBottom: 'red', barFillColorTop: 'green', valueScaling: 'linear', trackBorderWidth: 0, trackBorderColor: 'black', labelTextOpacity: 0.4, barOpacity: 1, }, }, { type: 'bar', aliases: ['horizontal-bar', 'vertical-bar'], datatype: ['vector'], local: false, orientation: '1d-horizontal', rotatable: true, availableOptions: [ 'align', 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelShowResolution', 'labelShowAssembly', 'labelColor', 'labelTextOpacity', 'labelBackgroundOpacity', 'axisLabelFormatting', 'axisPositionHorizontal', 'axisMargin', 'barFillColor', 'colorRange', 'colorRangeGradient', 'valueScaling', 'valueScaleMin', 'valueScaleMax', 'trackBorderWidth', 'trackBorderColor', 'barOpacity', 'showMousePosition', 'showTooltip', 'aggregationMode', 'zeroLineVisible', 'zeroLineColor', 'zeroLineOpacity', ], defaultOptions: { align: 'bottom', labelColor: '[glyph-color]', labelPosition: 'topLeft', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, labelShowResolution: false, labelShowAssembly: true, axisLabelFormatting: 'scientific', axisPositionHorizontal: 'right', barFillColor: 'darkgreen', valueScaling: 'linear', trackBorderWidth: 0, trackBorderColor: 'black', labelTextOpacity: 0.4, barOpacity: 1, }, }, { type: '2d-tiles', datatype: ['matrix'], local: false, orientation: '2d', name: '2D Tile Outlines', thumbnail: svg2DTilesIcon, }, { type: '1d-value-interval', aliases: ['horizontal-1d-value-interval', 'vertical-1d-value-interval'], datatype: ['bed-value'], local: false, orientation: ['1d-horizontal'], rotatable: true, name: '1D Rectangles', availableOptions: [ 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelColor', 'labelTextOpacity', 'labelBackgroundOpacity', 'axisPositionHorizontal', 'axisMargin', ], defaultOptions: { labelColor: 'black', labelPosition: 'bottomLeft', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, axisPositionHorizontal: 'left', lineStrokeColor: 'blue', valueScaling: 'linear', }, }, { type: 'stacked-interval', aliases: ['top-stacked-interval', 'left-stacked-interval'], datatype: ['stacked-interval'], local: false, orientation: '1d-horizontal', rotatable: true, thumbnail: 'horizontal-stacked-interval.png', availableOptions: [ 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelColor', 'labelTextOpacity', 'labelBackgroundOpacity', ], }, { type: 'viewport-projection-vertical', datatype: ['1d-projection'], local: true, hidden: true, orientation: '1d-vertical', name: 'Viewport Projection', thumbnail: 'viewport-projection-center.png', availableOptions: [ 'projectionFillColor', 'projectionStrokeColor', 'strokeWidth', ], defaultOptions: { projectionFillColor: '#777', projectionStrokeColor: '#777', projectionFillOpacity: 0.3, projectionStrokeOpacity: 0.7, strokeWidth: 1, }, }, { type: 'viewport-projection-horizontal', datatype: ['1d-projection'], local: true, hidden: true, orientation: '1d-horizontal', name: 'Viewport Projection', thumbnail: 'viewport-projection-center.png', availableOptions: [ 'projectionFillColor', 'projectionStrokeColor', 'strokeWidth', ], defaultOptions: { projectionFillColor: '#777', projectionStrokeColor: '#777', projectionFillOpacity: 0.3, projectionStrokeOpacity: 0.7, strokeWidth: 1, }, }, { type: 'viewport-projection-center', datatype: ['2d-projection'], local: true, hidden: true, orientation: '2d', name: 'Viewport Projection', thumbnail: 'viewport-projection-center.png', availableOptions: [ 'projectionFillColor', 'projectionStrokeColor', 'strokeWidth', ], defaultOptions: { projectionFillColor: '#777', projectionStrokeColor: '#777', projectionFillOpacity: 0.3, projectionStrokeOpacity: 0.7, strokeWidth: 1, }, }, { type: 'gene-annotations', aliases: ['horizontal-gene-annotations', 'vertical-gene-annotations'], datatype: ['gene-annotation'], local: false, defaultHeight: 90, defaultWidth: 90, rotatable: true, orientation: '1d-horizontal', name: 'Gene Annotations', thumbnail: svgGeneAnnotationsIcon, availableOptions: [ 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelColor', 'labelTextOpacity', 'labelBackgroundColor', 'labelBackgroundOpacity', 'minHeight', 'plusStrandColor', 'minusStrandColor', 'trackBorderWidth', 'trackBorderColor', 'showMousePosition', 'mousePositionColor', 'fontSize', 'geneAnnotationHeight', 'geneLabelPosition', 'geneStrandSpacing', ], defaultOptions: { fontSize: 10, labelColor: 'black', labelBackgroundColor: '#ffffff', labelPosition: 'hidden', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, minHeight: 24, plusStrandColor: 'blue', minusStrandColor: 'red', trackBorderWidth: 0, trackBorderColor: 'black', showMousePosition: false, mousePositionColor: '#000000', geneAnnotationHeight: 16, geneLabelPosition: 'outside', geneStrandSpacing: 4, }, defaultOptionsByTheme: { [THEME_DARK]: { labelColor: '#ffffff', labelBackgroundColor: '#000000', trackBorderColor: '#ffffff', mousePositionColor: '#ffffff', plusStrandColor: '#40a0ff', }, }, }, { type: 'arrowhead-domains', datatype: ['arrowhead-domains'], local: false, orientation: '2d', name: 'Arrowhead Domains', thumbnail: svgArrowheadDomainsIcon, availableOptions: [ 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelColor', 'labelTextOpacity', 'labelBackgroundOpacity', 'trackBorderWidth', 'trackBorderColor', ], defaultOptions: { labelColor: 'black', labelPosition: 'hidden', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, trackBorderWidth: 0, trackBorderColor: 'black', }, }, { type: 'linear-2d-rectangle-domains', aliases: [ 'horizontal-2d-rectangle-domains', 'vertical-2d-rectangle-domains', ], datatype: ['2d-rectangle-domains'], local: false, orientation: '1d-horizontal', rotatable: true, name: 'Horizontal 2D Rectangle Domains', thumbnail: svgArrowheadDomainsIcon, availableOptions: [ 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelColor', 'labelTextOpacity', 'labelBackgroundOpacity', 'trackBorderWidth', 'trackBorderColor', 'rectangleDomainFillColor', 'rectangleDomainStrokeColor', 'rectangleDomainOpacity', 'minSquareSize', ], defaultOptions: { labelColor: 'black', labelPosition: 'bottomLeft', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, trackBorderWidth: 0, trackBorderColor: 'black', rectangleDomainFillColor: 'grey', rectangleDomainStrokeColor: 'black', rectangleDomainOpacity: 0.6, minSquareSize: 'none', }, }, { type: '2d-rectangle-domains', datatype: ['2d-rectangle-domains'], local: false, orientation: '2d', name: '2D Rectangle Domains', thumbnail: svgArrowheadDomainsIcon, availableOptions: [ 'flipDiagonal', 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelColor', 'labelTextOpacity', 'labelBackgroundOpacity', 'trackBorderWidth', 'trackBorderColor', 'rectangleDomainFillColor', 'rectangleDomainStrokeColor', 'rectangleDomainOpacity', 'minSquareSize', ], defaultOptions: { flipDiagonal: 'none', labelColor: 'black', labelPosition: 'hidden', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, trackBorderWidth: 0, trackBorderColor: 'black', rectangleDomainFillColor: 'grey', rectangleDomainStrokeColor: 'black', rectangleDomainOpacity: 0.6, minSquareSize: 'none', }, }, { type: 'horizontal-1d-annotations', datatype: ['nothing'], // Unfortunately one has to specify something here local: false, orientation: '1d-horizontal', name: 'Horizontal 1D Annotations', thumbnail: null, availableOptions: [ 'fill', 'fillOpacity', 'stroke', 'strokeOpacity', 'strokeWidth', 'strokePos', 'regions', ], defaultOptions: { fill: 'red', fillOpacity: 0.2, stroke: 'red', strokeOpacity: 0, strokeWidth: 1, regions: [], strokePos: [], }, }, { type: 'vertical-1d-annotations', datatype: ['nothing'], // Unfortunately one has to specify something here local: false, orientation: '1d-vertical', name: 'Vertical 1D Annotations', thumbnail: null, availableOptions: [ 'fill', 'fillOpacity', 'stroke', 'strokeOpacity', 'regions', ], defaultOptions: { fill: 'red', fillOpacity: '0.2', stroke: 'red', strokeOpacity: '0', regions: [], }, }, { type: '2d-annotations', datatype: ['2d-annotations'], local: false, orientation: '2d', name: '2D Annotations', thumbnail: svgArrowheadDomainsIcon, availableOptions: [ 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelColor', 'labelTextOpacity', 'labelBackgroundOpacity', 'trackBorderWidth', 'trackBorderColor', 'rectangleDomainFillColor', 'rectangleDomainStrokeColor', 'rectangleDomainOpacity', 'minSquareSize', 'isClickable', 'hoverColor', 'selectColor', 'exclude', 'trackBorderBgWidth', 'trackBorderBgColor', 'trackBorderBgAlpha', ], defaultOptions: { labelColor: 'black', labelPosition: 'hidden', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, trackBorderWidth: 0, trackBorderColor: 'black', rectangleDomainFillColor: 'grey', rectangleDomainStrokeColor: 'black', rectangleDomainOpacity: 0.6, minSquareSize: 'none', isClickable: false, hoverColor: 'orange', selectColor: 'fuchsia', exclude: [], trackBorderBgWidth: 0, trackBorderBgColor: 'black', trackBorderBgAlpha: 0.33, }, }, { type: 'square-markers', datatype: ['bedpe'], local: false, orientation: '2d', name: 'Square Markers', thumbnail: svgArrowheadDomainsIcon, availableOptions: [ 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'labelColor', ], defaultOptions: { labelColor: 'black', labelPosition: 'hidden', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, trackBorderWidth: 0, trackBorderColor: 'black', }, }, { type: 'combined', datatype: 'any', local: true, orientation: 'any', }, { type: 'horizontal-chromosome-grid', datatype: ['chromsizes'], local: false, orientation: '1d-horizontal', name: 'Chromosome Grid', chromInfoPath: '//s3.amazonaws.com/pkerp/data/hg19/chromSizes.tsv', thumbnail: null, availableOptions: [ 'lineStrokeWidth', 'lineStrokeColor', 'showMousePosition', ], defaultOptions: { lineStrokeWidth: 1, lineStrokeColor: 'grey', showMousePosition: false, }, }, { type: 'vertical-chromosome-grid', datatype: ['chromsizes'], local: false, orientation: '1d-vertical', name: 'Chromosome Grid', chromInfoPath: '//s3.amazonaws.com/pkerp/data/hg19/chromSizes.tsv', thumbnail: null, availableOptions: [ 'lineStrokeWidth', 'lineStrokeColor', 'showMousePosition', ], defaultOptions: { lineStrokeWidth: 1, lineStrokeColor: 'grey', showMousePosition: false, }, }, { type: '2d-chromosome-grid', datatype: ['chromsizes'], local: false, orientation: '2d', name: 'Chromosome Grid', chromInfoPath: '//s3.amazonaws.com/pkerp/data/hg19/chromSizes.tsv', thumbnail: null, availableOptions: ['lineStrokeWidth', 'lineStrokeColor'], defaultOptions: { lineStrokeWidth: 1, lineStrokeColor: 'grey', }, }, { type: '2d-chromosome-annotations', datatype: ['chromsizes'], local: true, orientation: '2d', name: '2D Chromosome Annotations', thumbnail: null, hidden: true, }, { type: '2d-chromosome-labels', datatype: ['chromsizes'], local: true, orientation: '2d', name: 'Pairwise Chromosome Labels', thumbnail: null, }, { type: 'chromosome-labels', aliases: ['horizontal-chromosome-labels', 'vertical-chromosome-labels'], datatype: ['chromsizes'], orientation: '1d-horizontal', rotatable: true, minHeight: 35, defaultHeight: 30, name: 'Chromosome Axis', thumbnail: null, availableOptions: [ 'color', 'stroke', 'fontSize', 'fontIsLeftAligned', 'showMousePosition', 'mousePositionColor', 'tickPositions', 'tickFormat', 'reverseOrientation', ], defaultOptions: { color: '#808080', stroke: '#ffffff', fontSize: 12, fontIsLeftAligned: false, showMousePosition: false, mousePositionColor: '#000000', reverseOrientation: false, }, defaultOptionsByTheme: { [THEME_DARK]: { color: '#808080', stroke: '#000000', mousePositionColor: '#ffffff', }, }, }, { type: 'vertical-1d-tiles', datatype: ['1d-tiles'], local: false, orientation: '1d-vertical', name: 'Vertical 1D Tile Outlines', thumbnail: svgVertical1DTilesIcon, }, { type: 'horizontal-1d-tiles', datatype: ['vector', 'stacked-interval', 'gene-annotation'], local: false, orientation: '1d-horizontal', name: 'Horizontal 1D Tile Outlines', thumbnail: svg1DTilesIcon, }, { type: 'osm-2d-tile-ids', datatype: ['map-tiles'], local: false, orientation: '2d', name: 'OSM Tile Outlines', thumbnail: svg2DTilesIcon, availableOptions: [ 'minPos', 'maxPos', 'maxZoom', 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'name', ], defaultOptions: { minPos: -180, maxPos: 180, maxZoom: 19, labelPosition: 'bottomRight', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, }, }, { type: 'raster-tiles', datatype: ['map-tiles'], local: true, orientation: '2d', hidden: true, name: 'Raster Tiles', thumbnail: svgGeoMapIcon, availableOptions: [ 'labelPosition', 'labelLeftMargin', 'labelRightMargin', 'labelTopMargin', 'labelBottomMargin', 'name', ], defaultOptions: { labelPosition: 'bottomRight', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, }, }, { type: 'image-tiles', datatype: ['image-tiles'], local: true, orientation: '2d', hidden: true, name: 'Image Tiles', thumbnail: null, }, { type: 'bedlike', datatype: ['bedlike'], aliases: ['vertical-bedlike'], local: false, orientation: '1d-horizontal', rotatable: true, name: 'BED-like track', thumbnail: null, availableOptions: [ 'alternating', 'annotationHeight', 'annotationStyle', 'fillColor', 'fillOpacity', 'fontColor', 'fontSize', 'minusStrandColor', 'plusStrandColor', 'labelBottomMargin', 'labelColor', 'labelLeftMargin', 'labelPosition', 'labelRightMargin', 'labelTopMargin', 'labelTextOpacity', 'labelBackgroundOpacity', 'maxAnnotationHeight', 'minHeight', 'trackBorderWidth', 'trackBorderColor', 'valueColumn', 'colorEncoding', 'colorRange', 'colorEncodingRange', 'separatePlusMinusStrands', 'showTexts', 'axisPositionHorizontal', 'axisMargin', ], defaultOptions: { alternating: false, annotationStyle: 'box', fillColor: 'blue', fillOpacity: 0.3, fontSize: '10', axisPositionHorizontal: 'right', labelColor: 'black', labelPosition: 'hidden', labelLeftMargin: 0, labelRightMargin: 0, labelTopMargin: 0, labelBottomMargin: 0, minHeight: 20, maxAnnotationHeight: null, trackBorderWidth: 0, trackBorderColor: 'black', valueColumn: null, colorEncoding: 'itemRgb', showTexts: false, colorRange: ['#000000', '#652537', '#bf5458', '#fba273', '#ffffe0'], colorEncodingRange: false, separatePlusMinusStrands: true, annotationHeight: 16, }, }, { type: 'empty', datatype: [], orientation: '1d-horizontal', name: 'Empty track', thumbnail: null, availableOptions: [], defaultOptions: {}, }, ]; export default TRACKS_INFO;
/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */ import React, { PropTypes, Component } from 'react'; import styles from './ContactPage.css'; import withStyles from '../../decorators/withStyles'; @withStyles(styles) class ContactPage extends Component { static contextTypes = { onSetTitle: PropTypes.func.isRequired, }; render() { const title = '联系我们'; this.context.onSetTitle(title); return ( <div className="ContactPage"> <div className="ContactPage-container"> <h1>{title}</h1> <p>...</p> </div> </div> ); } } export default ContactPage;
/* jshint node: true */ module.exports = function(environment) { var ENV = { modulePrefix: 'ember-mythology', podModulePrefix: 'ember-mythology/pods', environment: environment, baseURL: '/', locationType: 'auto', EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build // e.g. 'with-controller': true } }, APP: { // Here you can pass flags/options to your application instance // when it is created APIEndpoint: "http://hypermedia.cainosullivan.com" } }; if (environment === 'development') { // ENV.APP.LOG_RESOLVER = true; // ENV.APP.LOG_ACTIVE_GENERATION = true; // ENV.APP.LOG_TRANSITIONS = true; // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; // ENV.APP.LOG_VIEW_LOOKUPS = true; } if (environment === 'test') { // Testem prefers this... ENV.baseURL = '/'; ENV.locationType = 'none'; // keep test console output quieter ENV.APP.LOG_ACTIVE_GENERATION = false; ENV.APP.LOG_VIEW_LOOKUPS = false; ENV.APP.rootElement = '#ember-testing'; } if (environment === 'production') { } return ENV; };
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ 'use strict'; /* * SINGLE ASSET SERVICES * */ mdlDirectTvApp.factory('SingleAssetService', ['$http', 'Sessions', '$rootScope', 'configuration', function($http, Sessions, $rootScope, configuration) { var SingleAssetService = { getMetadata: function(isContinuousPlayback, titleIdOrEmbedCode) { var url = (isContinuousPlayback === true) ? '/singleasset/getSigleAssetMetadata?embed_code=' + titleIdOrEmbedCode : '/singleasset/getSigleAssetMetadata?titleId=' + titleIdOrEmbedCode; var promise = $http.get(configuration.server_url + url).then(function(response, headers) { return response.data; }); return promise; }, getEpisodesAndSeasonList: function(series_id) { var url = '/singleasset/getEpisodelist?series_id=' + series_id; var promise = $http.get(configuration.server_url + url).then(function(response, headers) { return response.data; }); return promise; }, getEpisodeListOfaSeason: function(series_id, season_id) { var url = '/singleasset/getOPTEpisodelist?series_id=' + series_id + '&season_id=' + season_id; var promise = $http.get(configuration.server_url + url).then(function(response, headers) { return response.data; }); return promise; }, getEpisodeListOnlyOfaSeason: function(series_id, season_id) { var url = '/singleasset/getOPTEpisodelistOnly?series_id=' + series_id + '&season_id=' + season_id; var promise = $http.get(configuration.server_url + url).then(function(response, headers) { return response.data; }); return promise; }, getSimilarItemsList: function(embed_code, queryOption) { var url = '/singleasset/getSimilarAssets?embed_code=' + embed_code + '&assetType=' + queryOption; var promise = $http.get(configuration.server_url + url).then(function(response, headers) { return response.data; }); return promise; }, getPlayerOpt: function(token) { //review transaction to display errors and then confirm var promise = $http.get(configuration.server_url + '/getopt').then(function(response, headers) { return response.data; }); return promise; }, getDiscoveryItems: function(queryOption) { //var path=(JSON.parse(queryOption)).path; var url = "/singleasset/getDiscoveryAssetsShort?" + (JSON.parse(queryOption)).path; var promise = $http.get(configuration.server_url + url).then(function(response, headers) { return response.data; }); return promise; }, getMiniSearchItems: function(queryOption) { var url = "/searchApi/railShortCall?queryoptions=" + queryOption; var promise = $http.get(configuration.server_url + url).then(function(response, headers) { return response.data; }); return promise; } ///searchApi/railShortCall? }; return SingleAssetService; }]);
import React from 'react'; import Link from 'next/link'; import Layout from '../../../components/layout'; import Highlight from 'react-highlight'; import markdown from 'markdown-in-js'; export default ({ url }) => ( <Layout url={url} title={'Idyll Documentation | Creating a custom component'}> <link rel="stylesheet" href="../../../static/styles/tomorrow-night-eighties.css" /> <div> <h1>Custom Components</h1> <h2>Overview</h2> <p> Under the hood an Idyll component is anything that will function as a React component. If you create a custom component in JavaScript, point Idyll to the folder where you created it and it will be available in your markup. </p> <p> <i> Note: Idyll currently uses React version 17. We will do our best to support the latest stable versions of React as they are released. </i> </p> <p>For example, this custom component</p> <Highlight className="javascript"> {`// custom.js const React = require('react'); class Custom extends React.PureComponent { render() { const { idyll, hasError, updateProps, ...props } = this.props; return ( <div {...props}> This is a custom component </div> ); } } module.exports = Custom;`} </Highlight> <p>would be invoked inside of an Idyll file with the following code:</p> <pre> <code>{`[Custom /]`}</code> </pre> <p> Notice that the custom component inherits from{' '} <code>React.PureComponent</code> rather than <code>React.Component</code> so that rendering is updated only when properties or state change. This speeds up compilation in watch mode. </p> <h2>Updating the Document</h2> <p> Idyll provides a way for your components to push state changes back up to the document. This is how a component is able to affect change through the document. An <code>updateProps</code> method is injected onto the <code>props</code> object that your custom component receives. This function can be called to update variable values and propagate those changes to the rest of the Idyll document. </p> <h3>Example</h3> <p> For example, a component can change the value of a property that it receives, and Idyll will propagate the change to any bound variables on the page. </p> <Highlight className="javascript"> {`const React = require('react'); class Incrementer extends React.PureComponent { increment() { this.props.updateProps({ value: this.props.value + 1 }) } render() { return ( <div onClick={this.increment.bind(this)}> Click me. </div> ); } } module.exports = Incrementer;`} </Highlight> <p> The <code>Incrementer</code> component could then be used as follows: </p> <pre> <code>{`[var name:"clickCount" value:0 /] [Incrementer value:clickCount /] [Display value:clickCount /]`}</code> </pre> <p> Notice that even though the <code>Incrementer</code> component doesn't know anything about the variable <code>clickCount</code>, it will still correctly update. </p> <h2>Name resolution</h2> <p> Components lookup is based on filenames. If your component name is{' '} <code>MyComponent</code>, it will match files like <code>mycomponent.js</code> or <code>my-component.js</code>. The component filenames are case insensitive. </p> <p> Custom component are meant for times when more complex and custom code is needed. By default Idyll will look for your custom components inside of a folder called <code>components/</code>. If you wish to change the custom component path, specify it with the <code>--components</code>{' '} option, e.g. </p> <p> <code> idyll index.idl --css styles.css --components custom/component/path/ </code> </p> <h2>Manipulating component children</h2> <p> If your component needs to modify the render tree of its children, <br /> <a href="https://github.com/idyll-lang/idyll-component-children"> https://github.com/idyll-lang/idyll-component-children{' '} </a> is a helper library to filter and map the component's children. </p> <p> Continue to learn how to use{' '} <Link href="/docs/components/scrolling-and-refs"> <a>references</a> </Link>{' '} to make your page more dynamic. </p> </div> </Layout> );
/* * View model for OctoPrint-Slicer * * Author: Kenneth Jiang * License: AGPLv3 */ 'use strict'; import * as THREE from 'three'; import * as THREETK from '3tk'; import { STLViewPort } from './STLViewPort'; import { OverridesViewModel } from './profile_overrides'; import { ModelArranger } from './ModelArranger'; import { CheckerboardMaterial } from './CheckerboardMaterial'; import { find, forEach, endsWith, some, extend, isNaN } from 'lodash-es'; function isDev() { return window.location.hostname == "localhost"; } function SlicerViewModel(parameters) { mixpanel.track("App Loaded"); var self = this; self.canvas = document.getElementById( 'slicer-canvas' ); //check if webGL is present. If not disable Slicer plugin if ( ! THREETK.Detector.webgl ) { $('#tab_plugin_slicer').empty().append("<h3>Slicer Plugin is disabled because your browser doesn't support WebGL</h3>"); return; } // assign the injected parameters, e.g.: self.slicingViewModel = parameters[0]; self.overridesViewModel = parameters[1]; self.printerStateViewModel = parameters[2]; self.printerProfilesViewModel = parameters[3]; self.lockScale = true; // Override slicingViewModel.show to surpress default slicing behavior self.slicingViewModel.show = function(target, file, force) { if (!self.slicingViewModel.enableSlicingDialog() && !force) { return; } mixpanel.track("Load STL"); $('a[href="#tab_plugin_slicer"]').tab('show'); self.setSlicingViewModelIfNeeded(target, file); self.addSTL(target, file); }; self.resetToDefault = function() { self.resetSlicingViewModel(); // hide all value inputs $("#slicer-viewport .values div").removeClass("show"); updateTransformMode(); } self.addSTL = function(target, file) { $('#tab_plugin_slicer > div.translucent-blocker').show(); self.stlViewPort.loadSTL(BASEURL + "downloads/files/" + target + "/" + file); } self.onModelAdd = function(event) { var models = event.models; forEach( models, function( model ) { self.fixZPosition(model); }); if (self.stlViewPort.models().length > 1) { new ModelArranger().arrange(self.stlViewPort.models()); } updateValueInputs(); updateControlState(); }; self.onModelDelete = function() { if (self.stlViewPort.models().length == 0) { self.resetToDefault(); } updateValueInputs(); updateControlState(); new ModelArranger().arrange(self.stlViewPort.models()); }; ko.computed(function() { var profileName = self.slicingViewModel.printerProfile(); if (profileName) { var profile = find(self.printerProfilesViewModel.profiles.items(), function(p) { return p.id == profileName }); var dim = profile.volume; self.BEDSIZE_X_MM = Math.max(dim.width, 0.1); // Safari will error if rectShape has dimensions being 0 self.BEDSIZE_Y_MM = Math.max(dim.depth, 0.1); self.BEDSIZE_Z_MM = Math.max(dim.height, 0.1); self.BED_FORM_FACTOR = dim.formFactor; if (dim.origin == "lowerleft" ) { self.ORIGIN_OFFSET_X_MM = self.BEDSIZE_X_MM/2.0; self.ORIGIN_OFFSET_Y_MM = self.BEDSIZE_Y_MM/2.0; } else { self.ORIGIN_OFFSET_X_MM = 0; self.ORIGIN_OFFSET_Y_MM = 0; } self.drawBedFloor(self.BEDSIZE_X_MM, self.BEDSIZE_Y_MM, self.BED_FORM_FACTOR); self.drawWalls(self.BEDSIZE_X_MM, self.BEDSIZE_Y_MM, self.BEDSIZE_Z_MM, self.BED_FORM_FACTOR); } }); self.slicing = ko.observable(false); self.BEDSIZE_X_MM = 200; self.BEDSIZE_Y_MM = 200; self.BEDSIZE_Z_MM = 200; self.BED_FORM_FACTOR = "rectangular"; self.ORIGIN_OFFSET_X_MM = 0; self.ORIGIN_OFFSET_Y_MM = 0; var CANVAS_WIDTH = 588, CANVAS_HEIGHT = 588; self.init = function() { OctoPrint.socket.onMessage("event", self.removeTempFilesAfterSlicing); $('#tab_plugin_slicer > div.translucent-blocker').hide(); self.slicingViewModel.requestData(); self.stlViewPort = new STLViewPort(self.canvas, CANVAS_WIDTH, CANVAS_HEIGHT); self.stlViewPort.addEventListener( "change", self.onModelChange ); self.stlViewPort.addEventListener( "add", self.onModelAdd ); self.stlViewPort.addEventListener( "delete", self.onModelDelete ); self.stlViewPort.init(); //Walls and Floor self.walls = new THREE.Object3D(); self.floor = new THREE.Object3D(); self.origin= new THREE.Object3D(); self.stlViewPort.scene.add(self.walls); self.stlViewPort.scene.add(self.floor); self.stlViewPort.scene.add(self.origin); ko.applyBindings(self.slicingViewModel, $('#slicing-settings')[0]); // Buttons on the canvas, and their behaviors. // TODO: it's not DRY. mix of prez code and logics. need to figure out a better way $("#slicer-viewport").empty().append('\ <div class="model">\ <button class="rotate disabled btn" title="Rotate"><img src="' + PLUGIN_BASEURL + 'slicer/static/img/rotate.png"></button>\ <button class="scale disabled btn" title="Scale"><img src="' + PLUGIN_BASEURL + 'slicer/static/img/scale.png"></button>\ <button class="remove disabled btn" title="Remove"><img src="' + PLUGIN_BASEURL + 'slicer/static/img/remove.png"></button>\ <button class="removeall disabled btn" title="Remove all"><img src="' + PLUGIN_BASEURL + 'slicer/static/img/removeall.png"></button>\ <button class="more disabled btn" title="More..."><img src="' + PLUGIN_BASEURL + 'slicer/static/img/more.png"></button>\ </div>\ <div class="values rotate">\ <div>\ <a class="close"><i class="icon-remove-sign"></i></a>\ <p><span class="axis x">X</span><input type="number" step="any" name="x"><span title="">°</span></p>\ <p><span class="axis y">Y</span><input type="number" step="any" name="y"><span title="">°</span></p>\ <p><span class="axis z">Z</span><input type="number" step="any" name="z"><span title="">°</span></p>\ <p><button id="lay-flat" class="btn"><i class="icon-glass"></i><span>&nbsp;Lay flat</span></button></p>\ <p><button id="rotate0" class="btn"><i class="icon-fast-backward"></i><span>&nbsp;Reset</span></button></p>\ <span></span>\ </div>\ </div>\ <div class="values scale">\ <div>\ <a class="close"><i class="icon-remove-sign"></i></a>\ <p><span class="axis x">X</span><input type="number" step="0.001" name="x" min="0.001"><span class="size x" ></span></p>\ <p><span class="axis y">Y</span><input type="number" step="0.001" name="y" min="0.001"><span class="size y" ></span></p>\ <p><span class="axis z">Z</span><input type="number" step="0.001" name="z" min="0.001"><span class="size z" ></span></p>\ <p class="checkbox"><label><input id="lock-scale" type="checkbox" checked>Lock</label></p>\ <p class="checkbox"><label><input id="mirror-x" type="checkbox">Mirror X</label><label><input id="mirror-y" type="checkbox">Mirror Y</label></p>\ <span></span>\ </div>\ </div>\ <div class="values more">\ <div>\ <a class="close"><i class="icon-remove-sign"></i></a>\ <p><button id="split" class="btn"><i class="icon-unlink"></i><span>&nbsp;Split into parts</span></button></p>\ <p><button id="duplicate" class="btn"><i class="icon-copy"></i><span>&nbsp;Duplicate</span></button></p>\ <p><button id="cut" class="btn"><i class="icon-crop"></i><span>&nbsp;Cut at height</span></button></p>\ <p><button id="info" class="btn"><i class="icon-info"></i><span>&nbsp;Advanced usage</span></button></p>\ <span></span>\ </div>\ </div>'); $("#slicer-viewport").append(self.stlViewPort.renderer.domElement); if ( isDev() ) { self.stlViewPort.stats = new Stats(); self.stlViewPort.stats.showPanel( 1 ); $("#slicer-viewport").append(self.stlViewPort.stats.dom); } $("#slicer-viewport button.rotate").click(function(event) { toggleValueInputs($("#slicer-viewport .rotate.values div")); }); $("#slicer-viewport button.scale").click(function(event) { toggleValueInputs($("#slicer-viewport .scale.values div")); }); $("#slicer-viewport button.remove").click(function(event) { self.stlViewPort.removeSelectedModel(); }); $("#slicer-viewport button.more").click(function(event) { toggleValueInputs($("#slicer-viewport .more.values div")); }); $("#slicer-viewport button.removeall").click(function(event) { self.stlViewPort.removeAllModels(); self.resetToDefault(); }); $("#slicer-viewport button#split").click(function(event) { toggleValueInputs($("#slicer-viewport .more.values div")); startLongRunning( self.stlViewPort.splitSelectedModel ); }); $("#slicer-viewport button#cut").click(function(event) { toggleValueInputs($("#slicer-viewport .more.values div")); var height = parseFloat( prompt("Cut selected object(s) at height (mm):", 1.00) ); if (!isNaN(height)) { startLongRunning( self.stlViewPort.cutSelectedModel.bind(self.stlViewPort, height) ); } }); $("#slicer-viewport button#duplicate").click(function(event) { toggleValueInputs($("#slicer-viewport .more.values div")); var copies = parseInt( prompt("The number of copies you want to duplicate:", 1) ); if (!isNaN(copies)) { startLongRunning( self.stlViewPort.duplicateSelectedModel.bind(self, copies) ); } }); $("#slicer-viewport button#info").click(function(event) { toggleValueInputs($("#slicer-viewport .more.values div")); $("#plugin-slicer-advanced-usage-info").modal("show"); }); $("#slicer-viewport button#lay-flat").click(function(event) { startLongRunning( function() {self.stlViewPort.laySelectedModelFlat(); } ); }); $("#slicer-viewport button#rotate0").click(function(event) { $("#slicer-viewport .rotate.values input").val(0); applyValueInputs($("#slicer-viewport .rotate.values input")); }); $("#slicer-viewport .values input").on('input', function() { applyValueInputs($(this)); }); $("#slicer-viewport .values input#lock-scale").change( function(event) { self.lockScale = event.target.checked; }); $("#slicer-viewport .values input[id^=mirror]").change( function(event) { applyMirrorScale(event.target); }); $("#slicer-viewport .values a.close").click(function() { $("#slicer-viewport .values div").removeClass("show"); updateTransformMode(); }); }; self.fixZPosition = function ( model ) { var bedLowMinZ = 0.0; var boundaryBox = model.userData.box3FromObject(); boundaryBox.min.sub(model.position); boundaryBox.max.sub(model.position); model.position.z -= model.position.z + boundaryBox.min.z - bedLowMinZ; } // callback function when models are changed by TransformControls self.onModelChange = function() { var model = self.stlViewPort.selectedModel(); if (model) self.fixZPosition(model); updateValueInputs(); updateControlState(); }; // Slicing // self.tempFiles = {}; self.removeTempFilesAfterSlicing = function (event) { if ($.inArray(event.data.type, ["SlicingDone", "SlicingFailed"]) >= 0 && event.data.payload.stl in self.tempFiles) { OctoPrint.files.delete(event.data.payload.stl_location, event.data.payload.stl); delete self.tempFiles[event.data.payload.stl]; self.slicing(false); } } self.sliceRequestData = function(slicingVM, groupCenter) { var destinationFilename = slicingVM._sanitize(slicingVM.destinationFilename()); var destinationExtensions = slicingVM.data[slicingVM.slicer()] && slicingVM.data[slicingVM.slicer()].extensions && slicingVM.data[slicingVM.slicer()].extensions.destination ? slicingVM.data[slicingVM.slicer()].extensions.destination : ["???"]; if (!some(destinationExtensions, function(extension) { return endsWith(destinationFilename.toLowerCase(), "." + extension.toLowerCase()); })) { destinationFilename = destinationFilename + "." + destinationExtensions[0]; } if (!groupCenter) { groupCenter = new THREE.Vector3(0,0,0); } var data = { command: "slice", slicer: slicingVM.slicer(), profile: slicingVM.profile(), printerProfile: slicingVM.printerProfile(), destination: destinationFilename, position: { "x": self.ORIGIN_OFFSET_X_MM + groupCenter.x, "y": self.ORIGIN_OFFSET_Y_MM + groupCenter.y} }; extend(data, self.overridesViewModel.toJS()); if (slicingVM.afterSlicing() == "print") { data["print"] = true; } else if (slicingVM.afterSlicing() == "select") { data["select"] = true; } return data; }; self.sendSliceRequest = function(target, filename, data) { $.ajax({ url: API_BASEURL + "files/" + target + "/" + filename, type: "POST", dataType: "json", contentType: "application/json; charset=UTF-8", data: JSON.stringify(data), error: function(jqXHR, textStatus) { new PNotify({title: "Slicing failed", text: jqXHR.responseText, type: "error", hide: false}); self.slicing(false); } }); }; self.slice = function() { mixpanel.track("Slice Model"); self.slicing(true); var target = self.slicingViewModel.target; var sliceRequestData; var form = new FormData(); var group = new THREE.Group(); let groupBox3 = new THREE.Box3(); forEach(self.stlViewPort.models(), function (model) { group.add(model.clone(true)); groupBox3.expandByPoint(model.userData.box3FromObject().min); groupBox3.expandByPoint(model.userData.box3FromObject().max); }); sliceRequestData = self.sliceRequestData(self.slicingViewModel, groupBox3.getCenter()); var tempFilename = self.tempSTLFilename(); form.append("file", self.blobFromModel(group), tempFilename); $.ajax({ url: API_BASEURL + "files/local", type: "POST", data: form, processData: false, contentType: false, // On success success: function(_) { self.tempFiles[tempFilename] = 1; self.sendSliceRequest(target, tempFilename, sliceRequestData); }, error: function(jqXHR, textStatus) { new PNotify({title: "Slicing failed", text: jqXHR.responseText, type: "error", hide: false}); self.slicing(false); } }); }; self.blobFromModel = function( model ) { var exporter = new THREETK.STLBinaryExporter(); return new Blob([exporter.parse(model)], {type: "text/plain"}); }; // END: Slicing // Helpers for drawing walls and floor // self.createText = function(font, text, width, depth, parentObj) { var textGeometry = new THREE.TextGeometry( text, { font: font, size: 10, height: 0.1, material: 0, extrudeMaterial: 1 }); var materialFront = new THREE.MeshBasicMaterial( { color: 0x048e06} ); var materialSide = new THREE.MeshBasicMaterial( { color: 0x8A8A8A} ); var materialArray = [ materialFront, materialSide ]; var textMaterial = materialArray; var mesh = new THREE.Mesh( textGeometry, textMaterial ); textGeometry.computeBoundingBox(); var textWidth = textGeometry.boundingBox.max.x - textGeometry.boundingBox.min.x; var textHeight = textGeometry.boundingBox.max.y - textGeometry.boundingBox.min.y; switch (text) { case "Front": mesh.position.set(-textWidth/2, -depth/2 - textHeight - 4, 1.0); break; case "Back": mesh.position.set(textWidth/2, depth/2 + textHeight + 4, 1.0); mesh.rotation.set(0, 0, Math.PI); break; case "Left": mesh.position.set(-width/2 - textHeight - 4, textWidth/2, 1.0); mesh.rotation.set(0, 0, -Math.PI / 2); break; case "Right": mesh.position.set(width/2 + textHeight, -textWidth/2, 1.0); mesh.rotation.set(0, 0, Math.PI / 2); break; } parentObj.add(mesh); }; self.drawBedFloor = function ( width, depth, formFactor) { var geometry; for(var i = self.floor.children.length - 1; i >= 0; i--) { var obj = self.floor.children[i]; self.floor.remove(obj); } if (formFactor == "circular") { geometry = new THREE.CircleGeometry(width/2, 60); } else { geometry = new THREE.PlaneBufferGeometry(width, depth); } var material = new CheckerboardMaterial(width/20, depth/20, null, function() { self.stlViewPort.render(); }); // 20mm/checker box var mesh = new THREE.Mesh(geometry, material); mesh.receiveShadow = true; self.floor.add(mesh); //Add text to indicate front/back of print bed var loader = new THREE.FontLoader(); loader.load( PLUGIN_BASEURL + "slicer/static/js/optimer_bold.typeface.json", function ( font ) { self.createText(font, "Front", width, depth, self.floor); self.createText(font, "Back", width, depth, self.floor); self.createText(font, "Left", width, depth, self.floor); self.createText(font, "Right", width, depth, self.floor); } ); self.drawOrigin(); }; self.drawOrigin = function() { for(var i = self.origin.children.length - 1; i >= 0; i--) { var obj = self.origin.children[i]; self.origin.remove(obj); } var material = new THREE.LineBasicMaterial({ color: 0x801010 }); const axisLength = 8; [[axisLength, 0, 0], [0, axisLength, 0], [0, 0, axisLength]].forEach( function(end) { const geometry = new THREE.Geometry(); geometry.vertices.push( new THREE.Vector3(0, 0, 0), new THREE.Vector3(...end) ); self.origin.add(new THREE.Line( geometry, material )); }); self.origin.position.x = -self.ORIGIN_OFFSET_X_MM; self.origin.position.y = -self.ORIGIN_OFFSET_Y_MM; }; self.drawWalls = function ( width, depth, height, formFactor ) { for(var i = self.walls.children.length - 1; i >= 0; i--) { var obj = self.walls.children[i]; self.walls.remove(obj); } //This material will only make the inside of the cylinder walls visible while allowing the outside to be transparent. var wallMaterial = new THREE.MeshBasicMaterial({ color: 0x8888fc, side: THREE.BackSide, transparent: true, opacity: 0.8 }); var invisibleMaterial = new THREE.MeshBasicMaterial({ visible: false, transparent: false }); if (formFactor == "circular") { var cylGeometry = new THREE.CylinderGeometry(width/2, width/2, height, 60, 1, true); // Move the walls up to the floor cylGeometry.applyMatrix(new THREE.Matrix4().makeTranslation(0, height / 2, 0)); var wall = new THREE.Mesh(cylGeometry, wallMaterial); //rotate the walls so they are upright wall.rotation.x = Math.PI / 2; self.walls.add(wall); } else { var cubeGeometry = new THREE.BoxBufferGeometry( width, depth, height ); var materials = [ wallMaterial, wallMaterial, wallMaterial, wallMaterial, invisibleMaterial, invisibleMaterial, ]; var cubeSidesMaterial = materials; var wall = new THREE.Mesh( cubeGeometry, cubeSidesMaterial ); wall.position.z = height/2; self.walls.add(wall); } }; // END: Helpers for drawing walls and floor self.resetSlicingViewModel = function() { self.slicingViewModel.target = undefined; self.slicingViewModel.file(undefined); self.slicingViewModel.destinationFilename(undefined); }; self.setSlicingViewModelIfNeeded = function(target, filename) { if (!self.slicingViewModel.destinationFilename()) { // A model is added to an empty bed self.slicingViewModel.target = target; self.slicingViewModel.file(filename); self.slicingViewModel.destinationFilename(self.computeDestinationFilename(filename)); } }; // Returns the destination filename based on which models are loaded. // The destination filename is without the final .gco on it because // that will depend on the slicer. self.computeDestinationFilename = function(inputFilename) { // TODO: For now, just use the first model's name. var destinationFilename = inputFilename.substr(0, inputFilename.lastIndexOf(".")); if (destinationFilename.lastIndexOf("/") != 0) { destinationFilename = destinationFilename.substr(destinationFilename.lastIndexOf("/") + 1); } return destinationFilename; }; self.tempSTLFilename = function() { var pos = self.slicingViewModel.file().lastIndexOf(".") return [self.slicingViewModel.file().slice(0, pos), ".tmp." + (+ new Date()), self.slicingViewModel.file().slice(pos)].join(''); }; // Pause WebGL rendering when slicer tab is inactive self.onTabChange = function (next, current) { if (current === "#tab_plugin_slicer") { self.stlViewPort.pauseRendering(); } } self.onAfterTabChange = function (current, previous) { if (current === "#tab_plugin_slicer") { self.stlViewPort.unpauseRendering(); } } self.init(); ////////////////////// // internal functions /////////////////////// function startLongRunning( func ) { $('#tab_plugin_slicer > div.translucent-blocker').show(); setTimeout( function() { func(); $('#tab_plugin_slicer > div.translucent-blocker').hide(); }, 25); } function updateTransformMode() { if ( $("#slicer-viewport .rotate.values div").hasClass("show") ) { self.stlViewPort.transformControls.setMode("rotate"); self.stlViewPort.transformControls.space = "world"; } else if ( $("#slicer-viewport .scale.values div").hasClass("show") ) { self.stlViewPort.transformControls.setMode("scale"); self.stlViewPort.transformControls.space = "local"; self.stlViewPort.transformControls.axis = null; } else { self.stlViewPort.transformControls.setMode("translate"); self.stlViewPort.transformControls.space = "world"; self.stlViewPort.transformControls.axis = "XY"; } } // Value inputs function updateSizeInfo() { var model = self.stlViewPort.selectedModel(); if (model) { var size = model.userData.box3FromObject().getSize(); $("#slicer-viewport > div.values.scale > div > p > span.size.x").text(size.x.toFixed(1) + "mm"); $("#slicer-viewport > div.values.scale > div > p > span.size.y").text(size.y.toFixed(1) + "mm"); $("#slicer-viewport > div.values.scale > div > p > span.size.z").text(size.z.toFixed(1) + "mm"); } } function updateMirrorCheckboxes() { var model = self.stlViewPort.selectedModel(); $("#slicer-viewport .scale.values input#mirror-x").prop('checked', model.scale.x < 0); $("#slicer-viewport .scale.values input#mirror-y").prop('checked',model.scale.y < 0); } function updateValueInputs() { var model = self.stlViewPort.selectedModel(); if (model) { $("#slicer-viewport .rotate.values input[name=\"x\"]").val((model.rotation.x * 180 / Math.PI).toFixed(1)).attr("min", ''); $("#slicer-viewport .rotate.values input[name=\"y\"]").val((model.rotation.y * 180 / Math.PI).toFixed(1)).attr("min", ''); $("#slicer-viewport .rotate.values input[name=\"z\"]").val((model.rotation.z * 180 / Math.PI).toFixed(1)).attr("min", ''); $("#slicer-viewport .scale.values input[name=\"x\"]").val(model.scale.x.toFixed(3)).attr("min", ''); $("#slicer-viewport .scale.values input[name=\"y\"]").val(model.scale.y.toFixed(3)).attr("min", ''); $("#slicer-viewport .scale.values input[name=\"z\"]").val(model.scale.z.toFixed(3)).attr("min", ''); $("#slicer-viewport .scale.values input#lock-scale").prop('checked', self.lockScale); updateSizeInfo(); updateMirrorCheckboxes(); } } function updateControlState() { $('#tab_plugin_slicer > div.translucent-blocker').hide(); if (!self.stlViewPort.selectedModel()) { $("#slicer-viewport button").addClass("disabled"); $("#slicer-viewport .values div").removeClass("show"); updateTransformMode(); } else { $("#slicer-viewport button").removeClass("disabled"); } } function toggleValueInputs(parentDiv) { if ( parentDiv.hasClass("show") ) { $("#slicer-viewport .values div").removeClass("show"); } else if (self.stlViewPort.selectedModel()) { $("#slicer-viewport .values div").removeClass("show"); parentDiv.addClass("show").children('p').addClass("show"); } updateTransformMode(); } function applyValueInputs(input) { if(input[0].type == "number" && !isNaN(parseFloat(input.val()))) { var model = self.stlViewPort.selectedModel(); if (model === undefined) return; if (input.closest(".values").hasClass("scale") && self.lockScale) { // Updating self in event handler will cost a lot of weirdness in user experience // Therefore this very convoluted way to do "update all other scale fields except myself". $("#slicer-viewport .scale.values input").each( function(i, ele) { if (ele.type == "number" && ele !== input[0]) { $(ele).val(input.val()); } }); } model.rotation.x = THREE.Math.degToRad($("#slicer-viewport .rotate.values input[name=\"x\"]").val()); model.rotation.y = THREE.Math.degToRad($("#slicer-viewport .rotate.values input[name=\"y\"]").val()); model.rotation.z = THREE.Math.degToRad($("#slicer-viewport .rotate.values input[name=\"z\"]").val()); model.scale.x = parseFloat($("#slicer-viewport .scale.values input[name=\"x\"]").val()) model.scale.y = parseFloat($("#slicer-viewport .scale.values input[name=\"y\"]").val()) model.scale.z = parseFloat($("#slicer-viewport .scale.values input[name=\"z\"]").val()) self.fixZPosition(model); updateSizeInfo(); updateMirrorCheckboxes(); self.stlViewPort.recalculateOverhang(model); } } function applyMirrorScale(mirrorCheckbox) { var model = self.stlViewPort.selectedModel(); if (mirrorCheckbox.id == "mirror-x") { model.scale.x = -1 * model.scale.x; } if (mirrorCheckbox.id == "mirror-y") { model.scale.y = -1 * model.scale.y; } if (mirrorCheckbox.checked) { self.lockScale = false; } updateValueInputs(); } } // view model class, parameters for constructor, container to bind to OCTOPRINT_VIEWMODELS.push([ SlicerViewModel, // e.g. loginStateViewModel, settingsViewModel, ... [ "slicingViewModel", "overridesViewModel", "printerStateViewModel", "printerProfilesViewModel" ], // e.g. #settings_plugin_slicer, #tab_plugin_slicer, ... [ "#slicer" ] ]);
goog.provide('embedly.exports') goog.require('embedly.Api') goog.exportSymbol('embedly.Api', embedly.Api) goog.exportProperty(embedly.Api.prototype, 'call', embedly.Api.prototype.call) goog.exportProperty(embedly.Api.prototype, 'services', embedly.Api.prototype.services) goog.exportProperty(embedly.Api.prototype, 'services_regex', embedly.Api.prototype.services_regex) if (typeof(embedlyOnLoad) == 'function') { embedlyOnLoad() }
/** * Created by LENOVO on 19/01/2016. */
import processors from './lib/decl'; function pluginCreator() { return { postcssPlugin: 'postcss-merge-longhand', OnceExit(css) { css.walkRules((rule) => { processors.forEach((p) => { p.explode(rule); p.merge(rule); }); }); }, }; } pluginCreator.postcss = true; export default pluginCreator;
function parseConfig(config) { "use strict"; config.host = process.env.zander_host || config.host || "127.0.0.1"; config.port = process.env.zander_port || config.port || 1337; if (!config.goduser) { config.goduser = { }; } config.goduser.name = process.env.zander_god_username || config.goduser.name; config.goduser.password = process.env.zander_god_password || config.goduser.password; if (config.goduser.name && config.goduser.name.length <= 20) { console.log("[WARNING] Super user with name of 20 characters or less"); } config.hashAlgorithm = config.hashAlgorithm || "sha256"; config.throttle = config.throttle || { "burst" : 100, "rate" : 50, "ip" : true }; return config; } var config = parseConfig(require(__dirname + "/config.json")); var zander = require(__dirname + "/lib/server.js"); zander.bootstrapDatabase(config, function (err, database) { "use strict"; if (err) { throw err; } zander.startServer(config, database); console.log("Zander server running: " + config.host + ":" + config.port); });
const encodeMap = [ {regex: /&/g, value: '&amp;'}, {regex: /</g, value: '&lt;'}, {regex: />/g, value: '&gt;'} ] exports.encode = (message) => { return encodeMap.reduce((x, map) => { return x.replace(map.regex, map.value) }, message) } const decodeMap = [ {regex: /&amp;/g, value: '&'}, {regex: /&lt;/g, value: '<'}, {regex: /&gt;/g, value: '>'} ] exports.decode = (message) => { return decodeMap.reduce((x, map) => { return x.replace(map.regex, map.value) }, message) }
/* Original work Copyright (c) 2010-2016 Google, Inc. http://angularjs.org Modified work Copyright (c) 2016 Mouaffak A. Sarhan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 'use strict'; (function(){ var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } var locale = { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], "ERANAMES": [ "Anno Hegirae" ], "ERAS": [ "AH" ], "FIRSTDAYOFWEEK": 6, "MONTH": [ "Muharram", "Safar", "Rabiʻ I", "Rabiʻ II", "Jumada I", "Jumada II", "Rajab", "Shaʻban", "Ramadan", "Shawwal", "Dhuʻl-Qiʻdah", "Dhuʻl-Hijjah" ], "SHORTDAY": [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], "SHORTMONTH": [ "Muh", "Saf", "Rab I", "Rab II", "Jum I", "Jum II", "Raj", "Sha", "Ram", "Shaw", "Dhuʻl-Q", "Dhuʻl-H" ], "STANDALONEMONTH": [ "Muharram", "Safar", "Rabiʻ I", "Rabiʻ II", "Jumada I", "Jumada II", "Rajab", "Shaʻban", "Ramadan", "Shawwal", "Dhuʻl-Qiʻdah", "Dhuʻl-Hijjah" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, MMMM d, y", "longDate": "MMMM d, y", "medium": "MMM d, y h:mm:ss a", "mediumDate": "MMM d, y", "mediumTime": "h:mm:ss a", "short": "M/d/yy h:mm a", "shortDate": "M/d/yy", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "$", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-\u00a4", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "en", "localeID": "en", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }; LocaleProvider.register('en', locale); })();
(function(f){var k=function(){var c=function(){};c.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(a,b,e,d){if(!d)this.context=b,this.buffer=[];if(!this.includes("",a))if(d)return a;else{this.send(a);return}a=this.render_pragmas(a);a=this.render_section(a,b,e);if(d)return this.render_tags(a,b,e,d);this.render_tags(a,b,e,d)},send:function(a){a!=""&&this.buffer.push(a)},render_pragmas:function(a){if(!this.includes("%",a))return a; var b=this;return a.replace(RegExp(this.otag+"%([\\w-]+) ?([\\w]+=[\\w]+)?"+this.ctag),function(a,d,h){if(!b.pragmas_implemented[d])throw{message:"This implementation of mustache doesn't understand the '"+d+"' pragma"};b.pragmas[d]={};h&&(a=h.split("="),b.pragmas[d][a[0]]=a[1]);return""})},render_partial:function(a,b,e){a=this.trim(a);if(!e||e[a]===void 0)throw{message:"unknown_partial '"+a+"'"};if(typeof b[a]!="object")return this.render(e[a],b,e,!0);return this.render(e[a],b[a],e,!0)},render_section:function(a, b,e){if(!this.includes("#",a)&&!this.includes("^",a))return a;var d=this;return a.replace(RegExp(this.otag+"(\\^|\\#)\\s*(.+)\\s*"+this.ctag+"\n*([\\s\\S]+?)"+this.otag+"\\/\\s*\\2\\s*"+this.ctag+"\\s*","mg"),function(a,c,f,g){a=d.find(f,b);if(c=="^")return!a||d.is_array(a)&&a.length===0?d.render(g,b,e,!0):"";else if(c=="#")return d.is_array(a)?d.map(a,function(a){return d.render(g,d.create_context(a),e,!0)}).join(""):d.is_object(a)?d.render(g,d.create_context(a),e,!0):typeof a==="function"?a.call(b, g,function(a){return d.render(a,b,e,!0)}):a?d.render(g,b,e,!0):""})},render_tags:function(a,b,e,d){for(var c=this,f=function(){return RegExp(c.otag+"(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?"+c.ctag+"+","g")},j=f(),g=function(a,d,g){switch(d){case "!":return"";case "=":return c.set_delimiters(g),j=f(),"";case ">":return c.render_partial(g,b,e);case "{":return c.find(g,b);default:return c.escape(c.find(g,b))}},a=a.split("\n"),i=0;i<a.length;i++)a[i]=a[i].replace(j,g,this),d||this.send(a[i]);if(d)return a.join("\n")}, set_delimiters:function(a){a=a.split(" ");this.otag=this.escape_regex(a[0]);this.ctag=this.escape_regex(a[1])},escape_regex:function(a){if(!arguments.callee.sRE)arguments.callee.sRE=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\)","g");return a.replace(arguments.callee.sRE,"\\$1")},find:function(a,b){var a=this.trim(a),e;b[a]===!1||b[a]===0||b[a]?e=b[a]:(this.context[a]===!1||this.context[a]===0||this.context[a])&&(e=this.context[a]);if(typeof e==="function")return e.apply(b);if(e!== void 0)return e;return""},includes:function(a,b){return b.indexOf(this.otag+a)!=-1},escape:function(a){return String(a===null?"":a).replace(/&(?!\w+;)|["<>\\]/g,function(a){switch(a){case "&":return"&amp;";case "\\":return"\\\\";case '"':return'"';case "<":return"&lt;";case ">":return"&gt;";default:return a}})},create_context:function(a){if(this.is_object(a))return a;else{var b=".";if(this.pragmas["IMPLICIT-ITERATOR"])b=this.pragmas["IMPLICIT-ITERATOR"].iterator;var e={};e[b]=a;return e}},is_object:function(a){return a&& typeof a=="object"},is_array:function(a){return Object.prototype.toString.call(a)==="[object Array]"},trim:function(a){return a.replace(/^\s*|\s*$/g,"")},map:function(a,b){if(typeof a.map=="function")return a.map(b);else{for(var e=[],d=a.length,c=0;c<d;c++)e.push(b(a[c]));return e}}};return{name:"mustache.js",version:"0.3.0",to_html:function(a,b,e,d){var f=new c;if(d)f.send=d;f.render(a,b,e);if(!d)return f.buffer.join("\n")}}}();window.ich=new function(){var c=this;c.VERSION="0.9";c.templates={}; c.partials={};c.addTemplate=function(a,b){if(c[a])throw"Invalid name: "+a+".";if(c.templates[a])throw'Template " + name + " exists';c.templates[a]=b;c[a]=function(b,d){var b=b||{},h=k.to_html(c.templates[a],b,c.partials);return d?h:f(h)}};c.addPartial=function(a,b){if(c.partials[a])throw'Partial " + name + " exists';else c.partials[a]=b};c.grabTemplates=function(){f('script[type="text/html"]').add("div.template").each(function(a,b){var e=f(typeof a==="number"?b:a),d="".trim?e.html().trim():f.trim(e.html()), d=d.replace(/&gt;/,">"),d=c._firefoxUrlCleanup(d);c[e.hasClass("partial")?"addPartial":"addTemplate"](e.attr("id"),d);e.remove()})};c.clearAll=function(){for(var a in c.templates)delete c[a];c.templates={};c.partials={}};c.refresh=function(){c.clearAll();c.grabTemplates()};c._firefoxUrlCleanup=function(a){return a.replace(/%7B%7B/g,"{{").replace(/%7D%7D/g,"}}")}};f(function(){ich.grabTemplates()})})(window.jQuery||window.Zepto);
'use strict'; /* * Module dependencies. */ const test = require('tape'); const request = require('supertest'); const { app } = require('../server'); test('Home page', t => { request(app) .get('/') .expect(200) .end(t.end); }); test.onFinish(() => process.exit(0));
import r from 'restructure'; import Chunk from './chunk'; export default Chunk({ version: r.uint32le });
'use strict' var Router = require('./lib/mqtt-router.js') exports.wrap = function (mqttclient) { return new Router(mqttclient) }
/*eslint global-require:0, no-unused-vars:0*/ 'use strict'; const bodyParser = require('body-parser'); const express = require('express'); const knex = require('knex'); const path = require('path'); const packageInfo = require('../../package.json'); module.exports = (config) => { //Connecting to database and registering models const models = require('./models/').register(knex({ client: 'mysql', connection: config.db })); const app = express(); // Enable HTML5 features app.enable('jsonp callback'); // Parse req body and URL app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); // views and view engine setup app.set('views', path.join(__dirname, './views')); app.set('view engine', 'ejs'); // static assets app.use(express.static(path.join(__dirname, '../../build'))); // register routes require('./routes/index')(app, models, config); // Add a default statusCode to the error app.use((err, req, res, next) => { err.statusCode = err.statusCode || 500; return next(err); }); app.listen = app.listen.bind(app, config.port, config.host); return app; };
steal('funcunit').then(function(){ module("mxui/block test",{ setup: function(){ S.open("//mxui/layout/block/block.html"); S("#blocker").exists(); } }) test("Block Test", function(){ S("#blocker").exists(function(){ ok(/0/.test(S("#blocker").width()), "Initial blocker width is correct.") ok(/0/.test( S("#blocker").height() ), "Initial blocker height is correct.") }); S("#block").click() var winWidth, winHeight; S("#blocker").offset( function(offset) { return (offset.left == 0 && offset.top == 0) } , function(){ equals(S("#blocker").width(), S(S.window).width(),"width is correct") equals(S("#blocker").height(), S(S.window).height(),"height is correct") equals(S("#blocker").css( "zIndex"), 9999, "zIndex is high") }); }); });
(function ($) { var _userService = abp.services.app.user, l = abp.localization.getSource('AbpProjectName'), _$modal = $('#UserEditModal'), _$form = _$modal.find('form'); function save() { if (!_$form.valid()) { return; } var user = _$form.serializeFormToObject(); user.roleNames = []; var _$roleCheckboxes = _$form[0].querySelectorAll("input[name='role']:checked"); if (_$roleCheckboxes) { for (var roleIndex = 0; roleIndex < _$roleCheckboxes.length; roleIndex++) { var _$roleCheckbox = $(_$roleCheckboxes[roleIndex]); user.roleNames.push(_$roleCheckbox.val()); } } abp.ui.setBusy(_$form); _userService.update(user).done(function () { _$modal.modal('hide'); abp.notify.info(l('SavedSuccessfully')); abp.event.trigger('user.edited', user); }).always(function () { abp.ui.clearBusy(_$form); }); } _$form.closest('div.modal-content').find(".save-button").click(function (e) { e.preventDefault(); save(); }); _$form.find('input').on('keypress', function (e) { if (e.which === 13) { e.preventDefault(); save(); } }); _$modal.on('shown.bs.modal', function () { _$form.find('input[type=text]:first').focus(); }); })(jQuery);
angular.module('grillApp') .directive('clientTopNav', [function () { return { templateUrl: 'views/client/partials/navs/client_top_nav.html', restrict: 'AEC', link: function ($scope, $element, $attrs) { } } }]) .directive('mainOrderJumbo', [function () { return { templateUrl: 'views/client/partials/sections/main_order_card.html', restrict: 'AEC', link: function ($scope, $element, $attrs) { } } }]) .directive('myRecentOrders', [function () { return { templateUrl: 'views/client/partials/sections/my_recent_orders.html', restrict: 'AEC', link: function ($scope, $element, $attrs) { } } }]) .directive('recentOrderStream', [function () { return { templateUrl: 'views/client/partials/sections/recent_order_stream.html', restrict: 'AEC', link: function ($scope, $element, $attrs) { } } }]);
function test1() { return function test2() { var foo = 'bar'; const a = ({ b, c, ...d, e, f: 42 }); } }
var http = require('http'); var server = http.createServer(function(req, res){ res.statusCode = 200 res.end('hello world') }) server.listen(80, function(){ console.log('server listening'); })
version https://git-lfs.github.com/spec/v1 oid sha256:ea0097bf055ba9eb99fd9bb41a551c93cbc3dd3a41c071256b0f95643b7cc7fc size 189
//https://github.com/nothingrandom/project_euler.js function highprime(e){var t=Math.round(Math.sqrt(e));for(var n=t;n>=2;n--){if(e%n===0&&highprime(n)===1){return n}}return 1}console.log(highprime(600851475143))
/** * Created by SilentAngel on 20.7.2017 г.. */ (function () { Command.prototype.insert = function (input) { // • insert <index> <string> – inserts the specified string at the specified position in the list and prints the list after that. if (input.length !== 2 ) { return Command.invalidParametersMessage; } if (Number.isNaN(Number(input[0])) || Number(input[0]) < 0 || Number(input[0]) >= this.initialArray.length){ return Command.invalidIndexMessage(input[0]); } let index = Number(input[0]); let item = input[1]; this.initialArray.splice(index, 0, item); }; })();
'use strict'; angular.module('meanstackApp') .factory('User', function ($resource) { return $resource('/api/users/:id/:controller', { id: '@_id' }, { changePassword: { method: 'PUT', params: { controller:'password' } }, get: { method: 'GET', params: { id:'me' } } }); });
module.exports.sort = sortPhotosToDateDir const fs = require('fs') const path = require('path') const ExifImage = require('exif').ExifImage var filter = /\.jpg$/ function sortPhotosToDateDir (dirPath) { fs.readdir(dirPath, function (err, files) { if (err) { console.log('ERROR: ' + err) } files.map(function (file) { return path.join(dirPath, file) }).filter(function (file){ if (filter.test(file.toLowerCase())){ new ExifImage({image: file}, function(err, exifData) { if (err) { console.log('ERROR: ' + err) } else { var date = exifData['exif']['CreateDate'] var pattern = /^(\d{4}):(\d{2}):(\d{2})/ var formattedDate = (date.match(pattern)[0]).replace(/:/g, '_') fs.mkdir(file + '/../' + formattedDate , 0777, function (err) { if (err) { if (err.code != 'EEXIST'){ console.log('ERROR: ' + err) } } }) fs.createReadStream(file).pipe(fs.createWriteStream(file + '/../' + formattedDate + '//' + path.basename(file))) } }) } }) }) }
angular.module('mainApp') //Create New Entity .controller('EntityNew', ['$scope', '$http', '$state', 'myToast', function($scope, $http, $state, myToast) { $scope.page.setTitle('Create Entity'); $scope.entity = {}; $scope.typeid = null; $scope.types = [{id:0,name:'Mixed'},{id:1,name:'Customer'},{id:2,name:'Vendor'}]; $scope.countryid = null; $scope.countries = null; $scope.countryname = null; $scope.selectType = function() { if ($scope.typeid == null) { $scope.entity.type = null; } else if ($scope.entity.type == null || $scope.typeid != $scope.entity.type) { var typeObj = $scope.types .filter(function(type) { return (type.id == $scope.typeid); })[0]; $scope.entity.type = typeObj.id; } }; $scope.loadCountry = function() { if ($scope.countries == null) { $http.post('/country/ngGetCountries/') .then(function success(res) { $scope.countries = res.data; // console.log('loadUnit', $scope.countries); }) .catch(function error(res) { $scope.countries = null; myToast.simpleToast(res.data, 'warn'); }); } }; $scope.selectCountry = function() { if ($scope.countryid == null) { $scope.entity.country = null; } else if ($scope.entity.country == null || $scope.countryid != $scope.entity.country.id) { var countryObj = $scope.countries .filter(function(country) { return (country.id == $scope.countryid); })[0]; $scope.entity.country = countryObj; } }; $scope.getCountryName = function() { if ($scope.countryid != null) { // console.log('getCountryName not null', $scope.countryid); var countryObj = $scope.countries .filter(function(country) { return (country.id == $scope.countryid); })[0]; $scope.countryname = countryObj.name + ' - ' + countryObj.code; return countryObj.name; } else { // console.log('getCountryName is null', $scope.countryid); $scope.countryname = null; return 'Country'; } }; $scope.addEntity = function() { // console.log('addEntity', $scope.entity); if ($scope.newEntityForm.$valid && $scope.entity) { // console.log($scope.entity); $http.post('/entity/ngAddEntity', $scope.entity) .then(function success(res) { var entityObj = res.data; myToast.simpleToast('Entity: ' + entityObj.entityid +' Created !', 'primary'); // $state.go('entitieshow', { // id: entityObj.id // }); }) .catch(function error(res) { myToast.simpleToast(res.data, 'warn'); }); } }; $scope.clearEntity = function() { $state.reload(); }; }]) //Show & Edit Entity .controller('EntityShow', ['$scope', '$rootScope', '$http', '$state', '$stateParams', '$timeout', 'myToast', 'myFocus', function($scope, $rootScope, $http, $state, $stateParams, $timeout, myToast, myFocus) { $scope.types = [{id:0,name:'Mixed'},{id:1,name:'Customer'},{id:2,name:'Vendor'}]; $scope.showEntity = function() { $scope.page.setTitle('Show Entity'); $scope.editMode = false; $http.post('/entity/ngGetEntity/' + $stateParams.id) .then(function success(res) { $scope.entity = res.data; $scope.typeid = $scope.entity.type.id; $scope.countryid = $scope.entity.country.id; $scope.countryname = $scope.entity.country.name + ' - ' + $scope.entity.country.code; $scope.loadCountry(); }) .catch(function error(res) { $scope.entity = {}; $scope.countryname = null; myToast.simpleToast(res.data, 'warn'); }); }; //Get Entity Information On Page Load $scope.showEntity(); $scope.editEntity = function() { $scope.page.setTitle('Edit Entity'); $scope.editMode = true; myFocus.focusOn('entityid'); $scope.entity.address += ' '; $timeout(function() { $scope.entity.address = $scope.entity.address.substr(0, $scope.entity.address.length-1); }, 100); }; $scope.loadCountry = function() { $http.post('/country/ngGetCountries/') .then(function success(res) { $scope.countries = res.data; // console.log('loadUnit', $scope.countries); }) .catch(function error(res) { $scope.countries = null; myToast.simpleToast(res.data, 'warn'); }); }; $scope.selectCountry = function() { if ($scope.countryid == null) { $scope.entity.country = null; } else if ($scope.entity.country == null || $scope.countryid != $scope.entity.country.id) { var countryObj = $scope.countries .filter(function(country) { return (country.id == $scope.countryid); })[0]; $scope.entity.country = countryObj; } }; $scope.getCountryName = function() { if ($scope.countryid != null) { // console.log('getCountryName not null', $scope.countryid); var countryObj = $scope.countries .filter(function(country) { return (country.id == $scope.countryid); })[0]; $scope.countryname = countryObj.name + ' - ' + countryObj.code; return countryObj.name; } else { // console.log('getCountryName is null', $scope.countryid); $scope.countryname = null; return 'Country'; } }; $scope.selectType = function() { if ($scope.typeid == null) { $scope.entity.type = null; } else if ($scope.entity.type == null || $scope.typeid != $scope.entity.type) { var typeObj = $scope.types .filter(function(type) { return (type.id == $scope.typeid); })[0]; $scope.entity.type = typeObj; } }; $scope.updateEntity = function() { var entityObj = { entityid: $scope.entity.entityid, type: $scope.entity.type.id, name: $scope.entity.name, fullname: $scope.entity.fullname, telno: $scope.entity.telno, email: $scope.entity.email, country: $scope.entity.country.id, address: $scope.entity.address }; $http.post('/entity/ngUpdateEntity/' + $scope.entity.id, entityObj) .then( function success(res) { myToast.simpleToast('Entity information updated !','primary'); $scope.showEntity(); }, function error(res) { myToast.simpleToast(res.data,'warn'); } ); }; $scope.listEntity = function() { $state.go('entitylist'); }; }]) //Entity List .controller('EntityList', ['$scope', '$http', '$state', 'myToast', function($scope, $http, $state, myToast) { // $scope.auth = auth; $scope.loading = true; $scope.page.setTitle('Entity List'); $scope.selected = []; $scope.limitOptions = [10,20,50,100]; $scope.query = { filter: {}, //{ username: { 'contains': 'a' }, email: { contains: 'a' } }, limit: 10, page: 1, order: '' }; $scope.onReOrder = function(order) { $scope.loadEntityList(); }; $scope.onPagination = function(page, limit) { $scope.loadEntityList(); }; $scope.loadEntityList = function() { var p = { filter: $scope.query.filter, limit: $scope.query.limit, page: $scope.query.page, order: $scope.query.order }; $http({ url: '/entity/ngGetEntityList', method: 'POST', params: p }) .then(function success(res) { $scope.total = res.data.total; $scope.entities = res.data.entities; }) .catch(function error(res) { myToast.simpleToast(res.data, 'warn'); }) .finally(function () { $scope.loading = false; }); }; $scope.loadEntityList(); $scope.showEntity = function(id) { if (id) { $state.go('entityshow', {id:id}); } }; $scope.newEntity = function() { $state.go('entitynew'); }; }]);
function Results () { } Results.prototype.addPersons = function(persons) { this.persons = persons; return this; }; Results.prototype.addKeywords = function(keywords) { //console.log(keywords); this.keywords = keywords; //console.log(this); return this; }; Results.prototype.getKeyWords = function(first_argument) { return this.keywords; }; Results.prototype.searchScore = function(searchString) { var results = []; //console.log(searchString); this.keywords.forEach(function function_name (element, index, array) { //console.log(element); if( searchString.search(element) > 0) { results.push(element); } }) return results; }; Results.prototype.run = function(results, callback) { //console.log(results); score = []; var that = this; results.forEach(function function_name (element, index, array) { var rank = that.searchScore(element.description.toUpperCase()); if(rank.length !== 0) { var temp = {}; temp.name = element.name; temp.date = new Date(element.date); //temp.rank = that.searchScore(element.description.toUpperCase()); //console.log(temp); temp.rank = rank score.push(temp); } }); callback(score); }; module.exports = new Results();
var Class = require( 'uberclass' ) , path = require( 'path' ) , fs = require( 'fs' ) , debug = require( 'debug' )( 'Modules' ) , config = injector.getInstance( 'config' ) , app = injector.getInstance( 'app' ) , express = injector.getInstance( 'express' ) , moduleLoader = injector.getInstance( 'moduleLoader' ); module.exports = Class.extend( { moduleFolders: [ 'exceptions', 'classes', 'models/orm', 'models/odm', 'services', 'controllers', 'tasks' ], injectableFolders: [ 'controllers', 'services' ], excludedFiles: [ 'index.js', 'module.js', 'Gruntfile.js', 'package.json' ] }, { name: null, paths: null, config: null, setup: function( name, injector ) { debug( 'setup called for module ' + name ); // Set our module name this.name = name; // Allow some code to be executed before the main setup this.hook( 'preSetup' ); // Set our config if there is any this.config = typeof config[ name ] === 'object' ? config[ name ] : {}; // Set the modules location this.modulePath = [ path.dirname( path.dirname( __dirname ) ), 'modules', this.name ].join( path.sep ); // Add the modulePath to our list of paths this.paths = [ this.modulePath ]; // Add our moduleFolders to the list of paths, and our injector paths this.Class.moduleFolders.forEach( this.proxy( 'addFolderToPath', injector ) ); this.hook( 'preResources' ); this.loadResources(); if ( typeof this.configureApp === 'function' ) { debug( 'configureApp hook called for module ' + this.name ); app.configure( this.proxy( 'configureApp', app, express ) ); } this.hook( 'preInit' ); }, hook: function( hookName ) { if ( typeof this[ hookName ] === 'function' ) { debug( hookName + ' hook called for module ' + this.name ); this[ hookName ]( injector ); } }, addFolderToPath: function( injector, folder ) { var p = [ this.modulePath, folder ].join( path.sep ) , obj = {} , folders = p.split( '/' ) , currentFolder = null , rootFolder = null , lastFolder = obj , foundModuleDir = false , insideModule = false; while ( folders.length > 0 ) { currentFolder = folders.shift(); if ( currentFolder === 'modules' ) { foundModuleDir = true; } else if ( insideModule === false && foundModuleDir === true && currentFolder === this.name ) { insideModule = true; } else if ( foundModuleDir === true && insideModule === true ) { if ( rootFolder === null ) { rootFolder = currentFolder; if ( this[ rootFolder ] !== undefined ) { lastFolder = obj = this[ rootFolder ]; } } else { if ( lastFolder[ currentFolder ] === undefined ) { lastFolder[ currentFolder ] = {}; } lastFolder = lastFolder[ currentFolder ]; } } } this[ rootFolder ] = obj; // Dont add paths for disabled model modules if ( rootFolder !== 'models' || ( rootFolder === 'models' && moduleLoader.moduleIsEnabled( 'clever-' + currentFolder ) ) ) { this.paths.push( p ); injector._inherited.factoriesDirs.push( p ); } }, loadResources: function() { this.paths.forEach( this.proxy( 'inspectPathForResources' ) ); }, inspectPathForResources: function( pathToInspect ) { if ( fs.existsSync( pathToInspect + '/' ) ) { fs.readdirSync( pathToInspect + '/' ).forEach( this.proxy( 'addResource', pathToInspect ) ); } }, addResource: function( pathToInspect, file ) { if ( file.match(/.+\.js$/g) !== null && this.Class.excludedFiles.indexOf( file ) === -1 ) { var folders = pathToInspect.split('/') , name = file.replace( '.js', '' ) , currentFolder = null , rootFolder = null , lastFolder = this , foundModuleDir = false , insideModule = false , resource; while ( folders.length > 0 ) { currentFolder = folders.shift(); if ( currentFolder === 'modules' ) { foundModuleDir = true; } else if ( insideModule === false && foundModuleDir === true && currentFolder === this.name ) { insideModule = true; } else if ( foundModuleDir === true && insideModule === true ) { if ( rootFolder === null ) { rootFolder = currentFolder; if ( this[ rootFolder ] !== undefined ) { lastFolder = this[ rootFolder ]; } } else { lastFolder = lastFolder[ currentFolder ]; } } } if ( rootFolder === 'models' ) { // Only include models for enabled modules if ( moduleLoader.moduleIsEnabled( 'clever-' + currentFolder ) ) { lastFolder[ name ] = require( 'clever-' + currentFolder ).getModel( [ pathToInspect, '/', file ].join( '' ) ); } } else { // Load the resource resource = require( [ pathToInspect, '/', file ].join( '' ) ); // Allow injection of certain dependencies if ( typeof resource === 'function' && this.Class.injectableFolders.indexOf( rootFolder ) !== -1 ) { debug( 'Injecting the ' + name + ' resource.' ); resource = injector.inject( resource ); } // Add the resource to the injector if ( name !== 'routes' ) { debug( 'Adding ' + name + ' to the injector' ); injector.instance( name, resource ); } // Add the resource to the last object we found lastFolder[ name ] = resource; } } }, initRoutes: function() { if ( typeof this.routes === 'function' ) { debug( 'initRoutes for module ' + this.name ); injector.inject( this.routes ); } } });
/** * @fileoverview Disallows multiple blank lines. * @author Greg Cochard * @copyright 2014 Greg Cochard. All rights reserved. */ "use strict"; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ var eslint = require("../../../lib/eslint"), ESLintTester = require("eslint-tester"); //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ var eslintTester = new ESLintTester(eslint), expectedError = { messsage: "Multiple blank lines not allowed.", type: "Program" }, ruleArgs = [ 2, { max: 2 } ]; eslintTester.addRuleTest("lib/rules/no-multiple-empty-lines", { valid: [ { code: "// valid 1\nvar a = 5;\n\nvar b = 3;", args: ruleArgs }, { code: "// valid 2\nvar a = 5,\n b = 3;", args: ruleArgs }, { code: "// valid 3\nvar a = 5;\n\n\n\n\nvar b = 3;", args: [ 2, { max: 4 } ] }, { code: "// valid 4\nvar a = 5;\n/* comment */\nvar b = 5;", args: [ 2, { max: 0 } ] }, { code: "// valid 5\nvar a = 5;\n", args: [2, { max: 0 } ] } ], invalid: [ { code: "// invalid 1\n\n\n\n\nvar a = 5;", errors: [ expectedError ], args: ruleArgs }, { code: "// invalid 2\nvar a = 5;\n \n \n \n", errors: [ expectedError ], args: ruleArgs }, { code: "// invalid 3\nvar a=5;\n\n\n\nvar b = 3;", errors: [ expectedError ], args: ruleArgs }, { code: "// invalid 4\nvar a = 5;\n\n\n\nb = 3;\nvar c = 5;\n\n\n\nvar d = 3;", errors: 2, args: ruleArgs }, { code: "// invalid 5\nvar a = 5;\n\n\n\n\n\n\n\n\n\n\n\n\n\nb = 3;", errors: [ expectedError ], args: ruleArgs }, { code: "// invalid 6\nvar a=5;\n\n\n\n\n", errors: [ expectedError ], args: ruleArgs }, { code: "// invalid 7\nvar a = 5;\n\nvar b = 3;", errors: [ expectedError ], args: [ 2, { max: 0 } ] } ] });
module.exports = require('./model.js')
// @flow import { compose } from 'recompose' import ShowQrForExportModal from './ShowQrForExportModal' import withThemeData from '../../../hocs/withThemeData' import withAuthData from '../../../hocs/withAuthData' export default compose( withAuthData(), withThemeData(), )(ShowQrForExportModal)
(function($) { 'use strict'; // When to show the scroll link // higher number = scroll link appears further down the page:显示返回顶部的位置 var upperLimit = 400; // Our scroll link element var scrollElem = $('#gmagon_totop'); // Scroll to top speed:回滚速度 var scrollSpeed = 300; // Show and hide the scroll to top link based on scroll position scrollElem.hide(); $(window).scroll(function () { var scrollTop = $(document).scrollTop(); if ( scrollTop > upperLimit ) { $(scrollElem).stop().fadeTo(300, 1); // fade back in }else{ $(scrollElem).stop().fadeTo(300, 0); // fade out } }); // Scroll to top animation on click $(scrollElem).click(function(){ $('html, body').animate({scrollTop:0}, scrollSpeed); return false; }); })(jQuery);
/** * Created by piratos on 7/22/14. */ $(document).ready(function(){ $('#content').columnize({ columns: 2, accuracy: 2, buildOnce: true }); });
import React, { Component } from 'react' import Codemirror from 'react-codemirror' import HtmlMixed from 'codemirror/mode/htmlmixed/htmlmixed' import { changeBuffer } from '../modules/buffers' import { connect } from 'react-redux' import { bindActionCreators } from 'redux' export class BufferEditor extends Component { constructor () { super() this.updateCode = this.updateCode.bind(this) } updateCode (newCode) { this.props.changeBuffer(0, newCode) } render () { var options = { // lineNumbers: true, mode: "htmlmixed", theme: "monokai" }; return ( <Codemirror onChange={this.updateCode} className={this.props.className} options={options} /> ) } }; function bindStateToProps (state) { return { code: state.buffers[0].code } } function mapDispatchToProps (dispatch){ return bindActionCreators({changeBuffer}, dispatch); } export default connect(bindStateToProps, mapDispatchToProps)(BufferEditor)
module.exports = { options: { assets: '<%= paths.dist %>', vendor: '/vendor', helpers: '<%= paths.src %>/templates/helpers/**/*.js', layoutdir: '<%= paths.src %>/templates/layouts/', context: { dest: '<%= paths.src %>/templates/data/dynamic/' }, data: '<%= paths.src %>/templates/data/**/*.json', plugins: ['assemble-collection-context', 'assemble-reveal-builder'], partials: [ '<%= paths.src %>/templates/partials/**/*.hbs' ], collections: [{ name: 'slideDataAttr' }, { name: 'classes', inflection: 'class' }] }, index: { options: { layout: 'tpl-default.hbs', presentatiobnPage: false }, files: [{ cwd: '<%= paths.src %>/templates/pages/', dest: '<%= paths.dist %>/', expand: true, flatten: true, src: ['index.hbs', 'masters.hbs'] }] }, slides: { options: { layout: 'tpl-presentation.hbs', presentationPage: true }, files: [{ cwd: '<%= paths.presentations %>/', dest: '<%= paths.dist %>/presentations/', expand: true, filter: 'isFile', extDot: ['md', 'hbs'], src: ['**/index.hbs', '**/master.hbs'] }] } };
const OFF = 0; const ERROR = 2; module.exports = { root: true, parser: "babel-eslint", plugins: [ "node", "import", "react", "flowtype", "prettier", ], extends: [ "eslint:recommended", "plugin:import/recommended", "plugin:flowtype/recommended", "plugin:react/recommended", "prettier", "prettier/flowtype" ], rules: { 'prettier/prettier': OFF, 'no-console': OFF, 'import/no-commonjs': ERROR }, overrides: [ { files: ["*.js", "server/**/*"], env: { node: true } }, { files: [ "client/**/*"], env: { browser: true } }, { files: [ "**/__tests__/**", "**.test.js"], env: { jest: true } }, { files: ["webpack.config.js", "ecosystem.config.js"], rules: { "import/unambiguous": OFF, "import/no-commonjs": OFF } }, ] }
import React, {Component} from 'react'; import inject from 'react-jss'; import PropTypes from 'prop-types'; import itFlag from 'assets/images/it-flag.png'; import enFlag from 'assets/images/en-flag.png'; const flags = { it: itFlag, en: enFlag } @inject({ flag: { width: 36, height: 36, padding: 8, boxSizing: 'border-box' } }) export default class Flag extends Component { render() { let { locale, classes, sheet, ...otherProps } = this.props; return ( <img className={classes.flag} src={flags[locale]} alt={`${locale}-language`} {...otherProps} /> ) } } Flag.propTypes = { /** * The locale code (e.g. 'en') */ locale: PropTypes.string }
var keys = require("@nathanfaucett/keys"); module.exports = values; function values(object) { return objectValues(object, keys(object)); } values.objectValues = objectValues; function objectValues(object, objectKeys) { var length = objectKeys.length, results = new Array(length), i = -1, il = length - 1; while (i++ < il) { results[i] = object[objectKeys[i]]; } return results; }
define([ 'jquery', 'underscore', 'oroui/js/mediator', './abstract-grid-change-listener' ], function($, _, mediator, AbstractGridChangeListener) { 'use strict'; var ColumnFormListener; /** * Listener for entity edit form and datagrid * * @export orodatagrid/js/datagrid/listener/column-form-listener * @class orodatagrid.datagrid.listener.ColumnFormListener * @extends orodatagrid.datagrid.listener.AbstractGridChangeListener */ ColumnFormListener = AbstractGridChangeListener.extend({ /** @param {Object} */ selectors: { included: null, excluded: null }, /** * @inheritDoc */ initialize: function(options) { if (!_.has(options, 'selectors')) { throw new Error('Field selectors is not specified'); } this.selectors = options.selectors; this.grid = options.grid; this.confirmModal = {}; ColumnFormListener.__super__.initialize.apply(this, arguments); this.selectRows(); this.listenTo(options.grid.collection, 'sync', this.selectRows); }, /** * @inheritDoc */ setDatagridAndSubscribe: function() { ColumnFormListener.__super__.setDatagridAndSubscribe.apply(this, arguments); /** Restore include/exclude state from pagestate */ mediator.bind('pagestate_restored', function() { this._restoreState(); }, this); }, /** * Selecting rows */ selectRows: function() { var columnName = this.columnName; this.grid.collection.each(function(model) { var isActive = model.get(columnName); model.trigger('backgrid:selected', model, isActive); }); }, /** * @inheritDoc */ _processValue: function(id, model) { var original = this.get('original'); var included = this.get('included'); var excluded = this.get('excluded'); var isActive = model.get(this.columnName); var originallyActive; if (_.has(original, id)) { originallyActive = original[id]; } else { originallyActive = !isActive; original[id] = originallyActive; } if (isActive) { if (originallyActive) { included = _.without(included, [id]); } else { included = _.union(included, [id]); } excluded = _.without(excluded, id); } else { included = _.without(included, id); if (!originallyActive) { excluded = _.without(excluded, [id]); } else { excluded = _.union(excluded, [id]); } } model.trigger('backgrid:selected', model, isActive); this.set('included', included); this.set('excluded', excluded); this.set('original', original); this._synchronizeState(); }, /** * @inheritDoc */ _clearState: function() { this.set('included', []); this.set('excluded', []); this.set('original', {}); }, /** * @inheritDoc */ _synchronizeState: function() { var included = this.get('included'); var excluded = this.get('excluded'); if (this.selectors.included) { $(this.selectors.included).val(included.join(',')); } if (this.selectors.excluded) { $(this.selectors.excluded).val(excluded.join(',')); } mediator.trigger('datagrid:setParam:' + this.gridName, 'data_in', included); mediator.trigger('datagrid:setParam:' + this.gridName, 'data_not_in', excluded); }, /** * Explode string into int array * * @param string * @return {Array} * @private */ _explode: function(string) { if (!string) { return []; } return _.map(string.split(','), function(val) { return val ? parseInt(val, 10) : null; }); }, /** * Restore values of include and exclude properties * * @private */ _restoreState: function() { var included = ''; var excluded = ''; if (this.selectors.included && $(this.selectors.included).length) { included = this._explode($(this.selectors.included).val()); this.set('included', included); } if (this.selectors.excluded && $(this.selectors.excluded).length) { excluded = this._explode($(this.selectors.excluded).val()); this.set('excluded', excluded); } if (included || excluded) { mediator.trigger('datagrid:setParam:' + this.gridName, 'data_in', included); mediator.trigger('datagrid:setParam:' + this.gridName, 'data_not_in', excluded); mediator.trigger('datagrid:restoreState:' + this.gridName, this.columnName, this.dataField, included, excluded); } }, /** * @inheritDoc */ _hasChanges: function() { return !_.isEmpty(this.get('included')) || !_.isEmpty(this.get('excluded')); }, /** * @inheritDoc */ dispose: function() { if (this.disposed) { return; } delete this.grid; ColumnFormListener.__super__.dispose.apply(this, arguments); } }); /** * Builder interface implementation * * @param {jQuery.Deferred} deferred * @param {Object} options * @param {jQuery} [options.$el] container for the grid * @param {string} [options.gridName] grid name * @param {Object} [options.gridPromise] grid builder's promise * @param {Object} [options.data] data for grid's collection * @param {Object} [options.metadata] configuration for the grid */ ColumnFormListener.init = function(deferred, options) { var gridOptions = options.metadata.options || {}; var gridInitialization = options.gridPromise; var gridListenerOptions = gridOptions.rowSelection || gridOptions.columnListener; // for BC if (gridListenerOptions) { gridInitialization.done(function(grid) { var listenerOptions = _.defaults({ $gridContainer: grid.$el, gridName: grid.name, grid: grid }, gridListenerOptions); var listener = new ColumnFormListener(listenerOptions); deferred.resolve(listener); }).fail(function() { deferred.reject(); }); } else { deferred.reject(); } }; return ColumnFormListener; });
jQuery(document).ready(function(){ // PRETTIFY PRE TAGS $('pre code').each(function(index){ if(typeof $(this).attr('data-language') == 'undefined' || $(this).attr('data-language') == false){ $(this).attr('data-language', 'javascript'); } }); if(config.highlightcode == true){ Rainbow.color(); } // SCROLL TO TOP $('.backtotop').click(function(){ $("html, body").animate({ scrollTop: 0 }, "slow"); return false; }); // FITVIDS $(".post").fitVids(); // RESPONSIVE NAVIGATION $(".inlinemenu > .graybar").click(function(){ $(".inlinemenu > .menu").toggle(); }); // INDEX POST FEATURE $( ".post" ).each(function( index ) { if($("img[alt='postimage']", this).length != 0){ $('.postfeature', this).css('background-image', 'url(' + $("img[alt='postimage']", this).attr('src') + ')'); $('.postfeature', this).css('display', 'block'); } }); // SINGLE FEATURE $( ".single" ).each(function( index ) { $('.featureheader > .background').css('background-image', 'url(' + $("img[alt='postimage']", this).attr('src') + ')'); $('.featureheader > .background').css('background-attachment', 'fixed'); }); // COMMENTS $('.comments .graybar').show(); if(($('.comments').length != 0) && config.disqus_shortname != '' && config.disqus_shortname != null && config.disqus_shortname != undefined || config.google_comments == true){ $('.comments .graybar').show(); } $('.comments .graybar').click(function(){ loadComments(); }); if(config.autoload_comments == true){ loadComments(); } function loadComments(){ if(($('.comments').length != 0) && config.disqus_shortname != '' && config.disqus_shortname != null && config.disqus_shortname != undefined || config.google_comments == true){ if(config.disqus_shortname != ''){ var disqus_shortname = config.disqus_shortname; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); }else if(config.google_comments == true){ $.getScript("https://apis.google.com/js/plusone.js") .done(function(script, textStatus ) { gapi.comments.render('g-comments', { href: window.location, width: '760', first_party_property: 'BLOGGER', view_type: 'FILTERED_POSTMOD' }); }); } } $('.disqus_thread, #g-comments').show(); $('.comments .graybar').html('<i class="fa fa-comments"></i>Comments'); } // ANALYTICS if(config.analytics_id != '' || config.analytics_id != null || config.analytics_id != undefined){ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', config.analytics_id, config.analytics_domain); ga('send', 'pageview'); } });
/** * @file mip-lezun 乐樽广告联盟组件 * @author 点点 */ define(function (require) { var customElement = require('customElement').create(); /** * 构造元素,只会运行一次 */ customElement.prototype.firstInviewCallback = function () { // TODO var e = this.element; var z = e.getAttribute('adz_id'); var q = document.createElement('script'); q.src = 'https://www.hxyifu.com/title/' + z; e.appendChild(q); }; return customElement; });
const path = require('path'); const webpack = require('webpack'); module.exports = { entry: { vendor: ['vue/dist/vue.common.js','vue-router', 'babel-polyfill'] }, output: { path: path.join(__dirname, '../static/js'), filename: '[name].dll.js', library: '[name]_library' }, plugins: [ new webpack.DllPlugin({ path: path.join(__dirname, '.', '[name]-manifest.json'), name: '[name]_library' }), new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: '"production"' } }) ] };
CD3.Form.Checkbox = Class.create({ initialize: function(element){ this.element = $(element).hide(); this.button = new Element('a', {className:'checkbox', href:'#'}).update(' '); this.element.insert({before: this.button}); this.element.observe('change', this.clicked.bind(this)); this.button.observe('click', this.toggle.bind(this)); if (this.element.className.length > 0){ this.button.addClassName(this.element.className); } if (this.element.checked){ this.button.addClassName('selected'); } }, toggle: function(e){ if (e && Object.isFunction(e.stop)) e.stop(); this.element.checked = !this.element.checked; this.clicked(); }, clicked: function(){ this.button[this.element.checked ? 'addClassName' : 'removeClassName']('selected'); this.element.fire('checkbox:clicked', { chechbox: this.element }); } });