text
stringlengths 2
1.05M
|
|---|
/*
* eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency,
* accountability and the service delivery of the government organizations.
*
* Copyright (C) 2017 eGovernments Foundation
*
* The updated version of eGov suite of products as by eGovernments Foundation
* is available at http://www.egovernments.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ or
* http://www.gnu.org/licenses/gpl.html .
*
* In addition to the terms of the GPL license to be adhered to in using this
* program, the following additional terms are to be complied with:
*
* 1) All versions of this program, verbatim or modified must carry this
* Legal Notice.
* Further, all user interfaces, including but not limited to citizen facing interfaces,
* Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any
* derived works should carry eGovernments Foundation logo on the top right corner.
*
* For the logo, please refer http://egovernments.org/html/logo/egov_logo.png.
* For any further queries on attribution, including queries on brand guidelines,
* please contact contact@egovernments.org
*
* 2) Any misrepresentation of the origin of the material is prohibited. It
* is required that all modified versions of this material be marked in
* reasonable ways as different from the original version.
*
* 3) This license does not grant any rights to any user of the program
* with regards to rights under trademark law for use of the trade names
* or trademarks of eGovernments Foundation.
*
* In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org.
*
*/
$(document).ready(function () {
$.fn.preventDoubleSubmission = function () {
$(this).on('submit', function (e) {
var $form = $(this);
if ($form.data('submitted') === true) {
e.preventDefault();
} else {
$form.data('submitted', true);
}
});
return this;
};
$('form').preventDoubleSubmission();
$('.password-error').hide();
$('.totalServicesAppliedHide').hide();
$('.totalServicesCompletedHide').hide();
$('#servicesCmpletedDiv').attr('style', 'opacity: 0.7;cursor: pointer');
$('#totalServicesAppliedDiv').attr('style', 'opacity: 0.7;cursor: pointer');
$('#totalServicesAppliedDiv').click(function () {
$('.servicesUnderScrutinyHide').hide();
$('.totalServicesCompletedHide').hide();
$('.totalServicesAppliedHide').show();
$('#totalServicesAppliedDiv').attr('style', 'opacity: 1;cursor: pointer');
$('#servicesUnderScrutinyDiv').attr('style', 'opacity: 0.7;cursor: pointer');
$('#servicesCmpletedDiv').attr('style', 'opacity: 0.7;cursor: pointer');
});
$('#servicesUnderScrutinyDiv').click(function () {
$('.totalServicesAppliedHide').hide();
$('.totalServicesCompletedHide').hide();
$('.servicesUnderScrutinyHide').show();
$('#servicesUnderScrutinyDiv').attr('style', 'opacity: 1;cursor: pointer');
$('#servicesCmpletedDiv').attr('style', 'opacity: 0.7;cursor: pointer');
$('#totalServicesAppliedDiv').attr('style', 'opacity: 0.7;cursor: pointer');
});
$('#servicesCmpletedDiv').click(function () {
$('.totalServicesAppliedHide').hide();
$('.servicesUnderScrutinyHide').hide();
$('.totalServicesCompletedHide').show();
$('#servicesCmpletedDiv').attr('style', 'opacity: 1;cursor: pointer');
$('#totalServicesAppliedDiv').attr('style', 'opacity: 0.7;cursor: pointer');
$('#servicesUnderScrutinyDiv').attr('style', 'opacity: 0.7;cursor: pointer');
});
var module;
$('.services .content').matchHeight();
leftmenuheight();
rightcontentheight();
//alert(matchRuleShort("bird123", "bird*"))
$('#search').keyup(function (e) {
var rule = '*' + $(this).val() + '*';
if (e.keyCode == 8) {
$('[data-services="' + module + '"]').show();
}
$(".services-item .services:visible").each(function () {
var testStr = $(this).find('.content').html().toLowerCase();
console.log(testStr, rule, matchRuleShort(testStr, rule))
if (matchRuleShort(testStr, rule))
$(this).show();
else
$(this).hide();
});
});
$('.modules-li').click(function () {
$('#search').val('');
$('.modules-li').removeClass('active');
$(this).addClass('active');
module = $(this).data('module');
$('.services-item .services').hide();
$('#showServiceGroup').hide();
if (module == 'home') {
$('.inbox-modules #showServiceGroup').show();
$('.action-bar').hide();
$('.linkedApplications').hide();
inboxloadmethod();
} else if (module == 'My Services') {
$('.inbox-modules').hide();
$('[data-services="' + module + '"], .action-bar, .linkedApplications').show();
} else {
$('.inbox-modules, .linkedApplications').hide();
$('[data-services="' + module + '"], .action-bar').show();
}
});
$(window).resize(function () {
leftmenuheight();
rightcontentheight();
});
$('table tbody tr').click(function () {
$('#myModal').modal('show');
});
$('.checkpassword').blur(function () {
if (($('#new-pass').val() != "") && ($('#retype-pass').val() != "")) {
if ($('#new-pass').val() === $('#retype-pass').val()) {
} else {
$('.password-error').show();
$('#retype-pass').addClass('error');
}
}
});
$('#btnChangePwd').click(function (e) {
$.ajax({
url: '/egi/home/password/update',
type: 'POST',
data: {
'currentPwd': $("#old-pass").val(),
'newPwd': $("#new-pass").val(),
'retypeNewPwd': $("#retype-pass").val()
},
success: function (data) {
var msg = "";
if (data == "SUCCESS") {
msg = "Your password has been updated."
} else if (data == "NEWPWD_UNMATCH") {
msg = "New password you have entered does not match with retyped password."
} else if (data == "CURRPWD_UNMATCH") {
msg = "Old password you have entered is incorrect."
} else if (data == "NEWPWD_INVALID") {
msg = $('#errorPwdInvalid').val() + "\"" + " ' / \ and space]";
} else if (data == 'NEW_AND_CURR_PWD_SAME') {
msg = "New Password cannot be same as your Old Password, try a different one.";
}
bootbox.alert(msg);
},
error: function () {
bootbox.alert("Internal server error occurred, please try after sometime.");
}, complete: function () {
$('.change-password, .loader-class').modal('hide');
resetValues();
}
});
});
$('#serviceGroup').change(function () {
var selected = $(this).val();
var total = $("#totalServicesAppliedSize").html().trim();
var length = document.getElementsByClassName($(this).val()).length / 2;
if ($(this).val() == "") {
$('.showAll').show();
$("#totalServicesAppliedSize").html($("#tabelPortal tbody.totalServicesAppliedHide tr.showAll").length);
$("#totalServicesCompletedSize").html($("#tabelPortal tbody.totalServicesCompletedHide tr.showAll").length);
$("#totalServicesPendingSize").html($("#tabelPortal tbody.servicesUnderScrutinyHide tr.showAll").length);
var showAllClass = "#tabelPortal tbody.servicesUnderScrutinyHide tr.showAll td:first-child";
generateSno(showAllClass);
} else {
$('.showAll').hide();
$('.' + $(this).val()).show();
$("#totalServicesAppliedSize").html($("#tabelPortal tbody.totalServicesAppliedHide tr." + $(this).val()).length);
$("#totalServicesCompletedSize").html($("#tabelPortal tbody.totalServicesCompletedHide tr." + $(this).val()).length);
$("#totalServicesPendingSize").html($("#tabelPortal tbody.servicesUnderScrutinyHide tr." + $(this).val()).length);
var servicesUnderScrutinyHideClass = "#tabelPortal tbody.servicesUnderScrutinyHide tr." + selected + " td:first-child";
var totalServicesAppliedHideClass = "#tabelPortal tbody.totalServicesAppliedHide tr." + selected + " td:first-child";
var totalServicesCompletedHideClass = "#tabelPortal tbody.totalServicesCompletedHide tr." + selected + " td:first-child";
generateSno(servicesUnderScrutinyHideClass);
generateSno(totalServicesAppliedHideClass);
generateSno(totalServicesCompletedHideClass);
}
});
$('.linkedApplications, .action-bar').hide();
});
function onlinePayTaxForm(url) {
window.open(url, 'window', 'scrollbars=yes,resizable=yes,height=700,width=800,status=yes');
}
function leftmenuheight() {
//console.log($( window ).height(), $('.modules-ul').height());
$('.left-menu,.modules-ul').css({
height: $(window).height(),
overflow: 'auto'
});
}
function rightcontentheight() {
//console.log($( window ).height(), $('.right-content').height());
$('.right-content').css({
height: $(window).height(),
overflow: 'auto'
})
}
//Short code
function matchRuleShort(str, rule) {
return new RegExp("^" + rule.toLowerCase().split("*").join(".*") + "$").test(str.toLowerCase());
}
var url;
function openPopUp(url) {
window.open(url, '', 'height=650,width=980,scrollbars=yes,left=0,top=0,status=yes');
}
function generateSno(className) {
var idx = 1;
$(className).each(function () {
$(this).text(idx);
idx++;
});
}
function resetValues() {
$('#retype-pass').val('');
$('#new-pass').val('');
$('#old-pass').val('');
$('.password-error').hide();
}
function inboxloadmethod() {
location.reload();
}
|
const readline = require('readline');
let move_disk = (src, dest, from, to) => {
let home_top = src.pop();
let center_top = dest.pop();
if (home_top == undefined) {
src.push(center_top);
print_move(to, from, center_top);
}
else if (center_top == undefined) {
dest.push(home_top);
print_move(from, to, home_top);
}
else if (home_top > center_top) {
src.push(home_top);
src.push(center_top);
print_move(to, from, center_top);
}
else {
dest.push(center_top);
dest.push(home_top);
print_move(from, to, home_top);
}
}
let print_move = (src, dest, disk) => {
console.log("Move disk " + disk + " from post " + src + " to " + dest);
return;
}
let solve = (n, src, dest, aux) => {
let i, num_moves;
let home = 1, center = 2, end = 3;
num_moves = Math.pow(2, n) - 1;
for (i = n; i >= 1; i--)
src.push(i);
for (i = 1; i <= num_moves; i++) {
if (i % 3 == 0)
move_disk(aux, dest, end, center);
else if (i % 3 == 1)
move_disk(src, dest, home, center);
else if (i % 3 == 2)
move_disk(src, aux, home, end);
}
}
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
src = [];
dest = [];
aux = [];
rl.question("Enter number of rings: ", x => {
solve(parseInt(x), src, dest, aux);
rl.close();
})
|
declare module "command-line-usage" {
/**
* Generates a usage guide suitable for a command-line app.
* @param sections One or more Section objects
* @alias module:command-line-usage
*/
declare function commandLineUsage(
sections:
| commandLineUsage$commandLineUsage$Section
| commandLineUsage$commandLineUsage$Section[]
): string;
declare module.exports: typeof commandLineUsage;
/**
* Section object.
*/
declare type commandLineUsage$Section =
| commandLineUsage$Content
| commandLineUsage$OptionList;
/**
* A Content section comprises a header and one or more lines of content.
*/
declare interface commandLineUsage$Content {
/**
* The section header, always bold and underlined.
*/
header?: string;
/**
* Overloaded property, accepting data in one of four formats.
* 1. A single string (one line of text).
* 2. An array of strings (multiple lines of text).
* 3. An array of objects (recordset-style data). In this case, the data will be rendered in table format. The property names of each object are not important, so long as they are
* consistent throughout the array.
* 4. An object with two properties - data and options. In this case, the data and options will be passed directly to the underlying table layout module for rendering.
*/
content?:
| string
| string[]
| any[]
| {
data: any,
options: any
};
/**
* Set to true to avoid indentation and wrapping. Useful for banners.
*/
raw?: boolean;
}
/**
* Describes a command-line option. Additionally, if generating a usage guide with command-line-usage you could optionally add description and typeLabel properties to each definition.
*/
declare interface commandLineUsage$OptionDefinition {
name: string;
/**
* The type value is a setter function (you receive the output from this), enabling you to be specific about the type and value received.
*
* The most common values used are String (the default), Number and Boolean but you can use a custom function.
*/
type?: any;
/**
* getopt-style short option names. Can be any single character (unicode included) except a digit or hyphen.
*/
alias?: string;
/**
* Set this flag if the option takes a list of values. You will receive an array of values, each passed through the type function (if specified).
*/
multiple?: boolean;
/**
* Identical to multiple but with greedy parsing disabled.
*/
lazyMultiple?: boolean;
/**
* Any values unaccounted for by an option definition will be set on the defaultOption. This flag is typically set on the most commonly-used option to make for more concise usage.
*/
defaultOption?: boolean;
/**
* An initial value for the option.
*/
defaultValue?: any;
/**
* When your app has a large amount of options it makes sense to organise them in groups.
*
* There are two automatic groups: _all (contains all options) and _none (contains options without a group specified in their definition).
*/
group?: string | string[];
/**
* A string describing the option.
*/
description?: string;
/**
* A string to replace the default type string (e.g. <string>). It's often more useful to set a more descriptive type label, like <ms>, <files>, <command>, etc..
*/
typeLabel?: string;
}
/**
* A OptionList section adds a table displaying details of the available options.
*/
declare interface commandLineUsage$OptionList {
header?: string;
/**
* An array of option definition objects.
*/
optionList?: commandLineUsage$OptionDefinition[];
/**
* If specified, only options from this particular group will be printed.
*/
group?: string | string[];
/**
* The names of one of more option definitions to hide from the option list.
*/
hide?: string | string[];
/**
* If true, the option alias will be displayed after the name, i.e. --verbose, -v instead of -v, --verbose).
*/
reverseNameOrder?: boolean;
/**
* An options object suitable for passing into table-layout.
*/
tableOptions?: any;
}
}
|
'use strict';
angular.module('etcdControlPanel')
.directive('highlight', function(keyPrefix) {
return {
restrict: 'E',
scope: {
highlightBase: '=',
highlightCurrent: '='
},
link: function(scope, element, attrs) {
var base = _.str.strRight(scope.highlightBase, keyPrefix),
current = _.str.trim(scope.highlightCurrent, '/');
if (base === current) {
element.parent().parent().addClass('etcd-selected');
}
}
};
});
|
import React, { Fragment } from 'react';
const PostNavigationContainer = () => (
<div>
<nav className="navbar navbar-expand-lg navbar-light bg-light">
<a className="navbar-brand" href="#">Post List</a>
<div className="navbar-nav">
<button className="btn btn-outline-success my-2 my-sm-0">New Post</button>
</div>
</nav>
</div>
);
export default PostNavigationContainer;
|
/*
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
(function(){function p(a,g){var b=a.editable().findOne('a[data-cke-autoembed\x3d"'+g+'"]'),c=a.lang.autoembed,d;if(b&&b.data("cke-saved-href")){var b=b.data("cke-saved-href"),e=CKEDITOR.plugins.autoEmbed.getWidgetDefinition(a,b);if(e){var f="function"==typeof e.defaults?e.defaults():e.defaults,f=CKEDITOR.dom.element.createFromHtml(e.template.output(f)),h,m=a.widgets.wrapElement(f,e.name),n=new CKEDITOR.dom.documentFragment(m.getDocument());n.append(m);(h=a.widgets.initOn(f,e))?(d=a.showNotification(c.embeddingInProgress,
"info"),h.loadContent(b,{noNotifications:!0,callback:function(){var b=a.editable().findOne('a[data-cke-autoembed\x3d"'+g+'"]');if(b){var c=a.getSelection(),e=a.createRange(),f=a.editable();a.fire("saveSnapshot");a.fire("lockSnapshot",{dontUpdate:!0});var l=c.createBookmarks(!1)[0],k=l.startNode,h=l.endNode||k;CKEDITOR.env.ie&&9>CKEDITOR.env.version&&!l.endNode&&k.equals(b.getNext())&&b.append(k);e.setStartBefore(b);e.setEndAfter(b);f.insertElement(m,e);f.contains(k)&&f.contains(h)?c.selectBookmarks([l]):
(k.remove(),h.remove());a.fire("unlockSnapshot")}d.hide();a.widgets.finalizeCreation(n)},errorCallback:function(){d.hide();a.widgets.destroy(h,!0);a.showNotification(c.embeddingFailed,"info")}})):a.widgets.finalizeCreation(n)}else CKEDITOR.warn("autoembed-no-widget-def")}}var q=/^<a[^>]+href="([^"]+)"[^>]*>([^<]+)<\/a>$/i;CKEDITOR.plugins.add("autoembed",{requires:"autolink,undo",lang:"az,bg,ca,cs,da,de,de-ch,el,en,en-au,eo,es,es-mx,eu,fr,gl,hr,hu,it,ja,km,ko,ku,lv,mk,nb,nl,oc,pl,pt,pt-br,ro,ru,sk,sq,sv,tr,ug,uk,vi,zh,zh-cn",
init:function(a){var g=1,b;a.on("paste",function(c){if(c.data.dataTransfer.getTransferType(a)==CKEDITOR.DATA_TRANSFER_INTERNAL)b=0;else{var d=c.data.dataValue.match(q);if(b=null!=d&&decodeURI(d[1])==decodeURI(d[2]))c.data.dataValue='\x3ca data-cke-autoembed\x3d"'+ ++g+'"'+c.data.dataValue.substr(2)}},null,null,20);a.on("afterPaste",function(){b&&p(a,g)})}});CKEDITOR.plugins.autoEmbed={getWidgetDefinition:function(a,g){var b=a.config.autoEmbed_widget||"embed,embedSemantic",c,d=a.widgets.registered;
if("string"==typeof b)for(b=b.split(",");c=b.shift();){if(d[c])return d[c]}else if("function"==typeof b)return d[b(g)];return null}}})();
|
let facade = require('gamecloud')
let {ReturnCode} = facade.const
/**
* 自定义控制器:用户登录模块
* @description 该模块覆盖了同名的系统缺省控制器
*/
class login extends facade.Control
{
/**
* 用户登录
* @param {UserEntity} user 认证用户对象
* @param {Object} params 上行参数数组
* @returns {Object}
*/
async UserLogin(user, params) {
let ret = {code:ReturnCode.Success};
ret.data = user.GetInfo();
ret.data.id = user.id; //本服唯一数字编号
ret.data.domain = user.domain; //domain
ret.data.openid = user.openid; //uuid
ret.data.name = user.name; //用户昵称,客户端直接获取
ret.data.token = user.sign; //登录令牌
ret.data.time = user.time; //标记令牌有效期的时间戳
ret.data.currentAuthority = this.core.options.master.includes(user.openid) ? ['admin', 'user'] : ['user']; //客户端需要的权限信息
return ret;
}
}
exports = module.exports = login;
|
/* global Module */
/* Magic Mirror 2
* Module: MMM-Chart
*
* Developed by Erik Pettersson
* Partly based on dynchart module by Chris van Marle
* MIT Licensed.
*/
Module.register("MMM-Chart",{
requiresVersion: "2.1.0",
//var graph = [],
// Default module config.
defaults: {
// Graph default values (for all graphs on the MM).
// These can _not_ be set / graph.
// ------------------------------------------------
// Font size in px.
defaultFontSize: 12,
// Default MM font.
defaultFontFamily: "Roboto, sans-serif",
// Default color of the text.
defaultFontColor: "#666666",
// ------------------------------------------------
// Graph ID (name)
name: "my-chart",
// Maintain aspect ratio.
maintainAspectRatio: true,
// How long between updates.
updateInterval: 60000,
// Animation speed.
fadeSpeed: 1000,
// Type of graph.
// For mor information checkout: http://www.chartjs.org/docs/
// Warning, I have only really tested with bar and line graphs!
graphStyle: "line",
//graphStyle: "bar",
//graphStyle: "radar",
//graphStyle: "polarArea",
// URL to graph JSON data source.
//url: "http://you.have.to.set.this.to.your.JSON.source.in.the.config!",
// X Axis time unit the graphs should be ploted in.
//xaxisTimeUnit: "millisecond",
//xaxisTimeUnit: "second",
//xaxisTimeUnit: "minute",
xaxisTimeUnit: "hour",
//xaxisTimeUnit: "day",
//xaxisTimeUnit: "week",
//xaxisTimeUnit: "month",
//xaxisTimeUnit: "quarter",
//xaxisTimeUnit: "year",
// Format for the unit above.
// For more options checkout: http://momentjs.com/docs/#/displaying/format/
// Example for second above.
//xaxisTimeFormatLabels: "ss",
// Example for minute above.
//xaxisTimeFormatLabels: "mm",
// Example for hour above.
xaxisTimeFormatLabels: "H",
// Example for day above.
//xaxisTimeFormatLabels: "YYYY-MM-DD",
// Example for week above.
//xaxisTimeFormatLabels: "WW",
// Example for month above.
//xaxisTimeFormatLabels: "MM",
// Available: "category", "linear", "logarithmic", "time", "radialLinear" (you have to use one that works with your data).
// For more options checkout: http://www.chartjs.org/docs/#scales
xaxisType: "time",
// Display X-Axis ticks.
xaxisLabelTicks: true,
// Position of the horizontal scale labels (top, left, bottom and right).
xaxisLabelsPosition: "bottom",
// Add to the graph continuously.
additiveGraph: false,
// Max number of graph data points.
graphPoints: 10000,
// Show information lables.
showGraphLabels: true,
// Position of information lables (top, left, bottom and right).
showGraphLabelsPosition: "top",
// Box before text. R G B Weight
boxFontColor: "rgba(153, 153, 153, 0.6)",
// Width of the box (before the label).
boxWidth: 2,
// Axis color. R G B Weight
xaxisColor: "rgba(255, 255, 255, 0.1)",
// Default line bezier curve tension (recommended 0 - 0.4). Set to 0 for no bezier curves.
lineTension: 0.2,
// Tooltips enebeld/disabeld (displays if hoovering over tha graph points).
tooltipEnabeld: true,
// Tooltip background R G B Weight
tooltipBackgroundColor: "rgba(0, 0, 0, 0.8)",
// Tooltip text colors. R G B Weight
tooltipBodyFontColor: "rgba(255, 255, 255, 1)",
tooltipTitleFontColor: "rgba(255, 255, 255, 1)",
tooltipDisplayColorsBoxes: true,
// Graph 1 information:
// Colors. R G B Weight
graphGridColor0: "rgba(255, 255, 255, 0.1)",
graphTickColor0: "rgba(120, 120, 255, 0.8)",
graphLineColor0: "rgba(80, 80, 255, 1)",
graphFillColor0: "rgba(80, 80, 255, 0.4)",
// Fill or not.
graphFill0: false,
// Line width.
graphBorderWidth0: 2,
// Scale position.
graphScalePos0: "left",
// Display Y-Axis ticks.
graphLabelTicks0: true,
// Size of the value steps on the scale (0 = Auto).
graphScaleStepSize0: 0,
// Always begin ticks at zero.
graphTicksZero0: false,
// Text after the graph example box.
graphLabel0: "Dummy A",
// Show vertical side label.
graphShowScaleLabel0: false,
// The text on the vertical label.
graphTextScaleLabel0: "Dummy A",
// Stack the graph.
graphstacked0: false,
// Graph 2 information:
// Colors. R G B Weight
graphGridColor1: "rgba(255, 255, 255, 0.1)",
graphTickColor1: "rgba(80, 200, 80, 0.6)",
graphLineColor1: "rgba(80, 200, 80, 1)",
graphFillColor1: "rgba(80, 200, 80, 0.4)",
// Fill or not.
graphFill1: false,
// Line width.
graphBorderWidth1: 2,
// Scale position (left or right).
graphScalePos1: "right",
// Display Y-Axis ticks.
graphLabelTicks1: true,
// Size of the value steps on the right side (0 = Auto).
graphScaleStepSize1: 0,
// Always begin ticks at zero.
graphTicksZero1: false,
// Text after the graph example box.
graphLabel1: "Dummy B",
// Show vertical side label.
graphShowScaleLabel1: false,
// The text on the vertical label.
graphTextScaleLabel1: "Dummy B",
// Stack the graph.
graphstacked1: false,
// Graph 3 information:
// Colors. R G B Weight
graphGridColor2: "rgba(255, 255, 255, 0.1)",
graphTickColor2: "rgba(200, 80, 80, 0.6)",
graphLineColor2: "rgba(200, 80, 80, 1)",
graphFillColor2: "rgba(200, 80, 80, 0.4)",
// Fill or not.
graphFill2: false,
// Line width.
graphBorderWidth2: 2,
// Scale position (left or right).
graphScalePos2: "left",
// Display Y-Axis ticks.
graphLabelTicks2: true,
// Size of the value steps on the right side (0 = Auto).
graphScaleStepSize2: 0,
// Always begin ticks at zero.
graphTicksZero2: false,
// Text after the graph example box.
graphLabel2: "Dummy C",
// Show vertical side label.
graphShowScaleLabel2: false,
// The text on the vertical label.
graphTextScaleLabel2: "Dummy C",
// Stack the graph.
graphstacked2: false,
// Graph 4 information:
// Colors. R G B Weight
graphGridColor3: "rgba(255, 255, 255, 0.1)",
graphTickColor3: "rgba(200, 200, 80, 0.6)",
graphLineColor3: "rgba(200, 200, 80, 1)",
graphFillColor3: "rgba(200, 200, 80, 0.4)",
// Fill or not.
graphFill3: false,
// Line width.
graphBorderWidth3: 2,
// Scale position (left or right).
graphScalePos3: "right",
// Display Y-Axis ticks.
graphLabelTicks3: true,
// Size of the value steps on the right side (0 = Auto).
graphScaleStepSize3: 0,
// Always begin ticks at zero.
graphTicksZero3: false,
// Text after the graph example box.
graphLabel3: "Dummy D",
// Show vertical side label.
graphShowScaleLabel3: false,
// The text on the vertical label.
graphTextScaleLabel3: "Dummy D",
// Stack the graph.
graphstacked3: false,
},
// Get the Module CSS.
getStyles: function() {
return ["MMM-Chart.css"];
},
// Get the needed scripts to make graphs.
getScripts: function() {
return [
// Used to create the actual chart.
this.file('node_modules/chart.js/dist/Chart.min.js'),
// Used to handle the mouse and touch interactions.
this.file('node_modules/hammerjs/hammer.min.js'),
// Used for interaction with the graph to be able to zoom and pan.
this.file('node_modules/chartjs-plugin-zoom/chartjs-plugin-zoom.min.js')
]
},
// Starting up.
start: function() {
this.scheduleUpdate();
this.chartData = {labels: [], datasets: [] }
this.config.identifier = this.identifier;
if (typeof this.config.url === 'undefined' || this.config.url === null) {
Log.error('URL not defined in ' + this.name + ' on graph ' + this.config.name + '.');
}
// Triggers the get data.
this.getData(this.config);
},
// Request the graph data.
getData: function (data) {
this.sendSocketNotification('GET_GRAPH_DATA', data);
},
// Getting the graph data from helper (all MMM-Chart modules get it).
socketNotificationReceived: function(notification, payload) {
if (notification === "GRAPH_DATA_RESULT") {
// Checks if the data is to this instans of the graph module.
if (this.identifier === payload.identifier) {
// Show it all!
//Log.info('Parsed payload: ' + JSON.stringify(payload));
// Parsing the JSON data to an array.
payload = JSON.parse(payload.body);
// Show it all!
//Log.info('Parsed payload body: ' + JSON.stringify(payload));
// Continue to add to a already rendered graph or not...
if (this.config.additiveGraph == true) {
// Only reset data if non exsists on graphs.
if (typeof this.chartData.datasets[0] === 'undefined' || this.chartData.datasets[0] === null) {
// Reset all avaiable data graph lines.
for (var q = 0; q < payload[0].length-1; q++) {
this.chartData.datasets[q] = { data:[] };
}
}
} else {
// Reset all data graph lines (non additive graph).
for (var q = 0; q < payload[0].length-1; q++) {
this.chartData.datasets[q] = { data:[] };
}
}
// Counting trough the new graph data.
for (var i = 0, toI = payload.length; i < toI; i++) {
// Setting up the xAxes labels.
this.chartData.labels.push(payload[i][0]);
// Cuting off lables if the max points value has been reached.
if (this.config.graphPoints < this.chartData.labels.length || this.chartData.datasets[1-1].data.length < this.chartData.labels.length) {
// Removing labels that is out of the scoop.
this.chartData.labels.splice(0, 1);
}
// Setting up the graphs data.
for (var j = 1, toJ = payload[i].length; j < toJ; j++) {
// Only add data to defined graphs.
if (this.chartData.datasets[j-1] !== 'undefined' || this.chartData.datasets[j-1] !== null) {
this.chartData.datasets[j-1].data.push(payload[i][j]);
// Cuting off data if the max points value has been reached.
if (this.config.graphPoints < this.chartData.datasets[j-1].data.length) {
// Removing data that is out of the scoop.
this.chartData.datasets[j-1].data.splice(0, 1);
}
}
}
}
//Log.info('Length = ' + this.chartData.datasets.length);
//Log.info('Data = ' + this.chartData.datasets);
//Log.info('Lbels = ' + this.chartData.labels);
// Update the graphs.
//this.updateChartData();
this.updateDom(self.config.fadeSpeed);
}
}
},
// Updating routine.
scheduleUpdate: function(delay) {
var nextLoad = this.config.updateInterval;
if (typeof delay !== 'undefined' && delay >= 0) {
nextLoad = delay;
}
// Time is up!
var self = this;
setInterval(function() {
self.getData(self.config);
}, nextLoad);
},
// Parsing the data and preparing for the graph chart.
updateChartData: function() {
if(this.myChart !== 'undefined') {
// Adding the labels to the chart.
this.myChart.data.labels = this.chartData.labels;
// Adding the data to the chart.
for (var i = 0; i < this.myChart.data.datasets.length && i < this.chartData.datasets.length; i++) {
this.myChart.data.datasets[i].data = this.chartData.datasets[i].data;
}
// Updating the chart.
this.myChart.update();
}
},
// Override dom generator.
getDom: function() {
var wrapper = document.createElement("div");
// Adding personal name class (fos use in CSS).
wrapper.className = this.config.name;
// Creating the canvas.
this.ctx = document.createElement("canvas");
// Adding the canvas to the document wrapper.
wrapper.appendChild(this.ctx);
// Setting the defaults.
Chart.defaults.global.defaultFontSize = this.config.defaultFontSize;
Chart.defaults.global.defaultFontFamily = this.config.defaultFontFamily;
Chart.defaults.global.defaultFontColor = this.config.defaultFontColor;
// Graph options.
var options = {
responsive: true,
maintainAspectRatio: this.config.maintainAspectRatio,
legend: {
display: this.config.showGraphLabels,
position: this.config.showGraphLabelsPosition,
labels: {
boxWidth: this.config.boxWidth,
fontColor: this.config.boxFontColor
}
},
pan: {
enabled: true,
mode: 'xy'
},
zoom: {
enabled: true,
mode: 'xy',
},
tooltips: {
enabled: this.config.tooltipEnabeld,
backgroundColor: this.config.tooltipBackgroundColor,
displayColors: this.config.tooltipDisplayColorsBoxes,
titleFontColor: this.config.tooltipTitleFontColor,
bodyFontColor: this.config.tooltipBodyFontColor,
mode: "x",
callbacks: {
title: function(ti, data) {
return moment(ti[0].xLabel).format("HH:mm:ss");
},
label: function(ti, data) {
if (ti.datasetIndex == 0) {
return data.datasets[ti.datasetIndex].data[ti.index];
} else if(ti.datasetIndex == 1) {
return data.datasets[ti.datasetIndex].data[ti.index];
} else {
return data.datasets[ti.datasetIndex].data[ti.index].toString();
}
}
}
},
};
// Start of the Scales.
var optionScales = {
scales: {
xAxes: [],
yAxes: []
}
};
// X Axis Scale.
var xAxis0 = {
display: this.config.xaxisLabelTicks,
type: this.config.xaxisType,
position: this.config.xaxisLabelsPosition,
time: {
displayFormats: {},
unit: this.config.xaxisTimeUnit,
},
gridLines: {
color: this.config.xaxisColor
}
};
// Adding Graph XAxis to chart.
optionScales.scales.xAxes.push(xAxis0);
// Adding Graph label and color settings to chart.
for (var y = 0; y < this.chartData.datasets.length; y++) {
// Graph 1.
yAxis0 = {
display: this.config['graphLabelTicks' + y],
stacked: this.config['graphstacked' + y],
position: this.config['graphScalePos' + y],
id: "y-axis-" + y,
scaleLabel: {
display: this.config['graphShowScaleLabel' + y],
labelString: this.config['graphTextScaleLabel' + y]
},
gridLines: {
color: this.config['graphGridColor' + y]
},
ticks: {
stepSize: this.config['graphScaleStepSize' + y],
beginAtZero: this.config['graphTicksZero' + y],//true,
//minStepSize: 0.2,
fontColor: this.config['graphTickColor' + y],
callback: function(val) {
if (!isNaN(val)) {
val = Math.round(val * 100) / 100
}
return val;
}
}
};
optionScales.scales.yAxes.push(yAxis0);
};
// Scale option elements.
var optionelements = {
elements: {
point: {
radius: 0,
hitRadius: 3,
hoverRadius: 3,
},
line: {
tension: this.config.lineTension,
}
}
};
// Start graph datasets.
var graphdatasets = [];
// Adding Graph line settings to chart.
for (var g = 0; g < this.chartData.datasets.length; g++) {
graph0 = {
label: this.config['graphLabel' + g],
yAxisID: "y-axis-" + g,
borderColor: this.config['graphLineColor' + g],
backgroundColor: this.config['graphFillColor' + g],
fill: this.config['graphFill' + g],
borderWidth: this.config['graphBorderWidth' + g],
data: [],
};
graphdatasets.push(graph0);
//Log.info(JSON.stringify(graph0));
};
// Merging it all.
Object.assign(options, optionelements, optionScales);
// Show it all...
//Log.info(JSON.stringify(options));
// Setting the time scale.
if (this.config.xaxisTimeUnit == "millisecond") {
options.scales.xAxes[0].time.displayFormats.millisecond = this.config.xaxisTimeFormatLabels
} else if (this.config.xaxisTimeUnit == "second") {
options.scales.xAxes[0].time.displayFormats.second = this.config.xaxisTimeFormatLabels
} else if (this.config.xaxisTimeUnit == "minute") {
options.scales.xAxes[0].time.displayFormats.minute = this.config.xaxisTimeFormatLabels
} else if (this.config.xaxisTimeUnit == "hour") {
options.scales.xAxes[0].time.displayFormats.hour = this.config.xaxisTimeFormatLabels
} else if (this.config.xaxisTimeUnit == "day") {
options.scales.xAxes[0].time.displayFormats.day = this.config.xaxisTimeFormatLabels
} else if (this.config.xaxisTimeUnit == "week") {
options.scales.xAxes[0].time.displayFormats.week = this.config.xaxisTimeFormatLabels
} else if (this.config.xaxisTimeUnit == "month") {
options.scales.xAxes[0].time.displayFormats.month = this.config.xaxisTimeFormatLabels
} else if (this.config.xaxisTimeUnit == "quarter") {
options.scales.xAxes[0].time.displayFormats.quarter = this.config.xaxisTimeFormatLabels
} else if (this.config.xaxisTimeUnit == "year") {
options.scales.xAxes[0].time.displayFormats.year = this.config.xaxisTimeFormatLabels
}
// Show it all again...
//Log.info(JSON.stringify(options));
// Creating the actual graph.
this.myChart = new Chart(this.ctx, {
type: this.config.graphStyle,
data: {
labels: [],
datasets: graphdatasets,
},
options: options
});
this.updateChartData();
return wrapper;
}
});
|
import React from 'react'
import styled from 'styled-components'
import { animateScroll as scroll } from "react-scroll"
import { Header5, Header6, Body, Caption } from '../layouts/typography'
import './Card.css'
import arrow from '../images/ic_arrow_b.svg'
const Container = styled.div`
display: flex;
flex-direction: column;
margin: 5px auto 70px;
padding: 10px;
@media (max-width: 768px) {
margin: 2px auto 0px;
padding: 10px 0px;
}
`
const Content = styled.div`
height: 474px;
width: auto;
padding: 64px;
display: flex;
flex-direction: column;
align-items: center;
@media (max-width: 768px) {
padding: 40px 20px;
width: auto;
}
@media (max-width: 500px) {
padding: 20px 20px;
width: auto;
}
`
const OverViewContainer = styled.div`
width: 1000px;
display: flex;
flex-direction: row;
max-width: 1000px;
@media (max-width: 768px) {
flex-direction: column;
width: 100%;
}
`
const OverViewContent = styled.div`
display: flex;
flex-direction: column;
width: 70%;
margin-right: 60px;
@media (max-width: 768px) {
width: 100%;
margin-right: 0px;
margin-bottom: 32px;
}
`
const Title = styled(Header6)`
color: #000000;
margin-top: 0px;
margin-bottom: 12px;
@media (max-width: 768px) {
text-align: center;
}
`
const Description = styled(Body)`
color: rgba(0,0,0,0.7);
`
const RoleContainer = styled.div`
display: flex;
flex-direction: row;
width: 35%;
@media (max-width: 768px) {
flex-direction: row;
width: 100%;
justify-content: space-around;
}
`
const RoleContent = styled.div`
display: flex;
flex-direction: column;
padding-left: 20px;
padding-right: 40px;
`
const RoleTitle = styled(Body)`
font-weight: bold;
line-height: 0;
color: #000000;
`
const ItemArrow = styled.img`
width: 16px;
height: 16px;
position: relative;
top: 2px;
`
const HorizontalBar = styled.div`
width: 80px;
border: solid 1px #f7991e;
margin: 10px 0px;
`
const Br = styled.div`
width: 100%;
height: 20px;
`
const RoleDescription = styled(Caption)`
color: rgba(0, 0, 0, 0.7);
line-height: 1rem;
`
const Experience = styled.div`
width: 70%;
max-width: 900px;
border-radius: 8px;
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.2);
background-color: #ffffff;
margin: -240px auto -50px;
padding: 32px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
@media (max-width: 768px) {
width: 90%;
margin: -30px auto 20px;
padding: 24px 16px;
}
@media (max-width: 500px) {
margin: 250px auto 0;
}
`
const ExpTitle = styled(Header5)`
max-width: 600px;
text-align: center;
color: #000000;
margin-bottom: 12px;
margin-top: 0;
@media (max-width: 768px) {
width: auto;
font-size: 1.75rem;
line-height: 2.125rem;
}
`
const ExpDescription = styled(Body)`
color: rgba(0, 0, 0, 0.7);
@media (max-width: 768px) {
max-width: 540px;
}
`
const SkipLink = styled.a`
font-size: 18px;
font-weight: 700;
line-height: 27px;
text-align: center;
color: #540D6E;
cursor: pointer;
margin-top: 16px;
transition: all 300ms ease 0s;
&:hover {
transform: translateY(3px);
}
@media (max-width: 768px) {
margin-top: 16px;
}
`
const Role = ({title, description}) => {
return (
<RoleContent>
<RoleTitle>{title}</RoleTitle>
<HorizontalBar />
<RoleDescription>{description}</RoleDescription>
</RoleContent>
)
}
const OverView = props => (
<Container>
<Content>
<OverViewContainer>
<OverViewContent>
<Title>Overview</Title>
<Description>
tCheck, the world’s first handheld live cannabis potency tester was about to get even better. To date, the device tested cannabis concentrate based infusions. The engineering team had just discovered how to introduce a much requested feature, cannabis plant based infusions, into the tCheck device. However, to use this new feature,
users would need to complete a complicated flow. Could this multi-step flow really work alongside tCheck other simple measurement flows?
</Description>
</OverViewContent>
<RoleContainer>
<Role
title="Role"
description={
<div>
UX research
<Br />
UX/UI design
<Br />
Interactive prototyping
<Br />
</div>}
/>
<Role
title="Timeline"
description={
<div>
6 months
</div>}
/>
</RoleContainer>
</OverViewContainer>
</Content>
<Experience>
<ExpTitle>
How do we make a complex scientific process easy to perform?
</ExpTitle>
<ExpDescription>
If the user skips any steps in the flow, their results will not be
accurate. How do we explain the additional test prep needed? How can
we help the user feel confident that they can complete a test?
</ExpDescription>
<SkipLink onClick={() => {
scroll.scrollTo(
document.getElementById("Solution2").offsetTop - 100
)
}}>
Skip process and see where we landed <ItemArrow src={arrow} />
</SkipLink>
</Experience>
</Container>
)
export default OverView
|
/*!
* country-region-selector
* ------------------------
* 0.2.3
* @author Ben Keen
* @repo https://github.com/benkeen/country-region-selector
* @licence MIT
*/
!function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b(require()):a.crs=b(a)}(this,function(){"use strict";var a="crs-country",b="Select country",c="Select region",d=!0,e=!0,f=[],g=[["Afghanistan","AF","Badakhshan~BDS|Badghis~BDG|Baghlan~BGL|Balkh~BAL|Bamyan~BAM|Daykundi~DAY|Farah~FRA|Faryab~FYB|Ghazni~GHA|Ghor~GHO|Helmand~HEL|Herat~HER|Jowzjan~JOW|Kabul~KAB|Kandahar~KAN|Kapisa~KAP|Khost~KHO|Kunar~KNR|Kunduz~KDZ|Laghman~LAG|Logar~LOW|Maidan Wardak~WAR|Nangarhar~NAN|Nimruz~NIM|Nuristan~NUR|Paktia~PIA|Paktika~PKA|Panjshir~PAN|Parwan~PAR|Samangan~SAM|Sar-e Pol~SAR|Takhar~TAK|Urozgan~ORU|Zabul~ZAB"],["Åland Islands","AX","Brändö~BR|Eckerö~EC|Finström~FN|Föglö~FG|Geta~GT|Hammarland~HM|Jomala~JM|Kumlinge~KM|Kökar~KK|Lemland~LE|Lumparland~LU|Mariehamn~MH|Saltvik~SV|Sottunga~ST|Sund~SD|Vårdö~VR"],["Albania","AL","Berat~01|Dibër~09|Durrës~02|Elbasan~03|Fier~04|Gjirokastër~05|Korçë~06|Kukës~07|Lezhë~08|Shkodër~10|Tirana~11|Vlorë~12"],["Algeria","DZ","Adrar~01|Aïn Defla~44|Aïn Témouchent~46|Algiers~16|Annaba~23|Batna~05|Béchar~08|Béjaïa~06|Biskra~07|Blida~09|Bordj Bou Arréridj~34|Bouïra~10|Boumerdès~35|Chlef~02|Constantine~25|Djelfa~17|El Bayadh~32|El Oued~39|El Tarf~36|Ghardaïa~47|Guelma~24|Illizi~33|Jijel~18|Khenchela~40|Laghouat~03|Mascara~29|Médéa~26|Mila~43|Mostaganem~27|Msila~28|Naâma~45|Oran~31|Ouargla~30|Oum el Bouaghi~04|Relizane~48|Saïda~20|Sétif~19|Sidi Bel Abbès~22|Skikda~21|Souk Ahras~41|Tamanghasset~11|Tébessa~12|Tiaret~14|Tindouf~37|Tipaza~42|Tissemsilt~38|Tizi Ouzou~15|Tlemcen~13"],["American Samoa","AS","Tutuila~01|Aunu'u~02|Ta'ū~03|Ofu‑Olosega~04|Rose Atoll~21|Swains Island~22"],["Andorra","AD","Andorra la Vella~07|Canillo~02|Encamp~03|Escaldes-Engordany~08|La Massana~04|Ordino~05|Sant Julià de Lòria~06"],["Angola","AO","Bengo~BGO|Benguela~BGU|Bié~BIE|Cabinda~CAB|Cuando Cubango~CCU|Cuanza Norte~CNO|Cuanza Sul~CUS|Cunene~CNN|Huambo~HUA|Huíla~HUI|Luanda~LUA|Lunda Norte~LNO|Lunda Sul~LSU|Malanje~MAL|Moxico~MOX|Namibe~NAM|Uíge~UIG|Zaire~ZAI"],["Anguilla","AI","Anguilla~01|Anguillita Island~02|Blowing Rock~03|Cove Cay~04|Crocus Cay~05|Deadman's Cay~06|Dog Island~07|East Cay~08|Little Island~09|Little Scrub Island~10|Mid Cay~11|North Cay~12|Prickly Pear Cays~13|Rabbit Island~14|Sandy Island/Sand Island~15|Scilly Cay~16|Scrub Island~17|Seal Island~18|Sombrero/Hat Island~19|South Cay~20|South Wager Island~21|West Cay~22"],["Antarctica","AQ","Antarctica~AQ"],["Antigua and Barbuda","AG","Antigua Island~01|Barbuda Island~02|Bird Island~04|Bishop Island~05|Blake Island~06|Crump Island~09|Dulcina Island~10|Exchange Island~11|Five Islands~12|Great Bird Island~13|Green Island~14|Guiana Island~15|Hawes Island~17|Hells Gate Island~16|Henry Island~18|Johnson Island~19|Kid Island~20|Lobster Island~22|Maiden Island~24|Moor Island~25|Nanny Island~26|Pelican Island~27|Prickly Pear Island~28|Rabbit Island~29|Red Head Island~31|Redonda Island~03|Sandy Island~32|Smith Island~33|The Sisters~34|Vernon Island~35|Wicked Will Island~36|York Island~37"],["Argentina","AR","Buenos Aires~B|Capital Federal~C|Catamarca~K|Chaco~H|Chubut~U|Córdoba~X|Corrientes~W|Entre Ríos~E|Formosa~P|Jujuy~Y|La Pampa~L|La Rioja~F|Mendoza~M|Misiones~N|Neuquén~Q|Río Negro~R|Salta~A|San Juan~J|San Luis~D|Santa Cruz~Z|Santa Fe~S|Santiago del Estero~G|Tierra del Fuego~V|Tucumán~T"],["Armenia","AM","Aragatsotn~AG|Ararat~AR|Armavir~AV|Gegharkunik~GR|Kotayk~KT|Lori~LO|Shirak~SH|Syunik~SU|Tavush~TV|Vayots Dzor~VD|Yerevan~ER"],["Aruba","AW","Aruba~AW"],["Australia","AU","Australian Capital Territory~ACT|New South Wales~NSW|Northern Territory~NT|Queensland~QLD|South Australia~SA|Tasmania~TAS|Victoria~VIC|Western Australia~WA"],["Austria","AT","Burgenland~1|Kärnten~2|Niederösterreich~3|Oberösterreich~4|Salzburg~5|Steiermark~6|Tirol~7|Vorarlberg~8|Wien~9"],["Azerbaijan","AZ","Bakı~BA|Gəncə~GA|Lənkəran~LA|Mingəçevir~MI|Naftalan~NA|Naxçıvan~NV|Şəki~SA|Şirvan~SR|Sumqayit~SM|Xankəndi~XA|Yevlax~YE|Abşeron~ABS|Ağcabədi~AGC|Ağdam~AGM|Ağdaş~AGS|Ağstafa~AGA|Ağsu~AGU|Astara~AST|Babək~BAB|Balakən~BAL|Bərdə~BAR|Beyləqan~BEY|Biləsuvar~BIL|Cəbrayıl~CAB|Cəlilabad~CAL|Culfa~CUL|Daşkəsən~DAS|Füzuli~FUZ|Gədəbəy~GAD|Goranboy~GOR|Göyçay~GOY|Göygöl~GYG|Hacıqabul~HAC|İmişli~IMI|İsmayıllı~ISM|Kəlbəcər~KAL|Kǝngǝrli~KAN|Kürdəmir~KUR|Laçın~LAC|Lənkəran~LAN|Lerik~LER|Masallı~MAS|Neftçala~NEF|Oğuz~OGU|Ordubad~ORD|Qəbələ~QAB|Qax~QAX|Qazax~QAZ|Qobustan~QOB|Quba~QBA|Qubadli~QBI|Qusar~QUS|Saatlı~SAT|Sabirabad~SAB|Şabran~SBN|Sədərək~SAD|Şahbuz~SAH|Şəki~SAK|Salyan~SAL|Şamaxı~SMI|Şəmkir~SKR|Samux~SMX|Şərur~SAR|Siyəzən~SIY|Şuşa~SUS|Tərtər~TAR|Tovuz~TOV|Ucar~UCA|Xaçmaz~XAC|Xızı~XIZ|Xocalı~XCI|Xocavənd~XVD|Yardımlı~YAR|Yevlax~YEV|Zəngilan~ZAN|Zaqatala~ZAQ|Zərdab~ZAR"],["Bahamas","BS","Acklins Island~01|Berry Islands~22|Bimini~02|Black Point~23|Cat Island~03|Central Abaco~24|Crooked Island and Long Cay~28|East Grand Bahama~29|Exuma~04|Freeport~05|Fresh Creek~06|Governor's Harbour~07|Green Turtle Cay~08|Harbour Island~09|High Rock~10|Inagua~11|Kemps Bay~12|Long Island~13|Marsh Harbour~14|Mayaguana~15|Moore’s Island~40|New Providence~16|Nichollstown and Berry Islands~17|North Abaco~42|North Andros~41|North Eleuthera~33|Ragged Island~18|Rock Sound~19|San Salvador and Rum Cay~20|Sandy Point~21|South Abaco~35|South Andros~36|South Eleuthera~37|West Grand Bahama~39"],["Bahrain","BH","Al Janūbīyah~14|Al Manāmah~13|Al Muḩarraq~15|Al Wusţá~16|Ash Shamālīyah~17"],["Bangladesh","BD","Barisal~A|Chittagong~B|Dhaka~C|Khulna~D|Rajshahi~E|Rangpur~F|Sylhet~G"],["Barbados","BB","Christ Church~01|Saint Andrew~02|Saint George~03|Saint James~04|Saint John~05|Saint Joseph~06|Saint Lucy~07|Saint Michael~08|Saint Peter~09|Saint Philip~10|Saint Thomas~11"],["Belarus","BY","Brest voblast~BR|Gorod Minsk~HO|Homiel voblast~HO|Hrodna voblast~HR|Mahilyow voblast~MA|Minsk voblast~MI|Vitsebsk voblast~VI"],["Belgium","BE","Bruxelles-Capitale~BRU|Région Flamande~VLG|Région Wallonië~WAL"],["Belize","BZ","Belize District~BZ|Cayo District~CY|Corozal District~CZL|Orange Walk District~OW|Stann Creek District~SC|Toledo District~TOL"],["Benin","BJ","Alibori~AL|Atakora~AK|Atlantique~AQ|Borgou~BO|Collines Department~CO|Donga~DO|Kouffo~KO|Littoral Department~LI|Mono Department~MO|Ouémé~OU|Plateau~PL|Zou~ZO"],["Bermuda","BM","City of Hamilton~03|Devonshire Parish~01|Hamilton Parish~02|Paget Parish~04|Pembroke Parish~05|Sandys Parish~08|Smith's Parish~09|Southampton Parish~10|St. George's Parish~07|Town of St. George~06|Warwick Parish~11"],["Bhutan","BT","Bumthang~33|Chhukha~12|Dagana~22|Gasa~GA|Haa~13|Lhuntse~44|Mongar~42|Paro~11|Pemagatshel~43|Punakha~23|Samdrup Jongkhar~45|Samtse~14|Sarpang~31|Thimphu~15|Trashigang~41|Trashiyangtse~TY|Trongsa~32|Tsirang~21|Wangdue Phodrang~24|Zhemgang~34"],["Bolivia","BO","Beni~B|Chuquisaca~H|Cochabamba~C|La Paz~L|Oruro~O|Pando~N|Potosí~P|Santa Cruz~S|Tarija~T"],["Bonaire, Sint Eustatius and Saba","BQ","Bonaire~BO|Saba Isand~SA|Sint Eustatius~SE"],["Bosnia and Herzegovina","BA","Brčko Distrikt~BRC|Federacija Bosne i Hercegovine~BIH|Republika Srpska~SRP"],["Botswana","BW","Central~CE|Ghanzi~GH|Kgalagadi~KG|Kgatleng~KL|Kweneng~KW|North West~NW|North-East~NE|South East~SE|Southern~SO"],["Bouvet Island","BV","Bouvet Island~BV"],["Brazil","BR","Acre~AC|Alagoas~AL|Amapá~AP|Amazonas~AM|Bahia~BA|Ceará~CE|Distrito Federal~DF|Espírito Santo~ES|Goiás~GO|Maranhão~MA|Mato Grosso~MT|Mato Grosso do Sul~MS|Minas Gerais~MG|Para~PA|Paraiba~PB|Paraná~PR|Pernambuco~PE|Piauí~PI|Rio de Janeiro~RJ|Rio Grande do Norte~RN|Rio Grande do Sul~RS|Rondônia~RO|Roraima~RR|Santa Catarina~SC|Sao Paulo~SP|Sergipe~SE|Tocantins~TO"],["British Indian Ocean Territory","IO","British Indian Ocean Territory"],["Brunei Darussalam","BN","Belait~BE|Brunei Muara~BM|Temburong~TE|Tutong~TU"],["Bulgaria","BG","Blagoevgrad~01|Burgas~02|Dobrich~08|Gabrovo~07|Jambol~28|Khaskovo~26|Kjustendil~10|Kurdzhali~09|Lovech~11|Montana~12|Pazardzhik~13|Pernik~14|Pleven~15|Plovdiv~16|Razgrad~17|Ruse~18|Shumen~27|Silistra~19|Sliven~20|Smoljan~21|Sofija~23|Sofija-Grad~22|Stara Zagora~24|Turgovishhe~25|Varna~03|Veliko Turnovo~04|Vidin~05|Vraca~06"],["Burkina Faso","BF","Balé~BAL|Bam/Lake Bam~BAM|Banwa Province~BAN|Bazèga~BAZ|Bougouriba~BGR|Boulgou Province~BLG|Boulkiemdé~BLK|Comoé/Komoe~COM|Ganzourgou Province~GAN|Gnagna~GNA|Gourma Province~GOU|Houet~HOU|Ioba~IOB|Kadiogo~KAD|Kénédougou~KEN|Komondjari~KMD|Kompienga~KMP|Kossi Province~KOS|Koulpélogo~KOP|Kouritenga~KOT|Kourwéogo~KOW|Léraba~LER|Loroum~LOR|Mouhoun~MOU|Namentenga~NAM|Naouri/Nahouri~NAO|Nayala~NAY|Noumbiel~NOU|Oubritenga~OUB|Oudalan~OUD|Passoré~PAS|Poni~PON|Sanguié~SNG|Sanmatenga~SMT|Séno~SEN|Sissili~SIS|Soum~SOM|Sourou~SOR|Tapoa~TAP|Tui/Tuy~TUI|Yagha~YAG|Yatenga~YAT|Ziro~ZIR|Zondoma~ZON|Zoundwéogo~ZOU"],["Burundi","BI","Bubanza~BB|Bujumbura Mairie~BM|Bujumbura Rural~BL|Bururi~BR|Cankuzo~CA|Cibitoke~CI|Gitega~GI|Karuzi~KR|Kayanza~KY|Kirundo~KI|Makamba~MA|Muramvya~MU|Muyinga~MY|Mwaro~MW|Ngozi~NG|Rutana~RT|Ruyigi~RY"],["Cambodia","KH","Banteay Mean Cheay|Batdambang|Kampong Cham|Kampong Chhnang|Kampong Spoe|Kampong Thum|Kampot|Kandal|Kaoh Kong|Keb|Kracheh|Mondol Kiri|Otdar Mean Cheay|Pailin|Phnum Penh|Pouthisat|Preah Seihanu (Sihanoukville)|Preah Vihear|Prey Veng|Rotanah Kiri|Siem Reab|Stoeng Treng|Svay Rieng|Takev"],["Cameroon","CM","Adamaoua~AD|Centre~CE|Est~ES|Extrême-Nord~EN|Littoral~LT|Nord~NO|Nord-Ouest~NW|Ouest~OU|Sud~SU|Sud-Ouest~SW"],["Canada","CA","Alberta~AB|British Columbia~BC|Manitoba~MB|New Brunswick~NB|Newfoundland and Labrador~NL|Northwest Territories~NT|Nova Scotia~NS|Nunavut~NU|Ontario~ON|Prince Edward Island~PE|Quebec~QC|Saskatchewan~SK|Yukon~YT"],["Cape Verde","CV","Boa Vista~BV|Brava~BR|Calheta de São Miguel~CS|Maio~MA|Mosteiros~MO|Paúl~PA|Porto Novo~PN|Praia~PR|Ribeira Brava~RB|Ribeira Grande~RG|Sal~SL|Santa Catarina~CA|Santa Cruz~CR|São Domingos~SD|São Filipe~SF|São Nicolau~SN|São Vicente~SV|Tarrafal~TA|Tarrafal de São Nicolau~TS"],["Cayman Islands","KY","Creek|Eastern|Midland|South Town|Spot Bay|Stake Bay|West End|Western"],["Central African Republic","CF","Bamingui-Bangoran~BB|Bangui~BGF|Basse-Kotto~BK|Haute-Kotto~HK|Haut-Mbomou~HM|Kémo~KG|Lobaye~LB|Mambéré-Kadéï~HS|Mbomou~MB|Nana-Grebizi~10|Nana-Mambéré~NM|Ombella-M'Poko~MP|Ouaka~UK|Ouham~AC|Ouham Péndé~OP|Sangha-Mbaéré~SE|Vakaga~VK"],["Chad","TD","Batha|Biltine|Borkou-Ennedi-Tibesti|Chari-Baguirmi|Guera|Kanem|Lac|Logone Occidental|Logone Oriental|Mayo-Kebbi|Moyen-Chari|Ouaddai|Salamat|Tandjile"],["Chile","CL","Aisén del General Carlos Ibáñez del Campo~AI|Antofagasta~AN|Araucanía~AR|Arica y Parinacota~AP|Atacama~AT|Bío-Bío~BI|Coquimbo~CO|Libertador General Bernardo O'Higgins~LI|Los Lagos~LL|Los Ríos~LR|Magallanes y Antartica Chilena~MA|Marga-Marga~|Maule~ML|Región Metropolitana de Santiago~RM|Tarapacá~TA|Valparaíso~VS"],["China","CN","Anhui~34|Beijing~11|Chongqing~50|Fujian~35|Gansu~62|Guangdong~44|Guangxi~45|Guizhou~52|Hainan~46|Hebei~13|Heilongjiang~23|Henan~41|Hong Kong~91|Hubei~42|Hunan~43|Inner Mongolia~15|Jiangsu~32|Jiangxi~36|Jilin~22|Liaoning~21|Macau~92|Ningxia~64|Qinghai~63|Shaanxi~61|Shandong~37|Shanghai~31|Shanxi~14|Sichuan~51|Tianjin~12|Tibet~54|Xinjiang~65|Yunnan~53|Zhejiang~33"],["Christmas Island","CX","Christmas Island~CX"],["Cocos (Keeling) Islands","CC","Direction Island~DI|Home Island~HM|Horsburgh Island~HR|North Keeling Island~NK|South Island~SI|West Island~WI"],["Colombia","CO","Amazonas~AMA|Antioquia~ANT|Arauca~ARA|Archipiélago de San Andrés~SAP|Atlántico~ATL|Bogotá D.C.~DC|Bolívar~BOL|Boyacá~BOY|Caldas~CAL|Caquetá~CAQ|Casanare~CAS|Cauca~CAU|Cesar~CES|Chocó~CHO|Córdoba~COR|Cundinamarca~CUN|Guainía~GUA|Guaviare~GUV|Huila~HUI|La Guajira~LAG|Magdalena~MAG|Meta~MET|Nariño~NAR|Norte de Santander~NSA|Putumayo~PUT|Quindío~QUI|Risaralda~RIS|Santander~SAN|Sucre~SUC|Tolima~TOL|Valle del Cauca~VAC|Vaupés~VAU|Vichada~VID"],["Comoros","KM","Anjouan (Nzwani)|Domoni|Fomboni|Grande Comore (Njazidja)|Moheli (Mwali)|Moroni|Moutsamoudou"],["Congo, Republic of the (Brazzaville)","CG","Bouenza~11|Brazzaville~BZV|Cuvette~8|Cuvette-Ouest~15|Kouilou~5|Lékoumou~2|Likouala~7|Niari~9|Plateaux~14|Pointe-Noire~16|Pool~12|Sangha~13"],["Congo, the Democratic Republic of the (Kinshasa)","CD","Bandundu~BN|Bas-Congo~BC|Équateur~EQ|Kasaï-Occidental~KE|Kasaï-Oriental~KW|Katanga~KA|Kinshasa~KN|Maniema~MA|Nord-Kivu~NK|Orientale~OR|Sud-Kivu~SK"],["Cook Islands","CK","Aitutaki~01|Atiu~02|Avarua|Mangaia~03|Manihiki~04|Manuae~05|Mauke~06|Mitiaro~07|Nassau Island~08|Palmerston~09|Penrhyn~10|Pukapuka~11|Rakahanga~12|Rarotonga~13|Suwarrow~14|Takutea~15"],["Costa Rica","CR","Alajuela~2|Cartago~3|Guanacaste~5|Heredia~4|Limón~7|Puntarenas~6|San José~1"],["Côte d'Ivoire, Republic of","CI","Agnéby~16|Bafing~17|Bas-Sassandra~09|Denguélé~10|Dix-Huit Montagnes~06|Fromager~18|Haut-Sassandra~02|Lacs~07|Lagunes~01|Marahoué~12|Moyen-Cavally~19|Moyen-Comoé~05|N'zi-Comoé~11|Savanes~03|Sud-Bandama~15|Sud-Comoé~13|Vallée du Bandama~04|Worodougou~14|Zanzan~08"],["Croatia","HR","Bjelovarsko-Bilogorska Zupanija|Brodsko-Posavska Zupanija|Dubrovacko-Neretvanska Zupanija|Istarska Zupanija|Karlovacka Zupanija|Koprivnicko-Krizevacka Zupanija|Krapinsko-Zagorska Zupanija|Licko-Senjska Zupanija|Medimurska Zupanija|Osjecko-Baranjska Zupanija|Pozesko-Slavonska Zupanija|Primorsko-Goranska Zupanija|Sibensko-Kninska Zupanija|Sisacko-Moslavacka Zupanija|Splitsko-Dalmatinska Zupanija|Varazdinska Zupanija|Viroviticko-Podravska Zupanija|Vukovarsko-Srijemska Zupanija|Zadarska Zupanija|Zagreb|Zagrebacka Zupanija"],["Cuba","CU","Artemisa~15|Camagüey~09|Ciego de Ávila~08|Cienfuegos~06|Granma~12|Guantánamo~14|Holguín~11|Isla de la Juventud~99|La Habana~03|Las Tunas~10|Matanzas~04|Mayabeque~16|Pinar del Río~01|Sancti Spíritus~07|Santiago de Cuba~13|Villa Clara~05"],["Curaçao","CW","Curaçao~CW"],["Cyprus","CY","Ammochostos~04|Keryneia~05|Larnaka~03|Lefkosia~01|Lemesos~02|Pafos~05"],["Czech Republic","CZ","Hlavní město Praha~PR|Jihočeský kraj~JC|Jihomoravský kraj~JM|Karlovarský kraj~KA|Královéhradecký kraj~KR|Liberecký kraj~LI|Moravskoslezský kraj~MO|Olomoucký kraj~OL|Pardubický kraj~PA|Plzeňský kraj~PL|Středočeský kraj~ST|Ústecký kraj~US|Vysočina~VY|Zlínský kraj~ZL"],["Denmark","DK","Hovedstaden~84|Kujalleq~GL-KU|Midtjylland~82|Norderøerne~FO-01|Nordjylland~81|Østerø~FO-06|Qaasuitsup~GL-QA|Qeqqata~GL-QE|Sandø~FO-02|Sermersooq~GL-SM|Sjælland~85|Strømø~FO-03|Suderø~FO-04|Syddanmark~83|Vågø~FO-05"],["Djibouti","DJ","Ali Sabieh~AS|Arta~AR|Dikhil~DI|Obock~OB|Tadjourah~TA"],["Dominica","DM","Saint Andrew Parish~02|Saint David Parish~03|Saint George Parish~04|Saint John Parish~05|Saint Joseph Parish~06|Saint Luke Parish~07|Saint Mark Parish~08|Saint Patrick Parish~09|Saint Paul Parish~10|Saint Peter Parish~11"],["Dominican Republic","DO","Cibao Central~02|Del Valle~37|Distrito Nacional~01|Enriquillo~38|Norcentral~04|Nordeste~34|Noroeste~34|Norte~35|Valdesia~42"],["Ecuador","EC","Azuay~A|Bolívar~B|Cañar~F|Carchi~C|Chimborazo~H|Cotopaxi~X|El Oro~O|Esmeraldas~E|Galápagos~W|Guayas~G|Imbabura~I|Loja~L|Los Ríos~R|Manabí~M|Morona-Santiago~S|Napo~N|Orellana~D|Pastaza~Y|Pichincha~P|Santa Elena~SE|Santo Domingo de los Tsáchilas~SD|Sucumbíos~U|Tungurahua~T|Zamora-Chinchipe~Z"],["Egypt","EG","Alexandria~ALX|Aswan~ASN|Asyout~AST|Bani Sueif~BNS|Beheira~BH|Cairo~C|Daqahlia~DK|Dumiat~DT|El Bahr El Ahmar~BA|El Ismailia~IS|El Suez~SUZ|El Wadi El Gedeed~WAD|Fayoum~FYM|Gharbia~GH|Giza~SUZ|Helwan~HU|Kafr El Sheikh~KFS|Luxor~LX|Matrouh~MT|Menia~MN|Menofia~MNF|North Sinai~SIN|Port Said~PTS|Qalubia~KB|Qena~KN|Sharqia~SHR|Sixth of October~SU|Sohag~SHG|South Sinai~JS"],["El Salvador","SV","Ahuachapan|Cabanas|Chalatenango|Cuscatlan|La Libertad|La Paz|La Union|Morazan|San Miguel|San Salvador|San Vicente|Santa Ana|Sonsonate|Usulutan"],["Equatorial Guinea","GQ","Annobon|Bioko Norte|Bioko Sur|Centro Sur|Kie-Ntem|Litoral|Wele-Nzas"],["Eritrea","ER","Anseba~AN|Debub~DU|Debub-Keih-Bahri~DK|Gash-Barka~GB|Maekel~MA|Semien-Keih-Bahri~SK"],["Estonia","EE","Harjumaa (Tallinn)~37|Hiiumaa (Kardla)~39|Ida-Virumaa (Johvi)~44|Järvamaa (Paide)~41|Jõgevamaa (Jogeva)~49|Läänemaa~57|Lääne-Virumaa (Rakvere)~59|Pärnumaa (Parnu)~67|Põlvamaa (Polva)~65|Raplamaa (Rapla)~70|Saaremaa (Kuessaare)~74|Tartumaa (Tartu)~78|Valgamaa (Valga)~82|Viljandimaa (Viljandi)~84|Võrumaa (Voru)~86"],["Ethiopia","ET","Addis Ababa~AA|Afar~AF|Amhara~AM|Benshangul-Gumaz~BE|Dire Dawa~DD|Gambela~GA|Harari~HA|Oromia~OR|Somali~SO|Southern Nations Nationalities and People's Region~SN|Tigray~TI"],["Falkland Islands (Islas Malvinas)","FK","Falkland Islands (Islas Malvinas)"],["Faroe Islands","FO","Bordoy|Eysturoy|Mykines|Sandoy|Skuvoy|Streymoy|Suduroy|Tvoroyri|Vagar"],["Fiji","FJ","Central|Eastern|Northern|Rotuma|Western"],["Finland","FI","Ahvenanmaan lääni~AL|Etelä-Suomen lääni~ES|Itä-Suomen lääni~IS|Länsi-Suomen lääni~LS|Lapin lääni~LL|Oulun lääni~OL"],["France","FR","Alsace|Aquitaine|Auvergne|Basse-Normandie|Bourgogne|Bretagne|Centre|Champagne-Ardenne|Corse|Franche-Comte|Haute-Normandie|Ile-de-France|Languedoc-Roussillon|Limousin|Lorraine|Midi-Pyrenees|Nord-Pas-de-Calais|Pays de la Loire|Picardie|Poitou-Charentes|Provence-Alpes-Cote d'Azur|Rhone-Alpes"],["French Guiana","GF","French Guiana"],["French Polynesia","PF","Archipel des Marquises|Archipel des Tuamotu|Archipel des Tubuai|Iles du Vent|Iles Sous-le-Vent"],["French Southern and Antarctic Lands","TF","Adelie Land|Ile Crozet|Iles Kerguelen|Iles Saint-Paul et Amsterdam"],["Gabon","GA","Estuaire|Haut-Ogooue|Moyen-Ogooue|Ngounie|Nyanga|Ogooue-Ivindo|Ogooue-Lolo|Ogooue-Maritime|Woleu-Ntem"],["Gambia, The","GM","Banjul|Central River|Lower River|North Bank|Upper River|Western"],["Georgia","GE","Abashis|Abkhazia or Ap'khazet'is Avtonomiuri Respublika (Sokhumi)|Adigenis|Ajaria or Acharis Avtonomiuri Respublika (Bat'umi)|Akhalgoris|Akhalk'alak'is|Akhalts'ikhis|Akhmetis|Ambrolauris|Aspindzis|Baghdat'is|Bolnisis|Borjomis|Ch'khorotsqus|Ch'okhatauris|Chiat'ura|Dedop'listsqaros|Dmanisis|Dushet'is|Gardabanis|Gori|Goris|Gurjaanis|Javis|K'arelis|K'ut'aisi|Kaspis|Kharagaulis|Khashuris|Khobis|Khonis|Lagodekhis|Lanch'khut'is|Lentekhis|Marneulis|Martvilis|Mestiis|Mts'khet'is|Ninotsmindis|Onis|Ozurget'is|P'ot'i|Qazbegis|Qvarlis|Rust'avi|Sach'kheris|Sagarejos|Samtrediis|Senakis|Sighnaghis|T'bilisi|T'elavis|T'erjolis|T'et'ritsqaros|T'ianet'is|Tqibuli|Ts'ageris|Tsalenjikhis|Tsalkis|Tsqaltubo|Vanis|Zestap'onis|Zugdidi|Zugdidis"],["Germany","DE","Baden-Württemberg~BW|Bayern~BY|Berlin~BE|Brandenburg~BB|Bremen~HB|Hamburg~HH|Hessen~HE|Mecklenburg-Vorpommern~MV|Niedersachsen~NI|Nordrhein-Westfalen~NW|Rheinland-Pfalz~RP|Saarland~SL|Sachsen~SN|Sachsen-Anhalt~ST|Schleswig-Holstein~SH|Thüringen~TH"],["Ghana","GH","Ashanti|Brong-Ahafo|Central|Eastern|Greater Accra|Northern|Upper East|Upper West|Volta|Western"],["Gibraltar","GI","Gibraltar"],["Greece","GR","Aitolia kai Akarnania|Akhaia|Argolis|Arkadhia|Arta|Attiki|Ayion Oros (Mt. Athos)|Dhodhekanisos|Drama|Evritania|Evros|Evvoia|Florina|Fokis|Fthiotis|Grevena|Ilia|Imathia|Ioannina|Irakleion|Kardhitsa|Kastoria|Kavala|Kefallinia|Kerkyra|Khalkidhiki|Khania|Khios|Kikladhes|Kilkis|Korinthia|Kozani|Lakonia|Larisa|Lasithi|Lesvos|Levkas|Magnisia|Messinia|Pella|Pieria|Preveza|Rethimni|Rodhopi|Samos|Serrai|Thesprotia|Thessaloniki|Trikala|Voiotia|Xanthi|Zakinthos"],["Greenland","GL","Avannaa (Nordgronland)|Kitaa (Vestgronland)|Tunu (Ostgronland)"],["Grenada","GD","Carriacou and Petit Martinique|Saint Andrew|Saint David|Saint George|Saint John|Saint Mark|Saint Patrick"],["Guadeloupe","GP","Basse-Terre|Grande-Terre|Iles de la Petite Terre|Iles des Saintes|Marie-Galante"],["Guam","GU","Guam"],["Guatemala","GT","Alta Verapaz|Baja Verapaz|Chimaltenango|Chiquimula|El Progreso|Escuintla|Guatemala|Huehuetenango|Izabal|Jalapa|Jutiapa|Peten|Quetzaltenango|Quiche|Retalhuleu|Sacatepequez|San Marcos|Santa Rosa|Solola|Suchitepequez|Totonicapan|Zacapa"],["Guernsey","GG","Castel|Forest|St. Andrew|St. Martin|St. Peter Port|St. Pierre du Bois|St. Sampson|St. Saviour|Torteval|Vale"],["Guinea","GN","Beyla|Boffa|Boke|Conakry|Coyah|Dabola|Dalaba|Dinguiraye|Dubreka|Faranah|Forecariah|Fria|Gaoual|Gueckedou|Kankan|Kerouane|Kindia|Kissidougou|Koubia|Koundara|Kouroussa|Labe|Lelouma|Lola|Macenta|Mali|Mamou|Mandiana|Nzerekore|Pita|Siguiri|Telimele|Tougue|Yomou"],["Guinea-Bissau","GW","Bafata|Biombo|Bissau|Bolama-Bijagos|Cacheu|Gabu|Oio|Quinara|Tombali"],["Guyana","GY","Barima-Waini|Cuyuni-Mazaruni|Demerara-Mahaica|East Berbice-Corentyne|Essequibo Islands-West Demerara|Mahaica-Berbice|Pomeroon-Supenaam|Potaro-Siparuni|Upper Demerara-Berbice|Upper Takutu-Upper Essequibo"],["Haiti","HT","Artibonite|Centre|Grand'Anse|Nord|Nord-Est|Nord-Ouest|Ouest|Sud|Sud-Est"],["Heard Island and McDonald Islands","HM","Heard Island and McDonald Islands"],["Holy See (Vatican City)","VA","Holy See (Vatican City)~01"],["Honduras","HN","Atlantida|Choluteca|Colon|Comayagua|Copan|Cortes|El Paraiso|Francisco Morazan|Gracias a Dios|Intibuca|Islas de la Bahia|La Paz|Lempira|Ocotepeque|Olancho|Santa Barbara|Valle|Yoro"],["Hong Kong","HK","Hong Kong"],["Hungary","HU","Bacs-Kiskun|Baranya|Bekes|Bekescsaba|Borsod-Abauj-Zemplen|Budapest|Csongrad|Debrecen|Dunaujvaros|Eger|Fejer|Gyor|Gyor-Moson-Sopron|Hajdu-Bihar|Heves|Hodmezovasarhely|Jasz-Nagykun-Szolnok|Kaposvar|Kecskemet|Komarom-Esztergom|Miskolc|Nagykanizsa|Nograd|Nyiregyhaza|Pecs|Pest|Somogy|Sopron|Szabolcs-Szatmar-Bereg|Szeged|Szekesfehervar|Szolnok|Szombathely|Tatabanya|Tolna|Vas|Veszprem|Veszprem|Zala|Zalaegerszeg"],["Iceland","IS","Akranes|Akureyri|Arnessysla|Austur-Bardhastrandarsysla|Austur-Hunavatnssysla|Austur-Skaftafellssysla|Borgarfjardharsysla|Dalasysla|Eyjafjardharsysla|Gullbringusysla|Hafnarfjordhur|Husavik|Isafjordhur|Keflavik|Kjosarsysla|Kopavogur|Myrasysla|Neskaupstadhur|Nordhur-Isafjardharsysla|Nordhur-Mulasys-la|Nordhur-Thingeyjarsysla|Olafsfjordhur|Rangarvallasysla|Reykjavik|Saudharkrokur|Seydhisfjordhur|Siglufjordhur|Skagafjardharsysla|Snaefellsnes-og Hnappadalssysla|Strandasysla|Sudhur-Mulasysla|Sudhur-Thingeyjarsysla|Vesttmannaeyjar|Vestur-Bardhastrandarsysla|Vestur-Hunavatnssysla|Vestur-Isafjardharsysla|Vestur-Skaftafellssysla"],["India","IN","Andaman and Nicobar Islands|Andhra Pradesh|Arunachal Pradesh|Assam|Bihar|Chandigarh|Chhattisgarh|Dadra and Nagar Haveli|Daman and Diu|Delhi|Goa|Gujarat|Haryana|Himachal Pradesh|Jammu and Kashmir|Jharkhand|Karnataka|Kerala|Lakshadweep|Madhya Pradesh|Maharashtra|Manipur|Meghalaya|Mizoram|Nagaland|Orissa|Pondicherry|Punjab|Rajasthan|Sikkim|Tamil Nadu|Tripura|Uttar Pradesh|Uttaranchal|West Bengal"],["Indonesia","ID","Aceh|Bali|Banten|Bengkulu|East Timor|Gorontalo|Jakarta Raya|Jambi|Jawa Barat|Jawa Tengah|Jawa Timur|Kalimantan Barat|Kalimantan Selatan|Kalimantan Tengah|Kalimantan Timur|Kepulauan Bangka Belitung|Kepulauan Riau|Lampung|Maluku|Maluku Utara|Nusa Tenggara Barat|Nusa Tenggara Timur|Papua|Papua Barat|Riau|Sulawesi Selatan|Sulawesi Tengah|Sulawesi Tenggara|Sulawesi Utara|Sumatera Barat|Sumatera Selatan|Sumatera Utara|Yogyakarta"],["Iran, Islamic Republic of","IR","Ardabil|Azarbayjan-e Gharbi|Azarbayjan-e Sharqi|Bushehr|Chahar Mahall va Bakhtiari|Esfahan|Fars|Gilan|Golestan|Hamadan|Hormozgan|Ilam|Kerman|Kermanshah|Khorasan|Khuzestan|Kohgiluyeh va Buyer Ahmad|Kordestan|Lorestan|Markazi|Mazandaran|Qazvin|Qom|Semnan|Sistan va Baluchestan|Tehran|Yazd|Zanjan"],["Iraq","IQ","Al Anbar|Al Basrah|Al Muthanna|Al Qadisiyah|An Najaf|Arbil|As Sulaymaniyah|At Ta'mim|Babil|Baghdad|Dahuk|Dhi Qar|Diyala|Karbala'|Maysan|Ninawa|Salah ad Din|Wasit"],["Ireland","IE","Carlow|Cavan|Clare|Cork|Donegal|Dublin|Galway|Kerry|Kildare|Kilkenny|Laois|Leitrim|Limerick|Longford|Louth|Mayo|Meath|Monaghan|Offaly|Roscommon|Sligo|Tipperary|Waterford|Westmeath|Wexford|Wicklow"],["Isle of Man","IM","Isle of Man"],["Israel","IL","Central|Haifa|Jerusalem|Northern|Southern|Tel Aviv"],["Italy","IT","Abruzzo|Basilicata|Calabria|Campania|Emilia-Romagna|Friuli-Venezia Giulia|Lazio|Liguria|Lombardia|Marche|Molise|Piemonte|Puglia|Sardegna|Sicilia|Toscana|Trentino-Alto Adige|Umbria|Valle d'Aosta|Veneto"],["Jamaica","JM","Clarendon|Hanover|Kingston|Manchester|Portland|Saint Andrew|Saint Ann|Saint Catherine|Saint Elizabeth|Saint James|Saint Mary|Saint Thomas|Trelawny|Westmoreland"],["Japan","JP","Aichi|Akita|Aomori|Chiba|Ehime|Fukui|Fukuoka|Fukushima|Gifu|Gumma|Hiroshima|Hokkaido|Hyogo|Ibaraki|Ishikawa|Iwate|Kagawa|Kagoshima|Kanagawa|Kochi|Kumamoto|Kyoto|Mie|Miyagi|Miyazaki|Nagano|Nagasaki|Nara|Niigata|Oita|Okayama|Okinawa|Osaka|Saga|Saitama|Shiga|Shimane|Shizuoka|Tochigi|Tokushima|Tokyo|Tottori|Toyama|Wakayama|Yamagata|Yamaguchi|Yamanashi"],["Jersey","JE","Jersey"],["Jordan","JO","'Amman|Ajlun|Al 'Aqabah|Al Balqa'|Al Karak|Al Mafraq|At Tafilah|Az Zarqa'|Irbid|Jarash|Ma'an|Madaba"],["Kazakhstan","KZ","Almaty|Aqmola|Aqtobe|Astana|Atyrau|Batys Qazaqstan|Bayqongyr|Mangghystau|Ongtustik Qazaqstan|Pavlodar|Qaraghandy|Qostanay|Qyzylorda|Shyghys Qazaqstan|Soltustik Qazaqstan|Zhambyl"],["Kenya","KE","Central|Coast|Eastern|Nairobi Area|North Eastern|Nyanza|Rift Valley|Western"],["Kiribati","KI","Abaiang|Abemama|Aranuka|Arorae|Banaba|Banaba|Beru|Butaritari|Central Gilberts|Gilbert Islands|Kanton|Kiritimati|Kuria|Line Islands|Line Islands|Maiana|Makin|Marakei|Nikunau|Nonouti|Northern Gilberts|Onotoa|Phoenix Islands|Southern Gilberts|Tabiteuea|Tabuaeran|Tamana|Tarawa|Tarawa|Teraina"],["Korea, Democratic People's Republic of","KP","Chagang-do (Chagang Province)|Hamgyong-bukto (North Hamgyong Province)|Hamgyong-namdo (South Hamgyong Province)|Hwanghae-bukto (North Hwanghae Province)|Hwanghae-namdo (South Hwanghae Province)|Kaesong-si (Kaesong City)|Kangwon-do (Kangwon Province)|Namp'o-si (Namp'o City)|P'yongan-bukto (North P'yongan Province)|P'yongan-namdo (South P'yongan Province)|P'yongyang-si (P'yongyang City)|Yanggang-do (Yanggang Province)"],["Korea, Republic of","KR","Ch'ungch'ong-bukto|Ch'ungch'ong-namdo|Cheju-do|Cholla-bukto|Cholla-namdo|Inch'on-gwangyoksi|Kangwon-do|Kwangju-gwangyoksi|Kyonggi-do|Kyongsang-bukto|Kyongsang-namdo|Pusan-gwangyoksi|Soul-t'ukpyolsi|Taegu-gwangyoksi|Taejon-gwangyoksi|Ulsan-gwangyoksi"],["Kuwait","KW","Al 'Asimah|Al Ahmadi|Al Farwaniyah|Al Jahra'|Hawalli"],["Kyrgyzstan","KG","Batken Oblasty|Bishkek Shaary|Chuy Oblasty (Bishkek)|Jalal-Abad Oblasty|Naryn Oblasty|Osh Oblasty|Talas Oblasty|Ysyk-Kol Oblasty (Karakol)"],["Laos","LA","Vientiane~VT|Attapu!(Attopeu)~AT|Bokèo~BK|Bolikhamxai!(Borikhane)~BL|Champasak!(Champassak)~CH|Houaphan~HO|Khammouan~KH|Louang!Namtha~LM|Louangphabang!(Louang!Prabang)~LP|Oudômxai!(Oudomsai)~OU|Phôngsali!(Phong!Saly)~PH|Salavan!(Saravane)~SL|Savannakhét~SV|Vientiane~VI|Xaignabouli~XA|Xékong!(Sékong)~XE|Xiangkhoang!(Xieng!Khouang)~XI|Xaisômboun~XN"],["Latvia","LV","Aizkraukles Rajons|Aluksnes Rajons|Balvu Rajons|Bauskas Rajons|Cesu Rajons|Daugavpils|Daugavpils Rajons|Dobeles Rajons|Gulbenes Rajons|Jekabpils Rajons|Jelgava|Jelgavas Rajons|Jurmala|Kraslavas Rajons|Kuldigas Rajons|Leipaja|Liepajas Rajons|Limbazu Rajons|Ludzas Rajons|Madonas Rajons|Ogres Rajons|Preilu Rajons|Rezekne|Rezeknes Rajons|Riga|Rigas Rajons|Saldus Rajons|Talsu Rajons|Tukuma Rajons|Valkas Rajons|Valmieras Rajons|Ventspils|Ventspils Rajons"],["Lebanon","LB","Beyrouth|Ech Chimal|Ej Jnoub|El Bekaa|Jabal Loubnane"],["Lesotho","LS","Berea|Butha-Buthe|Leribe|Mafeteng|Maseru|Mohales Hoek|Mokhotlong|Qacha's Nek|Quthing|Thaba-Tseka"],["Liberia","LR","Bomi|Bong|Grand Bassa|Grand Cape Mount|Grand Gedeh|Grand Kru|Lofa|Margibi|Maryland|Montserrado|Nimba|River Cess|Sinoe"],["Libya","LY","Ajdabiya|Al 'Aziziyah|Al Fatih|Al Jabal al Akhdar|Al Jufrah|Al Khums|Al Kufrah|An Nuqat al Khams|Ash Shati'|Awbari|Az Zawiyah|Banghazi|Darnah|Ghadamis|Gharyan|Misratah|Murzuq|Sabha|Sawfajjin|Surt|Tarabulus|Tarhunah|Tubruq|Yafran|Zlitan"],["Liechtenstein","LI","Balzers|Eschen|Gamprin|Mauren|Planken|Ruggell|Schaan|Schellenberg|Triesen|Triesenberg|Vaduz"],["Lithuania","LT","Akmenes Rajonas|Alytaus Rajonas|Alytus|Anyksciu Rajonas|Birstonas|Birzu Rajonas|Druskininkai|Ignalinos Rajonas|Jonavos Rajonas|Joniskio Rajonas|Jurbarko Rajonas|Kaisiadoriu Rajonas|Kaunas|Kauno Rajonas|Kedainiu Rajonas|Kelmes Rajonas|Klaipeda|Klaipedos Rajonas|Kretingos Rajonas|Kupiskio Rajonas|Lazdiju Rajonas|Marijampole|Marijampoles Rajonas|Mazeikiu Rajonas|Moletu Rajonas|Neringa Pakruojo Rajonas|Palanga|Panevezio Rajonas|Panevezys|Pasvalio Rajonas|Plunges Rajonas|Prienu Rajonas|Radviliskio Rajonas|Raseiniu Rajonas|Rokiskio Rajonas|Sakiu Rajonas|Salcininku Rajonas|Siauliai|Siauliu Rajonas|Silales Rajonas|Silutes Rajonas|Sirvintu Rajonas|Skuodo Rajonas|Svencioniu Rajonas|Taurages Rajonas|Telsiu Rajonas|Traku Rajonas|Ukmerges Rajonas|Utenos Rajonas|Varenos Rajonas|Vilkaviskio Rajonas|Vilniaus Rajonas|Vilnius|Zarasu Rajonas"],["Luxembourg","LU","Diekirch|Grevenmacher|Luxembourg"],["Macao","MO","Macao"],["Macedonia, Former Yugoslav Republic of","MK","Aracinovo|Bac|Belcista|Berovo|Bistrica|Bitola|Blatec|Bogdanci|Bogomila|Bogovinje|Bosilovo|Brvenica|Cair (Skopje)|Capari|Caska|Cegrane|Centar (SkopjeZupa|Cesinovo|Cucer-Sandevo|Debar|Delcevo|Delogozdi|Demir Hisar|Demir Kapija|Dobrusevo|Dolna Banjica|Dolneni|Dorce Petrov (Skopje)Dzepciste|Gazi Baba (Skopje)|Gevgelija|Gostivar|Gradsko|Ilinden|Izvor|Jegunovce|Kamenjane|Karbinci|Karpos (Skopje)|Kavadarci|Kicevo|Kisela Voda (lecevce|Kocani|Konce|Kondovo|Konopiste|Kosel|Kratovo|Kriva rivogastani|Krusevo|Kuklis|Kukurecani|Kumanovo|Labunista|Lipkovo|Lozovo|Lukovo|Makedonska Kamenica|Makedonski Brod|Mavrovi eista|Miravci|Mogila|Murtino|Negotino|Negotino-Poloska|Novaci|Novo Selo|Oblesevo|Ohrid|Orasac|Orizari|Oslomej|Pehcevo|Petrovec|Plasnia|Podares|Prilepp|Radovis|Rankovce|Resen|Rosoman|Rostusa|Samokov|Saraj|Sipkovica|Sopiste|Sopotnika|Srbinovo|Star Dojran|Staravina|Staro e|Stip|Struga|Strumica|Studenicani|Suto Orizari (Skopje)|Sveti Nikole|Tearce|Tetovo|Topolcani|Valandovo|Vasilevo|Veles|Velesta|Vevcani|Vinica|Vitolistica|Vrapciste|Vratnica|Vrutok|Zajas|Zelenikovo|Zileno|Zitose|Zletovo|Zrnovci"],["Madagascar","MG","Antananarivo|Antsiranana|Fianarantsoa|Mahajanga|Toamasina|Toliara"],["Malawi","MW","Balaka|Blantyre|Chikwawa|Chiradzulu|Chitipa|Dedza|Dowa|Karonga|Kasungu|Likoma|Lilongwe|Machinga (Kasupe)|Mchinji|Mulanje|Mwanza|Mzimba|Nkhata Bay|Nkhotakota|Nsanje|Ntcheu|Ntchisi|Phalombe|Rumphi|Salima|Thyolo|Zomba"],["Malaysia","MY","Johor|Kedah|Kelantan|Labuan|Melaka|Negeri Sembilan|Pahang|Perak|Perlis|Pulau Pinang|Sabah|Sarawak|Selangor|Terengganu|Wilayah Persekutuan"],["Maldives","MV","Alifu|Baa|Dhaalu|Faafu|Gaafu Alifu|Gaafu Dhaalu|Gnaviyani|Haa Alifu|Haa afu|Laamu|Lhaviyani|Maale|Meemu|Noonu|Raa|Seenu|Shaviyani|Thaa|Vaavu"],["Mali","ML","Gao|Kayes|Kidal|Koulikoro|Mopti|Segou|Sikasso|Tombouctou"],["Malta","MT","Valletta"],["Marshall Islands","MH","Ailinginae|Ailinglaplap|Ailuk|Arno|Aur|Bikar|Bikini|Bokak|Ebon|Enewetak|Erikub|Jabat|Jaluit|Jemo|Kili|Kwajalein|Lae|Lib|Likiep|Majuro|Maloelap|Mejitorik|Namu|Rongelap|Rongrik|Toke|Ujae|Ujelang|Utirik|Wotho|Wotje"],["Martinique","MQ","Martinique"],["Mauritania","MR","Adrar|Assaba|Brakna|Dakhlet Nouadhibou|Gorgol|Guidimaka|Hodh Ech Chargui|Hodh El Gharbi|Inchiri|Nouakchott|Tagant|Tiris Zemmour|Trarza"],["Mauritius","MU","Agalega Islands|Black River|Cargados Carajos Shoals|Flacq|Grand Port|Moka|Pamplemousses|Plaines Wilhems|Port Louis|Riviere du odrigues|Savanne"],["Mayotte","YT","Dzaoudzi~01|Pamandzi~02|Mamoudzou~03|Dembeni~04|Bandrélé~05|Kani-Kéli~06|Bouéni~07|Chirongui~08|Sada~09|Ouangani~10|Chiconi~11|Tsingoni~12|M'Tsangamouji~13|Acoua~14|Mtsamboro~15|Bandraboua~16|Koungou~17"],["Mexico","MX","Aguascalientes|Baja California|Baja California Sur|Campeche|Chiapas|Chihuahua|Coahuila de Zaragoza|Colima|Distrito Federal|Durango|Guanajuato|Guerrero|Hidalgo|Jalisco|Mexico|Michoacan de Ocampo|Morelos|Nayarit|Nuevo Leon|Oaxaca|Puebla|Queretaro de Arteaga|Quintana Roo|San si|Sinaloa|Sonora|Tabasco|Tamaulipas|Tlaxcala|Veracruz-Llave|Yucatan|Zacatecas"],["Micronesia, Federated States of","FM","Chuuk (Truk)|Kosrae|Pohnpei|Yap"],["Moldova","MD","Balti|Cahul|Chisinau|Chisinau|Dubasari|Edinet|Gagauzia|Lapusna|Orhei|Soroca|Tighina|Ungheni"],["Monaco","MC","Fontvieille|La Condamine|Monaco-Ville|Monte-Carlo"],["Mongolia","MN","Arhangay|Bayan-Olgiy|Bayanhongor|Bulgan|Darhan|Dornod|Dornogovi|Dundgovi|Dzavhan|Erdenet|Govi-tiy|Hovd|Hovsgol|Omnogovi|Ovorhangay|Selenge|Suhbaatar|Tov|Ulaanbaatar|Uvs"],["Montenegro","ME","Andrijevica|Bar|Berane|Bijelo Polje|Budva|Cetinje|Danilovgrad|Herceg Novi|Kolašin|Kotor|Mojkovac|Nikšić|Plav|Plužine|Pljevlja|Podgorica|Golubovci|Tuzi|Rožaje|Šavnik|Tivat|Ulcinj|Žablja"],["Montserrat","MS","Saint Anthony|Saint Georges|Saint Peter's"],["Morocco","MA","Agadir|Al Hoceima|Azilal|Ben Slimane|Beni Mellal|Boulemane|Casablanca|Chaouen|El Jadida|El Kelaa des Srarhna|Er Essaouira|Fes|Figuig|Guelmim|Ifrane|Kenitra|Khemisset|Khenifra|Khouribga|Laayoune|Larache|Marrakech|Meknes|Nador|Ouarzazate|Oujda|Rabat-|Settat|Sidi Kacem|Tan-Tan|Tanger|Taounate|Taroudannt|Tata|Taza|Tetouan|Tiznit"],["Mozambique","MZ","Cabo Delgado|Gaza|Inhambane|Manica|Maputo|Nampula|Niassa|Sofala|Tete|Zambezia"],["Myanmar","MM","Ayeyarwady Region|Bago Region|Chin State|Kachin State|Kayah State|Kayin State|Magway Region|Mandalay Region|Mon State|Rakhine State|Shan State|Sagaing Region|Tanintharyi Region|Yangon Region|Naypyidaw Union Territory|Danu Self-Administered Zone|Kokang Self-Administered Zone|Naga Self-Administered Zone|Pa-O Self-Administered Zone|Pa Laung Self-Administered Zone|Wa Self-Administered Division"],["Namibia","NA","Caprivi|Erongo|Hardap|Karas|Khomas|Kunene|Ohangwena|Okavango|Omaheke|Omusati|Oshana|Oshikoto|Otjozondjupa"],["Nauru","NR","Aiwo|Anabar|Anetan|Anibare|Baiti|Boe|Buada|Denigomodu|Ewa|Ijuw|Meneng|Nibok|Uaboe|Yaren"],["Nepal","NP","Bagmati|Bheri|Dhawalagiri|Gandaki|Janakpur|Karnali|Kosi|Lumbini|Mahakali|Mechi|Narayani|Rapti|Sagarmatha|Seti"],["Netherlands","NL","Drenthe|Flevoland|Friesland|Gelderland|Groningen|Limburg|Noord-Brabant|Noord-Holland|Overijssel|Utrecht|Zeeland|Zuid-Holland"],["New Caledonia","NC","Iles Loyaute|Nord|Sud"],["New Zealand","NZ","Auckland (Tāmaki-makau-rau)~AUK|Bay of Plenty (Te Moana a Toi Te Huatahi)~BOP|Canterbury (Waitaha)~CAN|Hawke's Bay (Te Matau a Māui)~HKB|Manawatu-Wanganui (Manawatu Whanganui)~MWT|Northland (Te Tai tokerau)~NTL|Otago (Ō Tākou)~OTA|Southland (Murihiku)~STL|Taranaki (Taranaki)~TKI|Waikato~WKO|Wellington (Te Whanga-nui-a-Tara)~WGN|West Coast (Te Taihau ā uru)~WTC|Gisborne District (Tūranga nui a Kiwa)~GIS|Marlborough District~MBH|Nelson City (Whakatū)~NSN|Tasman District~TAS|Chatham Islands Territory (Wharekauri)~CIT"],["Nicaragua","NI","Boaco~BO|Carazo~CA|Chinandega~CI|Chontales~CO|Estelí~ES|Granada~GR|Jinotega~JI|León~LE|Madriz~MD|Managua~MN|Masaya~MS|Matagalpa~MT|Nueva Segovia~NS|Río San Juan~SJ|Rivas~RI|Atlántico Norte~AN|Atlántico Sur~AS"],["Niger","NE","Agadez|Diffa|Dosso|Maradi|Niamey|Tahoua|Tillaberi|Zinder"],["Nigeria","NG","Abia|Abuja Federal Capital Territory|Adamawa|Akwa Ibom|Anambra|Bauchi|Bayelsa|Benue|Borno|Cross River|Delta|Ebonyi|Edo|Ekiti|Enugu|Gombe|Imo|Jigawa|no|Katsina|Kebbi|Kogi|Kwara|Lagos|Nassarawa|Niger|Ogun|Ondo|Osun|Oyo|Plateau|Rivers|Sokoto|Taraba|Yobe|Zamfara"],["Niue","NU","Niue"],["Norfolk Island","NF","Norfolk Island"],["Northern Mariana Islands","MP","Northern Islands|Rota|Saipan|Tinian"],["Norway","NO","Akershus~02|Aust-Agder~09|Buskerud~06|Finnmark~20|Hedmark~04|Hordaland~12|Møre og Romsdal~15|Nordland~18|Nord-Trøndelag~17|Oppland~05|Oslo~03|Rogaland~11|Sogn og Fjordane~14|Sør-Trøndelag~16|Telemark~08|Troms~19|Vest-Agder~10|Vestfold~07|Østfold~01|Jan Mayen~22|Svalbard~21"],["Oman","OM","Ad Dakhiliyah|Al Batinah|Al Wusta|Ash Sharqiyah|Az Zahirah|Masqat|Musandam|Zufar"],["Pakistan","PK","Balochistan|Federally Administered Tribal Areas|Islamabad Capital Territory|North-West Frontier Province|Punjab|Sindh"],["Palau","PW","Aimeliik|Airai|Angaur|Hatobohei|Kayangel|Koror|Melekeok|Ngaraard|Ngarchelong|Ngardmau|Ngatpang|Ngchesar|Ngeremlengui|Ngiwal|Palau leliu|Sonsoral|Tobi"],["Palestine, State of","PS","Palestine"],["Panama","PA","Bocas del Toro|Chiriqui|Cocle|Colon|Darien|Herrera|Los Santos|Panama|San Blas|Veraguas"],["Papua New Guinea","PG","Bougainville|Central|Chimbu|East New Britain|East Sepik|Eastern Highlands|Enga|Gulf|Madang|Manus|Milne Bay|Morobe|National Capital|New orthern|Sandaun|Southern Highlands|West New Britain|Western|Western Highlands"],["Paraguay","PY","Alto Paraguay|Alto Parana|Amambay|Asuncion (city)|Caaguazu|Caazapa|Canindeyu|Central|Concepcion|Cordillera|Guaira|Itapua|Misiones|Neembucu|Paraguari|Presidente Hayes|San Pedro"],["Peru","PE","Amazonas|Ancash|Apurimac|Arequipa|Ayacucho|Cajamarca|Callao|Cusco|Huancavelica|Huanuco|Ica|Junin|La Libertad|Lambayeque|Lima|Loreto|Madre de egua|Pasco|Piura|Puno|San Martin|Tacna|Tumbes|Ucayali"],["Philippines","PH","Abra|Agusan del Norte|Agusan del Sur|Aklan|Albay|Angeles|Antique|Aurora|Bacolod|Bago|Baguio|Bais|Basilan|Basilan an|Batanes|Batangas|Batangas City|Benguet|Bohol|Bukidnon|Bulacan|Butuan|Cabanatuan|Cadiz|Cagayan|Cagayan de Oro|Calbayog|Caloocan|Camarines arines Sur|Camiguin|Canlaon|Capiz|Catanduanes|Cavite|Cavite City|Cebu|Cebu City|Cotabato|Dagupan|Danao|Dapitan|Davao City Davao|Davao del Sur|Davao Dipolog|Dumaguete|Eastern Samar|General Santos|Gingoog|Ifugao|Iligan|Ilocos Norte|Ilocos Sur|Iloilo|Iloilo City|Iriga|Isabela|Kalinga-Apayao|La a Union|Laguna|Lanao del Norte|Lanao del Sur|Laoag|Lapu-Lapu|Legaspi|Leyte|Lipa|Lucena|Maguindanao|Mandaue|Manila|Marawi|Marinduque|Masbate|Mindoro l|Mindoro Oriental|Misamis Occidental|Misamis Oriental|Mountain|Naga|Negros Occidental|Negros Oriental|North Cotabato|Northern Samar|Nueva va Vizcaya|Olongapo|Ormoc|Oroquieta|Ozamis|Pagadian|Palawan|Palayan|Pampanga|Pangasinan|Pasay|Puerto Princesa|Quezon|Quezon ino|Rizal|Romblon|Roxas|Samar|San Carlos (in Negros Occidental)|San Carlos (in Pangasinan)|San Jose|San Pablo|Silay|Siquijor|Sorsogon|South Southern Leyte|Sultan Kudarat|Sulu|Surigao|Surigao del Norte|Surigao del Sur|Tacloban|Tagaytay|Tagbilaran|Tangub|Tarlac|Tawitawi|Toledo|Trece Zambales|Zamboanga|Zamboanga del Norte|Zamboanga del Sur"],["Pitcairn","PN","Pitcairn Islands"],["Poland","PL","Dolnoslaskie|Kujawsko-|Lodzkie|Lubelskie|Lubuskie|Malopolskie|Mazowieckie|Opolskie|Podkarpackie|Podlaskie|Pomorskie|Slaskie|Swietokrzyskie|Warminsko-|Wielkopolskie|Zachodniopomorskie"],["Portugal","PT","Acores (Azores)|Aveiro|Beja|Braga|Braganca|Castelo Branco|Coimbra|Evora|Faro|Guarda|Leiria|Lisboa|Madeira|Portalegre|Porto|Santarem|Setubal|Viana o|Vila Real|Viseu"],["Puerto Rico","PR","Adjuntas|Aguada|Aguadilla|Aguas Buenas|Aibonito|Anasco|Arecibo|Arroyo|Barceloneta|Barranquitas|Bayamon|Cabo Rojo|Caguas|Camuy|Canovanas|Carolina|Cat|Ceiba|Ciales|Cidra|Coamo|Comerio|Corozal|Culebra|Dorado|Fajardo|Florida|Guanica|Guayama|Guayanilla|Guaynabo|Gurabo|Hatillo|Hormigueros|Humacao|Isabe|Juana Diaz|Juncos|Lajas|Lares|Las Marias|Las oiza|Luquillo|Manati|Maricao|Maunabo|Mayaguez|Moca|Morovis|Naguabo|Naranjito|Orocovis|Patillas|Penuelas|Ponce|Quebradillas|Rincon|Rio Grande|Sabana linas|San German|San Juan|San Lorenzo|San Sebastian|Santa Isabel|Toa Alta|Toa Baja|Trujillo Alto|Utuado|Vega Alta|Vega ues|Villalba|Yabucoa|Yauco"],["Qatar","QA","Ad Dawhah|Al Ghuwayriyah|Al Jumayliyah|Al Khawr|Al Wakrah|Ar Rayyan|Jarayan al Batinah|Madinat ash Shamal|Umm Salal"],["Réunion","RE","Réunion"],["Romania","RO","Alba|Arad|Arges|Bacau|Bihor|Bistrita-Nasaud|Botosani|Braila|Brasov|Bucuresti|Buzau|Calarasi|Caras-luj|Constanta|Covasna|Dimbovita|Dolj|Galati|Giurgiu|Gorj|Harghita|Hunedoara|Ialomita|Iasi|Maramures|Mehedinti|Mures|Neamt|Olt|Prahova|Salaj|Satu u|Suceava|Teleorman|Timis|Tulcea|Vaslui|Vilcea|Vrancea"],["Russian Federation","RU","Adygeya (Maykop)|Aginskiy Buryatskiy (Aginskoye)|Altay (Gorno-Altaysk)|Altayskiy (Barnaul)|Amurskaya (Blagoveshchensk)|Astrakhanskaya|Bashkortostan (Ufa)|Belgorodskaya|Bryanskaya|Buryatiya (Ulan-Ude)|Chechnya (Groznyy)|Chelyabinskaya|Chitinskaya|Chukotskiy (Anadyr)|Chuvashiya (Cheboksary)|Dagestan (Makhachkala)|Evenkiyskiy (Tura)|Ingushetiya (Nazran')|Irkutskaya|Ivanovskaya|Kabardino-Balkariya (Nal'chik)|Kalmykiya (Elista)|Kaluzhskaya|Kamchatskaya (Petropavlovsk-Kamchatskiy)|Karachayevo-Cherkesiya (Cherkessk)|Kareliya (Petrozavodsk)|Khabarovskiy|Khakasiya (Abakan)|Khanty-Mansiyskiy (Khanty-Mansiysk)|Kirovskaya|Komi (Syktyvkar)|Komi-Permyatskiy (Kudymkar)|Koryakskiy (Palana)|Krasnodarskiy|Krasnoyarskiy|Kurganskaya|Kurskaya|Leningradskaya|Lipetskaya|Magadanskaya|Mariy-El (Yoshkar-Ola)|Mordoviya (Saransk)aya|Moskva (Moscow)|Murmanskaya|Nenetskiy (Nar'yan-Mar)|Nizhegorodskaya|Novgorodskaya|Novosibirskaya|Omskaya|Orenburgskaya|Orlovskaya (Orel)|Permskaya|Primorskiy (Vladivostok)|Pskovskaya|Rostovskaya|Ryazanskaya|Sakha (Yakutsk)|Sakhalinskaya (Yuzhno-Sakhalinsk)|Samarskaya|Leningradskaya|Sankt-Peterburg (Saint Petersburg)|Saratovskaya|Severnaya Osetiya-Alaniya [North Ossetia] (Vladikavkaz)|Smolenskaya|Stavropol'skiy|Sverdlovskaya (Yekaterinburg)aya|Tatarstan (Kazan')|Taymyrskiy (Dudinka)|Tomskaya|Tul'skaya|Tverskaya|Tyumenskaya|Tyva (Kyzyl)|Udmurtiya (Izhevsk)|Ul'yanovskaya|Ust'-Ordynskiy (Ust'-Ordynskiy)|Vladimirskaya|Volgogradskaya|Vologodskaya|Voronezhskaya|Yamalo-Nenetskiy (Salekhard)|Yaroslavskaya|Yevreyskaya"],["Rwanda","RW","Kigali~01|Eastern~02|Northern~03|Western~04|Southern~05"],["Saint Barthélemy","BL","Au Vent~02|Sous le Vent~01"],["Saint Helena, Ascension and Tristan da Cunha","SH","Ascension|Saint Helena|Tristan da Cunha"],["Saint Kitts and Nevis","KN","Christ Church Nichola Town|Saint Anne Sandy Point|Saint George Basseterre|Saint George Gingerland|Saint James Windward|Saint John Capisterre|Saint ree|Saint Mary Cayon|Saint Paul Capisterre|Saint Paul Charlestown|Saint Peter Basseterre|Saint Thomas Lowland|Saint Thomas Middle Island|Trinity Point"],["Saint Lucia","LC","Anse-la-Raye|Castries|Choiseul|Dauphin|Dennery|Gros Islet|Laborie|Micoud|Praslin|Soufriere|Vieux Fort"],["Saint Martin (French part)","MF","Saint Martin"],["Saint Pierre and Miquelon","PM","Miquelon|Saint Pierre"],["Saint Vincent and the Grenadines","VC","Charlotte~01|Grenadines~06|Saint~Andrew~02|Saint~David~03|Saint~George~04|Saint~Patrick~05"],["Samoa","WS","A'ana~AA|Aiga-i-le-Tai~AL|Atua~AT|Fa'asaleleaga~FA|Gaga'emauga~GE|Gagaifomauga~GI|Palauli~PA|Satupa'itea~SA|Tuamasaga~TU|Va'a-o-Fonoti~VF|Vaisigano~VS"],["San Marino","SM","Acquaviva|Borgo Maggiore|Chiesanuova|Domagnano|Faetano|Fiorentino|Monte Giardino|San Marino|Serravalle"],["Sao Tome and Principe","ST","Principe|Sao Tome"],["Saudi Arabia","SA","'Asir|Al Bahah|Al Hudud ash Shamaliyah|Al Jawf|Al Madinah|Al Qasim|Ar Riyad|Ash Sharqiyah (Eastern Province)|Ha'il|Jizan|Makkah|Najran|Tabuk"],["Senegal","SN","Dakar|Diourbel|Fatick|Kaolack|Kolda|Louga|Saint-Louis|Tambacounda|Thies|Ziguinchor"],["Serbia","RS","Beograd (Belgrade)~00|Borski~14|Braničevski~11|Jablanički~23|Južnobački~06|Južnobanatski~04|Kolubarski~09|Kosovski~25|Kosovsko-Mitrovački~28|Kosovsko-Pomoravski~29|Mačvanski~08|Moravički~17|Nišavski~20|Pčinjski~24|Pećki~26|Pirotski~22|Podunavski~10|Pomoravski~13|Prizrenski~27|Rasinski~19|Raški~18|Severnobački~01|Severnobanatski~03|Srednjebanatski~02|Sremski~07|Šumadijski~12|Toplički~21|Zaječarski~15|Zapadnobački~05|Zlatiborski~16"],["Seychelles","SC","Anse aux Pins|Anse Boileau|Anse Etoile|Anse Louis|Anse Royale|Baie Lazare|Baie Sainte Anne|Beau Vallon|Bel Air|Bel Ombre|Cascade|Glacis|Grand' Anse |Grand' Anse (on Praslin)|La Digue|La Riviere Anglaise|Mont Buxton|Mont Fleuri|Plaisance|Pointe La Rue|Port Glaud|Saint Louis|Takamaka"],["Sierra Leone","SL","Eastern|Northern|Southern|Western"],["Singapore","SG","Central Singapore~01|North East~02|North West~03|South East~04|South West~05"],["Sint Maarten (Dutch part)","SX","Sint Maarten"],["Slovakia","SK","Banskobystricky|Bratislavsky|Kosicky|Nitriansky|Presovsky|Trenciansky|Trnavsky|Zilinsky"],["Slovenia","SI","Ajdovscina|Beltinci|Bled|Bohinj|Borovnica|Bovec|Brda|Brezice|Brezovica|Cankova-Tisina|Celje|Cerklje na Gorenjskem|Cerknica|Cerkno|Crensovci|Crna na Crnomelj|Destrnik-Trnovska Vas|Divaca|Dobrepolje|Dobrova-Horjul-Polhov Gradec|Dol pri Ljubljani|Domzale|Dornava|Dravograd|Duplek|Gorenja Vas-orisnica|Gornja Radgona|Gornji Grad|Gornji Petrovci|Grosuplje|Hodos Salovci|Hrastnik|Hrpelje-Kozina|Idrija|Ig|Ilirska Bistrica|Ivancna ola|Jesenice|Jursinci|Kamnik|Kanal|Kidricevo|Kobarid|Kobilje|Kocevje|Komen|Koper|Kozje|Kranj|Kranjska o|Kungota|Kuzma|Lasko|Lenart|Lendava|Litija|Ljubljana|Ljubno|Ljutomer|Logatec|Loska Dolina|Loski e|Lukovica|Majsperk|Maribor|Medvode|Menges|Metlika|Mezica|Miren-Kostanjevica|Mislinja|Moravce|Moravske Toplice|Mozirje|Murska ta|Naklo|Nazarje|Nova Gorica|Novo Mesto|Odranci|Ormoz|Osilnica|Pesnica|Piran|Pivka|Podcetrtek|Podvelka-Ribnica|Postojna|Preddvor|Ptuj|Puconci|Race-ce|Radenci|Radlje ob Dravi|Radovljica|Ravne-Prevalje|Ribnica|Rogasevci|Rogaska Slatina|Rogatec|Ruse|Semic|Sencur|Sentilj|Sentjernej|Sentjur pri nica|Sezana|Skocjan|Skofja Loka|Skofljica|Slovenj Gradec|Slovenska Bistrica|Slovenske Konjice|Smarje pri Jelsah|Smartno ob anj|Starse|Store|Sveti Jurij|Tolmin|Trbovlje|Trebnje|Trzic|Turnisce|Velenje|Velike Lasce|Videm|Vipava|Vitanje|Vodice|Vojnik|Vrhnika|Vuzenica|Zagorje alec|Zavrc|Zelezniki|Ziri|Zrece"],["Solomon Islands","SB","Bellona|Central|Choiseul (Lauru)|Guadalcanal|Honiara|Isabel|Makira|Malaita|Rennell|Temotu|Western"],["Somalia","SO","Awdal|Bakool|Banaadir|Bari|Bay|Galguduud|Gedo|Hiiraan|Jubbada Dhexe|Jubbada Hoose|Mudug|Nugaal|Sanaag|Shabeellaha Dhexe|Shabeellaha l|Togdheer|Woqooyi Galbeed"],["South Africa","ZA","Eastern Cape~EC|Free State~FS|Gauteng~GT|KwaZulu-Natal~NL|Limpopo~LP|Mpumalanga~MP|Northern Cape~NC|North West~NW|Western Cape~WC"],["South Georgia and South Sandwich Islands","GS","Bird Island|Bristol Island|Clerke Rocks|Montagu Island|Saunders Island|South Georgia|Southern Thule|Traversay Islands"],["South Sudan","SS","South Sudan"],["Spain","ES","Albacete~CM|Alicante~VC|Almería~AN|Araba/Álava~VI|Asturias~O|Ávila~AV|Badajoz~BA|Barcelona~B|Bizkaia~BI|Burgos~BU|Cáceres~CC|Cádiz~CA|Cantabria~S|Castellón~CS|Cueta~CU|Ciudad Real~CR|Córdoba~CO|A Coruña~C|Cuenca~CU|Gipuzkoa~SS|Girona~GI|Granada~GR|Guadalajara~GU|Huelva~H|Huesca~HU|Illes Balears~PM|Jaén~J|León~LE|Lleida~L|Lugo~LU|Madrid~M|Málaga~MA|Melilla~ML|Murcia~MU|Navarre~NA|Ourense~OR|Palencia~P|Las Palmas~GC|Pontevedra~PO|La Rioja~LO|Salamanca~SA|Santa Cruz de Tenerife~TF|Segovia~SG|Sevilla~SE|Soria~SO|Tarragona~T|Teruel~TE|Toledo~TO|Valencia~V|Valladolid~VA|Zamora~ZA|Zaragoza~Z"],["Sri Lanka","LK","Central|Eastern|North Central|North Eastern|North Western|Northern|Sabaragamuwa|Southern|Uva|Western"],["Sudan","SD","A'ali an Nil|Al Bahr al Ahmar|Al Buhayrat|Al Jazirah|Al Khartum|Al Qadarif|Al Wahdah|An Nil al Abyad|An Nil al Azraq|Ash Shamaliyah|Bahr al rb al Istiwa'iyah|Gharb Bahr al Ghazal|Gharb Darfur|Gharb Kurdufan|Janub Darfur|Janub Kurdufan|Junqali|Kassala|Nahr an Nil|Shamal Bahr al amal Darfur|Shamal Kurdufan|Sharq al Istiwa'iyah|Sinnar|Warab"],["Suriname","SR","Brokopondo|Commewijne|Coronie|Marowijne|Nickerie|Para|Paramaribo|Saramacca|Sipaliwini|Wanica"],["Svalbard and Jan Mayen","SJ","Barentsoya|Bjornoya|Edgeoya|Hopen|Kvitoya|Nordaustandet|Prins Karls Forland|Spitsbergen"],["Swaziland","SZ","Hhohho|Lubombo|Manzini|Shiselweni"],["Sweden","SE","Blekinge|Dalarnas|Gavleborgs|Gotlands|Hallands|Jamtlands|Jonkopings|Kalmar|Kronobergs|Norrbottens|Orebro|Ostergotlands|Skane|Sodermanlands|Stockholm|Varmlands|Vasterbottens|Vasternorrlands|Vastmanlands|Vastra Gotalands"],["Switzerland","CH","Aargau~AG|Appenzell Ausserrhoden~AR|Appenzell Innerhoden~AI|Basel-Landschaft~BL|Basel-Stadt~BS|Bern~BE|Fribourg~FR|Genève~GE|Glarus~GL|Graubünden~GR|Jura~JU|Luzern~LU|Neuchâtel~NE|Nidwalden~NW|Obwalden~OW|Sankt Gallen~SG|Schaffhausen~SH|Schwyz~SZ|Solothurn~SO|Thurgau~TG|Ticino~TI|Uri~UR|Valais~VS|Waadt~VD|Zug~ZG|Zürich~ZH"],["Syrian Arab Republic","SY","Al Hasakah|Al Ladhiqiyah|Al Qunaytirah|Ar Raqqah|As Suwayda'|Dar'a|Dayr az Zawr|Dimashq|Halab|Hamah|Hims|Idlib|Rif Dimashq|Tartus"],["Taiwan, Province of China","TW","Chang-hua|Chi-lung|Chia-i|Chia-i|Chung-hsing-hsin-ts'un|Hsin-chu|Hsin-chu|Hua-lien|I-lan|Kao-hsiung|Kao-hsiung|Miao-li|Nan-t'ou|P'eng-hu|P'ing--chung|T'ai-chung|T'ai-nan|T'ai-nan|T'ai-pei|T'ai-pei|T'ai-tung|T'ao-yuan|Yun-lin"],["Tajikistan","TJ","Viloyati Khatlon|Viloyati Leninobod|Viloyati Mukhtori Kuhistoni Badakhshon"],["Tanzania, United Republic of","TZ","Arusha~01|Coast~19|Dar es Salaam~02|Dodoma~03|Iringa~04|Kagera~05|Kigoma~08|Kilimanjaro~09|Lindi~12|Manyara~26|Mara~13|Mbeya~14|Morogoro~16|Mtwara~17|Mwanza~18|Pemba North~06|Pemba South~10|Rukwa~20|Ruvuma~21|Shinyanga~22|Singida~23|Tabora~24|Tanga~25|Zanzibar North~07|Zanzibar Central/South~11|Zanzibar Urban/West~15"],["Thailand","TH","Amnat Charoen|Ang Thong|Buriram|Chachoengsao|Chai Nat|Chaiyaphum|Chanthaburi|Chiang Mai|Chiang Rai|Chon Buri|Chumphon|Kalasin|Kamphaeng hanaburi|Khon Kaen|Krabi|Krung Thep Mahanakhon (Bangkok)|Lampang|Lamphun|Loei|Lop Buri|Mae Hong Son|Maha Sarakham|Mukdahan|Nakhon Nayok|Nakhon khon Phanom|Nakhon Ratchasima|Nakhon Sawan|Nakhon Si Thammarat|Nan|Narathiwat|Nong Bua Lamphu|Nong Khai|Nonthaburi|Pathum tani|Phangnga|Phatthalung|Phayao|Phetchabun|Phetchaburi|Phichit|Phitsanulok|Phra Nakhon Si Ayutthaya|Phrae|Phuket|Prachin Buri|Prachuap Khiri ng|Ratchaburi|Rayong|Roi Et|Sa Kaeo|Sakon Nakhon|Samut Prakan|Samut Sakhon|Samut Songkhram|Sara Buri|Satun|Sing ket|Songkhla|Sukhothai|Suphan Buri|Surat Thani|Surin|Tak|Trang|Trat|Ubon Ratchathani|Udon Thani|Uthai Thani|Uttaradit|Yala|Yasothon"],["Timor-Leste","TL","Timor-Leste"],["Togo","TG","De La Kara|Des Plateaux|Des Savanes|Du Centre|Maritime"],["Tokelau","TK","Atafu|Fakaofo|Nukunonu"],["Tonga","TO","Ha'apai|Tongatapu|Vava'u"],["Trinidad and Tobago","TT","Arima|Caroni|Mayaro|Nariva|Port-of-Spain|Saint Andrew|Saint David|Saint George|Saint Patrick|San Fernando|Victoria|Tobago"],["Tunisia","TN","Ariana|Beja|Ben Arous|Bizerte|El Kef|Gabes|Gafsa|Jendouba|Kairouan|Kasserine|Kebili|Mahdia|Medenine|Monastir|Nabeul|Sfax|Sidi Bou na|Sousse|Tataouine|Tozeur|Tunis|Zaghouan"],["Turkey","TR","Adana|Adiyaman|Afyon|Agri|Aksaray|Amasya|Ankara|Antalya|Ardahan|Artvin|Aydin|Balikesir|Bartin|Batman|Bayburt|Bilecik|Bingol|Bitlis|Bolu|Burdur|Bursae|Cankiri|Corum|Denizli|Diyarbakir|Duzce|Edirne|Elazig|Erzincan|Erzurum|Eskisehir|Gaziantep|Giresun|Gumushane|Hakkari|Hatay|Icel|Igdir|Isparta|IstanbKahramanmaras|Karabuk|Karaman|Kars|Kastamonu|Kayseri|Kilis|Kirikkale|Kirklareli|Kirsehir|Kocaeli|Konya|Kutahya|Malatya|Manisa|Mardin|Mugla|Mus|NevsehOrdu|Osmaniye|Rize|Sakarya|Samsun|Sanliurfa|Siirt|Sinop|Sirnak|Sivas|Tekirdag|Tokat|Trabzon|Tunceli|Usak|Van|Yalova|Yozgat|Zonguldak"],["Turkmenistan","TM","Ahal Welayaty|Balkan Welayaty|Dashhowuz Welayaty|Lebap Welayaty|Mary Welayaty"],["Turks and Caicos Islands","TC","Turks and Caicos Islands"],["Tuvalu","TV","Tuvalu"],["Uganda","UG","Abim~317|Adjumani~301|Amolatar~314|Amuria~216|Amuru~319|Apac~302|Arua~303|Budaka~217|Bududa~223|Bugiri~201|Bukedea~224|Bukwa~218|Buliisa~419|Bundibugyo~401|Bushenyi~402|Busia~202|Butaleja~219|Dokolo~318|Gulu~304|Hoima~403|Ibanda~416|Iganga~203|Isingiro~417|Jinja~204|Kaabong~315|Kabale~404|Kabarole~405|Kaberamaido~213|Kalangala~101|Kaliro~220|Kampala~102|Kamuli~205|Kamwenge~413|Kanungu~414|Kapchorwa~206|Kasese~406|Katakwi~207|Kayunga~112|Kibaale~407|Kiboga~103|Kiruhura~418|Kisoro~408|Kitgum~305|Koboko~316|Kotido~306|Kumi~208|Kyenjojo~415|Lira~307|Luwero~104|Lyantonde~116|Manafwa~221|Maracha~320|Masaka~105|Masindi~409|Mayuge~214|Mbale~209|Mbarara~410|Mityana~114|Moroto~308|Moyo~309|Mpigi~106|Mubende~107|Mukono~108|Nakapiripirit~311|Nakaseke~115|Nakasongola~109|Namutumba~222|Nebbi~310|Ntungamo~411|Oyam~321|Pader~312|Pallisa~210|Rakai~110|Rukungiri~412|Sembabule~111|Sironko~215|Soroti~211|Tororo~212|Wakiso~113|Yumbe~313"],["Ukraine","UA","Cherkasy~71|Chernihiv~74|Chernivtsi~77|Dnipropetrovsk~12|Donetsk~14|Ivano-Frankivsk~26|Kharkiv~63|Kherson~65|Khmelnytskyi~68|Kiev~32|Kirovohrad~35|Luhansk~09|Lviv~46|Mykolaiv~48|Odessa~51|Poltava~53|Rivne~56|Sumy~59|Ternopil~61|Vinnytsia~05|Volyn~07|Zakarpattia~21|Zaporizhia~23|Zhytomyr~18|Avtonomna Respublika Krym~43|Kyïv~30|Sevastopol~40"],["United Arab Emirates","AE","Abu Dhabi~AZ|Ajman~AJ|Dubai~DU|Fujairah~FU|Ras al Khaimah~RK|Sharjah~SH|Umm Al Quwain~UQ"],["United Kingdom","GB","Avon~AVN|Bedfordshire~BDF|Berkshire~BRK|Bristol, City of~COB|Buckinghamshire~BKM|Cambridgeshire~CAM|Cheshire~CHS|Cleveland~CLV|Cornwall~CON|Cumbria~CMA|Derbyshire~DBY|Devon~DEV|Dorset~DOR|Durham~DUR|East Sussex~SXE|Essex~ESS|Gloucestershire~GLS|Greater London~LND|Greater Manchester~GTM|Hampshire (County of Southampton)~HAM|Hereford and Worcester~HWR|Herefordshire~HEF|Hertfordshire~HRT|Isle of Wight~IOW|Kent~KEN|Lancashire~LAN|Leicestershire~LEI|Lincolnshire~LIN|London~LDN|Merseyside~MSY|Middlesex~MDX|Norfolk~NFK|Northamptonshire~NTH|Northumberland~NBL|North Humberside~NHM|North Yorkshire~NYK|Nottinghamshire~NTT|Oxfordshire~OXF|Rutland~RUT|Shropshire~SAL|Somerset~SOM|South Humberside~SHM|South Yorkshire~SYK|Staffordshire~STS|Suffolk~SFK|Surrey~SRY|Tyne and Wear~TWR|Warwickshire~WAR|West Midlands~WMD|West Sussex~SXW|West Yorkshire~WYK|Wiltshire~WIL|Worcestershire~WOR|Antrim~ANT|Armagh~ARM|Belfast, City of~BLF|Down~DOW|Fermanagh~FER|Londonderry~LDY|Derry, City of~DRY|Tyrone~TYR|Aberdeen, City of~AN|Aberdeenshire~ABD|Angus (Forfarshire)~ANS|Argyll~AGB|Ayrshire~ARG|Banffshire~BAN|Berwickshire~BEW|Bute~BUT|Caithness~CAI|Clackmannanshire~CLK|Cromartyshire~COC|Dumfriesshire~DFS|Dunbartonshire (Dumbarton)~DNB|Dundee, City of~DD|East Lothian (Haddingtonshire)~ELN|Edinburgh, City of~EB|Fife~FIF|Glasgow, City of~GLA|Inverness-shire~INV|Kincardineshire~KCD|Kinross-shire~KRS|Kirkcudbrightshire~KKD|Lanarkshire~LKS|Midlothian (County of Edinburgh)~MLN|Moray (Elginshire)~MOR|Nairnshire~NAI|Orkney~OKI|Peeblesshire~PEE|Perthshire~PER|Renfrewshire~RFW|Ross and Cromarty~ROC|Ross-shire~ROS|Roxburghshire~ROX|Selkirkshire~SEL|Shetland (Zetland)~SHI|Stirlingshire~STI|Sutherland~SUT|West Lothian (Linlithgowshire)~WLN|Wigtownshire~WIG|Clwyd~CWD|Dyfed~DFD|Gwent~GNT|Gwynedd~GWN|Mid Glamorgan~MGM|Powys~POW|South Glamorgan~SGM|West Glamorgan~WGM"],["United Kingdom Overseas Territories","UO","Anguilla|Bermuda|British Virgin Islands|Cayman Islands|Falkland Islands|Gibraltar|Montserrat|St Helena|Tristan Da Cunha|Turks & Caicos Islands"],["United States","US","Alaska~AK|Alabama~AL|American Samoa~AS|Arizona~AZ|Arkansas~AR|California~CA|Colorado~CO|Connecticut~CT|Delaware~DE|District of Columbia~DC|Micronesia~FM|Florida~FL|Georgia~GA|Guam~GU|Hawaii~HI|Idaho~ID|Illinois~IL|Indiana~IN|Iowa~IA|Kansas~KS|Kentucky~KY|Louisiana~LA|Maine~ME|Marshall Islands~MH|Maryland~MD|Massachusetts~MA|Michigan~MI|Minnesota~MN|Mississippi~MS|Missouri~MO|Montana~MT|Nebraska~NE|Nevada~NV|New Hampshire~NH|New Jersey~NJ|New Mexico~NM|New York~NY|North Carolina~NC|North Dakota~ND|Northern Mariana Islands~MP|Ohio~OH|Oklahoma~OK|Oregon~OR|Palau~PW|Pennsylvania~PA|Puerto Rico~PR|Rhode Island~RI|South Carolina~SC|South Dakota~SD|Tennessee~TN|Texas~TX|Utah~UT|Vermont~VT|Virgin Islands~VI|Virginia~VA|Washington~WA|West Virginia~WV|Wisconsin~WI|Wyoming~WY|Armed Forces Americas~AA|Armed Forces Europe, Canada, Africa and Middle East~AE|Armed Forces Pacific~AP"],["United States Minor Outlying Islands","UM","Baker Island~81|Howland Island~84|Jarvis Island~86|Johnston Atoll~67|Kingman Reef~89|Midway Islands~71|Navassa Island~76|Palmyra Atoll~95|Wake Island~79|Bajo Nuevo Bank~BN|Serranilla Bank~SB"],["Uruguay","UY","Artigas~AR|Canelones~CA|Cerro Largo~CL|Colonia~CO|Durazno~DU|Flores~FS|Florida~FD|Lavalleja~LA|Maldonado~MA|Montevideo~MO|Paysandú~PA|Río Negro~RN|Rivera~RV|Rocha~RO|Salto~SA|San José~SJ|Soriano~SO|Tacuarembó~TA|Treinta y Tres~TT"],["Uzbekistan","UZ","Toshkent shahri~TK|Andijon~AN|Buxoro~BU|Farg‘ona~FA|Jizzax~JI|Namangan~NG|Navoiy~NW|Qashqadaryo (Qarshi)~QA|Samarqand~SA|Sirdaryo (Guliston)~SI|Surxondaryo (Termiz)~SU|Toshkent wiloyati~TO|Xorazm (Urganch)~XO|Qoraqalpog‘iston Respublikasi (Nukus)~QR"],["Vanuatu","VU","Malampa~MAP|Pénama~PAM|Sanma~SAM|Shéfa~SEE|Taféa~TAE|Torba~TOB"],["Venezuela, Bolivarian Republic of","VE","Dependencias Federales~W|Distrito Federal~A|Amazonas~Z|Anzoátegui~B|Apure~C|Aragua~D|Barinas~E|Bolívar~F|Carabobo~G|Cojedes~H|Delta Amacuro~Y|Falcón~I|Guárico~J|Lara~K|Mérida~L|Miranda~M|Monagas~N|Nueva Esparta~O|Portuguesa~P|Sucre~R|Táchira~S|Trujillo~T|Vargas~X|Yaracuy~U|Zulia~V"],["Viet Nam","VN","Đồng Nai~39|Đồng Tháp~45|Gia Lai~30|Hà Giang~03|Hà Nam~63|Hà Tây~15|Hà Tĩnh~23|Hải Dương~61|Hậu Giang~73|Hòa Bình~14|Hưng Yên~66|Khánh Hòa~34|Kiên Giang~47|Kon Tum~28|Lai Châu~01|Lâm Đồng~35|Lạng Sơn~09|Lào Cai~02|Long An~41|Nam Định~67|Nghệ An~22|Ninh Bình~18|Ninh Thuận~36|Phú Thọ~68|Phú Yên~32|Quảng Bình~24|Quảng Nam~27|Quảng Ngãi~29|Quảng Ninh~13|Quảng Trị~25|Sóc Trăng~52|Sơn La~05|Tây Ninh~37|Thái Bình~20|Thái Nguyên~69|Thanh Hóa~21|Thừa Thiên–Huế~26|Tiền Giang~46|Trà Vinh~51|Tuyên Quang~07|Vĩnh Long~49|Vĩnh Phúc~70|Yên Bái~06|Cần Thơ~CT|Đà Nẵng~DN|Hà Nội~HN|Hải Phòng~HP|Hồ Chí Minh (Sài Gòn)~SG"],["Virgin Islands, British","VG","Anegada~ANG|Jost Van Dyke~JVD|Tortola~TTA|Virgin Gorda~VGD"],["Virgin Islands, U.S.","VI","St. Thomas~STH|St. John~SJO|St. Croix~SCR"],["Wallis and Futuna","WF","Alo~ALO|Sigave~SIG|Wallis~WAL"],["Western Sahara","EH","Es Smara~ESM|Boujdour~BOD|Laâyoune~LAA|Aousserd~AOU|Oued ed Dahab~OUD"],["Yemen","YE","Şan‘ā'~SA|Abyān~AB|'Adan~AD|Aḑ Ḑāli'~DA|Al Bayḑā'~BA|Al Ḩudaydah~HU|Al Jawf~JA|Al Mahrah~MR|Al Maḩwīt~MW|'Amrān~AM|Dhamār~DH|Ḩaḑramawt~HD|Ḩajjah~HJ|Ibb~IB|Laḩij~LA|Ma'rib~MA|Raymah~RA|Şā‘dah~SD|Şan‘ā'~SN|Shabwah~SH|Tā‘izz~TA"],["Zambia","ZM","Central~02|Copperbelt~08|Eastern~03|Luapula~04|Lusaka~09|Northern~05|North-Western~06|Southern~07|Western~01"],["Zimbabwe","ZW","Bulawayo~BU|Harare~HA|Manicaland~MA|Mashonaland Central~MC|Mashonaland East~ME|Mashonaland West~MW|Masvingo~MV|Matabeleland North~MN|Matabeleland South~MS|Midlands~MI"]],h=function(){
for(var b=document.getElementsByClassName(a),c=0;c<b.length;c++)i(b[c])},i=function(a){var c=a.getAttribute("data-crs-loaded");if("true"!==c){a.length=0;var e=a.getAttribute("data-default-option"),g=e?e:b,h=a.getAttribute("data-show-default-option");d=null===h?!0:"true"===h;var i=a.getAttribute("data-default-value"),l=a.getAttribute("data-value"),o=0;d&&(a.options[0]=new Option(g,"")),k({whitelist:a.getAttribute("data-whitelist"),blacklist:a.getAttribute("data-blacklist")});for(var p=0;p<f.length;p++){var q="shortcode"===l||"2-char"===l?f[p][1]:f[p][0];a.options[a.length]=new Option(f[p][0],q),null!=i&&i===q&&(o=p,d&&o++)}a.selectedIndex=o;var r=a.getAttribute("data-region-id");if(!r)return void console.error("Missing data-region-id on country-region-selector country field.");var s=document.getElementById(r);if(s)if(j(s),a.onchange=function(){n(a,s)},null!==i&&a.selectedIndex>0){n(a,s);var t=s.getAttribute("data-default-value"),u="shortcode"===s.getAttribute("data-value");if(null!==t){var v=f[a.selectedIndex-1][3];m(s,v,t,u)}}else d===!1&&n(a,s);else console.error("Region dropdown DOM node with ID "+r+" not found.");a.setAttribute("data-crs-loaded","true")}},j=function(a){var b=a.getAttribute("data-blank-option"),c=b?b:"-",d=a.getAttribute("data-show-default-option");e=null===d?!0:"true"===d,a.length=0,e&&(a.options[0]=new Option(c,""),a.selectedIndex=0)},k=function(a){var b=g,c=[],d=0;if(a.whitelist){var e=a.whitelist.split(",");for(d=0;d<g.length;d++)-1!==e.indexOf(g[d][1])&&c.push(g[d]);b=c}else if(a.blacklist){var h=a.blacklist.split(",");for(d=0;d<g.length;d++)-1===h.indexOf(g[d][1])&&c.push(g[d]);b=c}f=b,l()},l=function(){for(var a=0;a<f.length;a++){for(var b={hasShortcodes:/~/.test(f[a][2]),regions:[]},c=f[a][2].split("|"),d=0;d<c.length;d++){var e=c[d].split("~");b.regions.push([e[0],e[1]])}f[a][3]=b}},m=function(a,b,c,d){for(var e=0;e<b.regions.length;e++){var f=d&&b.hasShortcodes&&b.regions[e][1]?b.regions[e][1]:b.regions[e][0];if(f===c){a.selectedIndex=e+1;break}}},n=function(a,b){var g=d?a.selectedIndex-1:a.selectedIndex,h=b.getAttribute("data-default-option"),i=b.getAttribute("data-value"),k=h?h:c;if(""===a.value)j(b);else{b.length=0,e&&(b.options[0]=new Option(k,""));for(var l=f[g][3],m=0;m<l.regions.length;m++){var n="shortcode"===i&&l.hasShortcodes?l.regions[m][1]:l.regions[m][0];b.options[b.length]=new Option(l.regions[m][0],n)}b.selectedIndex=0}},o=function(a,b){var c=!1,d=!0,e=a.document,f=e.documentElement,g=e.addEventListener?"addEventListener":"attachEvent",h=e.addEventListener?"removeEventListener":"detachEvent",i=e.addEventListener?"":"on",j=function(d){("readystatechange"!=d.type||"complete"==e.readyState)&&(("load"==d.type?a:e)[h](i+d.type,j,!1),!c&&(c=!0)&&b.call(a,d.type||d))},k=function(){try{f.doScroll("left")}catch(a){return void setTimeout(k,50)}j("poll")};if("complete"==e.readyState)b.call(a,"lazy");else{if(e.createEventObject&&f.doScroll){try{d=!a.frameElement}catch(l){}d&&k()}e[g](i+"DOMContentLoaded",j,!1),e[g](i+"readystatechange",j,!1),a[g](i+"load",j,!1)}};return o(window,h),{init:h}});
|
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var _jsxRuntime = require("react/jsx-runtime");
var _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
d: "M20 14.27V10c0-4.42-3.58-8-8-8s-8 3.58-8 8v4.27c-.6.34-1 .99-1 1.73v4c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-4c0-.74-.4-1.39-1-1.73zM7 20H5v-4h2v4zm4 0H9v-4h2v4zm0-6H6v-4c0-2.97 2.16-5.44 5-5.92V14zm2-9.92c2.84.48 5 2.94 5 5.92v4h-5V4.08zM15 20h-2v-4h2v4zm4 0h-2v-4h2v4zM8 11c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.45-1-1zm8 0c0 .55-.45 1-1 1s-1-.45-1-1 .45-1 1-1 1 .45 1 1z"
}), 'BalconyRounded');
exports.default = _default;
|
import PropTypes from 'prop-types';
import { FaArrowCircleRight } from 'react-icons/fa';
import './Details.css';
const Details = ({
id,
name,
cases,
deaths,
newDeaths,
newCases,
intensive,
hospitalised,
}) => (
<div id={id}>
<div className="itemHeader detailFlex">
<h4 className="lato">{name}</h4>
<span className="lato">{`${cases} Active `}</span>
</div>
<div className="regionInfo">
<span className="lato">REGION CASES INFO</span>
</div>
<div className="regionsContainer">
<div className="regionRow detailFlex">
<span className="latoBold">Total Deaths</span>
<div className="numbersInfo detailFlex">
<span className="latoRegular">{deaths}</span>
<FaArrowCircleRight />
</div>
</div>
<div className="regionRow detailFlex">
<span className="latoBold">New Deaths</span>
<div className="numbersInfo detailFlex">
<span className="latoRegular">{newDeaths}</span>
<FaArrowCircleRight />
</div>
</div>
<div className="regionRow detailFlex">
<span className="latoBold">New Cases</span>
<div className="numbersInfo detailFlex">
<span className="latoRegular">{newCases}</span>
<FaArrowCircleRight />
</div>
</div>
<div className="regionRow detailFlex">
<span className="latoBold">Intesive Care</span>
<div className="numbersInfo detailFlex">
<span className="latoRegular">{intensive}</span>
<FaArrowCircleRight />
</div>
</div>
<div className="regionRow detailFlex">
<span className="latoBold">Hospitalised</span>
<div className="numbersInfo detailFlex">
<span className="latoRegular">{hospitalised}</span>
<FaArrowCircleRight />
</div>
</div>
</div>
</div>
);
Details.propTypes = {
id: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
cases: PropTypes.number.isRequired,
deaths: PropTypes.number.isRequired,
newDeaths: PropTypes.number.isRequired,
newCases: PropTypes.number.isRequired,
intensive: PropTypes.number.isRequired,
hospitalised: PropTypes.number.isRequired,
};
export default Details;
|
import React from 'react';
import { connect } from 'react-redux'
import HotelRateDetail from "../components/HotelRateDetail";
const mapStateToProps = (state, ownProps) => {
return {
hotelRates: state.hotelRates.hotelRates,
}
}
export default connect(
mapStateToProps
)(HotelRateDetail)
|
/*
* Copyright 2018 Expedia Group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { expect } from 'chai';
import axios from 'axios';
import { when } from 'mobx';
import MockAdapter from 'axios-mock-adapter';
import {ServiceStore} from '../../../src/stores/serviceStore';
describe('ServiceStore', () => {
let server = null;
const store = new ServiceStore();
beforeEach(() => {
server = new MockAdapter(axios);
});
afterEach(() => {
server = null;
});
it('fetches services off the api', (done) => {
server.onGet('/api/services').reply(200, '["test-service"]');
store.fetchServices();
when(
() => store.services.length > 0,
() => {
expect(store.services).to.have.length(1);
done();
});
store.fetchServices();
expect(store.services).to.have.length(0);
});
});
|
/*=============================================================
Authour URI: www.binarytheme.com
License: Commons Attribution 3.0
http://creativecommons.org/licenses/by/3.0/
100% To use For Personal And Commercial Use.
IN EXCHANGE JUST GIVE US CREDITS AND TELL YOUR FRIENDS ABOUT US
======================================================== */
/*====================================
FOR IMAGE/GALLERY POPUP
======================================*/
$("a.preview").prettyPhoto({
social_tools: false
});
/*====================================
FOR IMAGE/GALLERY FILTER
======================================*/
// MixItUp plugin
// http://mixitup.io
$('#port-folio').mixitup({
targetSelector: '.portfolio-item',
filterSelector: '.filter',
effects: ['fade'],
easing: 'snap',
});
|
"use strict";
/**
* Copyright (c) 2017-present, Ephox, Inc.
*
* This source code is licensed under the Apache 2 license found in the
* LICENSE file in the root directory of this source tree.
*
*/
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.EditorPropTypes = exports.eventPropTypes = void 0;
var PropTypes = require("prop-types");
exports.eventPropTypes = {
onActivate: PropTypes.func,
onAddUndo: PropTypes.func,
onBeforeAddUndo: PropTypes.func,
onBeforeExecCommand: PropTypes.func,
onBeforeGetContent: PropTypes.func,
onBeforeRenderUI: PropTypes.func,
onBeforeSetContent: PropTypes.func,
onBeforePaste: PropTypes.func,
onBlur: PropTypes.func,
onChange: PropTypes.func,
onClearUndos: PropTypes.func,
onClick: PropTypes.func,
onContextMenu: PropTypes.func,
onCopy: PropTypes.func,
onCut: PropTypes.func,
onDblclick: PropTypes.func,
onDeactivate: PropTypes.func,
onDirty: PropTypes.func,
onDrag: PropTypes.func,
onDragDrop: PropTypes.func,
onDragEnd: PropTypes.func,
onDragGesture: PropTypes.func,
onDragOver: PropTypes.func,
onDrop: PropTypes.func,
onExecCommand: PropTypes.func,
onFocus: PropTypes.func,
onFocusIn: PropTypes.func,
onFocusOut: PropTypes.func,
onGetContent: PropTypes.func,
onHide: PropTypes.func,
onInit: PropTypes.func,
onKeyDown: PropTypes.func,
onKeyPress: PropTypes.func,
onKeyUp: PropTypes.func,
onLoadContent: PropTypes.func,
onMouseDown: PropTypes.func,
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func,
onMouseMove: PropTypes.func,
onMouseOut: PropTypes.func,
onMouseOver: PropTypes.func,
onMouseUp: PropTypes.func,
onNodeChange: PropTypes.func,
onObjectResizeStart: PropTypes.func,
onObjectResized: PropTypes.func,
onObjectSelected: PropTypes.func,
onPaste: PropTypes.func,
onPostProcess: PropTypes.func,
onPostRender: PropTypes.func,
onPreProcess: PropTypes.func,
onProgressState: PropTypes.func,
onRedo: PropTypes.func,
onRemove: PropTypes.func,
onReset: PropTypes.func,
onSaveContent: PropTypes.func,
onSelectionChange: PropTypes.func,
onSetAttrib: PropTypes.func,
onSetContent: PropTypes.func,
onShow: PropTypes.func,
onSubmit: PropTypes.func,
onUndo: PropTypes.func,
onVisualAid: PropTypes.func
};
exports.EditorPropTypes = __assign({ apiKey: PropTypes.string, id: PropTypes.string, inline: PropTypes.bool, init: PropTypes.object, initialValue: PropTypes.string, onEditorChange: PropTypes.func, outputFormat: PropTypes.oneOf(['html', 'text']), value: PropTypes.string, tagName: PropTypes.string, cloudChannel: PropTypes.string, version: PropTypes.string, plugins: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), toolbar: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), disabled: PropTypes.bool, textareaName: PropTypes.string, tinymceScriptSrc: PropTypes.string, scriptLoading: PropTypes.shape({
async: PropTypes.bool,
defer: PropTypes.bool,
delay: PropTypes.number
}) }, exports.eventPropTypes);
|
var _ = require('underscore');
var Backbone = require('backbone');
var XYZView = require('./xyz-view');
/**
* View model for XYZ tab content.
*/
module.exports = Backbone.Model.extend({
defaults: {
name: 'xyz',
label: 'XYZ',
tms: false,
layer: undefined // will be set when valid
},
createView: function (opts) {
if (!opts.submitButton) throw new Error('submitButton is required');
if (!opts.modalFooter) throw new Error('modalFooter is required');
this._submitButton = opts.submitButton;
this._modalFooter = opts.modalFooter;
return new XYZView({
model: this,
submitButton: this._submitButton,
modalFooter: this._modalFooter
});
},
hasAlreadyAddedLayer: function (userLayers) {
var urlTemplate = this.get('layer').get('urlTemplate');
return _.any(userLayers.isCustomCategory(), function (customLayer) {
return customLayer.get('urlTemplate') === urlTemplate;
});
}
});
|
$(document).ready(function() {
// MIXITUP PORTFOLIO
$(function() {
// Instantiate MixItUp:
$('#container-mixitup').mixItUp();
});
// MAGNIFIC POPUP
$('#container-mixitup').magnificPopup({
delegate: 'a', // child items selector, by clicking on it popup will open
type: 'image'
// other options
});
//WAYPOINT - JQUERY COUNTTO PROGRESS BAR//
$('#count-wrapper').waypoint(function() {
$('.title-count').countTo();
}, {
offset: '80%',
triggerOnce: true
});
// Clients Slider
$("#owl-clients").owlCarousel({
autoPlay: 3000,
items: 4,
pagination: false,
itemsCustom: [
[0, 3],
[450, 4]
]
});
});
|
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'flash', 'sv', {
access: 'Script-tillgång',
accessAlways: 'Alltid',
accessNever: 'Aldrig',
accessSameDomain: 'Samma domän',
alignAbsBottom: 'Absolut nederkant',
alignAbsMiddle: 'Absolut centrering',
alignBaseline: 'Baslinje',
alignTextTop: 'Text överkant',
bgcolor: 'Bakgrundsfärg',
chkFull: 'Tillåt helskärm',
chkLoop: 'Upprepa/Loopa',
chkMenu: 'Aktivera Flashmeny',
chkPlay: 'Automatisk uppspelning',
flashvars: 'Variabler för Flash',
hSpace: 'Horis. marginal',
properties: 'Flashegenskaper',
propertiesTab: 'Egenskaper',
quality: 'Kvalitet',
qualityAutoHigh: 'Auto Hög',
qualityAutoLow: 'Auto Låg',
qualityBest: 'Bäst',
qualityHigh: 'Hög',
qualityLow: 'Låg',
qualityMedium: 'Medium',
scale: 'Skala',
scaleAll: 'Visa allt',
scaleFit: 'Exakt passning',
scaleNoBorder: 'Ingen ram',
title: 'Flashegenskaper',
vSpace: 'Vert. marginal',
validateHSpace: 'HSpace måste vara ett nummer.',
validateSrc: 'Var god ange länkens URL',
validateVSpace: 'VSpace måste vara ett nummer.',
windowMode: 'Fönsterläge',
windowModeOpaque: 'Opaque',
windowModeTransparent: 'Transparent',
windowModeWindow: 'Fönster'
} );
|
/**
* 1006.笨阶乘 | 难度:中等 | 标签:数学
* 通常,正整数 n 的阶乘是所有小于或等于 n 的正整数的乘积。例如,factorial(10) = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1。
* <p>
* 相反,我们设计了一个笨阶乘 clumsy:在整数的递减序列中,我们以一个固定顺序的操作符序列来依次替换原有的乘法操作符:乘法(*),除法(/),加法(+)和减法(-)。
* <p>
* 例如,clumsy(10) = 10 * 9 / 8 + 7 - 6 * 5 / 4 + 3 - 2 * 1。然而,这些运算仍然使用通常的算术运算顺序:我们在任何加、减步骤之前执行所有的乘法和除法步骤,并且按从左到右处理乘法和除法步骤。
* <p>
* 另外,我们使用的除法是地板除法(floor division),所以 10 * 9 / 8 等于 11。这保证结果是一个整数。
* <p>
* 实现上面定义的笨函数:给定一个整数 N,它返回 N 的笨阶乘。
* <p>
* 示例 1:
* 输入:4
* 输出:7
* 解释:7 = 4 * 3 / 2 + 1
* <p>
* 示例 2:
* 输入:10
* 输出:12
* 解释:12 = 10 * 9 / 8 + 7 - 6 * 5 / 4 + 3 - 2 * 1
* <p>
* 提示:
* 1 <= N <= 10000
* -2^31 <= answer <= 2^31 - 1 (答案保证符合 32 位整数。)
* <p>
* 来源:力扣(LeetCode)
* 链接:https://leetcode-cn.com/problems/clumsy-factorial
* 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
*
* 执行用时: 100 ms , 在所有 JavaScript 提交中击败了 12.50% 的用户
* 内存消耗: 38.1 MB , 在所有 JavaScript 提交中击败了 50.00% 的用户
* @param {number} N
* @return {number}
*/
var clumsy = function (N) {
let sum = 0;
let sign = 1;
while (N >= 4) {
// js除法会计算小数
sum += sign * Math.floor(N * (N - 1) / (N - 2)) + (N - 3);
sign = -1;
N -= 4;
}
if (N === 3) {
sum += sign * Math.floor(N * (N - 1) / (N - 2));
} else if (N === 2) {
sum += sign * N * (N - 1);
} else {
sum += sign * N;
}
return sum;
};
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{"6VtZ":function(n,c,o){},Ay9S:function(n,c,o){},"Pf/c":function(n,c,o){},Uj7m:function(n,c,o){},"Z/1q":function(n,c,o){},drWP:function(n,c,o){},en2a:function(n,c,o){},gjrb:function(n,c,o){},hc9C:function(n,c,o){},"sg+I":function(n,c,o){}}]);
//# sourceMappingURL=styles-f81b2ebb917971093840.js.map
|
import React from 'react';
import { Button } from '@material-ui/core';
import skull from '../resources/skull.svg';
// import Modal from '@material-ui/core/Modal';
import { Router, Route, Link, browserHistory, IndexRoute } from 'react-router';
const reqSvgs = require.context ( '../resources/sweet/', true, /\.svg$/ );
const paths = reqSvgs.keys ();
class Subtraction extends React.Component {
constructor(props) {
super(props);
this.state = {value: ''};
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
handleChange(event) {
this.setState({value: event.target.value});
}
handleSubmit(event) {
let res=this.state.v1-this.state.v2;
const svgs = paths.map( path => reqSvgs ( path ) )
let item = svgs[Math.floor(Math.random() * svgs.length)];
if(res.toString()=== this.state.value){
this.setState({
Solved: 'correct',
imgsrc: item
});
}
else{
this.setState({
Solved: 'wrong',
imgsrc: item
});
}
// SimpleModal();
event.preventDefault();
}
componentWillMount(){
this.setState({
v1: this.randomizer(),
v2: this.randomizer2()
});
}
randomizer(){
return Math.floor(Math.random() * 101);
}
randomizer2(){
return Math.floor(Math.random() * 10) + 1;
}
render() {
let xButton=<Button className="chbutton" variant="contained" color="primary" onClick={this.handleSubmit} >Check Answer</Button>
if(this.state.Solved==="correct"){
xButton= <Button className="chbutton correct" variant="contained" onClick={this.handleSubmit} ><img src={this.state.imgsrc} className='butsvg' alt='correct'/></Button>
}
if(this.state.Solved==="wrong"){
xButton= <Button className="chbutton wrong" variant="contained" onClick={this.handleSubmit} ><img src={skull} className='butsvg' alt='wrong'/></Button>
}
return (
<div className='main'>
<b>{this.state.v1} - {this.state.v2} =</b><input className="result_box" type="text" value={this.state.value} onChange={this.handleChange} />
{xButton}
{/* <Modal
open={open}
onClose={handleClose}
aria-labelledby="simple-modal-title"
aria-describedby="simple-modal-description"
>
<img src={this.state.imgsrc} alt='correct'/>
</Modal> */}
</div>
);
}
}
export default Subtraction;
|
const { Logger } = require('KegLog')
const { git } = require('KegGitCli')
const { ask } = require('@keg-hub/ask-it')
const { exists } = require('@keg-hub/jsutils')
const { getGitPath } = require('KegUtils/git')
const { generalError } = require('KegUtils/error')
/**
* Git push task
* @param {Object} args - arguments passed from the runTask method
* @param {string} args.command - Initial command being run
* @param {Array} args.options - arguments passed from the command line
* @param {Object} args.tasks - All registered tasks of the CLI
* @param {Object} globalConfig - Global config object for the keg-cli
*
* @returns {void}
*/
const gitPushRepo = async args => {
const { params, globalConfig, __internal={} } = args
const { skipLog } = __internal
const { context, location: repoPath, tap, env, log, ...pushParams } = params
const location = repoPath || context && getGitPath(globalConfig, tap || context) || process.cwd()
const doPush = pushParams.force
? await ask.confirm(`Are you sure you want to force push your local changes?`)
: true
if(!doPush) return Logger.log(`Canceled git push task!`)
const { data, exitCode } = await git.branch.push({ ...pushParams, log: exists(skipLog) && !skipLog || log, location })
// Log the outcome of the git push command
exitCode === 0
? !skipLog && log && Logger.spacedMsg(`Finished pulling branch!`)
: generalError(data || `Failed pulling git branche.\nExit with code "${ resp }"`)
}
module.exports = {
push: {
name: 'push',
action: gitPushRepo,
description: `Push local changes to a remote branch`,
example: 'keg push <options>',
options: {
context: {
alias: [ 'name' ],
description: `Name or context to use when finding the current git branch`,
},
location: {
alias: [ 'path', 'loc' ],
description: `Full path location of a repository to get the current branch from. Overrides "context" option`,
},
tap: {
description: 'Name of the tap to build a Docker image for',
example: 'keg git current --tap visitapps',
},
force: {
description: `Force the git fetch action, including pruning local branches`,
default: false
},
log: {
alias: [ 'lg' ],
description: `Logs the git command being run`,
default: false
},
}
}
}
|
const helper = require('think-helper');
const nodemailer = require('nodemailer');
const assert = require('assert');
function thinkEmail(transport, options) {
assert(helper.isObject(transport), 'think-email transport required an Object');
assert(helper.isObject(options), 'think-email send email options required an Object');
// send email
const transporter = nodemailer.createTransport(transport);
return new Promise((resolve, reject) => {
transporter.sendMail(options, (error, info) => {
transporter.close();
if(error) {
reject(error);
}else {
resolve(info);
}
});
});
}
module.exports = thinkEmail;
|
// Util
const fs = require("fs");
// Slash Commands
const slash = require("../util/slash");
// CLI
const botLoader = ora("Bot aktif ediliyor.").start();
module.exports = {
event: "ready",
oneTime: true,
ws: false,
run: async (client) => {
const commandFiles = fs
.readdirSync("./src/commands")
.filter((file) => file.endsWith(".js"));
let commandsArray = [];
commandFiles.forEach((file) => {
const command = require(`../commands/${file}`);
client.commands.set(command.data.name, command);
commandsArray.push(command);
});
const finalArray = commandsArray.map((e) => e.data.toJSON());
slash.register(client.user.id, finalArray);
botLoader.succeed(`${client.user.tag}, başarıyla giriş yaptım.`);
},
};
|
var awsIotProfileTemplate =
`/*
* FreeRTOS V202112.00
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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.
*
* https://www.FreeRTOS.org
* https://aws.amazon.com/freertos
*
*/
#ifndef DEMO_CONFIG_H
#define DEMO_CONFIG_H
/* FreeRTOS config include. */
#include "FreeRTOSConfig.h"
/**************************************************/
/******* DO NOT CHANGE the following order ********/
/**************************************************/
/* Include logging header files and define logging macros in the following order:
* 1. Include the header file "logging_levels.h".
* 2. Define the LIBRARY_LOG_NAME and LIBRARY_LOG_LEVEL macros depending on
* the logging configuration for DEMO.
* 3. Include the header file "logging_stack.h", if logging is enabled for DEMO.
*/
#include "logging_levels.h"
/* Logging configuration for the Demo. */
#ifndef LIBRARY_LOG_NAME
#define LIBRARY_LOG_NAME "MQTTDemo"
#endif
#ifndef LIBRARY_LOG_LEVEL
#define LIBRARY_LOG_LEVEL LOG_INFO
#endif
#include "logging_stack.h"
/************ End of logging configuration ****************/
/**
* @brief The MQTT client identifier used in this example. Each client identifier
* must be unique; so edit as required to ensure that no two clients connecting to
* the same broker use the same client identifier.
*
* #define democonfigCLIENT_IDENTIFIER "insert here."
*/
#define democonfigCLIENT_IDENTIFIER <IOTThingName>
/**
* @brief Endpoint of the MQTT broker to connect to.
*
* This demo application can be run with any MQTT broker, that supports mutual
* authentication.
*
* For AWS IoT MQTT broker, this is the Thing's REST API Endpoint.
*
* @note Your AWS IoT Core endpoint can be found in the AWS IoT console under
* Settings/Custom Endpoint, or using the describe-endpoint REST API (with
* AWS CLI command line tool).
*
* @note If you would like to setup an MQTT broker for running this demo,
* please see \`mqtt_broker_setup.txt\`.
*
* #define democonfigMQTT_BROKER_ENDPOINT "...insert here..."
*/
#define democonfigMQTT_BROKER_ENDPOINT <IOTEndpoint>
/**
* @brief The port to use for the demo.
*
* In general, port 8883 is for secured MQTT connections.
*
* @note Port 443 requires use of the ALPN TLS extension with the ALPN protocol
* name. Using ALPN with this demo would require additional changes, including
* setting the \`pAlpnProtos\` member of the \`NetworkCredentials_t\` struct before
* forming the TLS connection. When using port 8883, ALPN is not required.
*
* #define democonfigMQTT_BROKER_PORT ( insert here. )
*/
#define democonfigMQTT_BROKER_PORT ( 8883 )
/**
* @brief Server's root CA certificate.
*
* For AWS IoT MQTT broker, this certificate is used to identify the AWS IoT
* server and is publicly available. Refer to the AWS documentation available
* in the link below.
* https://docs.aws.amazon.com/iot/latest/developerguide/server-authentication.html#server-authentication-certs
*
* @note This certificate should be PEM-encoded.
*
* Must include the PEM header and footer:
* "-----BEGIN CERTIFICATE-----\n"\
* "...base64 data...\n"\
* "-----END CERTIFICATE-----\n"
*
* #define democonfigROOT_CA_PEM "...insert here..."
*/
#define democonfigROOT_CA_PEM \\
"-----BEGIN CERTIFICATE-----\\n" \\
"MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\\n" \\
"ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\\n" \\
"b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\\n" \\
"MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\\n" \\
"b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\\n" \\
"ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\\n" \\
"9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\\n" \\
"IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\\n" \\
"VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\\n" \\
"93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\\n" \\
"jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\\n" \\
"AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\\n" \\
"A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\\n" \\
"U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\\n" \\
"N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv\\n" \\
"o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU\\n" \\
"5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\\n" \\
"rqXRfboQnoZsG4q5WTP468SQvvG5\\n" \\
"-----END CERTIFICATE-----\\n"
/**
* @brief Client certificate.
*
* For AWS IoT MQTT broker, refer to the AWS documentation below for details
* regarding client authentication.
* https://docs.aws.amazon.com/iot/latest/developerguide/client-authentication.html
*
* @note This certificate should be PEM-encoded.
*
* Must include the PEM header and footer:
* "-----BEGIN CERTIFICATE-----\n"\
* "...base64 data...\n"\
* "-----END CERTIFICATE-----\n"
*
* #define democonfigCLIENT_CERTIFICATE_PEM "...insert here..."
*/
#define democonfigCLIENT_CERTIFICATE_PEM \\
<ClientCertificatePEM>
/**
* @brief PEM-encoded client private key.
*
* Must include the PEM header and footer:
* "-----BEGIN RSA PRIVATE KEY-----\\n"\\
* "...base64 data...\\n"\\
* "-----END RSA PRIVATE KEY-----\\n"
*
* #define democonfigCLIENT_PRIVATE_KEY_PEM "...insert here..."
*/
#define democonfigCLIENT_PRIVATE_KEY_PEM \\
<ClientPrivateKeyPEM>
/**
* @brief An option to disable Server Name Indication.
*
* @note When using a local Mosquitto server setup, SNI needs to be disabled
* for an MQTT broker that only has an IP address but no hostname. However,
* SNI should be enabled whenever possible.
*/
#define democonfigDISABLE_SNI ( pdFALSE )
/**
* @brief Configuration that indicates if the demo connection is made to the AWS IoT Core MQTT broker.
*
* If username/password based authentication is used, the demo will use appropriate TLS ALPN and
* SNI configurations as required for the Custom Authentication feature of AWS IoT.
* For more information, refer to the following documentation:
* https://docs.aws.amazon.com/iot/latest/developerguide/custom-auth.html#custom-auth-mqtt
*
* #define democonfigUSE_AWS_IOT_CORE_BROKER ( 1 )
*/
#define democonfigUSE_AWS_IOT_CORE_BROKER ( 1 )
/**
* @brief The username value for authenticating client to the MQTT broker when
* username/password based client authentication is used.
*
* For AWS IoT MQTT broker, refer to the AWS IoT documentation below for
* details regarding client authentication with a username and password.
* https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html
* An authorizer setup needs to be done, as mentioned in the above link, to use
* username/password based client authentication.
*
* #define democonfigCLIENT_USERNAME "...insert here..."
*/
/**
* @brief The password value for authenticating client to the MQTT broker when
* username/password based client authentication is used.
*
* For AWS IoT MQTT broker, refer to the AWS IoT documentation below for
* details regarding client authentication with a username and password.
* https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html
* An authorizer setup needs to be done, as mentioned in the above link, to use
* username/password based client authentication.
*
* #define democonfigCLIENT_PASSWORD "...insert here..."
*/
/**
* @brief The name of the operating system that the application is running on.
* The current value is given as an example. Please update for your specific
* operating system.
*/
#define democonfigOS_NAME "FreeRTOS"
/**
* @brief The version of the operating system that the application is running
* on. The current value is given as an example. Please update for your specific
* operating system version.
*/
#define democonfigOS_VERSION tskKERNEL_VERSION_NUMBER
/**
* @brief The name of the hardware platform the application is running on. The
* current value is given as an example. Please update for your specific
* hardware platform.
*/
#define democonfigHARDWARE_PLATFORM_NAME "WinSim"
/**
* @brief The name of the MQTT library used and its version, following an "@"
* symbol.
*/
#define democonfigMQTT_LIB "core-mqtt@1.0.0"
/**
* @brief Set the stack size of the main demo task.
*
* In the Windows port, this stack only holds a structure. The actual
* stack is created by an operating system thread.
*/
#define democonfigDEMO_STACKSIZE configMINIMAL_STACK_SIZE
/**
* @brief Size of the network buffer for MQTT packets.
*/
#define democonfigNETWORK_BUFFER_SIZE ( 1024U )
#endif /* DEMO_CONFIG_H */
`;
|
var inst = require("../index").getInstance();
inst.applyConfig({ debug: true, filter: "debug" });
module.exports = inst.use("autocomplete-list-keys");
|
export default function editorUrl(config, file, lineNumber) {
const editor = config.editor;
const editors = {
sublime: 'subl://open?url=file://%path&line=%line',
textmate: 'txmt://open?url=file://%path&line=%line',
emacs: 'emacs://open?url=file://%path&line=%line',
macvim: 'mvim://open/?url=file://%path&line=%line',
phpstorm: 'phpstorm://open?file=%path&line=%line',
idea: 'idea://open?file=%path&line=%line',
vscode: 'vscode://file/%path:%line',
'vscode-insiders': 'vscode-insiders://file/%path:%line',
atom: 'atom://core/open/file?filename=%path&line=%line',
nova: 'nova://core/open/file?filename=%path&line=%line',
netbeans: 'netbeans://open/?f=%path:%line',
xdebug: 'xdebug://%path@%line',
};
file =
(config.remoteSitesPath || false).length > 0 && (config.localSitesPath || false).length > 0
? file.replace(config.remoteSitesPath, config.localSitesPath)
: file;
if (!Object.keys(editors).includes(editor)) {
console.error(
`'${editor}' is not supported. Support editors are: ${Object.keys(editors).join(', ')}`,
);
return null;
}
return editors[editor]
.replace('%path', encodeURIComponent(file))
.replace('%line', encodeURIComponent(lineNumber));
}
|
import React from 'react'
import Navbar from './Navbar'
import '../styles/global.css'
export default function Layout({children}) {
return (
<div className="layout">
<Navbar />
<div className="layoutMiddle">
{children}
</div>
<footer>Copyright 2021 cc</footer>
</div>
)
}
|
'use strict'
import React, {Component} from 'react';
import {
StyleSheet,
View,
Text,
Image,
Button,
ScrollView,
ActivityIndicator,
RefreshControl
} from 'react-native';
import {StackNavigator} from 'react-navigation';
import config from '../config';
export default class RandomScreen extends Component {
constructor(props) {
super(props);
this.state = {
isLoading: true,
error: false,
errorInfo: "",
dataArray: []
}
}
static navigationOptions = {
title: '随机一文'
};
_fetchData() {
fetch(REQUEST_RANDOM_URL).then((response) => response.json()).then((responseData) => {
this.setState({dataObject: responseData, isLoading: false});
}).catch((error) => {
this.setState({error: true, errorInfo: error})
}).done();
}
componentDidMount() {
this._fetchData();
}
_onRefresh() {
this.setState({isLoading: true});
this._fetchData();
}
_renderItemView() {
const {navigate} = this.props.navigation;
return (
<ScrollView refreshControl={
<RefreshControl
refreshing={this.state.isLoading}
onRefresh={this._onRefresh.bind(this)}
/>
}>
<View style={styles.cardView}>
<Image style={styles.imageStyle} source={{
uri: PIC_URL + '?v=' + Math.random()
}}/>
</View>
<View style={styles.viewItem1}>
<Text style={styles.todayTitle}>{this.state.dataObject.data.title}</Text>
<Text style={styles.todayAuthor}>{this.state.dataObject.data.author}</Text>
<Text style={styles.todayDigest}>{this.state.dataObject.data.digest} ...</Text>
<View style={styles.readAll}>
<Text style={styles.readAllText} onPress={() => {
navigate('Detail',{detail:this.state.dataObject.data.content,
title:this.state.dataObject.data.title});
}}>阅读全文</Text>
</View>
<Text style={styles.dateText}>{this.state.dataObject.data.date.curr}</Text>
</View>
</ScrollView>
);
}
_renderLoadingView() {
return (<ActivityIndicator animating={this.state.isLoading} style={styles.aiStyle} size="large"/>);
}
_renderErrorView() {
return (
<View>
<Text>Eror</Text>
</View>
);
}
render() {
if (this.state.isLoading && !this.state.error && typeof(this.state.dataObject) != "undefined") {
return this._renderItemView();
}else if (typeof(this.state.dataObject) == "undefined") {
return this._renderLoadingView();
}
else if (this.state.error) {
return this._renderErrorView();
}
return this._renderItemView();
}
}
const styles = StyleSheet.create({
viewItem1: {
flex: 1,
flexDirection: 'column',
backgroundColor: 'transparent',
alignItems: 'center'
},
viewItem2: {
flex: 1,
flexDirection: 'column',
backgroundColor: '#3F3F3F',
justifyContent: 'center'
},
todatTitleContainer: {
flexDirection: 'row',
alignItems: 'center'
},
todayTitle: {
color: '#262626',
fontSize: 40,
fontWeight: 'bold',
textAlign: 'center',
marginTop: 20
},
todayAuthor: {
color: '#3F3F3F',
fontWeight: 'bold',
fontSize: 16,
textAlign: 'center'
},
todayDigest: {
color: '#3F3F3F',
fontSize: 16,
textAlign: 'left',
marginLeft: 20,
marginRight: 20,
marginTop: 8
},
imageStyle: {
resizeMode: 'cover',
height: 250,
borderRadius: 5
},
cardView: {
flex: 1,
elevation: 8,
backgroundColor: '#F5F5F5',
marginLeft: 15,
marginRight: 15,
marginTop: 15,
borderRadius: 5
},
readAll: {
backgroundColor: '#3F3F3F',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
marginTop: 20,
marginBottom: 5
},
readAllText: {
paddingLeft: 20,
paddingRight: 20,
paddingTop: 10,
paddingBottom: 10,
color: 'white',
fontWeight: 'bold'
},
dateText: {
color: '#D0D0D0',
marginBottom: 10
},
placeholderImg: {
marginLeft: 15,
marginRight: 15,
marginTop: 15,
borderRadius: 5,
height: 300
},
aiStyle:{
flex:1,
justifyContent:'center',
alignItems:'center'
}
})
|
import React from 'react';
import styled from '@emotion/styled';
import Layout from './layout';
import { graphql } from 'gatsby';
const Contenido = styled.div`
max-width: 1200px;
margin: 0 auto;
width: 95%auto;
@media(min-width: 768px){
display: grid;
grid-template-columns: 2fr 1fr;
column-gap: 5rem;
}
`;
const Sidebar = styled.aside`
.precio {
font-size: 2rem;
color: #75AB00;
}
.agente {
margin-top: 4rem;
border-radius: 2rem;
background-color: #75AB00;
padding: 3rem;
color: #FFF;
p {
margin: 0;
}
}
`;
export const query = graphql`
query($id: String!) {
allStrapiPropiedades(filter: { id: { eq: $id}}) {
nodes {
nombre
estacionamiento
descripcion
habitaciones
precio
wc
}
}
}
`
function Propiedades({ data: { allStrapiPropiedades: { nodes } } }) {
const { nombre, descripcion, estacionamiento, habitaciones, wc, precio } = nodes[0];
return (
<Layout>
<h1>{nombre}</h1>
<Contenido>
<p className="precio">
{descripcion}
</p>
<Sidebar>
<p>${precio}</p>
</Sidebar>
</Contenido>
</Layout>
)
}
export default Propiedades
|
const version = require('../package.json').version;
const fs = require('fs');
if (version.indexOf('-') === -1) {
// beta, alpha, rc, dev versions are ok to go without changelog
const file = fs.readFileSync('./changelog.md', 'utf-8');
let lines = file.toString().split('\n');
// remove lines that start with -
lines = lines.filter((line) => !line.trim().startsWith('-'));
if (!lines.some((line) => line.includes(version))) {
console.error(`missing info about ${version} in changelog.md, found versions are ${JSON.stringify(lines)}`);
process.exit(1);
}
}
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tmrm = require("azure-pipelines-task-lib/mock-run");
const path = require("path");
const mocks = require("./mockWebApi");
let rootDir = path.join(__dirname, '../../Tasks', 'TagBuild');
let taskPath = path.join(rootDir, 'tagBuild.js');
let tmr = new tmrm.TaskMockRunner(taskPath);
tmr.registerMock('azure-devops-node-api/WebApi', mocks.MockWebApi);
// set variables
process.env["SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"] = "http://localhost:8080/tfs/defaultcollection";
process.env["SYSTEM_TEAMPROJECT"] = "demo";
process.env["BUILD_BUILDID"] = "1";
process.env["SYSTEM_ACCESSTOKEN"] = "faketoken";
// set inputs
tmr.setInput('tags', `tag1
tag2`);
tmr.setInput('type', 'Build');
tmr.run();
// need setTimeout because of async methods
setTimeout(() => {
if ("demo" !== mocks.MockWebApi.taggerCall.project ||
"Build" !== mocks.MockWebApi.taggerCall.callType ||
1 !== mocks.MockWebApi.taggerCall.id ||
!mocks.MockWebApi.taggerCall.tags.some(t => t === "tag1") ||
!mocks.MockWebApi.taggerCall.tags.some(t => t === "tag2") ||
mocks.MockWebApi.taggerCall.tags.length !== 2) {
console.log(mocks.MockWebApi.taggerCall);
console.error("Tagging failed.");
}
else {
console.log("Tagging successful!");
}
}, 50);
//# sourceMappingURL=test-multiTag-succeeds.js.map
|
'use strict'
const fs = require('fs')
const rpc = require('pm2-axon-rpc')
const axon = require('pm2-axon')
const log = require('debug')('interactor:daemon')
const os = require('os')
const cst = require('../constants.js')
const ReverseInteractor = require('./reverse/ReverseInteractor.js')
const PushInteractor = require('./push/PushInteractor.js')
const Utility = require('./Utility.js')
const PM2Client = require('./PM2Client.js')
const TransporterInterface = require('./TransporterInterface.js')
const domain = require('domain') // eslint-disable-line
const WatchDog = require('./WatchDog')
const InteractorClient = require('./InteractorClient')
const semver = require('semver')
const path = require('path')
const pkg = require('../package.json')
global._logs = false
const InteractorDaemon = module.exports = class InteractorDaemon {
constructor () {
this.opts = this.retrieveConf()
log(`MACHINE_NAME=${this.opts.MACHINE_NAME}`)
log(`PUBLIC_KEY=${this.opts.PUBLIC_KEY}`)
log(`WEBSOCKET_ENABLED=${process.env.AGENT_TRANSPORT_WEBSOCKET}`)
log(`AXON_ENABLED=${process.env.AGENT_TRANSPORT_AXON}`)
log(`ROOT_URL=${cst.KEYMETRICS_ROOT_URL}`)
this.DAEMON_ACTIVE = false
this.transport = new TransporterInterface(this.opts, this)
.bind('axon')
.bind('websocket')
this.transport.on('error', (err) => {
return console.error('[NETWORK] Error : ' + err.message || err)
})
this.httpClient = new Utility.HTTPClient()
this._online = true
this._internalDebugger()
}
/**
* Use process.send() if connected
* @param {Object} data
*/
sendToParent (data) {
if (!process.connected || !process.send) return console.log('Could not send data to parent')
try {
process.send(data)
} catch (e) {
console.trace('Parent process disconnected')
}
}
/**
* Get an interface for communicating with PM2 daemon
* @private
* @return {PM2Client}
*/
getPM2Client () {
if (!this._ipm2) {
this._ipm2 = new PM2Client()
}
return this._ipm2
}
/**
* Terminate aconnections and exit
* @param {cb} callback called at the end
*/
exit (err, cb) {
log('Exiting Interactor')
// clear workers
if (this._workerEndpoint) clearInterval(this._workerEndpoint)
// stop interactors
if (this.reverse) this.reverse.stop()
if (this.push) this.push.stop()
if (this._ipm2) this._ipm2.disconnect()
if (this.watchDog) this.watchDog.stop()
// stop transport
if (this.transport) this.transport.disconnect()
if (!err) {
try {
fs.unlinkSync(cst.INTERACTOR_RPC_PORT)
fs.unlinkSync(cst.INTERACTOR_PID_PATH)
} catch (err) {}
}
if (!this._rpc || !this._rpc.sock) {
return process.exit(cst.ERROR_EXIT)
}
if (typeof cb === 'function') {
cb()
}
setTimeout(() => {
this._rpc.sock.close(() => {
log('RPC server closed')
process.exit(err ? cst.ERROR_EXIT : cst.SUCCESS_EXIT)
})
}, 10)
}
/**
* Start a RPC server and expose it throught a socket file
*/
startRPC (opts) {
log('Launching Interactor RPC server (bind to %s)', cst.INTERACTOR_RPC_PORT)
const rep = axon.socket('rep')
const rpcServer = new rpc.Server(rep)
const self = this
rep.bind(cst.INTERACTOR_RPC_PORT)
rpcServer.expose({
kill: function (cb) {
log('Shutdown request received via RPC')
return self.exit(null, cb)
},
getInfos: function (cb) {
if (self.opts && self.DAEMON_ACTIVE === true) {
return cb(null, {
machine_name: self.opts.MACHINE_NAME,
public_key: self.opts.PUBLIC_KEY,
secret_key: self.opts.SECRET_KEY,
remote_host: self.km_data.endpoints.web,
connected: self.transport.isConnected(),
transporters: self.transport.getActiveTransporters(),
socket_path: cst.INTERACTOR_RPC_PORT,
pm2_home_monitored: cst.PM2_HOME
})
} else {
return cb(null)
}
}
})
return rpcServer
}
/**
* Handle specific signals to launch memory / cpu profiling
* if available in node
*/
_internalDebugger () {
// inspector isn't available under node 8
if (semver.satisfies(process.version, '<8')) return
const inspector = require('inspector')
const state = {
heap: false,
cpu: false,
session: null
}
const commands = {
heap: {
start: 'HeapProfiler.startSampling',
stop: 'HeapProfiler.stopSampling'
},
cpu: {
start: 'Profiler.start',
stop: 'Profiler.stop'
}
}
const handleSignal = type => {
return _ => {
if (state.session === null) {
state.session = new inspector.Session()
state.session.connect()
}
const isAlreadyEnabled = state[type]
const debuggerCommands = commands[type]
const profilerDomain = type === 'cpu' ? 'Profiler' : 'HeapProfiler'
const fileExt = type === 'heap' ? '.heapprofile' : '.cpuprofile'
if (isAlreadyEnabled) {
// stopping the profiling and writting it to disk if its running
console.log(`[DEBUG] Stopping ${type.toUpperCase()} Profiling`)
state.session.post(debuggerCommands.stop, (err, data) => {
const profile = data.profile
if (err) return console.error(err)
const randomId = Math.random().toString(36)
const profilePath = path.resolve(os.tmpdir(), `${type}-${randomId}${fileExt}`)
fs.writeFileSync(profilePath, JSON.stringify(profile))
console.log(`[DEBUG] Writing file in ${profilePath}`)
state[type] = false
state.session.post(`${profilerDomain}.disable`)
})
} else {
// start the profiling otherwise
console.log(`[DEBUG] Starting ${type.toUpperCase()} Profiling`)
state.session.post(`${profilerDomain}.enable`, _ => {
state.session.post(debuggerCommands.start)
state[type] = true
})
}
}
}
// use hook
process.on('SIGUSR1', handleSignal('cpu'))
process.on('SIGUSR2', handleSignal('heap'))
}
/**
* Retrieve metadata about the system
*/
getSystemMetadata () {
return {
MACHINE_NAME: this.opts.MACHINE_NAME,
PUBLIC_KEY: this.opts.PUBLIC_KEY,
RECYCLE: this.opts.RECYCLE || false,
PM2_VERSION: process.env.PM2_VERSION,
MEMORY: os.totalmem() / 1000 / 1000,
HOSTNAME: os.hostname(),
CPUS: os.cpus()
}
}
/**
* Ping root url to retrieve node info
* @private
* @param {Function} cb invoked with <Error, Object> where Object is the response sended by the server
*/
_pingRoot (cb) {
const data = this.getSystemMetadata()
this.httpClient.open({
url: this.opts.ROOT_URL + '/api/node/verifyPM2',
method: 'POST',
data: {
public_id: this.opts.PUBLIC_KEY,
private_id: this.opts.SECRET_KEY,
data: data
},
headers: {
'User-Agent': `PM2 Agent v${pkg.version}`
}
}, cb)
}
/**
* Ping root to verify retrieve and connect to the km endpoint
* @private
* @param {Function} cb invoked with <Error, Boolean>
*/
_verifyEndpoint (cb) {
if (typeof cb !== 'function') cb = function () {}
this._pingRoot((err, data) => {
if (err) {
log('Got an a error on ping root', err)
return cb(err)
}
this.km_data = data
// Verify data integrity
if (data.disabled === true || data.pending === true) {
log('Interactor is disabled by admins')
return cb(new Error('Connection refused, you might have hit the limit of agents you can connect (send email at contact@keymetrics.io for more infos)'))
}
if (data.active === false) {
log('Interactor not active: %s', data.msg || 'no message')
return cb(null, data)
}
if (!data.endpoints) {
return cb(new Error(`Endpoints field not present (${JSON.stringify(data)})`))
}
this.DAEMON_ACTIVE = true
this.transport.connect(data.endpoints, cb)
})
}
/**
* Retrieve configuration from environnement
*/
retrieveConf () {
let opts = {}
opts.MACHINE_NAME = process.env.PM2_MACHINE_NAME
opts.PUBLIC_KEY = process.env.PM2_PUBLIC_KEY
opts.SECRET_KEY = process.env.PM2_SECRET_KEY
opts.RECYCLE = process.env.KM_RECYCLE ? JSON.parse(process.env.KM_RECYCLE) : false
opts.PM2_VERSION = process.env.PM2_VERSION || '0.0.0'
opts.AGENT_TRANSPORT_AXON = process.env.AGENT_TRANSPORT_AXON
opts.AGENT_TRANSPORT_WEBSOCKET = process.env.AGENT_TRANSPORT_WEBSOCKET
opts.internal_ip = Utility.network.v4
opts.PM2_REMOTE_METHOD_ALLOWED = [
'restart',
'reload',
'reset',
'scale',
'startLogging',
'stopLogging',
'ping'
]
if (!opts.MACHINE_NAME) {
console.error('You must provide a PM2_MACHINE_NAME environment variable')
process.exit(cst.ERROR_EXIT)
} else if (!opts.PUBLIC_KEY) {
console.error('You must provide a PM2_PUBLIC_KEY environment variable')
process.exit(cst.ERROR_EXIT)
} else if (!opts.SECRET_KEY) {
console.error('You must provide a PM2_SECRET_KEY environment variable')
process.exit(cst.ERROR_EXIT)
}
return opts
}
/**
* Ping root url to retrieve node info
* @private
* @param {Function} cb invoked with <Error> [optional]
*/
start (cb) {
let retries = 0
this._rpc = this.startRPC()
this.opts.ROOT_URL = cst.KEYMETRICS_ROOT_URL
const verifyEndpointCallback = (err, result) => {
if (err) {
log('Error while trying to retrieve endpoints : ' + (err.message || err))
if (retries++ < 30 && process.env.NODE_ENV !== 'test') {
log('Retrying to retrieve endpoints...')
return setTimeout(_ => {
return this._verifyEndpoint(verifyEndpointCallback)
}, 200 * retries)
}
this.sendToParent({ error: true, msg: err.message || err })
return this.exit(new Error('Error retrieving endpoints'))
}
if (result === false) {
log('False returned while trying to retrieve endpoints')
return this.exit(new Error('Error retrieving endpoints'))
}
// send data over IPC for CLI feedback
this.sendToParent({
error: false,
km_data: this.km_data,
online: true,
pid: process.pid,
machine_name: this.opts.MACHINE_NAME,
public_key: this.opts.PUBLIC_KEY,
secret_key: this.opts.SECRET_KEY,
reverse_interaction: this.opts.REVERSE_INTERACT
})
if (result && typeof result === 'object' &&
result.error === true && result.active === false) {
log(`Error when connecting: ${result.msg}`)
return this.exit(new Error(`Error when connecting: ${result.msg}`))
}
// start workers
this._workerEndpoint = setInterval(this._verifyEndpoint.bind(this, (err, result) => {
if (err) return
// We need to exit agent if bucket is disabled (trialing)
if (result && typeof result === 'object' && result.error === true && result.active === false) {
log(`Error when connecting: ${result.msg}, disconnecting transporters`)
return this.transport.disconnect()
}
}), 60000)
// start interactors
this.watchDog = WatchDog
setTimeout(() => {
log('PM2 Watchdog started')
this.watchDog.start({
conf: {
ipm2: this.getPM2Client()
}
})
}, 1000 * 60 * 3)
this.push = new PushInteractor(this.opts, this.getPM2Client(), this.transport)
this.reverse = new ReverseInteractor(this.opts, this.getPM2Client(), this.transport)
this.push.start()
this.reverse.start()
log('Interactor daemon started')
if (cb) {
setTimeout(cb, 20)
}
}
return this._verifyEndpoint(verifyEndpointCallback)
}
}
// If its the entry file launch the daemon
// otherwise we just required it to use a function
if (require.main === module) {
const d = domain.create()
let daemon = null
d.on('error', function (err) {
console.error('-- FATAL EXCEPTION happened --')
console.error(new Date())
console.error(err.stack)
console.log('Re-initiating Agent')
InteractorClient.getOrSetConf(cst, null, (err, infos) => {
if (err || !infos) {
if (err) {
console.error('[PM2 Agent] Failed to rescue agent :')
console.error(err || new Error(`Cannot find configuration to connect to backend`))
return process.exit(1)
}
}
console.log(`[PM2 Agent] Using (Public key: ${infos.public_key}) (Private key: ${infos.secret_key}) (Info node: ${infos.info_node})`)
// Exit anyway the errored agent
var timeout = setTimeout(_ => {
console.error('Daemonization of failsafe agent did not worked')
daemon.exit(err)
}, 2000)
InteractorClient.daemonize(cst, infos, (err) => {
if (err) {
log('[PM2 Agent] Failed to rescue agent :')
log(err)
} else {
log(`Succesfully launched new agent`)
}
clearTimeout(timeout)
daemon.exit(err)
})
})
})
d.run(_ => {
daemon = new InteractorDaemon()
process.title = `PM2 Agent v${pkg.version}: (${cst.PM2_HOME})`
log('[PM2 Agent] Launching agent')
daemon.start()
})
}
|
var $localize=Object.assign(void 0===$localize?{}:$localize,{locale:"en-US"});
"use strict";(function(global){global.ng=global.ng||{};global.ng.common=global.ng.common||{};global.ng.common.locales=global.ng.common.locales||{};const u=undefined;function plural(n){const i=Math.floor(Math.abs(n)),v=n.toString().replace(/^[^.]*\.?/,"").length;if(i===1&&v===0)return 1;return 5}global.ng.common.locales["en-us-posix"]=["en-US-POSIX",[["a","p"],["AM","PM"],u],[["AM","PM"],u,u],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],u,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],u,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",u,"{1} 'at' {0}",u],[".",",",";","%","+","-","E","\xD7","0/00","INF","NaN",":"],["0.######","0%","\xA4\xA00.00","0.000000E+000"],"USD","$","US Dollar",{},"ltr",plural,[[["mi","n","in the morning","in the afternoon","in the evening","at night"],["midnight","noon","in the morning","in the afternoon","in the evening","at night"],u],[["midnight","noon","morning","afternoon","evening","night"],u,u],["00:00","12:00",["06:00","12:00"],["12:00","18:00"],["18:00","21:00"],["21:00","06:00"]]]]})(typeof globalThis!=="undefined"&&globalThis||typeof global!=="undefined"&&global||typeof window!=="undefined"&&window);;
(self.webpackChunkweb=self.webpackChunkweb||[]).push([[179],{8255:st=>{function we(N){return Promise.resolve().then(()=>{var _=new Error("Cannot find module '"+N+"'");throw _.code="MODULE_NOT_FOUND",_})}we.keys=()=>[],we.resolve=we,we.id=8255,st.exports=we},8583:(st,we,N)=>{"use strict";N.d(we,{mr:()=>Ge,ez:()=>Ti,K0:()=>Z,uU:()=>x,Do:()=>Pe,V_:()=>Ie,Ye:()=>ae,S$:()=>$e,mk:()=>Yn,sg:()=>Ln,O5:()=>Zn,RF:()=>Vn,n9:()=>Un,ED:()=>jt,b0:()=>ze,lw:()=>Ce,EM:()=>Ro,JF:()=>go,w_:()=>fe,bD:()=>Go,q:()=>me,Mx:()=>Ut,HT:()=>te});var _=N(476);let f=null;function me(){return f}function te(y){f||(f=y)}class fe{}const Z=new _.OlP("DocumentToken");let Ce=(()=>{class y{historyGo(v){throw new Error("Not implemented")}}return y.\u0275fac=function(v){return new(v||y)},y.\u0275prov=(0,_.Yz7)({factory:ke,token:y,providedIn:"platform"}),y})();function ke(){return(0,_.LFG)(Ee)}const Ie=new _.OlP("Location Initialized");let Ee=(()=>{class y extends Ce{constructor(v){super(),this._doc=v,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return me().getBaseHref(this._doc)}onPopState(v){const A=me().getGlobalEventTarget(this._doc,"window");return A.addEventListener("popstate",v,!1),()=>A.removeEventListener("popstate",v)}onHashChange(v){const A=me().getGlobalEventTarget(this._doc,"window");return A.addEventListener("hashchange",v,!1),()=>A.removeEventListener("hashchange",v)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(v){this.location.pathname=v}pushState(v,A,L){ie()?this._history.pushState(v,A,L):this.location.hash=L}replaceState(v,A,L){ie()?this._history.replaceState(v,A,L):this.location.hash=L}forward(){this._history.forward()}back(){this._history.back()}historyGo(v=0){this._history.go(v)}getState(){return this._history.state}}return y.\u0275fac=function(v){return new(v||y)(_.LFG(Z))},y.\u0275prov=(0,_.Yz7)({factory:_e,token:y,providedIn:"platform"}),y})();function ie(){return!!window.history.pushState}function _e(){return new Ee((0,_.LFG)(Z))}function ge(y,w){if(0==y.length)return w;if(0==w.length)return y;let v=0;return y.endsWith("/")&&v++,w.startsWith("/")&&v++,2==v?y+w.substring(1):1==v?y+w:y+"/"+w}function Se(y){const w=y.match(/#|\?|$/),v=w&&w.index||y.length;return y.slice(0,v-("/"===y[v-1]?1:0))+y.slice(v)}function he(y){return y&&"?"!==y[0]?"?"+y:y}let $e=(()=>{class y{historyGo(v){throw new Error("Not implemented")}}return y.\u0275fac=function(v){return new(v||y)},y.\u0275prov=(0,_.Yz7)({factory:Ae,token:y,providedIn:"root"}),y})();function Ae(y){const w=(0,_.LFG)(Z).location;return new ze((0,_.LFG)(Ce),w&&w.origin||"")}const Ge=new _.OlP("appBaseHref");let ze=(()=>{class y extends $e{constructor(v,A){if(super(),this._platformLocation=v,this._removeListenerFns=[],null==A&&(A=this._platformLocation.getBaseHrefFromDOM()),null==A)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=A}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(v){this._removeListenerFns.push(this._platformLocation.onPopState(v),this._platformLocation.onHashChange(v))}getBaseHref(){return this._baseHref}prepareExternalUrl(v){return ge(this._baseHref,v)}path(v=!1){const A=this._platformLocation.pathname+he(this._platformLocation.search),L=this._platformLocation.hash;return L&&v?`${A}${L}`:A}pushState(v,A,L,X){const le=this.prepareExternalUrl(L+he(X));this._platformLocation.pushState(v,A,le)}replaceState(v,A,L,X){const le=this.prepareExternalUrl(L+he(X));this._platformLocation.replaceState(v,A,le)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(v=0){var A,L;null===(L=(A=this._platformLocation).historyGo)||void 0===L||L.call(A,v)}}return y.\u0275fac=function(v){return new(v||y)(_.LFG(Ce),_.LFG(Ge,8))},y.\u0275prov=_.Yz7({token:y,factory:y.\u0275fac}),y})(),Pe=(()=>{class y extends $e{constructor(v,A){super(),this._platformLocation=v,this._baseHref="",this._removeListenerFns=[],null!=A&&(this._baseHref=A)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(v){this._removeListenerFns.push(this._platformLocation.onPopState(v),this._platformLocation.onHashChange(v))}getBaseHref(){return this._baseHref}path(v=!1){let A=this._platformLocation.hash;return null==A&&(A="#"),A.length>0?A.substring(1):A}prepareExternalUrl(v){const A=ge(this._baseHref,v);return A.length>0?"#"+A:A}pushState(v,A,L,X){let le=this.prepareExternalUrl(L+he(X));0==le.length&&(le=this._platformLocation.pathname),this._platformLocation.pushState(v,A,le)}replaceState(v,A,L,X){let le=this.prepareExternalUrl(L+he(X));0==le.length&&(le=this._platformLocation.pathname),this._platformLocation.replaceState(v,A,le)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(v=0){var A,L;null===(L=(A=this._platformLocation).historyGo)||void 0===L||L.call(A,v)}}return y.\u0275fac=function(v){return new(v||y)(_.LFG(Ce),_.LFG(Ge,8))},y.\u0275prov=_.Yz7({token:y,factory:y.\u0275fac}),y})(),ae=(()=>{class y{constructor(v,A){this._subject=new _.vpe,this._urlChangeListeners=[],this._platformStrategy=v;const L=this._platformStrategy.getBaseHref();this._platformLocation=A,this._baseHref=Se(je(L)),this._platformStrategy.onPopState(X=>{this._subject.emit({url:this.path(!0),pop:!0,state:X.state,type:X.type})})}path(v=!1){return this.normalize(this._platformStrategy.path(v))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(v,A=""){return this.path()==this.normalize(v+he(A))}normalize(v){return y.stripTrailingSlash(function(y,w){return y&&w.startsWith(y)?w.substring(y.length):w}(this._baseHref,je(v)))}prepareExternalUrl(v){return v&&"/"!==v[0]&&(v="/"+v),this._platformStrategy.prepareExternalUrl(v)}go(v,A="",L=null){this._platformStrategy.pushState(L,"",v,A),this._notifyUrlChangeListeners(this.prepareExternalUrl(v+he(A)),L)}replaceState(v,A="",L=null){this._platformStrategy.replaceState(L,"",v,A),this._notifyUrlChangeListeners(this.prepareExternalUrl(v+he(A)),L)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(v=0){var A,L;null===(L=(A=this._platformStrategy).historyGo)||void 0===L||L.call(A,v)}onUrlChange(v){this._urlChangeListeners.push(v),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(A=>{this._notifyUrlChangeListeners(A.url,A.state)}))}_notifyUrlChangeListeners(v="",A){this._urlChangeListeners.forEach(L=>L(v,A))}subscribe(v,A,L){return this._subject.subscribe({next:v,error:A,complete:L})}}return y.\u0275fac=function(v){return new(v||y)(_.LFG($e),_.LFG(Ce))},y.normalizeQueryParams=he,y.joinWithSlash=ge,y.stripTrailingSlash=Se,y.\u0275prov=(0,_.Yz7)({factory:Ye,token:y,providedIn:"root"}),y})();function Ye(){return new ae((0,_.LFG)($e),(0,_.LFG)(Ce))}function je(y){return y.replace(/\/index.html$/,"")}var U=(()=>((U=U||{})[U.Zero=0]="Zero",U[U.One=1]="One",U[U.Two=2]="Two",U[U.Few=3]="Few",U[U.Many=4]="Many",U[U.Other=5]="Other",U))(),Y=(()=>((Y=Y||{})[Y.Format=0]="Format",Y[Y.Standalone=1]="Standalone",Y))(),ne=(()=>((ne=ne||{})[ne.Narrow=0]="Narrow",ne[ne.Abbreviated=1]="Abbreviated",ne[ne.Wide=2]="Wide",ne[ne.Short=3]="Short",ne))(),De=(()=>((De=De||{})[De.Short=0]="Short",De[De.Medium=1]="Medium",De[De.Long=2]="Long",De[De.Full=3]="Full",De))(),K=(()=>((K=K||{})[K.Decimal=0]="Decimal",K[K.Group=1]="Group",K[K.List=2]="List",K[K.PercentSign=3]="PercentSign",K[K.PlusSign=4]="PlusSign",K[K.MinusSign=5]="MinusSign",K[K.Exponential=6]="Exponential",K[K.SuperscriptingExponent=7]="SuperscriptingExponent",K[K.PerMille=8]="PerMille",K[K.Infinity=9]="Infinity",K[K.NaN=10]="NaN",K[K.TimeSeparator=11]="TimeSeparator",K[K.CurrencyDecimal=12]="CurrencyDecimal",K[K.CurrencyGroup=13]="CurrencyGroup",K))();function Vt(y,w){return gt((0,_.cg1)(y)[_.wAp.DateFormat],w)}function Gt(y,w){return gt((0,_.cg1)(y)[_.wAp.TimeFormat],w)}function Tt(y,w){return gt((0,_.cg1)(y)[_.wAp.DateTimeFormat],w)}function Xt(y,w){const v=(0,_.cg1)(y),A=v[_.wAp.NumberSymbols][w];if(void 0===A){if(w===K.CurrencyDecimal)return v[_.wAp.NumberSymbols][K.Decimal];if(w===K.CurrencyGroup)return v[_.wAp.NumberSymbols][K.Group]}return A}const Cn=_.kL8;function xn(y){if(!y[_.wAp.ExtraData])throw new Error(`Missing extra locale data for the locale "${y[_.wAp.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function gt(y,w){for(let v=w;v>-1;v--)if(void 0!==y[v])return y[v];throw new Error("Locale data API: locale data undefined")}function tr(y){const[w,v]=y.split(":");return{hours:+w,minutes:+v}}const j=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,ue={},ce=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;var Ne=(()=>((Ne=Ne||{})[Ne.Short=0]="Short",Ne[Ne.ShortGMT=1]="ShortGMT",Ne[Ne.Long=2]="Long",Ne[Ne.Extended=3]="Extended",Ne))(),J=(()=>((J=J||{})[J.FullYear=0]="FullYear",J[J.Month=1]="Month",J[J.Date=2]="Date",J[J.Hours=3]="Hours",J[J.Minutes=4]="Minutes",J[J.Seconds=5]="Seconds",J[J.FractionalSeconds=6]="FractionalSeconds",J[J.Day=7]="Day",J))(),xe=(()=>((xe=xe||{})[xe.DayPeriods=0]="DayPeriods",xe[xe.Days=1]="Days",xe[xe.Months=2]="Months",xe[xe.Eras=3]="Eras",xe))();function Oe(y,w,v,A){let L=function(y){if(Fn(y))return y;if("number"==typeof y&&!isNaN(y))return new Date(y);if("string"==typeof y){if(y=y.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(y)){const[L,X=1,le=1]=y.split("-").map(Be=>+Be);return At(L,X-1,le)}const v=parseFloat(y);if(!isNaN(y-v))return new Date(v);let A;if(A=y.match(j))return function(y){const w=new Date(0);let v=0,A=0;const L=y[8]?w.setUTCFullYear:w.setFullYear,X=y[8]?w.setUTCHours:w.setHours;y[9]&&(v=Number(y[9]+y[10]),A=Number(y[9]+y[11])),L.call(w,Number(y[1]),Number(y[2])-1,Number(y[3]));const le=Number(y[4]||0)-v,Be=Number(y[5]||0)-A,Et=Number(y[6]||0),E=Math.floor(1e3*parseFloat("0."+(y[7]||0)));return X.call(w,le,Be,Et,E),w}(A)}const w=new Date(y);if(!Fn(w))throw new Error(`Unable to convert "${y}" into a date`);return w}(y);w=xt(v,w)||w;let Be,le=[];for(;w;){if(Be=ce.exec(w),!Be){le.push(w);break}{le=le.concat(Be.slice(1));const m=le.pop();if(!m)break;w=m}}let Et=L.getTimezoneOffset();A&&(Et=br(A,Et),L=function(y,w,v){const L=y.getTimezoneOffset();return function(y,w){return(y=new Date(y.getTime())).setMinutes(y.getMinutes()+w),y}(y,-1*(br(w,L)-L))}(L,A));let E="";return le.forEach(m=>{const h=function(y){if(mt[y])return mt[y];let w;switch(y){case"G":case"GG":case"GGG":w=Fe(xe.Eras,ne.Abbreviated);break;case"GGGG":w=Fe(xe.Eras,ne.Wide);break;case"GGGGG":w=Fe(xe.Eras,ne.Narrow);break;case"y":w=ot(J.FullYear,1,0,!1,!0);break;case"yy":w=ot(J.FullYear,2,0,!0,!0);break;case"yyy":w=ot(J.FullYear,3,0,!1,!0);break;case"yyyy":w=ot(J.FullYear,4,0,!1,!0);break;case"Y":w=Pn(1);break;case"YY":w=Pn(2,!0);break;case"YYY":w=Pn(3);break;case"YYYY":w=Pn(4);break;case"M":case"L":w=ot(J.Month,1,1);break;case"MM":case"LL":w=ot(J.Month,2,1);break;case"MMM":w=Fe(xe.Months,ne.Abbreviated);break;case"MMMM":w=Fe(xe.Months,ne.Wide);break;case"MMMMM":w=Fe(xe.Months,ne.Narrow);break;case"LLL":w=Fe(xe.Months,ne.Abbreviated,Y.Standalone);break;case"LLLL":w=Fe(xe.Months,ne.Wide,Y.Standalone);break;case"LLLLL":w=Fe(xe.Months,ne.Narrow,Y.Standalone);break;case"w":w=ho(1);break;case"ww":w=ho(2);break;case"W":w=ho(1,!0);break;case"d":w=ot(J.Date,1);break;case"dd":w=ot(J.Date,2);break;case"c":case"cc":w=ot(J.Day,1);break;case"ccc":w=Fe(xe.Days,ne.Abbreviated,Y.Standalone);break;case"cccc":w=Fe(xe.Days,ne.Wide,Y.Standalone);break;case"ccccc":w=Fe(xe.Days,ne.Narrow,Y.Standalone);break;case"cccccc":w=Fe(xe.Days,ne.Short,Y.Standalone);break;case"E":case"EE":case"EEE":w=Fe(xe.Days,ne.Abbreviated);break;case"EEEE":w=Fe(xe.Days,ne.Wide);break;case"EEEEE":w=Fe(xe.Days,ne.Narrow);break;case"EEEEEE":w=Fe(xe.Days,ne.Short);break;case"a":case"aa":case"aaa":w=Fe(xe.DayPeriods,ne.Abbreviated);break;case"aaaa":w=Fe(xe.DayPeriods,ne.Wide);break;case"aaaaa":w=Fe(xe.DayPeriods,ne.Narrow);break;case"b":case"bb":case"bbb":w=Fe(xe.DayPeriods,ne.Abbreviated,Y.Standalone,!0);break;case"bbbb":w=Fe(xe.DayPeriods,ne.Wide,Y.Standalone,!0);break;case"bbbbb":w=Fe(xe.DayPeriods,ne.Narrow,Y.Standalone,!0);break;case"B":case"BB":case"BBB":w=Fe(xe.DayPeriods,ne.Abbreviated,Y.Format,!0);break;case"BBBB":w=Fe(xe.DayPeriods,ne.Wide,Y.Format,!0);break;case"BBBBB":w=Fe(xe.DayPeriods,ne.Narrow,Y.Format,!0);break;case"h":w=ot(J.Hours,1,-12);break;case"hh":w=ot(J.Hours,2,-12);break;case"H":w=ot(J.Hours,1);break;case"HH":w=ot(J.Hours,2);break;case"m":w=ot(J.Minutes,1);break;case"mm":w=ot(J.Minutes,2);break;case"s":w=ot(J.Seconds,1);break;case"ss":w=ot(J.Seconds,2);break;case"S":w=ot(J.FractionalSeconds,1);break;case"SS":w=ot(J.FractionalSeconds,2);break;case"SSS":w=ot(J.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":w=nn(Ne.Short);break;case"ZZZZZ":w=nn(Ne.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":w=nn(Ne.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":w=nn(Ne.Long);break;default:return null}return mt[y]=w,w}(m);E+=h?h(L,v,Et):"''"===m?"'":m.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),E}function At(y,w,v){const A=new Date(0);return A.setFullYear(y,w,v),A.setHours(0,0,0),A}function xt(y,w){const v=function(y){return(0,_.cg1)(y)[_.wAp.LocaleId]}(y);if(ue[v]=ue[v]||{},ue[v][w])return ue[v][w];let A="";switch(w){case"shortDate":A=Vt(y,De.Short);break;case"mediumDate":A=Vt(y,De.Medium);break;case"longDate":A=Vt(y,De.Long);break;case"fullDate":A=Vt(y,De.Full);break;case"shortTime":A=Gt(y,De.Short);break;case"mediumTime":A=Gt(y,De.Medium);break;case"longTime":A=Gt(y,De.Long);break;case"fullTime":A=Gt(y,De.Full);break;case"short":const L=xt(y,"shortTime"),X=xt(y,"shortDate");A=Gn(Tt(y,De.Short),[L,X]);break;case"medium":const le=xt(y,"mediumTime"),Be=xt(y,"mediumDate");A=Gn(Tt(y,De.Medium),[le,Be]);break;case"long":const Et=xt(y,"longTime"),E=xt(y,"longDate");A=Gn(Tt(y,De.Long),[Et,E]);break;case"full":const m=xt(y,"fullTime"),h=xt(y,"fullDate");A=Gn(Tt(y,De.Full),[m,h])}return A&&(ue[v][w]=A),A}function Gn(y,w){return w&&(y=y.replace(/\{([^}]+)}/g,function(v,A){return null!=w&&A in w?w[A]:v})),y}function bt(y,w,v="-",A,L){let X="";(y<0||L&&y<=0)&&(L?y=1-y:(y=-y,X=v));let le=String(y);for(;le.length<w;)le="0"+le;return A&&(le=le.substr(le.length-w)),X+le}function ot(y,w,v=0,A=!1,L=!1){return function(X,le){let Be=function(y,w){switch(y){case J.FullYear:return w.getFullYear();case J.Month:return w.getMonth();case J.Date:return w.getDate();case J.Hours:return w.getHours();case J.Minutes:return w.getMinutes();case J.Seconds:return w.getSeconds();case J.FractionalSeconds:return w.getMilliseconds();case J.Day:return w.getDay();default:throw new Error(`Unknown DateType value "${y}".`)}}(y,X);if((v>0||Be>-v)&&(Be+=v),y===J.Hours)0===Be&&-12===v&&(Be=12);else if(y===J.FractionalSeconds)return function(y,w){return bt(y,3).substr(0,w)}(Be,w);const Et=Xt(le,K.MinusSign);return bt(Be,w,Et,A,L)}}function Fe(y,w,v=Y.Format,A=!1){return function(L,X){return function(y,w,v,A,L,X){switch(v){case xe.Months:return function(y,w,v){const A=(0,_.cg1)(y),X=gt([A[_.wAp.MonthsFormat],A[_.wAp.MonthsStandalone]],w);return gt(X,v)}(w,L,A)[y.getMonth()];case xe.Days:return function(y,w,v){const A=(0,_.cg1)(y),X=gt([A[_.wAp.DaysFormat],A[_.wAp.DaysStandalone]],w);return gt(X,v)}(w,L,A)[y.getDay()];case xe.DayPeriods:const le=y.getHours(),Be=y.getMinutes();if(X){const E=function(y){const w=(0,_.cg1)(y);return xn(w),(w[_.wAp.ExtraData][2]||[]).map(A=>"string"==typeof A?tr(A):[tr(A[0]),tr(A[1])])}(w),m=function(y,w,v){const A=(0,_.cg1)(y);xn(A);const X=gt([A[_.wAp.ExtraData][0],A[_.wAp.ExtraData][1]],w)||[];return gt(X,v)||[]}(w,L,A),h=E.findIndex(M=>{if(Array.isArray(M)){const[G,ve]=M,wt=le>=G.hours&&Be>=G.minutes,sn=le<ve.hours||le===ve.hours&&Be<ve.minutes;if(G.hours<ve.hours){if(wt&&sn)return!0}else if(wt||sn)return!0}else if(M.hours===le&&M.minutes===Be)return!0;return!1});if(-1!==h)return m[h]}return function(y,w,v){const A=(0,_.cg1)(y),X=gt([A[_.wAp.DayPeriodsFormat],A[_.wAp.DayPeriodsStandalone]],w);return gt(X,v)}(w,L,A)[le<12?0:1];case xe.Eras:return function(y,w){return gt((0,_.cg1)(y)[_.wAp.Eras],w)}(w,A)[y.getFullYear()<=0?0:1];default:throw new Error(`unexpected translation type ${v}`)}}(L,X,y,w,v,A)}}function nn(y){return function(w,v,A){const L=-1*A,X=Xt(v,K.MinusSign),le=L>0?Math.floor(L/60):Math.ceil(L/60);switch(y){case Ne.Short:return(L>=0?"+":"")+bt(le,2,X)+bt(Math.abs(L%60),2,X);case Ne.ShortGMT:return"GMT"+(L>=0?"+":"")+bt(le,1,X);case Ne.Long:return"GMT"+(L>=0?"+":"")+bt(le,2,X)+":"+bt(Math.abs(L%60),2,X);case Ne.Extended:return 0===A?"Z":(L>=0?"+":"")+bt(le,2,X)+":"+bt(Math.abs(L%60),2,X);default:throw new Error(`Unknown zone width "${y}"`)}}}function Tn(y){return At(y.getFullYear(),y.getMonth(),y.getDate()+(4-y.getDay()))}function ho(y,w=!1){return function(v,A){let L;if(w){const X=new Date(v.getFullYear(),v.getMonth(),1).getDay()-1,le=v.getDate();L=1+Math.floor((le+X)/7)}else{const X=Tn(v),le=function(y){const w=At(y,0,1).getDay();return At(y,0,1+(w<=4?4:11)-w)}(X.getFullYear()),Be=X.getTime()-le.getTime();L=1+Math.round(Be/6048e5)}return bt(L,y,Xt(A,K.MinusSign))}}function Pn(y,w=!1){return function(v,A){return bt(Tn(v).getFullYear(),y,Xt(A,K.MinusSign),w)}}const mt={};function br(y,w){y=y.replace(/:/g,"");const v=Date.parse("Jan 01, 1970 00:00:00 "+y)/6e4;return isNaN(v)?w:v}function Fn(y){return y instanceof Date&&!isNaN(y.valueOf())}class et{}let pt=(()=>{class y extends et{constructor(v){super(),this.locale=v}getPluralCategory(v,A){switch(Cn(A||this.locale)(v)){case U.Zero:return"zero";case U.One:return"one";case U.Two:return"two";case U.Few:return"few";case U.Many:return"many";default:return"other"}}}return y.\u0275fac=function(v){return new(v||y)(_.LFG(_.soG))},y.\u0275prov=_.Yz7({token:y,factory:y.\u0275fac}),y})();function Ut(y,w){w=encodeURIComponent(w);for(const v of y.split(";")){const A=v.indexOf("="),[L,X]=-1==A?[v,""]:[v.slice(0,A),v.slice(A+1)];if(L.trim()===w)return decodeURIComponent(X)}return null}let Yn=(()=>{class y{constructor(v,A,L,X){this._iterableDiffers=v,this._keyValueDiffers=A,this._ngEl=L,this._renderer=X,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(v){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof v?v.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(v){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof v?v.split(/\s+/):v,this._rawClass&&((0,_.sIi)(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const v=this._iterableDiffer.diff(this._rawClass);v&&this._applyIterableChanges(v)}else if(this._keyValueDiffer){const v=this._keyValueDiffer.diff(this._rawClass);v&&this._applyKeyValueChanges(v)}}_applyKeyValueChanges(v){v.forEachAddedItem(A=>this._toggleClass(A.key,A.currentValue)),v.forEachChangedItem(A=>this._toggleClass(A.key,A.currentValue)),v.forEachRemovedItem(A=>{A.previousValue&&this._toggleClass(A.key,!1)})}_applyIterableChanges(v){v.forEachAddedItem(A=>{if("string"!=typeof A.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${(0,_.AaK)(A.item)}`);this._toggleClass(A.item,!0)}),v.forEachRemovedItem(A=>this._toggleClass(A.item,!1))}_applyClasses(v){v&&(Array.isArray(v)||v instanceof Set?v.forEach(A=>this._toggleClass(A,!0)):Object.keys(v).forEach(A=>this._toggleClass(A,!!v[A])))}_removeClasses(v){v&&(Array.isArray(v)||v instanceof Set?v.forEach(A=>this._toggleClass(A,!1)):Object.keys(v).forEach(A=>this._toggleClass(A,!1)))}_toggleClass(v,A){(v=v.trim())&&v.split(/\s+/g).forEach(L=>{A?this._renderer.addClass(this._ngEl.nativeElement,L):this._renderer.removeClass(this._ngEl.nativeElement,L)})}}return y.\u0275fac=function(v){return new(v||y)(_.Y36(_.ZZ4),_.Y36(_.aQg),_.Y36(_.SBq),_.Y36(_.Qsj))},y.\u0275dir=_.lG2({type:y,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),y})();class wr{constructor(w,v,A,L){this.$implicit=w,this.ngForOf=v,this.index=A,this.count=L}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Ln=(()=>{class y{constructor(v,A,L){this._viewContainer=v,this._template=A,this._differs=L,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(v){this._ngForOf=v,this._ngForOfDirty=!0}set ngForTrackBy(v){this._trackByFn=v}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(v){v&&(this._template=v)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const v=this._ngForOf;if(!this._differ&&v)try{this._differ=this._differs.find(v).create(this.ngForTrackBy)}catch(A){throw new Error(`Cannot find a differ supporting object '${v}' of type '${function(y){return y.name||typeof y}(v)}'. NgFor only supports binding to Iterables such as Arrays.`)}}if(this._differ){const v=this._differ.diff(this._ngForOf);v&&this._applyChanges(v)}}_applyChanges(v){const A=[];v.forEachOperation((L,X,le)=>{if(null==L.previousIndex){const Be=this._viewContainer.createEmbeddedView(this._template,new wr(null,this._ngForOf,-1,-1),null===le?void 0:le),Et=new Ze(L,Be);A.push(Et)}else if(null==le)this._viewContainer.remove(null===X?void 0:X);else if(null!==X){const Be=this._viewContainer.get(X);this._viewContainer.move(Be,le);const Et=new Ze(L,Be);A.push(Et)}});for(let L=0;L<A.length;L++)this._perViewChange(A[L].view,A[L].record);for(let L=0,X=this._viewContainer.length;L<X;L++){const le=this._viewContainer.get(L);le.context.index=L,le.context.count=X,le.context.ngForOf=this._ngForOf}v.forEachIdentityChange(L=>{this._viewContainer.get(L.currentIndex).context.$implicit=L.item})}_perViewChange(v,A){v.context.$implicit=A.item}static ngTemplateContextGuard(v,A){return!0}}return y.\u0275fac=function(v){return new(v||y)(_.Y36(_.s_b),_.Y36(_.Rgc),_.Y36(_.ZZ4))},y.\u0275dir=_.lG2({type:y,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),y})();class Ze{constructor(w,v){this.record=w,this.view=v}}let Zn=(()=>{class y{constructor(v,A){this._viewContainer=v,this._context=new en,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=A}set ngIf(v){this._context.$implicit=this._context.ngIf=v,this._updateView()}set ngIfThen(v){fn("ngIfThen",v),this._thenTemplateRef=v,this._thenViewRef=null,this._updateView()}set ngIfElse(v){fn("ngIfElse",v),this._elseTemplateRef=v,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(v,A){return!0}}return y.\u0275fac=function(v){return new(v||y)(_.Y36(_.s_b),_.Y36(_.Rgc))},y.\u0275dir=_.lG2({type:y,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),y})();class en{constructor(){this.$implicit=null,this.ngIf=null}}function fn(y,w){if(w&&!w.createEmbeddedView)throw new Error(`${y} must be a TemplateRef, but received '${(0,_.AaK)(w)}'.`)}class Bt{constructor(w,v){this._viewContainerRef=w,this._templateRef=v,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(w){w&&!this._created?this.create():!w&&this._created&&this.destroy()}}let Vn=(()=>{class y{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(v){this._ngSwitch=v,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(v){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(v)}_matchCase(v){const A=v==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||A,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),A}_updateDefaultCases(v){if(this._defaultViews&&v!==this._defaultUsed){this._defaultUsed=v;for(let A=0;A<this._defaultViews.length;A++)this._defaultViews[A].enforceState(v)}}}return y.\u0275fac=function(v){return new(v||y)},y.\u0275dir=_.lG2({type:y,selectors:[["","ngSwitch",""]],inputs:{ngSwitch:"ngSwitch"}}),y})(),Un=(()=>{class y{constructor(v,A,L){this.ngSwitch=L,L._addCase(),this._view=new Bt(v,A)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return y.\u0275fac=function(v){return new(v||y)(_.Y36(_.s_b),_.Y36(_.Rgc),_.Y36(Vn,9))},y.\u0275dir=_.lG2({type:y,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),y})(),jt=(()=>{class y{constructor(v,A,L){L._addDefault(new Bt(v,A))}}return y.\u0275fac=function(v){return new(v||y)(_.Y36(_.s_b),_.Y36(_.Rgc),_.Y36(Vn,9))},y.\u0275dir=_.lG2({type:y,selectors:[["","ngSwitchDefault",""]]}),y})();let x=(()=>{class y{constructor(v){this.locale=v}transform(v,A="mediumDate",L,X){if(null==v||""===v||v!=v)return null;try{return Oe(v,A,X||this.locale,L)}catch(le){throw function(y,w){return Error(`InvalidPipeArgument: '${w}' for pipe '${(0,_.AaK)(y)}'`)}(y,le.message)}}}return y.\u0275fac=function(v){return new(v||y)(_.Y36(_.soG,16))},y.\u0275pipe=_.Yjl({name:"date",type:y,pure:!0}),y})(),Ti=(()=>{class y{}return y.\u0275fac=function(v){return new(v||y)},y.\u0275mod=_.oAB({type:y}),y.\u0275inj=_.cJS({providers:[{provide:et,useClass:pt}]}),y})();const Go="browser";let Ro=(()=>{class y{}return y.\u0275prov=(0,_.Yz7)({token:y,providedIn:"root",factory:()=>new No((0,_.LFG)(Z),window)}),y})();class No{constructor(w,v){this.document=w,this.window=v,this.offset=()=>[0,0]}setOffset(w){this.offset=Array.isArray(w)?()=>w:w}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(w){this.supportsScrolling()&&this.window.scrollTo(w[0],w[1])}scrollToAnchor(w){if(!this.supportsScrolling())return;const v=function(y,w){const v=y.getElementById(w)||y.getElementsByName(w)[0];if(v)return v;if("function"==typeof y.createTreeWalker&&y.body&&(y.body.createShadowRoot||y.body.attachShadow)){const A=y.createTreeWalker(y.body,NodeFilter.SHOW_ELEMENT);let L=A.currentNode;for(;L;){const X=L.shadowRoot;if(X){const le=X.getElementById(w)||X.querySelector(`[name="${w}"]`);if(le)return le}L=A.nextNode()}}return null}(this.document,w);v&&(this.scrollToElement(v),this.attemptFocus(v))}setHistoryScrollRestoration(w){if(this.supportScrollRestoration()){const v=this.window.history;v&&v.scrollRestoration&&(v.scrollRestoration=w)}}scrollToElement(w){const v=w.getBoundingClientRect(),A=v.left+this.window.pageXOffset,L=v.top+this.window.pageYOffset,X=this.offset();this.window.scrollTo(A-X[0],L-X[1])}attemptFocus(w){return w.focus(),this.document.activeElement===w}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const w=Nr(this.window.history)||Nr(Object.getPrototypeOf(this.window.history));return!(!w||!w.writable&&!w.set)}catch(w){return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch(w){return!1}}}function Nr(y){return Object.getOwnPropertyDescriptor(y,"scrollRestoration")}class go{}},1841:(st,we,N)=>{"use strict";N.d(we,{TP:()=>q,eN:()=>K,JF:()=>gt,WM:()=>Ie});var _=N(8583),f=N(476),me=N(1964),oe=N(1776),te=N(3766),fe=N(4689),Z=N(5207);class Ce{}class ke{}class Ie{constructor(B){this.normalizedNames=new Map,this.lazyUpdate=null,B?this.lazyInit="string"==typeof B?()=>{this.headers=new Map,B.split("\n").forEach(j=>{const ue=j.indexOf(":");if(ue>0){const ce=j.slice(0,ue),Ne=ce.toLowerCase(),J=j.slice(ue+1).trim();this.maybeSetNormalizedName(ce,Ne),this.headers.has(Ne)?this.headers.get(Ne).push(J):this.headers.set(Ne,[J])}})}:()=>{this.headers=new Map,Object.keys(B).forEach(j=>{let ue=B[j];const ce=j.toLowerCase();"string"==typeof ue&&(ue=[ue]),ue.length>0&&(this.headers.set(ce,ue),this.maybeSetNormalizedName(j,ce))})}:this.headers=new Map}has(B){return this.init(),this.headers.has(B.toLowerCase())}get(B){this.init();const j=this.headers.get(B.toLowerCase());return j&&j.length>0?j[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(B){return this.init(),this.headers.get(B.toLowerCase())||null}append(B,j){return this.clone({name:B,value:j,op:"a"})}set(B,j){return this.clone({name:B,value:j,op:"s"})}delete(B,j){return this.clone({name:B,value:j,op:"d"})}maybeSetNormalizedName(B,j){this.normalizedNames.has(j)||this.normalizedNames.set(j,B)}init(){this.lazyInit&&(this.lazyInit instanceof Ie?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(B=>this.applyUpdate(B)),this.lazyUpdate=null))}copyFrom(B){B.init(),Array.from(B.headers.keys()).forEach(j=>{this.headers.set(j,B.headers.get(j)),this.normalizedNames.set(j,B.normalizedNames.get(j))})}clone(B){const j=new Ie;return j.lazyInit=this.lazyInit&&this.lazyInit instanceof Ie?this.lazyInit:this,j.lazyUpdate=(this.lazyUpdate||[]).concat([B]),j}applyUpdate(B){const j=B.name.toLowerCase();switch(B.op){case"a":case"s":let ue=B.value;if("string"==typeof ue&&(ue=[ue]),0===ue.length)return;this.maybeSetNormalizedName(B.name,j);const ce=("a"===B.op?this.headers.get(j):void 0)||[];ce.push(...ue),this.headers.set(j,ce);break;case"d":const Ne=B.value;if(Ne){let J=this.headers.get(j);if(!J)return;J=J.filter(xe=>-1===Ne.indexOf(xe)),0===J.length?(this.headers.delete(j),this.normalizedNames.delete(j)):this.headers.set(j,J)}else this.headers.delete(j),this.normalizedNames.delete(j)}}forEach(B){this.init(),Array.from(this.normalizedNames.keys()).forEach(j=>B(this.normalizedNames.get(j),this.headers.get(j)))}}class Ee{encodeKey(B){return Se(B)}encodeValue(B){return Se(B)}decodeKey(B){return decodeURIComponent(B)}decodeValue(B){return decodeURIComponent(B)}}const _e=/%(\d[a-f0-9])/gi,ge={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Se(se){return encodeURIComponent(se).replace(_e,(B,j)=>{var ue;return null!==(ue=ge[j])&&void 0!==ue?ue:B})}function he(se){return`${se}`}class $e{constructor(B={}){if(this.updates=null,this.cloneFrom=null,this.encoder=B.encoder||new Ee,B.fromString){if(B.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(se,B){const j=new Map;return se.length>0&&se.replace(/^\?/,"").split("&").forEach(ce=>{const Ne=ce.indexOf("="),[J,xe]=-1==Ne?[B.decodeKey(ce),""]:[B.decodeKey(ce.slice(0,Ne)),B.decodeValue(ce.slice(Ne+1))],Oe=j.get(J)||[];Oe.push(xe),j.set(J,Oe)}),j}(B.fromString,this.encoder)}else B.fromObject?(this.map=new Map,Object.keys(B.fromObject).forEach(j=>{const ue=B.fromObject[j];this.map.set(j,Array.isArray(ue)?ue:[ue])})):this.map=null}has(B){return this.init(),this.map.has(B)}get(B){this.init();const j=this.map.get(B);return j?j[0]:null}getAll(B){return this.init(),this.map.get(B)||null}keys(){return this.init(),Array.from(this.map.keys())}append(B,j){return this.clone({param:B,value:j,op:"a"})}appendAll(B){const j=[];return Object.keys(B).forEach(ue=>{const ce=B[ue];Array.isArray(ce)?ce.forEach(Ne=>{j.push({param:ue,value:Ne,op:"a"})}):j.push({param:ue,value:ce,op:"a"})}),this.clone(j)}set(B,j){return this.clone({param:B,value:j,op:"s"})}delete(B,j){return this.clone({param:B,value:j,op:"d"})}toString(){return this.init(),this.keys().map(B=>{const j=this.encoder.encodeKey(B);return this.map.get(B).map(ue=>j+"="+this.encoder.encodeValue(ue)).join("&")}).filter(B=>""!==B).join("&")}clone(B){const j=new $e({encoder:this.encoder});return j.cloneFrom=this.cloneFrom||this,j.updates=(this.updates||[]).concat(B),j}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(B=>this.map.set(B,this.cloneFrom.map.get(B))),this.updates.forEach(B=>{switch(B.op){case"a":case"s":const j=("a"===B.op?this.map.get(B.param):void 0)||[];j.push(he(B.value)),this.map.set(B.param,j);break;case"d":if(void 0===B.value){this.map.delete(B.param);break}{let ue=this.map.get(B.param)||[];const ce=ue.indexOf(he(B.value));-1!==ce&&ue.splice(ce,1),ue.length>0?this.map.set(B.param,ue):this.map.delete(B.param)}}}),this.cloneFrom=this.updates=null)}}class Ge{constructor(){this.map=new Map}set(B,j){return this.map.set(B,j),this}get(B){return this.map.has(B)||this.map.set(B,B.defaultValue()),this.map.get(B)}delete(B){return this.map.delete(B),this}keys(){return this.map.keys()}}function Pe(se){return"undefined"!=typeof ArrayBuffer&&se instanceof ArrayBuffer}function ae(se){return"undefined"!=typeof Blob&&se instanceof Blob}function Ye(se){return"undefined"!=typeof FormData&&se instanceof FormData}class je{constructor(B,j,ue,ce){let Ne;if(this.url=j,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=B.toUpperCase(),function(se){switch(se){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||ce?(this.body=void 0!==ue?ue:null,Ne=ce):Ne=ue,Ne&&(this.reportProgress=!!Ne.reportProgress,this.withCredentials=!!Ne.withCredentials,Ne.responseType&&(this.responseType=Ne.responseType),Ne.headers&&(this.headers=Ne.headers),Ne.context&&(this.context=Ne.context),Ne.params&&(this.params=Ne.params)),this.headers||(this.headers=new Ie),this.context||(this.context=new Ge),this.params){const J=this.params.toString();if(0===J.length)this.urlWithParams=j;else{const xe=j.indexOf("?");this.urlWithParams=j+(-1===xe?"?":xe<j.length-1?"&":"")+J}}else this.params=new $e,this.urlWithParams=j}serializeBody(){return null===this.body?null:Pe(this.body)||ae(this.body)||Ye(this.body)||"undefined"!=typeof URLSearchParams&&this.body instanceof URLSearchParams||"string"==typeof this.body?this.body:this.body instanceof $e?this.body.toString():"object"==typeof this.body||"boolean"==typeof this.body||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return null===this.body||Ye(this.body)?null:ae(this.body)?this.body.type||null:Pe(this.body)?null:"string"==typeof this.body?"text/plain":this.body instanceof $e?"application/x-www-form-urlencoded;charset=UTF-8":"object"==typeof this.body||"number"==typeof this.body||"boolean"==typeof this.body?"application/json":null}clone(B={}){var j;const ue=B.method||this.method,ce=B.url||this.url,Ne=B.responseType||this.responseType,J=void 0!==B.body?B.body:this.body,xe=void 0!==B.withCredentials?B.withCredentials:this.withCredentials,Oe=void 0!==B.reportProgress?B.reportProgress:this.reportProgress;let At=B.headers||this.headers,xt=B.params||this.params;const Gn=null!==(j=B.context)&&void 0!==j?j:this.context;return void 0!==B.setHeaders&&(At=Object.keys(B.setHeaders).reduce((bt,Ke)=>bt.set(Ke,B.setHeaders[Ke]),At)),B.setParams&&(xt=Object.keys(B.setParams).reduce((bt,Ke)=>bt.set(Ke,B.setParams[Ke]),xt)),new je(ue,ce,J,{params:xt,headers:At,context:Gn,reportProgress:Oe,responseType:Ne,withCredentials:xe})}}var lt=(()=>((lt=lt||{})[lt.Sent=0]="Sent",lt[lt.UploadProgress=1]="UploadProgress",lt[lt.ResponseHeader=2]="ResponseHeader",lt[lt.DownloadProgress=3]="DownloadProgress",lt[lt.Response=4]="Response",lt[lt.User=5]="User",lt))();class ee{constructor(B,j=200,ue="OK"){this.headers=B.headers||new Ie,this.status=void 0!==B.status?B.status:j,this.statusText=B.statusText||ue,this.url=B.url||null,this.ok=this.status>=200&&this.status<300}}class U extends ee{constructor(B={}){super(B),this.type=lt.ResponseHeader}clone(B={}){return new U({headers:B.headers||this.headers,status:void 0!==B.status?B.status:this.status,statusText:B.statusText||this.statusText,url:B.url||this.url||void 0})}}class Y extends ee{constructor(B={}){super(B),this.type=lt.Response,this.body=void 0!==B.body?B.body:null}clone(B={}){return new Y({body:void 0!==B.body?B.body:this.body,headers:B.headers||this.headers,status:void 0!==B.status?B.status:this.status,statusText:B.statusText||this.statusText,url:B.url||this.url||void 0})}}class ne extends ee{constructor(B){super(B,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${B.url||"(unknown url)"}`:`Http failure response for ${B.url||"(unknown url)"}: ${B.status} ${B.statusText}`,this.error=B.error||null}}function De(se,B){return{body:B,headers:se.headers,context:se.context,observe:se.observe,params:se.params,reportProgress:se.reportProgress,responseType:se.responseType,withCredentials:se.withCredentials}}let K=(()=>{class se{constructor(j){this.handler=j}request(j,ue,ce={}){let Ne;if(j instanceof je)Ne=j;else{let Oe,At;Oe=ce.headers instanceof Ie?ce.headers:new Ie(ce.headers),ce.params&&(At=ce.params instanceof $e?ce.params:new $e({fromObject:ce.params})),Ne=new je(j,ue,void 0!==ce.body?ce.body:null,{headers:Oe,context:ce.context,params:At,reportProgress:ce.reportProgress,responseType:ce.responseType||"json",withCredentials:ce.withCredentials})}const J=(0,me.of)(Ne).pipe((0,te.b)(Oe=>this.handler.handle(Oe)));if(j instanceof je||"events"===ce.observe)return J;const xe=J.pipe((0,fe.h)(Oe=>Oe instanceof Y));switch(ce.observe||"body"){case"body":switch(Ne.responseType){case"arraybuffer":return xe.pipe((0,Z.U)(Oe=>{if(null!==Oe.body&&!(Oe.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return Oe.body}));case"blob":return xe.pipe((0,Z.U)(Oe=>{if(null!==Oe.body&&!(Oe.body instanceof Blob))throw new Error("Response is not a Blob.");return Oe.body}));case"text":return xe.pipe((0,Z.U)(Oe=>{if(null!==Oe.body&&"string"!=typeof Oe.body)throw new Error("Response is not a string.");return Oe.body}));case"json":default:return xe.pipe((0,Z.U)(Oe=>Oe.body))}case"response":return xe;default:throw new Error(`Unreachable: unhandled observe type ${ce.observe}}`)}}delete(j,ue={}){return this.request("DELETE",j,ue)}get(j,ue={}){return this.request("GET",j,ue)}head(j,ue={}){return this.request("HEAD",j,ue)}jsonp(j,ue){return this.request("JSONP",j,{params:(new $e).append(ue,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(j,ue={}){return this.request("OPTIONS",j,ue)}patch(j,ue,ce={}){return this.request("PATCH",j,De(ce,ue))}post(j,ue,ce={}){return this.request("POST",j,De(ce,ue))}put(j,ue,ce={}){return this.request("PUT",j,De(ce,ue))}}return se.\u0275fac=function(j){return new(j||se)(f.LFG(Ce))},se.\u0275prov=f.Yz7({token:se,factory:se.\u0275fac}),se})();class We{constructor(B,j){this.next=B,this.interceptor=j}handle(B){return this.interceptor.intercept(B,this.next)}}const q=new f.OlP("HTTP_INTERCEPTORS");let Me=(()=>{class se{intercept(j,ue){return ue.handle(j)}}return se.\u0275fac=function(j){return new(j||se)},se.\u0275prov=f.Yz7({token:se,factory:se.\u0275fac}),se})();const Tt=/^\)\]\}',?\n/;let _t=(()=>{class se{constructor(j){this.xhrFactory=j}handle(j){if("JSONP"===j.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new oe.y(ue=>{const ce=this.xhrFactory.build();if(ce.open(j.method,j.urlWithParams),j.withCredentials&&(ce.withCredentials=!0),j.headers.forEach((Ke,ot)=>ce.setRequestHeader(Ke,ot.join(","))),j.headers.has("Accept")||ce.setRequestHeader("Accept","application/json, text/plain, */*"),!j.headers.has("Content-Type")){const Ke=j.detectContentTypeHeader();null!==Ke&&ce.setRequestHeader("Content-Type",Ke)}if(j.responseType){const Ke=j.responseType.toLowerCase();ce.responseType="json"!==Ke?Ke:"text"}const Ne=j.serializeBody();let J=null;const xe=()=>{if(null!==J)return J;const Ke=1223===ce.status?204:ce.status,ot=ce.statusText||"OK",Mn=new Ie(ce.getAllResponseHeaders()),Fe=function(se){return"responseURL"in se&&se.responseURL?se.responseURL:/^X-Request-URL:/m.test(se.getAllResponseHeaders())?se.getResponseHeader("X-Request-URL"):null}(ce)||j.url;return J=new U({headers:Mn,status:Ke,statusText:ot,url:Fe}),J},Oe=()=>{let{headers:Ke,status:ot,statusText:Mn,url:Fe}=xe(),Lt=null;204!==ot&&(Lt=void 0===ce.response?ce.responseText:ce.response),0===ot&&(ot=Lt?200:0);let nn=ot>=200&&ot<300;if("json"===j.responseType&&"string"==typeof Lt){const Dr=Lt;Lt=Lt.replace(Tt,"");try{Lt=""!==Lt?JSON.parse(Lt):null}catch(nr){Lt=Dr,nn&&(nn=!1,Lt={error:nr,text:Lt})}}nn?(ue.next(new Y({body:Lt,headers:Ke,status:ot,statusText:Mn,url:Fe||void 0})),ue.complete()):ue.error(new ne({error:Lt,headers:Ke,status:ot,statusText:Mn,url:Fe||void 0}))},At=Ke=>{const{url:ot}=xe(),Mn=new ne({error:Ke,status:ce.status||0,statusText:ce.statusText||"Unknown Error",url:ot||void 0});ue.error(Mn)};let xt=!1;const Gn=Ke=>{xt||(ue.next(xe()),xt=!0);let ot={type:lt.DownloadProgress,loaded:Ke.loaded};Ke.lengthComputable&&(ot.total=Ke.total),"text"===j.responseType&&!!ce.responseText&&(ot.partialText=ce.responseText),ue.next(ot)},bt=Ke=>{let ot={type:lt.UploadProgress,loaded:Ke.loaded};Ke.lengthComputable&&(ot.total=Ke.total),ue.next(ot)};return ce.addEventListener("load",Oe),ce.addEventListener("error",At),ce.addEventListener("timeout",At),ce.addEventListener("abort",At),j.reportProgress&&(ce.addEventListener("progress",Gn),null!==Ne&&ce.upload&&ce.upload.addEventListener("progress",bt)),ce.send(Ne),ue.next({type:lt.Sent}),()=>{ce.removeEventListener("error",At),ce.removeEventListener("abort",At),ce.removeEventListener("load",Oe),ce.removeEventListener("timeout",At),j.reportProgress&&(ce.removeEventListener("progress",Gn),null!==Ne&&ce.upload&&ce.upload.removeEventListener("progress",bt)),ce.readyState!==ce.DONE&&ce.abort()}})}}return se.\u0275fac=function(j){return new(j||se)(f.LFG(_.JF))},se.\u0275prov=f.Yz7({token:se,factory:se.\u0275fac}),se})();const gn=new f.OlP("XSRF_COOKIE_NAME"),It=new f.OlP("XSRF_HEADER_NAME");class rt{}let mn=(()=>{class se{constructor(j,ue,ce){this.doc=j,this.platform=ue,this.cookieName=ce,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const j=this.doc.cookie||"";return j!==this.lastCookieString&&(this.parseCount++,this.lastToken=(0,_.Mx)(j,this.cookieName),this.lastCookieString=j),this.lastToken}}return se.\u0275fac=function(j){return new(j||se)(f.LFG(_.K0),f.LFG(f.Lbi),f.LFG(gn))},se.\u0275prov=f.Yz7({token:se,factory:se.\u0275fac}),se})(),Cn=(()=>{class se{constructor(j,ue){this.tokenService=j,this.headerName=ue}intercept(j,ue){const ce=j.url.toLowerCase();if("GET"===j.method||"HEAD"===j.method||ce.startsWith("http://")||ce.startsWith("https://"))return ue.handle(j);const Ne=this.tokenService.getToken();return null!==Ne&&!j.headers.has(this.headerName)&&(j=j.clone({headers:j.headers.set(this.headerName,Ne)})),ue.handle(j)}}return se.\u0275fac=function(j){return new(j||se)(f.LFG(rt),f.LFG(It))},se.\u0275prov=f.Yz7({token:se,factory:se.\u0275fac}),se})(),xn=(()=>{class se{constructor(j,ue){this.backend=j,this.injector=ue,this.chain=null}handle(j){if(null===this.chain){const ue=this.injector.get(q,[]);this.chain=ue.reduceRight((ce,Ne)=>new We(ce,Ne),this.backend)}return this.chain.handle(j)}}return se.\u0275fac=function(j){return new(j||se)(f.LFG(ke),f.LFG(f.zs3))},se.\u0275prov=f.Yz7({token:se,factory:se.\u0275fac}),se})(),Nt=(()=>{class se{static disable(){return{ngModule:se,providers:[{provide:Cn,useClass:Me}]}}static withOptions(j={}){return{ngModule:se,providers:[j.cookieName?{provide:gn,useValue:j.cookieName}:[],j.headerName?{provide:It,useValue:j.headerName}:[]]}}}return se.\u0275fac=function(j){return new(j||se)},se.\u0275mod=f.oAB({type:se}),se.\u0275inj=f.cJS({providers:[Cn,{provide:q,useExisting:Cn,multi:!0},{provide:rt,useClass:mn},{provide:gn,useValue:"XSRF-TOKEN"},{provide:It,useValue:"X-XSRF-TOKEN"}]}),se})(),gt=(()=>{class se{}return se.\u0275fac=function(j){return new(j||se)},se.\u0275mod=f.oAB({type:se}),se.\u0275inj=f.cJS({providers:[K,{provide:Ce,useClass:xn},_t,{provide:ke,useExisting:_t}],imports:[[Nt.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),se})()},476:(st,we,N)=>{"use strict";N.d(we,{deG:()=>my,tb:()=>A_,AFp:()=>D_,ip1:()=>Td,CZH:()=>Ss,hGG:()=>cM,z2F:()=>Pa,sBO:()=>X0,Sil:()=>xa,_Vd:()=>Ei,EJc:()=>T_,SBq:()=>Mo,qLn:()=>Xi,vpe:()=>To,gxx:()=>is,tBr:()=>qi,XFs:()=>J,OlP:()=>an,zs3:()=>Ft,ZZ4:()=>xl,aQg:()=>Pl,soG:()=>zl,YKP:()=>hm,v3s:()=>$A,h0i:()=>Di,PXZ:()=>LA,R0b:()=>Er,FiY:()=>ko,Lbi:()=>w_,g9A:()=>b_,Qsj:()=>V0,FYo:()=>Nl,JOm:()=>Eo,Tiy:()=>td,q3G:()=>ln,tp0:()=>Xo,EAV:()=>YA,Rgc:()=>Ea,dDg:()=>R_,DyG:()=>el,GfV:()=>im,s_b:()=>Ll,ifc:()=>Fe,eFA:()=>L_,G48:()=>OA,Gpc:()=>Pe,_c5:()=>rM,VLi:()=>SA,c2e:()=>M_,zSh:()=>ua,wAp:()=>qe,vHH:()=>je,EiD:()=>Af,mCW:()=>ta,qzn:()=>Ji,JVY:()=>zy,pB0:()=>qy,eBb:()=>Yy,L6k:()=>Wy,LAX:()=>Zy,cg1:()=>Gc,Tjo:()=>tM,kL8:()=>Tg,yhl:()=>_f,dqk:()=>tt,sIi:()=>fa,CqO:()=>Pc,QGY:()=>xc,F4k:()=>kp,RDi:()=>Be,AaK:()=>Ae,z3N:()=>Lo,qOj:()=>Ec,TTD:()=>Ro,_Bn:()=>em,xp6:()=>uh,uIk:()=>wc,Tol:()=>tg,ekj:()=>Bc,Suo:()=>Xm,Xpm:()=>Xe,lG2:()=>rr,Yz7:()=>kt,cJS:()=>Nt,oAB:()=>_n,Yjl:()=>Wn,Y36:()=>pa,_UZ:()=>Np,qZA:()=>Nc,TgZ:()=>Rc,EpF:()=>Fp,n5z:()=>Hi,Ikx:()=>$c,SDv:()=>Qg,N_p:()=>qc,Zx4:()=>Jg,tHW:()=>Zc,LFG:()=>vn,$8M:()=>vu,NdJ:()=>Fc,CRH:()=>e_,oxw:()=>Bp,ALo:()=>Zm,xi3:()=>qm,Q6J:()=>Sc,s9C:()=>Lc,MGl:()=>bl,hYB:()=>Vc,DdM:()=>jm,VKq:()=>Hm,iGM:()=>Jm,MAs:()=>Cp,CHM:()=>ja,LSH:()=>xu,kYT:()=>zr,Udp:()=>Uc,YNc:()=>vp,W1O:()=>o_,_uU:()=>lg,Oqu:()=>Hc,hij:()=>Al});var _=N(23),f=N(5994),me=N(5929),oe=N(6149),te=N(9528),Z=N(6889),Ce=N(8839),ke=N(1776),Ie=N(9162),Ee=N(4294),ie=N(4111),_e=N(4297);function Se(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return!0===t?(e(),null):!1===t?null:t.apply(void 0,(0,Ie.ev)([],(0,Ie.CR)(n))).pipe((0,Ee.q)(1)).subscribe(function(){return e()})}function he(e){for(let t in e)if(e[t]===he)return t;throw Error("Could not find renamed property on target object.")}function $e(e,t){for(const n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function Ae(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Ae).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}function Ge(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const ze=he({__forward_ref__:he});function Pe(e){return e.__forward_ref__=Pe,e.toString=function(){return Ae(this())},e}function ae(e){return Ye(e)?e():e}function Ye(e){return"function"==typeof e&&e.hasOwnProperty(ze)&&e.__forward_ref__===Pe}class je extends Error{constructor(t,n){super(function(e,t){return`${e?`NG0${e}: `:""}${t}`}(t,n)),this.code=t}}function U(e){return"string"==typeof e?e:null==e?"":String(e)}function Y(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():U(e)}function We(e,t){const n=t?` in ${t}`:"";throw new je("201",`No provider for ${Y(e)} found${n}`)}function rt(e,t,n,r){throw new Error(`ASSERTION ERROR: ${e}`+(null==r?"":` [Expected=> ${n} ${r} ${t} <=Actual]`))}function kt(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Nt(e){return{providers:e.providers||[],imports:e.imports||[]}}function gt(e){return tr(e,j)||tr(e,ce)}function tr(e,t){return e.hasOwnProperty(t)?e[t]:null}function B(e){return e&&(e.hasOwnProperty(ue)||e.hasOwnProperty(Ne))?e[ue]:null}const j=he({\u0275prov:he}),ue=he({\u0275inj:he}),ce=he({ngInjectableDef:he}),Ne=he({ngInjectorDef:he});var J=(()=>((J=J||{})[J.Default=0]="Default",J[J.Host=1]="Host",J[J.Self=2]="Self",J[J.SkipSelf=4]="SkipSelf",J[J.Optional=8]="Optional",J))();let xe;function At(e){const t=xe;return xe=e,t}function xt(e,t,n){const r=gt(e);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:n&J.Optional?null:void 0!==t?t:void We(Ae(e),"Injector")}function bt(e){return{toString:e}.toString()}var Ke=(()=>((Ke=Ke||{})[Ke.OnPush=0]="OnPush",Ke[Ke.Default=1]="Default",Ke))(),Fe=(()=>((Fe=Fe||{})[Fe.Emulated=0]="Emulated",Fe[Fe.None=2]="None",Fe[Fe.ShadowDom=3]="ShadowDom",Fe))();const Lt="undefined"!=typeof globalThis&&globalThis,nn="undefined"!=typeof window&&window,Dr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,nr="undefined"!=typeof global&&global,tt=Lt||nr||nn||Dr,Pn={},mt=[],ur=he({\u0275cmp:he}),br=he({\u0275dir:he}),$r=he({\u0275pipe:he}),po=he({\u0275mod:he}),Gr=he({\u0275loc:he}),In=he({\u0275fac:he}),Fn=he({__NG_ELEMENT_ID__:he});let zn=0;function Xe(e){return bt(()=>{const n={},r={type:e.type,providersResolver:null,decls:e.decls,vars:e.vars,factory:null,template:e.template||null,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:n,inputs:null,outputs:null,exportAs:e.exportAs||null,onPush:e.changeDetection===Ke.OnPush,directiveDefs:null,pipeDefs:null,selectors:e.selectors||mt,viewQuery:e.viewQuery||null,features:e.features||null,data:e.data||{},encapsulation:e.encapsulation||Fe.Emulated,id:"c",styles:e.styles||mt,_:null,setInput:null,schemas:e.schemas||null,tView:null},o=e.directives,i=e.features,s=e.pipes;return r.id+=zn++,r.inputs=Wr(e.inputs,n),r.outputs=Wr(e.outputs),i&&i.forEach(a=>a(r)),r.directiveDefs=o?()=>("function"==typeof o?o():o).map(Sn):null,r.pipeDefs=s?()=>("function"==typeof s?s():s).map(En):null,r})}function Sn(e){return Yt(e)||function(e){return e[br]||null}(e)}function En(e){return function(e){return e[$r]||null}(e)}const kn={};function _n(e){return bt(()=>{const t={type:e.type,bootstrap:e.bootstrap||mt,declarations:e.declarations||mt,imports:e.imports||mt,exports:e.exports||mt,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null};return null!=e.id&&(kn[e.id]=e.type),t})}function zr(e,t){return bt(()=>{const n=Zt(e,!0);n.declarations=t.declarations||mt,n.imports=t.imports||mt,n.exports=t.exports||mt})}function Wr(e,t){if(null==e)return Pn;const n={};for(const r in e)if(e.hasOwnProperty(r)){let o=e[r],i=o;Array.isArray(o)&&(i=o[1],o=o[0]),n[o]=r,t&&(t[o]=i)}return n}const rr=Xe;function Wn(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,onDestroy:e.type.prototype.ngOnDestroy||null}}function Yt(e){return e[ur]||null}function Zt(e,t){const n=e[po]||null;if(!n&&!0===t)throw new Error(`Type ${Ae(e)} does not have '\u0275mod' property.`);return n}function hn(e){return Array.isArray(e)&&"object"==typeof e[1]}function Dn(e){return Array.isArray(e)&&!0===e[1]}function pr(e){return 0!=(8&e.flags)}function Tr(e){return 2==(2&e.flags)}function Qn(e){return 1==(1&e.flags)}function O(e){return null!==e.template}function x(e){return 0!=(512&e[2])}function Rr(e,t){return e.hasOwnProperty(In)?e[In]:null}class Wo{constructor(t,n,r){this.previousValue=t,this.currentValue=n,this.firstChange=r}isFirstChange(){return this.firstChange}}function Ro(){return No}function No(e){return e.type.prototype.ngOnChanges&&(e.setInput=gr),Nr}function Nr(){const e=go(this),t=null==e?void 0:e.current;if(t){const n=e.previous;if(n===Pn)e.previous=t;else for(let r in t)n[r]=t[r];e.current=null,this.ngOnChanges(t)}}function gr(e,t,n,r){const o=go(e)||function(e,t){return e[Yo]=t}(e,{previous:Pn,current:null}),i=o.current||(o.current={}),s=o.previous,a=this.declaredInputs[n],c=s[a];i[a]=new Wo(c&&c.currentValue,t,s===Pn),e[r]=t}Ro.ngInherit=!0;const Yo="__ngSimpleChanges__";function go(e){return e[Yo]||null}let le;function Be(e){le=e}function Et(){return void 0!==le?le:"undefined"!=typeof document?document:void 0}function m(e){return!!e.listen}const M={createRenderer:(e,t)=>Et()};function ve(e){for(;Array.isArray(e);)e=e[0];return e}function Qt(e,t){return ve(t[e])}function $t(e,t){return ve(t[e.index])}function xr(e,t){return e.data[t]}function mr(e,t){return e[t]}function bn(e,t){const n=t[e];return hn(n)?n:n[0]}function si(e){return 4==(4&e[2])}function qr(e){return 128==(128&e[2])}function Qr(e,t){return null==t?null:e[t]}function ai(e){e[18]=0}function Ls(e,t){e[5]+=t;let n=e,r=e[3];for(;null!==r&&(1===t&&1===n[5]||-1===t&&0===n[5]);)r[5]+=t,n=r,r=r[3]}const it={lFrame:$s(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function Ba(){return it.bindingsEnabled}function de(){return it.lFrame.lView}function vt(){return it.lFrame.tView}function ja(e){return it.lFrame.contextLView=e,e[8]}function pn(){let e=Ha();for(;null!==e&&64===e.type;)e=e.parent;return e}function Ha(){return it.lFrame.currentTNode}function ci(){const e=it.lFrame,t=e.currentTNode;return e.isParent?t:t.parent}function Pr(e,t){const n=it.lFrame;n.currentTNode=e,n.isParent=t}function Us(){return it.lFrame.isParent}function Si(){return it.isInCheckNoChangesMode}function Oi(e){it.isInCheckNoChangesMode=e}function jn(){const e=it.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function _r(){return it.lFrame.bindingIndex}function xo(){return it.lFrame.bindingIndex++}function Fr(e){const t=it.lFrame,n=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,n}function Bs(e){it.lFrame.inI18n=e}function au(e,t){const n=it.lFrame;n.bindingIndex=n.bindingRootIndex=e,js(t)}function js(e){it.lFrame.currentDirectiveIndex=e}function Ga(){return it.lFrame.currentQueryIndex}function di(e){it.lFrame.currentQueryIndex=e}function uu(e){const t=e[1];return 2===t.type?t.declTNode:1===t.type?e[6]:null}function za(e,t,n){if(n&J.SkipSelf){let o=t,i=e;for(;!(o=o.parent,null!==o||n&J.Host||(o=uu(i),null===o||(i=i[15],10&o.type))););if(null===o)return!1;t=o,e=i}const r=it.lFrame=Ni();return r.currentTNode=t,r.lView=e,!0}function Ri(e){const t=Ni(),n=e[1];it.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function Ni(){const e=it.lFrame,t=null===e?null:e.child;return null===t?$s(e):t}function $s(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function Wa(){const e=it.lFrame;return it.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const Po=Wa;function xi(){const e=Wa();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function Hn(){return it.lFrame.selectedIndex}function Kr(e){it.lFrame.selectedIndex=e}function Kt(){const e=it.lFrame;return xr(e.tView,e.selectedIndex)}function Jr(e,t){for(let n=t.directiveStart,r=t.directiveEnd;n<r;n++){const i=e.data[n].type.prototype,{ngAfterContentInit:s,ngAfterContentChecked:a,ngAfterViewInit:c,ngAfterViewChecked:g,ngOnDestroy:D}=i;s&&(e.contentHooks||(e.contentHooks=[])).push(-n,s),a&&((e.contentHooks||(e.contentHooks=[])).push(n,a),(e.contentCheckHooks||(e.contentCheckHooks=[])).push(n,a)),c&&(e.viewHooks||(e.viewHooks=[])).push(-n,c),g&&((e.viewHooks||(e.viewHooks=[])).push(n,g),(e.viewCheckHooks||(e.viewCheckHooks=[])).push(n,g)),null!=D&&(e.destroyHooks||(e.destroyHooks=[])).push(n,D)}}function fi(e,t,n){Ya(e,t,3,n)}function Li(e,t,n,r){(3&e[2])===n&&Ya(e,t,n,r)}function hi(e,t){let n=e[2];(3&n)===t&&(n&=2047,n+=1,e[2]=n)}function Ya(e,t,n,r){const i=null!=r?r:-1,s=t.length-1;let a=0;for(let c=void 0!==r?65535&e[18]:0;c<s;c++)if("number"==typeof t[c+1]){if(a=t[c],null!=r&&a>=r)break}else t[c]<0&&(e[18]+=65536),(a<i||-1==i)&&(Za(e,n,t,c),e[18]=(4294901760&e[18])+c+2),c++}function Za(e,t,n,r){const o=n[r]<0,i=n[r+1],a=e[o?-n[r]:n[r]];if(o){if(e[2]>>11<e[18]>>16&&(3&e[2])===t){e[2]+=2048;try{i.call(a)}finally{}}}else try{i.call(a)}finally{}}class qo{constructor(t,n,r){this.factory=t,this.resolving=!1,this.canSeeViewProviders=n,this.injectImpl=r}}function Ui(e,t,n){const r=m(e);let o=0;for(;o<n.length;){const i=n[o];if("number"==typeof i){if(0!==i)break;o++;const s=n[o++],a=n[o++],c=n[o++];r?e.setAttribute(t,a,c,s):t.setAttributeNS(s,a,c)}else{const s=i,a=n[++o];zs(s)?r&&e.setProperty(t,s,a):r?e.setAttribute(t,s,a):t.setAttribute(s,a),o++}}return o}function Ka(e){return 3===e||4===e||6===e}function zs(e){return 64===e.charCodeAt(0)}function Bi(e,t){if(null!==t&&0!==t.length)if(null===e||0===e.length)e=t.slice();else{let n=-1;for(let r=0;r<t.length;r++){const o=t[r];"number"==typeof o?n=o:0===n||Ws(e,n,o,null,-1===n||2===n?t[++r]:null)}}return e}function Ws(e,t,n,r,o){let i=0,s=e.length;if(-1===t)s=-1;else for(;i<e.length;){const a=e[i++];if("number"==typeof a){if(a===t){s=-1;break}if(a>t){s=i-1;break}}}for(;i<e.length;){const a=e[i];if("number"==typeof a)break;if(a===n){if(null===r)return void(null!==o&&(e[i+1]=o));if(r===e[i+1])return void(e[i+2]=o)}i++,null!==r&&i++,null!==o&&i++}-1!==s&&(e.splice(s,0,t),i=s+1),e.splice(i++,0,n),null!==r&&e.splice(i++,0,r),null!==o&&e.splice(i++,0,o)}function Ja(e){return-1!==e}function Qo(e){return 32767&e}function _o(e,t){let n=function(e){return e>>16}(e),r=t;for(;n>0;)r=r[15],n--;return r}let Ys=!0;function ji(e){const t=Ys;return Ys=e,t}let d=0;function l(e,t){const n=C(e,t);if(-1!==n)return n;const r=t[1];r.firstCreatePass&&(e.injectorIndex=t.length,p(r.data,e),p(t,null),p(r.blueprint,null));const o=b(e,t),i=e.injectorIndex;if(Ja(o)){const s=Qo(o),a=_o(o,t),c=a[1].data;for(let g=0;g<8;g++)t[i+g]=a[s+g]|c[s+g]}return t[i+8]=o,i}function p(e,t){e.push(0,0,0,0,0,0,0,0,t)}function C(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function b(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let n=0,r=null,o=t;for(;null!==o;){const i=o[1],s=i.type;if(r=2===s?i.declTNode:1===s?o[6]:null,null===r)return-1;if(n++,o=o[15],-1!==r.injectorIndex)return r.injectorIndex|n<<16}return-1}function R(e,t,n){!function(e,t,n){let r;"string"==typeof n?r=n.charCodeAt(0)||0:n.hasOwnProperty(Fn)&&(r=n[Fn]),null==r&&(r=n[Fn]=d++);const o=255&r;t.data[e+(o>>5)]|=1<<o}(e,t,n)}function z(e,t,n){if(n&J.Optional)return e;We(t,"NodeInjector")}function be(e,t,n,r){if(n&J.Optional&&void 0===r&&(r=null),0==(n&(J.Self|J.Host))){const o=e[9],i=At(void 0);try{return o?o.get(t,r,n&J.Optional):xt(t,r,n&J.Optional)}finally{At(i)}}return z(r,t,n)}function Ue(e,t,n,r=J.Default,o){if(null!==e){const i=function(e){if("string"==typeof e)return e.charCodeAt(0)||0;const t=e.hasOwnProperty(Fn)?e[Fn]:void 0;return"number"==typeof t?t>=0?255&t:Pt:t}(n);if("function"==typeof i){if(!za(t,e,r))return r&J.Host?z(o,n,r):be(t,n,r,o);try{const s=i(r);if(null!=s||r&J.Optional)return s;We(n)}finally{Po()}}else if("number"==typeof i){let s=null,a=C(e,t),c=-1,g=r&J.Host?t[16][6]:null;for((-1===a||r&J.SkipSelf)&&(c=-1===a?b(e,t):t[a+8],-1!==c&&Fo(r,!1)?(s=t[1],a=Qo(c),t=_o(c,t)):a=-1);-1!==a;){const D=t[1];if(Ko(i,a,D.data)){const T=Ct(a,t,n,s,r,g);if(T!==at)return T}c=t[a+8],-1!==c&&Fo(r,t[1].data[a+8]===g)&&Ko(i,a,t)?(s=D,a=Qo(c),t=_o(c,t)):a=-1}}}return be(t,n,r,o)}const at={};function Pt(){return new ir(pn(),de())}function Ct(e,t,n,r,o,i){const s=t[1],a=s.data[e+8],D=yr(a,s,n,null==r?Tr(a)&&Ys:r!=s&&0!=(3&a.type),o&J.Host&&i===a);return null!==D?or(t,s,D,a):at}function yr(e,t,n,r,o){const i=e.providerIndexes,s=t.data,a=1048575&i,c=e.directiveStart,D=i>>20,S=o?a+D:e.directiveEnd;for(let P=r?a:a+D;P<S;P++){const V=s[P];if(P<c&&n===V||P>=c&&V.type===n)return P}if(o){const P=s[c];if(P&&O(P)&&P.type===n)return c}return null}function or(e,t,n,r){let o=e[n];const i=t.data;if(function(e){return e instanceof qo}(o)){const s=o;s.resolving&&function(e,t){throw new je("200",`Circular dependency in DI detected for ${e}`)}(Y(i[n]));const a=ji(s.canSeeViewProviders);s.resolving=!0;const c=s.injectImpl?At(s.injectImpl):null;za(e,r,J.Default);try{o=e[n]=s.factory(void 0,i,e,r),t.firstCreatePass&&n>=r.directiveStart&&function(e,t,n){const{ngOnChanges:r,ngOnInit:o,ngDoCheck:i}=t.type.prototype;if(r){const s=No(t);(n.preOrderHooks||(n.preOrderHooks=[])).push(e,s),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,s)}o&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-e,o),i&&((n.preOrderHooks||(n.preOrderHooks=[])).push(e,i),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,i))}(n,i[n],t)}finally{null!==c&&At(c),ji(a),s.resolving=!1,Po()}}return o}function Ko(e,t,n){return!!(n[t+(e>>5)]&1<<e)}function Fo(e,t){return!(e&J.Self||e&J.Host&&t)}class ir{constructor(t,n){this._tNode=t,this._lView=n}get(t,n){return Ue(this._tNode,this._lView,t,void 0,n)}}function Hi(e){return bt(()=>{const t=e.prototype.constructor,n=t[In]||yu(t),r=Object.prototype;let o=Object.getPrototypeOf(e.prototype).constructor;for(;o&&o!==r;){const i=o[In]||yu(o);if(i&&i!==n)return i;o=Object.getPrototypeOf(o)}return i=>new i})}function yu(e){return Ye(e)?()=>{const t=yu(ae(e));return t&&t()}:Rr(e)}function vu(e){return function(e,t){if("class"===t)return e.classes;if("style"===t)return e.styles;const n=e.attrs;if(n){const r=n.length;let o=0;for(;o<r;){const i=n[o];if(Ka(i))break;if(0===i)o+=2;else if("number"==typeof i)for(o++;o<r&&"string"==typeof n[o];)o++;else{if(i===t)return n[o+1];o+=2}}}return null}(pn(),e)}const Gi="__parameters__";function pi(e,t,n){return bt(()=>{const r=function(e){return function(...n){if(e){const r=e(...n);for(const o in r)this[o]=r[o]}}}(t);function o(...i){if(this instanceof o)return r.apply(this,i),this;const s=new o(...i);return a.annotation=s,a;function a(c,g,D){const T=c.hasOwnProperty(Gi)?c[Gi]:Object.defineProperty(c,Gi,{value:[]})[Gi];for(;T.length<=D;)T.push(null);return(T[D]=T[D]||[]).push(s),c}}return n&&(o.prototype=Object.create(n.prototype)),o.prototype.ngMetadataName=e,o.annotationCls=o,o})}class an{constructor(t,n){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof n?this.__NG_ELEMENT_ID__=n:void 0!==n&&(this.\u0275prov=kt({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}toString(){return`InjectionToken ${this._desc}`}}const my=new an("AnalyzeForEntryComponents"),el=Function;function Lr(e,t){void 0===t&&(t=e);for(let n=0;n<e.length;n++){let r=e[n];Array.isArray(r)?(t===e&&(t=e.slice(0,n)),Lr(r,t)):t!==e&&t.push(r)}return t}function yo(e,t){e.forEach(n=>Array.isArray(n)?yo(n,t):t(n))}function nl(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function gi(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function vr(e,t,n){let r=Wi(e,t);return r>=0?e[1|r]=n:(r=~r,function(e,t,n,r){let o=e.length;if(o==t)e.push(n,r);else if(1===o)e.push(r,e[0]),e[0]=n;else{for(o--,e.push(e[o-1],e[o]);o>t;)e[o]=e[o-2],o--;e[t]=n,e[t+1]=r}}(e,r,t,n)),r}function Eu(e,t){const n=Wi(e,t);if(n>=0)return e[1|n]}function Wi(e,t){return function(e,t,n){let r=0,o=e.length>>n;for(;o!==r;){const i=r+(o-r>>1),s=e[i<<n];if(t===s)return i<<n;s>t?o=i:r=i+1}return~(o<<n)}(e,t,1)}const Ks={},bu="__NG_DI_FLAG__",Yi="ngTempTokenPath",My=/\n/gm,wu="__source",Au=he({provide:String,useValue:he});let Js;function Zi(e){const t=Js;return Js=e,t}function Iy(e,t=J.Default){if(void 0===Js)throw new Error("inject() must be called from an injection context");return null===Js?xt(e,void 0,t):Js.get(e,t&J.Optional?null:void 0,t)}function vn(e,t=J.Default){return(xe||Iy)(ae(e),t)}function mi(e){const t=[];for(let n=0;n<e.length;n++){const r=ae(e[n]);if(Array.isArray(r)){if(0===r.length)throw new Error("Arguments array must have arguments.");let o,i=J.Default;for(let s=0;s<r.length;s++){const a=r[s],c=Sy(a);"number"==typeof c?-1===c?o=a.token:i|=c:o=a}t.push(vn(o,i))}else t.push(vn(r))}return t}function Xs(e,t){return e[bu]=t,e.prototype[bu]=t,e}function Sy(e){return e[bu]}function uf(e,t,n,r){const o=e[Yi];throw t[wu]&&o.unshift(t[wu]),e.message=function(e,t,n,r=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.substr(2):e;let o=Ae(t);if(Array.isArray(t))o=t.map(Ae).join(" -> ");else if("object"==typeof t){let i=[];for(let s in t)if(t.hasOwnProperty(s)){let a=t[s];i.push(s+":"+("string"==typeof a?JSON.stringify(a):Ae(a)))}o=`{${i.join(", ")}}`}return`${n}${r?"("+r+")":""}[${o}]: ${e.replace(My,"\n ")}`}("\n"+e.message,o,n,r),e.ngTokenPath=o,e[Yi]=null,e}const qi=Xs(pi("Inject",e=>({token:e})),-1),ko=Xs(pi("Optional"),8),Xo=Xs(pi("SkipSelf"),4);let sl;function Ki(e){var t;return(null===(t=function(){if(void 0===sl&&(sl=null,tt.trustedTypes))try{sl=tt.trustedTypes.createPolicy("angular",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch(e){}return sl}())||void 0===t?void 0:t.createHTML(e))||e}class _i{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class By extends _i{getTypeName(){return"HTML"}}class jy extends _i{getTypeName(){return"Style"}}class Hy extends _i{getTypeName(){return"Script"}}class $y extends _i{getTypeName(){return"URL"}}class Gy extends _i{getTypeName(){return"ResourceURL"}}function Lo(e){return e instanceof _i?e.changingThisBreaksApplicationSecurity:e}function Ji(e,t){const n=_f(e);if(null!=n&&n!==t){if("ResourceURL"===n&&"URL"===t)return!0;throw new Error(`Required a safe ${t}, got a ${n} (see https://g.co/ng/security#xss)`)}return n===t}function _f(e){return e instanceof _i&&e.getTypeName()||null}function zy(e){return new By(e)}function Wy(e){return new jy(e)}function Yy(e){return new Hy(e)}function Zy(e){return new $y(e)}function qy(e){return new Gy(e)}function yf(e){const t=new Ky(e);return function(){try{return!!(new window.DOMParser).parseFromString(Ki(""),"text/html")}catch(e){return!1}}()?new Qy(t):t}class Qy{constructor(t){this.inertDocumentHelper=t}getInertBodyElement(t){t="<body><remove></remove>"+t;try{const n=(new window.DOMParser).parseFromString(Ki(t),"text/html").body;return null===n?this.inertDocumentHelper.getInertBodyElement(t):(n.removeChild(n.firstChild),n)}catch(n){return null}}}class Ky{constructor(t){if(this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const n=this.inertDocument.createElement("html");this.inertDocument.appendChild(n);const r=this.inertDocument.createElement("body");n.appendChild(r)}}getInertBodyElement(t){const n=this.inertDocument.createElement("template");if("content"in n)return n.innerHTML=Ki(t),n;const r=this.inertDocument.createElement("body");return r.innerHTML=Ki(t),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(r),r}stripCustomNsAttrs(t){const n=t.attributes;for(let o=n.length-1;0<o;o--){const s=n.item(o).name;("xmlns:ns1"===s||0===s.indexOf("ns1:"))&&t.removeAttribute(s)}let r=t.firstChild;for(;r;)r.nodeType===Node.ELEMENT_NODE&&this.stripCustomNsAttrs(r),r=r.nextSibling}}const Xy=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi,ev=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;function ta(e){return(e=String(e)).match(Xy)||e.match(ev)?e:"unsafe:"+e}function vf(e){return(e=String(e)).split(",").map(t=>ta(t.trim())).join(", ")}function vo(e){const t={};for(const n of e.split(","))t[n]=!0;return t}function na(...e){const t={};for(const n of e)for(const r in n)n.hasOwnProperty(r)&&(t[r]=!0);return t}const Cf=vo("area,br,col,hr,img,wbr"),Ef=vo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Df=vo("rp,rt"),Su=na(Cf,na(Ef,vo("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),na(Df,vo("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),na(Df,Ef)),Ou=vo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),Ru=vo("srcset"),bf=na(Ou,Ru,vo("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),vo("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),tv=vo("script,style,template");class nv{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(t){let n=t.firstChild,r=!0;for(;n;)if(n.nodeType===Node.ELEMENT_NODE?r=this.startElement(n):n.nodeType===Node.TEXT_NODE?this.chars(n.nodeValue):this.sanitizedSomething=!0,r&&n.firstChild)n=n.firstChild;else for(;n;){n.nodeType===Node.ELEMENT_NODE&&this.endElement(n);let o=this.checkClobberedElement(n,n.nextSibling);if(o){n=o;break}n=this.checkClobberedElement(n,n.parentNode)}return this.buf.join("")}startElement(t){const n=t.nodeName.toLowerCase();if(!Su.hasOwnProperty(n))return this.sanitizedSomething=!0,!tv.hasOwnProperty(n);this.buf.push("<"),this.buf.push(n);const r=t.attributes;for(let o=0;o<r.length;o++){const i=r.item(o),s=i.name,a=s.toLowerCase();if(!bf.hasOwnProperty(a)){this.sanitizedSomething=!0;continue}let c=i.value;Ou[a]&&(c=ta(c)),Ru[a]&&(c=vf(c)),this.buf.push(" ",s,'="',wf(c),'"')}return this.buf.push(">"),!0}endElement(t){const n=t.nodeName.toLowerCase();Su.hasOwnProperty(n)&&!Cf.hasOwnProperty(n)&&(this.buf.push("</"),this.buf.push(n),this.buf.push(">"))}chars(t){this.buf.push(wf(t))}checkClobberedElement(t,n){if(n&&(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${t.outerHTML}`);return n}}const rv=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ov=/([^\#-~ |!])/g;function wf(e){return e.replace(/&/g,"&").replace(rv,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(ov,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}let ll;function Af(e,t){let n=null;try{ll=ll||yf(e);let r=t?String(t):"";n=ll.getInertBodyElement(r);let o=5,i=r;do{if(0===o)throw new Error("Failed to sanitize html because the input is unstable");o--,r=i,i=n.innerHTML,n=ll.getInertBodyElement(r)}while(r!==i);return Ki((new nv).sanitizeChildren(Nu(n)||n))}finally{if(n){const r=Nu(n)||n;for(;r.firstChild;)r.removeChild(r.firstChild)}}}function Nu(e){return"content"in e&&function(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var ln=(()=>((ln=ln||{})[ln.NONE=0]="NONE",ln[ln.HTML=1]="HTML",ln[ln.STYLE=2]="STYLE",ln[ln.SCRIPT=3]="SCRIPT",ln[ln.URL=4]="URL",ln[ln.RESOURCE_URL=5]="RESOURCE_URL",ln))();function xu(e){const t=function(){const e=de();return e&&e[12]}();return t?t.sanitize(ln.URL,e)||"":Ji(e,"URL")?Lo(e):ta(U(e))}const If="__ngContext__";function Kn(e,t){e[If]=t}function Fu(e){const t=function(e){return e[If]||null}(e);return t?Array.isArray(t)?t:t.lView:null}function ul(e){return e.ngOriginalError}function Dv(e,...t){e.error(...t)}class Xi{constructor(){this._console=console}handleError(t){const n=this._findOriginalError(t),r=this._findContext(t),o=(e=t)&&e.ngErrorLogger||Dv;var e;o(this._console,"ERROR",t),n&&o(this._console,"ORIGINAL ERROR",n),r&&o(this._console,"ERROR CONTEXT",r)}_findContext(t){return t?t.ngDebugContext||this._findContext(ul(t)):null}_findOriginalError(t){let n=t&&ul(t);for(;n&&ul(n);)n=ul(n);return n||null}}const Lf=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(tt))();function Co(e){return e instanceof Function?e():e}var Eo=(()=>((Eo=Eo||{})[Eo.Important=1]="Important",Eo[Eo.DashCase=2]="DashCase",Eo))();let Lu;function Vu(e,t){return Lu(e,t)}function ia(e){const t=e[3];return Dn(t)?t[3]:t}function Uu(e){return Hf(e[13])}function Bu(e){return Hf(e[4])}function Hf(e){for(;null!==e&&!Dn(e);)e=e[4];return e}function ts(e,t,n,r,o){if(null!=r){let i,s=!1;Dn(r)?i=r:hn(r)&&(s=!0,r=r[0]);const a=ve(r);0===e&&null!==n?null==o?Zf(t,n,a):yi(t,n,a,o||null,!0):1===e&&null!==n?yi(t,n,a,o||null,!0):2===e?function(e,t,n){const r=dl(e,t);r&&function(e,t,n,r){m(e)?e.removeChild(t,n,r):t.removeChild(n)}(e,r,t,n)}(t,a,s):3===e&&t.destroyNode(a),null!=i&&function(e,t,n,r,o){const i=n[7];i!==ve(n)&&ts(t,e,r,i,o);for(let a=10;a<n.length;a++){const c=n[a];sa(c[1],c,e,t,r,i)}}(t,e,i,n,o)}}function ju(e,t){return m(e)?e.createText(t):e.createTextNode(t)}function Hu(e,t,n){return m(e)?e.createElement(t,n):null===n?e.createElement(t):e.createElementNS(n,t)}function Gf(e,t){const n=e[9],r=n.indexOf(t),o=t[3];1024&t[2]&&(t[2]&=-1025,Ls(o,-1)),n.splice(r,1)}function $u(e,t){if(e.length<=10)return;const n=10+t,r=e[n];if(r){const o=r[17];null!==o&&o!==e&&Gf(o,r),t>0&&(e[n-1][4]=r[4]);const i=gi(e,10+t);!function(e,t){sa(e,t,t[11],2,null,null),t[0]=null,t[6]=null}(r[1],r);const s=i[19];null!==s&&s.detachView(i[1]),r[3]=null,r[4]=null,r[2]&=-129}return r}function zf(e,t){if(!(256&t[2])){const n=t[11];m(n)&&n.destroyNode&&sa(e,t,n,3,null,null),function(e){let t=e[13];if(!t)return Gu(e[1],e);for(;t;){let n=null;if(hn(t))n=t[13];else{const r=t[10];r&&(n=r)}if(!n){for(;t&&!t[4]&&t!==e;)hn(t)&&Gu(t[1],t),t=t[3];null===t&&(t=e),hn(t)&&Gu(t[1],t),n=t&&t[4]}t=n}}(t)}}function Gu(e,t){if(!(256&t[2])){t[2]&=-129,t[2]|=256,function(e,t){let n;if(null!=e&&null!=(n=e.destroyHooks))for(let r=0;r<n.length;r+=2){const o=t[n[r]];if(!(o instanceof qo)){const i=n[r+1];if(Array.isArray(i))for(let s=0;s<i.length;s+=2){const a=o[i[s]],c=i[s+1];try{c.call(a)}finally{}}else try{i.call(o)}finally{}}}}(e,t),function(e,t){const n=e.cleanup,r=t[7];let o=-1;if(null!==n)for(let i=0;i<n.length-1;i+=2)if("string"==typeof n[i]){const s=n[i+1],a="function"==typeof s?s(t):ve(t[s]),c=r[o=n[i+2]],g=n[i+3];"boolean"==typeof g?a.removeEventListener(n[i],c,g):g>=0?r[o=g]():r[o=-g].unsubscribe(),i+=2}else{const s=r[o=n[i+1]];n[i].call(s)}if(null!==r){for(let i=o+1;i<r.length;i++)r[i]();t[7]=null}}(e,t),1===t[1].type&&m(t[11])&&t[11].destroy();const n=t[17];if(null!==n&&Dn(t[3])){n!==t[3]&&Gf(n,t);const r=t[19];null!==r&&r.detachView(e)}}}function Yf(e,t,n){let r=t;for(;null!==r&&40&r.type;)r=(t=r).parent;if(null===r)return n[0];if(2&r.flags){const o=e.data[r.directiveStart].encapsulation;if(o===Fe.None||o===Fe.Emulated)return null}return $t(r,n)}function yi(e,t,n,r,o){m(e)?e.insertBefore(t,n,r,o):t.insertBefore(n,r,o)}function Zf(e,t,n){m(e)?e.appendChild(t,n):t.appendChild(n)}function qf(e,t,n,r,o){null!==r?yi(e,t,n,r,o):Zf(e,t,n)}function dl(e,t){return m(e)?e.parentNode(t):t.parentNode}function Kf(e,t,n){return 40&e.type?$t(e,n):null}let zu,Jf=Kf;function Xf(e,t){Jf=e,zu=t}function fl(e,t,n,r){const o=function(e,t,n){return Yf(e,t.parent,n)}(e,r,t),i=t[11],a=function(e,t,n){return Jf(e,t,n)}(r.parent||t[6],r,t);if(null!=o)if(Array.isArray(n))for(let c=0;c<n.length;c++)qf(i,o,n[c],a,!1);else qf(i,o,n,a,!1);void 0!==zu&&zu(i,r,t,n,o)}function hl(e,t){if(null!==t){const n=t.type;if(3&n)return $t(t,e);if(4&n)return Wu(-1,e[t.index]);if(8&n){const r=t.child;if(null!==r)return hl(e,r);{const o=e[t.index];return Dn(o)?Wu(-1,o):ve(o)}}if(32&n)return Vu(t,e)()||ve(e[t.index]);{const r=eh(e,t);return null!==r?Array.isArray(r)?r[0]:hl(ia(e[16]),r):hl(e,t.next)}}return null}function eh(e,t){return null!==t?e[16][6].projection[t.projection]:null}function Wu(e,t){const n=10+e+1;if(n<t.length){const r=t[n],o=r[1].firstChild;if(null!==o)return hl(r,o)}return t[7]}function Yu(e,t,n,r,o,i,s){for(;null!=n;){const a=r[n.index],c=n.type;if(s&&0===t&&(a&&Kn(ve(a),r),n.flags|=4),64!=(64&n.flags))if(8&c)Yu(e,t,n.child,r,o,i,!1),ts(t,e,o,a,i);else if(32&c){const g=Vu(n,r);let D;for(;D=g();)ts(t,e,o,D,i);ts(t,e,o,a,i)}else 16&c?nh(e,t,r,n,o,i):ts(t,e,o,a,i);n=s?n.projectionNext:n.next}}function sa(e,t,n,r,o,i){Yu(n,r,e.firstChild,t,o,i,!1)}function nh(e,t,n,r,o,i){const s=n[16],c=s[6].projection[r.projection];if(Array.isArray(c))for(let g=0;g<c.length;g++)ts(t,e,o,c[g],i);else Yu(e,t,c,s[3],o,i,!0)}function rh(e,t,n){m(e)?e.setAttribute(t,"style",n):t.style.cssText=n}function Zu(e,t,n){m(e)?""===n?e.removeAttribute(t,"class"):e.setAttribute(t,"class",n):t.className=n}function oh(e,t,n){let r=e.length;for(;;){const o=e.indexOf(t,n);if(-1===o)return o;if(0===o||e.charCodeAt(o-1)<=32){const i=t.length;if(o+i===r||e.charCodeAt(o+i)<=32)return o}n=o+1}}const ih="ng-template";function Zv(e,t,n){let r=0;for(;r<e.length;){let o=e[r++];if(n&&"class"===o){if(o=e[r],-1!==oh(o.toLowerCase(),t,0))return!0}else if(1===o){for(;r<e.length&&"string"==typeof(o=e[r++]);)if(o.toLowerCase()===t)return!0;return!1}}return!1}function sh(e){return 4===e.type&&e.value!==ih}function qv(e,t,n){return t===(4!==e.type||n?e.value:ih)}function Qv(e,t,n){let r=4;const o=e.attrs||[],i=function(e){for(let t=0;t<e.length;t++)if(Ka(e[t]))return t;return e.length}(o);let s=!1;for(let a=0;a<t.length;a++){const c=t[a];if("number"!=typeof c){if(!s)if(4&r){if(r=2|1&r,""!==c&&!qv(e,c,n)||""===c&&1===t.length){if(eo(r))return!1;s=!0}}else{const g=8&r?c:t[++a];if(8&r&&null!==e.attrs){if(!Zv(e.attrs,g,n)){if(eo(r))return!1;s=!0}continue}const T=Kv(8&r?"class":c,o,sh(e),n);if(-1===T){if(eo(r))return!1;s=!0;continue}if(""!==g){let S;S=T>i?"":o[T+1].toLowerCase();const P=8&r?S:null;if(P&&-1!==oh(P,g,0)||2&r&&g!==S){if(eo(r))return!1;s=!0}}}}else{if(!s&&!eo(r)&&!eo(c))return!1;if(s&&eo(c))continue;s=!1,r=c|1&r}}return eo(r)||s}function eo(e){return 0==(1&e)}function Kv(e,t,n,r){if(null===t)return-1;let o=0;if(r||!n){let i=!1;for(;o<t.length;){const s=t[o];if(s===e)return o;if(3===s||6===s)i=!0;else{if(1===s||2===s){let a=t[++o];for(;"string"==typeof a;)a=t[++o];continue}if(4===s)break;if(0===s){o+=4;continue}}o+=i?1:2}return-1}return function(e,t){let n=e.indexOf(4);if(n>-1)for(n++;n<e.length;){const r=e[n];if("number"==typeof r)return-1;if(r===t)return n;n++}return-1}(t,e)}function ah(e,t,n=!1){for(let r=0;r<t.length;r++)if(Qv(e,t[r],n))return!0;return!1}function lh(e,t){return e?":not("+t.trim()+")":t}function nC(e){let t=e[0],n=1,r=2,o="",i=!1;for(;n<e.length;){let s=e[n];if("string"==typeof s)if(2&r){const a=e[++n];o+="["+s+(a.length>0?'="'+a+'"':"")+"]"}else 8&r?o+="."+s:4&r&&(o+=" "+s);else""!==o&&!eo(s)&&(t+=lh(i,o),o=""),r=s,i=i||!eo(r);n++}return""!==o&&(t+=lh(i,o)),t}const ct={};function uh(e){ch(vt(),de(),Hn()+e,Si())}function ch(e,t,n,r){if(!r)if(3==(3&t[2])){const i=e.preOrderCheckHooks;null!==i&&fi(t,i,n)}else{const i=e.preOrderHooks;null!==i&&Li(t,i,0,n)}Kr(n)}function pl(e,t){return e<<17|t<<2}function to(e){return e>>17&32767}function qu(e){return 2|e}function Vo(e){return(131068&e)>>2}function Qu(e,t){return-131069&e|t<<2}function Ku(e){return 1|e}function Ch(e,t){const n=e.contentQueries;if(null!==n)for(let r=0;r<n.length;r+=2){const o=n[r],i=n[r+1];if(-1!==i){const s=e.data[i];di(o),s.contentQueries(2,t[i],i)}}}function aa(e,t,n,r,o,i,s,a,c,g){const D=t.blueprint.slice();return D[0]=o,D[2]=140|r,ai(D),D[3]=D[15]=e,D[8]=n,D[10]=s||e&&e[10],D[11]=a||e&&e[11],D[12]=c||e&&e[12]||null,D[9]=g||e&&e[9]||null,D[6]=i,D[16]=2==t.type?e[16]:D,D}function ns(e,t,n,r,o){let i=e.data[t];if(null===i)i=oc(e,t,n,r,o),it.lFrame.inI18n&&(i.flags|=64);else if(64&i.type){i.type=n,i.value=r,i.attrs=o;const s=ci();i.injectorIndex=null===s?-1:s.injectorIndex}return Pr(i,!0),i}function oc(e,t,n,r,o){const i=Ha(),s=Us(),c=e.data[t]=function(e,t,n,r,o,i){return{type:n,index:r,insertBeforeIndex:null,injectorIndex:t?t.injectorIndex:-1,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,propertyBindings:null,flags:0,providerIndexes:0,value:o,attrs:i,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tViews:null,next:null,projectionNext:null,child:null,parent:t,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}(0,s?i:i&&i.parent,n,t,r,o);return null===e.firstChild&&(e.firstChild=c),null!==i&&(s?null==i.child&&null!==c.parent&&(i.child=c):null===i.next&&(i.next=c)),c}function rs(e,t,n,r){if(0===n)return-1;const o=t.length;for(let i=0;i<n;i++)t.push(r),e.blueprint.push(r),e.data.push(null);return o}function la(e,t,n){Ri(t);try{const r=e.viewQuery;null!==r&&hc(1,r,n);const o=e.template;null!==o&&Eh(e,t,o,1,n),e.firstCreatePass&&(e.firstCreatePass=!1),e.staticContentQueries&&Ch(e,t),e.staticViewQueries&&hc(2,e.viewQuery,n);const i=e.components;null!==i&&function(e,t){for(let n=0;n<t.length;n++)FC(e,t[n])}(t,i)}catch(r){throw e.firstCreatePass&&(e.incompleteFirstPass=!0,e.firstCreatePass=!1),r}finally{t[2]&=-5,xi()}}function os(e,t,n,r){const o=t[2];if(256==(256&o))return;Ri(t);const i=Si();try{ai(t),function(e){it.lFrame.bindingIndex=e}(e.bindingStartIndex),null!==n&&Eh(e,t,n,2,r);const s=3==(3&o);if(!i)if(s){const g=e.preOrderCheckHooks;null!==g&&fi(t,g,null)}else{const g=e.preOrderHooks;null!==g&&Li(t,g,0,null),hi(t,0)}if(function(e){for(let t=Uu(e);null!==t;t=Bu(t)){if(!t[2])continue;const n=t[9];for(let r=0;r<n.length;r++){const o=n[r],i=o[3];0==(1024&o[2])&&Ls(i,1),o[2]|=1024}}}(t),function(e){for(let t=Uu(e);null!==t;t=Bu(t))for(let n=10;n<t.length;n++){const r=t[n],o=r[1];qr(r)&&os(o,r,o.template,r[8])}}(t),null!==e.contentQueries&&Ch(e,t),!i)if(s){const g=e.contentCheckHooks;null!==g&&fi(t,g)}else{const g=e.contentHooks;null!==g&&Li(t,g,1),hi(t,1)}!function(e,t){const n=e.hostBindingOpCodes;if(null!==n)try{for(let r=0;r<n.length;r++){const o=n[r];if(o<0)Kr(~o);else{const i=o,s=n[++r],a=n[++r];au(s,i),a(2,t[i])}}}finally{Kr(-1)}}(e,t);const a=e.components;null!==a&&function(e,t){for(let n=0;n<t.length;n++)PC(e,t[n])}(t,a);const c=e.viewQuery;if(null!==c&&hc(2,c,r),!i)if(s){const g=e.viewCheckHooks;null!==g&&fi(t,g)}else{const g=e.viewHooks;null!==g&&Li(t,g,2),hi(t,2)}!0===e.firstUpdatePass&&(e.firstUpdatePass=!1),i||(t[2]&=-73),1024&t[2]&&(t[2]&=-1025,Ls(t[3],-1))}finally{xi()}}function gC(e,t,n,r){const o=t[10],i=!Si(),s=si(t);try{i&&!s&&o.begin&&o.begin(),s&&la(e,t,r),os(e,t,n,r)}finally{i&&!s&&o.end&&o.end()}}function Eh(e,t,n,r,o){const i=Hn(),s=2&r;try{Kr(-1),s&&t.length>20&&ch(e,t,20,Si()),n(r,o)}finally{Kr(i)}}function ic(e,t,n){!Ba()||(function(e,t,n,r){const o=n.directiveStart,i=n.directiveEnd;e.firstCreatePass||l(n,t),Kn(r,t);const s=n.initialInputs;for(let a=o;a<i;a++){const c=e.data[a],g=O(c);g&&SC(t,n,c);const D=or(t,e,a,n);Kn(D,t),null!==s&&OC(0,a-o,D,c,0,s),g&&(bn(n.index,t)[8]=D)}}(e,t,n,$t(n,t)),128==(128&n.flags)&&function(e,t,n){const r=n.directiveStart,o=n.directiveEnd,s=n.index,a=it.lFrame.currentDirectiveIndex;try{Kr(s);for(let c=r;c<o;c++){const g=e.data[c],D=t[c];js(c),(null!==g.hostBindings||0!==g.hostVars||null!==g.hostAttrs)&&Oh(g,D)}}finally{Kr(-1),js(a)}}(e,t,n))}function sc(e,t,n=$t){const r=t.localNames;if(null!==r){let o=t.index+1;for(let i=0;i<r.length;i+=2){const s=r[i+1],a=-1===s?n(t,e):e[s];e[o++]=a}}}function bh(e){const t=e.tView;return null===t||t.incompleteFirstPass?e.tView=_l(1,null,e.template,e.decls,e.vars,e.directiveDefs,e.pipeDefs,e.viewQuery,e.schemas,e.consts):t}function _l(e,t,n,r,o,i,s,a,c,g){const D=20+r,T=D+o,S=function(e,t){const n=[];for(let r=0;r<t;r++)n.push(r<e?null:ct);return n}(D,T),P="function"==typeof g?g():g;return S[1]={type:e,blueprint:S,template:n,queries:null,viewQuery:a,declTNode:t,data:S.slice().fill(null,D),bindingStartIndex:D,expandoStartIndex:T,hostBindingOpCodes:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:"function"==typeof i?i():i,pipeRegistry:"function"==typeof s?s():s,firstChild:null,schemas:c,consts:P,incompleteFirstPass:!1}}function Mh(e,t,n,r){const o=kh(t);null===n?o.push(r):(o.push(n),e.firstCreatePass&&Lh(e).push(r,o.length-1))}function Th(e,t,n){for(let r in e)if(e.hasOwnProperty(r)){const o=e[r];(n=null===n?{}:n).hasOwnProperty(r)?n[r].push(t,o):n[r]=[t,o]}return n}function Cr(e,t,n,r,o,i,s,a){const c=$t(t,n);let D,g=t.inputs;!a&&null!=g&&(D=g[r])?(Bh(e,n,D,r,o),Tr(t)&&function(e,t){const n=bn(t,e);16&n[2]||(n[2]|=64)}(n,t.index)):3&t.type&&(r=function(e){return"class"===e?"className":"for"===e?"htmlFor":"formaction"===e?"formAction":"innerHtml"===e?"innerHTML":"readonly"===e?"readOnly":"tabindex"===e?"tabIndex":e}(r),o=null!=s?s(o,t.value||"",r):o,m(i)?i.setProperty(c,r,o):zs(r)||(c.setProperty?c.setProperty(r,o):c[r]=o))}function ac(e,t,n,r){let o=!1;if(Ba()){const i=function(e,t,n){const r=e.directiveRegistry;let o=null;if(r)for(let i=0;i<r.length;i++){const s=r[i];ah(n,s.selectors,!1)&&(o||(o=[]),R(l(n,t),e,s.type),O(s)?(Rh(e,n),o.unshift(s)):o.push(s))}return o}(e,t,n),s=null===r?null:{"":-1};if(null!==i){o=!0,Nh(n,e.data.length,i.length);for(let D=0;D<i.length;D++){const T=i[D];T.providersResolver&&T.providersResolver(T)}let a=!1,c=!1,g=rs(e,t,i.length,null);for(let D=0;D<i.length;D++){const T=i[D];n.mergedAttrs=Bi(n.mergedAttrs,T.hostAttrs),xh(e,n,t,g,T),IC(g,T,s),null!==T.contentQueries&&(n.flags|=8),(null!==T.hostBindings||null!==T.hostAttrs||0!==T.hostVars)&&(n.flags|=128);const S=T.type.prototype;!a&&(S.ngOnChanges||S.ngOnInit||S.ngDoCheck)&&((e.preOrderHooks||(e.preOrderHooks=[])).push(n.index),a=!0),!c&&(S.ngOnChanges||S.ngDoCheck)&&((e.preOrderCheckHooks||(e.preOrderCheckHooks=[])).push(n.index),c=!0),g++}!function(e,t){const r=t.directiveEnd,o=e.data,i=t.attrs,s=[];let a=null,c=null;for(let g=t.directiveStart;g<r;g++){const D=o[g],T=D.inputs,S=null===i||sh(t)?null:RC(T,i);s.push(S),a=Th(T,g,a),c=Th(D.outputs,g,c)}null!==a&&(a.hasOwnProperty("class")&&(t.flags|=16),a.hasOwnProperty("style")&&(t.flags|=32)),t.initialInputs=s,t.inputs=a,t.outputs=c}(e,n)}s&&function(e,t,n){if(t){const r=e.localNames=[];for(let o=0;o<t.length;o+=2){const i=n[t[o+1]];if(null==i)throw new je("301",`Export of name '${t[o+1]}' not found!`);r.push(t[o],i)}}}(n,r,s)}return n.mergedAttrs=Bi(n.mergedAttrs,n.attrs),o}function Sh(e,t,n,r,o,i){const s=i.hostBindings;if(s){let a=e.hostBindingOpCodes;null===a&&(a=e.hostBindingOpCodes=[]);const c=~t.index;(function(e){let t=e.length;for(;t>0;){const n=e[--t];if("number"==typeof n&&n<0)return n}return 0})(a)!=c&&a.push(c),a.push(r,o,s)}}function Oh(e,t){null!==e.hostBindings&&e.hostBindings(1,t)}function Rh(e,t){t.flags|=2,(e.components||(e.components=[])).push(t.index)}function IC(e,t,n){if(n){if(t.exportAs)for(let r=0;r<t.exportAs.length;r++)n[t.exportAs[r]]=e;O(t)&&(n[""]=e)}}function Nh(e,t,n){e.flags|=1,e.directiveStart=t,e.directiveEnd=t+n,e.providerIndexes=t}function xh(e,t,n,r,o){e.data[r]=o;const i=o.factory||(o.factory=Rr(o.type)),s=new qo(i,O(o),null);e.blueprint[r]=s,n[r]=s,Sh(e,t,0,r,rs(e,n,o.hostVars,ct),o)}function SC(e,t,n){const r=$t(t,e),o=bh(n),i=e[10],s=yl(e,aa(e,o,null,n.onPush?64:16,r,t,i,i.createRenderer(r,n),null,null));e[t.index]=s}function Do(e,t,n,r,o,i){const s=$t(e,t);!function(e,t,n,r,o,i,s){if(null==i)m(e)?e.removeAttribute(t,o,n):t.removeAttribute(o);else{const a=null==s?U(i):s(i,r||"",o);m(e)?e.setAttribute(t,o,a,n):n?t.setAttributeNS(n,o,a):t.setAttribute(o,a)}}(t[11],s,i,e.value,n,r,o)}function OC(e,t,n,r,o,i){const s=i[t];if(null!==s){const a=r.setInput;for(let c=0;c<s.length;){const g=s[c++],D=s[c++],T=s[c++];null!==a?r.setInput(n,T,g,D):n[D]=T}}}function RC(e,t){let n=null,r=0;for(;r<t.length;){const o=t[r];if(0!==o)if(5!==o){if("number"==typeof o)break;e.hasOwnProperty(o)&&(null===n&&(n=[]),n.push(o,e[o],t[r+1])),r+=2}else r+=2;else r+=4}return n}function Ph(e,t,n,r){return new Array(e,!0,!1,t,null,0,r,n,null,null)}function PC(e,t){const n=bn(t,e);if(qr(n)){const r=n[1];80&n[2]?os(r,n,r.template,n[8]):n[5]>0&&uc(n)}}function uc(e){for(let r=Uu(e);null!==r;r=Bu(r))for(let o=10;o<r.length;o++){const i=r[o];if(1024&i[2]){const s=i[1];os(s,i,s.template,i[8])}else i[5]>0&&uc(i)}const n=e[1].components;if(null!==n)for(let r=0;r<n.length;r++){const o=bn(n[r],e);qr(o)&&o[5]>0&&uc(o)}}function FC(e,t){const n=bn(t,e),r=n[1];(function(e,t){for(let n=t.length;n<e.blueprint.length;n++)t.push(e.blueprint[n])})(r,n),la(r,n,n[8])}function yl(e,t){return e[13]?e[14][4]=t:e[13]=t,e[14]=t,t}function cc(e){for(;e;){e[2]|=64;const t=ia(e);if(x(e)&&!t)return e;e=t}return null}function fc(e,t,n){const r=t[10];r.begin&&r.begin();try{os(e,t,e.template,n)}catch(o){throw Uh(t,o),o}finally{r.end&&r.end()}}function Fh(e){!function(e){for(let t=0;t<e.components.length;t++){const n=e.components[t],r=Fu(n),o=r[1];gC(o,r,o.template,n)}}(e[8])}function hc(e,t,n){di(0),t(e,n)}const BC=(()=>Promise.resolve(null))();function kh(e){return e[7]||(e[7]=[])}function Lh(e){return e.cleanup||(e.cleanup=[])}function Uh(e,t){const n=e[9],r=n?n.get(Xi,null):null;r&&r.handleError(t)}function Bh(e,t,n,r,o){for(let i=0;i<n.length;){const s=n[i++],a=n[i++],c=t[s],g=e.data[s];null!==g.setInput?g.setInput(c,o,r,a):c[a]=o}}function Bo(e,t,n){const r=Qt(t,e);!function(e,t,n){m(e)?e.setValue(t,n):t.textContent=n}(e[11],r,n)}function vl(e,t,n){let r=n?e.styles:null,o=n?e.classes:null,i=0;if(null!==t)for(let s=0;s<t.length;s++){const a=t[s];"number"==typeof a?i=a:1==i?o=Ge(o,a):2==i&&(r=Ge(r,a+": "+t[++s]+";"))}n?e.styles=r:e.stylesWithoutHost=r,n?e.classes=o:e.classesWithoutHost=o}const is=new an("INJECTOR",-1);class jh{get(t,n=Ks){if(n===Ks){const r=new Error(`NullInjectorError: No provider for ${Ae(t)}!`);throw r.name="NullInjectorError",r}return n}}const ua=new an("Set Injector scope."),ca={},$C={};let pc;function Hh(){return void 0===pc&&(pc=new jh),pc}function $h(e,t=null,n=null,r){return new zC(e,n,t||Hh(),r)}class zC{constructor(t,n,r,o=null){this.parent=r,this.records=new Map,this.injectorDefTypes=new Set,this.onDestroy=new Set,this._destroyed=!1;const i=[];n&&yo(n,a=>this.processProvider(a,t,n)),yo([t],a=>this.processInjectorType(a,[],i)),this.records.set(is,ss(void 0,this));const s=this.records.get(ua);this.scope=null!=s?s.value:null,this.source=o||("object"==typeof t?null:Ae(t))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(t=>t.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(t,n=Ks,r=J.Default){this.assertNotDestroyed();const o=Zi(this),i=At(void 0);try{if(!(r&J.SkipSelf)){let a=this.records.get(t);if(void 0===a){const c=("function"==typeof(e=t)||"object"==typeof e&&e instanceof an)&>(t);a=c&&this.injectableDefInScope(c)?ss(gc(t),ca):null,this.records.set(t,a)}if(null!=a)return this.hydrate(t,a)}return(r&J.Self?Hh():this.parent).get(t,n=r&J.Optional&&n===Ks?null:n)}catch(s){if("NullInjectorError"===s.name){if((s[Yi]=s[Yi]||[]).unshift(Ae(t)),o)throw s;return uf(s,t,"R3InjectorError",this.source)}throw s}finally{At(i),Zi(o)}var e}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(t=>this.get(t))}toString(){const t=[];return this.records.forEach((r,o)=>t.push(Ae(o))),`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(t,n,r){if(!(t=ae(t)))return!1;let o=B(t);const i=null==o&&t.ngModule||void 0,s=void 0===i?t:i,a=-1!==r.indexOf(s);if(void 0!==i&&(o=B(i)),null==o)return!1;if(null!=o.imports&&!a){let D;r.push(s);try{yo(o.imports,T=>{this.processInjectorType(T,n,r)&&(void 0===D&&(D=[]),D.push(T))})}finally{}if(void 0!==D)for(let T=0;T<D.length;T++){const{ngModule:S,providers:P}=D[T];yo(P,V=>this.processProvider(V,S,P||mt))}}this.injectorDefTypes.add(s);const c=Rr(s)||(()=>new s);this.records.set(s,ss(c,ca));const g=o.providers;if(null!=g&&!a){const D=t;yo(g,T=>this.processProvider(T,D,g))}return void 0!==i&&void 0!==t.providers}processProvider(t,n,r){let o=as(t=ae(t))?t:ae(t&&t.provide);const i=zh(e=t)?ss(void 0,e.useValue):ss(Gh(e),ca);var e;if(as(t)||!0!==t.multi)this.records.get(o);else{let s=this.records.get(o);s||(s=ss(void 0,ca,!0),s.factory=()=>mi(s.multi),this.records.set(o,s)),o=t,s.multi.push(t)}this.records.set(o,i)}hydrate(t,n){return n.value===ca&&(n.value=$C,n.value=n.factory()),"object"==typeof n.value&&n.value&&null!==(e=n.value)&&"object"==typeof e&&"function"==typeof e.ngOnDestroy&&this.onDestroy.add(n.value),n.value;var e}injectableDefInScope(t){if(!t.providedIn)return!1;const n=ae(t.providedIn);return"string"==typeof n?"any"===n||n===this.scope:this.injectorDefTypes.has(n)}}function gc(e){const t=gt(e),n=null!==t?t.factory:Rr(e);if(null!==n)return n;if(e instanceof an)throw new Error(`Token ${Ae(e)} is missing a \u0275prov definition.`);if(e instanceof Function)return function(e){const t=e.length;if(t>0){const r=function(e,t){const n=[];for(let r=0;r<e;r++)n.push(t);return n}(t,"?");throw new Error(`Can't resolve all parameters for ${Ae(e)}: (${r.join(", ")}).`)}const n=function(e){const t=e&&(e[j]||e[ce]);if(t){const n=function(e){if(e.hasOwnProperty("name"))return e.name;const t=(""+e).match(/^function\s*([^\s(]+)/);return null===t?"":t[1]}(e);return console.warn(`DEPRECATED: DI is instantiating a token "${n}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${n}" class.`),t}return null}(e);return null!==n?()=>n.factory(e):()=>new e}(e);throw new Error("unreachable")}function Gh(e,t,n){let r;if(as(e)){const o=ae(e);return Rr(o)||gc(o)}if(zh(e))r=()=>ae(e.useValue);else if(function(e){return!(!e||!e.useFactory)}(e))r=()=>e.useFactory(...mi(e.deps||[]));else if(function(e){return!(!e||!e.useExisting)}(e))r=()=>vn(ae(e.useExisting));else{const o=ae(e&&(e.useClass||e.provide));if(!function(e){return!!e.deps}(e))return Rr(o)||gc(o);r=()=>new o(...mi(e.deps))}return r}function ss(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function zh(e){return null!==e&&"object"==typeof e&&Au in e}function as(e){return"function"==typeof e}const Wh=function(e,t,n){return function(e,t=null,n=null,r){const o=$h(e,t,n,r);return o._resolveInjectorDefTypes(),o}({name:n},t,e,n)};class Ft{static create(t,n){return Array.isArray(t)?Wh(t,n,""):Wh(t.providers,t.parent,t.name||"")}}function fE(e,t){Jr(Fu(e)[1],pn())}function Ec(e){let t=function(e){return Object.getPrototypeOf(e.prototype).constructor}(e.type),n=!0;const r=[e];for(;t;){let o;if(O(e))o=t.\u0275cmp||t.\u0275dir;else{if(t.\u0275cmp)throw new Error("Directives cannot inherit Components");o=t.\u0275dir}if(o){if(n){r.push(o);const s=e;s.inputs=Dc(e.inputs),s.declaredInputs=Dc(e.declaredInputs),s.outputs=Dc(e.outputs);const a=o.hostBindings;a&&mE(e,a);const c=o.viewQuery,g=o.contentQueries;if(c&&pE(e,c),g&&gE(e,g),$e(e.inputs,o.inputs),$e(e.declaredInputs,o.declaredInputs),$e(e.outputs,o.outputs),O(o)&&o.data.animation){const D=e.data;D.animation=(D.animation||[]).concat(o.data.animation)}}const i=o.features;if(i)for(let s=0;s<i.length;s++){const a=i[s];a&&a.ngInherit&&a(e),a===Ec&&(n=!1)}}t=Object.getPrototypeOf(t)}!function(e){let t=0,n=null;for(let r=e.length-1;r>=0;r--){const o=e[r];o.hostVars=t+=o.hostVars,o.hostAttrs=Bi(o.hostAttrs,n=Bi(n,o.hostAttrs))}}(r)}function Dc(e){return e===Pn?{}:e===mt?[]:e}function pE(e,t){const n=e.viewQuery;e.viewQuery=n?(r,o)=>{t(r,o),n(r,o)}:t}function gE(e,t){const n=e.contentQueries;e.contentQueries=n?(r,o,i)=>{t(r,o,i),n(r,o,i)}:t}function mE(e,t){const n=e.hostBindings;e.hostBindings=n?(r,o)=>{t(r,o),n(r,o)}:t}Ft.THROW_IF_NOT_FOUND=Ks,Ft.NULL=new jh,Ft.\u0275prov=kt({token:Ft,providedIn:"any",factory:()=>vn(is)}),Ft.__NG_ELEMENT_ID__=-1;let Cl=null;function ls(){if(!Cl){const e=tt.Symbol;if(e&&e.iterator)Cl=e.iterator;else{const t=Object.getOwnPropertyNames(Map.prototype);for(let n=0;n<t.length;++n){const r=t[n];"entries"!==r&&"size"!==r&&Map.prototype[r]===Map.prototype.entries&&(Cl=r)}}}return Cl}class ro{constructor(t){this.wrapped=t}static wrap(t){return new ro(t)}static unwrap(t){return ro.isWrapped(t)?t.wrapped:t}static isWrapped(t){return t instanceof ro}}function fa(e){return!!bc(e)&&(Array.isArray(e)||!(e instanceof Map)&&ls()in e)}function bc(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function bo(e,t,n){return e[t]=n}function Jn(e,t,n){return!Object.is(e[t],n)&&(e[t]=n,!0)}function vi(e,t,n,r){const o=Jn(e,t,n);return Jn(e,t+1,r)||o}function wc(e,t,n,r){const o=de();return Jn(o,xo(),t)&&(vt(),Do(Kt(),o,e,t,n,r)),wc}function cs(e,t,n,r){return Jn(e,xo(),n)?t+U(n)+r:ct}function vp(e,t,n,r,o,i,s,a){const c=de(),g=vt(),D=e+20,T=g.firstCreatePass?function(e,t,n,r,o,i,s,a,c){const g=t.consts,D=ns(t,e,4,s||null,Qr(g,a));ac(t,n,D,Qr(g,c)),Jr(t,D);const T=D.tViews=_l(2,D,r,o,i,t.directiveRegistry,t.pipeRegistry,null,t.schemas,g);return null!==t.queries&&(t.queries.template(t,D),T.queries=t.queries.embeddedTView(D)),D}(D,g,c,t,n,r,o,i,s):g.data[D];Pr(T,!1);const S=c[11].createComment("");fl(g,c,S,T),Kn(S,c),yl(c,c[D]=Ph(S,c,S,T)),Qn(T)&&ic(g,c,T),null!=s&&sc(c,T,a)}function Cp(e){return mr(it.lFrame.contextLView,20+e)}function pa(e,t=J.Default){const n=de();return null===n?vn(e,t):Ue(pn(),n,ae(e),t)}function Sc(e,t,n){const r=de();return Jn(r,xo(),t)&&Cr(vt(),Kt(),r,e,t,r[11],n,!1),Sc}function Oc(e,t,n,r,o){const s=o?"class":"style";Bh(e,n,t.inputs[s],s,r)}function Rc(e,t,n,r){const o=de(),i=vt(),s=20+e,a=o[11],c=o[s]=Hu(a,t,it.lFrame.currentNamespace),g=i.firstCreatePass?function(e,t,n,r,o,i,s){const a=t.consts,g=ns(t,e,2,o,Qr(a,i));return ac(t,n,g,Qr(a,s)),null!==g.attrs&&vl(g,g.attrs,!1),null!==g.mergedAttrs&&vl(g,g.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,g),g}(s,i,o,0,t,n,r):i.data[s];Pr(g,!0);const D=g.mergedAttrs;null!==D&&Ui(a,c,D);const T=g.classes;null!==T&&Zu(a,c,T);const S=g.styles;null!==S&&rh(a,c,S),64!=(64&g.flags)&&fl(i,o,c,g),0===it.lFrame.elementDepthCount&&Kn(c,o),it.lFrame.elementDepthCount++,Qn(g)&&(ic(i,o,g),function(e,t,n){if(pr(t)){const o=t.directiveEnd;for(let i=t.directiveStart;i<o;i++){const s=e.data[i];s.contentQueries&&s.contentQueries(1,n[i],i)}}}(i,g,o)),null!==r&&sc(o,g)}function Nc(){let e=pn();Us()?it.lFrame.isParent=!1:(e=e.parent,Pr(e,!1));const t=e;it.lFrame.elementDepthCount--;const n=vt();n.firstCreatePass&&(Jr(n,e),pr(e)&&n.queries.elementEnd(e)),null!=t.classesWithoutHost&&function(e){return 0!=(16&e.flags)}(t)&&Oc(n,t,de(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function(e){return 0!=(32&e.flags)}(t)&&Oc(n,t,de(),t.stylesWithoutHost,!1)}function Np(e,t,n,r){Rc(e,t,n,r),Nc()}function Fp(){return de()}function xc(e){return!!e&&"function"==typeof e.then}function kp(e){return!!e&&"function"==typeof e.subscribe}const Pc=kp;function Fc(e,t,n,r){const o=de(),i=vt(),s=pn();return function(e,t,n,r,o,i,s,a){const c=Qn(r),D=e.firstCreatePass&&Lh(e),T=t[8],S=kh(t);let P=!0;if(3&r.type||a){const H=$t(r,t),pe=a?a(H):H,re=S.length,Le=a?Qe=>a(ve(Qe[r.index])):r.index;if(m(n)){let Qe=null;if(!a&&c&&(Qe=function(e,t,n,r){const o=e.cleanup;if(null!=o)for(let i=0;i<o.length-1;i+=2){const s=o[i];if(s===n&&o[i+1]===r){const a=t[7],c=o[i+2];return a.length>c?a[c]:null}"string"==typeof s&&(i+=2)}return null}(e,t,o,r.index)),null!==Qe)(Qe.__ngLastListenerFn__||Qe).__ngNextListenerFn__=i,Qe.__ngLastListenerFn__=i,P=!1;else{i=kc(r,t,T,i,!1);const ht=n.listen(pe,o,i);S.push(i,ht),D&&D.push(o,Le,re,re+1)}}else i=kc(r,t,T,i,!0),pe.addEventListener(o,i,s),S.push(i),D&&D.push(o,Le,re,s)}else i=kc(r,t,T,i,!1);const V=r.outputs;let W;if(P&&null!==V&&(W=V[o])){const H=W.length;if(H)for(let pe=0;pe<H;pe+=2){const Jt=t[W[pe]][W[pe+1]].subscribe(i),Hr=S.length;S.push(i,Jt),D&&D.push(o,r.index,Hr,-(Hr+1))}}}(i,o,o[11],s,e,t,!!n,r),Fc}function Up(e,t,n,r){try{return!1!==n(r)}catch(o){return Uh(e,o),!1}}function kc(e,t,n,r,o){return function i(s){if(s===Function)return r;const a=2&e.flags?bn(e.index,t):t;0==(32&t[2])&&cc(a);let c=Up(t,0,r,s),g=i.__ngNextListenerFn__;for(;g;)c=Up(t,0,g,s)&&c,g=g.__ngNextListenerFn__;return o&&!1===c&&(s.preventDefault(),s.returnValue=!1),c}}function Bp(e=1){return function(e){return(it.lFrame.contextLView=function(e,t){for(;e>0;)t=t[15],e--;return t}(e,it.lFrame.contextLView))[8]}(e)}function Lc(e,t,n){return bl(e,"",t,"",n),Lc}function bl(e,t,n,r,o){const i=de(),s=cs(i,t,n,r);return s!==ct&&Cr(vt(),Kt(),i,e,s,i[11],o,!1),bl}function Vc(e,t,n,r,o,i,s){const a=de(),c=function(e,t,n,r,o,i){const a=vi(e,_r(),n,o);return Fr(2),a?t+U(n)+r+U(o)+i:ct}(a,t,n,r,o,i);return c!==ct&&Cr(vt(),Kt(),a,e,c,a[11],s,!1),Vc}function Zp(e,t,n,r,o){const i=e[n+1],s=null===t;let a=r?to(i):Vo(i),c=!1;for(;0!==a&&(!1===c||s);){const D=e[a+1];nD(e[a],t)&&(c=!0,e[a+1]=r?Ku(D):qu(D)),a=r?to(D):Vo(D)}c&&(e[n+1]=r?qu(i):Ku(i))}function nD(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&Wi(e,t)>=0}const An={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function qp(e){return e.substring(An.key,An.keyEnd)}function Qp(e,t){const n=An.textEnd;return n===t?-1:(t=An.keyEnd=function(e,t,n){for(;t<n&&e.charCodeAt(t)>32;)t++;return t}(e,An.key=t,n),vs(e,t,n))}function vs(e,t,n){for(;t<n&&e.charCodeAt(t)<=32;)t++;return t}function Uc(e,t,n){return oo(e,t,n,!1),Uc}function Bc(e,t){return oo(e,t,null,!0),Bc}function tg(e){!function(e,t,n,r){const o=vt(),i=Fr(2);o.firstUpdatePass&&rg(o,null,i,r);const s=de();if(n!==ct&&Jn(s,i,n)){const a=o.data[Hn()];if(ag(a,r)&&!ng(o,i)){let c=r?a.classesWithoutHost:a.stylesWithoutHost;null!==c&&(n=Ge(c,n||"")),Oc(o,a,s,n,r)}else!function(e,t,n,r,o,i,s,a){o===ct&&(o=mt);let c=0,g=0,D=0<o.length?o[0]:null,T=0<i.length?i[0]:null;for(;null!==D||null!==T;){const S=c<o.length?o[c+1]:void 0,P=g<i.length?i[g+1]:void 0;let W,V=null;D===T?(c+=2,g+=2,S!==P&&(V=T,W=P)):null===T||null!==D&&D<T?(c+=2,V=D):(g+=2,V=T,W=P),null!==V&&ig(e,t,n,r,V,W,s,a),D=c<o.length?o[c]:null,T=g<i.length?i[g]:null}}(o,a,s,s[11],s[i+1],s[i+1]=function(e,t,n){if(null==n||""===n)return mt;const r=[],o=Lo(n);if(Array.isArray(o))for(let i=0;i<o.length;i++)e(r,o[i],!0);else if("object"==typeof o)for(const i in o)o.hasOwnProperty(i)&&e(r,i,o[i]);else"string"==typeof o&&t(r,o);return r}(e,t,n),r,i)}}(vr,Ao,e,!0)}function Ao(e,t){for(let n=function(e){return function(e){An.key=0,An.keyEnd=0,An.value=0,An.valueEnd=0,An.textEnd=e.length}(e),Qp(e,vs(e,0,An.textEnd))}(t);n>=0;n=Qp(t,n))vr(e,qp(t),!0)}function oo(e,t,n,r){const o=de(),i=vt(),s=Fr(2);i.firstUpdatePass&&rg(i,e,s,r),t!==ct&&Jn(o,s,t)&&ig(i,i.data[Hn()],o,o[11],e,o[s+1]=function(e,t){return null==e||("string"==typeof t?e+=t:"object"==typeof e&&(e=Ae(Lo(e)))),e}(t,n),r,s)}function ng(e,t){return t>=e.expandoStartIndex}function rg(e,t,n,r){const o=e.data;if(null===o[n+1]){const i=o[Hn()],s=ng(e,n);ag(i,r)&&null===t&&!s&&(t=!1),t=function(e,t,n,r){const o=function(e){const t=it.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}(e);let i=r?t.residualClasses:t.residualStyles;if(null===o)0===(r?t.classBindings:t.styleBindings)&&(n=ga(n=jc(null,e,t,n,r),t.attrs,r),i=null);else{const s=t.directiveStylingLast;if(-1===s||e[s]!==o)if(n=jc(o,e,t,n,r),null===i){let c=function(e,t,n){const r=n?t.classBindings:t.styleBindings;if(0!==Vo(r))return e[to(r)]}(e,t,r);void 0!==c&&Array.isArray(c)&&(c=jc(null,e,t,c[1],r),c=ga(c,t.attrs,r),function(e,t,n,r){e[to(n?t.classBindings:t.styleBindings)]=r}(e,t,r,c))}else i=function(e,t,n){let r;const o=t.directiveEnd;for(let i=1+t.directiveStylingLast;i<o;i++)r=ga(r,e[i].hostAttrs,n);return ga(r,t.attrs,n)}(e,t,r)}return void 0!==i&&(r?t.residualClasses=i:t.residualStyles=i),n}(o,i,t,r),function(e,t,n,r,o,i){let s=i?t.classBindings:t.styleBindings,a=to(s),c=Vo(s);e[r]=n;let D,g=!1;if(Array.isArray(n)){const T=n;D=T[1],(null===D||Wi(T,D)>0)&&(g=!0)}else D=n;if(o)if(0!==c){const S=to(e[a+1]);e[r+1]=pl(S,a),0!==S&&(e[S+1]=Qu(e[S+1],r)),e[a+1]=function(e,t){return 131071&e|t<<17}(e[a+1],r)}else e[r+1]=pl(a,0),0!==a&&(e[a+1]=Qu(e[a+1],r)),a=r;else e[r+1]=pl(c,0),0===a?a=r:e[c+1]=Qu(e[c+1],r),c=r;g&&(e[r+1]=qu(e[r+1])),Zp(e,D,r,!0),Zp(e,D,r,!1),function(e,t,n,r,o){const i=o?e.residualClasses:e.residualStyles;null!=i&&"string"==typeof t&&Wi(i,t)>=0&&(n[r+1]=Ku(n[r+1]))}(t,D,e,r,i),s=pl(a,c),i?t.classBindings=s:t.styleBindings=s}(o,i,t,n,s,r)}}function jc(e,t,n,r,o){let i=null;const s=n.directiveEnd;let a=n.directiveStylingLast;for(-1===a?a=n.directiveStart:a++;a<s&&(i=t[a],r=ga(r,i.hostAttrs,o),i!==e);)a++;return null!==e&&(n.directiveStylingLast=a),r}function ga(e,t,n){const r=n?1:2;let o=-1;if(null!==t)for(let i=0;i<t.length;i++){const s=t[i];"number"==typeof s?o=s:o===r&&(Array.isArray(e)||(e=void 0===e?[]:["",e]),vr(e,s,!!n||t[++i]))}return void 0===e?null:e}function ig(e,t,n,r,o,i,s,a){if(!(3&t.type))return;const c=e.data,g=c[a+1];wl(function(e){return 1==(1&e)}(g)?sg(c,t,n,o,Vo(g),s):void 0)||(wl(i)||function(e){return 2==(2&e)}(g)&&(i=sg(c,null,n,o,a,s)),function(e,t,n,r,o){const i=m(e);if(t)o?i?e.addClass(n,r):n.classList.add(r):i?e.removeClass(n,r):n.classList.remove(r);else{let s=-1===r.indexOf("-")?void 0:Eo.DashCase;if(null==o)i?e.removeStyle(n,r,s):n.style.removeProperty(r);else{const a="string"==typeof o&&o.endsWith("!important");a&&(o=o.slice(0,-10),s|=Eo.Important),i?e.setStyle(n,r,o,s):n.style.setProperty(r,o,a?"important":"")}}}(r,s,Qt(Hn(),n),o,i))}function sg(e,t,n,r,o,i){const s=null===t;let a;for(;o>0;){const c=e[o],g=Array.isArray(c),D=g?c[1]:c,T=null===D;let S=n[o+1];S===ct&&(S=T?mt:void 0);let P=T?Eu(S,r):D===r?S:void 0;if(g&&!wl(P)&&(P=Eu(c,r)),wl(P)&&(a=P,s))return a;const V=e[o+1];o=s?to(V):Vo(V)}if(null!==t){let c=i?t.residualClasses:t.residualStyles;null!=c&&(a=Eu(c,r))}return a}function wl(e){return void 0!==e}function ag(e,t){return 0!=(e.flags&(t?16:32))}function lg(e,t=""){const n=de(),r=vt(),o=e+20,i=r.firstCreatePass?ns(r,o,1,t,null):r.data[o],s=n[o]=ju(n[11],t);fl(r,n,s,i),Pr(i,!1)}function Hc(e){return Al("",e,""),Hc}function Al(e,t,n){const r=de(),o=cs(r,e,t,n);return o!==ct&&Bo(r,Hn(),o),Al}function $c(e,t,n){const r=de();return Jn(r,xo(),t)&&Cr(vt(),Kt(),r,e,t,r[11],n,!0),$c}const Ci=void 0;var kD=["en",[["a","p"],["AM","PM"],Ci],[["AM","PM"],Ci,Ci],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Ci,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Ci,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Ci,"{1} 'at' {0}",Ci],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(e){const t=Math.floor(Math.abs(e)),n=e.toString().replace(/^[^.]*\.?/,"").length;return 1===t&&0===n?1:5}];let Cs={};function Gc(e){const t=function(e){return e.toLowerCase().replace(/_/g,"-")}(e);let n=Ig(t);if(n)return n;const r=t.split("-")[0];if(n=Ig(r),n)return n;if("en"===r)return kD;throw new Error(`Missing locale data for the locale "${e}".`)}function Tg(e){return Gc(e)[qe.PluralCase]}function Ig(e){return e in Cs||(Cs[e]=tt.ng&&tt.ng.common&&tt.ng.common.locales&&tt.ng.common.locales[e]),Cs[e]}var qe=(()=>((qe=qe||{})[qe.LocaleId=0]="LocaleId",qe[qe.DayPeriodsFormat=1]="DayPeriodsFormat",qe[qe.DayPeriodsStandalone=2]="DayPeriodsStandalone",qe[qe.DaysFormat=3]="DaysFormat",qe[qe.DaysStandalone=4]="DaysStandalone",qe[qe.MonthsFormat=5]="MonthsFormat",qe[qe.MonthsStandalone=6]="MonthsStandalone",qe[qe.Eras=7]="Eras",qe[qe.FirstDayOfWeek=8]="FirstDayOfWeek",qe[qe.WeekendRange=9]="WeekendRange",qe[qe.DateFormat=10]="DateFormat",qe[qe.TimeFormat=11]="TimeFormat",qe[qe.DateTimeFormat=12]="DateTimeFormat",qe[qe.NumberSymbols=13]="NumberSymbols",qe[qe.NumberFormats=14]="NumberFormats",qe[qe.CurrencyCode=15]="CurrencyCode",qe[qe.CurrencySymbol=16]="CurrencySymbol",qe[qe.CurrencyName=17]="CurrencyName",qe[qe.Currencies=18]="Currencies",qe[qe.Directionality=19]="Directionality",qe[qe.PluralCase=20]="PluralCase",qe[qe.ExtraData=21]="ExtraData",qe))();const Ml="en-US",Tl={marker:"element"},Il={marker:"ICU"};var un=(()=>((un=un||{})[un.SHIFT=2]="SHIFT",un[un.APPEND_EAGERLY=1]="APPEND_EAGERLY",un[un.COMMENT=2]="COMMENT",un))();let Sg=Ml;function zc(e){(function(e,t){null==e&&rt(t,e,null,"!=")})(e,"Expected localeId to be defined"),"string"==typeof e&&(Sg=e.toLowerCase().replace(/_/g,"-"))}function Og(e,t,n){const r=t.insertBeforeIndex,o=Array.isArray(r)?r[0]:r;return null===o?Kf(e,0,n):ve(n[o])}function Rg(e,t,n,r,o){const i=t.insertBeforeIndex;if(Array.isArray(i)){let s=r,a=null;if(3&t.type||(a=s,s=o),null!==s&&0==(2&t.flags))for(let c=1;c<i.length;c++)yi(e,s,n[i[c]],a,!1)}}function Ng(e,t){if(e.push(t),e.length>1)for(let n=e.length-2;n>=0;n--){const r=e[n];xg(r)||HD(r,t)&&null===$D(r)&&GD(r,t.index)}}function xg(e){return!(64&e.type)}function HD(e,t){return xg(t)||e.index>t.index}function $D(e){const t=e.insertBeforeIndex;return Array.isArray(t)?t[0]:t}function GD(e,t){const n=e.insertBeforeIndex;Array.isArray(n)?n[0]=t:(Xf(Og,Rg),e.insertBeforeIndex=t)}function YD(e,t,n){const r=oc(e,n,64,null,null);return Ng(t,r),r}function e0(){const e=[];let n,r,t=-1;function i(a,c){t=0;const g=function(e,t){const n=t[e.currentCaseLViewIndex];return null===n?n:n<0?~n:n}(a,c);r=null!==g?a.remove[g]:mt}function s(){if(t<r.length){const a=r[t++];return a>0?n[a]:(e.push(t,r),i(n[1].data[~a],n),s())}return 0===e.length?null:(r=e.pop(),t=e.pop(),s())}return function(a,c){for(n=c;e.length;)e.pop();return i(a.value,c),s}}const Ol=/\ufffd(\d+):?\d*\ufffd/gi,n0=/\ufffd(\d+)\ufffd/,Hg=/^\s*(\ufffd\d+:?\d*\ufffd)\s*,\s*(select|plural)\s*,/,r0=/\ufffd\/?\*(\d+:\d+)\ufffd/gi,o0=/\ufffd(\/?[#*]\d+):?\d*\ufffd/gi,i0=/\uE500/g;function $g(e,t,n,r,o,i,s){const a=rs(e,r,1,null);let c=a<<un.SHIFT,g=ci();t===g&&(g=null),null===g&&(c|=un.APPEND_EAGERLY),s&&(c|=un.COMMENT,function(e){void 0===Lu&&(Lu=e())}(e0)),o.push(c,null===i?"":i);const D=oc(e,a,s?32:1,null===i?"":i,null);Ng(n,D);const T=D.index;return Pr(D,!1),null!==g&&t!==g&&function(e,t){let n=e.insertBeforeIndex;null===n?(Xf(Og,Rg),n=e.insertBeforeIndex=[null,t]):(function(e,t,n){e!=t&&rt(n,e,t,"==")}(Array.isArray(n),!0,"Expecting array here"),n.push(t))}(g,T),D}function l0(e,t,n,r,o,i,s){const a=s.match(Ol),c=$g(e,t,n,i,r,a?null:s,!1);a&&Es(o,s,c.index,null,0,null)}function Es(e,t,n,r,o,i){const s=e.length,a=s+1;e.push(null,null);const c=s+2,g=t.split(Ol);let D=0;for(let T=0;T<g.length;T++){const S=g[T];if(1&T){const P=o+parseInt(S,10);e.push(-1-P),D|=Gg(P)}else""!==S&&e.push(S)}return e.push(n<<2|(r?1:0)),r&&e.push(r,i),e[s]=D,e[a]=e.length-c,D}function Gg(e){return 1<<Math.min(e,31)}function zg(e){let t,i,n="",r=0,o=!1;for(;null!==(t=r0.exec(e));)o?t[0]===`\ufffd/*${i}\ufffd`&&(r=t.index,o=!1):(n+=e.substring(r,t.index+t[0].length),i=t[1],o=!0);return n+=e.substr(r),n}function Wg(e,t,n,r,o,i){let s=0;const a={type:o.type,currentCaseLViewIndex:rs(e,t,1,null),anchorIdx:i,cases:[],create:[],remove:[],update:[]};(function(e,t,n){e.push(Gg(t.mainBinding),2,-1-t.mainBinding,n<<2|2)})(n,o,i),function(e,t,n){const r=e.data[t];null===r?e.data[t]=n:r.value=n}(e,i,a);const c=o.values;for(let g=0;g<c.length;g++){const D=c[g],T=[];for(let S=0;S<D.length;S++){const P=D[S];if("string"!=typeof P){const V=T.push(P)-1;D[S]=`\x3c!--\ufffd${V}\ufffd--\x3e`}}s=p0(e,a,t,n,r,o.cases[g],D.join(""),T)|s}s&&function(e,t,n){e.push(t,1,n<<2|3)}(n,s,i)}function h0(e){const t=[],n=[];let r=1,o=0;const i=Wc(e=e.replace(Hg,function(s,a,c){return r="select"===c?0:1,o=parseInt(a.substr(1),10),""}));for(let s=0;s<i.length;){let a=i[s++].trim();1===r&&(a=a.replace(/\s*(?:=)?(\w+)\s*/,"$1")),a.length&&t.push(a);const c=Wc(i[s++]);t.length>n.length&&n.push(c)}return{type:r,mainBinding:o,cases:t,values:n}}function Wc(e){if(!e)return[];let t=0;const n=[],r=[],o=/[{}]/g;let i;for(o.lastIndex=0;i=o.exec(e);){const a=i.index;if("}"==i[0]){if(n.pop(),0==n.length){const c=e.substring(t,a);Hg.test(c)?r.push(h0(c)):r.push(c),t=a+1}}else{if(0==n.length){const c=e.substring(t,a);r.push(c),t=a+1}n.push("{")}}const s=e.substring(t);return r.push(s),r}function p0(e,t,n,r,o,i,s,a){const c=[],g=[],D=[];t.cases.push(i),t.create.push(c),t.remove.push(g),t.update.push(D);const S=yf(Et()).getInertBodyElement(s),P=Nu(S)||S;return P?Yg(e,t,n,r,c,g,D,P,o,a,0):0}function Yg(e,t,n,r,o,i,s,a,c,g,D){let T=0,S=a.firstChild;for(;S;){const P=rs(e,n,1,null);switch(S.nodeType){case Node.ELEMENT_NODE:const V=S,W=V.tagName.toLowerCase();if(Su.hasOwnProperty(W)){Yc(o,Tl,W,c,P),e.data[P]=W;const Le=V.attributes;for(let Qe=0;Qe<Le.length;Qe++){const ht=Le.item(Qe),Jt=ht.name.toLowerCase();ht.value.match(Ol)?bf.hasOwnProperty(Jt)&&Es(s,ht.value,P,ht.name,0,Ou[Jt]?ta:Ru[Jt]?vf:null):y0(o,P,ht)}T=Yg(e,t,n,r,o,i,s,S,P,g,D+1)|T,Zg(i,P,D)}break;case Node.TEXT_NODE:const H=S.textContent||"",pe=H.match(Ol);Yc(o,null,pe?"":H,c,P),Zg(i,P,D),pe&&(T=Es(s,H,P,null,0,null)|T);break;case Node.COMMENT_NODE:const re=n0.exec(S.textContent||"");if(re){const Qe=g[parseInt(re[1],10)];Yc(o,Il,"",c,P),Wg(e,n,r,c,Qe,P),g0(i,P,D)}}S=S.nextSibling}return T}function Zg(e,t,n){0===n&&e.push(t)}function g0(e,t,n){0===n&&(e.push(~t),e.push(t))}function Yc(e,t,n,r,o){null!==t&&e.push(t),e.push(n,o,function(e,t,n){return 0|t<<17|n<<1}(0,r,o))}function y0(e,t,n){e.push(t<<1|1,n.name,n.value)}const v0=/\[(\ufffd.+?\ufffd?)\]/,C0=/\[(\ufffd.+?\ufffd?)\]|(\ufffd\/?\*\d+:\d+\ufffd)/g,E0=/({\s*)(VAR_(PLURAL|SELECT)(_\d+)?)(\s*,)/g,D0=/{([A-Z0-9_]+)}/g,b0=/\ufffdI18N_EXP_(ICU(_\d+)?)\ufffd/g,w0=/\/\*/,A0=/\d+\:(\d+)/;function Zc(e,t,n=-1){const r=vt(),o=de(),i=20+e,s=Qr(r.consts,t),a=ci();r.firstCreatePass&&function(e,t,n,r,o,i){const s=ci(),a=[],c=[],g=[[]],D=function(e){return e.replace(i0," ")}(o=function(e,t){if(function(e){return-1===e}(t))return zg(e);{const n=e.indexOf(`:${t}\ufffd`)+2+t.toString().length,r=e.search(new RegExp(`\ufffd\\/\\*\\d+:${t}\ufffd`));return zg(e.substring(n,r))}}(o,i)).split(o0);for(let T=0;T<D.length;T++){let S=D[T];if(0==(1&T)){const P=Wc(S);for(let V=0;V<P.length;V++){let W=P[V];if(0==(1&V)){const H=W;""!==H&&l0(e,s,g[0],a,c,n,H)}else{const H=W;if("object"!=typeof H)throw new Error(`Unable to parse ICU expression in "${o}" message.`);Wg(e,n,c,t,H,$g(e,s,g[0],n,a,"",!0).index)}}}else{const P=47===S.charCodeAt(0),W=(S.charCodeAt(P?1:0),20+Number.parseInt(S.substring(P?2:1)));if(P)g.shift(),Pr(ci(),!1);else{const H=YD(e,g[0],W);g.unshift([]),Pr(H,!0)}}}e.data[r]={create:a,update:c}}(r,null===a?0:a.index,o,i,s,n);const c=r.data[i],D=Yf(r,a===o[6]?null:a,o);(function(e,t,n,r){const o=e[11];for(let i=0;i<t.length;i++){const s=t[i++],a=t[i],c=(s&un.COMMENT)===un.COMMENT,g=(s&un.APPEND_EAGERLY)===un.APPEND_EAGERLY,D=s>>>un.SHIFT;let T=e[D];null===T&&(T=e[D]=c?o.createComment(a):ju(o,a)),g&&null!==n&&yi(o,n,T,r,!1)}})(o,c.create,D,a&&8&a.type?o[a.index]:null),Bs(!0)}function qc(){Bs(!1)}function Qg(e,t,n){Zc(e,t,n),qc()}function Jg(e,t={}){return function(e,t={}){let n=e;if(v0.test(e)){const r={},o=[0];n=n.replace(C0,(i,s,a)=>{const c=s||a,g=r[c]||[];if(g.length||(c.split("|").forEach(W=>{const H=W.match(A0),pe=H?parseInt(H[1],10):0,re=w0.test(W);g.push([pe,re,W])}),r[c]=g),!g.length)throw new Error(`i18n postprocess: unmatched placeholder - ${c}`);const D=o[o.length-1];let T=0;for(let W=0;W<g.length;W++)if(g[W][0]===D){T=W;break}const[S,P,V]=g[T];return P?o.pop():D!==S&&o.push(S),g.splice(T,1),V})}return Object.keys(t).length&&(n=n.replace(E0,(r,o,i,s,a,c)=>t.hasOwnProperty(i)?`${o}${t[i]}${c}`:r),n=n.replace(D0,(r,o)=>t.hasOwnProperty(o)?t[o]:r),n=n.replace(b0,(r,o)=>{if(t.hasOwnProperty(o)){const i=t[o];if(!i.length)throw new Error(`i18n postprocess: unmatched ICU - ${r} with key: ${o}`);return i.shift()}return r})),n}(e,t)}function Qc(e,t,n,r,o){if(e=ae(e),Array.isArray(e))for(let i=0;i<e.length;i++)Qc(e[i],t,n,r,o);else{const i=vt(),s=de();let a=as(e)?e:ae(e.provide),c=Gh(e);const g=pn(),D=1048575&g.providerIndexes,T=g.directiveStart,S=g.providerIndexes>>20;if(as(e)||!e.multi){const P=new qo(c,o,pa),V=Jc(a,t,o?D:D+S,T);-1===V?(R(l(g,s),i,a),Kc(i,e,t.length),t.push(a),g.directiveStart++,g.directiveEnd++,o&&(g.providerIndexes+=1048576),n.push(P),s.push(P)):(n[V]=P,s[V]=P)}else{const P=Jc(a,t,D+S,T),V=Jc(a,t,D,D+S),W=P>=0&&n[P],H=V>=0&&n[V];if(o&&!H||!o&&!W){R(l(g,s),i,a);const pe=function(e,t,n,r,o){const i=new qo(e,n,pa);return i.multi=[],i.index=t,i.componentProviders=0,Xg(i,o,r&&!n),i}(o?R0:O0,n.length,o,r,c);!o&&H&&(n[V].providerFactory=pe),Kc(i,e,t.length,0),t.push(a),g.directiveStart++,g.directiveEnd++,o&&(g.providerIndexes+=1048576),n.push(pe),s.push(pe)}else Kc(i,e,P>-1?P:V,Xg(n[o?V:P],c,!o&&r));!o&&r&&H&&n[V].componentProviders++}}}function Kc(e,t,n,r){const o=as(t);if(o||function(e){return!!e.useClass}(t)){const s=(t.useClass||t).prototype.ngOnDestroy;if(s){const a=e.destroyHooks||(e.destroyHooks=[]);if(!o&&t.multi){const c=a.indexOf(n);-1===c?a.push(n,[r,s]):a[c+1].push(r,s)}else a.push(n,s)}}}function Xg(e,t,n){return n&&e.componentProviders++,e.multi.push(t)-1}function Jc(e,t,n,r){for(let o=n;o<r;o++)if(t[o]===e)return o;return-1}function O0(e,t,n,r){return Xc(this.multi,[])}function R0(e,t,n,r){const o=this.multi;let i;if(this.providerFactory){const s=this.providerFactory.componentProviders,a=or(n,n[1],this.providerFactory.index,r);i=a.slice(0,s),Xc(o,i);for(let c=s;c<a.length;c++)i.push(a[c])}else i=[],Xc(o,i);return i}function Xc(e,t){for(let n=0;n<e.length;n++)t.push((0,e[n])());return t}function em(e,t=[]){return n=>{n.providersResolver=(r,o)=>function(e,t,n){const r=vt();if(r.firstCreatePass){const o=O(e);Qc(n,r.data,r.blueprint,o,!0),Qc(t,r.data,r.blueprint,o,!1)}}(r,o?o(e):e,t)}}class tm{}const rm="ngComponent";class P0{resolveComponentFactory(t){throw function(e){const t=Error(`No component factory found for ${Ae(e)}. Did you add it to @NgModule.entryComponents?`);return t[rm]=e,t}(t)}}class Ei{}function Rl(...e){}function Ds(e,t){return new Mo($t(e,t))}Ei.NULL=new P0;const L0=function(){return Ds(pn(),de())};let Mo=(()=>{class e{constructor(n){this.nativeElement=n}}return e.__NG_ELEMENT_ID__=L0,e})();function om(e){return e instanceof Mo?e.nativeElement:e}class Nl{}let V0=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>B0(),e})();const B0=function(){const e=de(),n=bn(pn().index,e);return function(e){return e[11]}(hn(n)?n:e)};let td=(()=>{class e{}return e.\u0275prov=kt({token:e,providedIn:"root",factory:()=>null}),e})();class im{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const sm=new im("12.2.4");class am{constructor(){}supports(t){return fa(t)}create(t){return new G0(t)}}const $0=(e,t)=>t;class G0{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||$0}forEachItem(t){let n;for(n=this._itHead;null!==n;n=n._next)t(n)}forEachOperation(t){let n=this._itHead,r=this._removalsHead,o=0,i=null;for(;n||r;){const s=!r||n&&n.currentIndex<um(r,o,i)?n:r,a=um(s,o,i),c=s.currentIndex;if(s===r)o--,r=r._nextRemoved;else if(n=n._next,null==s.previousIndex)o++;else{i||(i=[]);const g=a-o,D=c-o;if(g!=D){for(let S=0;S<g;S++){const P=S<i.length?i[S]:i[S]=0,V=P+S;D<=V&&V<g&&(i[S]=P+1)}i[s.previousIndex]=D-g}}a!==c&&t(s,a,c)}}forEachPreviousItem(t){let n;for(n=this._previousItHead;null!==n;n=n._nextPrevious)t(n)}forEachAddedItem(t){let n;for(n=this._additionsHead;null!==n;n=n._nextAdded)t(n)}forEachMovedItem(t){let n;for(n=this._movesHead;null!==n;n=n._nextMoved)t(n)}forEachRemovedItem(t){let n;for(n=this._removalsHead;null!==n;n=n._nextRemoved)t(n)}forEachIdentityChange(t){let n;for(n=this._identityChangesHead;null!==n;n=n._nextIdentityChange)t(n)}diff(t){if(null==t&&(t=[]),!fa(t))throw new Error(`Error trying to diff '${Ae(t)}'. Only arrays and iterables are allowed`);return this.check(t)?this:null}onDestroy(){}check(t){this._reset();let o,i,s,n=this._itHead,r=!1;if(Array.isArray(t)){this.length=t.length;for(let a=0;a<this.length;a++)i=t[a],s=this._trackByFn(a,i),null!==n&&Object.is(n.trackById,s)?(r&&(n=this._verifyReinsertion(n,i,s,a)),Object.is(n.item,i)||this._addIdentityChange(n,i)):(n=this._mismatch(n,i,s,a),r=!0),n=n._next}else o=0,function(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)t(e[n]);else{const n=e[ls()]();let r;for(;!(r=n.next()).done;)t(r.value)}}(t,a=>{s=this._trackByFn(o,a),null!==n&&Object.is(n.trackById,s)?(r&&(n=this._verifyReinsertion(n,a,s,o)),Object.is(n.item,a)||this._addIdentityChange(n,a)):(n=this._mismatch(n,a,s,o),r=!0),n=n._next,o++}),this.length=o;return this._truncate(n),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,n,r,o){let i;return null===t?i=this._itTail:(i=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._reinsertAfter(t,i,o)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(r,o))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._moveAfter(t,i,o)):t=this._addAfter(new z0(n,r),i,o),t}_verifyReinsertion(t,n,r,o){let i=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null);return null!==i?t=this._reinsertAfter(i,t._prev,o):t.currentIndex!=o&&(t.currentIndex=o,this._addToMoves(t,o)),t}_truncate(t){for(;null!==t;){const n=t._next;this._addToRemovals(this._unlink(t)),t=n}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,n,r){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const o=t._prevRemoved,i=t._nextRemoved;return null===o?this._removalsHead=i:o._nextRemoved=i,null===i?this._removalsTail=o:i._prevRemoved=o,this._insertAfter(t,n,r),this._addToMoves(t,r),t}_moveAfter(t,n,r){return this._unlink(t),this._insertAfter(t,n,r),this._addToMoves(t,r),t}_addAfter(t,n,r){return this._insertAfter(t,n,r),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,n,r){const o=null===n?this._itHead:n._next;return t._next=o,t._prev=n,null===o?this._itTail=t:o._prev=t,null===n?this._itHead=t:n._next=t,null===this._linkedRecords&&(this._linkedRecords=new lm),this._linkedRecords.put(t),t.currentIndex=r,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const n=t._prev,r=t._next;return null===n?this._itHead=r:n._next=r,null===r?this._itTail=n:r._prev=n,t}_addToMoves(t,n){return t.previousIndex===n||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new lm),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,n){return t.item=n,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class z0{constructor(t,n){this.item=t,this.trackById=n,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class W0{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,n){let r;for(r=this._head;null!==r;r=r._nextDup)if((null===n||n<=r.currentIndex)&&Object.is(r.trackById,t))return r;return null}remove(t){const n=t._prevDup,r=t._nextDup;return null===n?this._head=r:n._nextDup=r,null===r?this._tail=n:r._prevDup=n,null===this._head}}class lm{constructor(){this.map=new Map}put(t){const n=t.trackById;let r=this.map.get(n);r||(r=new W0,this.map.set(n,r)),r.add(t)}get(t,n){const o=this.map.get(t);return o?o.get(t,n):null}remove(t){const n=t.trackById;return this.map.get(n).remove(t)&&this.map.delete(n),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function um(e,t,n){const r=e.previousIndex;if(null===r)return r;let o=0;return n&&r<n.length&&(o=n[r]),r+t+o}class cm{constructor(){}supports(t){return t instanceof Map||bc(t)}create(){return new Y0}}class Y0{constructor(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}get isDirty(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead}forEachItem(t){let n;for(n=this._mapHead;null!==n;n=n._next)t(n)}forEachPreviousItem(t){let n;for(n=this._previousMapHead;null!==n;n=n._nextPrevious)t(n)}forEachChangedItem(t){let n;for(n=this._changesHead;null!==n;n=n._nextChanged)t(n)}forEachAddedItem(t){let n;for(n=this._additionsHead;null!==n;n=n._nextAdded)t(n)}forEachRemovedItem(t){let n;for(n=this._removalsHead;null!==n;n=n._nextRemoved)t(n)}diff(t){if(t){if(!(t instanceof Map||bc(t)))throw new Error(`Error trying to diff '${Ae(t)}'. Only maps and objects are allowed`)}else t=new Map;return this.check(t)?this:null}onDestroy(){}check(t){this._reset();let n=this._mapHead;if(this._appendAfter=null,this._forEach(t,(r,o)=>{if(n&&n.key===o)this._maybeAddToChanges(n,r),this._appendAfter=n,n=n._next;else{const i=this._getOrCreateRecordForKey(o,r);n=this._insertBeforeOrAppend(n,i)}}),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(let r=n;null!==r;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,n){if(t){const r=t._prev;return n._next=t,n._prev=r,t._prev=n,r&&(r._next=n),t===this._mapHead&&(this._mapHead=n),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=n,n._prev=this._appendAfter):this._mapHead=n,this._appendAfter=n,null}_getOrCreateRecordForKey(t,n){if(this._records.has(t)){const o=this._records.get(t);this._maybeAddToChanges(o,n);const i=o._prev,s=o._next;return i&&(i._next=s),s&&(s._prev=i),o._next=null,o._prev=null,o}const r=new Z0(t);return this._records.set(t,r),r.currentValue=n,this._addToAdditions(r),r}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,n){Object.is(n,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=n,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,n){t instanceof Map?t.forEach(n):Object.keys(t).forEach(r=>n(t[r],r))}}class Z0{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function dm(){return new xl([new am])}let xl=(()=>{class e{constructor(n){this.factories=n}static create(n,r){if(null!=r){const o=r.factories.slice();n=n.concat(o)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||dm()),deps:[[e,new Xo,new ko]]}}find(n){const r=this.factories.find(o=>o.supports(n));if(null!=r)return r;throw new Error(`Cannot find a differ supporting object '${n}' of type '${function(e){return e.name||typeof e}(n)}'`)}}return e.\u0275prov=kt({token:e,providedIn:"root",factory:dm}),e})();function fm(){return new Pl([new cm])}let Pl=(()=>{class e{constructor(n){this.factories=n}static create(n,r){if(r){const o=r.factories.slice();n=n.concat(o)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||fm()),deps:[[e,new Xo,new ko]]}}find(n){const r=this.factories.find(o=>o.supports(n));if(r)return r;throw new Error(`Cannot find a differ supporting object '${n}'`)}}return e.\u0275prov=kt({token:e,providedIn:"root",factory:fm}),e})();function Fl(e,t,n,r,o=!1){for(;null!==n;){const i=t[n.index];if(null!==i&&r.push(ve(i)),Dn(i))for(let a=10;a<i.length;a++){const c=i[a],g=c[1].firstChild;null!==g&&Fl(c[1],c,g,r)}const s=n.type;if(8&s)Fl(e,t,n.child,r);else if(32&s){const a=Vu(n,t);let c;for(;c=a();)r.push(c)}else if(16&s){const a=eh(t,n);if(Array.isArray(a))r.push(...a);else{const c=ia(t[16]);Fl(c[1],c,a,r,!0)}}n=o?n.projectionNext:n.next}return r}class Ca{constructor(t,n){this._lView=t,this._cdRefInjectingView=n,this._appRef=null,this._attachedToViewContainer=!1}get rootNodes(){const t=this._lView,n=t[1];return Fl(n,t,n.firstChild,[])}get context(){return this._lView[8]}set context(t){this._lView[8]=t}get destroyed(){return 256==(256&this._lView[2])}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){const t=this._lView[3];if(Dn(t)){const n=t[8],r=n?n.indexOf(this):-1;r>-1&&($u(t,r),gi(n,r))}this._attachedToViewContainer=!1}zf(this._lView[1],this._lView)}onDestroy(t){Mh(this._lView[1],this._lView,null,t)}markForCheck(){cc(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){fc(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(e,t,n){Oi(!0);try{fc(e,t,n)}finally{Oi(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){var t;this._appRef=null,sa(this._lView[1],t=this._lView,t[11],2,null,null)}attachToAppRef(t){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t}}class Q0 extends Ca{constructor(t){super(t),this._view=t}detectChanges(){Fh(this._view)}checkNoChanges(){!function(e){Oi(!0);try{Fh(e)}finally{Oi(!1)}}(this._view)}get context(){return null}}const J0=function(e){return function(e,t,n){if(Tr(e)&&!n){const r=bn(e.index,t);return new Ca(r,r)}return 47&e.type?new Ca(t[16],t):null}(pn(),de(),16==(16&e))};let X0=(()=>{class e{}return e.__NG_ELEMENT_ID__=J0,e})();const nb=[new cm],ob=new xl([new am]),ib=new Pl(nb),ab=function(){return kl(pn(),de())};let Ea=(()=>{class e{}return e.__NG_ELEMENT_ID__=ab,e})();const lb=Ea,ub=class extends lb{constructor(t,n,r){super(),this._declarationLView=t,this._declarationTContainer=n,this.elementRef=r}createEmbeddedView(t){const n=this._declarationTContainer.tViews,r=aa(this._declarationLView,n,t,16,null,n.declTNode,null,null,null,null);r[17]=this._declarationLView[this._declarationTContainer.index];const i=this._declarationLView[19];return null!==i&&(r[19]=i.createEmbeddedView(n)),la(n,r,t),new Ca(r)}};function kl(e,t){return 4&e.type?new ub(t,e,Ds(e,t)):null}class Di{}class hm{}const fb=function(){return mm(pn(),de())};let Ll=(()=>{class e{}return e.__NG_ELEMENT_ID__=fb,e})();const pb=Ll,pm=class extends pb{constructor(t,n,r){super(),this._lContainer=t,this._hostTNode=n,this._hostLView=r}get element(){return Ds(this._hostTNode,this._hostLView)}get injector(){return new ir(this._hostTNode,this._hostLView)}get parentInjector(){const t=b(this._hostTNode,this._hostLView);if(Ja(t)){const n=_o(t,this._hostLView),r=Qo(t);return new ir(n[1].data[r+8],n)}return new ir(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const n=gm(this._lContainer);return null!==n&&n[t]||null}get length(){return this._lContainer.length-10}createEmbeddedView(t,n,r){const o=t.createEmbeddedView(n||{});return this.insert(o,r),o}createComponent(t,n,r,o,i){const s=r||this.parentInjector;if(!i&&null==t.ngModule&&s){const c=s.get(Di,null);c&&(i=c)}const a=t.create(s,o,void 0,i);return this.insert(a.hostView,n),a}insert(t,n){const r=t._lView,o=r[1];if(Dn(r[3])){const D=this.indexOf(t);if(-1!==D)this.detach(D);else{const T=r[3],S=new pm(T,T[6],T[3]);S.detach(S.indexOf(t))}}const i=this._adjustIndex(n),s=this._lContainer;!function(e,t,n,r){const o=10+r,i=n.length;r>0&&(n[o-1][4]=t),r<i-10?(t[4]=n[o],nl(n,10+r,t)):(n.push(t),t[4]=null),t[3]=n;const s=t[17];null!==s&&n!==s&&function(e,t){const n=e[9];t[16]!==t[3][3][16]&&(e[2]=!0),null===n?e[9]=[t]:n.push(t)}(s,t);const a=t[19];null!==a&&a.insertView(e),t[2]|=128}(o,r,s,i);const a=Wu(i,s),c=r[11],g=dl(c,s[7]);return null!==g&&function(e,t,n,r,o,i){r[0]=o,r[6]=t,sa(e,r,n,1,o,i)}(o,s[6],c,r,g,a),t.attachToViewContainerRef(),nl(nd(s),i,t),t}move(t,n){return this.insert(t,n)}indexOf(t){const n=gm(this._lContainer);return null!==n?n.indexOf(t):-1}remove(t){const n=this._adjustIndex(t,-1),r=$u(this._lContainer,n);r&&(gi(nd(this._lContainer),n),zf(r[1],r))}detach(t){const n=this._adjustIndex(t,-1),r=$u(this._lContainer,n);return r&&null!=gi(nd(this._lContainer),n)?new Ca(r):null}_adjustIndex(t,n=0){return null==t?this.length+n:t}};function gm(e){return e[8]}function nd(e){return e[8]||(e[8]=[])}function mm(e,t){let n;const r=t[e.index];if(Dn(r))n=r;else{let o;if(8&e.type)o=ve(r);else{const i=t[11];o=i.createComment("");const s=$t(e,t);yi(i,dl(i,s),o,function(e,t){return m(e)?e.nextSibling(t):t.nextSibling}(i,s),!1)}t[e.index]=n=Ph(r,t,o,e),yl(t,n)}return new pm(n,e,t)}const Ms={};class km extends Ei{constructor(t){super(),this.ngModule=t}resolveComponentFactory(t){const n=Yt(t);return new Vm(n,this.ngModule)}}function Lm(e){const t=[];for(let n in e)e.hasOwnProperty(n)&&t.push({propName:e[n],templateName:n});return t}const cw=new an("SCHEDULER_TOKEN",{providedIn:"root",factory:()=>Lf});class Vm extends tm{constructor(t,n){super(),this.componentDef=t,this.ngModule=n,this.componentType=t.type,this.selector=t.selectors.map(nC).join(","),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!n}get inputs(){return Lm(this.componentDef.inputs)}get outputs(){return Lm(this.componentDef.outputs)}create(t,n,r,o){const i=(o=o||this.ngModule)?function(e,t){return{get:(n,r,o)=>{const i=e.get(n,Ms,o);return i!==Ms||r===Ms?i:t.get(n,r,o)}}}(t,o.injector):t,s=i.get(Nl,M),a=i.get(td,null),c=s.createRenderer(null,this.componentDef),g=this.componentDef.selectors[0][0]||"div",D=r?function(e,t,n){if(m(e))return e.selectRootElement(t,n===Fe.ShadowDom);let r="string"==typeof t?e.querySelector(t):t;return r.textContent="",r}(c,r,this.componentDef.encapsulation):Hu(s.createRenderer(null,this.componentDef),g,function(e){const t=e.toLowerCase();return"svg"===t?"http://www.w3.org/2000/svg":"math"===t?"http://www.w3.org/1998/MathML/":null}(g)),T=this.componentDef.onPush?576:528,S=function(e,t){return{components:[],scheduler:e||Lf,clean:BC,playerHandler:t||null,flags:0}}(),P=_l(0,null,null,1,0,null,null,null,null,null),V=aa(null,P,S,T,null,null,s,c,a,i);let W,H;Ri(V);try{const pe=function(e,t,n,r,o,i){const s=n[1];n[20]=e;const c=ns(s,20,2,"#host",null),g=c.mergedAttrs=t.hostAttrs;null!==g&&(vl(c,g,!0),null!==e&&(Ui(o,e,g),null!==c.classes&&Zu(o,e,c.classes),null!==c.styles&&rh(o,e,c.styles)));const D=r.createRenderer(e,t),T=aa(n,bh(t),null,t.onPush?64:16,n[20],c,r,D,i||null,null);return s.firstCreatePass&&(R(l(c,n),s,t.type),Rh(s,c),Nh(c,n.length,1)),yl(n,T),n[20]=T}(D,this.componentDef,V,s,c);if(D)if(r)Ui(c,D,["ng-version",sm.full]);else{const{attrs:re,classes:Le}=function(e){const t=[],n=[];let r=1,o=2;for(;r<e.length;){let i=e[r];if("string"==typeof i)2===o?""!==i&&t.push(i,e[++r]):8===o&&n.push(i);else{if(!eo(o))break;o=i}r++}return{attrs:t,classes:n}}(this.componentDef.selectors[0]);re&&Ui(c,D,re),Le&&Le.length>0&&Zu(c,D,Le.join(" "))}if(H=xr(P,20),void 0!==n){const re=H.projection=[];for(let Le=0;Le<this.ngContentSelectors.length;Le++){const Qe=n[Le];re.push(null!=Qe?Array.from(Qe):null)}}W=function(e,t,n,r,o){const i=n[1],s=function(e,t,n){const r=pn();e.firstCreatePass&&(n.providersResolver&&n.providersResolver(n),xh(e,r,t,rs(e,t,1,null),n));const o=or(t,e,r.directiveStart,r);Kn(o,t);const i=$t(r,t);return i&&Kn(i,t),o}(i,n,t);if(r.components.push(s),e[8]=s,o&&o.forEach(c=>c(s,t)),t.contentQueries){const c=pn();t.contentQueries(1,s,c.directiveStart)}const a=pn();return!i.firstCreatePass||null===t.hostBindings&&null===t.hostAttrs||(Kr(a.index),Sh(n[1],a,0,a.directiveStart,a.directiveEnd,t),Oh(t,s)),s}(pe,this.componentDef,V,S,[fE]),la(P,V,null)}finally{xi()}return new hw(this.componentType,W,Ds(H,V),V,H)}}class hw extends class{}{constructor(t,n,r,o,i){super(),this.location=r,this._rootLView=o,this._tNode=i,this.instance=n,this.hostView=this.changeDetectorRef=new Q0(o),this.componentType=t}get injector(){return new ir(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(t){this.hostView.onDestroy(t)}}const Ts=new Map;class mw extends Di{constructor(t,n){super(),this._parent=n,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new km(this);const r=Zt(t),o=t[Gr]||null;o&&zc(o),this._bootstrapComponents=Co(r.bootstrap),this._r3Injector=$h(t,n,[{provide:Di,useValue:this},{provide:Ei,useValue:this.componentFactoryResolver}],Ae(t)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(t)}get(t,n=Ft.THROW_IF_NOT_FOUND,r=J.Default){return t===Ft||t===Di||t===is?this:this._r3Injector.get(t,n,r)}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(n=>n()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class gd extends hm{constructor(t){super(),this.moduleType=t,null!==Zt(t)&&function(e){const t=new Set;!function n(r){const o=Zt(r,!0),i=o.id;null!==i&&(function(e,t,n){if(t&&t!==n)throw new Error(`Duplicate module registered for ${e} - ${Ae(t)} vs ${Ae(t.name)}`)}(i,Ts.get(i),r),Ts.set(i,r));const s=Co(o.imports);for(const a of s)t.has(a)||(t.add(a),n(a))}(e)}(t)}create(t){return new mw(this.moduleType,t)}}function jm(e,t,n){const r=jn()+e,o=de();return o[r]===ct?bo(o,r,n?t.call(n):t()):function(e,t){return e[t]}(o,r)}function Hm(e,t,n,r){return function(e,t,n,r,o,i){const s=t+n;return Jn(e,s,o)?bo(e,s+1,i?r.call(i,o):r(o)):Sa(e,s+1)}(de(),jn(),e,t,n,r)}function Sa(e,t){const n=e[t];return n===ct?void 0:n}function Zm(e,t){const n=vt();let r;const o=e+20;n.firstCreatePass?(r=function(e,t){if(t)for(let n=t.length-1;n>=0;n--){const r=t[n];if(e===r.name)return r}throw new je("302",`The pipe '${e}' could not be found!`)}(t,n.pipeRegistry),n.data[o]=r,r.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(o,r.onDestroy)):r=n.data[o];const i=r.factory||(r.factory=Rr(r.type)),s=At(pa);try{const a=ji(!1),c=i();return ji(a),function(e,t,n,r){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=r}(n,de(),o,c),c}finally{At(s)}}function qm(e,t,n,r){const o=e+20,i=de(),s=mr(i,o);return function(e,t){ro.isWrapped(t)&&(t=ro.unwrap(t),e[_r()]=ct);return t}(i,function(e,t){return e[1].data[t].pure}(i,o)?function(e,t,n,r,o,i,s){const a=t+n;return vi(e,a,o,i)?bo(e,a+2,s?r.call(s,o,i):r(o,i)):Sa(e,a+2)}(i,jn(),t,s.transform,n,r,s):s.transform(n,r))}function md(e){return t=>{setTimeout(e,void 0,t)}}const To=class extends Z.x{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,n,r){var o,i,s;let a=t,c=n||(()=>null),g=r;if(t&&"object"==typeof t){const T=t;a=null===(o=T.next)||void 0===o?void 0:o.bind(T),c=null===(i=T.error)||void 0===i?void 0:i.bind(T),g=null===(s=T.complete)||void 0===s?void 0:s.bind(T)}this.__isAsync&&(c=md(c),a&&(a=md(a)),g&&(g=md(g)));const D=super.subscribe({next:a,error:c,complete:g});return t instanceof Ce.w0&&t.add(D),D}};function Rw(){return this._results[ls()]()}class Hl{constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const n=ls(),r=Hl.prototype;r[n]||(r[n]=Rw)}get changes(){return this._changes||(this._changes=new To)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,n){return this._results.reduce(t,n)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,n){const r=this;r.dirty=!1;const o=Lr(t);(this._changesDetected=!function(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],i=t[r];if(n&&(o=n(o),i=n(i)),i!==o)return!1}return!0}(r._results,o,n))&&(r._results=o,r.length=o.length,r.last=o[this.length-1],r.first=o[0])}notifyOnChanges(){this._changes&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this.changes.complete(),this.changes.unsubscribe()}}Symbol;class _d{constructor(t){this.queryList=t,this.matches=null}clone(){return new _d(this.queryList)}setDirty(){this.queryList.setDirty()}}class yd{constructor(t=[]){this.queries=t}createEmbeddedView(t){const n=t.queries;if(null!==n){const r=null!==t.contentQueries?t.contentQueries[0]:n.length,o=[];for(let i=0;i<r;i++){const s=n.getByIndex(i);o.push(this.queries[s.indexInDeclarationView].clone())}return new yd(o)}return null}insertView(t){this.dirtyQueriesWithMatches(t)}detachView(t){this.dirtyQueriesWithMatches(t)}dirtyQueriesWithMatches(t){for(let n=0;n<this.queries.length;n++)null!==r_(t,n).matches&&this.queries[n].setDirty()}}class Qm{constructor(t,n,r=null){this.predicate=t,this.flags=n,this.read=r}}class vd{constructor(t=[]){this.queries=t}elementStart(t,n){for(let r=0;r<this.queries.length;r++)this.queries[r].elementStart(t,n)}elementEnd(t){for(let n=0;n<this.queries.length;n++)this.queries[n].elementEnd(t)}embeddedTView(t){let n=null;for(let r=0;r<this.length;r++){const o=null!==n?n.length:0,i=this.getByIndex(r).embeddedTView(t,o);i&&(i.indexInDeclarationView=r,null!==n?n.push(i):n=[i])}return null!==n?new vd(n):null}template(t,n){for(let r=0;r<this.queries.length;r++)this.queries[r].template(t,n)}getByIndex(t){return this.queries[t]}get length(){return this.queries.length}track(t){this.queries.push(t)}}class Cd{constructor(t,n=-1){this.metadata=t,this.matches=null,this.indexInDeclarationView=-1,this.crossesNgTemplate=!1,this._appliesToNextNode=!0,this._declarationNodeIndex=n}elementStart(t,n){this.isApplyingToNode(n)&&this.matchTNode(t,n)}elementEnd(t){this._declarationNodeIndex===t.index&&(this._appliesToNextNode=!1)}template(t,n){this.elementStart(t,n)}embeddedTView(t,n){return this.isApplyingToNode(t)?(this.crossesNgTemplate=!0,this.addMatch(-t.index,n),new Cd(this.metadata)):null}isApplyingToNode(t){if(this._appliesToNextNode&&1!=(1&this.metadata.flags)){const n=this._declarationNodeIndex;let r=t.parent;for(;null!==r&&8&r.type&&r.index!==n;)r=r.parent;return n===(null!==r?r.index:-1)}return this._appliesToNextNode}matchTNode(t,n){const r=this.metadata.predicate;if(Array.isArray(r))for(let o=0;o<r.length;o++){const i=r[o];this.matchTNodeWithReadOption(t,n,Pw(n,i)),this.matchTNodeWithReadOption(t,n,yr(n,t,i,!1,!1))}else r===Ea?4&n.type&&this.matchTNodeWithReadOption(t,n,-1):this.matchTNodeWithReadOption(t,n,yr(n,t,r,!1,!1))}matchTNodeWithReadOption(t,n,r){if(null!==r){const o=this.metadata.read;if(null!==o)if(o===Mo||o===Ll||o===Ea&&4&n.type)this.addMatch(n.index,-2);else{const i=yr(n,t,o,!1,!1);null!==i&&this.addMatch(n.index,i)}else this.addMatch(n.index,r)}}addMatch(t,n){null===this.matches?this.matches=[t,n]:this.matches.push(t,n)}}function Pw(e,t){const n=e.localNames;if(null!==n)for(let r=0;r<n.length;r+=2)if(n[r]===t)return n[r+1];return null}function kw(e,t,n,r){return-1===n?function(e,t){return 11&e.type?Ds(e,t):4&e.type?kl(e,t):null}(t,e):-2===n?function(e,t,n){return n===Mo?Ds(t,e):n===Ea?kl(t,e):n===Ll?mm(t,e):void 0}(e,t,r):or(e,e[1],n,t)}function Km(e,t,n,r){const o=t[19].queries[r];if(null===o.matches){const i=e.data,s=n.matches,a=[];for(let c=0;c<s.length;c+=2){const g=s[c];a.push(g<0?null:kw(t,i[g],s[c+1],n.metadata.read))}o.matches=a}return o.matches}function Ed(e,t,n,r){const o=e.queries.getByIndex(n),i=o.matches;if(null!==i){const s=Km(e,t,o,n);for(let a=0;a<i.length;a+=2){const c=i[a];if(c>0)r.push(s[a/2]);else{const g=i[a+1],D=t[-c];for(let T=10;T<D.length;T++){const S=D[T];S[17]===S[3]&&Ed(S[1],S,g,r)}if(null!==D[9]){const T=D[9];for(let S=0;S<T.length;S++){const P=T[S];Ed(P[1],P,g,r)}}}}}return r}function Jm(e){const t=de(),n=vt(),r=Ga();di(r+1);const o=r_(n,r);if(e.dirty&&si(t)===(2==(2&o.metadata.flags))){if(null===o.matches)e.reset([]);else{const i=o.crossesNgTemplate?Ed(n,t,r,[]):Km(n,t,o,r);e.reset(i,om),e.notifyOnChanges()}return!0}return!1}function Xm(e,t,n,r){const o=vt();if(o.firstCreatePass){const i=pn();(function(e,t,n){null===e.queries&&(e.queries=new vd),e.queries.track(new Cd(t,n))})(o,new Qm(t,n,r),i.index),function(e,t){const n=e.contentQueries||(e.contentQueries=[]);t!==(n.length?n[n.length-1]:-1)&&n.push(e.queries.length-1,t)}(o,e),2==(2&n)&&(o.staticContentQueries=!0)}!function(e,t,n){const r=new Hl(4==(4&n));Mh(e,t,r,r.destroy),null===t[19]&&(t[19]=new yd),t[19].queries.push(new _d(r))}(o,de(),n)}function e_(){return e=de(),t=Ga(),e[19].queries[t].queryList;var e,t}function r_(e,t){return e.queries.getByIndex(t)}function o_(e,t){return kl(e,t)}const Td=new an("Application Initializer");let Ss=(()=>{class e{constructor(n){this.appInits=n,this.resolve=Rl,this.reject=Rl,this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,o)=>{this.resolve=r,this.reject=o})}runInitializers(){if(this.initialized)return;const n=[],r=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let o=0;o<this.appInits.length;o++){const i=this.appInits[o]();if(xc(i))n.push(i);else if(Pc(i)){const s=new Promise((a,c)=>{i.subscribe({complete:a,error:c})});n.push(s)}}Promise.all(n).then(()=>{r()}).catch(o=>{this.reject(o)}),0===n.length&&r(),this.initialized=!0}}return e.\u0275fac=function(n){return new(n||e)(vn(Td,8))},e.\u0275prov=kt({token:e,factory:e.\u0275fac}),e})();const D_=new an("AppId"),hA={provide:D_,useFactory:function(){return`${Id()}${Id()}${Id()}`},deps:[]};function Id(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const b_=new an("Platform Initializer"),w_=new an("Platform ID"),A_=new an("appBootstrapListener");let M_=(()=>{class e{log(n){console.log(n)}warn(n){console.warn(n)}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=kt({token:e,factory:e.\u0275fac}),e})();const zl=new an("LocaleId"),T_=new an("DefaultCurrencyCode");class gA{constructor(t,n){this.ngModuleFactory=t,this.componentFactories=n}}const Sd=function(e){return new gd(e)},mA=Sd,_A=function(e){return Promise.resolve(Sd(e))},I_=function(e){const t=Sd(e),r=Co(Zt(e).declarations).reduce((o,i)=>{const s=Yt(i);return s&&o.push(new Vm(s)),o},[]);return new gA(t,r)},yA=I_,vA=function(e){return Promise.resolve(I_(e))};let xa=(()=>{class e{constructor(){this.compileModuleSync=mA,this.compileModuleAsync=_A,this.compileModuleAndAllComponentsSync=yA,this.compileModuleAndAllComponentsAsync=vA}clearCache(){}clearCacheFor(n){}getModuleId(n){}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=kt({token:e,factory:e.\u0275fac}),e})();const DA=(()=>Promise.resolve(0))();function Od(e){"undefined"==typeof Zone?DA.then(()=>{e&&e.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",e)}class Er{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:n=!1,shouldCoalesceRunChangeDetection:r=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new To(!1),this.onMicrotaskEmpty=new To(!1),this.onStable=new To(!1),this.onError=new To(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const o=this;o._nesting=0,o._outer=o._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(o._inner=o._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(o._inner=o._inner.fork(Zone.longStackTraceZoneSpec)),o.shouldCoalesceEventChangeDetection=!r&&n,o.shouldCoalesceRunChangeDetection=r,o.lastRequestAnimationFrameId=-1,o.nativeRequestAnimationFrame=function(){let e=tt.requestAnimationFrame,t=tt.cancelAnimationFrame;if("undefined"!=typeof Zone&&e&&t){const n=e[Zone.__symbol__("OriginalDelegate")];n&&(e=n);const r=t[Zone.__symbol__("OriginalDelegate")];r&&(t=r)}return{nativeRequestAnimationFrame:e,nativeCancelAnimationFrame:t}}().nativeRequestAnimationFrame,function(e){const t=()=>{!function(e){e.isCheckStableRunning||-1!==e.lastRequestAnimationFrameId||(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(tt,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,Nd(e),e.isCheckStableRunning=!0,Rd(e),e.isCheckStableRunning=!1},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),Nd(e))}(e)};e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,r,o,i,s,a)=>{try{return S_(e),n.invokeTask(o,i,s,a)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===i.type||e.shouldCoalesceRunChangeDetection)&&t(),O_(e)}},onInvoke:(n,r,o,i,s,a,c)=>{try{return S_(e),n.invoke(o,i,s,a,c)}finally{e.shouldCoalesceRunChangeDetection&&t(),O_(e)}},onHasTask:(n,r,o,i)=>{n.hasTask(o,i),r===o&&("microTask"==i.change?(e._hasPendingMicrotasks=i.microTask,Nd(e),Rd(e)):"macroTask"==i.change&&(e.hasPendingMacrotasks=i.macroTask))},onHandleError:(n,r,o,i)=>(n.handleError(o,i),e.runOutsideAngular(()=>e.onError.emit(i)),!1)})}(o)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Er.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(Er.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(t,n,r){return this._inner.run(t,n,r)}runTask(t,n,r,o){const i=this._inner,s=i.scheduleEventTask("NgZoneEvent: "+o,t,wA,Rl,Rl);try{return i.runTask(s,n,r)}finally{i.cancelTask(s)}}runGuarded(t,n,r){return this._inner.runGuarded(t,n,r)}runOutsideAngular(t){return this._outer.run(t)}}const wA={};function Rd(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function Nd(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&-1!==e.lastRequestAnimationFrameId)}function S_(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function O_(e){e._nesting--,Rd(e)}class TA{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new To,this.onMicrotaskEmpty=new To,this.onStable=new To,this.onError=new To}run(t,n,r){return t.apply(n,r)}runGuarded(t,n,r){return t.apply(n,r)}runOutsideAngular(t){return t()}runTask(t,n,r,o){return t.apply(n,r)}}let R_=(()=>{class e{constructor(n){this._ngZone=n,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),n.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Er.assertNotInAngularZone(),Od(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())Od(()=>{for(;0!==this._callbacks.length;){let n=this._callbacks.pop();clearTimeout(n.timeoutId),n.doneCb(this._didWork)}this._didWork=!1});else{let n=this.getPendingTasks();this._callbacks=this._callbacks.filter(r=>!r.updateCb||!r.updateCb(n)||(clearTimeout(r.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(n=>({source:n.source,creationLocation:n.creationLocation,data:n.data})):[]}addCallback(n,r,o){let i=-1;r&&r>0&&(i=setTimeout(()=>{this._callbacks=this._callbacks.filter(s=>s.timeoutId!==i),n(this._didWork,this.getPendingTasks())},r)),this._callbacks.push({doneCb:n,timeoutId:i,updateCb:o})}whenStable(n,r,o){if(o&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(n,r,o),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(n,r,o){return[]}}return e.\u0275fac=function(n){return new(n||e)(vn(Er))},e.\u0275prov=kt({token:e,factory:e.\u0275fac}),e})(),N_=(()=>{class e{constructor(){this._applications=new Map,xd.addToWindow(this)}registerApplication(n,r){this._applications.set(n,r)}unregisterApplication(n){this._applications.delete(n)}unregisterAllApplications(){this._applications.clear()}getTestability(n){return this._applications.get(n)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(n,r=!0){return xd.findTestabilityInTree(this,n,r)}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=kt({token:e,factory:e.\u0275fac}),e})();class IA{addToWindow(t){}findTestabilityInTree(t,n,r){return null}}function SA(e){xd=e}let xd=new IA,x_=!0,P_=!1;function OA(){if(P_)throw new Error("Cannot enable prod mode after platform setup.");x_=!1}let lo;const k_=new an("AllowMultipleToken");class LA{constructor(t,n){this.name=t,this.token=n}}function L_(e,t,n=[]){const r=`Platform: ${t}`,o=new an(r);return(i=[])=>{let s=V_();if(!s||s.injector.get(k_,!1))if(e)e(n.concat(i).concat({provide:o,useValue:!0}));else{const a=n.concat(i).concat({provide:o,useValue:!0},{provide:ua,useValue:"platform"});!function(e){if(lo&&!lo.destroyed&&!lo.injector.get(k_,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");lo=e.get(U_);const t=e.get(b_,null);t&&t.forEach(n=>n())}(Ft.create({providers:a,name:r}))}return function(e){const t=V_();if(!t)throw new Error("No platform exists!");if(!t.injector.get(e,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return t}(o)}}function V_(){return lo&&!lo.destroyed?lo:null}let U_=(()=>{class e{constructor(n){this._injector=n,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(n,r){const a=function(e,t){let n;return n="noop"===e?new TA:("zone.js"===e?void 0:e)||new Er({enableLongStackTrace:(P_=!0,x_),shouldCoalesceEventChangeDetection:!!(null==t?void 0:t.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==t?void 0:t.ngZoneRunCoalescing)}),n}(r?r.ngZone:void 0,{ngZoneEventCoalescing:r&&r.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:r&&r.ngZoneRunCoalescing||!1}),c=[{provide:Er,useValue:a}];return a.run(()=>{const g=Ft.create({providers:c,parent:this.injector,name:n.moduleType.name}),D=n.create(g),T=D.injector.get(Xi,null);if(!T)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const S=a.onError.subscribe({next:P=>{T.handleError(P)}});D.onDestroy(()=>{Pd(this._modules,D),S.unsubscribe()})}),function(e,t,n){try{const r=n();return xc(r)?r.catch(o=>{throw t.runOutsideAngular(()=>e.handleError(o)),o}):r}catch(r){throw t.runOutsideAngular(()=>e.handleError(r)),r}}(T,a,()=>{const S=D.injector.get(Ss);return S.runInitializers(),S.donePromise.then(()=>(zc(D.injector.get(zl,Ml)||Ml),this._moduleDoBootstrap(D),D))})})}bootstrapModule(n,r=[]){const o=B_({},r);return function(e,t,n){const r=new gd(n);return Promise.resolve(r)}(0,0,n).then(i=>this.bootstrapModuleFactory(i,o))}_moduleDoBootstrap(n){const r=n.injector.get(Pa);if(n._bootstrapComponents.length>0)n._bootstrapComponents.forEach(o=>r.bootstrap(o));else{if(!n.instance.ngDoBootstrap)throw new Error(`The module ${Ae(n.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);n.instance.ngDoBootstrap(r)}this._modules.push(n)}onDestroy(n){this._destroyListeners.push(n)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(n=>n.destroy()),this._destroyListeners.forEach(n=>n()),this._destroyed=!0}get destroyed(){return this._destroyed}}return e.\u0275fac=function(n){return new(n||e)(vn(Ft))},e.\u0275prov=kt({token:e,factory:e.\u0275fac}),e})();function B_(e,t){return Array.isArray(t)?t.reduce(B_,e):Object.assign(Object.assign({},e),t)}let Pa=(()=>{class e{constructor(n,r,o,i,s){this._zone=n,this._injector=r,this._exceptionHandler=o,this._componentFactoryResolver=i,this._initStatus=s,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const a=new ke.y(g=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{g.next(this._stable),g.complete()})}),c=new ke.y(g=>{let D;this._zone.runOutsideAngular(()=>{D=this._zone.onStable.subscribe(()=>{Er.assertNotInAngularZone(),Od(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,g.next(!0))})})});const T=this._zone.onUnstable.subscribe(()=>{Er.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{g.next(!1)}))});return()=>{D.unsubscribe(),T.unsubscribe()}});this.isStable=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,te.yG)(e),r=(0,te._6)(e,1/0),o=e;return o.length?1===o.length?(0,me.Xf)(o[0]):(0,_.J)(r)((0,f.h)(o,n)):oe.E}(a,c.pipe(function(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new Z.x}:t,r=e.resetOnError,o=void 0===r||r,i=e.resetOnComplete,s=void 0===i||i,a=e.resetOnRefCountZero,c=void 0===a||a;return function(g){var D=null,T=null,S=null,P=0,V=!1,W=!1,H=function(){null==T||T.unsubscribe(),T=null},pe=function(){H(),D=S=null,V=W=!1},re=function(){var Le=D;pe(),null==Le||Le.unsubscribe()};return(0,_e.e)(function(Le,Qe){P++,!W&&!V&&H();var ht=S=null!=S?S:n();Qe.add(function(){0==--P&&!W&&!V&&(T=Se(re,c))}),ht.subscribe(Qe),D||(D=new ie.Hp({next:function(Jt){return ht.next(Jt)},error:function(Jt){W=!0,H(),T=Se(pe,o,Jt),ht.error(Jt)},complete:function(){V=!0,H(),T=Se(pe,s),ht.complete()}}),(0,me.Dp)(Le).subscribe(D))})(g)}}()))}bootstrap(n,r){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let o;o=n instanceof tm?n:this._componentFactoryResolver.resolveComponentFactory(n),this.componentTypes.push(o.componentType);const i=function(e){return e.isBoundToModule}(o)?void 0:this._injector.get(Di),a=o.create(Ft.NULL,[],r||o.selector,i),c=a.location.nativeElement,g=a.injector.get(R_,null),D=g&&a.injector.get(N_);return g&&D&&D.registerApplication(c,g),a.onDestroy(()=>{this.detachView(a.hostView),Pd(this.components,a),D&&D.unregisterApplication(c)}),this._loadComponent(a),a}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let n of this._views)n.detectChanges()}catch(n){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(n))}finally{this._runningTick=!1}}attachView(n){const r=n;this._views.push(r),r.attachToAppRef(this)}detachView(n){const r=n;Pd(this._views,r),r.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView),this.tick(),this.components.push(n),this._injector.get(A_,[]).concat(this._bootstrapListeners).forEach(o=>o(n))}ngOnDestroy(){this._views.slice().forEach(n=>n.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return e.\u0275fac=function(n){return new(n||e)(vn(Er),vn(Ft),vn(Xi),vn(Ei),vn(Ss))},e.\u0275prov=kt({token:e,factory:e.\u0275fac}),e})();function Pd(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class $A{}class zA{}const WA={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"};let YA=(()=>{class e{constructor(n,r){this._compiler=n,this._config=r||WA}load(n){return this.loadAndCompile(n)}loadAndCompile(n){let[r,o]=n.split("#");return void 0===o&&(o="default"),N(8255)(r).then(i=>i[o]).then(i=>G_(i,r,o)).then(i=>this._compiler.compileModuleAsync(i))}loadFactory(n){let[r,o]=n.split("#"),i="NgFactory";return void 0===o&&(o="default",i=""),N(8255)(this._config.factoryPathPrefix+r+this._config.factoryPathSuffix).then(s=>s[o+i]).then(s=>G_(s,r,o))}}return e.\u0275fac=function(n){return new(n||e)(vn(xa),vn(zA,8))},e.\u0275prov=kt({token:e,factory:e.\u0275fac}),e})();function G_(e,t,n){if(!e)throw new Error(`Cannot find '${n}' in '${t}'`);return e}const tM=function(e){return null},rM=L_(null,"core",[{provide:w_,useValue:"unknown"},{provide:U_,deps:[Ft]},{provide:N_,deps:[]},{provide:M_,deps:[]}]),lM=[{provide:Pa,useClass:Pa,deps:[Er,Ft,Xi,Ei,Ss]},{provide:cw,deps:[Er],useFactory:function(e){let t=[];return e.onStable.subscribe(()=>{for(;t.length;)t.pop()()}),function(n){t.push(n)}}},{provide:Ss,useClass:Ss,deps:[[new ko,Td]]},{provide:xa,useClass:xa,deps:[]},hA,{provide:xl,useFactory:function(){return ob},deps:[]},{provide:Pl,useFactory:function(){return ib},deps:[]},{provide:zl,useFactory:function(e){return zc(e=e||"undefined"!=typeof $localize&&$localize.locale||Ml),e},deps:[[new qi(zl),new ko,new Xo]]},{provide:T_,useValue:"USD"}];let cM=(()=>{class e{constructor(n){}}return e.\u0275fac=function(n){return new(n||e)(vn(Pa))},e.\u0275mod=_n({type:e}),e.\u0275inj=Nt({providers:lM}),e})()},3092:(st,we,N)=>{"use strict";N.d(we,{Fj:()=>ze,u5:()=>L,nD:()=>gr,JJ:()=>B,JL:()=>j,F:()=>pt,On:()=>fn,YN:()=>St,wV:()=>Un,_:()=>on,Q7:()=>zo,EJ:()=>He,_Y:()=>Bt,Kr:()=>So});var _=N(476),f=N(8583),me=N(1776),oe=N(1260),te=N(5929),fe=N(9528),Z=N(5076),Ce=N(9607),ke=N(5526),Ee=N(5207);let ie=(()=>{class E{constructor(h,M){this._renderer=h,this._elementRef=M,this.onChange=G=>{},this.onTouched=()=>{}}setProperty(h,M){this._renderer.setProperty(this._elementRef.nativeElement,h,M)}registerOnTouched(h){this.onTouched=h}registerOnChange(h){this.onChange=h}setDisabledState(h){this.setProperty("disabled",h)}}return E.\u0275fac=function(h){return new(h||E)(_.Y36(_.Qsj),_.Y36(_.SBq))},E.\u0275dir=_.lG2({type:E}),E})(),_e=(()=>{class E extends ie{}return E.\u0275fac=function(){let m;return function(M){return(m||(m=_.n5z(E)))(M||E)}}(),E.\u0275dir=_.lG2({type:E,features:[_.qOj]}),E})();const ge=new _.OlP("NgValueAccessor"),$e={provide:ge,useExisting:(0,_.Gpc)(()=>ze),multi:!0},Ge=new _.OlP("CompositionEventMode");let ze=(()=>{class E extends ie{constructor(h,M,G){super(h,M),this._compositionMode=G,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const E=(0,f.q)()?(0,f.q)().getUserAgent():"";return/android (\d+)/.test(E.toLowerCase())}())}writeValue(h){this.setProperty("value",null==h?"":h)}_handleInput(h){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(h)}_compositionStart(){this._composing=!0}_compositionEnd(h){this._composing=!1,this._compositionMode&&this.onChange(h)}}return E.\u0275fac=function(h){return new(h||E)(_.Y36(_.Qsj),_.Y36(_.SBq),_.Y36(Ge,8))},E.\u0275dir=_.lG2({type:E,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(h,M){1&h&&_.NdJ("input",function(ve){return M._handleInput(ve.target.value)})("blur",function(){return M.onTouched()})("compositionstart",function(){return M._compositionStart()})("compositionend",function(ve){return M._compositionEnd(ve.target.value)})},features:[_._Bn([$e]),_.qOj]}),E})();const Ye=new _.OlP("NgValidators"),Dt=new _.OlP("NgAsyncValidators");function Me(E){return null}function ye(E){return null!=E}function Ve(E){const m=(0,_.QGY)(E)?(0,te.Dp)(E):E;return(0,_.CqO)(m),m}function Je(E){let m={};return E.forEach(h=>{m=null!=h?Object.assign(Object.assign({},m),h):m}),0===Object.keys(m).length?null:m}function nt(E,m){return m.map(h=>h(E))}function Vt(E){return E.map(m=>function(E){return!E.validate}(m)?m:h=>m.validate(h))}function Tt(E){return null!=E?function(E){if(!E)return null;const m=E.filter(ye);return 0==m.length?null:function(h){return Je(nt(h,m))}}(Vt(E)):null}function _t(E){return null!=E?function(E){if(!E)return null;const m=E.filter(ye);return 0==m.length?null:function(h){return function(){for(var E=[],m=0;m<arguments.length;m++)E[m]=arguments[m];var h=(0,fe.jO)(E),M=(0,oe.D)(E),G=M.args,ve=M.keys,wt=new me.y(function(sn){var Qt=G.length;if(Qt)for(var $t=new Array(Qt),Zo=Qt,xr=Qt,mr=function(si){var qr=!1;(0,te.Xf)(G[si]).subscribe(new Z.Q(sn,function(ks){qr||(qr=!0,xr--),$t[si]=ks},function(){(!--Zo||!qr)&&(xr||sn.next(ve?(0,ke.n)(ve,$t):$t),sn.complete())}))},bn=0;bn<Qt;bn++)mr(bn);else sn.complete()});return h?wt.pipe((0,Ce.Z)(h)):wt}(nt(h,m).map(Ve)).pipe((0,Ee.U)(Je))}}(Vt(E)):null}function gn(E,m){return null===E?[m]:Array.isArray(E)?[...E,m]:[E,m]}function mn(E){return E?Array.isArray(E)?E:[E]:[]}function Cn(E,m){return Array.isArray(E)?E.includes(m):E===m}function xn(E,m){const h=mn(m);return mn(E).forEach(G=>{Cn(h,G)||h.push(G)}),h}function kt(E,m){return mn(m).filter(h=>!Cn(E,h))}let fo=(()=>{class E{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(h){this._rawValidators=h||[],this._composedValidatorFn=Tt(this._rawValidators)}_setAsyncValidators(h){this._rawAsyncValidators=h||[],this._composedAsyncValidatorFn=_t(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(h){this._onDestroyCallbacks.push(h)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(h=>h()),this._onDestroyCallbacks=[]}reset(h){this.control&&this.control.reset(h)}hasError(h,M){return!!this.control&&this.control.hasError(h,M)}getError(h,M){return this.control?this.control.getError(h,M):null}}return E.\u0275fac=function(h){return new(h||E)},E.\u0275dir=_.lG2({type:E}),E})(),Nt=(()=>{class E extends fo{get formDirective(){return null}get path(){return null}}return E.\u0275fac=function(){let m;return function(M){return(m||(m=_.n5z(E)))(M||E)}}(),E.\u0275dir=_.lG2({type:E,features:[_.qOj]}),E})();class gt extends fo{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class tr{constructor(m){this._cd=m}is(m){var h,M,G;return"submitted"===m?!!(null===(h=this._cd)||void 0===h?void 0:h.submitted):!!(null===(G=null===(M=this._cd)||void 0===M?void 0:M.control)||void 0===G?void 0:G[m])}}let B=(()=>{class E extends tr{constructor(h){super(h)}}return E.\u0275fac=function(h){return new(h||E)(_.Y36(gt,2))},E.\u0275dir=_.lG2({type:E,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(h,M){2&h&&_.ekj("ng-untouched",M.is("untouched"))("ng-touched",M.is("touched"))("ng-pristine",M.is("pristine"))("ng-dirty",M.is("dirty"))("ng-valid",M.is("valid"))("ng-invalid",M.is("invalid"))("ng-pending",M.is("pending"))},features:[_.qOj]}),E})(),j=(()=>{class E extends tr{constructor(h){super(h)}}return E.\u0275fac=function(h){return new(h||E)(_.Y36(Nt,10))},E.\u0275dir=_.lG2({type:E,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(h,M){2&h&&_.ekj("ng-untouched",M.is("untouched"))("ng-touched",M.is("touched"))("ng-pristine",M.is("pristine"))("ng-dirty",M.is("dirty"))("ng-valid",M.is("valid"))("ng-invalid",M.is("invalid"))("ng-pending",M.is("pending"))("ng-submitted",M.is("submitted"))},features:[_.qOj]}),E})();function Fe(E,m){nr(E,m),m.valueAccessor.writeValue(E.value),function(E,m){m.valueAccessor.registerOnChange(h=>{E._pendingValue=h,E._pendingChange=!0,E._pendingDirty=!0,"change"===E.updateOn&&Pn(E,m)})}(E,m),function(E,m){const h=(M,G)=>{m.valueAccessor.writeValue(M),G&&m.viewToModelUpdate(M)};E.registerOnChange(h),m._registerOnDestroy(()=>{E._unregisterOnChange(h)})}(E,m),function(E,m){m.valueAccessor.registerOnTouched(()=>{E._pendingTouched=!0,"blur"===E.updateOn&&E._pendingChange&&Pn(E,m),"submit"!==E.updateOn&&E.markAsTouched()})}(E,m),function(E,m){if(m.valueAccessor.setDisabledState){const h=M=>{m.valueAccessor.setDisabledState(M)};E.registerOnDisabledChange(h),m._registerOnDestroy(()=>{E._unregisterOnDisabledChange(h)})}}(E,m)}function nn(E,m){E.forEach(h=>{h.registerOnValidatorChange&&h.registerOnValidatorChange(m)})}function nr(E,m){const h=function(E){return E._rawValidators}(E);null!==m.validator?E.setValidators(gn(h,m.validator)):"function"==typeof h&&E.setValidators([h]);const M=function(E){return E._rawAsyncValidators}(E);null!==m.asyncValidator?E.setAsyncValidators(gn(M,m.asyncValidator)):"function"==typeof M&&E.setAsyncValidators([M]);const G=()=>E.updateValueAndValidity();nn(m._rawValidators,G),nn(m._rawAsyncValidators,G)}function Pn(E,m){E._pendingDirty&&E.markAsDirty(),E.setValue(E._pendingValue,{emitModelToViewChange:!1}),m.viewToModelUpdate(E._pendingValue),E._pendingChange=!1}function Xe(E,m){const h=E.indexOf(m);h>-1&&E.splice(h,1)}const Sn="VALID",En="INVALID",kn="PENDING",_n="DISABLED";function Wr(E){return(cn(E)?E.validators:E)||null}function rr(E){return Array.isArray(E)?Tt(E):E||null}function Wn(E,m){return(cn(m)?m.asyncValidators:E)||null}function Yt(E){return Array.isArray(E)?_t(E):E||null}function cn(E){return null!=E&&!Array.isArray(E)&&"object"==typeof E}class On{constructor(m,h){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=m,this._rawAsyncValidators=h,this._composedValidatorFn=rr(this._rawValidators),this._composedAsyncValidatorFn=Yt(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(m){this._rawValidators=this._composedValidatorFn=m}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(m){this._rawAsyncValidators=this._composedAsyncValidatorFn=m}get parent(){return this._parent}get valid(){return this.status===Sn}get invalid(){return this.status===En}get pending(){return this.status==kn}get disabled(){return this.status===_n}get enabled(){return this.status!==_n}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(m){this._rawValidators=m,this._composedValidatorFn=rr(m)}setAsyncValidators(m){this._rawAsyncValidators=m,this._composedAsyncValidatorFn=Yt(m)}addValidators(m){this.setValidators(xn(m,this._rawValidators))}addAsyncValidators(m){this.setAsyncValidators(xn(m,this._rawAsyncValidators))}removeValidators(m){this.setValidators(kt(m,this._rawValidators))}removeAsyncValidators(m){this.setAsyncValidators(kt(m,this._rawAsyncValidators))}hasValidator(m){return Cn(this._rawValidators,m)}hasAsyncValidator(m){return Cn(this._rawAsyncValidators,m)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(m={}){this.touched=!0,this._parent&&!m.onlySelf&&this._parent.markAsTouched(m)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(m=>m.markAllAsTouched())}markAsUntouched(m={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(h=>{h.markAsUntouched({onlySelf:!0})}),this._parent&&!m.onlySelf&&this._parent._updateTouched(m)}markAsDirty(m={}){this.pristine=!1,this._parent&&!m.onlySelf&&this._parent.markAsDirty(m)}markAsPristine(m={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(h=>{h.markAsPristine({onlySelf:!0})}),this._parent&&!m.onlySelf&&this._parent._updatePristine(m)}markAsPending(m={}){this.status=kn,!1!==m.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!m.onlySelf&&this._parent.markAsPending(m)}disable(m={}){const h=this._parentMarkedDirty(m.onlySelf);this.status=_n,this.errors=null,this._forEachChild(M=>{M.disable(Object.assign(Object.assign({},m),{onlySelf:!0}))}),this._updateValue(),!1!==m.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},m),{skipPristineCheck:h})),this._onDisabledChange.forEach(M=>M(!0))}enable(m={}){const h=this._parentMarkedDirty(m.onlySelf);this.status=Sn,this._forEachChild(M=>{M.enable(Object.assign(Object.assign({},m),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:m.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},m),{skipPristineCheck:h})),this._onDisabledChange.forEach(M=>M(!1))}_updateAncestors(m){this._parent&&!m.onlySelf&&(this._parent.updateValueAndValidity(m),m.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(m){this._parent=m}updateValueAndValidity(m={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Sn||this.status===kn)&&this._runAsyncValidator(m.emitEvent)),!1!==m.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!m.onlySelf&&this._parent.updateValueAndValidity(m)}_updateTreeValidity(m={emitEvent:!0}){this._forEachChild(h=>h._updateTreeValidity(m)),this.updateValueAndValidity({onlySelf:!0,emitEvent:m.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?_n:Sn}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(m){if(this.asyncValidator){this.status=kn,this._hasOwnPendingAsyncValidator=!0;const h=Ve(this.asyncValidator(this));this._asyncValidationSubscription=h.subscribe(M=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(M,{emitEvent:m})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(m,h={}){this.errors=m,this._updateControlsErrors(!1!==h.emitEvent)}get(m){return function(E,m,h){if(null==m||(Array.isArray(m)||(m=m.split(".")),Array.isArray(m)&&0===m.length))return null;let M=E;return m.forEach(G=>{M=M instanceof fr?M.controls.hasOwnProperty(G)?M.controls[G]:null:M instanceof dn&&M.at(G)||null}),M}(this,m)}getError(m,h){const M=h?this.get(h):this;return M&&M.errors?M.errors[m]:null}hasError(m,h){return!!this.getError(m,h)}get root(){let m=this;for(;m._parent;)m=m._parent;return m}_updateControlsErrors(m){this.status=this._calculateStatus(),m&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(m)}_initObservables(){this.valueChanges=new _.vpe,this.statusChanges=new _.vpe}_calculateStatus(){return this._allControlsDisabled()?_n:this.errors?En:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(kn)?kn:this._anyControlsHaveStatus(En)?En:Sn}_anyControlsHaveStatus(m){return this._anyControls(h=>h.status===m)}_anyControlsDirty(){return this._anyControls(m=>m.dirty)}_anyControlsTouched(){return this._anyControls(m=>m.touched)}_updatePristine(m={}){this.pristine=!this._anyControlsDirty(),this._parent&&!m.onlySelf&&this._parent._updatePristine(m)}_updateTouched(m={}){this.touched=this._anyControlsTouched(),this._parent&&!m.onlySelf&&this._parent._updateTouched(m)}_isBoxedValue(m){return"object"==typeof m&&null!==m&&2===Object.keys(m).length&&"value"in m&&"disabled"in m}_registerOnCollectionChange(m){this._onCollectionChange=m}_setUpdateStrategy(m){cn(m)&&null!=m.updateOn&&(this._updateOn=m.updateOn)}_parentMarkedDirty(m){return!m&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class Zt extends On{constructor(m=null,h,M){super(Wr(h),Wn(M,h)),this._onChange=[],this._applyFormState(m),this._setUpdateStrategy(h),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}setValue(m,h={}){this.value=this._pendingValue=m,this._onChange.length&&!1!==h.emitModelToViewChange&&this._onChange.forEach(M=>M(this.value,!1!==h.emitViewToModelChange)),this.updateValueAndValidity(h)}patchValue(m,h={}){this.setValue(m,h)}reset(m=null,h={}){this._applyFormState(m),this.markAsPristine(h),this.markAsUntouched(h),this.setValue(this.value,h),this._pendingChange=!1}_updateValue(){}_anyControls(m){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(m){this._onChange.push(m)}_unregisterOnChange(m){Xe(this._onChange,m)}registerOnDisabledChange(m){this._onDisabledChange.push(m)}_unregisterOnDisabledChange(m){Xe(this._onDisabledChange,m)}_forEachChild(m){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(m){this._isBoxedValue(m)?(this.value=this._pendingValue=m.value,m.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=m}}class fr extends On{constructor(m,h,M){super(Wr(h),Wn(M,h)),this.controls=m,this._initObservables(),this._setUpdateStrategy(h),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(m,h){return this.controls[m]?this.controls[m]:(this.controls[m]=h,h.setParent(this),h._registerOnCollectionChange(this._onCollectionChange),h)}addControl(m,h,M={}){this.registerControl(m,h),this.updateValueAndValidity({emitEvent:M.emitEvent}),this._onCollectionChange()}removeControl(m,h={}){this.controls[m]&&this.controls[m]._registerOnCollectionChange(()=>{}),delete this.controls[m],this.updateValueAndValidity({emitEvent:h.emitEvent}),this._onCollectionChange()}setControl(m,h,M={}){this.controls[m]&&this.controls[m]._registerOnCollectionChange(()=>{}),delete this.controls[m],h&&this.registerControl(m,h),this.updateValueAndValidity({emitEvent:M.emitEvent}),this._onCollectionChange()}contains(m){return this.controls.hasOwnProperty(m)&&this.controls[m].enabled}setValue(m,h={}){this._checkAllValuesPresent(m),Object.keys(m).forEach(M=>{this._throwIfControlMissing(M),this.controls[M].setValue(m[M],{onlySelf:!0,emitEvent:h.emitEvent})}),this.updateValueAndValidity(h)}patchValue(m,h={}){null!=m&&(Object.keys(m).forEach(M=>{this.controls[M]&&this.controls[M].patchValue(m[M],{onlySelf:!0,emitEvent:h.emitEvent})}),this.updateValueAndValidity(h))}reset(m={},h={}){this._forEachChild((M,G)=>{M.reset(m[G],{onlySelf:!0,emitEvent:h.emitEvent})}),this._updatePristine(h),this._updateTouched(h),this.updateValueAndValidity(h)}getRawValue(){return this._reduceChildren({},(m,h,M)=>(m[M]=h instanceof Zt?h.value:h.getRawValue(),m))}_syncPendingControls(){let m=this._reduceChildren(!1,(h,M)=>!!M._syncPendingControls()||h);return m&&this.updateValueAndValidity({onlySelf:!0}),m}_throwIfControlMissing(m){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[m])throw new Error(`Cannot find form control with name: ${m}.`)}_forEachChild(m){Object.keys(this.controls).forEach(h=>{const M=this.controls[h];M&&m(M,h)})}_setUpControls(){this._forEachChild(m=>{m.setParent(this),m._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(m){for(const h of Object.keys(this.controls)){const M=this.controls[h];if(this.contains(h)&&m(M))return!0}return!1}_reduceValue(){return this._reduceChildren({},(m,h,M)=>((h.enabled||this.disabled)&&(m[M]=h.value),m))}_reduceChildren(m,h){let M=m;return this._forEachChild((G,ve)=>{M=h(M,G,ve)}),M}_allControlsDisabled(){for(const m of Object.keys(this.controls))if(this.controls[m].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(m){this._forEachChild((h,M)=>{if(void 0===m[M])throw new Error(`Must supply a value for form control with name: '${M}'.`)})}}class dn extends On{constructor(m,h,M){super(Wr(h),Wn(M,h)),this.controls=m,this._initObservables(),this._setUpdateStrategy(h),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(m){return this.controls[m]}push(m,h={}){this.controls.push(m),this._registerControl(m),this.updateValueAndValidity({emitEvent:h.emitEvent}),this._onCollectionChange()}insert(m,h,M={}){this.controls.splice(m,0,h),this._registerControl(h),this.updateValueAndValidity({emitEvent:M.emitEvent})}removeAt(m,h={}){this.controls[m]&&this.controls[m]._registerOnCollectionChange(()=>{}),this.controls.splice(m,1),this.updateValueAndValidity({emitEvent:h.emitEvent})}setControl(m,h,M={}){this.controls[m]&&this.controls[m]._registerOnCollectionChange(()=>{}),this.controls.splice(m,1),h&&(this.controls.splice(m,0,h),this._registerControl(h)),this.updateValueAndValidity({emitEvent:M.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(m,h={}){this._checkAllValuesPresent(m),m.forEach((M,G)=>{this._throwIfControlMissing(G),this.at(G).setValue(M,{onlySelf:!0,emitEvent:h.emitEvent})}),this.updateValueAndValidity(h)}patchValue(m,h={}){null!=m&&(m.forEach((M,G)=>{this.at(G)&&this.at(G).patchValue(M,{onlySelf:!0,emitEvent:h.emitEvent})}),this.updateValueAndValidity(h))}reset(m=[],h={}){this._forEachChild((M,G)=>{M.reset(m[G],{onlySelf:!0,emitEvent:h.emitEvent})}),this._updatePristine(h),this._updateTouched(h),this.updateValueAndValidity(h)}getRawValue(){return this.controls.map(m=>m instanceof Zt?m.value:m.getRawValue())}clear(m={}){this.controls.length<1||(this._forEachChild(h=>h._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:m.emitEvent}))}_syncPendingControls(){let m=this.controls.reduce((h,M)=>!!M._syncPendingControls()||h,!1);return m&&this.updateValueAndValidity({onlySelf:!0}),m}_throwIfControlMissing(m){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(m))throw new Error(`Cannot find form control at index ${m}`)}_forEachChild(m){this.controls.forEach((h,M)=>{m(h,M)})}_updateValue(){this.value=this.controls.filter(m=>m.enabled||this.disabled).map(m=>m.value)}_anyControls(m){return this.controls.some(h=>h.enabled&&m(h))}_setUpControls(){this._forEachChild(m=>this._registerControl(m))}_checkAllValuesPresent(m){this._forEachChild((h,M)=>{if(void 0===m[M])throw new Error(`Must supply a value for form control at index: ${M}.`)})}_allControlsDisabled(){for(const m of this.controls)if(m.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(m){m.setParent(this),m._registerOnCollectionChange(this._onCollectionChange)}}const Te={provide:Nt,useExisting:(0,_.Gpc)(()=>pt)},ft=(()=>Promise.resolve(null))();let pt=(()=>{class E extends Nt{constructor(h,M){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new _.vpe,this.form=new fr({},Tt(h),_t(M))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(h){ft.then(()=>{const M=this._findContainer(h.path);h.control=M.registerControl(h.name,h.control),Fe(h.control,h),h.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(h)})}getControl(h){return this.form.get(h.path)}removeControl(h){ft.then(()=>{const M=this._findContainer(h.path);M&&M.removeControl(h.name),Xe(this._directives,h)})}addFormGroup(h){ft.then(()=>{const M=this._findContainer(h.path),G=new fr({});(function(E,m){nr(E,m)})(G,h),M.registerControl(h.name,G),G.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(h){ft.then(()=>{const M=this._findContainer(h.path);M&&M.removeControl(h.name)})}getFormGroup(h){return this.form.get(h.path)}updateModel(h,M){ft.then(()=>{this.form.get(h.path).setValue(M)})}setValue(h){this.control.setValue(h)}onSubmit(h){return this.submitted=!0,function(E,m){E._syncPendingControls(),m.forEach(h=>{const M=h.control;"submit"===M.updateOn&&M._pendingChange&&(h.viewToModelUpdate(M._pendingValue),M._pendingChange=!1)})}(this.form,this._directives),this.ngSubmit.emit(h),!1}onReset(){this.resetForm()}resetForm(h){this.form.reset(h),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(h){return h.pop(),h.length?this.form.get(h):this.form}}return E.\u0275fac=function(h){return new(h||E)(_.Y36(Ye,10),_.Y36(Dt,10))},E.\u0275dir=_.lG2({type:E,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(h,M){1&h&&_.NdJ("submit",function(ve){return M.onSubmit(ve)})("reset",function(){return M.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[_._Bn([Te]),_.qOj]}),E})();const cr={provide:gt,useExisting:(0,_.Gpc)(()=>fn)},en=(()=>Promise.resolve(null))();let fn=(()=>{class E extends gt{constructor(h,M,G,ve){super(),this.control=new Zt,this._registered=!1,this.update=new _.vpe,this._parent=h,this._setValidators(M),this._setAsyncValidators(G),this.valueAccessor=function(E,m){if(!m)return null;let h,M,G;return Array.isArray(m),m.forEach(ve=>{ve.constructor===ze?h=ve:function(E){return Object.getPrototypeOf(E.constructor)===_e}(ve)?M=ve:G=ve}),G||M||h||null}(0,ve)}ngOnChanges(h){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in h&&this._updateDisabled(h),function(E,m){if(!E.hasOwnProperty("model"))return!1;const h=E.model;return!!h.isFirstChange()||!Object.is(m,h.currentValue)}(h,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?function(E,m){return[...m.path,E]}(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(h){this.viewModel=h,this.update.emit(h)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){Fe(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(h){en.then(()=>{this.control.setValue(h,{emitViewToModelChange:!1})})}_updateDisabled(h){const M=h.isDisabled.currentValue,G=""===M||M&&"false"!==M;en.then(()=>{G&&!this.control.disabled?this.control.disable():!G&&this.control.disabled&&this.control.enable()})}}return E.\u0275fac=function(h){return new(h||E)(_.Y36(Nt,9),_.Y36(Ye,10),_.Y36(Dt,10),_.Y36(ge,10))},E.\u0275dir=_.lG2({type:E,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[_._Bn([cr]),_.qOj,_.TTD]}),E})(),Bt=(()=>{class E{}return E.\u0275fac=function(h){return new(h||E)},E.\u0275dir=_.lG2({type:E,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),E})();const Vn={provide:ge,useExisting:(0,_.Gpc)(()=>Un),multi:!0};let Un=(()=>{class E extends _e{writeValue(h){this.setProperty("value",null==h?"":h)}registerOnChange(h){this.onChange=M=>{h(""==M?null:parseFloat(M))}}}return E.\u0275fac=function(){let m;return function(M){return(m||(m=_.n5z(E)))(M||E)}}(),E.\u0275dir=_.lG2({type:E,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(h,M){1&h&&_.NdJ("input",function(ve){return M.onChange(ve.target.value)})("blur",function(){return M.onTouched()})},features:[_._Bn([Vn]),_.qOj]}),E})();const jt={provide:ge,useExisting:(0,_.Gpc)(()=>on),multi:!0};let Yr=(()=>{class E{}return E.\u0275fac=function(h){return new(h||E)},E.\u0275mod=_.oAB({type:E}),E.\u0275inj=_.cJS({}),E})(),Ar=(()=>{class E{constructor(){this._accessors=[]}add(h,M){this._accessors.push([h,M])}remove(h){for(let M=this._accessors.length-1;M>=0;--M)if(this._accessors[M][1]===h)return void this._accessors.splice(M,1)}select(h){this._accessors.forEach(M=>{this._isSameGroup(M,h)&&M[1]!==h&&M[1].fireUncheck(h.value)})}_isSameGroup(h,M){return!!h[0].control&&h[0]._parent===M._control._parent&&h[1].name===M.name}}return E.\u0275fac=function(h){return new(h||E)},E.\u0275prov=(0,_.Yz7)({factory:function(){return new E},token:E,providedIn:Yr}),E})(),on=(()=>{class E extends _e{constructor(h,M,G,ve){super(h,M),this._registry=G,this._injector=ve,this.onChange=()=>{}}ngOnInit(){this._control=this._injector.get(gt),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(h){this._state=h===this.value,this.setProperty("checked",this._state)}registerOnChange(h){this._fn=h,this.onChange=()=>{h(this.value),this._registry.select(this)}}fireUncheck(h){this.writeValue(h)}_checkName(){!this.name&&this.formControlName&&(this.name=this.formControlName)}}return E.\u0275fac=function(h){return new(h||E)(_.Y36(_.Qsj),_.Y36(_.SBq),_.Y36(Ar),_.Y36(_.zs3))},E.\u0275dir=_.lG2({type:E,selectors:[["input","type","radio","formControlName",""],["input","type","radio","formControl",""],["input","type","radio","ngModel",""]],hostBindings:function(h,M){1&h&&_.NdJ("change",function(){return M.onChange()})("blur",function(){return M.onTouched()})},inputs:{name:"name",formControlName:"formControlName",value:"value"},features:[_._Bn([jt]),_.qOj]}),E})();const F={provide:ge,useExisting:(0,_.Gpc)(()=>He),multi:!0};function Q(E,m){return null==E?`${m}`:(m&&"object"==typeof m&&(m="Object"),`${E}: ${m}`.slice(0,50))}let He=(()=>{class E extends _e{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(h){this._compareWith=h}writeValue(h){this.value=h;const M=this._getOptionId(h);null==M&&this.setProperty("selectedIndex",-1);const G=Q(M,h);this.setProperty("value",G)}registerOnChange(h){this.onChange=M=>{this.value=this._getOptionValue(M),h(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(h){for(const M of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(M),h))return M;return null}_getOptionValue(h){const M=function(E){return E.split(":")[0]}(h);return this._optionMap.has(M)?this._optionMap.get(M):h}}return E.\u0275fac=function(){let m;return function(M){return(m||(m=_.n5z(E)))(M||E)}}(),E.\u0275dir=_.lG2({type:E,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(h,M){1&h&&_.NdJ("change",function(ve){return M.onChange(ve.target.value)})("blur",function(){return M.onTouched()})},inputs:{compareWith:"compareWith"},features:[_._Bn([F]),_.qOj]}),E})(),St=(()=>{class E{constructor(h,M,G){this._element=h,this._renderer=M,this._select=G,this._select&&(this.id=this._select._registerOption())}set ngValue(h){null!=this._select&&(this._select._optionMap.set(this.id,h),this._setElementValue(Q(this.id,h)),this._select.writeValue(this._select.value))}set value(h){this._setElementValue(h),this._select&&this._select.writeValue(this._select.value)}_setElementValue(h){this._renderer.setProperty(this._element.nativeElement,"value",h)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return E.\u0275fac=function(h){return new(h||E)(_.Y36(_.SBq),_.Y36(_.Qsj),_.Y36(He,9))},E.\u0275dir=_.lG2({type:E,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),E})();const qt={provide:ge,useExisting:(0,_.Gpc)(()=>Ir),multi:!0};function Bn(E,m){return null==E?`${m}`:("string"==typeof m&&(m=`'${m}'`),m&&"object"==typeof m&&(m="Object"),`${E}: ${m}`.slice(0,50))}let Ir=(()=>{class E extends _e{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(h){this._compareWith=h}writeValue(h){let M;if(this.value=h,Array.isArray(h)){const G=h.map(ve=>this._getOptionId(ve));M=(ve,wt)=>{ve._setSelected(G.indexOf(wt.toString())>-1)}}else M=(G,ve)=>{G._setSelected(!1)};this._optionMap.forEach(M)}registerOnChange(h){this.onChange=M=>{const G=[];if(void 0!==M.selectedOptions){const ve=M.selectedOptions;for(let wt=0;wt<ve.length;wt++){const sn=ve.item(wt),Qt=this._getOptionValue(sn.value);G.push(Qt)}}else{const ve=M.options;for(let wt=0;wt<ve.length;wt++){const sn=ve.item(wt);if(sn.selected){const Qt=this._getOptionValue(sn.value);G.push(Qt)}}}this.value=G,h(G)}}_registerOption(h){const M=(this._idCounter++).toString();return this._optionMap.set(M,h),M}_getOptionId(h){for(const M of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(M)._value,h))return M;return null}_getOptionValue(h){const M=function(E){return E.split(":")[0]}(h);return this._optionMap.has(M)?this._optionMap.get(M)._value:h}}return E.\u0275fac=function(){let m;return function(M){return(m||(m=_.n5z(E)))(M||E)}}(),E.\u0275dir=_.lG2({type:E,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(h,M){1&h&&_.NdJ("change",function(ve){return M.onChange(ve.target)})("blur",function(){return M.onTouched()})},inputs:{compareWith:"compareWith"},features:[_._Bn([qt]),_.qOj]}),E})(),So=(()=>{class E{constructor(h,M,G){this._element=h,this._renderer=M,this._select=G,this._select&&(this.id=this._select._registerOption(this))}set ngValue(h){null!=this._select&&(this._value=h,this._setElementValue(Bn(this.id,h)),this._select.writeValue(this._select.value))}set value(h){this._select?(this._value=h,this._setElementValue(Bn(this.id,h)),this._select.writeValue(this._select.value)):this._setElementValue(h)}_setElementValue(h){this._renderer.setProperty(this._element.nativeElement,"value",h)}_setSelected(h){this._renderer.setProperty(this._element.nativeElement,"selected",h)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return E.\u0275fac=function(h){return new(h||E)(_.Y36(_.SBq),_.Y36(_.Qsj),_.Y36(Ir,9))},E.\u0275dir=_.lG2({type:E,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),E})();const Zr={provide:Ye,useExisting:(0,_.Gpc)(()=>zo),multi:!0};let zo=(()=>{class E{constructor(){this._required=!1}get required(){return this._required}set required(h){this._required=null!=h&&!1!==h&&"false"!=`${h}`,this._onChange&&this._onChange()}validate(h){return this.required?function(E){return function(E){return null==E||0===E.length}(E.value)?{required:!0}:null}(h):null}registerOnValidatorChange(h){this._onChange=h}}return E.\u0275fac=function(h){return new(h||E)},E.\u0275dir=_.lG2({type:E,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(h,M){2&h&&_.uIk("required",M.required?"":null)},inputs:{required:"required"},features:[_._Bn([Zr])]}),E})();const Nr={provide:Ye,useExisting:(0,_.Gpc)(()=>gr),multi:!0};let gr=(()=>{class E{constructor(){this._validator=Me}ngOnChanges(h){"maxlength"in h&&(this._createValidator(),this._onChange&&this._onChange())}validate(h){return this.enabled()?this._validator(h):null}registerOnValidatorChange(h){this._onChange=h}_createValidator(){this._validator=this.enabled()?function(E){return m=>function(E){return null!=E&&"number"==typeof E.length}(m.value)&&m.value.length>E?{maxlength:{requiredLength:E,actualLength:m.value.length}}:null}(function(E){return"number"==typeof E?E:parseInt(E,10)}(this.maxlength)):Me}enabled(){return null!=this.maxlength}}return E.\u0275fac=function(h){return new(h||E)},E.\u0275dir=_.lG2({type:E,selectors:[["","maxlength","","formControlName",""],["","maxlength","","formControl",""],["","maxlength","","ngModel",""]],hostVars:1,hostBindings:function(h,M){2&h&&_.uIk("maxlength",M.enabled()?M.maxlength:null)},inputs:{maxlength:"maxlength"},features:[_._Bn([Nr]),_.TTD]}),E})(),A=(()=>{class E{}return E.\u0275fac=function(h){return new(h||E)},E.\u0275mod=_.oAB({type:E}),E.\u0275inj=_.cJS({imports:[[Yr]]}),E})(),L=(()=>{class E{}return E.\u0275fac=function(h){return new(h||E)},E.\u0275mod=_.oAB({type:E}),E.\u0275inj=_.cJS({imports:[A]}),E})()},9502:(st,we,N)=>{"use strict";N.d(we,{gz:()=>jt,Eb:()=>ue,m2:()=>xn,OD:()=>Cn,F0:()=>$n,rH:()=>Fi,Od:()=>fi,yS:()=>ki,Bz:()=>Ui,lC:()=>hi,R9:()=>Nt});var _=N(8583),f=N(476),me=N(9162),oe=N(6889),te=function(d){function u(l){var p=d.call(this)||this;return p._value=l,p}return(0,me.ZT)(u,d),Object.defineProperty(u.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),u.prototype._subscribe=function(l){var p=d.prototype._subscribe.call(this,l);return!p.closed&&l.next(this._value),p},u.prototype.getValue=function(){var l=this,b=l._value;if(l.hasError)throw l.thrownError;return this._throwIfClosed(),b},u.prototype.next=function(l){d.prototype.next.call(this,this._value=l)},u}(oe.x),fe=N(1776),Z=N(1260),Ce=N(5929),ke=N(2738),Ie=N(9607),Ee=N(9528),ie=N(5526),_e=N(5076);function Se(d,u,l){return void 0===l&&(l=ke.y),function(p){he(u,function(){for(var C=d.length,b=new Array(C),R=C,k=C,z=function(Ue){he(u,function(){var at=(0,Ce.Dp)(d[Ue],u),Pt=!1;at.subscribe(new _e.Q(p,function(Ct){b[Ue]=Ct,Pt||(Pt=!0,k--),k||p.next(l(b.slice()))},function(){--R||p.complete()}))},p)},be=0;be<C;be++)z(be)},p)}}function he(d,u,l){d?l.add(d.schedule(u)):u()}var Ae=(0,N(3864).d)(function(d){return function(){d(this),this.name="EmptyError",this.message="no elements in sequence"}}),Ge=N(23);function ze(){return(0,Ge.J)(1)}var Pe=N(5994);function ae(){for(var d=[],u=0;u<arguments.length;u++)d[u]=arguments[u];return ze()((0,Pe.h)(d,(0,Ee.yG)(d)))}function Ye(d){return new fe.y(function(u){(0,Ce.Xf)(d()).subscribe(u)})}var Dt=N(8839),je=N(4297);function lt(){return(0,je.e)(function(d,u){var l=null;d._refCount++;var p=new _e.Q(u,void 0,void 0,void 0,function(){if(!d||d._refCount<=0||0<--d._refCount)l=null;else{var C=d._connection,b=l;l=null,C&&(!b||C===b)&&C.unsubscribe(),u.unsubscribe()}});d.subscribe(p),p.closed||(l=d.connect())})}var ee=function(d){function u(l,p){var C=d.call(this)||this;return C.source=l,C.subjectFactory=p,C._subject=null,C._refCount=0,C._connection=null,(0,je.A)(l)&&(C.lift=l.lift),C}return(0,me.ZT)(u,d),u.prototype._subscribe=function(l){return this.getSubject().subscribe(l)},u.prototype.getSubject=function(){var l=this._subject;return(!l||l.isStopped)&&(this._subject=this.subjectFactory()),this._subject},u.prototype._teardown=function(){this._refCount=0;var l=this._connection;this._subject=this._connection=null,null==l||l.unsubscribe()},u.prototype.connect=function(){var l=this,p=this._connection;if(!p){p=this._connection=new Dt.w0;var C=this.getSubject();p.add(this.source.subscribe(new _e.Q(C,void 0,function(){l._teardown(),C.complete()},function(b){l._teardown(),C.error(b)},function(){return l._teardown()}))),p.closed&&(this._connection=null,p=Dt.w0.EMPTY)}return p},u.prototype.refCount=function(){return lt()(this)},u}(fe.y),U=N(1964),Y=N(6149);function ne(d,u){return(0,je.e)(function(l,p){var C=null,b=0,R=!1,k=function(){return R&&!C&&p.complete()};l.subscribe(new _e.Q(p,function(z){null==C||C.unsubscribe();var be=0,Ue=b++;(0,Ce.Xf)(d(z,Ue)).subscribe(C=new _e.Q(p,function(at){return p.next(u?u(z,at,Ue,be++):at)},function(){C=null,k()}))},function(){R=!0,k()}))})}function K(d,u,l,p,C){return function(b,R){var k=l,z=u,be=0;b.subscribe(new _e.Q(R,function(Ue){var at=be++;z=k?d(z,Ue,at):(k=!0,Ue),p&&R.next(z)},C&&function(){k&&R.next(z),R.complete()}))}}function We(d,u){return(0,je.e)(K(d,u,arguments.length>=2,!0))}var q=N(4689);function Me(d){return d<=0?function(){return Y.E}:(0,je.e)(function(u,l){var p=[];u.subscribe(new _e.Q(l,function(C){p.push(C),d<p.length&&p.shift()},function(){var C,b;try{for(var R=(0,me.XA)(p),k=R.next();!k.done;k=R.next())l.next(k.value)}catch(be){C={error:be}}finally{try{k&&!k.done&&(b=R.return)&&b.call(R)}finally{if(C)throw C.error}}l.complete()},void 0,function(){p=null}))})}function ye(d){return void 0===d&&(d=Ve),(0,je.e)(function(u,l){var p=!1;u.subscribe(new _e.Q(l,function(C){p=!0,l.next(C)},function(){return p?l.complete():l.error(d())}))})}function Ve(){return new Ae}function Je(d){return(0,je.e)(function(u,l){var p=!1;u.subscribe(new _e.Q(l,function(C){p=!0,l.next(C)},function(){p||l.next(d),l.complete()}))})}var yt=N(4294);function Vt(d,u){var l=arguments.length>=2;return function(p){return p.pipe(d?(0,q.h)(function(C,b){return d(C,b,p)}):ke.y,(0,yt.q)(1),l?Je(u):ye(function(){return new Ae}))}}var Gt=N(8853);function Tt(d,u,l){var p=(0,Gt.m)(d)||u||l?{next:d,error:u,complete:l}:d;return p?(0,je.e)(function(C,b){var R;null===(R=p.subscribe)||void 0===R||R.call(p);var k=!0;C.subscribe(new _e.Q(b,function(z){var be;null===(be=p.next)||void 0===be||be.call(p,z),b.next(z)},function(){var z;k=!1,null===(z=p.complete)||void 0===z||z.call(p),b.complete()},function(z){var be;k=!1,null===(be=p.error)||void 0===be||be.call(p,z),b.error(z)},function(){var z,be;k&&(null===(z=p.unsubscribe)||void 0===z||z.call(p)),null===(be=p.finalize)||void 0===be||be.call(p)}))}):ke.y}var _t=N(5207),gn=N(5894),It=N(3766),rt=N(7216);class mn{constructor(u,l){this.id=u,this.url=l}}class Cn extends mn{constructor(u,l,p="imperative",C=null){super(u,l),this.navigationTrigger=p,this.restoredState=C}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class xn extends mn{constructor(u,l,p){super(u,l),this.urlAfterRedirects=p}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class kt extends mn{constructor(u,l,p){super(u,l),this.reason=p}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class fo extends mn{constructor(u,l,p){super(u,l),this.error=p}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class Nt extends mn{constructor(u,l,p,C){super(u,l),this.urlAfterRedirects=p,this.state=C}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class gt extends mn{constructor(u,l,p,C){super(u,l),this.urlAfterRedirects=p,this.state=C}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class tr extends mn{constructor(u,l,p,C,b){super(u,l),this.urlAfterRedirects=p,this.state=C,this.shouldActivate=b}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class Io extends mn{constructor(u,l,p,C){super(u,l),this.urlAfterRedirects=p,this.state=C}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class se extends mn{constructor(u,l,p,C){super(u,l),this.urlAfterRedirects=p,this.state=C}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class B{constructor(u){this.route=u}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class j{constructor(u){this.route=u}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class ue{constructor(u){this.snapshot=u}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class ce{constructor(u){this.snapshot=u}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Ne{constructor(u){this.snapshot=u}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class J{constructor(u){this.snapshot=u}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class xe{constructor(u,l,p){this.routerEvent=u,this.position=l,this.anchor=p}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}const Oe="primary";class At{constructor(u){this.params=u||{}}has(u){return Object.prototype.hasOwnProperty.call(this.params,u)}get(u){if(this.has(u)){const l=this.params[u];return Array.isArray(l)?l[0]:l}return null}getAll(u){if(this.has(u)){const l=this.params[u];return Array.isArray(l)?l:[l]}return[]}get keys(){return Object.keys(this.params)}}function xt(d){return new At(d)}const Gn="ngNavigationCancelingError";function bt(d){const u=Error("NavigationCancelingError: "+d);return u[Gn]=!0,u}function ot(d,u,l){const p=l.path.split("/");if(p.length>d.length||"full"===l.pathMatch&&(u.hasChildren()||p.length<d.length))return null;const C={};for(let b=0;b<p.length;b++){const R=p[b],k=d[b];if(R.startsWith(":"))C[R.substring(1)]=k;else if(R!==k.path)return null}return{consumed:d.slice(0,p.length),posParams:C}}function Fe(d,u){const l=d?Object.keys(d):void 0,p=u?Object.keys(u):void 0;if(!l||!p||l.length!=p.length)return!1;let C;for(let b=0;b<l.length;b++)if(C=l[b],!Lt(d[C],u[C]))return!1;return!0}function Lt(d,u){if(Array.isArray(d)&&Array.isArray(u)){if(d.length!==u.length)return!1;const l=[...d].sort(),p=[...u].sort();return l.every((C,b)=>p[b]===C)}return d===u}function nn(d){return Array.prototype.concat.apply([],d)}function Dr(d){return d.length>0?d[d.length-1]:null}function tt(d,u){for(const l in d)d.hasOwnProperty(l)&&u(d[l],l)}function Tn(d){return(0,f.CqO)(d)?d:(0,f.QGY)(d)?(0,Ce.Dp)(Promise.resolve(d)):(0,U.of)(d)}const Pn={exact:function $r(d,u,l){if(!En(d.segments,u.segments)||!Fn(d.segments,u.segments,l)||d.numberOfChildren!==u.numberOfChildren)return!1;for(const p in u.children)if(!d.children[p]||!$r(d.children[p],u.children[p],l))return!1;return!0},subset:Gr},mt={exact:function(d,u){return Fe(d,u)},subset:function(d,u){return Object.keys(u).length<=Object.keys(d).length&&Object.keys(u).every(l=>Lt(d[l],u[l]))},ignored:()=>!0};function ur(d,u,l){return Pn[l.paths](d.root,u.root,l.matrixParams)&&mt[l.queryParams](d.queryParams,u.queryParams)&&!("exact"===l.fragment&&d.fragment!==u.fragment)}function Gr(d,u,l){return In(d,u,u.segments,l)}function In(d,u,l,p){if(d.segments.length>l.length){const C=d.segments.slice(0,l.length);return!(!En(C,l)||u.hasChildren()||!Fn(C,l,p))}if(d.segments.length===l.length){if(!En(d.segments,l)||!Fn(d.segments,l,p))return!1;for(const C in u.children)if(!d.children[C]||!Gr(d.children[C],u.children[C],p))return!1;return!0}{const C=l.slice(0,d.segments.length),b=l.slice(d.segments.length);return!!(En(d.segments,C)&&Fn(d.segments,C,p)&&d.children[Oe])&&In(d.children[Oe],u,b,p)}}function Fn(d,u,l){return u.every((p,C)=>mt[l](d[C].parameters,p.parameters))}class zn{constructor(u,l,p){this.root=u,this.queryParams=l,this.fragment=p}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=xt(this.queryParams)),this._queryParamMap}toString(){return Wr.serialize(this)}}class Xe{constructor(u,l){this.segments=u,this.children=l,this.parent=null,tt(l,(p,C)=>p.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return rr(this)}}class rn{constructor(u,l){this.path=u,this.parameters=l}get parameterMap(){return this._parameterMap||(this._parameterMap=xt(this.parameters)),this._parameterMap}toString(){return Te(this)}}function En(d,u){return d.length===u.length&&d.every((l,p)=>l.path===u[p].path)}class _n{}class zr{parse(u){const l=new Ln(u);return new zn(l.parseRootSegment(),l.parseQueryParams(),l.parseFragment())}serialize(u){var d;return`${`/${Wn(u.root,!0)}`}${function(d){const u=Object.keys(d).map(l=>{const p=d[l];return Array.isArray(p)?p.map(C=>`${cn(l)}=${cn(C)}`).join("&"):`${cn(l)}=${cn(p)}`}).filter(l=>!!l);return u.length?`?${u.join("&")}`:""}(u.queryParams)}${"string"==typeof u.fragment?`#${d=u.fragment,encodeURI(d)}`:""}`}}const Wr=new zr;function rr(d){return d.segments.map(u=>Te(u)).join("/")}function Wn(d,u){if(!d.hasChildren())return rr(d);if(u){const l=d.children[Oe]?Wn(d.children[Oe],!1):"",p=[];return tt(d.children,(C,b)=>{b!==Oe&&p.push(`${b}:${Wn(C,!1)}`)}),p.length>0?`${l}(${p.join("//")})`:l}{const l=function(d,u){let l=[];return tt(d.children,(p,C)=>{C===Oe&&(l=l.concat(u(p,C)))}),tt(d.children,(p,C)=>{C!==Oe&&(l=l.concat(u(p,C)))}),l}(d,(p,C)=>C===Oe?[Wn(d.children[Oe],!1)]:[`${C}:${Wn(p,!1)}`]);return 1===Object.keys(d.children).length&&null!=d.children[Oe]?`${rr(d)}/${l[0]}`:`${rr(d)}/(${l.join("//")})`}}function Yt(d){return encodeURIComponent(d).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function cn(d){return Yt(d).replace(/%3B/gi,";")}function Zt(d){return Yt(d).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function fr(d){return decodeURIComponent(d)}function dn(d){return fr(d.replace(/\+/g,"%20"))}function Te(d){return`${Zt(d.path)}${function(d){return Object.keys(d).map(u=>`;${Zt(u)}=${Zt(d[u])}`).join("")}(d.parameters)}`}const pt=/^[^\/()?;=#]+/;function zt(d){const u=d.match(pt);return u?u[0]:""}const Ut=/^[^=?&#]+/,Ot=/^[^?&#]+/;class Ln{constructor(u){this.url=u,this.remaining=u}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Xe([],{}):new Xe([],this.parseChildren())}parseQueryParams(){const u={};if(this.consumeOptional("?"))do{this.parseQueryParam(u)}while(this.consumeOptional("&"));return u}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const u=[];for(this.peekStartsWith("(")||u.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),u.push(this.parseSegment());let l={};this.peekStartsWith("/(")&&(this.capture("/"),l=this.parseParens(!0));let p={};return this.peekStartsWith("(")&&(p=this.parseParens(!1)),(u.length>0||Object.keys(l).length>0)&&(p[Oe]=new Xe(u,l)),p}parseSegment(){const u=zt(this.remaining);if(""===u&&this.peekStartsWith(";"))throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);return this.capture(u),new rn(fr(u),this.parseMatrixParams())}parseMatrixParams(){const u={};for(;this.consumeOptional(";");)this.parseParam(u);return u}parseParam(u){const l=zt(this.remaining);if(!l)return;this.capture(l);let p="";if(this.consumeOptional("=")){const C=zt(this.remaining);C&&(p=C,this.capture(p))}u[fr(l)]=fr(p)}parseQueryParam(u){const l=function(d){const u=d.match(Ut);return u?u[0]:""}(this.remaining);if(!l)return;this.capture(l);let p="";if(this.consumeOptional("=")){const R=function(d){const u=d.match(Ot);return u?u[0]:""}(this.remaining);R&&(p=R,this.capture(p))}const C=dn(l),b=dn(p);if(u.hasOwnProperty(C)){let R=u[C];Array.isArray(R)||(R=[R],u[C]=R),R.push(b)}else u[C]=b}parseParens(u){const l={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const p=zt(this.remaining),C=this.remaining[p.length];if("/"!==C&&")"!==C&&";"!==C)throw new Error(`Cannot parse url '${this.url}'`);let b;p.indexOf(":")>-1?(b=p.substr(0,p.indexOf(":")),this.capture(b),this.capture(":")):u&&(b=Oe);const R=this.parseChildren();l[b]=1===Object.keys(R).length?R[Oe]:new Xe([],R),this.consumeOptional("//")}return l}peekStartsWith(u){return this.remaining.startsWith(u)}consumeOptional(u){return!!this.peekStartsWith(u)&&(this.remaining=this.remaining.substring(u.length),!0)}capture(u){if(!this.consumeOptional(u))throw new Error(`Expected "${u}".`)}}class Ze{constructor(u){this._root=u}get root(){return this._root.value}parent(u){const l=this.pathFromRoot(u);return l.length>1?l[l.length-2]:null}children(u){const l=cr(u,this._root);return l?l.children.map(p=>p.value):[]}firstChild(u){const l=cr(u,this._root);return l&&l.children.length>0?l.children[0].value:null}siblings(u){const l=Zn(u,this._root);return l.length<2?[]:l[l.length-2].children.map(C=>C.value).filter(C=>C!==u)}pathFromRoot(u){return Zn(u,this._root).map(l=>l.value)}}function cr(d,u){if(d===u.value)return u;for(const l of u.children){const p=cr(d,l);if(p)return p}return null}function Zn(d,u){if(d===u.value)return[u];for(const l of u.children){const p=Zn(d,l);if(p.length)return p.unshift(u),p}return[]}class en{constructor(u,l){this.value=u,this.children=l}toString(){return`TreeNode(${this.value})`}}function fn(d){const u={};return d&&d.children.forEach(l=>u[l.value.outlet]=l),u}class Bt extends Ze{constructor(u,l){super(u),this.snapshot=l,hr(this,u)}toString(){return this.snapshot.toString()}}function Vn(d,u){const l=function(d,u){const R=new Ar([],{},{},"",{},Oe,u,null,d.root,-1,{});return new on("",new en(R,[]))}(d,u),p=new te([new rn("",{})]),C=new te({}),b=new te({}),R=new te({}),k=new te(""),z=new jt(p,C,R,k,b,Oe,u,l.root);return z.snapshot=l.root,new Bt(new en(z,[]),l)}class jt{constructor(u,l,p,C,b,R,k,z){this.url=u,this.params=l,this.queryParams=p,this.fragment=C,this.data=b,this.outlet=R,this.component=k,this._futureSnapshot=z}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe((0,_t.U)(u=>xt(u)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe((0,_t.U)(u=>xt(u)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function Mt(d,u="emptyOnly"){const l=d.pathFromRoot;let p=0;if("always"!==u)for(p=l.length-1;p>=1;){const C=l[p],b=l[p-1];if(C.routeConfig&&""===C.routeConfig.path)p--;else{if(b.component)break;p--}}return function(d){return d.reduce((u,l)=>({params:Object.assign(Object.assign({},u.params),l.params),data:Object.assign(Object.assign({},u.data),l.data),resolve:Object.assign(Object.assign({},u.resolve),l._resolvedData)}),{params:{},data:{},resolve:{}})}(l.slice(p))}class Ar{constructor(u,l,p,C,b,R,k,z,be,Ue,at){this.url=u,this.params=l,this.queryParams=p,this.fragment=C,this.data=b,this.outlet=R,this.component=k,this.routeConfig=z,this._urlSegment=be,this._lastPathIndex=Ue,this._resolve=at}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=xt(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=xt(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(p=>p.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class on extends Ze{constructor(u,l){super(l),this.url=u,hr(this,l)}toString(){return dr(this._root)}}function hr(d,u){u.value._routerState=d,u.children.forEach(l=>hr(d,l))}function dr(d){const u=d.children.length>0?` { ${d.children.map(dr).join(", ")} } `:"";return`${d.value}${u}`}function Ht(d){if(d.snapshot){const u=d.snapshot,l=d._futureSnapshot;d.snapshot=l,Fe(u.queryParams,l.queryParams)||d.queryParams.next(l.queryParams),u.fragment!==l.fragment&&d.fragment.next(l.fragment),Fe(u.params,l.params)||d.params.next(l.params),function(d,u){if(d.length!==u.length)return!1;for(let l=0;l<d.length;++l)if(!Fe(d[l],u[l]))return!1;return!0}(u.url,l.url)||d.url.next(l.url),Fe(u.data,l.data)||d.data.next(l.data)}else d.snapshot=d._futureSnapshot,d.data.next(d._futureSnapshot.data)}function qn(d,u){return Fe(d.params,u.params)&&function(d,u){return En(d,u)&&d.every((l,p)=>Fe(l.parameters,u[p].parameters))}(d.url,u.url)&&!(!d.parent!=!u.parent)&&(!d.parent||qn(d.parent,u.parent))}function Mr(d,u,l){if(l&&d.shouldReuseRoute(u.value,l.value.snapshot)){const p=l.value;p._futureSnapshot=u.value;const C=function(d,u,l){return u.children.map(p=>{for(const C of l.children)if(d.shouldReuseRoute(p.value,C.value.snapshot))return Mr(d,p,C);return Mr(d,p)})}(d,u,l);return new en(p,C)}{if(d.shouldAttach(u.value)){const b=d.retrieve(u.value);if(null!==b){const R=b.route;return hn(u,R),R}}const p=function(d){return new jt(new te(d.url),new te(d.params),new te(d.queryParams),new te(d.fragment),new te(d.data),d.outlet,d.component,d)}(u.value),C=u.children.map(b=>Mr(d,b));return new en(p,C)}}function hn(d,u){if(d.value.routeConfig!==u.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(d.children.length!==u.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");u.value._futureSnapshot=d.value;for(let l=0;l<d.children.length;++l)hn(d.children[l],u.children[l])}function Qn(d){return"object"==typeof d&&null!=d&&!d.outlets&&!d.segmentPath}function O(d){return"object"==typeof d&&null!=d&&d.outlets}function x(d,u,l,p,C){let b={};return p&&tt(p,(R,k)=>{b[k]=Array.isArray(R)?R.map(z=>`${z}`):`${R}`}),new zn(l.root===d?u:I(l.root,d,u),b,C)}function I(d,u,l){const p={};return tt(d.children,(C,b)=>{p[b]=C===u?l:I(C,u,l)}),new Xe(d.segments,p)}class F{constructor(u,l,p){if(this.isAbsolute=u,this.numberOfDoubleDots=l,this.commands=p,u&&p.length>0&&Qn(p[0]))throw new Error("Root segment cannot have matrix parameters");const C=p.find(O);if(C&&C!==Dr(p))throw new Error("{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Re{constructor(u,l,p){this.segmentGroup=u,this.processChildren=l,this.index=p}}function Bn(d,u,l){if(d||(d=new Xe([],{})),0===d.segments.length&&d.hasChildren())return yn(d,u,l);const p=function(d,u,l){let p=0,C=u;const b={match:!1,pathIndex:0,commandIndex:0};for(;C<d.segments.length;){if(p>=l.length)return b;const R=d.segments[C],k=l[p];if(O(k))break;const z=`${k}`,be=p<l.length-1?l[p+1]:null;if(C>0&&void 0===z)break;if(z&&be&&"object"==typeof be&&void 0===be.outlets){if(!oi(z,be,R))return b;p+=2}else{if(!oi(z,{},R))return b;p++}C++}return{match:!0,pathIndex:C,commandIndex:p}}(d,u,l),C=l.slice(p.commandIndex);if(p.match&&p.pathIndex<d.segments.length){const b=new Xe(d.segments.slice(0,p.pathIndex),{});return b.children[Oe]=new Xe(d.segments.slice(p.pathIndex),d.children),yn(b,0,C)}return p.match&&0===C.length?new Xe(d.segments,{}):p.match&&!d.hasChildren()?Ir(d,u,l):p.match?yn(d,0,C):Ir(d,u,l)}function yn(d,u,l){if(0===l.length)return new Xe(d.segments,{});{const p=function(d){return O(d[0])?d[0].outlets:{[Oe]:d}}(l),C={};return tt(p,(b,R)=>{"string"==typeof b&&(b=[b]),null!==b&&(C[R]=Bn(d.children[R],u,b))}),tt(d.children,(b,R)=>{void 0===p[R]&&(C[R]=b)}),new Xe(d.segments,C)}}function Ir(d,u,l){const p=d.segments.slice(0,u);let C=0;for(;C<l.length;){const b=l[C];if(O(b)){const z=So(b.outlets);return new Xe(p,z)}if(0===C&&Qn(l[0])){p.push(new rn(d.segments[u].path,$o(l[0]))),C++;continue}const R=O(b)?b.outlets[Oe]:`${b}`,k=C<l.length-1?l[C+1]:null;R&&k&&Qn(k)?(p.push(new rn(R,$o(k))),C+=2):(p.push(new rn(R,{})),C++)}return new Xe(p,{})}function So(d){const u={};return tt(d,(l,p)=>{"string"==typeof l&&(l=[l]),null!==l&&(u[p]=Ir(new Xe([],{}),0,l))}),u}function $o(d){const u={};return tt(d,(l,p)=>u[p]=`${l}`),u}function oi(d,u,l){return d==l.path&&Fe(u,l.parameters)}class Go{constructor(u,l,p,C){this.routeReuseStrategy=u,this.futureState=l,this.currState=p,this.forwardEvent=C}activate(u){const l=this.futureState._root,p=this.currState?this.currState._root:null;this.deactivateChildRoutes(l,p,u),Ht(this.futureState.root),this.activateChildRoutes(l,p,u)}deactivateChildRoutes(u,l,p){const C=fn(l);u.children.forEach(b=>{const R=b.value.outlet;this.deactivateRoutes(b,C[R],p),delete C[R]}),tt(C,(b,R)=>{this.deactivateRouteAndItsChildren(b,p)})}deactivateRoutes(u,l,p){const C=u.value,b=l?l.value:null;if(C===b)if(C.component){const R=p.getContext(C.outlet);R&&this.deactivateChildRoutes(u,l,R.children)}else this.deactivateChildRoutes(u,l,p);else b&&this.deactivateRouteAndItsChildren(l,p)}deactivateRouteAndItsChildren(u,l){this.routeReuseStrategy.shouldDetach(u.value.snapshot)?this.detachAndStoreRouteSubtree(u,l):this.deactivateRouteAndOutlet(u,l)}detachAndStoreRouteSubtree(u,l){const p=l.getContext(u.value.outlet);if(p&&p.outlet){const C=p.outlet.detach(),b=p.children.onOutletDeactivated();this.routeReuseStrategy.store(u.value.snapshot,{componentRef:C,route:u,contexts:b})}}deactivateRouteAndOutlet(u,l){const p=l.getContext(u.value.outlet),C=p&&u.value.component?p.children:l,b=fn(u);for(const R of Object.keys(b))this.deactivateRouteAndItsChildren(b[R],C);p&&p.outlet&&(p.outlet.deactivate(),p.children.onOutletDeactivated(),p.attachRef=null,p.resolver=null,p.route=null)}activateChildRoutes(u,l,p){const C=fn(l);u.children.forEach(b=>{this.activateRoutes(b,C[b.value.outlet],p),this.forwardEvent(new J(b.value.snapshot))}),u.children.length&&this.forwardEvent(new ce(u.value.snapshot))}activateRoutes(u,l,p){const C=u.value,b=l?l.value:null;if(Ht(C),C===b)if(C.component){const R=p.getOrCreateContext(C.outlet);this.activateChildRoutes(u,l,R.children)}else this.activateChildRoutes(u,l,p);else if(C.component){const R=p.getOrCreateContext(C.outlet);if(this.routeReuseStrategy.shouldAttach(C.snapshot)){const k=this.routeReuseStrategy.retrieve(C.snapshot);this.routeReuseStrategy.store(C.snapshot,null),R.children.onOutletReAttached(k.contexts),R.attachRef=k.componentRef,R.route=k.route.value,R.outlet&&R.outlet.attach(k.componentRef,k.route.value),ii(k.route)}else{const k=function(d){for(let u=d.parent;u;u=u.parent){const l=u.routeConfig;if(l&&l._loadedConfig)return l._loadedConfig;if(l&&l.component)return null}return null}(C.snapshot),z=k?k.module.componentFactoryResolver:null;R.attachRef=null,R.route=C,R.resolver=z,R.outlet&&R.outlet.activateWith(C,z),this.activateChildRoutes(u,null,R.children)}}else this.activateChildRoutes(u,null,p)}}function ii(d){Ht(d.value),d.children.forEach(ii)}class Zr{constructor(u,l){this.routes=u,this.module=l}}function Sr(d){return"function"==typeof d}function Or(d){return d instanceof zn}const Nr=Symbol("INITIAL_VALUE");function gr(){return ne(d=>function(){for(var d=[],u=0;u<arguments.length;u++)d[u]=arguments[u];var l=(0,Ee.yG)(d),p=(0,Ee.jO)(d),C=(0,Z.D)(d),b=C.args,R=C.keys;if(0===b.length)return(0,Ce.Dp)([],l);var k=new fe.y(Se(b,l,R?function(z){return(0,ie.n)(R,z)}:ke.y));return p?k.pipe((0,Ie.Z)(p)):k}(d.map(u=>u.pipe((0,yt.q)(1),function(){for(var d=[],u=0;u<arguments.length;u++)d[u]=arguments[u];var l=(0,Ee.yG)(d);return(0,je.e)(function(p,C){(l?ae(d,p,l):ae(d,p)).subscribe(C)})}(Nr)))).pipe(We((u,l)=>{let p=!1;return l.reduce((C,b,R)=>C!==Nr?C:(b===Nr&&(p=!0),p||!1!==b&&R!==l.length-1&&!Or(b)?C:b),u)},Nr),(0,q.h)(u=>u!==Nr),(0,_t.U)(u=>Or(u)?u:!0===u),(0,yt.q)(1)))}let Yo=(()=>{class d{}return d.\u0275fac=function(l){return new(l||d)},d.\u0275cmp=f.Xpm({type:d,selectors:[["ng-component"]],decls:1,vars:0,template:function(l,p){1&l&&f._UZ(0,"router-outlet")},directives:function(){return[hi]},encapsulation:2}),d})();function go(d,u=""){for(let l=0;l<d.length;l++){const p=d[l];y(p,w(u,p))}}function y(d,u){d.children&&go(d.children,u)}function w(d,u){return u?d||u.path?d&&!u.path?`${d}/`:!d&&u.path?u.path:`${d}/${u.path}`:"":d}function v(d){const u=d.children&&d.children.map(v),l=u?Object.assign(Object.assign({},d),{children:u}):Object.assign({},d);return!l.component&&(u||l.loadChildren)&&l.outlet&&l.outlet!==Oe&&(l.component=Yo),l}function A(d){return d.outlet||Oe}function L(d,u){const l=d.filter(p=>A(p)===u);return l.push(...d.filter(p=>A(p)!==u)),l}const X={matched:!1,consumedSegments:[],lastChild:0,parameters:{},positionalParamSegments:{}};function le(d,u,l){var p;if(""===u.path)return"full"===u.pathMatch&&(d.hasChildren()||l.length>0)?Object.assign({},X):{matched:!0,consumedSegments:[],lastChild:0,parameters:{},positionalParamSegments:{}};const b=(u.matcher||ot)(l,d,u);if(!b)return Object.assign({},X);const R={};tt(b.posParams,(z,be)=>{R[be]=z.path});const k=b.consumed.length>0?Object.assign(Object.assign({},R),b.consumed[b.consumed.length-1].parameters):R;return{matched:!0,consumedSegments:b.consumed,lastChild:b.consumed.length,parameters:k,positionalParamSegments:null!==(p=b.posParams)&&void 0!==p?p:{}}}function Be(d,u,l,p,C="corrected"){if(l.length>0&&function(d,u,l){return l.some(p=>M(d,u,p)&&A(p)!==Oe)}(d,l,p)){const R=new Xe(u,function(d,u,l,p){const C={};C[Oe]=p,p._sourceSegment=d,p._segmentIndexShift=u.length;for(const b of l)if(""===b.path&&A(b)!==Oe){const R=new Xe([],{});R._sourceSegment=d,R._segmentIndexShift=u.length,C[A(b)]=R}return C}(d,u,p,new Xe(l,d.children)));return R._sourceSegment=d,R._segmentIndexShift=u.length,{segmentGroup:R,slicedSegments:[]}}if(0===l.length&&function(d,u,l){return l.some(p=>M(d,u,p))}(d,l,p)){const R=new Xe(d.segments,function(d,u,l,p,C,b){const R={};for(const k of p)if(M(d,l,k)&&!C[A(k)]){const z=new Xe([],{});z._sourceSegment=d,z._segmentIndexShift="legacy"===b?d.segments.length:u.length,R[A(k)]=z}return Object.assign(Object.assign({},C),R)}(d,u,l,p,d.children,C));return R._sourceSegment=d,R._segmentIndexShift=u.length,{segmentGroup:R,slicedSegments:l}}const b=new Xe(d.segments,d.children);return b._sourceSegment=d,b._segmentIndexShift=u.length,{segmentGroup:b,slicedSegments:l}}function M(d,u,l){return(!(d.hasChildren()||u.length>0)||"full"!==l.pathMatch)&&""===l.path}function G(d,u,l,p){return!!(A(d)===p||p!==Oe&&M(u,l,d))&&("**"===d.path||le(u,d,l).matched)}function ve(d,u,l){return 0===u.length&&!d.children[l]}class wt{constructor(u){this.segmentGroup=u||null}}class sn{constructor(u){this.urlTree=u}}function Qt(d){return new fe.y(u=>u.error(new wt(d)))}function $t(d){return new fe.y(u=>u.error(new sn(d)))}function Zo(d){return new fe.y(u=>u.error(new Error(`Only absolute redirects can have named outlets. redirectTo: '${d}'`)))}class bn{constructor(u,l,p,C,b){this.configLoader=l,this.urlSerializer=p,this.urlTree=C,this.config=b,this.allowRedirects=!0,this.ngModule=u.get(f.h0i)}apply(){const u=Be(this.urlTree.root,[],[],this.config).segmentGroup,l=new Xe(u.segments,u.children);return this.expandSegmentGroup(this.ngModule,this.config,l,Oe).pipe((0,_t.U)(b=>this.createUrlTree(qr(b),this.urlTree.queryParams,this.urlTree.fragment))).pipe((0,gn.K)(b=>{if(b instanceof sn)return this.allowRedirects=!1,this.match(b.urlTree);throw b instanceof wt?this.noMatchError(b):b}))}match(u){return this.expandSegmentGroup(this.ngModule,this.config,u.root,Oe).pipe((0,_t.U)(C=>this.createUrlTree(qr(C),u.queryParams,u.fragment))).pipe((0,gn.K)(C=>{throw C instanceof wt?this.noMatchError(C):C}))}noMatchError(u){return new Error(`Cannot match any routes. URL Segment: '${u.segmentGroup}'`)}createUrlTree(u,l,p){const C=u.segments.length>0?new Xe([],{[Oe]:u}):u;return new zn(C,l,p)}expandSegmentGroup(u,l,p,C){return 0===p.segments.length&&p.hasChildren()?this.expandChildren(u,l,p).pipe((0,_t.U)(b=>new Xe([],b))):this.expandSegment(u,p,l,p.segments,C,!0)}expandChildren(u,l,p){const C=[];for(const b of Object.keys(p.children))"primary"===b?C.unshift(b):C.push(b);return(0,Ce.Dp)(C).pipe((0,It.b)(b=>{const R=p.children[b],k=L(l,b);return this.expandSegmentGroup(u,k,R,b).pipe((0,_t.U)(z=>({segment:z,outlet:b})))}),We((b,R)=>(b[R.outlet]=R.segment,b),{}),function(d,u){var l=arguments.length>=2;return function(p){return p.pipe(d?(0,q.h)(function(C,b){return d(C,b,p)}):ke.y,Me(1),l?Je(u):ye(function(){return new Ae}))}}())}expandSegment(u,l,p,C,b,R){return(0,Ce.Dp)(p).pipe((0,It.b)(k=>this.expandSegmentAgainstRoute(u,l,p,k,C,b,R).pipe((0,gn.K)(be=>{if(be instanceof wt)return(0,U.of)(null);throw be}))),Vt(k=>!!k),(0,gn.K)((k,z)=>{if(k instanceof Ae||"EmptyError"===k.name){if(ve(l,C,b))return(0,U.of)(new Xe([],{}));throw new wt(l)}throw k}))}expandSegmentAgainstRoute(u,l,p,C,b,R,k){return G(C,l,b,R)?void 0===C.redirectTo?this.matchSegmentAgainstRoute(u,l,C,b,R):k&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(u,l,p,C,b,R):Qt(l):Qt(l)}expandSegmentAgainstRouteUsingRedirect(u,l,p,C,b,R){return"**"===C.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(u,p,C,R):this.expandRegularSegmentAgainstRouteUsingRedirect(u,l,p,C,b,R)}expandWildCardWithParamsAgainstRouteUsingRedirect(u,l,p,C){const b=this.applyRedirectCommands([],p.redirectTo,{});return p.redirectTo.startsWith("/")?$t(b):this.lineralizeSegments(p,b).pipe((0,rt.z)(R=>{const k=new Xe(R,{});return this.expandSegment(u,k,l,R,C,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(u,l,p,C,b,R){const{matched:k,consumedSegments:z,lastChild:be,positionalParamSegments:Ue}=le(l,C,b);if(!k)return Qt(l);const at=this.applyRedirectCommands(z,C.redirectTo,Ue);return C.redirectTo.startsWith("/")?$t(at):this.lineralizeSegments(C,at).pipe((0,rt.z)(Pt=>this.expandSegment(u,l,p,Pt.concat(b.slice(be)),R,!1)))}matchSegmentAgainstRoute(u,l,p,C,b){if("**"===p.path)return p.loadChildren?(p._loadedConfig?(0,U.of)(p._loadedConfig):this.configLoader.load(u.injector,p)).pipe((0,_t.U)(Pt=>(p._loadedConfig=Pt,new Xe(C,{})))):(0,U.of)(new Xe(C,{}));const{matched:R,consumedSegments:k,lastChild:z}=le(l,p,C);if(!R)return Qt(l);const be=C.slice(z);return this.getChildConfig(u,p,C).pipe((0,rt.z)(at=>{const Pt=at.module,Ct=at.routes,{segmentGroup:yr,slicedSegments:or}=Be(l,k,be,Ct),kr=new Xe(yr.segments,yr.children);if(0===or.length&&kr.hasChildren())return this.expandChildren(Pt,Ct,kr).pipe((0,_t.U)(Hi=>new Xe(k,Hi)));if(0===Ct.length&&0===or.length)return(0,U.of)(new Xe(k,{}));const Ko=A(p)===b;return this.expandSegment(Pt,kr,Ct,or,Ko?Oe:b,!0).pipe((0,_t.U)(ir=>new Xe(k.concat(ir.segments),ir.children)))}))}getChildConfig(u,l,p){return l.children?(0,U.of)(new Zr(l.children,u)):l.loadChildren?void 0!==l._loadedConfig?(0,U.of)(l._loadedConfig):this.runCanLoadGuards(u.injector,l,p).pipe((0,rt.z)(C=>{return C?this.configLoader.load(u.injector,l).pipe((0,_t.U)(b=>(l._loadedConfig=b,b))):(d=l,new fe.y(u=>u.error(bt(`Cannot load children because the guard of the route "path: '${d.path}'" returned false`))));var d})):(0,U.of)(new Zr([],u))}runCanLoadGuards(u,l,p){const C=l.canLoad;if(!C||0===C.length)return(0,U.of)(!0);const b=C.map(R=>{const k=u.get(R);let z;if((d=k)&&Sr(d.canLoad))z=k.canLoad(l,p);else{if(!Sr(k))throw new Error("Invalid CanLoad guard");z=k(l,p)}var d;return Tn(z)});return(0,U.of)(b).pipe(gr(),Tt(R=>{if(!Or(R))return;const k=bt(`Redirecting to "${this.urlSerializer.serialize(R)}"`);throw k.url=R,k}),(0,_t.U)(R=>!0===R))}lineralizeSegments(u,l){let p=[],C=l.root;for(;;){if(p=p.concat(C.segments),0===C.numberOfChildren)return(0,U.of)(p);if(C.numberOfChildren>1||!C.children[Oe])return Zo(u.redirectTo);C=C.children[Oe]}}applyRedirectCommands(u,l,p){return this.applyRedirectCreatreUrlTree(l,this.urlSerializer.parse(l),u,p)}applyRedirectCreatreUrlTree(u,l,p,C){const b=this.createSegmentGroup(u,l.root,p,C);return new zn(b,this.createQueryParams(l.queryParams,this.urlTree.queryParams),l.fragment)}createQueryParams(u,l){const p={};return tt(u,(C,b)=>{if("string"==typeof C&&C.startsWith(":")){const k=C.substring(1);p[b]=l[k]}else p[b]=C}),p}createSegmentGroup(u,l,p,C){const b=this.createSegments(u,l.segments,p,C);let R={};return tt(l.children,(k,z)=>{R[z]=this.createSegmentGroup(u,k,p,C)}),new Xe(b,R)}createSegments(u,l,p,C){return l.map(b=>b.path.startsWith(":")?this.findPosParam(u,b,C):this.findOrReturn(b,p))}findPosParam(u,l,p){const C=p[l.path.substring(1)];if(!C)throw new Error(`Cannot redirect to '${u}'. Cannot find '${l.path}'.`);return C}findOrReturn(u,l){let p=0;for(const C of l){if(C.path===u.path)return l.splice(p),C;p++}return u}}function qr(d){const u={};for(const p of Object.keys(d.children)){const b=qr(d.children[p]);(b.segments.length>0||b.hasChildren())&&(u[p]=b)}return function(d){if(1===d.numberOfChildren&&d.children[Oe]){const u=d.children[Oe];return new Xe(d.segments.concat(u.segments),u.children)}return d}(new Xe(d.segments,u))}class Qr{constructor(u){this.path=u,this.route=this.path[this.path.length-1]}}class ai{constructor(u,l){this.component=u,this.route=l}}function Ls(d,u,l){const p=d._root;return li(p,u?u._root:null,l,[p.value])}function Vs(d,u,l){const p=function(d){if(!d)return null;for(let u=d.parent;u;u=u.parent){const l=u.routeConfig;if(l&&l._loadedConfig)return l._loadedConfig}return null}(u);return(p?p.module.injector:l).get(d)}function li(d,u,l,p,C={canDeactivateChecks:[],canActivateChecks:[]}){const b=fn(u);return d.children.forEach(R=>{(function(d,u,l,p,C={canDeactivateChecks:[],canActivateChecks:[]}){const b=d.value,R=u?u.value:null,k=l?l.getContext(d.value.outlet):null;if(R&&b.routeConfig===R.routeConfig){const z=function(d,u,l){if("function"==typeof l)return l(d,u);switch(l){case"pathParamsChange":return!En(d.url,u.url);case"pathParamsOrQueryParamsChange":return!En(d.url,u.url)||!Fe(d.queryParams,u.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!qn(d,u)||!Fe(d.queryParams,u.queryParams);case"paramsChange":default:return!qn(d,u)}}(R,b,b.routeConfig.runGuardsAndResolvers);z?C.canActivateChecks.push(new Qr(p)):(b.data=R.data,b._resolvedData=R._resolvedData),li(d,u,b.component?k?k.children:null:l,p,C),z&&k&&k.outlet&&k.outlet.isActivated&&C.canDeactivateChecks.push(new ai(k.outlet.component,R))}else R&&ui(u,k,C),C.canActivateChecks.push(new Qr(p)),li(d,null,b.component?k?k.children:null:l,p,C)})(R,b[R.value.outlet],l,p.concat([R.value]),C),delete b[R.value.outlet]}),tt(b,(R,k)=>ui(R,l.getContext(k),C)),C}function ui(d,u,l){const p=fn(d),C=d.value;tt(p,(b,R)=>{ui(b,C.component?u?u.children.getContext(R):null:u,l)}),l.canDeactivateChecks.push(new ai(C.component&&u&&u.outlet&&u.outlet.isActivated?u.outlet.component:null,C))}class Us{}function Ii(d){return new fe.y(u=>u.error(d))}class iu{constructor(u,l,p,C,b,R){this.rootComponentType=u,this.config=l,this.urlTree=p,this.url=C,this.paramsInheritanceStrategy=b,this.relativeLinkResolution=R}recognize(){const u=Be(this.urlTree.root,[],[],this.config.filter(R=>void 0===R.redirectTo),this.relativeLinkResolution).segmentGroup,l=this.processSegmentGroup(this.config,u,Oe);if(null===l)return null;const p=new Ar([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},Oe,this.rootComponentType,null,this.urlTree.root,-1,{}),C=new en(p,l),b=new on(this.url,C);return this.inheritParamsAndData(b._root),b}inheritParamsAndData(u){const l=u.value,p=Mt(l,this.paramsInheritanceStrategy);l.params=Object.freeze(p.params),l.data=Object.freeze(p.data),u.children.forEach(C=>this.inheritParamsAndData(C))}processSegmentGroup(u,l,p){return 0===l.segments.length&&l.hasChildren()?this.processChildren(u,l):this.processSegment(u,l,l.segments,p)}processChildren(u,l){const p=[];for(const b of Object.keys(l.children)){const R=l.children[b],k=L(u,b),z=this.processSegmentGroup(k,R,b);if(null===z)return null;p.push(...z)}const C=_r(p);return C.sort((u,l)=>u.value.outlet===Oe?-1:l.value.outlet===Oe?1:u.value.outlet.localeCompare(l.value.outlet)),C}processSegment(u,l,p,C){for(const b of u){const R=this.processSegmentAgainstRoute(b,l,p,C);if(null!==R)return R}return ve(l,p,C)?[]:null}processSegmentAgainstRoute(u,l,p,C){if(u.redirectTo||!G(u,l,p,C))return null;let b,R=[],k=[];if("**"===u.path){const Ct=p.length>0?Dr(p).parameters:{};b=new Ar(p,Ct,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,$a(u),A(u),u.component,u,xo(l),Fr(l)+p.length,Bs(u))}else{const Ct=le(l,u,p);if(!Ct.matched)return null;R=Ct.consumedSegments,k=p.slice(Ct.lastChild),b=new Ar(R,Ct.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,$a(u),A(u),u.component,u,xo(l),Fr(l)+R.length,Bs(u))}const z=(d=u).children?d.children:d.loadChildren?d._loadedConfig.routes:[],{segmentGroup:be,slicedSegments:Ue}=Be(l,R,k,z.filter(Ct=>void 0===Ct.redirectTo),this.relativeLinkResolution);var d;if(0===Ue.length&&be.hasChildren()){const Ct=this.processChildren(z,be);return null===Ct?null:[new en(b,Ct)]}if(0===z.length&&0===Ue.length)return[new en(b,[])];const at=A(u)===C,Pt=this.processSegment(z,be,Ue,at?Oe:C);return null===Pt?null:[new en(b,Pt)]}}function jn(d){const u=d.value.routeConfig;return u&&""===u.path&&void 0===u.redirectTo}function _r(d){const u=[],l=new Set;for(const p of d){if(!jn(p)){u.push(p);continue}const C=u.find(b=>p.value.routeConfig===b.value.routeConfig);void 0!==C?(C.children.push(...p.children),l.add(C)):u.push(p)}for(const p of l){const C=_r(p.children);u.push(new en(p.value,C))}return u.filter(p=>!l.has(p))}function xo(d){let u=d;for(;u._sourceSegment;)u=u._sourceSegment;return u}function Fr(d){let u=d,l=u._segmentIndexShift?u._segmentIndexShift:0;for(;u._sourceSegment;)u=u._sourceSegment,l+=u._segmentIndexShift?u._segmentIndexShift:0;return l-1}function $a(d){return d.data||{}}function Bs(d){return d.resolve||{}}function di(d){return ne(u=>{const l=d(u);return l?(0,Ce.Dp)(l).pipe((0,_t.U)(()=>u)):(0,U.of)(u)})}class Ri extends class{shouldDetach(u){return!1}store(u,l){}shouldAttach(u){return!1}retrieve(u){return null}shouldReuseRoute(u,l){return u.routeConfig===l.routeConfig}}{}const Ni=new f.OlP("ROUTES");class $s{constructor(u,l,p,C){this.loader=u,this.compiler=l,this.onLoadStartListener=p,this.onLoadEndListener=C}load(u,l){if(l._loader$)return l._loader$;this.onLoadStartListener&&this.onLoadStartListener(l);const C=this.loadModuleFactory(l.loadChildren).pipe((0,_t.U)(b=>{this.onLoadEndListener&&this.onLoadEndListener(l);const R=b.create(u);return new Zr(nn(R.injector.get(Ni,void 0,f.XFs.Self|f.XFs.Optional)).map(v),R)}),(0,gn.K)(b=>{throw l._loader$=void 0,b}));return l._loader$=new ee(C,()=>new oe.x).pipe(lt()),l._loader$}loadModuleFactory(u){return"string"==typeof u?(0,Ce.Dp)(this.loader.load(u)):Tn(u()).pipe((0,rt.z)(l=>l instanceof f.YKP?(0,U.of)(l):(0,Ce.Dp)(this.compiler.compileModuleAsync(l))))}}class Wa{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.children=new Po,this.attachRef=null}}class Po{constructor(){this.contexts=new Map}onChildOutletCreated(u,l){const p=this.getOrCreateContext(u);p.outlet=l,this.contexts.set(u,p)}onChildOutletDestroyed(u){const l=this.getContext(u);l&&(l.outlet=null)}onOutletDeactivated(){const u=this.contexts;return this.contexts=new Map,u}onOutletReAttached(u){this.contexts=u}getOrCreateContext(u){let l=this.getContext(u);return l||(l=new Wa,this.contexts.set(u,l)),l}getContext(u){return this.contexts.get(u)||null}}class cu{shouldProcessUrl(u){return!0}extract(u){return u}merge(u,l){return u}}function du(d){throw d}function Hn(d,u,l){return u.parse("/")}function Kr(d,u){return(0,U.of)(null)}const Kt={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},fu={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let $n=(()=>{class d{constructor(l,p,C,b,R,k,z,be){this.rootComponentType=l,this.urlSerializer=p,this.rootContexts=C,this.location=b,this.config=be,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.disposed=!1,this.lastLocationChangeInfo=null,this.navigationId=0,this.currentPageId=0,this.isNgZoneEnabled=!1,this.events=new oe.x,this.errorHandler=du,this.malformedUriErrorHandler=Hn,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:Kr,afterPreactivation:Kr},this.urlHandlingStrategy=new cu,this.routeReuseStrategy=new Ri,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.canceledNavigationResolution="replace",this.ngModule=R.get(f.h0i),this.console=R.get(f.c2e);const Pt=R.get(f.R0b);this.isNgZoneEnabled=Pt instanceof f.R0b&&f.R0b.isInAngularZone(),this.resetConfig(be),this.currentUrlTree=new zn(new Xe([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new $s(k,z,Ct=>this.triggerEvent(new B(Ct)),Ct=>this.triggerEvent(new j(Ct))),this.routerState=Vn(this.currentUrlTree,this.rootComponentType),this.transitions=new te({id:0,targetPageId:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}get browserPageId(){var l;return null===(l=this.location.getState())||void 0===l?void 0:l.\u0275routerPageId}setupNavigations(l){const p=this.events;return l.pipe((0,q.h)(C=>0!==C.id),(0,_t.U)(C=>Object.assign(Object.assign({},C),{extractedUrl:this.urlHandlingStrategy.extract(C.rawUrl)})),ne(C=>{let b=!1,R=!1;return(0,U.of)(C).pipe(Tt(k=>{this.currentNavigation={id:k.id,initialUrl:k.currentRawUrl,extractedUrl:k.extractedUrl,trigger:k.source,extras:k.extras,previousNavigation:this.lastSuccessfulNavigation?Object.assign(Object.assign({},this.lastSuccessfulNavigation),{previousNavigation:null}):null}}),ne(k=>{const z=!this.navigated||k.extractedUrl.toString()!==this.browserUrlTree.toString(),be=("reload"===this.onSameUrlNavigation||z)&&this.urlHandlingStrategy.shouldProcessUrl(k.rawUrl);if(Pi(k.source)&&(this.browserUrlTree=k.rawUrl),be)return(0,U.of)(k).pipe(ne(Ue=>{const at=this.transitions.getValue();return p.next(new Cn(Ue.id,this.serializeUrl(Ue.extractedUrl),Ue.source,Ue.restoredState)),at!==this.transitions.getValue()?Y.E:Promise.resolve(Ue)}),function(d,u,l,p){return ne(C=>function(d,u,l,p,C){return new bn(d,u,l,p,C).apply()}(d,u,l,C.extractedUrl,p).pipe((0,_t.U)(b=>Object.assign(Object.assign({},C),{urlAfterRedirects:b}))))}(this.ngModule.injector,this.configLoader,this.urlSerializer,this.config),Tt(Ue=>{this.currentNavigation=Object.assign(Object.assign({},this.currentNavigation),{finalUrl:Ue.urlAfterRedirects})}),function(d,u,l,p,C){return(0,rt.z)(b=>function(d,u,l,p,C="emptyOnly",b="legacy"){try{const R=new iu(d,u,l,p,C,b).recognize();return null===R?Ii(new Us):(0,U.of)(R)}catch(R){return Ii(R)}}(d,u,b.urlAfterRedirects,l(b.urlAfterRedirects),p,C).pipe((0,_t.U)(R=>Object.assign(Object.assign({},b),{targetSnapshot:R}))))}(this.rootComponentType,this.config,Ue=>this.serializeUrl(Ue),this.paramsInheritanceStrategy,this.relativeLinkResolution),Tt(Ue=>{"eager"===this.urlUpdateStrategy&&(Ue.extras.skipLocationChange||this.setBrowserUrl(Ue.urlAfterRedirects,Ue),this.browserUrlTree=Ue.urlAfterRedirects);const at=new Nt(Ue.id,this.serializeUrl(Ue.extractedUrl),this.serializeUrl(Ue.urlAfterRedirects),Ue.targetSnapshot);p.next(at)}));if(z&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:at,extractedUrl:Pt,source:Ct,restoredState:yr,extras:or}=k,kr=new Cn(at,this.serializeUrl(Pt),Ct,yr);p.next(kr);const Ko=Vn(Pt,this.rootComponentType).snapshot;return(0,U.of)(Object.assign(Object.assign({},k),{targetSnapshot:Ko,urlAfterRedirects:Pt,extras:Object.assign(Object.assign({},or),{skipLocationChange:!1,replaceUrl:!1})}))}return this.rawUrlTree=k.rawUrl,this.browserUrlTree=k.urlAfterRedirects,k.resolve(null),Y.E}),di(k=>{const{targetSnapshot:z,id:be,extractedUrl:Ue,rawUrl:at,extras:{skipLocationChange:Pt,replaceUrl:Ct}}=k;return this.hooks.beforePreactivation(z,{navigationId:be,appliedUrlTree:Ue,rawUrlTree:at,skipLocationChange:!!Pt,replaceUrl:!!Ct})}),Tt(k=>{const z=new gt(k.id,this.serializeUrl(k.extractedUrl),this.serializeUrl(k.urlAfterRedirects),k.targetSnapshot);this.triggerEvent(z)}),(0,_t.U)(k=>Object.assign(Object.assign({},k),{guards:Ls(k.targetSnapshot,k.currentSnapshot,this.rootContexts)})),function(d,u){return(0,rt.z)(l=>{const{targetSnapshot:p,currentSnapshot:C,guards:{canActivateChecks:b,canDeactivateChecks:R}}=l;return 0===R.length&&0===b.length?(0,U.of)(Object.assign(Object.assign({},l),{guardsResult:!0})):function(d,u,l,p){return(0,Ce.Dp)(d).pipe((0,rt.z)(C=>function(d,u,l,p,C){const b=u&&u.routeConfig?u.routeConfig.canDeactivate:null;if(!b||0===b.length)return(0,U.of)(!0);const R=b.map(k=>{const z=Vs(k,u,C);let be;if(function(d){return d&&Sr(d.canDeactivate)}(z))be=Tn(z.canDeactivate(d,u,l,p));else{if(!Sr(z))throw new Error("Invalid CanDeactivate guard");be=Tn(z(d,u,l,p))}return be.pipe(Vt())});return(0,U.of)(R).pipe(gr())}(C.component,C.route,l,u,p)),Vt(C=>!0!==C,!0))}(R,p,C,d).pipe((0,rt.z)(k=>k&&function(d){return"boolean"==typeof d}(k)?function(d,u,l,p){return(0,Ce.Dp)(u).pipe((0,It.b)(C=>ae(function(d,u){return null!==d&&u&&u(new ue(d)),(0,U.of)(!0)}(C.route.parent,p),function(d,u){return null!==d&&u&&u(new Ne(d)),(0,U.of)(!0)}(C.route,p),function(d,u,l){const p=u[u.length-1],b=u.slice(0,u.length-1).reverse().map(R=>function(d){const u=d.routeConfig?d.routeConfig.canActivateChild:null;return u&&0!==u.length?{node:d,guards:u}:null}(R)).filter(R=>null!==R).map(R=>Ye(()=>{const k=R.guards.map(z=>{const be=Vs(z,R.node,l);let Ue;if(function(d){return d&&Sr(d.canActivateChild)}(be))Ue=Tn(be.canActivateChild(p,d));else{if(!Sr(be))throw new Error("Invalid CanActivateChild guard");Ue=Tn(be(p,d))}return Ue.pipe(Vt())});return(0,U.of)(k).pipe(gr())}));return(0,U.of)(b).pipe(gr())}(d,C.path,l),function(d,u,l){const p=u.routeConfig?u.routeConfig.canActivate:null;if(!p||0===p.length)return(0,U.of)(!0);const C=p.map(b=>Ye(()=>{const R=Vs(b,u,l);let k;if(function(d){return d&&Sr(d.canActivate)}(R))k=Tn(R.canActivate(u,d));else{if(!Sr(R))throw new Error("Invalid CanActivate guard");k=Tn(R(u,d))}return k.pipe(Vt())}));return(0,U.of)(C).pipe(gr())}(d,C.route,l))),Vt(C=>!0!==C,!0))}(p,b,d,u):(0,U.of)(k)),(0,_t.U)(k=>Object.assign(Object.assign({},l),{guardsResult:k})))})}(this.ngModule.injector,k=>this.triggerEvent(k)),Tt(k=>{if(Or(k.guardsResult)){const be=bt(`Redirecting to "${this.serializeUrl(k.guardsResult)}"`);throw be.url=k.guardsResult,be}const z=new tr(k.id,this.serializeUrl(k.extractedUrl),this.serializeUrl(k.urlAfterRedirects),k.targetSnapshot,!!k.guardsResult);this.triggerEvent(z)}),(0,q.h)(k=>!!k.guardsResult||(this.restoreHistory(k),this.cancelNavigationTransition(k,""),!1)),di(k=>{if(k.guards.canActivateChecks.length)return(0,U.of)(k).pipe(Tt(z=>{const be=new Io(z.id,this.serializeUrl(z.extractedUrl),this.serializeUrl(z.urlAfterRedirects),z.targetSnapshot);this.triggerEvent(be)}),ne(z=>{let be=!1;return(0,U.of)(z).pipe(function(d,u){return(0,rt.z)(l=>{const{targetSnapshot:p,guards:{canActivateChecks:C}}=l;if(!C.length)return(0,U.of)(l);let b=0;return(0,Ce.Dp)(C).pipe((0,It.b)(R=>function(d,u,l,p){return function(d,u,l,p){const C=Object.keys(d);if(0===C.length)return(0,U.of)({});const b={};return(0,Ce.Dp)(C).pipe((0,rt.z)(R=>function(d,u,l,p){const C=Vs(d,u,p);return Tn(C.resolve?C.resolve(u,l):C(u,l))}(d[R],u,l,p).pipe(Tt(k=>{b[R]=k}))),Me(1),(0,rt.z)(()=>Object.keys(b).length===C.length?(0,U.of)(b):Y.E))}(d._resolve,d,u,p).pipe((0,_t.U)(b=>(d._resolvedData=b,d.data=Object.assign(Object.assign({},d.data),Mt(d,l).resolve),null)))}(R.route,p,d,u)),Tt(()=>b++),Me(1),(0,rt.z)(R=>b===C.length?(0,U.of)(l):Y.E))})}(this.paramsInheritanceStrategy,this.ngModule.injector),Tt({next:()=>be=!0,complete:()=>{be||(this.restoreHistory(z),this.cancelNavigationTransition(z,"At least one route resolver didn't emit any value."))}}))}),Tt(z=>{const be=new se(z.id,this.serializeUrl(z.extractedUrl),this.serializeUrl(z.urlAfterRedirects),z.targetSnapshot);this.triggerEvent(be)}))}),di(k=>{const{targetSnapshot:z,id:be,extractedUrl:Ue,rawUrl:at,extras:{skipLocationChange:Pt,replaceUrl:Ct}}=k;return this.hooks.afterPreactivation(z,{navigationId:be,appliedUrlTree:Ue,rawUrlTree:at,skipLocationChange:!!Pt,replaceUrl:!!Ct})}),(0,_t.U)(k=>{const z=function(d,u,l){const p=Mr(d,u._root,l?l._root:void 0);return new Bt(p,u)}(this.routeReuseStrategy,k.targetSnapshot,k.currentRouterState);return Object.assign(Object.assign({},k),{targetRouterState:z})}),Tt(k=>{this.currentUrlTree=k.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,k.rawUrl),this.routerState=k.targetRouterState,"deferred"===this.urlUpdateStrategy&&(k.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,k),this.browserUrlTree=k.urlAfterRedirects)}),((d,u,l)=>(0,_t.U)(p=>(new Go(u,p.targetRouterState,p.currentRouterState,l).activate(d),p)))(this.rootContexts,this.routeReuseStrategy,k=>this.triggerEvent(k)),Tt({next(){b=!0},complete(){b=!0}}),function(d){return(0,je.e)(function(u,l){try{u.subscribe(l)}finally{l.add(d)}})}(()=>{if(!b&&!R){const k=`Navigation ID ${C.id} is not equal to the current navigation id ${this.navigationId}`;"replace"===this.canceledNavigationResolution?(this.restoreHistory(C),this.cancelNavigationTransition(C,k)):this.cancelNavigationTransition(C,k)}this.currentNavigation=null}),(0,gn.K)(k=>{if(R=!0,function(d){return d&&d[Gn]}(k)){const z=Or(k.url);z||(this.navigated=!0,this.restoreHistory(C,!0));const be=new kt(C.id,this.serializeUrl(C.extractedUrl),k.message);p.next(be),z?setTimeout(()=>{const Ue=this.urlHandlingStrategy.merge(k.url,this.rawUrlTree),at={skipLocationChange:C.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||Pi(C.source)};this.scheduleNavigation(Ue,"imperative",null,at,{resolve:C.resolve,reject:C.reject,promise:C.promise})},0):C.resolve(!1)}else{this.restoreHistory(C,!0);const z=new fo(C.id,this.serializeUrl(C.extractedUrl),k);p.next(z);try{C.resolve(this.errorHandler(k))}catch(be){C.reject(be)}}return Y.E}))}))}resetRootComponentType(l){this.rootComponentType=l,this.routerState.root.component=this.rootComponentType}getTransition(){const l=this.transitions.value;return l.urlAfterRedirects=this.browserUrlTree,l}setTransition(l){this.transitions.next(Object.assign(Object.assign({},this.getTransition()),l))}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(l=>{const p=this.extractLocationChangeInfoFromEvent(l);this.shouldScheduleNavigation(this.lastLocationChangeInfo,p)&&setTimeout(()=>{const{source:C,state:b,urlTree:R}=p,k={replaceUrl:!0};if(b){const z=Object.assign({},b);delete z.navigationId,delete z.\u0275routerPageId,0!==Object.keys(z).length&&(k.state=z)}this.scheduleNavigation(R,C,b,k)},0),this.lastLocationChangeInfo=p}))}extractLocationChangeInfoFromEvent(l){var p;return{source:"popstate"===l.type?"popstate":"hashchange",urlTree:this.parseUrl(l.url),state:(null===(p=l.state)||void 0===p?void 0:p.navigationId)?l.state:null,transitionId:this.getTransition().id}}shouldScheduleNavigation(l,p){if(!l)return!0;const C=p.urlTree.toString()===l.urlTree.toString();return p.transitionId!==l.transitionId||!C||!("hashchange"===p.source&&"popstate"===l.source||"popstate"===p.source&&"hashchange"===l.source)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(l){this.events.next(l)}resetConfig(l){go(l),this.config=l.map(v),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.transitions.complete(),this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0),this.disposed=!0}createUrlTree(l,p={}){const{relativeTo:C,queryParams:b,fragment:R,queryParamsHandling:k,preserveFragment:z}=p,be=C||this.routerState.root,Ue=z?this.currentUrlTree.fragment:R;let at=null;switch(k){case"merge":at=Object.assign(Object.assign({},this.currentUrlTree.queryParams),b);break;case"preserve":at=this.currentUrlTree.queryParams;break;default:at=b||null}return null!==at&&(at=this.removeEmptyProps(at)),function(d,u,l,p,C){if(0===l.length)return x(u.root,u.root,u,p,C);const b=function(d){if("string"==typeof d[0]&&1===d.length&&"/"===d[0])return new F(!0,0,d);let u=0,l=!1;const p=d.reduce((C,b,R)=>{if("object"==typeof b&&null!=b){if(b.outlets){const k={};return tt(b.outlets,(z,be)=>{k[be]="string"==typeof z?z.split("/"):z}),[...C,{outlets:k}]}if(b.segmentPath)return[...C,b.segmentPath]}return"string"!=typeof b?[...C,b]:0===R?(b.split("/").forEach((k,z)=>{0==z&&"."===k||(0==z&&""===k?l=!0:".."===k?u++:""!=k&&C.push(k))}),C):[...C,b]},[]);return new F(l,u,p)}(l);if(b.toRoot())return x(u.root,new Xe([],{}),u,p,C);const R=function(d,u,l){if(d.isAbsolute)return new Re(u.root,!0,0);if(-1===l.snapshot._lastPathIndex){const b=l.snapshot._urlSegment;return new Re(b,b===u.root,0)}const p=Qn(d.commands[0])?0:1;return function(d,u,l){let p=d,C=u,b=l;for(;b>C;){if(b-=C,p=p.parent,!p)throw new Error("Invalid number of '../'");C=p.segments.length}return new Re(p,!1,C-b)}(l.snapshot._urlSegment,l.snapshot._lastPathIndex+p,d.numberOfDoubleDots)}(b,u,d),k=R.processChildren?yn(R.segmentGroup,R.index,b.commands):Bn(R.segmentGroup,R.index,b.commands);return x(R.segmentGroup,k,u,p,C)}(be,this.currentUrlTree,l,at,null!=Ue?Ue:null)}navigateByUrl(l,p={skipLocationChange:!1}){const C=Or(l)?l:this.parseUrl(l),b=this.urlHandlingStrategy.merge(C,this.rawUrlTree);return this.scheduleNavigation(b,"imperative",null,p)}navigate(l,p={skipLocationChange:!1}){return function(d){for(let u=0;u<d.length;u++){const l=d[u];if(null==l)throw new Error(`The requested path contains ${l} segment at index ${u}`)}}(l),this.navigateByUrl(this.createUrlTree(l,p),p)}serializeUrl(l){return this.urlSerializer.serialize(l)}parseUrl(l){let p;try{p=this.urlSerializer.parse(l)}catch(C){p=this.malformedUriErrorHandler(C,this.urlSerializer,l)}return p}isActive(l,p){let C;if(C=!0===p?Object.assign({},Kt):!1===p?Object.assign({},fu):p,Or(l))return ur(this.currentUrlTree,l,C);const b=this.parseUrl(l);return ur(this.currentUrlTree,b,C)}removeEmptyProps(l){return Object.keys(l).reduce((p,C)=>{const b=l[C];return null!=b&&(p[C]=b),p},{})}processNavigations(){this.navigations.subscribe(l=>{this.navigated=!0,this.lastSuccessfulId=l.id,this.currentPageId=l.targetPageId,this.events.next(new xn(l.id,this.serializeUrl(l.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,l.resolve(!0)},l=>{this.console.warn("Unhandled Navigation Error: ")})}scheduleNavigation(l,p,C,b,R){var k,z;if(this.disposed)return Promise.resolve(!1);const be=this.getTransition(),Ue=Pi(p)&&be&&!Pi(be.source),Ct=(this.lastSuccessfulId===be.id||this.currentNavigation?be.rawUrl:be.urlAfterRedirects).toString()===l.toString();if(Ue&&Ct)return Promise.resolve(!0);let yr,or,kr;R?(yr=R.resolve,or=R.reject,kr=R.promise):kr=new Promise((ir,Hi)=>{yr=ir,or=Hi});const Ko=++this.navigationId;let Fo;return"computed"===this.canceledNavigationResolution?(0===this.currentPageId&&(C=this.location.getState()),Fo=C&&C.\u0275routerPageId?C.\u0275routerPageId:b.replaceUrl||b.skipLocationChange?null!==(k=this.browserPageId)&&void 0!==k?k:0:(null!==(z=this.browserPageId)&&void 0!==z?z:0)+1):Fo=0,this.setTransition({id:Ko,targetPageId:Fo,source:p,restoredState:C,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:l,extras:b,resolve:yr,reject:or,promise:kr,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),kr.catch(ir=>Promise.reject(ir))}setBrowserUrl(l,p){const C=this.urlSerializer.serialize(l),b=Object.assign(Object.assign({},p.extras.state),this.generateNgRouterState(p.id,p.targetPageId));this.location.isCurrentPathEqualTo(C)||p.extras.replaceUrl?this.location.replaceState(C,"",b):this.location.go(C,"",b)}restoreHistory(l,p=!1){var C,b;if("computed"===this.canceledNavigationResolution){const R=this.currentPageId-l.targetPageId;"popstate"!==l.source&&"eager"!==this.urlUpdateStrategy&&this.currentUrlTree!==(null===(C=this.currentNavigation)||void 0===C?void 0:C.finalUrl)||0===R?this.currentUrlTree===(null===(b=this.currentNavigation)||void 0===b?void 0:b.finalUrl)&&0===R&&(this.resetState(l),this.browserUrlTree=l.currentUrlTree,this.resetUrlToCurrentUrlTree()):this.location.historyGo(R)}else"replace"===this.canceledNavigationResolution&&(p&&this.resetState(l),this.resetUrlToCurrentUrlTree())}resetState(l){this.routerState=l.currentRouterState,this.currentUrlTree=l.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,l.rawUrl)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}cancelNavigationTransition(l,p){const C=new kt(l.id,this.serializeUrl(l.extractedUrl),p);this.triggerEvent(C),l.resolve(!1)}generateNgRouterState(l,p){return"computed"===this.canceledNavigationResolution?{navigationId:l,\u0275routerPageId:p}:{navigationId:l}}}return d.\u0275fac=function(l){return new(l||d)(f.LFG(f.DyG),f.LFG(_n),f.LFG(Po),f.LFG(_.Ye),f.LFG(f.zs3),f.LFG(f.v3s),f.LFG(f.Sil),f.LFG(void 0))},d.\u0275prov=f.Yz7({token:d,factory:d.\u0275fac}),d})();function Pi(d){return"imperative"!==d}let Fi=(()=>{class d{constructor(l,p,C,b,R){this.router=l,this.route=p,this.commands=[],this.onChanges=new oe.x,null==C&&b.setAttribute(R.nativeElement,"tabindex","0")}ngOnChanges(l){this.onChanges.next(this)}set routerLink(l){this.commands=null!=l?Array.isArray(l)?l:[l]:[]}onClick(){const l={skipLocationChange:Jr(this.skipLocationChange),replaceUrl:Jr(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,l),!0}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:Jr(this.preserveFragment)})}}return d.\u0275fac=function(l){return new(l||d)(f.Y36($n),f.Y36(jt),f.$8M("tabindex"),f.Y36(f.Qsj),f.Y36(f.SBq))},d.\u0275dir=f.lG2({type:d,selectors:[["","routerLink","",5,"a",5,"area"]],hostBindings:function(l,p){1&l&&f.NdJ("click",function(){return p.onClick()})},inputs:{routerLink:"routerLink",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state",relativeTo:"relativeTo"},features:[f.TTD]}),d})(),ki=(()=>{class d{constructor(l,p,C){this.router=l,this.route=p,this.locationStrategy=C,this.commands=[],this.onChanges=new oe.x,this.subscription=l.events.subscribe(b=>{b instanceof xn&&this.updateTargetUrlAndHref()})}set routerLink(l){this.commands=null!=l?Array.isArray(l)?l:[l]:[]}ngOnChanges(l){this.updateTargetUrlAndHref(),this.onChanges.next(this)}ngOnDestroy(){this.subscription.unsubscribe()}onClick(l,p,C,b,R){if(0!==l||p||C||b||R||"string"==typeof this.target&&"_self"!=this.target)return!0;const k={skipLocationChange:Jr(this.skipLocationChange),replaceUrl:Jr(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,k),!1}updateTargetUrlAndHref(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:Jr(this.preserveFragment)})}}return d.\u0275fac=function(l){return new(l||d)(f.Y36($n),f.Y36(jt),f.Y36(_.S$))},d.\u0275dir=f.lG2({type:d,selectors:[["a","routerLink",""],["area","routerLink",""]],hostVars:2,hostBindings:function(l,p){1&l&&f.NdJ("click",function(b){return p.onClick(b.button,b.ctrlKey,b.shiftKey,b.altKey,b.metaKey)}),2&l&&(f.Ikx("href",p.href,f.LSH),f.uIk("target",p.target))},inputs:{routerLink:"routerLink",target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state",relativeTo:"relativeTo"},features:[f.TTD]}),d})();function Jr(d){return""===d||!!d}let fi=(()=>{class d{constructor(l,p,C,b,R,k){this.router=l,this.element=p,this.renderer=C,this.cdr=b,this.link=R,this.linkWithHref=k,this.classes=[],this.isActive=!1,this.routerLinkActiveOptions={exact:!1},this.routerEventsSubscription=l.events.subscribe(z=>{z instanceof xn&&this.update()})}ngAfterContentInit(){(0,U.of)(this.links.changes,this.linksWithHrefs.changes,(0,U.of)(null)).pipe((0,Ge.J)()).subscribe(l=>{this.update(),this.subscribeToEachLinkOnChanges()})}subscribeToEachLinkOnChanges(){var l;null===(l=this.linkInputChangesSubscription)||void 0===l||l.unsubscribe();const p=[...this.links.toArray(),...this.linksWithHrefs.toArray(),this.link,this.linkWithHref].filter(C=>!!C).map(C=>C.onChanges);this.linkInputChangesSubscription=(0,Ce.Dp)(p).pipe((0,Ge.J)()).subscribe(C=>{this.isActive!==this.isLinkActive(this.router)(C)&&this.update()})}set routerLinkActive(l){const p=Array.isArray(l)?l:l.split(" ");this.classes=p.filter(C=>!!C)}ngOnChanges(l){this.update()}ngOnDestroy(){var l;this.routerEventsSubscription.unsubscribe(),null===(l=this.linkInputChangesSubscription)||void 0===l||l.unsubscribe()}update(){!this.links||!this.linksWithHrefs||!this.router.navigated||Promise.resolve().then(()=>{const l=this.hasActiveLinks();this.isActive!==l&&(this.isActive=l,this.cdr.markForCheck(),this.classes.forEach(p=>{l?this.renderer.addClass(this.element.nativeElement,p):this.renderer.removeClass(this.element.nativeElement,p)}))})}isLinkActive(l){const p=function(d){return!!d.paths}(this.routerLinkActiveOptions)?this.routerLinkActiveOptions:this.routerLinkActiveOptions.exact||!1;return C=>l.isActive(C.urlTree,p)}hasActiveLinks(){const l=this.isLinkActive(this.router);return this.link&&l(this.link)||this.linkWithHref&&l(this.linkWithHref)||this.links.some(l)||this.linksWithHrefs.some(l)}}return d.\u0275fac=function(l){return new(l||d)(f.Y36($n),f.Y36(f.SBq),f.Y36(f.Qsj),f.Y36(f.sBO),f.Y36(Fi,8),f.Y36(ki,8))},d.\u0275dir=f.lG2({type:d,selectors:[["","routerLinkActive",""]],contentQueries:function(l,p,C){if(1&l&&(f.Suo(C,Fi,5),f.Suo(C,ki,5)),2&l){let b;f.iGM(b=f.CRH())&&(p.links=b),f.iGM(b=f.CRH())&&(p.linksWithHrefs=b)}},inputs:{routerLinkActiveOptions:"routerLinkActiveOptions",routerLinkActive:"routerLinkActive"},exportAs:["routerLinkActive"],features:[f.TTD]}),d})(),hi=(()=>{class d{constructor(l,p,C,b,R){this.parentContexts=l,this.location=p,this.resolver=C,this.changeDetector=R,this.activated=null,this._activatedRoute=null,this.activateEvents=new f.vpe,this.deactivateEvents=new f.vpe,this.name=b||Oe,l.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const l=this.parentContexts.getContext(this.name);l&&l.route&&(l.attachRef?this.attach(l.attachRef,l.route):this.activateWith(l.route,l.resolver||null))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();const l=this.activated;return this.activated=null,this._activatedRoute=null,l}attach(l,p){this.activated=l,this._activatedRoute=p,this.location.insert(l.hostView)}deactivate(){if(this.activated){const l=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(l)}}activateWith(l,p){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=l;const R=(p=p||this.resolver).resolveComponentFactory(l._futureSnapshot.routeConfig.component),k=this.parentContexts.getOrCreateContext(this.name).children,z=new Ya(l,k,this.location.injector);this.activated=this.location.createComponent(R,this.location.length,z),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return d.\u0275fac=function(l){return new(l||d)(f.Y36(Po),f.Y36(f.s_b),f.Y36(f._Vd),f.$8M("name"),f.Y36(f.sBO))},d.\u0275dir=f.lG2({type:d,selectors:[["router-outlet"]],outputs:{activateEvents:"activate",deactivateEvents:"deactivate"},exportAs:["outlet"]}),d})();class Ya{constructor(u,l,p){this.route=u,this.childContexts=l,this.parent=p}get(u,l){return u===jt?this.route:u===Po?this.childContexts:this.parent.get(u,l)}}class Za{}class qo{preload(u,l){return(0,U.of)(null)}}let qa=(()=>{class d{constructor(l,p,C,b,R){this.router=l,this.injector=b,this.preloadingStrategy=R,this.loader=new $s(p,C,be=>l.triggerEvent(new B(be)),be=>l.triggerEvent(new j(be)))}setUpPreloading(){this.subscription=this.router.events.pipe((0,q.h)(l=>l instanceof xn),(0,It.b)(()=>this.preload())).subscribe(()=>{})}preload(){const l=this.injector.get(f.h0i);return this.processRoutes(l,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(l,p){const C=[];for(const b of p)if(b.loadChildren&&!b.canLoad&&b._loadedConfig){const R=b._loadedConfig;C.push(this.processRoutes(R.module,R.routes))}else b.loadChildren&&!b.canLoad?C.push(this.preloadConfig(l,b)):b.children&&C.push(this.processRoutes(l,b.children));return(0,Ce.Dp)(C).pipe((0,Ge.J)(),(0,_t.U)(b=>{}))}preloadConfig(l,p){return this.preloadingStrategy.preload(p,()=>(p._loadedConfig?(0,U.of)(p._loadedConfig):this.loader.load(l.injector,p)).pipe((0,rt.z)(b=>(p._loadedConfig=b,this.processRoutes(b.module,b.routes)))))}}return d.\u0275fac=function(l){return new(l||d)(f.LFG($n),f.LFG(f.v3s),f.LFG(f.Sil),f.LFG(f.zs3),f.LFG(Za))},d.\u0275prov=f.Yz7({token:d,factory:d.\u0275fac}),d})(),Gs=(()=>{class d{constructor(l,p,C={}){this.router=l,this.viewportScroller=p,this.options=C,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},C.scrollPositionRestoration=C.scrollPositionRestoration||"disabled",C.anchorScrolling=C.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(l=>{l instanceof Cn?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=l.navigationTrigger,this.restoredId=l.restoredState?l.restoredState.navigationId:0):l instanceof xn&&(this.lastId=l.id,this.scheduleScrollEvent(l,this.router.parseUrl(l.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(l=>{l instanceof xe&&(l.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(l.position):l.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(l.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(l,p){this.router.triggerEvent(new xe(l,"popstate"===this.lastSource?this.store[this.restoredId]:null,p))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return d.\u0275fac=function(l){return new(l||d)(f.LFG($n),f.LFG(_.EM),f.LFG(void 0))},d.\u0275prov=f.Yz7({token:d,factory:d.\u0275fac}),d})();const Xr=new f.OlP("ROUTER_CONFIGURATION"),Qa=new f.OlP("ROUTER_FORROOT_GUARD"),tf=[_.Ye,{provide:_n,useClass:zr},{provide:$n,useFactory:function(d,u,l,p,C,b,R,k={},z,be){const Ue=new $n(null,d,u,l,p,C,b,nn(R));return z&&(Ue.urlHandlingStrategy=z),be&&(Ue.routeReuseStrategy=be),function(d,u){d.errorHandler&&(u.errorHandler=d.errorHandler),d.malformedUriErrorHandler&&(u.malformedUriErrorHandler=d.malformedUriErrorHandler),d.onSameUrlNavigation&&(u.onSameUrlNavigation=d.onSameUrlNavigation),d.paramsInheritanceStrategy&&(u.paramsInheritanceStrategy=d.paramsInheritanceStrategy),d.relativeLinkResolution&&(u.relativeLinkResolution=d.relativeLinkResolution),d.urlUpdateStrategy&&(u.urlUpdateStrategy=d.urlUpdateStrategy)}(k,Ue),k.enableTracing&&Ue.events.subscribe(at=>{var Pt,Ct;null===(Pt=console.group)||void 0===Pt||Pt.call(console,`Router Event: ${at.constructor.name}`),console.log(at.toString()),console.log(at),null===(Ct=console.groupEnd)||void 0===Ct||Ct.call(console)}),Ue},deps:[_n,Po,_.Ye,f.zs3,f.v3s,f.Sil,Ni,Xr,[class{},new f.FiY],[class{},new f.FiY]]},Po,{provide:jt,useFactory:function(d){return d.routerState.root},deps:[$n]},{provide:f.v3s,useClass:f.EAV},qa,qo,class{preload(u,l){return l().pipe((0,gn.K)(()=>(0,U.of)(null)))}},{provide:Xr,useValue:{enableTracing:!1}}];function nf(){return new f.PXZ("Router",$n)}let Ui=(()=>{class d{constructor(l,p){}static forRoot(l,p){return{ngModule:d,providers:[tf,Ws(l),{provide:Qa,useFactory:Bi,deps:[[$n,new f.FiY,new f.tp0]]},{provide:Xr,useValue:p||{}},{provide:_.S$,useFactory:zs,deps:[_.lw,[new f.tBr(_.mr),new f.FiY],Xr]},{provide:Gs,useFactory:Ka,deps:[$n,_.EM,Xr]},{provide:Za,useExisting:p&&p.preloadingStrategy?p.preloadingStrategy:qo},{provide:f.PXZ,multi:!0,useFactory:nf},[_o,{provide:f.ip1,multi:!0,useFactory:Ys,deps:[_o]},{provide:mu,useFactory:ji,deps:[_o]},{provide:f.tb,multi:!0,useExisting:mu}]]}}static forChild(l){return{ngModule:d,providers:[Ws(l)]}}}return d.\u0275fac=function(l){return new(l||d)(f.LFG(Qa,8),f.LFG($n,8))},d.\u0275mod=f.oAB({type:d}),d.\u0275inj=f.cJS({}),d})();function Ka(d,u,l){return l.scrollOffset&&u.setOffset(l.scrollOffset),new Gs(d,u,l)}function zs(d,u,l={}){return l.useHash?new _.Do(d,u):new _.b0(d,u)}function Bi(d){return"guarded"}function Ws(d){return[{provide:f.deG,multi:!0,useValue:d},{provide:Ni,multi:!0,useValue:d}]}let _o=(()=>{class d{constructor(l){this.injector=l,this.initNavigation=!1,this.destroyed=!1,this.resultOfPreactivationDone=new oe.x}appInitializer(){return this.injector.get(_.V_,Promise.resolve(null)).then(()=>{if(this.destroyed)return Promise.resolve(!0);let p=null;const C=new Promise(k=>p=k),b=this.injector.get($n),R=this.injector.get(Xr);return"disabled"===R.initialNavigation?(b.setUpLocationChangeListener(),p(!0)):"enabled"===R.initialNavigation||"enabledBlocking"===R.initialNavigation?(b.hooks.afterPreactivation=()=>this.initNavigation?(0,U.of)(null):(this.initNavigation=!0,p(!0),this.resultOfPreactivationDone),b.initialNavigation()):p(!0),C})}bootstrapListener(l){const p=this.injector.get(Xr),C=this.injector.get(qa),b=this.injector.get(Gs),R=this.injector.get($n),k=this.injector.get(f.z2F);l===k.components[0]&&(("enabledNonBlocking"===p.initialNavigation||void 0===p.initialNavigation)&&R.initialNavigation(),C.setUpPreloading(),b.init(),R.resetRootComponentType(k.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}ngOnDestroy(){this.destroyed=!0}}return d.\u0275fac=function(l){return new(l||d)(f.LFG(f.zs3))},d.\u0275prov=f.Yz7({token:d,factory:d.\u0275fac}),d})();function Ys(d){return d.appInitializer.bind(d)}function ji(d){return d.bootstrapListener.bind(d)}const mu=new f.OlP("Router Initializer")},1776:(st,we,N)=>{"use strict";N.d(we,{y:()=>Ie});var _=N(4111),f=N(8839),me=N(8794),oe=N(2738);function fe(ge){return 0===ge.length?oe.y:1===ge.length?ge[0]:function(he){return ge.reduce(function($e,Ae){return Ae($e)},he)}}var Z=N(6806),Ce=N(8853),ke=N(4112),Ie=function(){function ge(Se){Se&&(this._subscribe=Se)}return ge.prototype.lift=function(Se){var he=new ge;return he.source=this,he.operator=Se,he},ge.prototype.subscribe=function(Se,he,$e){var Ae=this,Ge=function(ge){return ge&&ge instanceof _.Lv||function(ge){return ge&&(0,Ce.m)(ge.next)&&(0,Ce.m)(ge.error)&&(0,Ce.m)(ge.complete)}(ge)&&(0,f.Nn)(ge)}(Se)?Se:new _.Hp(Se,he,$e);return(0,ke.x)(function(){var Pe=Ae.operator,ae=Ae.source;Ge.add(Pe?Pe.call(Ge,ae):ae?Ae._subscribe(Ge):Ae._trySubscribe(Ge))}),Ge},ge.prototype._trySubscribe=function(Se){try{return this._subscribe(Se)}catch(he){Se.error(he)}},ge.prototype.forEach=function(Se,he){var $e=this;return new(he=Ee(he))(function(Ae,Ge){var ze;ze=$e.subscribe(function(Pe){try{Se(Pe)}catch(ae){Ge(ae),null==ze||ze.unsubscribe()}},Ge,Ae)})},ge.prototype._subscribe=function(Se){var he;return null===(he=this.source)||void 0===he?void 0:he.subscribe(Se)},ge.prototype[me.L]=function(){return this},ge.prototype.pipe=function(){for(var Se=[],he=0;he<arguments.length;he++)Se[he]=arguments[he];return fe(Se)(this)},ge.prototype.toPromise=function(Se){var he=this;return new(Se=Ee(Se))(function($e,Ae){var Ge;he.subscribe(function(ze){return Ge=ze},function(ze){return Ae(ze)},function(){return $e(Ge)})})},ge.create=function(Se){return new ge(Se)},ge}();function Ee(ge){var Se;return null!==(Se=null!=ge?ge:Z.v.Promise)&&void 0!==Se?Se:Promise}},6889:(st,we,N)=>{"use strict";N.d(we,{x:()=>Ce});var _=N(9162),f=N(1776),me=N(8839),te=(0,N(3864).d)(function(Ie){return function(){Ie(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),fe=N(5850),Z=N(4112),Ce=function(Ie){function Ee(){var ie=Ie.call(this)||this;return ie.closed=!1,ie.observers=[],ie.isStopped=!1,ie.hasError=!1,ie.thrownError=null,ie}return(0,_.ZT)(Ee,Ie),Ee.prototype.lift=function(ie){var _e=new ke(this,this);return _e.operator=ie,_e},Ee.prototype._throwIfClosed=function(){if(this.closed)throw new te},Ee.prototype.next=function(ie){var _e=this;(0,Z.x)(function(){var ge,Se;if(_e._throwIfClosed(),!_e.isStopped){var he=_e.observers.slice();try{for(var $e=(0,_.XA)(he),Ae=$e.next();!Ae.done;Ae=$e.next())Ae.value.next(ie)}catch(ze){ge={error:ze}}finally{try{Ae&&!Ae.done&&(Se=$e.return)&&Se.call($e)}finally{if(ge)throw ge.error}}}})},Ee.prototype.error=function(ie){var _e=this;(0,Z.x)(function(){if(_e._throwIfClosed(),!_e.isStopped){_e.hasError=_e.isStopped=!0,_e.thrownError=ie;for(var ge=_e.observers;ge.length;)ge.shift().error(ie)}})},Ee.prototype.complete=function(){var ie=this;(0,Z.x)(function(){if(ie._throwIfClosed(),!ie.isStopped){ie.isStopped=!0;for(var _e=ie.observers;_e.length;)_e.shift().complete()}})},Ee.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(Ee.prototype,"observed",{get:function(){var ie;return(null===(ie=this.observers)||void 0===ie?void 0:ie.length)>0},enumerable:!1,configurable:!0}),Ee.prototype._trySubscribe=function(ie){return this._throwIfClosed(),Ie.prototype._trySubscribe.call(this,ie)},Ee.prototype._subscribe=function(ie){return this._throwIfClosed(),this._checkFinalizedStatuses(ie),this._innerSubscribe(ie)},Ee.prototype._innerSubscribe=function(ie){var he=this.observers;return this.hasError||this.isStopped?me.Lc:(he.push(ie),new me.w0(function(){return(0,fe.P)(he,ie)}))},Ee.prototype._checkFinalizedStatuses=function(ie){var he=this.isStopped;this.hasError?ie.error(this.thrownError):he&&ie.complete()},Ee.prototype.asObservable=function(){var ie=new f.y;return ie.source=this,ie},Ee.create=function(ie,_e){return new ke(ie,_e)},Ee}(f.y),ke=function(Ie){function Ee(ie,_e){var ge=Ie.call(this)||this;return ge.destination=ie,ge.source=_e,ge}return(0,_.ZT)(Ee,Ie),Ee.prototype.next=function(ie){var _e,ge;null===(ge=null===(_e=this.destination)||void 0===_e?void 0:_e.next)||void 0===ge||ge.call(_e,ie)},Ee.prototype.error=function(ie){var _e,ge;null===(ge=null===(_e=this.destination)||void 0===_e?void 0:_e.error)||void 0===ge||ge.call(_e,ie)},Ee.prototype.complete=function(){var ie,_e;null===(_e=null===(ie=this.destination)||void 0===ie?void 0:ie.complete)||void 0===_e||_e.call(ie)},Ee.prototype._subscribe=function(ie){var _e,ge;return null!==(ge=null===(_e=this.source)||void 0===_e?void 0:_e.subscribe(ie))&&void 0!==ge?ge:me.Lc},Ee}(Ce)},4111:(st,we,N)=>{"use strict";N.d(we,{Hp:()=>ge,Lv:()=>_e});var _=N(9162),f=N(8853),me=N(8839),oe=N(6806),te=N(8550);function fe(){}var Z=Ie("C",void 0,void 0);function Ie(Ge,ze,Pe){return{kind:Ge,value:ze,error:Pe}}var Ee=N(9385),ie=N(4112),_e=function(Ge){function ze(Pe){var ae=Ge.call(this)||this;return ae.isStopped=!1,Pe?(ae.destination=Pe,(0,me.Nn)(Pe)&&Pe.add(ae)):ae.destination=Ae,ae}return(0,_.ZT)(ze,Ge),ze.create=function(Pe,ae,Ye){return new ge(Pe,ae,Ye)},ze.prototype.next=function(Pe){this.isStopped?$e(function(Ge){return Ie("N",Ge,void 0)}(Pe),this):this._next(Pe)},ze.prototype.error=function(Pe){this.isStopped?$e(function(Ge){return Ie("E",void 0,Ge)}(Pe),this):(this.isStopped=!0,this._error(Pe))},ze.prototype.complete=function(){this.isStopped?$e(Z,this):(this.isStopped=!0,this._complete())},ze.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,Ge.prototype.unsubscribe.call(this),this.destination=null)},ze.prototype._next=function(Pe){this.destination.next(Pe)},ze.prototype._error=function(Pe){try{this.destination.error(Pe)}finally{this.unsubscribe()}},ze.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},ze}(me.w0),ge=function(Ge){function ze(Pe,ae,Ye){var je,Dt=Ge.call(this)||this;if((0,f.m)(Pe))je=Pe;else if(Pe){var lt;je=Pe.next,ae=Pe.error,Ye=Pe.complete,Dt&&oe.v.useDeprecatedNextContext?(lt=Object.create(Pe)).unsubscribe=function(){return Dt.unsubscribe()}:lt=Pe,je=null==je?void 0:je.bind(lt),ae=null==ae?void 0:ae.bind(lt),Ye=null==Ye?void 0:Ye.bind(lt)}return Dt.destination={next:je?Se(je):fe,error:Se(null!=ae?ae:he),complete:Ye?Se(Ye):fe},Dt}return(0,_.ZT)(ze,Ge),ze}(_e);function Se(Ge,ze){return function(){for(var Pe=[],ae=0;ae<arguments.length;ae++)Pe[ae]=arguments[ae];try{Ge.apply(void 0,(0,_.ev)([],(0,_.CR)(Pe)))}catch(Ye){oe.v.useDeprecatedSynchronousErrorHandling?(0,ie.O)(Ye):(0,te.h)(Ye)}}}function he(Ge){throw Ge}function $e(Ge,ze){var Pe=oe.v.onStoppedNotification;Pe&&Ee.z.setTimeout(function(){return Pe(Ge,ze)})}var Ae={closed:!0,next:fe,error:he,complete:fe}},8839:(st,we,N)=>{"use strict";N.d(we,{Lc:()=>Z,w0:()=>fe,Nn:()=>Ce});var _=N(9162),f=N(8853),oe=(0,N(3864).d)(function(Ie){return function(ie){Ie(this),this.message=ie?ie.length+" errors occurred during unsubscription:\n"+ie.map(function(_e,ge){return ge+1+") "+_e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=ie}}),te=N(5850),fe=function(){function Ie(Ee){this.initialTeardown=Ee,this.closed=!1,this._parentage=null,this._teardowns=null}return Ie.prototype.unsubscribe=function(){var Ee,ie,_e,ge,Se;if(!this.closed){this.closed=!0;var he=this._parentage;if(he)if(this._parentage=null,Array.isArray(he))try{for(var $e=(0,_.XA)(he),Ae=$e.next();!Ae.done;Ae=$e.next())Ae.value.remove(this)}catch(je){Ee={error:je}}finally{try{Ae&&!Ae.done&&(ie=$e.return)&&ie.call($e)}finally{if(Ee)throw Ee.error}}else he.remove(this);var ze=this.initialTeardown;if((0,f.m)(ze))try{ze()}catch(je){Se=je instanceof oe?je.errors:[je]}var Pe=this._teardowns;if(Pe){this._teardowns=null;try{for(var ae=(0,_.XA)(Pe),Ye=ae.next();!Ye.done;Ye=ae.next()){var Dt=Ye.value;try{ke(Dt)}catch(je){Se=null!=Se?Se:[],je instanceof oe?Se=(0,_.ev)((0,_.ev)([],(0,_.CR)(Se)),(0,_.CR)(je.errors)):Se.push(je)}}}catch(je){_e={error:je}}finally{try{Ye&&!Ye.done&&(ge=ae.return)&&ge.call(ae)}finally{if(_e)throw _e.error}}}if(Se)throw new oe(Se)}},Ie.prototype.add=function(Ee){var ie;if(Ee&&Ee!==this)if(this.closed)ke(Ee);else{if(Ee instanceof Ie){if(Ee.closed||Ee._hasParent(this))return;Ee._addParent(this)}(this._teardowns=null!==(ie=this._teardowns)&&void 0!==ie?ie:[]).push(Ee)}},Ie.prototype._hasParent=function(Ee){var ie=this._parentage;return ie===Ee||Array.isArray(ie)&&ie.includes(Ee)},Ie.prototype._addParent=function(Ee){var ie=this._parentage;this._parentage=Array.isArray(ie)?(ie.push(Ee),ie):ie?[ie,Ee]:Ee},Ie.prototype._removeParent=function(Ee){var ie=this._parentage;ie===Ee?this._parentage=null:Array.isArray(ie)&&(0,te.P)(ie,Ee)},Ie.prototype.remove=function(Ee){var ie=this._teardowns;ie&&(0,te.P)(ie,Ee),Ee instanceof Ie&&Ee._removeParent(this)},Ie.EMPTY=((Ee=new Ie).closed=!0,Ee),Ie;var Ee}(),Z=fe.EMPTY;function Ce(Ie){return Ie instanceof fe||Ie&&"closed"in Ie&&(0,f.m)(Ie.remove)&&(0,f.m)(Ie.add)&&(0,f.m)(Ie.unsubscribe)}function ke(Ie){(0,f.m)(Ie)?Ie():Ie.unsubscribe()}},6806:(st,we,N)=>{"use strict";N.d(we,{v:()=>_});var _={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},6149:(st,we,N)=>{"use strict";N.d(we,{E:()=>f});var f=new(N(1776).y)(function(te){return te.complete()})},5929:(st,we,N)=>{"use strict";N.d(we,{Dp:()=>je,OO:()=>U,Xf:()=>lt});var _=N(9162),f=function(q){return q&&"number"==typeof q.length&&"function"!=typeof q},me=N(8853);function oe(q){return(0,me.m)(null==q?void 0:q.then)}var te=N(8794),fe=N(1776),Z=N(8839),Ie=N(2504),ie="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Se(q,Me){if(!q)throw new Error("Iterable cannot be null");return new fe.y(function(ye){var Ve=new Z.w0;return Ve.add(Me.schedule(function(){var Je=q[Symbol.asyncIterator]();Ve.add(Me.schedule(function(){var nt=this;Je.next().then(function(yt){yt.done?ye.complete():(ye.next(yt.value),nt.schedule())})}))})),Ve})}function he(q){return(0,me.m)(q[te.L])}function $e(q){return(0,me.m)(null==q?void 0:q[ie])}function Ae(q){return Symbol.asyncIterator&&(0,me.m)(null==q?void 0:q[Symbol.asyncIterator])}function Ge(q){return new TypeError("You provided "+(null!==q&&"object"==typeof q?"an invalid object":"'"+q+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function ze(q){return(0,_.FC)(this,arguments,function(){var ye,Ve,Je;return(0,_.Jh)(this,function(yt){switch(yt.label){case 0:ye=q.getReader(),yt.label=1;case 1:yt.trys.push([1,,9,10]),yt.label=2;case 2:return[4,(0,_.qq)(ye.read())];case 3:return Ve=yt.sent(),Je=Ve.value,Ve.done?[4,(0,_.qq)(void 0)]:[3,5];case 4:return[2,yt.sent()];case 5:return[4,(0,_.qq)(Je)];case 6:return[4,yt.sent()];case 7:return yt.sent(),[3,2];case 8:return[3,10];case 9:return ye.releaseLock(),[7];case 10:return[2]}})})}function Pe(q){return(0,me.m)(null==q?void 0:q.getReader)}var Dt=N(8550);function je(q,Me){return Me?function(q,Me){if(null!=q){if(he(q))return function(q,Me){return new fe.y(function(ye){var Ve=new Z.w0;return Ve.add(Me.schedule(function(){var Je=q[te.L]();Ve.add(Je.subscribe({next:function(nt){Ve.add(Me.schedule(function(){return ye.next(nt)}))},error:function(nt){Ve.add(Me.schedule(function(){return ye.error(nt)}))},complete:function(){Ve.add(Me.schedule(function(){return ye.complete()}))}}))})),Ve})}(q,Me);if(f(q))return(0,Ie.r)(q,Me);if(oe(q))return function(q,Me){return new fe.y(function(ye){return Me.schedule(function(){return q.then(function(Ve){ye.add(Me.schedule(function(){ye.next(Ve),ye.add(Me.schedule(function(){return ye.complete()}))}))},function(Ve){ye.add(Me.schedule(function(){return ye.error(Ve)}))})})})}(q,Me);if(Ae(q))return Se(q,Me);if($e(q))return function(q,Me){return new fe.y(function(ye){var Ve;return ye.add(Me.schedule(function(){Ve=q[ie](),function(q,Me,ye,Ve){void 0===Ve&&(Ve=0);var Je=Me.schedule(function(){try{ye.call(this)}catch(nt){q.error(nt)}},Ve);q.add(Je)}(ye,Me,function(){var Je=Ve.next(),nt=Je.value;Je.done?ye.complete():(ye.next(nt),this.schedule())})})),function(){return(0,me.m)(null==Ve?void 0:Ve.return)&&Ve.return()}})}(q,Me);if(Pe(q))return function(q,Me){return Se(ze(q),Me)}(q,Me)}throw Ge(q)}(q,Me):lt(q)}function lt(q){if(q instanceof fe.y)return q;if(null!=q){if(he(q))return function(q){return new fe.y(function(Me){var ye=q[te.L]();if((0,me.m)(ye.subscribe))return ye.subscribe(Me);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(q);if(f(q))return U(q);if(oe(q))return function(q){return new fe.y(function(Me){q.then(function(ye){Me.closed||(Me.next(ye),Me.complete())},function(ye){return Me.error(ye)}).then(null,Dt.h)})}(q);if(Ae(q))return De(q);if($e(q))return function(q){return new fe.y(function(Me){var ye,Ve;try{for(var Je=(0,_.XA)(q),nt=Je.next();!nt.done;nt=Je.next())if(Me.next(nt.value),Me.closed)return}catch(Vt){ye={error:Vt}}finally{try{nt&&!nt.done&&(Ve=Je.return)&&Ve.call(Je)}finally{if(ye)throw ye.error}}Me.complete()})}(q);if(Pe(q))return function(q){return De(ze(q))}(q)}throw Ge(q)}function U(q){return new fe.y(function(Me){for(var ye=0;ye<q.length&&!Me.closed;ye++)Me.next(q[ye]);Me.complete()})}function De(q){return new fe.y(function(Me){(function(q,Me){var ye,Ve,Je,nt;return(0,_.mG)(this,void 0,void 0,function(){var Vt;return(0,_.Jh)(this,function(Gt){switch(Gt.label){case 0:Gt.trys.push([0,5,6,11]),ye=(0,_.KL)(q),Gt.label=1;case 1:return[4,ye.next()];case 2:if((Ve=Gt.sent()).done)return[3,4];if(Me.next(Ve.value),Me.closed)return[2];Gt.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return Vt=Gt.sent(),Je={error:Vt},[3,11];case 6:return Gt.trys.push([6,,9,10]),Ve&&!Ve.done&&(nt=ye.return)?[4,nt.call(ye)]:[3,8];case 7:Gt.sent(),Gt.label=8;case 8:return[3,10];case 9:if(Je)throw Je.error;return[7];case 10:return[7];case 11:return Me.complete(),[2]}})})})(q,Me).catch(function(ye){return Me.error(ye)})})}},5994:(st,we,N)=>{"use strict";N.d(we,{h:()=>me});var _=N(2504),f=N(5929);function me(oe,te){return te?(0,_.r)(oe,te):(0,f.OO)(oe)}},1964:(st,we,N)=>{"use strict";N.d(we,{of:()=>oe});var _=N(5994),f=N(2504),me=N(9528);function oe(){for(var te=[],fe=0;fe<arguments.length;fe++)te[fe]=arguments[fe];var Z=(0,me.yG)(te);return Z?(0,f.r)(te,Z):(0,_.h)(te)}},8567:(st,we,N)=>{"use strict";N.d(we,{_:()=>me});var _=N(1776),f=N(8853);function me(oe,te){var fe=(0,f.m)(oe)?oe:function(){return oe},Z=function(Ce){return Ce.error(fe())};return new _.y(te?function(Ce){return te.schedule(Z,0,Ce)}:Z)}},5076:(st,we,N)=>{"use strict";N.d(we,{Q:()=>me});var _=N(9162),me=function(oe){function te(fe,Z,Ce,ke,Ie){var Ee=oe.call(this,fe)||this;return Ee.onFinalize=Ie,Ee._next=Z?function(ie){try{Z(ie)}catch(_e){fe.error(_e)}}:oe.prototype._next,Ee._error=ke?function(ie){try{ke(ie)}catch(_e){fe.error(_e)}finally{this.unsubscribe()}}:oe.prototype._error,Ee._complete=Ce?function(){try{Ce()}catch(ie){fe.error(ie)}finally{this.unsubscribe()}}:oe.prototype._complete,Ee}return(0,_.ZT)(te,oe),te.prototype.unsubscribe=function(){var fe,Z=this.closed;oe.prototype.unsubscribe.call(this),!Z&&(null===(fe=this.onFinalize)||void 0===fe||fe.call(this))},te}(N(4111).Lv)},5894:(st,we,N)=>{"use strict";N.d(we,{K:()=>oe});var _=N(5929),f=N(5076),me=N(4297);function oe(te){return(0,me.e)(function(fe,Z){var Ie,Ce=null,ke=!1;Ce=fe.subscribe(new f.Q(Z,void 0,void 0,function(Ee){Ie=(0,_.Xf)(te(Ee,oe(te)(fe))),Ce?(Ce.unsubscribe(),Ce=null,Ie.subscribe(Z)):ke=!0})),ke&&(Ce.unsubscribe(),Ce=null,Ie.subscribe(Z))})}},3766:(st,we,N)=>{"use strict";N.d(we,{b:()=>me});var _=N(7216),f=N(8853);function me(oe,te){return(0,f.m)(te)?(0,_.z)(oe,te,1):(0,_.z)(oe,1)}},4689:(st,we,N)=>{"use strict";N.d(we,{h:()=>me});var _=N(4297),f=N(5076);function me(oe,te){return(0,_.e)(function(fe,Z){var Ce=0;fe.subscribe(new f.Q(Z,function(ke){return oe.call(te,ke,Ce++)&&Z.next(ke)}))})}},5207:(st,we,N)=>{"use strict";N.d(we,{U:()=>me});var _=N(4297),f=N(5076);function me(oe,te){return(0,_.e)(function(fe,Z){var Ce=0;fe.subscribe(new f.Q(Z,function(ke){Z.next(oe.call(te,ke,Ce++))}))})}},23:(st,we,N)=>{"use strict";N.d(we,{J:()=>me});var _=N(7216),f=N(2738);function me(oe){return void 0===oe&&(oe=1/0),(0,_.z)(f.y,oe)}},7216:(st,we,N)=>{"use strict";N.d(we,{z:()=>Z});var _=N(5207),f=N(5929),me=N(4297),oe=N(5076),fe=N(8853);function Z(Ce,ke,Ie){return void 0===Ie&&(Ie=1/0),(0,fe.m)(ke)?Z(function(Ee,ie){return(0,_.U)(function(_e,ge){return ke(Ee,_e,ie,ge)})((0,f.Xf)(Ce(Ee,ie)))},Ie):("number"==typeof ke&&(Ie=ke),(0,me.e)(function(Ee,ie){return function(Ce,ke,Ie,Ee,ie,_e,ge,Se){var he=[],$e=0,Ae=0,Ge=!1,ze=function(){Ge&&!he.length&&!$e&&ke.complete()},Pe=function(Ye){return $e<Ee?ae(Ye):he.push(Ye)},ae=function(Ye){$e++;var Dt=!1;(0,f.Xf)(Ie(Ye,Ae++)).subscribe(new oe.Q(ke,function(je){ke.next(je)},function(){Dt=!0},void 0,function(){if(Dt)try{$e--;for(;he.length&&$e<Ee;)lt=void 0,lt=he.shift(),ae(lt);ze()}catch(lt){ke.error(lt)}var lt}))};return Ce.subscribe(new oe.Q(ke,Pe,function(){Ge=!0,ze()})),function(){}}(Ee,ie,Ce,Ie)}))}},4294:(st,we,N)=>{"use strict";N.d(we,{q:()=>oe});var _=N(6149),f=N(4297),me=N(5076);function oe(te){return te<=0?function(){return _.E}:(0,f.e)(function(fe,Z){var Ce=0;fe.subscribe(new me.Q(Z,function(ke){++Ce<=te&&(Z.next(ke),te<=Ce&&Z.complete())}))})}},2504:(st,we,N)=>{"use strict";N.d(we,{r:()=>f});var _=N(1776);function f(me,oe){return new _.y(function(te){var fe=0;return oe.schedule(function(){fe===me.length?te.complete():(te.next(me[fe++]),te.closed||this.schedule())})})}},9385:(st,we,N)=>{"use strict";N.d(we,{z:()=>f});var _=N(9162),f={setTimeout:function(){for(var me=[],oe=0;oe<arguments.length;oe++)me[oe]=arguments[oe];var te=f.delegate;return((null==te?void 0:te.setTimeout)||setTimeout).apply(void 0,(0,_.ev)([],(0,_.CR)(me)))},clearTimeout:function(me){var oe=f.delegate;return((null==oe?void 0:oe.clearTimeout)||clearTimeout)(me)},delegate:void 0}},8794:(st,we,N)=>{"use strict";N.d(we,{L:()=>_});var _="function"==typeof Symbol&&Symbol.observable||"@@observable"},9528:(st,we,N)=>{"use strict";N.d(we,{_6:()=>fe,jO:()=>oe,yG:()=>te});var _=N(8853);function me(Z){return Z[Z.length-1]}function oe(Z){return(0,_.m)(me(Z))?Z.pop():void 0}function te(Z){return function(Z){return Z&&(0,_.m)(Z.schedule)}(me(Z))?Z.pop():void 0}function fe(Z,Ce){return"number"==typeof me(Z)?Z.pop():Ce}},1260:(st,we,N)=>{"use strict";N.d(we,{D:()=>te});var _=Array.isArray,f=Object.getPrototypeOf,me=Object.prototype,oe=Object.keys;function te(Z){if(1===Z.length){var Ce=Z[0];if(_(Ce))return{args:Ce,keys:null};if(function(Z){return Z&&"object"==typeof Z&&f(Z)===me}(Ce)){var ke=oe(Ce);return{args:ke.map(function(Ie){return Ce[Ie]}),keys:ke}}}return{args:Z,keys:null}}},5850:(st,we,N)=>{"use strict";function _(f,me){if(f){var oe=f.indexOf(me);0<=oe&&f.splice(oe,1)}}N.d(we,{P:()=>_})},3864:(st,we,N)=>{"use strict";function _(f){var oe=f(function(te){Error.call(te),te.stack=(new Error).stack});return oe.prototype=Object.create(Error.prototype),oe.prototype.constructor=oe,oe}N.d(we,{d:()=>_})},5526:(st,we,N)=>{"use strict";function _(f,me){return f.reduce(function(oe,te,fe){return oe[te]=me[fe],oe},{})}N.d(we,{n:()=>_})},4112:(st,we,N)=>{"use strict";N.d(we,{x:()=>me,O:()=>oe});var _=N(6806),f=null;function me(te){if(_.v.useDeprecatedSynchronousErrorHandling){var fe=!f;if(fe&&(f={errorThrown:!1,error:null}),te(),fe){var Z=f;if(f=null,Z.errorThrown)throw Z.error}}else te()}function oe(te){_.v.useDeprecatedSynchronousErrorHandling&&f&&(f.errorThrown=!0,f.error=te)}},2738:(st,we,N)=>{"use strict";function _(f){return f}N.d(we,{y:()=>_})},8853:(st,we,N)=>{"use strict";function _(f){return"function"==typeof f}N.d(we,{m:()=>_})},4297:(st,we,N)=>{"use strict";N.d(we,{A:()=>f,e:()=>me});var _=N(8853);function f(oe){return(0,_.m)(null==oe?void 0:oe.lift)}function me(oe){return function(te){if(f(te))return te.lift(function(fe){try{return oe(fe,this)}catch(Z){this.error(Z)}});throw new TypeError("Unable to lift unknown Observable type")}}},9607:(st,we,N)=>{"use strict";N.d(we,{Z:()=>te});var _=N(9162),f=N(5207),me=Array.isArray;function te(fe){return(0,f.U)(function(Z){return function(fe,Z){return me(Z)?fe.apply(void 0,(0,_.ev)([],(0,_.CR)(Z))):fe(Z)}(fe,Z)})}},8550:(st,we,N)=>{"use strict";N.d(we,{h:()=>me});var _=N(6806),f=N(9385);function me(oe){f.z.setTimeout(function(){var te=_.v.onUnhandledError;if(!te)throw oe;te(oe)})}},5473:(st,we,N)=>{"use strict";N.d(we,{a:()=>oe});var _=N(476),f=N(9502),me=N(7556);let oe=(()=>{class te{constructor(Z,Ce){this.router=Z,this.authSvc=Ce}canActivate(Z,Ce){return this.checkLogin(Ce.url)}canActivateChild(Z,Ce){return this.canActivate(Z,Ce)}canLoad(Z){return this.checkLogin(`/${Z.path}`)}checkLogin(Z){return!(this.authSvc.isSecureMode&&!this.authSvc.isLoggedIn)||this.router.parseUrl("/login")}}return te.\u0275fac=function(Z){return new(Z||te)(_.LFG(f.F0),_.LFG(me.e))},te.\u0275prov=_.Yz7({token:te,factory:te.\u0275fac,providedIn:"root"}),te})()},7822:(st,we,N)=>{"use strict";N.d(we,{e:()=>me});var _=N(476);let me=(()=>{class oe{constructor(){this.messages=[]}success(fe="operation",Z){this.messages.push({class:"alert alert-success shadow rounded alert-dismissible fade show",content:`${fe} success! ${Z||""}`})}errors(fe){this.messages.push({class:"alert alert-danger shadow rounded alert-dismissible fade show",content:fe})}clear(){this.messages.shift()}}return oe.\u0275fac=function(fe){return new(fe||oe)},oe.\u0275prov=_.Yz7({token:oe,factory:oe.\u0275fac,providedIn:"root"}),oe})()},7556:(st,we,N)=>{"use strict";N.d(we,{e:()=>oe});var _=N(476),f=N(1841),me=N(4889);let oe=(()=>{class te{constructor(Z,Ce){this.http=Z,this.errorSvc=Ce,this.accessToken=null,this.isLoggedIn=!1,this.redirectUrl=null,this.isSecureMode=!1}login(){return this.tokenValidate()}tokenValidate(){return this.http.get("/core-data/api/v2/ping")}setAccessToken(Z){this.accessToken=Z,window.sessionStorage.setItem("EdgeX_Access_Token",this.accessToken)}getAccessToken(){if(this.accessToken)return this.accessToken;let Z=window.sessionStorage.getItem("EdgeX_Access_Token");return Z&&(this.accessToken=Z),this.accessToken}}return te.\u0275fac=function(Z){return new(Z||te)(_.LFG(f.eN),_.LFG(me.T))},te.\u0275prov=_.Yz7({token:te,factory:te.\u0275fac,providedIn:"root"}),te})()},4889:(st,we,N)=>{"use strict";N.d(we,{T:()=>oe});var _=N(8567),f=N(476),me=N(7822);let oe=(()=>{class te{constructor(Z){this.msgSvc=Z}handleErrorForV2API(Z){let Ce=Object.prototype.toString.call(Z);if("[object Array]"===Ce){if(!Z[0].statusCode.toString().startsWith("20"))return this.msgSvc.errors(`code: ${Z[0].statusCode}, message: ${Z[0].message}`),!0}else if("[object Object]"===Ce&&!Z.statusCode.toString().startsWith("20"))return this.msgSvc.errors(`code: ${Z.statusCode}, message: ${Z.message}`),!0;return!1}handleError(Z){return Z.error instanceof ErrorEvent?this.msgSvc.errors(`'An error occurred:', ${Z.error.message}`):"[object Object]"===Object.prototype.toString.call(Z.error)?this.msgSvc.errors(`code: ${Z.error.statusCode} , message: ${Z.error.message}`):"[object String]"===Object.prototype.toString.call(Z.error)?this.msgSvc.errors(`code: ${Z.status} , message: ${Z.error}`):this.msgSvc.errors(`code: ${Z.status} , message: ${Z.message}`),(0,_._)(`Backend returned code ${Z.status}, body was: ${Z.error.message}`)}}return te.\u0275fac=function(Z){return new(Z||te)(f.LFG(me.e))},te.\u0275prov=f.Yz7({token:te,factory:te.\u0275fac,providedIn:"root"}),te})()},1611:(st,we,N)=>{"use strict";var _=N(8583),f=N(476);class me extends _.w_{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class oe extends me{static makeCurrent(){(0,_.HT)(new oe)}onAndCancel(x,I,F){return x.addEventListener(I,F,!1),()=>{x.removeEventListener(I,F,!1)}}dispatchEvent(x,I){x.dispatchEvent(I)}remove(x){x.parentNode&&x.parentNode.removeChild(x)}createElement(x,I){return(I=I||this.getDefaultDocument()).createElement(x)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(x){return x.nodeType===Node.ELEMENT_NODE}isShadowRoot(x){return x instanceof DocumentFragment}getGlobalEventTarget(x,I){return"window"===I?window:"document"===I?x:"body"===I?x.body:null}getBaseHref(x){const I=(te=te||document.querySelector("base"),te?te.getAttribute("href"):null);return null==I?null:function(O){Z=Z||document.createElement("a"),Z.setAttribute("href",O);const x=Z.pathname;return"/"===x.charAt(0)?x:`/${x}`}(I)}resetBaseElement(){te=null}getUserAgent(){return window.navigator.userAgent}getCookie(x){return(0,_.Mx)(document.cookie,x)}}let Z,te=null;const ke=new f.OlP("TRANSITION_ID"),Ee=[{provide:f.ip1,useFactory:function(O,x,I){return()=>{I.get(f.CZH).donePromise.then(()=>{const F=(0,_.q)(),Q=x.querySelectorAll(`style[ng-transition="${O}"]`);for(let Re=0;Re<Q.length;Re++)F.remove(Q[Re])})}},deps:[ke,_.K0,f.zs3],multi:!0}];class ie{static init(){(0,f.VLi)(new ie)}addToWindow(x){f.dqk.getAngularTestability=(F,Q=!0)=>{const Re=x.findTestabilityInTree(F,Q);if(null==Re)throw new Error("Could not find testability for element.");return Re},f.dqk.getAllAngularTestabilities=()=>x.getAllTestabilities(),f.dqk.getAllAngularRootElements=()=>x.getAllRootElements(),f.dqk.frameworkStabilizers||(f.dqk.frameworkStabilizers=[]),f.dqk.frameworkStabilizers.push(F=>{const Q=f.dqk.getAllAngularTestabilities();let Re=Q.length,He=!1;const St=function(qt){He=He||qt,Re--,0==Re&&F(He)};Q.forEach(function(qt){qt.whenStable(St)})})}findTestabilityInTree(x,I,F){if(null==I)return null;const Q=x.getTestability(I);return null!=Q?Q:F?(0,_.q)().isShadowRoot(I)?this.findTestabilityInTree(x,I.host,!0):this.findTestabilityInTree(x,I.parentElement,!0):null}}let _e=(()=>{class O{build(){return new XMLHttpRequest}}return O.\u0275fac=function(I){return new(I||O)},O.\u0275prov=f.Yz7({token:O,factory:O.\u0275fac}),O})();const Y=new f.OlP("EventManagerPlugins");let ne=(()=>{class O{constructor(I,F){this._zone=F,this._eventNameToPlugin=new Map,I.forEach(Q=>Q.manager=this),this._plugins=I.slice().reverse()}addEventListener(I,F,Q){return this._findPluginFor(F).addEventListener(I,F,Q)}addGlobalEventListener(I,F,Q){return this._findPluginFor(F).addGlobalEventListener(I,F,Q)}getZone(){return this._zone}_findPluginFor(I){const F=this._eventNameToPlugin.get(I);if(F)return F;const Q=this._plugins;for(let Re=0;Re<Q.length;Re++){const He=Q[Re];if(He.supports(I))return this._eventNameToPlugin.set(I,He),He}throw new Error(`No event manager plugin found for event ${I}`)}}return O.\u0275fac=function(I){return new(I||O)(f.LFG(Y),f.LFG(f.R0b))},O.\u0275prov=f.Yz7({token:O,factory:O.\u0275fac}),O})();class De{constructor(x){this._doc=x}addGlobalEventListener(x,I,F){const Q=(0,_.q)().getGlobalEventTarget(this._doc,x);if(!Q)throw new Error(`Unsupported event target ${Q} for event ${I}`);return this.addEventListener(Q,I,F)}}let K=(()=>{class O{constructor(){this._stylesSet=new Set}addStyles(I){const F=new Set;I.forEach(Q=>{this._stylesSet.has(Q)||(this._stylesSet.add(Q),F.add(Q))}),this.onStylesAdded(F)}onStylesAdded(I){}getAllStyles(){return Array.from(this._stylesSet)}}return O.\u0275fac=function(I){return new(I||O)},O.\u0275prov=f.Yz7({token:O,factory:O.\u0275fac}),O})(),We=(()=>{class O extends K{constructor(I){super(),this._doc=I,this._hostNodes=new Map,this._hostNodes.set(I.head,[])}_addStylesToHost(I,F,Q){I.forEach(Re=>{const He=this._doc.createElement("style");He.textContent=Re,Q.push(F.appendChild(He))})}addHost(I){const F=[];this._addStylesToHost(this._stylesSet,I,F),this._hostNodes.set(I,F)}removeHost(I){const F=this._hostNodes.get(I);F&&F.forEach(q),this._hostNodes.delete(I)}onStylesAdded(I){this._hostNodes.forEach((F,Q)=>{this._addStylesToHost(I,Q,F)})}ngOnDestroy(){this._hostNodes.forEach(I=>I.forEach(q))}}return O.\u0275fac=function(I){return new(I||O)(f.LFG(_.K0))},O.\u0275prov=f.Yz7({token:O,factory:O.\u0275fac}),O})();function q(O){(0,_.q)().remove(O)}const Me={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},ye=/%COMP%/g;function Tt(O,x,I){for(let F=0;F<x.length;F++){let Q=x[F];Array.isArray(Q)?Tt(O,Q,I):(Q=Q.replace(ye,O),I.push(Q))}return I}function Xt(O){return x=>{if("__ngUnwrap__"===x)return O;!1===O(x)&&(x.preventDefault(),x.returnValue=!1)}}let gn=(()=>{class O{constructor(I,F,Q){this.eventManager=I,this.sharedStylesHost=F,this.appId=Q,this.rendererByCompId=new Map,this.defaultRenderer=new It(I)}createRenderer(I,F){if(!I||!F)return this.defaultRenderer;switch(F.encapsulation){case f.ifc.Emulated:{let Q=this.rendererByCompId.get(F.id);return Q||(Q=new xn(this.eventManager,this.sharedStylesHost,F,this.appId),this.rendererByCompId.set(F.id,Q)),Q.applyToHost(I),Q}case 1:case f.ifc.ShadowDom:return new kt(this.eventManager,this.sharedStylesHost,I,F);default:if(!this.rendererByCompId.has(F.id)){const Q=Tt(F.id,F.styles,[]);this.sharedStylesHost.addStyles(Q),this.rendererByCompId.set(F.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return O.\u0275fac=function(I){return new(I||O)(f.LFG(ne),f.LFG(We),f.LFG(f.AFp))},O.\u0275prov=f.Yz7({token:O,factory:O.\u0275fac}),O})();class It{constructor(x){this.eventManager=x,this.data=Object.create(null)}destroy(){}createElement(x,I){return I?document.createElementNS(Me[I]||I,x):document.createElement(x)}createComment(x){return document.createComment(x)}createText(x){return document.createTextNode(x)}appendChild(x,I){x.appendChild(I)}insertBefore(x,I,F){x&&x.insertBefore(I,F)}removeChild(x,I){x&&x.removeChild(I)}selectRootElement(x,I){let F="string"==typeof x?document.querySelector(x):x;if(!F)throw new Error(`The selector "${x}" did not match any elements`);return I||(F.textContent=""),F}parentNode(x){return x.parentNode}nextSibling(x){return x.nextSibling}setAttribute(x,I,F,Q){if(Q){I=Q+":"+I;const Re=Me[Q];Re?x.setAttributeNS(Re,I,F):x.setAttribute(I,F)}else x.setAttribute(I,F)}removeAttribute(x,I,F){if(F){const Q=Me[F];Q?x.removeAttributeNS(Q,I):x.removeAttribute(`${F}:${I}`)}else x.removeAttribute(I)}addClass(x,I){x.classList.add(I)}removeClass(x,I){x.classList.remove(I)}setStyle(x,I,F,Q){Q&(f.JOm.DashCase|f.JOm.Important)?x.style.setProperty(I,F,Q&f.JOm.Important?"important":""):x.style[I]=F}removeStyle(x,I,F){F&f.JOm.DashCase?x.style.removeProperty(I):x.style[I]=""}setProperty(x,I,F){x[I]=F}setValue(x,I){x.nodeValue=I}listen(x,I,F){return"string"==typeof x?this.eventManager.addGlobalEventListener(x,I,Xt(F)):this.eventManager.addEventListener(x,I,Xt(F))}}class xn extends It{constructor(x,I,F,Q){super(x),this.component=F;const Re=Tt(Q+"-"+F.id,F.styles,[]);I.addStyles(Re),this.contentAttr="_ngcontent-%COMP%".replace(ye,Q+"-"+F.id),this.hostAttr="_nghost-%COMP%".replace(ye,Q+"-"+F.id)}applyToHost(x){super.setAttribute(x,this.hostAttr,"")}createElement(x,I){const F=super.createElement(x,I);return super.setAttribute(F,this.contentAttr,""),F}}class kt extends It{constructor(x,I,F,Q){super(x),this.sharedStylesHost=I,this.hostEl=F,this.shadowRoot=F.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const Re=Tt(Q.id,Q.styles,[]);for(let He=0;He<Re.length;He++){const St=document.createElement("style");St.textContent=Re[He],this.shadowRoot.appendChild(St)}}nodeOrShadowRoot(x){return x===this.hostEl?this.shadowRoot:x}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}appendChild(x,I){return super.appendChild(this.nodeOrShadowRoot(x),I)}insertBefore(x,I,F){return super.insertBefore(this.nodeOrShadowRoot(x),I,F)}removeChild(x,I){return super.removeChild(this.nodeOrShadowRoot(x),I)}parentNode(x){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(x)))}}let fo=(()=>{class O extends De{constructor(I){super(I)}supports(I){return!0}addEventListener(I,F,Q){return I.addEventListener(F,Q,!1),()=>this.removeEventListener(I,F,Q)}removeEventListener(I,F,Q){return I.removeEventListener(F,Q)}}return O.\u0275fac=function(I){return new(I||O)(f.LFG(_.K0))},O.\u0275prov=f.Yz7({token:O,factory:O.\u0275fac}),O})();const Ne=["alt","control","meta","shift"],xe={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},Oe={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},Ke={alt:O=>O.altKey,control:O=>O.ctrlKey,meta:O=>O.metaKey,shift:O=>O.shiftKey};let ot=(()=>{class O extends De{constructor(I){super(I)}supports(I){return null!=O.parseEventName(I)}addEventListener(I,F,Q){const Re=O.parseEventName(F),He=O.eventCallback(Re.fullKey,Q,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>(0,_.q)().onAndCancel(I,Re.domEventName,He))}static parseEventName(I){const F=I.toLowerCase().split("."),Q=F.shift();if(0===F.length||"keydown"!==Q&&"keyup"!==Q)return null;const Re=O._normalizeKey(F.pop());let He="";if(Ne.forEach(qt=>{const Bn=F.indexOf(qt);Bn>-1&&(F.splice(Bn,1),He+=qt+".")}),He+=Re,0!=F.length||0===Re.length)return null;const St={};return St.domEventName=Q,St.fullKey=He,St}static getEventFullKey(I){let F="",Q=function(O){let x=O.key;if(null==x){if(x=O.keyIdentifier,null==x)return"Unidentified";x.startsWith("U+")&&(x=String.fromCharCode(parseInt(x.substring(2),16)),3===O.location&&Oe.hasOwnProperty(x)&&(x=Oe[x]))}return xe[x]||x}(I);return Q=Q.toLowerCase()," "===Q?Q="space":"."===Q&&(Q="dot"),Ne.forEach(Re=>{Re!=Q&&Ke[Re](I)&&(F+=Re+".")}),F+=Q,F}static eventCallback(I,F,Q){return Re=>{O.getEventFullKey(Re)===I&&Q.runGuarded(()=>F(Re))}}static _normalizeKey(I){switch(I){case"esc":return"escape";default:return I}}}return O.\u0275fac=function(I){return new(I||O)(f.LFG(_.K0))},O.\u0275prov=f.Yz7({token:O,factory:O.\u0275fac}),O})();const br=(0,f.eFA)(f._c5,"browser",[{provide:f.Lbi,useValue:_.bD},{provide:f.g9A,useValue:function(){oe.makeCurrent(),ie.init()},multi:!0},{provide:_.K0,useFactory:function(){return(0,f.RDi)(document),document},deps:[]}]),$r=[[],{provide:f.zSh,useValue:"root"},{provide:f.qLn,useFactory:function(){return new f.qLn},deps:[]},{provide:Y,useClass:fo,multi:!0,deps:[_.K0,f.R0b,f.Lbi]},{provide:Y,useClass:ot,multi:!0,deps:[_.K0]},[],{provide:gn,useClass:gn,deps:[ne,We,f.AFp]},{provide:f.FYo,useExisting:gn},{provide:K,useExisting:We},{provide:We,useClass:We,deps:[_.K0]},{provide:f.dDg,useClass:f.dDg,deps:[f.R0b]},{provide:ne,useClass:ne,deps:[Y,f.R0b]},{provide:_.JF,useClass:_e,deps:[]},[]];let po=(()=>{class O{constructor(I){if(I)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(I){return{ngModule:O,providers:[{provide:f.AFp,useValue:I.appId},{provide:ke,useExisting:f.AFp},Ee]}}}return O.\u0275fac=function(I){return new(I||O)(f.LFG(O,12))},O.\u0275mod=f.oAB({type:O}),O.\u0275inj=f.cJS({providers:$r,imports:[_.ez,f.hGG]}),O})();"undefined"!=typeof window&&window;var et=N(1841),ft=N(3092),pt=N(9502),zt=N(5473),Ut=N(5894),Yn=N(8567),Ot=N(4889);let wr=(()=>{class O{constructor(I,F){this.http=I,this.errorSvc=F,this.endpoint="",this.version="/api/v2",this.urlPrefix=`${this.endpoint}${this.version}`,this.secureModeUrl=`${this.urlPrefix}/auth/securemode`}getSecureMode(){return this.http.get(`${this.secureModeUrl}`,{responseType:"text"}).pipe((0,Ut.K)(F=>this.errorSvc.handleError(F)))}}return O.\u0275fac=function(I){return new(I||O)(f.LFG(et.eN),f.LFG(Ot.T))},O.\u0275prov=f.Yz7({token:O,factory:O.\u0275fac,providedIn:"root"}),O})();var Ln=N(7556);const cr=[{path:"dashboard",canLoad:[zt.a],loadChildren:()=>Promise.all([N.e(795),N.e(849)]).then(N.bind(N,8849)).then(O=>O.DashboardModule)},{path:"system-agent",canLoad:[zt.a],loadChildren:()=>Promise.all([N.e(795),N.e(357)]).then(N.bind(N,6357)).then(O=>O.SystemAgentModule)},{path:"metadata",canLoad:[zt.a],loadChildren:()=>N.e(679).then(N.bind(N,679)).then(O=>O.MetadataModule)},{path:"core-data",canLoad:[zt.a],loadChildren:()=>N.e(216).then(N.bind(N,8216)).then(O=>O.CoreDataModule)},{path:"notifications",canLoad:[zt.a],loadChildren:()=>Promise.all([N.e(827),N.e(641)]).then(N.bind(N,7641)).then(O=>O.NotificationsModule)},{path:"scheduler",canLoad:[zt.a],loadChildren:()=>Promise.all([N.e(827),N.e(707),N.e(568)]).then(N.bind(N,2568)).then(O=>O.SchedulerModule)},{path:"rule-engine",canLoad:[zt.a],loadChildren:()=>Promise.all([N.e(707),N.e(978)]).then(N.bind(N,532)).then(O=>O.RuleEngineModule)},{path:"app-service",canLoad:[zt.a],loadChildren:()=>Promise.all([N.e(679),N.e(631)]).then(N.bind(N,2631)).then(O=>O.AppServiceModule)},{path:"initializer",component:(()=>{class O{constructor(I,F,Q,Re,He){this.initSvc=I,this.errorSvc=F,this.authSvc=Q,this.router=Re,this.route=He}ngOnInit(){this.initializor()}initializor(){this.environmentCheck()}environmentCheck(){this.progressMsg="environment checking",window.setTimeout(()=>{this.initSvc.getSecureMode().subscribe(I=>{"secure"===I?(this.authSvc.isSecureMode=!0,this.tokenValidate()):(this.authSvc.isSecureMode=!1,window.setTimeout(()=>{this.navigateToHome()},1500))})},1500)}tokenValidate(){this.progressMsg="access token validating",this.authSvc.tokenValidate().pipe((0,Ut.K)(I=>(this.authSvc.isLoggedIn=!1,window.setTimeout(()=>{this.router.navigate(["/login"],{relativeTo:this.route})},1500),(0,Yn._)(I)))).subscribe(()=>{this.authSvc.isLoggedIn=!0,this.navigateToHome()})}navigateToHome(){window.setTimeout(()=>{this.router.navigate(["/dashboard"],{relativeTo:this.route})},1500)}}return O.\u0275fac=function(I){return new(I||O)(f.Y36(wr),f.Y36(Ot.T),f.Y36(Ln.e),f.Y36(pt.F0),f.Y36(pt.gz))},O.\u0275cmp=f.Xpm({type:O,selectors:[["app-initializer"]],decls:16,vars:1,consts:[[1,"init","text-center","bg-dark"],[1,"init-progress"],["role","status",1,"spinner-grow","text-success"],[1,"sr-only"],["role","status",1,"spinner-grow","text-danger"],["role","status",1,"spinner-grow","text-warning"],["role","status",1,"spinner-grow","text-info"],[1,"text-light"]],template:function(I,F){1&I&&(f.TgZ(0,"div",0),f.TgZ(1,"div",1),f.TgZ(2,"div",2),f.TgZ(3,"span",3),f._uU(4,"Loading..."),f.qZA(),f.qZA(),f.TgZ(5,"div",4),f.TgZ(6,"span",3),f._uU(7,"Loading..."),f.qZA(),f.qZA(),f.TgZ(8,"div",5),f.TgZ(9,"span",3),f._uU(10,"Loading..."),f.qZA(),f.qZA(),f.TgZ(11,"div",6),f.TgZ(12,"span",3),f._uU(13,"Loading..."),f.qZA(),f.qZA(),f.TgZ(14,"p",7),f._uU(15),f.qZA(),f.qZA(),f.qZA()),2&I&&(f.xp6(15),f.hij("",F.progressMsg,"..."))},styles:[".init[_ngcontent-%COMP%]{position:fixed;top:0;bottom:-100px;left:0;right:0;z-index:999}.init-progress[_ngcontent-%COMP%]{position:absolute;left:0;right:0;top:45%}"]}),O})()}];let Zn=(()=>{class O{}return O.\u0275fac=function(I){return new(I||O)},O.\u0275mod=f.oAB({type:O}),O.\u0275inj=f.cJS({imports:[[pt.Bz.forRoot(cr,{useHash:!0})],pt.Bz]}),O})();var en=N(4689),fn=N(7822);function Bt(O,x){if(1&O){const I=f.EpF();f.TgZ(0,"div"),f.TgZ(1,"div",3),f.TgZ(2,"span",4),f.NdJ("click",function(){const Re=f.CHM(I).$implicit;return f.oxw(2).close(Re)}),f.TgZ(3,"span",5),f._uU(4,"\xd7"),f.qZA(),f.qZA(),f.TgZ(5,"div"),f._uU(6),f.qZA(),f.qZA(),f.qZA()}if(2&O){const I=x.$implicit;f.xp6(1),f.Tol(I.class),f.xp6(5),f.hij(" ",I.content," ")}}function Vn(O,x){if(1&O&&(f.TgZ(0,"div",1),f.YNc(1,Bt,7,3,"div",2),f.qZA()),2&O){const I=f.oxw();f.xp6(1),f.Q6J("ngForOf",I.messageService.messages)}}let Un=(()=>{class O{constructor(I){this.messageService=I}ngOnInit(){}close(I){this.messageService.messages.splice(this.messageService.messages.indexOf(I),1)}ngOnDestroy(){this.timer&&clearInterval(this.timer)}}return O.\u0275fac=function(I){return new(I||O)(f.Y36(fn.e))},O.\u0275cmp=f.Xpm({type:O,selectors:[["app-message"]],decls:1,vars:1,consts:[["class","position-fixed overflow-hidden text-break","style","top: 10px; right: 0;min-width: 300px; max-width: 300px;z-index: 999;",4,"ngIf"],[1,"position-fixed","overflow-hidden","text-break",2,"top","10px","right","0","min-width","300px","max-width","300px","z-index","999"],[4,"ngFor","ngForOf"],["role","alert"],["type","button","aria-label","Close",1,"btn","btn-lg","close",3,"click"],["aria-hidden","true"]],template:function(I,F){1&I&&f.YNc(0,Vn,2,1,"div",0),2&I&&f.Q6J("ngIf",F.messageService.messages.length)},directives:[_.O5,_.sg],styles:[""]}),O})();function jt(O,x){if(1&O&&(f.TgZ(0,"a",50),f._uU(1),f.qZA()),2&O){const I=f.oxw().$implicit,F=f.oxw();f.s9C("routerLink",F.navChainMap.get(I)),f.xp6(1),f.hij(" ",F.pathFormat(I)," ")}}function Mt(O,x){if(1&O&&(f.TgZ(0,"span",51),f._uU(1),f.qZA()),2&O){const I=f.oxw().$implicit,F=f.oxw();f.xp6(1),f.hij(" ",F.pathFormat(I)," ")}}function Yr(O,x){1&O&&(f.TgZ(0,"span"),f._uU(1,">"),f.qZA())}function Ar(O,x){if(1&O&&(f.TgZ(0,"h6",37),f.YNc(1,jt,2,2,"a",47),f.YNc(2,Mt,2,1,"span",48),f.YNc(3,Yr,2,0,"span",49),f.qZA()),2&O){const I=x.index,F=f.oxw();f.xp6(1),f.Q6J("ngIf",I!==F.navChain.length-1),f.xp6(1),f.Q6J("ngIf",I==F.navChain.length-1),f.xp6(1),f.Q6J("ngIf",I!==F.navChain.length-1)}}const on=function(){return{exact:!1}};let hr=(()=>{class O{constructor(I,F){this.activatedRoute=I,this.router=F,this.title="EdgeX Console",this.isSelected=!1,this.toggleClass="",this.shrink=!1,this.shrinkSidebarOnly=!1,this.shrinkCenterNo=!1,this.navChainMap=new Map,this.navChainCache=[],this.navChain=[],this.currentNav="",this.navRecognized=F.events.pipe((0,en.h)(Q=>Q instanceof pt.R9)),this.navStart=F.events.pipe((0,en.h)(Q=>Q instanceof pt.OD)),this.navEnd=F.events.pipe((0,en.h)(Q=>Q instanceof pt.m2)),this.childStart=F.events.pipe((0,en.h)(Q=>Q instanceof pt.Eb))}ngOnInit(){this.navEnd.subscribe(I=>{this.navChainCache=[],this.navChainMap=new Map,this.currentNav=I.urlAfterRedirects.split("?")[0].split("/").pop(),this.navChain=I.urlAfterRedirects.split("?")[0].split("/"),this.navChain.shift();let F=this;this.navChain.map(Re=>Re).reverse().forEach(function(Re,He){let Bn=F.navChain.map(yn=>yn).reverse().slice(He).reverse().join("/");F.navChainCache.push("/"+Bn),F.navChainMap.set(Re,"/"+Bn)}),this.navChainCache.reverse()}),$(window).resize(()=>{this.shrinkCenterNo=!1,this.shrink=document.body.clientWidth<1340}),this.router.navigate(["/initializer"],{relativeTo:this.activatedRoute})}pathFormat(I){let F=I.split("-");return F.forEach((Q,Re)=>{F[Re]=Q.charAt(0).toUpperCase()+Q.substring(1)}),F.join(" ")}sideBarToggle(){this.shrink?(document.body.clientWidth<1340&&(this.shrinkCenterNo=!0),this.shrink=!1):(document.body.clientWidth<1340&&(this.shrinkCenterNo=!1),this.shrink=!0)}}return O.\u0275fac=function(I){return new(I||O)(f.Y36(pt.gz),f.Y36(pt.F0))},O.\u0275cmp=f.Xpm({type:O,selectors:[["app-root"]],decls:63,vars:46,consts:function(){let x,I,F,Q,Re,He,St,qt,Bn;return x="Dashboard",I="System",F="Metadata",Q="DataCenter",Re="Scheduler",He="Notifications",St="RuleEngine",qt="AppService",Bn="English",[[1,"container-fluid"],[1,"row"],[1,"px-0"],[1,"sidebar-center","font-weight-bold","text-white","vh-100"],[1,"sidebar-header","p-2"],["src","assets/img/bg_x.png","width","35","height","34","alt","","loading","lazy",1,"mt-2"],[1,"float-right","mt-3","mr-2"],["role","button",1,"fa","fa-navicon","fa-lg","text-light",3,"click"],[1,"overflow-hidden"],[1,"nav","flex-column"],["routerLink","/dashboard","routerLinkActive","active-link",1,"nav-link","text-light",3,"routerLinkActiveOptions"],[1,"fa","fa-tachometer","fa-fw","mr-5"],x,["routerLink","/system-agent","routerLinkActive","active-link",1,"nav-link","text-light",3,"routerLinkActiveOptions"],[1,"fa","fa-server","fa-fw","mr-5"],I,["routerLink","/metadata","routerLinkActive","active-link",1,"nav-link","text-light",3,"routerLinkActiveOptions"],[1,"fa","fa-cubes","fa-fw","mr-5"],F,["routerLink","/core-data","routerLinkActive","active-link",1,"nav-link","text-light",3,"routerLinkActiveOptions"],[1,"fa","fa-database","fa-fw","mr-5"],Q,["routerLink","/scheduler","routerLinkActive","active-link",1,"nav-link","text-light",3,"routerLinkActiveOptions"],[1,"fa","fa-clock-o","fa-fw","mr-5"],Re,["routerLink","/notifications","routerLinkActive","active-link",1,"nav-link","text-light",3,"routerLinkActiveOptions"],[1,"fa","fa-envelope","fa-fw","mr-5"],He,["routerLink","/rule-engine","routerLinkActive","active-link",1,"nav-link","text-light",3,"routerLinkActiveOptions"],[1,"fa","fa-sliders","fa-fw","mr-5"],St,["routerLink","/app-service","routerLinkActive","active-link",1,"nav-link","text-light",3,"routerLinkActiveOptions"],[1,"fa","fa-cloud-upload","fa-fw","mr-5"],qt,[1,"col-12"],[1,"bg-light","center-header","px-3","pt-2","font-weight-bold"],[1,"nav-router","mw-100","align-middle"],[1,"d-inline"],[1,"dropdown","float-right"],["id","dropdownLangLink","type","button","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","btn-secondary","btn-sm","dropdown-toggle"],Bn,["aria-labelledby","dropdownLangLink",1,"dropdown-menu","dropdown-menu-sm","dropdown-menu-right"],["href","/",1,"dropdown-item"],["href","/zh",1,"dropdown-item"],[1,"mw-100","align-middle","mt-1"],["class","d-inline",4,"ngFor","ngForOf"],[1,"center-center","p-3"],["class","text-decoration-none d-inline",3,"routerLink",4,"ngIf"],["class","text-decoration-none d-inline",4,"ngIf"],[4,"ngIf"],[1,"text-decoration-none","d-inline",3,"routerLink"],[1,"text-decoration-none","d-inline"]]},template:function(I,F){1&I&&(f._UZ(0,"app-message"),f.TgZ(1,"div",0),f.TgZ(2,"div",1),f.TgZ(3,"div",2),f.TgZ(4,"div",3),f.TgZ(5,"div",4),f._UZ(6,"img",5),f.TgZ(7,"p",6),f.TgZ(8,"i",7),f.NdJ("click",function(){return F.sideBarToggle()}),f.qZA(),f.qZA(),f.qZA(),f.TgZ(9,"div",8),f.TgZ(10,"nav",9),f.TgZ(11,"a",10),f._UZ(12,"i",11),f.TgZ(13,"span"),f.SDv(14,12),f.qZA(),f.qZA(),f.TgZ(15,"a",13),f._UZ(16,"i",14),f.TgZ(17,"span"),f.SDv(18,15),f.qZA(),f.qZA(),f.TgZ(19,"a",16),f._UZ(20,"i",17),f.TgZ(21,"span"),f.SDv(22,18),f.qZA(),f.qZA(),f.TgZ(23,"a",19),f._UZ(24,"i",20),f.TgZ(25,"span"),f.SDv(26,21),f.qZA(),f.qZA(),f.TgZ(27,"a",22),f._UZ(28,"i",23),f.TgZ(29,"span"),f.SDv(30,24),f.qZA(),f.qZA(),f.TgZ(31,"a",25),f._UZ(32,"i",26),f.TgZ(33,"span"),f.SDv(34,27),f.qZA(),f.qZA(),f.TgZ(35,"a",28),f._UZ(36,"i",29),f.TgZ(37,"span"),f.SDv(38,30),f.qZA(),f.qZA(),f.TgZ(39,"a",31),f._UZ(40,"i",32),f.TgZ(41,"span"),f.SDv(42,33),f.qZA(),f.qZA(),f.qZA(),f.qZA(),f.qZA(),f.qZA(),f.TgZ(43,"div",34),f.TgZ(44,"div"),f.TgZ(45,"nav",35),f.TgZ(46,"div",36),f.TgZ(47,"h4",37),f._uU(48),f.qZA(),f.TgZ(49,"div",38),f.TgZ(50,"button",39),f.TgZ(51,"span"),f.SDv(52,40),f.qZA(),f.qZA(),f.TgZ(53,"div",41),f.TgZ(54,"a",42),f._uU(55,"English"),f.qZA(),f.TgZ(56,"a",43),f._uU(57,"\u4e2d\u6587\u7b80\u4f53"),f.qZA(),f.qZA(),f.qZA(),f.qZA(),f.TgZ(58,"div",44),f.TgZ(59,"div",37),f.YNc(60,Ar,4,3,"h6",45),f.qZA(),f.qZA(),f.qZA(),f.TgZ(61,"div",46),f._UZ(62,"router-outlet"),f.qZA(),f.qZA(),f.qZA(),f.qZA(),f.qZA()),2&I&&(f.xp6(3),f.ekj("sidebar-shrink",F.shrink)("sidebar",!F.shrink),f.xp6(3),f.ekj("d-none",F.shrink),f.xp6(5),f.Q6J("routerLinkActiveOptions",f.DdM(38,on)),f.xp6(2),f.ekj("d-none",F.shrink),f.xp6(2),f.Q6J("routerLinkActiveOptions",f.DdM(39,on)),f.xp6(2),f.ekj("d-none",F.shrink),f.xp6(2),f.Q6J("routerLinkActiveOptions",f.DdM(40,on)),f.xp6(2),f.ekj("d-none",F.shrink),f.xp6(2),f.Q6J("routerLinkActiveOptions",f.DdM(41,on)),f.xp6(2),f.ekj("d-none",F.shrink),f.xp6(2),f.Q6J("routerLinkActiveOptions",f.DdM(42,on)),f.xp6(2),f.ekj("d-none",F.shrink),f.xp6(2),f.Q6J("routerLinkActiveOptions",f.DdM(43,on)),f.xp6(2),f.ekj("d-none",F.shrink),f.xp6(2),f.Q6J("routerLinkActiveOptions",f.DdM(44,on)),f.xp6(2),f.ekj("d-none",F.shrink),f.xp6(2),f.Q6J("routerLinkActiveOptions",f.DdM(45,on)),f.xp6(2),f.ekj("d-none",F.shrink),f.xp6(3),f.ekj("center-shrink",F.shrink)("center-no-shrink",F.shrinkCenterNo)("center",!F.shrink),f.xp6(4),f.Oqu(F.pathFormat(F.currentNav)),f.xp6(12),f.Q6J("ngForOf",F.navChain))},directives:[Un,pt.yS,pt.Od,_.sg,pt.lC,_.O5],styles:[".sidebar[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:250px;z-index:10}.sidebar-shrink[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:45px;z-index:10}.sidebar-center[_ngcontent-%COMP%]{background-color:#2d2848e6!important}.sidebar-header[_ngcontent-%COMP%]{background-color:#2d2848!important;height:65px}.active-link[_ngcontent-%COMP%]{color:#922c48;background-color:#922c4866!important}.sidebar-center[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:hover{color:#922c48;background-color:#922c4866!important}.center[_ngcontent-%COMP%]{position:absolute;left:250px;right:0}.center-shrink[_ngcontent-%COMP%]{position:absolute;left:45px;right:0}.center-no-shrink[_ngcontent-%COMP%]{position:absolute;left:45px;right:0}.center-header[_ngcontent-%COMP%]{height:65px}"]}),O})();function dr(O,x){1&O&&(f.TgZ(0,"button",18),f._UZ(1,"span",19),f.TgZ(2,"span"),f._uU(3,"Loading..."),f.qZA(),f.qZA())}function Ht(O,x){if(1&O){const I=f.EpF();f.TgZ(0,"button",20),f.NdJ("click",function(){return f.CHM(I),f.oxw().login()}),f.TgZ(1,"span"),f.SDv(2,21),f.qZA(),f.qZA()}}const Wt=[{path:"login",component:(()=>{class O{constructor(I,F,Q,Re){this.authSvc=I,this.errorSvc=F,this.router=Q,this.route=Re,this.loading=!1,this.accessToken=null,this.tokenIsValid=!0}ngOnInit(){}login(){this.loading=!0,this.authSvc.setAccessToken(this.accessToken),this.authSvc.login().pipe((0,Ut.K)(I=>(this.loading=!1,this.authSvc.isLoggedIn=!1,this.accessToken=null,this.tokenIsValid=!1,(0,Yn._)(I)))).subscribe(()=>{this.authSvc.isLoggedIn=!0,this.loading=!1,this.tokenIsValid=!0,this.router.navigate(["/dashboard"],{relativeTo:this.route})})}renderPopoverComponent(){$('[data-toggle="popover"]').popover({trigger:"hover"})}onInput(){this.tokenIsValid=!0}}return O.\u0275fac=function(I){return new(I||O)(f.Y36(Ln.e),f.Y36(Ot.T),f.Y36(pt.F0),f.Y36(pt.gz))},O.\u0275cmp=f.Xpm({type:O,selectors:[["app-login"]],decls:22,vars:5,consts:function(){let x,I,F,Q,Re;return x="Log in to EdgeX with a token",I="Token",F="the token is invalid!",Q="How to get access token?",Re="Login",[[1,"login","bg-dark"],[1,"card","login-form"],[1,"card-header"],x,[1,"card-body","bg-light","shadow"],[1,""],[1,"form-group"],["for","accessToken",1,"col-form-label"],[1,"mr-1"],I,["type","password","id","accessToken","name","accessToken",1,"form-control",3,"ngModel","ngModelChange"],[1,"invalid-feedback"],F,["class","btn btn-success btn-sm w-100","type","button","disabled","",4,"ngIf"],["type","button","class","btn btn-success btn-sm w-100",3,"click",4,"ngIf"],[1,"mt-2"],["href","https://docs.edgexfoundry.org/2.1/security/Ch-APIGateway/#creating-access-token-for-api-gateway-authentication","target","_blank",1,"text-decoration-none"],Q,["type","button","disabled","",1,"btn","btn-success","btn-sm","w-100"],["role","status","aria-hidden","true",1,"spinner-grow","spinner-grow-sm"],["type","button",1,"btn","btn-success","btn-sm","w-100",3,"click"],Re]},template:function(I,F){1&I&&(f.TgZ(0,"div",0),f.TgZ(1,"div",1),f.TgZ(2,"div",2),f.TgZ(3,"span"),f.SDv(4,3),f.qZA(),f.qZA(),f.TgZ(5,"div",4),f.TgZ(6,"form",5),f.TgZ(7,"div",6),f.TgZ(8,"label",7),f.TgZ(9,"span",8),f.SDv(10,9),f.qZA(),f.qZA(),f.TgZ(11,"div",5),f.TgZ(12,"input",10),f.NdJ("ngModelChange",function(Re){return F.accessToken=Re})("ngModelChange",function(){return F.onInput()}),f.qZA(),f.TgZ(13,"div",11),f.TgZ(14,"small"),f.SDv(15,12),f.qZA(),f.qZA(),f.qZA(),f.qZA(),f.YNc(16,dr,4,0,"button",13),f.YNc(17,Ht,3,0,"button",14),f.TgZ(18,"div",15),f.TgZ(19,"a",16),f.TgZ(20,"small"),f.SDv(21,17),f.qZA(),f.qZA(),f.qZA(),f.qZA(),f.qZA(),f.qZA(),f.qZA()),2&I&&(f.xp6(12),f.ekj("is-invalid",!F.tokenIsValid),f.Q6J("ngModel",F.accessToken),f.xp6(4),f.Q6J("ngIf",F.loading),f.xp6(1),f.Q6J("ngIf",!F.loading))},directives:[ft._Y,ft.JL,ft.F,ft.Fj,ft.JJ,ft.On,_.O5],styles:[".login[_ngcontent-%COMP%]{position:fixed;top:0;bottom:0;left:0;right:0;z-index:999}.login-form[_ngcontent-%COMP%]{position:absolute;left:0;right:0;top:40%;width:350px;margin:auto}"]}),O})()}];let Mr=(()=>{class O{}return O.\u0275fac=function(I){return new(I||O)},O.\u0275mod=f.oAB({type:O}),O.\u0275inj=f.cJS({imports:[[pt.Bz.forChild(Wt)],pt.Bz]}),O})(),hn=(()=>{class O{}return O.\u0275fac=function(I){return new(I||O)},O.\u0275mod=f.oAB({type:O}),O.\u0275inj=f.cJS({imports:[[_.ez,ft.u5,Mr]]}),O})();const pr=[{provide:et.TP,useClass:(()=>{class O{constructor(I){this.authSvc=I}intercept(I,F){let Q=`Bearer ${this.authSvc.getAccessToken()}`,Re=I.headers.set("X-Requested-With","XMLHttpRequest").set("Authorization",Q);const He=I.clone({headers:Re});return F.handle(He)}}return O.\u0275fac=function(I){return new(I||O)(f.LFG(Ln.e))},O.\u0275prov=f.Yz7({token:O,factory:O.\u0275fac,providedIn:"root"}),O})(),multi:!0}];let Tr=(()=>{class O{}return O.\u0275fac=function(I){return new(I||O)},O.\u0275mod=f.oAB({type:O,bootstrap:[hr]}),O.\u0275inj=f.cJS({providers:[pr],imports:[[po,_.ez,ft.u5,et.JF,Zn,hn]]}),O})();(0,f.G48)(),br().bootstrapModule(Tr).catch(O=>console.error(O))},9162:(st,we,N)=>{"use strict";N.d(we,{ZT:()=>f,mG:()=>Ce,Jh:()=>ke,XA:()=>ie,CR:()=>_e,ev:()=>he,qq:()=>$e,FC:()=>Ae,KL:()=>ze});var _=function(ee,U){return(_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,ne){Y.__proto__=ne}||function(Y,ne){for(var De in ne)Object.prototype.hasOwnProperty.call(ne,De)&&(Y[De]=ne[De])})(ee,U)};function f(ee,U){if("function"!=typeof U&&null!==U)throw new TypeError("Class extends value "+String(U)+" is not a constructor or null");function Y(){this.constructor=ee}_(ee,U),ee.prototype=null===U?Object.create(U):(Y.prototype=U.prototype,new Y)}function Ce(ee,U,Y,ne){return new(Y||(Y=Promise))(function(K,We){function q(Ve){try{ye(ne.next(Ve))}catch(Je){We(Je)}}function Me(Ve){try{ye(ne.throw(Ve))}catch(Je){We(Je)}}function ye(Ve){Ve.done?K(Ve.value):function(K){return K instanceof Y?K:new Y(function(We){We(K)})}(Ve.value).then(q,Me)}ye((ne=ne.apply(ee,U||[])).next())})}function ke(ee,U){var ne,De,K,We,Y={label:0,sent:function(){if(1&K[0])throw K[1];return K[1]},trys:[],ops:[]};return We={next:q(0),throw:q(1),return:q(2)},"function"==typeof Symbol&&(We[Symbol.iterator]=function(){return this}),We;function q(ye){return function(Ve){return function(ye){if(ne)throw new TypeError("Generator is already executing.");for(;Y;)try{if(ne=1,De&&(K=2&ye[0]?De.return:ye[0]?De.throw||((K=De.return)&&K.call(De),0):De.next)&&!(K=K.call(De,ye[1])).done)return K;switch(De=0,K&&(ye=[2&ye[0],K.value]),ye[0]){case 0:case 1:K=ye;break;case 4:return Y.label++,{value:ye[1],done:!1};case 5:Y.label++,De=ye[1],ye=[0];continue;case 7:ye=Y.ops.pop(),Y.trys.pop();continue;default:if(!(K=(K=Y.trys).length>0&&K[K.length-1])&&(6===ye[0]||2===ye[0])){Y=0;continue}if(3===ye[0]&&(!K||ye[1]>K[0]&&ye[1]<K[3])){Y.label=ye[1];break}if(6===ye[0]&&Y.label<K[1]){Y.label=K[1],K=ye;break}if(K&&Y.label<K[2]){Y.label=K[2],Y.ops.push(ye);break}K[2]&&Y.ops.pop(),Y.trys.pop();continue}ye=U.call(ee,Y)}catch(Ve){ye=[6,Ve],De=0}finally{ne=K=0}if(5&ye[0])throw ye[1];return{value:ye[0]?ye[1]:void 0,done:!0}}([ye,Ve])}}}function ie(ee){var U="function"==typeof Symbol&&Symbol.iterator,Y=U&&ee[U],ne=0;if(Y)return Y.call(ee);if(ee&&"number"==typeof ee.length)return{next:function(){return ee&&ne>=ee.length&&(ee=void 0),{value:ee&&ee[ne++],done:!ee}}};throw new TypeError(U?"Object is not iterable.":"Symbol.iterator is not defined.")}function _e(ee,U){var Y="function"==typeof Symbol&&ee[Symbol.iterator];if(!Y)return ee;var De,We,ne=Y.call(ee),K=[];try{for(;(void 0===U||U-- >0)&&!(De=ne.next()).done;)K.push(De.value)}catch(q){We={error:q}}finally{try{De&&!De.done&&(Y=ne.return)&&Y.call(ne)}finally{if(We)throw We.error}}return K}function he(ee,U){for(var Y=0,ne=U.length,De=ee.length;Y<ne;Y++,De++)ee[De]=U[Y];return ee}function $e(ee){return this instanceof $e?(this.v=ee,this):new $e(ee)}function Ae(ee,U,Y){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var De,ne=Y.apply(ee,U||[]),K=[];return De={},We("next"),We("throw"),We("return"),De[Symbol.asyncIterator]=function(){return this},De;function We(nt){ne[nt]&&(De[nt]=function(yt){return new Promise(function(Vt,Gt){K.push([nt,yt,Vt,Gt])>1||q(nt,yt)})})}function q(nt,yt){try{!function(nt){nt.value instanceof $e?Promise.resolve(nt.value.v).then(ye,Ve):Je(K[0][2],nt)}(ne[nt](yt))}catch(Vt){Je(K[0][3],Vt)}}function ye(nt){q("next",nt)}function Ve(nt){q("throw",nt)}function Je(nt,yt){nt(yt),K.shift(),K.length&&q(K[0][0],K[0][1])}}function ze(ee){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Y,U=ee[Symbol.asyncIterator];return U?U.call(ee):(ee=ie(ee),Y={},ne("next"),ne("throw"),ne("return"),Y[Symbol.asyncIterator]=function(){return this},Y);function ne(K){Y[K]=ee[K]&&function(We){return new Promise(function(q,Me){!function(K,We,q,Me){Promise.resolve(Me).then(function(ye){K({value:ye,done:q})},We)}(q,Me,(We=ee[K](We)).done,We.value)})}}}}},st=>{st(st.s=1611)}]);
|
/**
* @class Ext.data.schema.Reference
*
* **This is not a real JavaScript class and cannot be created. This is for documentation purposes only.**
*
* This documentation is for:
*
* + {@link Ext.data.field.Field#reference reference config}
*
* The {@link Ext.data.Model#entityName name} of the entity referenced by this field.
* In most databases, this relationship is represented by a "foreign key". That is, a
* value for such a field matches the value of the {@link Ext.data.Model#idProperty id}
* for an entity of this type.
*
* Ext.define('MyApp.models.Organization', {
* extend: 'Ext.data.Model',
* ...
* });
*
* Ext.define('MyApp.models.User', {
* extend: 'Ext.data.Model',
*
* fields: [
* { name: 'organizationId', reference: 'Organization' }
* ],
* ...
* });
*
* If a `reference` is not nullable, set the {@link Ext.data.field.Field#allowBlank} property
* to false.
*
* Ext.define('MyApp.models.User', {
* extend: 'Ext.data.Model',
*
* fields: [
* { name: 'organizationId', reference: 'Organization', allowBlank: false }
* ],
* ...
* });
*
* If the name of the generated {@link Ext.data.schema.Association association} or other aspects
* need to be specified, the `reference` can be an object. The following usage shows
* what would be generated by default given the above examples using the string form.
*
* Ext.define('MyApp.models.User', {
* extend: 'Ext.data.Model',
*
* fields: [{
* name: 'organizationId',
* reference: {
* type: 'Organization',
* association: 'UsersByOrganization',
* role: 'organization',
* inverse: 'users'
* }
* }],
* ...
* });
*
* Finally, a `reference` can also describe ownership between the entities. By default,
* no ownership relationship is assumed. If, however, the User entities are owned by
* their Organization, we could say this:
*
* Ext.define('MyApp.models.User', {
* extend: 'Ext.data.Model',
*
* fields: [{
* name: 'organizationId',
* reference: {
* parent: 'Organization' // Organization is the parent of User
* }
* }],
* ...
* });
*/
/**
* @cfg {String} type
* The type which this field references. This is the value set by the string form of
* `reference`. If the referenced entity has an ownership relationship this field
* should be omitted and `reference.parent` or `reference.child` should be specified
* instead.
*/
/**
* @cfg {String} association
* The name of the association. By default, the name of the association is the
* capitalized `inverse` plus "By" plus the capitalized `role`.
*/
/**
* @cfg {String} child
* Set this property instead of `reference.type` to indicate that the referenced entity
* is an owned child of this entity. That is, the `reference` entity should be deleted
* when this entity is deleted.
*/
/**
* @cfg {String} parent
* Set this property instead of `reference.type` to indicate that the referenced entity
* is the owning parent of this entity. That is, this entity should be deleted when the
* `reference` entity is deleted.
*
*/
/**
* @cfg {String} role
* The name of the role played by the referenced entity. By default, this is the field
* name (minus its "Id" suffix if present).
*/
/**
* @cfg {String} [getterName] The name of the getter function. Typically this is generated
* based on the {@link #role}.
*/
/**
* @cfg {String} [getterName] The name of the setter function (if required). Typically this is generated
* based on the {@link #role}.
*/
/**
* @cfg {Object} [reader] A custom {@link Ext.data.reader.Reader} configuration for reading
* nested data.
*/
/**
* @cfg {Boolean} [unique] `true` True for this reference to create a `Ext.data.schema.OneToOne`
* relationship. If not specified, the default is `Ext.data.schema.ManyToOne`.
*/
/**
* @cfg {String/Object} inverse
* The name of the inverse role (of this entity with respect to the `reference`
* entity). By default, this is the {@link Ext.util.Inflector#pluralize pluralized}
* name of this entity, unless this `reference` is `unique`, in which case the default
* name is the {@link Ext.util.Inflector#singularize singularized} name of this entity.
*
* This config may also be an object containing a role, getter, or setter.
*/
|
import { compileToFunctions } from 'vue-template-compiler'
import mount from '~src/mount'
import ComponentWithProps from '~resources/components/component-with-props.vue'
describe('setProps', () => {
it('sets component props and updates DOM when called on Vue instance', () => {
const prop1 = 'prop 1'
const prop2 = 'prop 2'
const propsData = { prop1: 'a prop', prop2 }
const TestComponent = {
render: h => h(ComponentWithProps, { props: propsData })
}
const wrapper = mount(TestComponent)
wrapper.findAll(ComponentWithProps).setProps({ prop1 })
expect(wrapper.find('.prop-1').element.textContent).to.equal(prop1)
expect(wrapper.find('.prop-2').element.textContent).to.equal(prop2)
})
it('sets component props, and updates DOM when propsData was not initially passed', () => {
const TestComponent = {
render: h => h(ComponentWithProps)
}
const prop1 = 'prop 1'
const prop2 = 'prop s'
const wrapper = mount(TestComponent)
wrapper.findAll(ComponentWithProps).setProps({ prop1, prop2 })
expect(wrapper.find('.prop-1').element.textContent).to.equal(prop1)
expect(wrapper.find('.prop-2').element.textContent).to.equal(prop2)
})
it('throws an error if node is not a Vue instance', () => {
const message = '[vue-test-utils]: wrapper.setProps() can only be called on a Vue instance'
const compiled = compileToFunctions('<div><p></p></div>')
const wrapper = mount(compiled)
const p = wrapper.findAll('p')
const fn = () => p.setProps({ ready: true })
expect(fn).to.throw().with.property('message', message)
})
it('throws error if wrapper array contains no items', () => {
const compiled = compileToFunctions('<div />')
const message = '[vue-test-utils]: setProps cannot be called on 0 items'
const fn = () => mount(compiled).findAll('p').setProps('p')
expect(fn).to.throw().with.property('message', message)
})
})
|
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
(factory((global.Recompose = {}),global.React));
}(this, (function (exports,React) { 'use strict';
var React__default = 'default' in React ? React['default'] : React;
// https://reactjs.org/blog/2020/02/26/react-v16.13.0.html#deprecating-reactcreatefactory
var createFactory = function createFactory(type) {
return React.createElement.bind(null, type);
};
var setStatic = function setStatic(key, value) {
return function (BaseComponent) {
/* eslint-disable no-param-reassign */
BaseComponent[key] = value;
/* eslint-enable no-param-reassign */
return BaseComponent;
};
};
var setDisplayName = function setDisplayName(displayName) {
return setStatic('displayName', displayName);
};
var getDisplayName = function getDisplayName(Component) {
if (typeof Component === 'string') {
return Component;
}
if (!Component) {
return undefined;
}
return Component.displayName || Component.name || 'Component';
};
var wrapDisplayName = function wrapDisplayName(BaseComponent, hocName) {
return hocName + "(" + getDisplayName(BaseComponent) + ")";
};
var mapProps = function mapProps(propsMapper) {
return function (BaseComponent) {
var factory = createFactory(BaseComponent);
var MapProps = function MapProps(props) {
return factory(propsMapper(props));
};
{
return setDisplayName(wrapDisplayName(BaseComponent, 'mapProps'))(MapProps);
}
return MapProps;
};
};
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
var withProps = function withProps(input) {
var hoc = mapProps(function (props) {
return _extends({}, props, typeof input === 'function' ? input(props) : input);
});
{
return function (BaseComponent) {
return setDisplayName(wrapDisplayName(BaseComponent, 'withProps'))(hoc(BaseComponent));
};
}
return hoc;
};
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
subClass.__proto__ = superClass;
}
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
function componentWillMount() {
// Call this.constructor.gDSFP to support sub-classes.
var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
if (state !== null && state !== undefined) {
this.setState(state);
}
}
function componentWillReceiveProps(nextProps) {
// Call this.constructor.gDSFP to support sub-classes.
var state = this.constructor.getDerivedStateFromProps(nextProps, this.state);
if (state !== null && state !== undefined) {
this.setState(state);
}
}
function componentWillUpdate(nextProps, nextState) {
try {
var prevProps = this.props;
var prevState = this.state;
this.props = nextProps;
this.state = nextState;
this.__reactInternalSnapshotFlag = true;
this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
prevProps,
prevState
);
} finally {
this.props = prevProps;
this.state = prevState;
}
}
// React may warn about cWM/cWRP/cWU methods being deprecated.
// Add a flag to suppress these warnings for this special case.
componentWillMount.__suppressDeprecationWarning = true;
componentWillReceiveProps.__suppressDeprecationWarning = true;
componentWillUpdate.__suppressDeprecationWarning = true;
function polyfill(Component) {
var prototype = Component.prototype;
if (!prototype || !prototype.isReactComponent) {
throw new Error('Can only polyfill class components');
}
if (
typeof Component.getDerivedStateFromProps !== 'function' &&
typeof prototype.getSnapshotBeforeUpdate !== 'function'
) {
return Component;
}
// If new component APIs are defined, "unsafe" lifecycles won't be called.
// Error if any of these lifecycles are present,
// Because they would work differently between older and newer (16.3+) versions of React.
var foundWillMountName = null;
var foundWillReceivePropsName = null;
var foundWillUpdateName = null;
if (typeof prototype.componentWillMount === 'function') {
foundWillMountName = 'componentWillMount';
} else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
foundWillMountName = 'UNSAFE_componentWillMount';
}
if (typeof prototype.componentWillReceiveProps === 'function') {
foundWillReceivePropsName = 'componentWillReceiveProps';
} else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
}
if (typeof prototype.componentWillUpdate === 'function') {
foundWillUpdateName = 'componentWillUpdate';
} else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
foundWillUpdateName = 'UNSAFE_componentWillUpdate';
}
if (
foundWillMountName !== null ||
foundWillReceivePropsName !== null ||
foundWillUpdateName !== null
) {
var componentName = Component.displayName || Component.name;
var newApiName =
typeof Component.getDerivedStateFromProps === 'function'
? 'getDerivedStateFromProps()'
: 'getSnapshotBeforeUpdate()';
throw Error(
'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' +
componentName +
' uses ' +
newApiName +
' but also contains the following legacy lifecycles:' +
(foundWillMountName !== null ? '\n ' + foundWillMountName : '') +
(foundWillReceivePropsName !== null
? '\n ' + foundWillReceivePropsName
: '') +
(foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') +
'\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' +
'https://fb.me/react-async-component-lifecycle-hooks'
);
}
// React <= 16.2 does not support static getDerivedStateFromProps.
// As a workaround, use cWM and cWRP to invoke the new static lifecycle.
// Newer versions of React will ignore these lifecycles if gDSFP exists.
if (typeof Component.getDerivedStateFromProps === 'function') {
prototype.componentWillMount = componentWillMount;
prototype.componentWillReceiveProps = componentWillReceiveProps;
}
// React <= 16.2 does not support getSnapshotBeforeUpdate.
// As a workaround, use cWU to invoke the new lifecycle.
// Newer versions of React will ignore that lifecycle if gSBU exists.
if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
if (typeof prototype.componentDidUpdate !== 'function') {
throw new Error(
'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'
);
}
prototype.componentWillUpdate = componentWillUpdate;
var componentDidUpdate = prototype.componentDidUpdate;
prototype.componentDidUpdate = function componentDidUpdatePolyfill(
prevProps,
prevState,
maybeSnapshot
) {
// 16.3+ will not execute our will-update method;
// It will pass a snapshot value to did-update though.
// Older versions will require our polyfilled will-update value.
// We need to handle both cases, but can't just check for the presence of "maybeSnapshot",
// Because for <= 15.x versions this might be a "prevContext" object.
// We also can't just check "__reactInternalSnapshot",
// Because get-snapshot might return a falsy value.
// So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.
var snapshot = this.__reactInternalSnapshotFlag
? this.__reactInternalSnapshot
: maybeSnapshot;
componentDidUpdate.call(this, prevProps, prevState, snapshot);
};
}
return Component;
}
var pick = function pick(obj, keys) {
var result = {};
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (obj.hasOwnProperty(key)) {
result[key] = obj[key];
}
}
return result;
};
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule shallowEqual
* @typechecks
*/
/* eslint-disable no-self-compare */
var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* inlined Object.is polyfill to avoid requiring consumers ship their own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
function is(x, y) {
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
// Added the nonzero y check to make Flow happy, but it is redundant
return x !== 0 || y !== 0 || 1 / x === 1 / y;
} // Step 6.a: NaN == NaN
return x !== x && y !== y;
}
/**
* Performs equality by iterating through keys on an object and returning false
* when any key has values which are not strictly equal between the arguments.
* Returns true when the values of all keys are strictly equal.
*/
function shallowEqual(objA, objB) {
if (is(objA, objB)) {
return true;
}
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
} // Test for A's keys different from B.
for (var i = 0; i < keysA.length; i++) {
if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
return false;
}
}
return true;
}
var withPropsOnChange = function withPropsOnChange(shouldMapOrKeys, propsMapper) {
return function (BaseComponent) {
var factory = createFactory(BaseComponent);
var shouldMap = typeof shouldMapOrKeys === 'function' ? shouldMapOrKeys : function (props, nextProps) {
return !shallowEqual(pick(props, shouldMapOrKeys), pick(nextProps, shouldMapOrKeys));
};
var WithPropsOnChange =
/*#__PURE__*/
function (_Component) {
_inheritsLoose(WithPropsOnChange, _Component);
function WithPropsOnChange() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
_this.state = {
computedProps: propsMapper(_this.props),
prevProps: _this.props
};
return _this;
}
WithPropsOnChange.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
if (shouldMap(prevState.prevProps, nextProps)) {
return {
computedProps: propsMapper(nextProps),
prevProps: nextProps
};
}
return {
prevProps: nextProps
};
};
var _proto = WithPropsOnChange.prototype;
_proto.render = function render() {
return factory(_extends({}, this.props, this.state.computedProps));
};
return WithPropsOnChange;
}(React.Component);
polyfill(WithPropsOnChange);
{
return setDisplayName(wrapDisplayName(BaseComponent, 'withPropsOnChange'))(WithPropsOnChange);
}
return WithPropsOnChange;
};
};
var mapValues = function mapValues(obj, func) {
var result = {};
/* eslint-disable no-restricted-syntax */
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
result[key] = func(obj[key], key);
}
}
/* eslint-enable no-restricted-syntax */
return result;
};
var withHandlers = function withHandlers(handlers) {
return function (BaseComponent) {
var factory = createFactory(BaseComponent);
var WithHandlers =
/*#__PURE__*/
function (_Component) {
_inheritsLoose(WithHandlers, _Component);
function WithHandlers() {
var _this;
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
_args[_key] = arguments[_key];
}
_this = _Component.call.apply(_Component, [this].concat(_args)) || this;
_this.handlers = mapValues(typeof handlers === 'function' ? handlers(_this.props) : handlers, function (createHandler) {
return function () {
var handler = createHandler(_this.props);
if (typeof handler !== 'function') {
console.error( // eslint-disable-line no-console
'withHandlers(): Expected a map of higher-order functions. ' + 'Refer to the docs for more info.');
}
return handler.apply(void 0, arguments);
};
});
return _this;
}
var _proto = WithHandlers.prototype;
_proto.render = function render() {
return factory(_extends({}, this.props, this.handlers));
};
return WithHandlers;
}(React.Component);
{
return setDisplayName(wrapDisplayName(BaseComponent, 'withHandlers'))(WithHandlers);
}
return WithHandlers;
};
};
var defaultProps = function defaultProps(props) {
return function (BaseComponent) {
var factory = createFactory(BaseComponent);
var DefaultProps = function DefaultProps(ownerProps) {
return factory(ownerProps);
};
DefaultProps.defaultProps = props;
{
return setDisplayName(wrapDisplayName(BaseComponent, 'defaultProps'))(DefaultProps);
}
return DefaultProps;
};
};
var omit = function omit(obj, keys) {
var rest = _extends({}, obj);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (rest.hasOwnProperty(key)) {
delete rest[key];
}
}
return rest;
};
var renameProp = function renameProp(oldName, newName) {
var hoc = mapProps(function (props) {
var _extends2;
return _extends({}, omit(props, [oldName]), (_extends2 = {}, _extends2[newName] = props[oldName], _extends2));
});
{
return function (BaseComponent) {
return setDisplayName(wrapDisplayName(BaseComponent, 'renameProp'))(hoc(BaseComponent));
};
}
return hoc;
};
var keys = Object.keys;
var mapKeys = function mapKeys(obj, func) {
return keys(obj).reduce(function (result, key) {
var val = obj[key];
/* eslint-disable no-param-reassign */
result[func(val, key)] = val;
/* eslint-enable no-param-reassign */
return result;
}, {});
};
var renameProps = function renameProps(nameMap) {
var hoc = mapProps(function (props) {
return _extends({}, omit(props, keys(nameMap)), mapKeys(pick(props, keys(nameMap)), function (_, oldName) {
return nameMap[oldName];
}));
});
{
return function (BaseComponent) {
return setDisplayName(wrapDisplayName(BaseComponent, 'renameProps'))(hoc(BaseComponent));
};
}
return hoc;
};
var flattenProp = function flattenProp(propName) {
return function (BaseComponent) {
var factory = createFactory(BaseComponent);
var FlattenProp = function FlattenProp(props) {
return factory(_extends({}, props, props[propName]));
};
{
return setDisplayName(wrapDisplayName(BaseComponent, 'flattenProp'))(FlattenProp);
}
return FlattenProp;
};
};
var withState = function withState(stateName, stateUpdaterName, initialState) {
return function (BaseComponent) {
var factory = createFactory(BaseComponent);
var WithState =
/*#__PURE__*/
function (_Component) {
_inheritsLoose(WithState, _Component);
function WithState() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
_this.state = {
stateValue: typeof initialState === 'function' ? initialState(_this.props) : initialState
};
_this.updateStateValue = function (updateFn, callback) {
return _this.setState(function (_ref) {
var stateValue = _ref.stateValue;
return {
stateValue: typeof updateFn === 'function' ? updateFn(stateValue) : updateFn
};
}, callback);
};
return _this;
}
var _proto = WithState.prototype;
_proto.render = function render() {
var _extends2;
return factory(_extends({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[stateUpdaterName] = this.updateStateValue, _extends2)));
};
return WithState;
}(React.Component);
{
return setDisplayName(wrapDisplayName(BaseComponent, 'withState'))(WithState);
}
return WithState;
};
};
var withStateHandlers = function withStateHandlers(initialState, stateUpdaters) {
return function (BaseComponent) {
var factory = createFactory(BaseComponent);
var WithStateHandlers =
/*#__PURE__*/
function (_Component) {
_inheritsLoose(WithStateHandlers, _Component);
function WithStateHandlers() {
var _this;
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
_args[_key] = arguments[_key];
}
_this = _Component.call.apply(_Component, [this].concat(_args)) || this;
_this.state = typeof initialState === 'function' ? initialState(_this.props) : initialState;
_this.stateUpdaters = mapValues(stateUpdaters, function (handler) {
return function (mayBeEvent) {
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
// Having that functional form of setState can be called async
// we need to persist SyntheticEvent
if (mayBeEvent && typeof mayBeEvent.persist === 'function') {
mayBeEvent.persist();
}
_this.setState(function (state, props) {
return handler(state, props).apply(void 0, [mayBeEvent].concat(args));
});
};
});
return _this;
}
var _proto = WithStateHandlers.prototype;
_proto.render = function render() {
return factory(_extends({}, this.props, this.state, this.stateUpdaters));
};
return WithStateHandlers;
}(React.Component);
{
return setDisplayName(wrapDisplayName(BaseComponent, 'withStateHandlers'))(WithStateHandlers);
}
return WithStateHandlers;
};
};
var noop = function noop() {};
var withReducer = function withReducer(stateName, dispatchName, reducer, initialState) {
return function (BaseComponent) {
var factory = createFactory(BaseComponent);
var WithReducer =
/*#__PURE__*/
function (_Component) {
_inheritsLoose(WithReducer, _Component);
function WithReducer() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
_this.state = {
stateValue: _this.initializeStateValue()
};
_this.dispatch = function (action, callback) {
if (callback === void 0) {
callback = noop;
}
return _this.setState(function (_ref) {
var stateValue = _ref.stateValue;
return {
stateValue: reducer(stateValue, action)
};
}, function () {
return callback(_this.state.stateValue);
});
};
return _this;
}
var _proto = WithReducer.prototype;
_proto.initializeStateValue = function initializeStateValue() {
if (initialState !== undefined) {
return typeof initialState === 'function' ? initialState(this.props) : initialState;
}
return reducer(undefined, {
type: '@@recompose/INIT'
});
};
_proto.render = function render() {
var _extends2;
return factory(_extends({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[dispatchName] = this.dispatch, _extends2)));
};
return WithReducer;
}(React.Component);
{
return setDisplayName(wrapDisplayName(BaseComponent, 'withReducer'))(WithReducer);
}
return WithReducer;
};
};
var identity = function identity(Component) {
return Component;
};
var branch = function branch(test, left, right) {
if (right === void 0) {
right = identity;
}
return function (BaseComponent) {
var leftFactory;
var rightFactory;
var Branch = function Branch(props) {
if (test(props)) {
leftFactory = leftFactory || createFactory(left(BaseComponent));
return leftFactory(props);
}
rightFactory = rightFactory || createFactory(right(BaseComponent));
return rightFactory(props);
};
{
return setDisplayName(wrapDisplayName(BaseComponent, 'branch'))(Branch);
}
return Branch;
};
};
var renderComponent = function renderComponent(Component) {
return function (_) {
var factory = createFactory(Component);
var RenderComponent = function RenderComponent(props) {
return factory(props);
};
{
RenderComponent.displayName = wrapDisplayName(Component, 'renderComponent');
}
return RenderComponent;
};
};
var Nothing =
/*#__PURE__*/
function (_Component) {
_inheritsLoose(Nothing, _Component);
function Nothing() {
return _Component.apply(this, arguments) || this;
}
var _proto = Nothing.prototype;
_proto.render = function render() {
return null;
};
return Nothing;
}(React.Component);
var renderNothing = function renderNothing(_) {
return Nothing;
};
var shouldUpdate = function shouldUpdate(test) {
return function (BaseComponent) {
var factory = createFactory(BaseComponent);
var ShouldUpdate =
/*#__PURE__*/
function (_Component) {
_inheritsLoose(ShouldUpdate, _Component);
function ShouldUpdate() {
return _Component.apply(this, arguments) || this;
}
var _proto = ShouldUpdate.prototype;
_proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
return test(this.props, nextProps);
};
_proto.render = function render() {
return factory(this.props);
};
return ShouldUpdate;
}(React.Component);
{
return setDisplayName(wrapDisplayName(BaseComponent, 'shouldUpdate'))(ShouldUpdate);
}
return ShouldUpdate;
};
};
var pure = function pure(BaseComponent) {
var hoc = shouldUpdate(function (props, nextProps) {
return !shallowEqual(props, nextProps);
});
{
return setDisplayName(wrapDisplayName(BaseComponent, 'pure'))(hoc(BaseComponent));
}
return hoc(BaseComponent);
};
var onlyUpdateForKeys = function onlyUpdateForKeys(propKeys) {
var hoc = shouldUpdate(function (props, nextProps) {
return !shallowEqual(pick(nextProps, propKeys), pick(props, propKeys));
});
{
return function (BaseComponent) {
return setDisplayName(wrapDisplayName(BaseComponent, 'onlyUpdateForKeys'))(hoc(BaseComponent));
};
}
return hoc;
};
var onlyUpdateForPropTypes = function onlyUpdateForPropTypes(BaseComponent) {
var propTypes = BaseComponent.propTypes;
{
if (!propTypes) {
/* eslint-disable */
console.error('A component without any `propTypes` was passed to ' + '`onlyUpdateForPropTypes()`. Check the implementation of the ' + ("component with display name \"" + getDisplayName(BaseComponent) + "\"."));
/* eslint-enable */
}
}
var propKeys = Object.keys(propTypes || {});
var OnlyUpdateForPropTypes = onlyUpdateForKeys(propKeys)(BaseComponent);
{
return setDisplayName(wrapDisplayName(BaseComponent, 'onlyUpdateForPropTypes'))(OnlyUpdateForPropTypes);
}
return OnlyUpdateForPropTypes;
};
var withContext = function withContext(childContextTypes, getChildContext) {
return function (BaseComponent) {
var factory = createFactory(BaseComponent);
var WithContext =
/*#__PURE__*/
function (_Component) {
_inheritsLoose(WithContext, _Component);
function WithContext() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
_this.getChildContext = function () {
return getChildContext(_this.props);
};
return _this;
}
var _proto = WithContext.prototype;
_proto.render = function render() {
return factory(this.props);
};
return WithContext;
}(React.Component);
WithContext.childContextTypes = childContextTypes;
{
return setDisplayName(wrapDisplayName(BaseComponent, 'withContext'))(WithContext);
}
return WithContext;
};
};
var getContext = function getContext(contextTypes) {
return function (BaseComponent) {
var factory = createFactory(BaseComponent);
var GetContext = function GetContext(ownerProps, context) {
return factory(_extends({}, ownerProps, context));
};
GetContext.contextTypes = contextTypes;
{
return setDisplayName(wrapDisplayName(BaseComponent, 'getContext'))(GetContext);
}
return GetContext;
};
};
var lifecycle = function lifecycle(spec) {
return function (BaseComponent) {
var factory = createFactory(BaseComponent);
if (spec.hasOwnProperty('render')) {
console.error('lifecycle() does not support the render method; its behavior is to ' + 'pass all props and state to the base component.');
}
var Lifecycle =
/*#__PURE__*/
function (_Component) {
_inheritsLoose(Lifecycle, _Component);
function Lifecycle() {
return _Component.apply(this, arguments) || this;
}
var _proto = Lifecycle.prototype;
_proto.render = function render() {
return factory(_extends({}, this.props, this.state));
};
return Lifecycle;
}(React.Component);
Object.keys(spec).forEach(function (hook) {
return Lifecycle.prototype[hook] = spec[hook];
});
{
return setDisplayName(wrapDisplayName(BaseComponent, 'lifecycle'))(Lifecycle);
}
return Lifecycle;
};
};
var isClassComponent = function isClassComponent(Component) {
return Boolean(Component && Component.prototype && typeof Component.prototype.render === 'function');
};
var toClass = function toClass(baseComponent) {
var _class, _temp;
return isClassComponent(baseComponent) ? baseComponent : (_temp = _class =
/*#__PURE__*/
function (_Component) {
_inheritsLoose(ToClass, _Component);
function ToClass() {
return _Component.apply(this, arguments) || this;
}
var _proto = ToClass.prototype;
_proto.render = function render() {
if (typeof baseComponent === 'string') {
return React__default.createElement(baseComponent, this.props);
}
return baseComponent(this.props, this.context);
};
return ToClass;
}(React.Component), _class.displayName = getDisplayName(baseComponent), _class.propTypes = baseComponent.propTypes, _class.contextTypes = baseComponent.contextTypes, _class.defaultProps = baseComponent.defaultProps, _temp);
};
function toRenderProps(hoc) {
var RenderPropsComponent = function RenderPropsComponent(props) {
return props.children(props);
};
return hoc(RenderPropsComponent);
}
var fromRenderProps = function fromRenderProps(RenderPropsComponent, propsMapper, renderPropName) {
if (renderPropName === void 0) {
renderPropName = 'children';
}
return function (BaseComponent) {
var baseFactory = createFactory(BaseComponent);
var renderPropsFactory = createFactory(RenderPropsComponent);
var FromRenderProps = function FromRenderProps(ownerProps) {
var _renderPropsFactory;
return renderPropsFactory((_renderPropsFactory = {}, _renderPropsFactory[renderPropName] = function () {
return baseFactory(_extends({}, ownerProps, propsMapper.apply(void 0, arguments)));
}, _renderPropsFactory));
};
{
return setDisplayName(wrapDisplayName(BaseComponent, 'fromRenderProps'))(FromRenderProps);
}
return FromRenderProps;
};
};
var setPropTypes = function setPropTypes(propTypes) {
return setStatic('propTypes', propTypes);
};
var compose = function compose() {
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
funcs[_key] = arguments[_key];
}
return funcs.reduce(function (a, b) {
return function () {
return a(b.apply(void 0, arguments));
};
}, function (arg) {
return arg;
});
};
var createSink = function createSink(callback) {
var Sink =
/*#__PURE__*/
function (_Component) {
_inheritsLoose(Sink, _Component);
function Sink() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
_this.state = {};
return _this;
}
Sink.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {
callback(nextProps);
return null;
};
var _proto = Sink.prototype;
_proto.render = function render() {
return null;
};
return Sink;
}(React.Component);
polyfill(Sink);
return Sink;
};
var componentFromProp = function componentFromProp(propName) {
var Component = function Component(props) {
return React.createElement(props[propName], omit(props, [propName]));
};
Component.displayName = "componentFromProp(" + propName + ")";
return Component;
};
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
var nest = function nest() {
for (var _len = arguments.length, Components = new Array(_len), _key = 0; _key < _len; _key++) {
Components[_key] = arguments[_key];
}
var factories = Components.map(createFactory);
var Nest = function Nest(_ref) {
var children = _ref.children,
props = _objectWithoutPropertiesLoose(_ref, ["children"]);
return factories.reduceRight(function (child, factory) {
return factory(props, child);
}, children);
};
{
var displayNames = Components.map(getDisplayName);
Nest.displayName = "nest(" + displayNames.join(', ') + ")";
}
return Nest;
};
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
var REACT_STATICS = {
childContextTypes: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
callee: true,
arguments: true,
arity: true
};
var defineProperty = Object.defineProperty;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getPrototypeOf = Object.getPrototypeOf;
var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
var hoistNonReactStatics = function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
if (objectPrototype) {
var inheritedComponent = getPrototypeOf(sourceComponent);
if (inheritedComponent && inheritedComponent !== objectPrototype) {
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
}
}
var keys = getOwnPropertyNames(sourceComponent);
if (getOwnPropertySymbols) {
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
}
for (var i = 0; i < keys.length; ++i) {
var key = keys[i];
if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
try { // Avoid failures from read-only properties
defineProperty(targetComponent, key, descriptor);
} catch (e) {}
}
}
return targetComponent;
}
return targetComponent;
};
var hoistStatics = function hoistStatics(higherOrderComponent, blacklist) {
return function (BaseComponent) {
var NewComponent = higherOrderComponent(BaseComponent);
hoistNonReactStatics(NewComponent, BaseComponent, blacklist);
return NewComponent;
};
};
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function unwrapExports (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var lib = createCommonjsModule(function (module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var createChangeEmitter = exports.createChangeEmitter = function createChangeEmitter() {
var currentListeners = [];
var nextListeners = currentListeners;
function ensureCanMutateNextListeners() {
if (nextListeners === currentListeners) {
nextListeners = currentListeners.slice();
}
}
function listen(listener) {
if (typeof listener !== 'function') {
throw new Error('Expected listener to be a function.');
}
var isSubscribed = true;
ensureCanMutateNextListeners();
nextListeners.push(listener);
return function () {
if (!isSubscribed) {
return;
}
isSubscribed = false;
ensureCanMutateNextListeners();
var index = nextListeners.indexOf(listener);
nextListeners.splice(index, 1);
};
}
function emit() {
currentListeners = nextListeners;
var listeners = currentListeners;
for (var i = 0; i < listeners.length; i++) {
listeners[i].apply(listeners, arguments);
}
}
return {
listen: listen,
emit: emit
};
};
});
unwrapExports(lib);
var lib_1 = lib.createChangeEmitter;
var ponyfill = createCommonjsModule(function (module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = symbolObservablePonyfill;
function symbolObservablePonyfill(root) {
var result;
var _Symbol = root.Symbol;
if (typeof _Symbol === 'function') {
if (_Symbol.observable) {
result = _Symbol.observable;
} else {
result = _Symbol('observable');
_Symbol.observable = result;
}
} else {
result = '@@observable';
}
return result;
}});
unwrapExports(ponyfill);
var lib$1 = createCommonjsModule(function (module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _ponyfill2 = _interopRequireDefault(ponyfill);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var root; /* global window */
if (typeof self !== 'undefined') {
root = self;
} else if (typeof window !== 'undefined') {
root = window;
} else if (typeof commonjsGlobal !== 'undefined') {
root = commonjsGlobal;
} else {
root = module;
}
var result = (0, _ponyfill2['default'])(root);
exports['default'] = result;
});
unwrapExports(lib$1);
var symbolObservable = lib$1;
var _config = {
fromESObservable: null,
toESObservable: null
};
var configureObservable = function configureObservable(c) {
_config = c;
};
var config = {
fromESObservable: function fromESObservable(observable) {
return typeof _config.fromESObservable === 'function' ? _config.fromESObservable(observable) : observable;
},
toESObservable: function toESObservable(stream) {
return typeof _config.toESObservable === 'function' ? _config.toESObservable(stream) : stream;
}
};
var componentFromStreamWithConfig = function componentFromStreamWithConfig(config$$1) {
return function (propsToVdom) {
return (
/*#__PURE__*/
function (_Component) {
_inheritsLoose(ComponentFromStream, _Component);
function ComponentFromStream() {
var _config$fromESObserva;
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
_this.state = {
vdom: null
};
_this.propsEmitter = lib_1();
_this.props$ = config$$1.fromESObservable((_config$fromESObserva = {
subscribe: function subscribe(observer) {
var unsubscribe = _this.propsEmitter.listen(function (props) {
if (props) {
observer.next(props);
} else {
observer.complete();
}
});
return {
unsubscribe: unsubscribe
};
}
}, _config$fromESObserva[symbolObservable] = function () {
return this;
}, _config$fromESObserva));
_this.vdom$ = config$$1.toESObservable(propsToVdom(_this.props$));
return _this;
}
var _proto = ComponentFromStream.prototype;
_proto.componentWillMount = function componentWillMount() {
var _this2 = this;
// Subscribe to child prop changes so we know when to re-render
this.subscription = this.vdom$.subscribe({
next: function next(vdom) {
_this2.setState({
vdom: vdom
});
}
});
this.propsEmitter.emit(this.props);
};
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
// Receive new props from the owner
this.propsEmitter.emit(nextProps);
};
_proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
return nextState.vdom !== this.state.vdom;
};
_proto.componentWillUnmount = function componentWillUnmount() {
// Call without arguments to complete stream
this.propsEmitter.emit(); // Clean-up subscription before un-mounting
this.subscription.unsubscribe();
};
_proto.render = function render() {
return this.state.vdom;
};
return ComponentFromStream;
}(React.Component)
);
};
};
var componentFromStream = function componentFromStream(propsToVdom) {
return componentFromStreamWithConfig(config)(propsToVdom);
};
var identity$1 = function identity(t) {
return t;
};
var mapPropsStreamWithConfig = function mapPropsStreamWithConfig(config$$1) {
var componentFromStream$$1 = componentFromStreamWithConfig({
fromESObservable: identity$1,
toESObservable: identity$1
});
return function (transform) {
return function (BaseComponent) {
var factory = createFactory(BaseComponent);
var fromESObservable = config$$1.fromESObservable,
toESObservable = config$$1.toESObservable;
return componentFromStream$$1(function (props$) {
var _ref;
return _ref = {
subscribe: function subscribe(observer) {
var subscription = toESObservable(transform(fromESObservable(props$))).subscribe({
next: function next(childProps) {
return observer.next(factory(childProps));
}
});
return {
unsubscribe: function unsubscribe() {
return subscription.unsubscribe();
}
};
}
}, _ref[symbolObservable] = function () {
return this;
}, _ref;
});
};
};
};
var mapPropsStream = function mapPropsStream(transform) {
var hoc = mapPropsStreamWithConfig(config)(transform);
{
return function (BaseComponent) {
return setDisplayName(wrapDisplayName(BaseComponent, 'mapPropsStream'))(hoc(BaseComponent));
};
}
return hoc;
};
var createEventHandlerWithConfig = function createEventHandlerWithConfig(config$$1) {
return function () {
var _config$fromESObserva;
var emitter = lib_1();
var stream = config$$1.fromESObservable((_config$fromESObserva = {
subscribe: function subscribe(observer) {
var unsubscribe = emitter.listen(function (value) {
return observer.next(value);
});
return {
unsubscribe: unsubscribe
};
}
}, _config$fromESObserva[symbolObservable] = function () {
return this;
}, _config$fromESObserva));
return {
handler: emitter.emit,
stream: stream
};
};
};
var createEventHandler = createEventHandlerWithConfig(config);
// Higher-order component helpers
exports.mapProps = mapProps;
exports.withProps = withProps;
exports.withPropsOnChange = withPropsOnChange;
exports.withHandlers = withHandlers;
exports.defaultProps = defaultProps;
exports.renameProp = renameProp;
exports.renameProps = renameProps;
exports.flattenProp = flattenProp;
exports.withState = withState;
exports.withStateHandlers = withStateHandlers;
exports.withReducer = withReducer;
exports.branch = branch;
exports.renderComponent = renderComponent;
exports.renderNothing = renderNothing;
exports.shouldUpdate = shouldUpdate;
exports.pure = pure;
exports.onlyUpdateForKeys = onlyUpdateForKeys;
exports.onlyUpdateForPropTypes = onlyUpdateForPropTypes;
exports.withContext = withContext;
exports.getContext = getContext;
exports.lifecycle = lifecycle;
exports.toClass = toClass;
exports.toRenderProps = toRenderProps;
exports.fromRenderProps = fromRenderProps;
exports.setStatic = setStatic;
exports.setPropTypes = setPropTypes;
exports.setDisplayName = setDisplayName;
exports.compose = compose;
exports.getDisplayName = getDisplayName;
exports.wrapDisplayName = wrapDisplayName;
exports.shallowEqual = shallowEqual;
exports.isClassComponent = isClassComponent;
exports.createSink = createSink;
exports.componentFromProp = componentFromProp;
exports.nest = nest;
exports.hoistStatics = hoistStatics;
exports.componentFromStream = componentFromStream;
exports.componentFromStreamWithConfig = componentFromStreamWithConfig;
exports.mapPropsStream = mapPropsStream;
exports.mapPropsStreamWithConfig = mapPropsStreamWithConfig;
exports.createEventHandler = createEventHandler;
exports.createEventHandlerWithConfig = createEventHandlerWithConfig;
exports.setObservableConfig = configureObservable;
Object.defineProperty(exports, '__esModule', { value: true });
})));
|
import { Meteor } from 'meteor/meteor';
import { Roles } from 'meteor/alanning:roles';
import { StudySessions } from '../../api/studysessions/StudySessions';
import { UserProfiles } from '../../api/userprofiles/UserProfiles';
import { CourseList } from '../../api/courselist/CourseList';
/** This subscription publishes all documents regardless of user, but only if logged in. */
Meteor.publish('StudySessionsAll', function publish() {
if (this.userId) {
return StudySessions.find();
}
return this.ready();
});
/** This subscription publishes only the documents associated with the logged in user */
Meteor.publish('StudySessions', function publish() {
if (this.userId) {
const username = Meteor.users.findOne(this.userId).username;
return StudySessions.find({ owner: username });
}
return this.ready();
});
/** This subscription publishes all documents regardless of user, but only if the logged in user is the Admin. */
Meteor.publish('StudySessionsAdmin', function publish() {
if (this.userId && Roles.userIsInRole(this.userId, 'admin')) {
return StudySessions.find();
}
return this.ready();
});
/** This subscription publishes only the documents associated with the logged in user */
Meteor.publish('UserProfiles', function publish() {
if (this.userId) {
const username = Meteor.users.findOne(this.userId).username;
return UserProfiles.find({ user: username });
}
return this.ready();
});
Meteor.publish('AllUserProfiles', function publish() {
if (this.userId) {
return UserProfiles.find();
}
return this.ready();
});
Meteor.publish('CourseList', function publish() {
if (this.userId) {
return CourseList.find();
}
return this.ready();
});
/** This subscription publishes all documents regardless of user, but only if logged in. */
Meteor.publish('ViewStudySession', function publish() {
if (this.userId) {
return StudySessions.find();
}
return this.ready();
});
|
const router = require('express').Router();
const bcrypt = require('bcryptjs');
const Users = require('../users/users-model.js');
router.post('/', (req, res) => {
const user = req.body;
if(!user.email || !user.username || !user.password){
res.status(400).json({ message: "Please provide username, email and pw" });
} else {
const hash = bcrypt.hashSync(user.password, 10);
user.password = hash; //pw is now the hash
Users.add(user)
.then(saved => {
res.status(201).json(saved);
})
.catch(err => {
res.status(500).json(err);
})
}
})
module.exports = router;
|
/*global defineSuite*/
defineSuite([
'Scene/ImageryLayer',
'Specs/createContext',
'Specs/destroyContext',
'Core/Extent',
'Core/jsonp',
'Core/loadImage',
'Core/loadWithXhr',
'Scene/BingMapsImageryProvider',
'Scene/EllipsoidTerrainProvider',
'Scene/Imagery',
'Scene/ImageryLayerCollection',
'Scene/ImageryState',
'Scene/NeverTileDiscardPolicy',
'Scene/SingleTileImageryProvider',
'Scene/TileMapServiceImageryProvider',
'Scene/WebMapServiceImageryProvider'
], function(
ImageryLayer,
createContext,
destroyContext,
Extent,
jsonp,
loadImage,
loadWithXhr,
BingMapsImageryProvider,
EllipsoidTerrainProvider,
Imagery,
ImageryLayerCollection,
ImageryState,
NeverTileDiscardPolicy,
SingleTileImageryProvider,
TileMapServiceImageryProvider,
WebMapServiceImageryProvider) {
"use strict";
/*global jasmine,describe,xdescribe,it,xit,expect,beforeEach,afterEach,beforeAll,afterAll,spyOn,runs,waits,waitsFor*/
var context;
beforeAll(function() {
context = createContext();
});
afterAll(function() {
destroyContext(context);
});
afterEach(function() {
jsonp.loadAndExecuteScript = jsonp.defaultLoadAndExecuteScript;
loadImage.createImage = loadImage.defaultCreateImage;
loadWithXhr.load = loadWithXhr.defaultLoad;
});
function CustomDiscardPolicy() {
this.shouldDiscard = false;
}
CustomDiscardPolicy.prototype.isReady = function() {
return true;
};
CustomDiscardPolicy.prototype.shouldDiscardImage = function(image) {
return this.shouldDiscard;
};
it('discards tiles when the ImageryProviders discard policy says to do so', function() {
loadImage.createImage = function(url, crossOrigin, deferred) {
return loadImage.defaultCreateImage('Data/Images/Red16x16.png', crossOrigin, deferred);
};
loadWithXhr.load = function(url, responseType, headers, deferred) {
return loadWithXhr.defaultLoad('Data/Images/Red16x16.png', responseType, headers, deferred);
};
var discardPolicy = new CustomDiscardPolicy();
var provider = new WebMapServiceImageryProvider({
url : 'made/up/url',
layers : 'foo',
tileDiscardPolicy : discardPolicy
});
var layer = new ImageryLayer(provider);
waitsFor(function() {
return provider.isReady();
}, 'imagery provider to become ready');
var imagery;
runs(function() {
discardPolicy.shouldDiscard = true;
imagery = new Imagery(layer, 0, 0, 0);
imagery.addReference();
layer._requestImagery(imagery);
});
waitsFor(function() {
return imagery.state === ImageryState.RECEIVED;
}, 'image to load');
runs(function() {
layer._createTexture(context, imagery);
expect(imagery.state).toEqual(ImageryState.INVALID);
imagery.releaseReference();
});
});
it('reprojects web mercator images', function() {
jsonp.loadAndExecuteScript = function(url, functionName) {
window[functionName]({
"authenticationResultCode" : "ValidCredentials",
"brandLogoUri" : "http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",
"copyright" : "Copyright © 2012 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.",
"resourceSets" : [{
"estimatedTotal" : 1,
"resources" : [{
"__type" : "ImageryMetadata:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",
"imageHeight" : 256,
"imageUrl" : "http:\/\/invalid.{subdomain}.invalid\/tiles\/r{quadkey}?g=1062&lbl=l1&productSet=mmCB",
"imageUrlSubdomains" : ["t0"],
"imageWidth" : 256,
"imageryProviders" : null,
"vintageEnd" : null,
"vintageStart" : null,
"zoomMax" : 21,
"zoomMin" : 1
}]
}],
"statusCode" : 200,
"statusDescription" : "OK",
"traceId" : "c9cf8c74a8b24644974288c92e448972|EWRM003311|02.00.171.2600|"
});
};
loadImage.createImage = function(url, crossOrigin, deferred) {
return loadImage.defaultCreateImage('Data/Images/Red16x16.png', crossOrigin, deferred);
};
loadWithXhr.load = function(url, responseType, headers, deferred) {
return loadWithXhr.defaultLoad('Data/Images/Red16x16.png', responseType, headers, deferred);
};
var provider = new BingMapsImageryProvider({
url : 'http://host.invalid',
tileDiscardPolicy : new NeverTileDiscardPolicy()
});
var layer = new ImageryLayer(provider);
waitsFor(function() {
return provider.isReady();
}, 'imagery provider to become ready');
var imagery;
runs(function() {
imagery = new Imagery(layer, 0, 0, 0);
imagery.addReference();
layer._requestImagery(imagery);
});
waitsFor(function() {
return imagery.state === ImageryState.RECEIVED;
}, 'image to load');
runs(function() {
layer._createTexture(context, imagery);
});
waitsFor(function() {
return imagery.state === ImageryState.TEXTURE_LOADED;
}, 'texture to load');
var textureBeforeReprojection;
runs(function() {
textureBeforeReprojection = imagery.texture;
layer._reprojectTexture(context, imagery);
});
waitsFor(function() {
return imagery.state === ImageryState.READY;
}, 'texture to be ready');
runs(function() {
expect(textureBeforeReprojection).not.toEqual(imagery.texture);
imagery.releaseReference();
});
});
it('basic properties work as expected', function() {
var provider = new SingleTileImageryProvider({
url : 'Data/Images/Red16x16.png'
});
var extent = new Extent(0.1, 0.2, 0.3, 0.4);
var layer = new ImageryLayer(provider, {
extent : extent
});
expect(layer.getExtent()).toEqual(extent);
expect(layer.isDestroyed()).toEqual(false);
layer.destroy();
expect(layer.isDestroyed()).toEqual(true);
});
it('createTileImagerySkeletons handles a base layer that does not cover the entire globe', function() {
var provider = new TileMapServiceImageryProvider({
url : 'Data/TMS/SmallArea'
});
var layers = new ImageryLayerCollection();
var layer = layers.addImageryProvider(provider);
var terrainProvider = new EllipsoidTerrainProvider();
waitsFor(function() {
return provider.isReady() && terrainProvider.isReady();
}, 'imagery provider to become ready');
runs(function() {
var tiles = terrainProvider.getTilingScheme().createLevelZeroTiles();
layer._createTileImagerySkeletons(tiles[0], terrainProvider);
layer._createTileImagerySkeletons(tiles[1], terrainProvider);
// Both tiles should have imagery from this layer completely covering them.
expect(tiles[0].imagery.length).toBe(4);
expect(tiles[0].imagery[0].textureCoordinateExtent.x).toBe(0.0);
expect(tiles[0].imagery[0].textureCoordinateExtent.w).toBe(1.0);
expect(tiles[0].imagery[1].textureCoordinateExtent.x).toBe(0.0);
expect(tiles[0].imagery[1].textureCoordinateExtent.y).toBe(0.0);
expect(tiles[0].imagery[2].textureCoordinateExtent.z).toBe(1.0);
expect(tiles[0].imagery[2].textureCoordinateExtent.w).toBe(1.0);
expect(tiles[0].imagery[3].textureCoordinateExtent.y).toBe(0.0);
expect(tiles[0].imagery[3].textureCoordinateExtent.z).toBe(1.0);
expect(tiles[1].imagery.length).toBe(2);
expect(tiles[1].imagery[0].textureCoordinateExtent.x).toBe(0.0);
expect(tiles[1].imagery[0].textureCoordinateExtent.w).toBe(1.0);
expect(tiles[1].imagery[0].textureCoordinateExtent.z).toBe(1.0);
expect(tiles[1].imagery[1].textureCoordinateExtent.x).toBe(0.0);
expect(tiles[1].imagery[1].textureCoordinateExtent.y).toBe(0.0);
expect(tiles[1].imagery[1].textureCoordinateExtent.z).toBe(1.0);
});
});
it('createTileImagerySkeletons handles a non-base layer that does not cover the entire globe', function() {
var baseProvider = new SingleTileImageryProvider({
url : 'Data/Images/Green4x4.png'
});
var provider = new TileMapServiceImageryProvider({
url : 'Data/TMS/SmallArea'
});
var layers = new ImageryLayerCollection();
layers.addImageryProvider(baseProvider);
var layer = layers.addImageryProvider(provider);
var terrainProvider = new EllipsoidTerrainProvider();
waitsFor(function() {
return provider.isReady() && terrainProvider.isReady();
}, 'imagery provider to become ready');
runs(function() {
var tiles = terrainProvider.getTilingScheme().createLevelZeroTiles();
layer._createTileImagerySkeletons(tiles[0], terrainProvider);
layer._createTileImagerySkeletons(tiles[1], terrainProvider);
// Only the western tile should have imagery from this layer.
// And the imagery should not cover it completely.
expect(tiles[0].imagery.length).toBe(4);
expect(tiles[0].imagery[0].textureCoordinateExtent.x).not.toBe(0.0);
expect(tiles[0].imagery[0].textureCoordinateExtent.y).not.toBe(0.0);
expect(tiles[0].imagery[0].textureCoordinateExtent.z).not.toBe(1.0);
expect(tiles[0].imagery[0].textureCoordinateExtent.w).not.toBe(1.0);
expect(tiles[0].imagery[1].textureCoordinateExtent.x).not.toBe(0.0);
expect(tiles[0].imagery[1].textureCoordinateExtent.y).not.toBe(0.0);
expect(tiles[0].imagery[1].textureCoordinateExtent.z).not.toBe(1.0);
expect(tiles[0].imagery[1].textureCoordinateExtent.w).not.toBe(1.0);
expect(tiles[0].imagery[2].textureCoordinateExtent.x).not.toBe(0.0);
expect(tiles[0].imagery[2].textureCoordinateExtent.y).not.toBe(0.0);
expect(tiles[0].imagery[2].textureCoordinateExtent.z).not.toBe(1.0);
expect(tiles[0].imagery[2].textureCoordinateExtent.w).not.toBe(1.0);
expect(tiles[0].imagery[3].textureCoordinateExtent.x).not.toBe(0.0);
expect(tiles[0].imagery[3].textureCoordinateExtent.y).not.toBe(0.0);
expect(tiles[0].imagery[3].textureCoordinateExtent.z).not.toBe(1.0);
expect(tiles[0].imagery[3].textureCoordinateExtent.w).not.toBe(1.0);
expect(tiles[1].imagery.length).toBe(0);
});
});
it('createTileImagerySkeletons honors the minimumTerrainLevel and maximumTerrainLevel properties', function() {
var provider = new SingleTileImageryProvider({
url : 'Data/Images/Green4x4.png'
});
var layer = new ImageryLayer(provider, {
minimumTerrainLevel : 2,
maximumTerrainLevel : 4
});
var layers = new ImageryLayerCollection();
layers.add(layer);
var terrainProvider = new EllipsoidTerrainProvider();
waitsFor(function() {
return provider.isReady() && terrainProvider.isReady();
}, 'imagery provider to become ready');
runs(function() {
var level0 = terrainProvider.getTilingScheme().createLevelZeroTiles();
var level1 = level0[0].getChildren();
var level2 = level1[0].getChildren();
var level3 = level2[0].getChildren();
var level4 = level3[0].getChildren();
var level5 = level4[0].getChildren();
layer._createTileImagerySkeletons(level0[0], terrainProvider);
expect(level0[0].imagery.length).toBe(0);
layer._createTileImagerySkeletons(level1[0], terrainProvider);
expect(level1[0].imagery.length).toBe(0);
layer._createTileImagerySkeletons(level2[0], terrainProvider);
expect(level2[0].imagery.length).toBe(1);
layer._createTileImagerySkeletons(level3[0], terrainProvider);
expect(level3[0].imagery.length).toBe(1);
layer._createTileImagerySkeletons(level4[0], terrainProvider);
expect(level4[0].imagery.length).toBe(1);
layer._createTileImagerySkeletons(level5[0], terrainProvider);
expect(level5[0].imagery.length).toBe(0);
});
});
}, 'WebGL');
|
(function($) {
var cultures = $.global.cultures,
en = cultures.en,
standard = en.calendars.standard,
culture = cultures["xh-ZA"] = $.extend(true, {}, en, {
name: "xh-ZA",
englishName: "isiXhosa (South Africa)",
nativeName: "isiXhosa (uMzantsi Afrika)",
language: "xh",
numberFormat: {
percent: {
pattern: ["-%n","%n"]
},
currency: {
pattern: ["$-n","$ n"],
symbol: "R"
}
},
calendars: {
standard: $.extend(true, {}, standard, {
days: {
names: ["iCawa","uMvulo","uLwesibini","uLwesithathu","uLwesine","uLwesihlanu","uMgqibelo"],
namesShort: ["Ca","Mv","Lb","Lt","Ln","Lh","Mg"]
},
months: {
names: ["Mqungu","Mdumba","Kwindla","Tshazimpuzi","Canzibe","Silimela","Khala","Thupha","Msintsi","Dwarha","Nkanga","Mnga",""]
},
patterns: {
d: "yyyy/MM/dd",
D: "dd MMMM yyyy",
t: "hh:mm tt",
T: "hh:mm:ss tt",
f: "dd MMMM yyyy hh:mm tt",
F: "dd MMMM yyyy hh:mm:ss tt",
M: "dd MMMM",
Y: "MMMM yyyy"
}
})
}
}, cultures["xh-ZA"]);
culture.calendar = culture.calendars.standard;
})(jQuery);
|
/* jshint -W097 */
/* jshint strict: false */
/* jslint node: true */
'use strict';
// you have to require the utils module and call adapter function
const utils = require('@iobroker/adapter-core'); // Get common adapter utils
const adapter = new utils.Adapter('mihome-plug');
const dgram = require('dgram');
const MiHome = require('./lib/mihomepacket');
const server = dgram.createSocket('udp4');
let connected = false;
let commands = {};
let paramReq = null;
let pingInterval;
let message = '';
let packet;
// is called if a subscribed state changes
adapter.on('stateChange', (id, state) => {
if (!state || state.ack) return;
//test
// Warning, state can be null if it was deleted
adapter.log.debug('stateChange ' + id + ' ' + JSON.stringify(state));
// output to parser
const command = id.split('.').pop();
if (command === 'power' || command === 'wifi_led') {
let send;
switch (command) {
case 'power':
send = 'set_power';
break;
case 'wifi_led':
send = 'set_wifi_led';
break;
default:
adapter.log.error('state not found');
}
if (state.val === 'true' || state.val === true || state.val === '1' || state.val === 1 || state.val === 'on' || state.val === 'ON') {
sendCommand(commands[send] + '"on"]', () =>
adapter.setForeignState(adapter.namespace + '.' + command, true, true));
} else {
sendCommand(commands[send] + '"off"]', () =>
adapter.setForeignState(adapter.namespace + '.' + +command, false, true));
}
}
});
adapter.on('unload', callback => {
if (pingTimeout) clearTimeout(pingTimeout);
adapter.setState('info.connection', false, true);
if (pingInterval) clearInterval(pingInterval);
if (typeof callback === 'function') callback();
});
adapter.on('ready', main);
let pingTimeout = null;
function sendPing() {
pingTimeout = setTimeout(() => {
pingTimeout = null;
if (connected) {
connected = false;
adapter.log.info('Disconnect');
adapter.setState('info.connection', false, true);
}
}, 3000);
try {
if (packet.token.toString('hex') !== 'ffffffffffffffffffffffffffffffff') {
packet.msgCounter = 400;
message = commands.get_prop;
} else {
adapter.log.warn('Token is not found yet!');
}
server.send(commands.ping, 0, commands.ping.length, adapter.config.port, adapter.config.ip, err =>
err && adapter.log.error('Cannot send ping: ' + err));
} catch (e) {
adapter.log.warn('Cannot send ping: ' + e);
clearTimeout(pingTimeout);
pingTimeout = null;
if (connected) {
connected = false;
adapter.log.info('Disconnect');
adapter.setState('info.connection', false, true);
}
}
}
function str2hex(str) {
str = str.replace(/\s/g, '');
const buf = new Buffer(str.length / 2);
for (let i = 0; i < str.length / 2; i++) {
buf[i] = parseInt(str[i * 2] + str[i * 2 + 1], 16);
}
return buf;
}
function sendCommand(cmd, callback) {
try {
message = cmd;
packet.setHelo();
const cmdRaw = packet.getRaw();
adapter.log.info('Send >>> Helo >>> ' + cmdRaw.toString('hex'));
server.send(cmdRaw, 0, cmdRaw.length, adapter.config.port, adapter.config.ip, err => {
if (err) adapter.log.error('Cannot send command: ' + err);
if (typeof callback === 'function') callback(err);
});
} catch (err) {
adapter.log.warn('Cannot send command_: ' + err);
if (typeof callback === 'function') callback(err);
}
}
function getStates(message) {
// Search id in answer
const answer = JSON.parse(message);
const request = Object.assign({}, paramReq);
adapter.log.debug(answer.result.length);
if (answer.id === 400) {
for (let i = 0; i < answer.result.length; i++) {
if (request.params[i] === 'temperature' ||
request.params[i] === 'power_consume_rate' ||
request.params[i] === 'power_price' ||
request.params[i] === 'lp_autooff' ||
request.params[i] === 'lp_threshold' ||
request.params[i] === 'lp_autooff_delay') {
adapter.setState(request.params[i], answer.result[i], true);
adapter.log.debug('Value "' + answer.result[i] + '" in: "' + request.params[i] + '" stored');
} else {
adapter.log.debug('Value "' + (answer.result[i] === 'on') + '" in: "' + request.params[i] + '" stored');
adapter.setState(request.params[i], answer.result[i] === 'on', true);
}
}
}
}
function main() {
adapter.setState('info.connection', false, true);
adapter.config.port = parseInt(adapter.config.port, 10) || 54321;
adapter.config.ownPort = parseInt(adapter.config.ownPort, 10) || 53421;
adapter.config.pingInterval = parseInt(adapter.config.pingInterval, 10) || 20000;
if (!adapter.config.ip || adapter.config.ip === '0.0.0.0') {
adapter.log.error('No IP set');
return;
}
packet = new MiHome.Packet();
packet.msgCounter = 1;
commands = {
ping: str2hex('21310020ffffffffffffffffffffffffffffffffffffffffffffffffffffffff'),
get_prop: '"method":"get_prop","params":["power","temperature","wifi_led"]',
set_power: '"method":"set_power","params":[',
set_wifi_led: '"method":"set_wifi_led","params":['
};
paramReq = {
id: 400,
method: 'get_prop',
params: [
"power",
"temperature",
// "power_consume_rate",
// "power_price",
"wifi_led"
// "option_feature",
// "lp_autooff",
// "lp_threshold",
// "lp_autooff_delay"
]
};
server.on('error', err => {
adapter.log.error('UDP error: ' + err);
server.close();
process.exit();
});
server.on('message', (msg, rinfo) => {
if (rinfo.port === adapter.config.port) {
if (msg.length === 32) {
adapter.log.debug('Receive <<< Helo <<< ' + msg.toString('hex'));
packet.setRaw(msg);
adapter.log.debug('Token = ' + packet.token.toString('hex'));
adapter.log.debug('lenght = ' + packet.len.toString('hex'));
adapter.log.debug('data = ' + packet.data.toString('hex'));
adapter.log.debug('check = ' + packet.checksum.toString('hex'));
clearTimeout(pingTimeout);
pingTimeout = null;
if (!connected) {
connected = true;
adapter.log.info('Connected');
adapter.setState('info.connection', true, true);
}
if (message.length > 0) {
try {
packet.setPlainData('{"id":' + packet.msgCounter + ',' + message + '}');
adapter.log.debug('{"id":' + packet.msgCounter + ',' + message + '}');
const cmdRaw = packet.getRaw();
adapter.log.debug('Send >>> {"id":' + packet.msgCounter + ',' + message + "} >>> " + cmdRaw.toString('hex'));
adapter.log.debug(cmdRaw.toString('hex'));
message = '';
server.send(cmdRaw, 0, cmdRaw.length, adapter.config.port, adapter.config.ip, function (err) {
if (err) adapter.log.error('Cannot send command: ' + err);
});
packet.msgCounter++;
if (packet.msgCounter > 0xFFFFFF) packet.msgCounter = 1;
} catch (err) {
adapter.log.warn('Cannot send command_: ' + err);
}
}
} else {
// here decode the answer
packet.setRaw(msg);
adapter.log.debug('Receive <<< ' + packet.getPlainData() + '<<< ' + msg.toString('hex'));
//adapter.log.warn('server got: ' + msg.length + ' bytes from ' + rinfo.address + ':' + rinfo.port);
getStates(packet.getPlainData());
}
}
});
server.on('listening', () => {
const address = server.address();
adapter.log.debug('server started on ' + address.address + ':' + address.port);
});
try {
server.bind(adapter.config.ownPort);
} catch (e) {
adapter.log.error('Cannot open UDP port: ' + e);
return;
}
sendPing();
pingInterval = setInterval(sendPing, adapter.config.pingInterval);
adapter.subscribeStates('*');
}
|
let todos = [];
const list = document.querySelector('#todo-list');
const todoInput = document.querySelector('#input-todo');
const allcheck = document.querySelector('#chk-allComplete');
const tabList = document.querySelector('.nav');
const tabSelect = document.querySelectorAll('.nav li');
const clearBtn = document.querySelector('#btn-removeCompletedTodos');
let completedCount = document.querySelector('#completedTodos');
let state = 'all';
function renderHTML() {
list.innerHTML = '';
let todos1 = [];
if (state === 'all') {
todos1 = todos;
} else if (state === 'active') {
todos1 = todos.filter(todo => (!todo.completed));
} else if (state === 'completed') {
todos1 = todos.filter(todo => (todo.completed));
}
todos1.forEach(function (todo) {
const checked = todo.completed ? 'checked' : '';
list.innerHTML += `<li class="list-group-item">
<div class="hover-anchor">
<a class="hover-action text-muted">
<span class="glyphicon glyphicon-remove-circle pull-right" data-id="${todo.id}"></span>
</a>
<label class="i-checks" for="${todo.id}">
<input type="checkbox" id="${todo.id}" ${checked}><i></i>
<span>${todo.content}</span>
</label>
</div>
</li>`;
});
}
function maxId() {
const getId = todos.map(function (todo) {
return todo.id;
});
return todos.length ? Math.max.call(null, ...getId) + 1 : 1;
}
function todoAdd() {
todos = [{ id: maxId(), content: todoInput.value, completed: false }].concat(todos);
todoInput.value = '';
}
todoInput.addEventListener('keyup', function (e) {
if (e.code !== 'Enter') return;
todoAdd();
renderHTML();
});
function clearCompletedCount() {
const completedCounts = todos.filter(todo => todo.completed);
completedCount.textContent = completedCounts.length;
// console.dir(completedCount.textContent);
}
list.addEventListener('click', function (e) {
if (e.target.nodeName === 'SPAN') {
todos = todos.filter(todo => (todo.id !== +e.target.dataset.id));
renderHTML();
}
});
list.addEventListener('change', function (e) {
if (e.target.nodeName === 'INPUT') {
todos = todos.map(function (todo) {
return todo.id === +e.target.id ? Object.assign({}, todo, { completed: !todo.completed }) : todo;
});
// console.dir(todos);
clearCompletedCount();
}
});
allcheck.addEventListener('click', function (e) {
todos = todos.map(todo => Object.assign({}, todo, { completed: !todo.completed }));
renderHTML();
clearCompletedCount();
});
tabList.addEventListener('click', function (e) {
// console.dir(e.target.parentNode.id);
// console.dir(e.target.textContent);
// console.dir(typeof tabSelect);
// e.target.parentNode.className = ' ';
tabSelect.forEach(function (select) {
// console.log(select);
select.classList.remove('active');
if (select.id === e.target.parentNode.id) {
select.classList.add('active');
state = e.target.parentNode.id;
// console.log(state);
}
});
renderHTML();
});
clearBtn.addEventListener('click', function (e) {
// console.dir(e);
todos = todos.filter(todo => !todo.completed);
completedCount.textContent = 0;
renderHTML();
});
window.addEventListener('load', function () {
todos = [
{ id: 1, content: 'HTML', completed: false },
{ id: 2, content: 'CSS', completed: false },
{ id: 3, content: 'JAVASCRIPT', completed: false }
];
renderHTML();
});
|
const express = require("express");
const path = require("path");
const mongoose = require("mongoose");
const apiRoutes = require("./routes/api-routes");
const booksRoutes = require("./routes/books-routes");
const app = express();
const PORT = process.env.PORT || 3001;
// Define middleware here
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
// Serve up static assets (usually on heroku)
if (process.env.NODE_ENV === "production") {
app.use(express.static("client/build"));
}
// Add routes, both API and view
app.use(apiRoutes);
app.use(booksRoutes);
app.get("*", (req, res) => {
res.sendFile(path.join(__dirname, "./client/build/index.html"));
});
// Connect to the Mongo DB
mongoose.connect(process.env.MONGODB_URI || "mongodb://localhost/googlebooks", {
useUnifiedTopology: true,
useNewUrlParser: true,
useFindAndModify:false,
});
// Start the API server
app.listen(PORT, function() {
console.log(`🌎 ==> API Server now listening on PORT ${PORT}!`);
});
|
Clazz.declarePackage ("J.adapter.readers.simple");
Clazz.load (["J.adapter.smarter.AtomSetCollectionReader"], "J.adapter.readers.simple.JSONReader", ["JU.P3", "$.PT", "J.adapter.smarter.Bond", "JU.Logger"], function () {
c$ = Clazz.decorateAsClass (function () {
this.scale = null;
Clazz.instantialize (this, arguments);
}, J.adapter.readers.simple, "JSONReader", J.adapter.smarter.AtomSetCollectionReader);
Clazz.overrideMethod (c$, "initializeReader",
function () {
this.asc.setCollectionName ("JSON");
this.asc.newAtomSet ();
var s = "";
while (this.rd () != null) s += this.line;
s = JU.PT.replaceAllCharacters (s, "\" ", "").$replace (',', ':');
if (s.contains ("_is2D:true")) this.set2D ();
if (s.contains ("_scale:")) this.getScaling (this.getSection (s, "_scale", false));
s = JU.PT.replaceAllCharacters (s, "}", "").$replace (',', ':');
this.readAtoms (this.getSection (s, "a", true));
this.readBonds (this.getSection (s, "b", true));
this.continuing = false;
});
Clazz.defineMethod (c$, "getScaling",
function (s) {
var xyz = s[0].$plit (":");
this.scale = JU.P3.new3 (1, 1, 1);
for (var j = 0; j < xyz.length; j += 2) if (xyz[j].length == 1) switch (xyz[j].charAt (0)) {
case 'x':
this.scale.x = this.parseFloatStr (xyz[j + 1]);
break;
case 'y':
this.scale.y = this.parseFloatStr (xyz[j + 1]);
break;
case 'z':
this.scale.z = this.parseFloatStr (xyz[j + 1]);
break;
}
JU.Logger.info ("scale set to " + this.scale);
}, "~A");
Clazz.defineMethod (c$, "getSection",
function (json, key, isArray) {
var a = JU.PT.split (json, key + ":" + (isArray ? "[" : "") + "{");
if (a.length < 2) return a;
var data = a[1];
data = data.substring (0, data.indexOf ((isArray ? "]" : "}"))) + ":";
return JU.PT.split (data, "{");
}, "~S,~S,~B");
Clazz.defineMethod (c$, "readAtoms",
function (atoms) {
for (var i = 0; i < atoms.length; ++i) {
var lxyz = atoms[i].$plit (":");
var atom = this.asc.addNewAtom ();
var x = 0;
var y = 0;
var z = 0;
var l = "C";
for (var j = 0; j < lxyz.length; j += 2) if (lxyz[j].length == 1) switch (lxyz[j].charAt (0)) {
case 'x':
x = this.parseFloatStr (lxyz[j + 1]);
break;
case 'y':
y = this.parseFloatStr (lxyz[j + 1]);
break;
case 'z':
z = this.parseFloatStr (lxyz[j + 1]);
break;
case 'l':
l = lxyz[j + 1];
break;
}
if (this.scale != null) {
x /= this.scale.x;
y /= this.scale.y;
z /= this.scale.z;
}this.setAtomCoordXYZ (atom, x, y, z);
atom.elementSymbol = l;
}
}, "~A");
Clazz.defineMethod (c$, "readBonds",
function (bonds) {
for (var i = 0; i < bonds.length; ++i) {
var beo = bonds[i].$plit (":");
var b = 0;
var e = 0;
var order = 1;
for (var j = 0; j < beo.length; j += 2) if (beo[j].length == 1) switch (beo[j].charAt (0)) {
case 'b':
b = this.parseIntStr (beo[j + 1]);
break;
case 'e':
e = this.parseIntStr (beo[j + 1]);
break;
case 'o':
var o = Clazz.floatToInt (this.parseFloatStr (beo[j + 1]) * 2);
switch (o) {
case 0:
continue;
case 2:
case 4:
case 6:
case 8:
order = Clazz.doubleToInt (o / 2);
break;
case 1:
order = 33;
break;
case 3:
order = 66;
break;
case 5:
order = 97;
break;
default:
order = 1;
break;
}
break;
}
this.asc.addBond ( new J.adapter.smarter.Bond (b, e, order));
}
}, "~A");
});
|
// This is an integration test because the dependencies are not mocked out
var expect = require('chai').expect
, UserService = require('../../../server/service/UserService')
, UserDao = require('../../../server/dao/UserDao')
, messages = require('../../../server/validate/ValidationMessages');
describe('User Service Integration', function() {
var goodUsername = 'sara@email.it';
var goodPassword = 'passw0rD';
var badUsername = 'nosuchuser@email.it';
var badPassword = 'passworD';
var validUserId = 3;
var invalidUserId = 999;
var emailToInsert = 'daffy.duck@looney.com';
afterEach(function(done) {
UserDao.deleteUser({email: emailToInsert}, function(err, result) {
done();
});
});
it('User that provides correct password can successfully authenticate', function(done) {
UserService.authenticateUser(goodUsername, goodPassword, function(err, user, info){
// Verify no errors
expect(err).to.be.null;
expect(info.message).to.equal(messages.LOGIN_SUCCESS);
expect(user).not.to.be.null;
// Verify returned user
expect(user.id).not.to.be.null;
expect(user.name).to.equal('Sara');
expect(user.last_name).to.equal('Neri');
expect(user.email).to.equal(goodUsername);
expect(user.username).to.equal(goodUsername);
expect(user.hash).to.be.null;
expect(user.role).not.to.be.null;
done();
});
});
it('User that provides wrong password fails authentication', function(done) {
UserService.authenticateUser(goodUsername, badPassword, function(err, user, info){
expect(user).to.be.null;
expect(err).to.be.null;
expect(info).not.to.be.null;
expect(info.message).to.be.equal(messages.INVALID_USERNAME_PASSWORD);
done();
});
});
it('User that provides invalid username fails authentication', function(done) {
UserService.authenticateUser(badUsername, goodPassword, function(err, user, info){
expect(user).to.be.null;
expect(err).to.be.null;
expect(info).not.to.be.null;
expect(info.message).to.be.equal(messages.INVALID_USERNAME_PASSWORD);
done();
});
});
it('Find user by id for valid id returns a result', function(done) {
UserService.findUserById(validUserId, function(user){
expect(user).not.to.be.null;
expect(user.id).to.be.equal(validUserId);
done();
});
});
it('Find user by id for invalid id returns null', function(done) {
UserService.findUserById(invalidUserId, function(user){
expect(user).to.be.null;
done();
});
});
it('Add new user returns newly added user object', function(done) {
var hash = "quackquackhashedpassword";
var userIn = {
username: emailToInsert,
firstname: "Daffy",
surname: "Duck"
};
UserService.addNewUser(userIn, hash, function(err, userOut){
expect(err).to.be.null;
expect(userOut).not.to.be.null;
expect(userOut.id).to.be.above(5);
expect(userOut.email).to.equal(userIn.username);
expect(userOut.name).to.equal(userIn.firstname);
expect(userOut.last_name).to.equal(userIn.surname);
done();
});
});
});
|
sap.ui.define([
"sap/ui/model/json/JSONModel",
"sap/ui/core/mvc/Controller"
], function (JSONModel, Controller) {
"use strict";
return Controller.extend("sap.f.ShellBarWithFlexibleColumnLayout.controller.FlexibleColumnLayout", {
onInit: function () {
this.oRouter = this.getOwnerComponent().getRouter();
this.oRouter.attachRouteMatched(this.onRouteMatched, this);
this.oRouter.attachBeforeRouteMatched(this.onBeforeRouteMatched, this);
},
onBeforeRouteMatched: function(oEvent) {
var oModel = this.getOwnerComponent().getModel();
var sLayout = oEvent.getParameters().arguments.layout;
// If there is no layout parameter, query for the default level 0 layout (normally OneColumn)
if (!sLayout) {
var oNextUIState = this.getOwnerComponent().getHelper().getNextUIState(0);
sLayout = oNextUIState.layout;
}
// Update the layout of the FlexibleColumnLayout
if (sLayout) {
oModel.setProperty("/layout", sLayout);
}
},
onRouteMatched: function (oEvent) {
var sRouteName = oEvent.getParameter("name"),
oArguments = oEvent.getParameter("arguments");
this._updateUIElements();
// Save the current route name
this.currentRouteName = sRouteName;
this.currentProduct = oArguments.product;
this.currentSupplier = oArguments.supplier;
},
onStateChanged: function (oEvent) {
var bIsNavigationArrow = oEvent.getParameter("isNavigationArrow"),
sLayout = oEvent.getParameter("layout");
this._updateUIElements();
// Replace the URL with the new layout if a navigation arrow was used
if (bIsNavigationArrow) {
this.oRouter.navTo(this.currentRouteName, {layout: sLayout, product: this.currentProduct, supplier: this.currentSupplier}, true);
}
},
// Update the close/fullscreen buttons visibility
_updateUIElements: function () {
var oModel = this.getOwnerComponent().getModel();
var oUIState = this.getOwnerComponent().getHelper().getCurrentUIState();
oModel.setData(oUIState);
},
onExit: function () {
this.oRouter.detachRouteMatched(this.onRouteMatched, this);
this.oRouter.detachBeforeRouteMatched(this.onBeforeRouteMatched, this);
}
});
}, true);
|
require("dotenv").config({
path: `.env`,
})
const dynamicPlugins = []
if (process.env.GATSBY_PRODUCTION) {
dynamicPlugins.push({
resolve: "gatsby-plugin-firebase",
options: {
credentials: {
apiKey: process.env.FIREBASE_API_KEY,
authDomain: process.env.FIREBASE_AUTH_DOMAIN,
databaseURL: process.env.FIREBASE_DB_URL,
projectId: process.env.FIREBASE_PROJECT_ID,
storageBucket: process.env.FIREBASE_SB,
messagingSenderId: process.env.FIREBASE_MSG_SENDER_ID,
appId: process.env.FIREBASE_APP_ID,
},
},
})
dynamicPlugins.push({
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: process.env.VIEW_ID,
},
})
}
module.exports = {
siteMetadata: {
title: `DesignRant`,
description: `Short, sharp user experience complaints.`,
siteUrl: `https://designrant.app/`,
},
mapping: {
"MarkdownRemark.frontmatter.author": `AuthorYaml`,
},
plugins: [
`gatsby-plugin-sitemap`,
{
resolve: "gatsby-plugin-robots-txt",
options: {
host: "https://designrant.app",
sitemap: "https://designrant.app/sitemap.xml",
policy: [{ userAgent: "*", allow: "/" }],
},
},
{
resolve: "gatsby-plugin-mailchimp",
options: {
endpoint:
"https://codes.us4.list-manage.com/subscribe/post?u=0cf960d42e04bd50f7c21d709&id=b09e53f081",
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/content`,
name: `assets`,
},
},
// additional instance of this plugin to read source nodes from second location in filesystem
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/content/legal`,
name: `legal`,
},
},
`gatsby-transformer-yaml`,
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 390,
linkImagesToOriginal: false,
},
},
`gatsby-remark-images-medium-zoom`,
{
resolve: `gatsby-remark-responsive-iframe`,
options: {
wrapperStyle: `margin-bottom: 1.0725rem`,
},
},
`gatsby-remark-prismjs`,
`gatsby-remark-copy-linked-files`,
`gatsby-remark-smartypants`,
],
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
`gatsby-plugin-sass`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `DesignRant.app`,
short_name: `DesignRant`,
start_url: `/`,
background_color: `#000000`,
theme_color: `#ffffff`,
display: `minimal-ui`,
icon: `content/assets/favicon.png`,
},
},
`gatsby-plugin-react-helmet`,
{
resolve: "gatsby-plugin-use-dark-mode",
},
{
resolve: `@gatsby-contrib/gatsby-plugin-elasticlunr-search`,
options: {
fields: [`title`, `description`, `tags`],
resolvers: {
MarkdownRemark: {
title: node => node.frontmatter.title,
tags: node => node.frontmatter.tags.join(" "),
description: node => node.frontmatter.description,
slug: node => node.fields.slug,
date: node => node.frontmatter.date,
},
},
filter: (node, getNode) => node.frontmatter.type === "Post",
},
},
].concat(dynamicPlugins),
}
|
const { ConstructLibraryCdktf, JsonFile } = require('projen');
const cdktfVersion = '0.5.0';
const CDKTF_JSON_FILE = 'cdktf.json';
const tsCustomConfig = {
exclude: ['examples'],
include: ['src/**/*.ts', 'src/**.*.tf'],
};
const project = new ConstructLibraryCdktf({
name: 'cdktf-metaflow',
authorName: 'Bryan Galvin',
authorEmail: 'bcgalvin@gmail.com',
repositoryUrl: 'https://github.com/bcgalvin/cdktf-metaflow',
description: 'High level cdktf construct to provision metaflow resources on AWS',
defaultReleaseBranch: 'main',
devDeps: ['source-map-support'],
license: 'Apache-2.0',
tsconfig: tsCustomConfig,
defaultReleaseBranch: 'main',
cdktfVersion: cdktfVersion,
codeCov: true,
minNodeVersion: '12.13.0',
releaseEveryCommit: true,
releaseToNpm: true,
python: {
distName: 'cdktf-metaflow',
module: 'cdktf_metaflow',
},
eslint: false,
gitignore: [
'.DS_Store',
'**/*.js',
'**/*.d.ts',
'package-lock.json',
'yarn.lock',
'/test/__snapshots__/',
'.gen',
'.vscode'
],
npmignore: ['examples']
});
project.npmignore.include('./lib/modules/*');
project.addTask('build-cdktf').exec('rm -rf ./src/* && mkdir -p src/modules && npx cdktf get && cp -R .gen/modules/* ./src/modules && rm -rf .gen')
project.addTask('update-docs').exec('rm README.md && cat API.md >> README.md')
new JsonFile(project, CDKTF_JSON_FILE, {
obj: {
language: 'typescript',
app: 'echo noop',
terraformModules: [
{
name: "metaflow",
source: "./modules/metaflow"
},
{
name: "common",
source: "./modules/common"
}
]
},
});
project.compileTask.exec('mkdir -p lib/modules && cp -R src/modules lib');
project.synth();
|
let CustomerModel = require('../models/customer.model');
let express = require('express');
let router = express.Router();
router.post('/customer', (req, res) => {
if (!req.body) {
return res.status(400).send('Request body is missing');
}
let model = new CustomerModel(req.body);
model
.save()
.then(doc => {
if (!doc || doc.length === 0) {
return res.status(500).send(doc);
}
res.status(201).send(doc);
})
.catch(err => {
res.status(500).json(err);
});
});
module.exports = router;
|
(function(){
var canv = document.getElementById('myCanvas'),
c = canv.getContext('2d'),
gravity = 0.1,
dampening = 0.99,
pullStrength = 0.01,
circles = [ ],
i, numCircles = 10;
for(i = 0; i < numCircles; i++){
circles.push({
x: Math.random() * canv.width,
y: Math.random() * canv.height,
// (vx, vy) = Velocity vector
vx: 0,
vy: 0,
radius: 20
});
}
function executeFrame(){
var i, circle;
for(i = 0; i < numCircles; i++){
circle = circles[i];
// Increment location by velocity
circle.x += circle.vx;
circle.y += circle.vy;
// Increment Gravity
circle.vy += gravity;
// Slow it down
circle.vy *= dampening;
circle.vx *= dampening;
// Bounce
// bottom
if(circle.y + circle.radius > canv.height){
circle.y = canv.height - circle.radius;
circle.vy = -Math.abs(circle.vy);
}
// right
if(circle.x + circle.radius > canv.width){
circle.x = canv.width - circle.radius;
circle.vx = -Math.abs(circle.vx);
}
c.beginPath();
c.arc(circle.x, circle.y, circle.radius,
0, 2*Math.PI);
c.closePath();
c.fillStyle = 'black';
c.fill();
}
c.fillStyle = 'rgba(255,255,255,0.05)';
c.fillRect(0, 0, canv.width, canv.height);
requestAnimFrame(executeFrame);
}
canv.addEventListener('mousedown', function(e){
var dx, dy, i, circle;
for(i = 0; i < numCircles; i++){
circle = circles[i];
dx = e.pageX - circle.x,
dy = e.pageY - circle.y,
circle.vx += dx * pullStrength;
circle.vy += dy * pullStrength;
}
});
// Start animation
executeFrame();
})();
|
var reload = chrome.runtime.reload
document.addEventListener("DOMContentLoaded",ondom)
function getel(id) { return document.getElementById(id) }
function ui_ready() {
getel('main-loading').style.display = 'none'
getel('main-content').style.display = 'block'
if (window.webapp) {
if (! (webapp.started || webapp.starting)) {
// autostart ?
webapp.start()
}
}
}
function settings_ready() {
//window.localOptions = d
console.log('fetched local settings',appOptions)
window.webapp = bg.get_webapp(appOptions.getAll()) // retainStr in here
bg.WSC.VERBOSE = bg.WSC.DEBUG = appOptions.get('optVerbose')
create_polymer_elements()
on_webapp_change()
webapp.on_status_change = on_webapp_change
setup_events()
ui_ready()
}
function ondom() {
chrome.runtime.getBackgroundPage( function(bg) {
window.appOptions = new window.AppOptions(settings_ready)
window.bg = bg
})
}
function get_status() {
return {
starting: webapp.starting,
started: webapp.started,
lasterr: webapp.lasterr,
folder: webapp.fs &&
webapp.fs.entry &&
webapp.fs.entry.fullPath
}
}
function on_webapp_change() {
var status = get_status()
console.log('webapp changed',status)
var c = document.getElementsByTagName('wsc-controls')[0]
// window could be undefined if suspend event?
if (window) {
window.wc = c
c.set('interfaces', webapp.urls.slice()) // why have to slice???
c.set('port', webapp.port)
c.set('folder', status.folder)
c.set('started', webapp.started)
c.set('starting', webapp.starting)
c.set('lasterr', webapp.lasterr)
}
}
function setup_events() {
function keydown(evt) {
if (evt.metaKey || evt.ctrlKey) {
if (evt.keyCode == 82) {
// ctrl-r
console.log('received ctrl(meta)-r, reload app')
if (window.fgapp) {
fgapp.reload()
} else {
chrome.runtime.reload()
}
}
//evt.preventDefault() // dont prevent ctrl-w
}
}
document.body.addEventListener('keydown', keydown)
document.getElementById('help-icon').addEventListener('click', function(evt) {
document.getElementById('help-dialog').open()
})
}
function create_polymer_elements() {
if (! window.Polymer) {
document.getElementById('polymerWarning').style.display = 'block'
}
Polymer({
is: 'wsc-controls',
properties: {
interfaces: { type: Array,
value: [] },
started: Boolean,
starting: Boolean,
lasterr: '??',
folder: {type:String, value:'No folder selected'},
port: {type:Number, value:6669},
state: { type: String,
computed: 'computeState(started, starting, lasterr)' }
},
displayFolder: function(folder) {
if (! folder) {
return "NO FOLDER SELECTED"
} else {
return folder
}
},
computeState: function(started, starting, lasterr) {
if (lasterr) {
return JSON.stringify(lasterr)
} else if (starting) {
return 'STARTING'
} else if (started) {
return 'STARTED'
} else {
return 'STOPPED'
}
},
ready: function() {
console.log('wsc-controls ready')
},
onChooseFolder: function() {
console.log('clicked choose folder')
function onfolder(folder) {
bg.onchoosefolder(folder)
}
chrome.fileSystem.chooseEntry({type:'openDirectory'}, onfolder)
},
onStartStop: function(evt) {
if (! this.$$('#start-stop').active) { // changes before on-click
console.log('stopping webapp')
webapp.stop()
} else {
console.log('starting webapp')
webapp.start()
}
}
})
Polymer({
is: 'wsc-options',
properties: {
showAdvanced: { type: Boolean,
value: false },
port: { type: Number,
value: webapp.port },
optAllInterfaces: {
type: Boolean,
observer: 'interfaceChange',
value: appOptions.options['optAllInterfaces']
},
optDoPortMapping: {
observer: 'portmapChange',
type: Boolean,
value: appOptions.options['optDoPortMapping']
},
optIPV6: {
type: Boolean,
observer: 'optIPV6Change',
value: appOptions.options['optIPV6']
},
optVerbose: {
type: Boolean,
observer: 'optVerboseChange',
value: appOptions.options['optVerbose']
},
optCORS: {
type: Boolean,
observer: 'optCORSChange',
value: appOptions.options['optCORS']
},
optStatic: {
type: Boolean,
observer: 'optStaticChange',
value: appOptions.options['optStatic']
},
optUpload: {
type: Boolean,
observer: 'optUploadChange',
value: appOptions.options['optUpload']
},
optTryOtherPorts: {
type: Boolean,
value: false
},
optStopIdleServer: { // ms until stop inactive server
type: Number,
value: 0
},
optRetryInterfaces: {
type: Boolean,
value: true
},
optPreventSleep: {
type: Boolean,
observer: 'preventSleepChange',
value: appOptions.options['optPreventSleep']
},
optBackground: {
type: Boolean,
observer: 'backgroundChange',
value: appOptions.options['optBackground']
},
optAutoStart: {
type: Boolean,
observer: 'autoStartChange',
value: appOptions.options['optAutoStart']
},
optRenderIndex: {
type: Boolean,
observer: 'optRenderIndexChange',
value: appOptions.options['optRenderIndex']
}
},
optStaticChange: function(val) {
var k = 'optStatic'
this.updateAndSave(k,val)
},
optUploadChange: function(val) {
var k = 'optUpload'
this.updateAndSave(k,val)
},
optCORSChange: function(val) {
var k = 'optCORS'
this.updateAndSave(k,val)
},
optVerboseChange: function(val) {
var k = 'optVerbose'
this.updateAndSave(k,val)
bg.WSC.VERBOSE = bg.WSC.DEBUG = val
},
optIPV6Change: function(val) {
var k = 'optIPV6'
this.updateAndSave(k,val)
},
updateAndSave: function(k,v) {
console.log('update and save',k,v)
webapp.updateOption(k,v)
appOptions.set(k,v)
},
ready: function() {
console.log('wsc-options ready')
window.opts = this
},
attributeChanged: function(name, type) {
console.log("attribute change",name,type)
},
propertyObserver: function() {
console.log('property observer',arguments)
},
portmapChange: function(val) {
console.log('persist setting portmapping',val)
webapp.updateOption('optDoPortMapping',val)
appOptions.set('optDoPortMapping',val)
},
interfaceChange: function(val) {
console.log('persist setting interface',val)
webapp.opts.optAllInterfaces = val
webapp.interfaces = []
appOptions.set('optAllInterfaces',val)
},
toggleShowAdvanced: function(evt) {
this.showAdvanced = ! this.showAdvanced
evt.preventDefault()
},
preventSleepChange: function(val) {
/*
maybe make power an optional permission? only, it is automatically granted without user gesture...
*/
console.log('persist setting prevent sleep',val)
webapp.opts.optPreventSleep = val
webapp.updatedSleepSetting()
appOptions.set('optPreventSleep',val)
},
autoStartChange: function(val) {
console.log('persist setting autostart')
appOptions.set('optAutoStart', val)
bg.backgroundSettingChange({'optAutoStart':val})
},
backgroundChange: function(val) {
console.log('background setting changed',val)
webapp.updateOption('optBackground',val)
appOptions.set('optBackground', val)
bg.backgroundSettingChange({'optBackground':val})
},
optRenderIndexChange: function(val) {
console.log('persist setting renderIndex')
webapp.opts.optRenderIndex = val
appOptions.set('optRenderIndex',val)
},
onPortChange: function() {
var val = this.port
var port = parseInt(val)
console.log('persist port',port)
webapp.opts.port = port
webapp.port = port
appOptions.set('port',port)
},
onClickStartBackground: function(evt) {
var val = this.$$('#start-background').active
if (val) {
chrome.permissions.request({permissions:['background']}, function(result) {
console.log('request perm bg',result)
if (result) {
success()
}
})
} else {
chrome.permissions.remove({permissions:['background']}, function(result) {
console.log('drop perm bg',result)
success()
})
}
function success() {
console.log('persist setting start in background',val)
webapp.opts.optBackground = val
appOptions.set('optBackground',val)
bg.backgroundSettingChange({'optBackground':val})
}
}
})
}
|
function recargar(){window.location.href=base_url+"personas/persona"}$(function(){redirectBrowser(),$(window).scroll(function(){$(this).scrollTop()>400?$(".scrollup").fadeIn():$(".scrollup").fadeOut()}),$(".scrollup").on("click",function(){return $("html, body").animate({scrollTop:0},600),!1}),$('[data-tooltip!=""]').qtip({content:{attr:"data-tooltip"},position:{my:"top left"},style:{classes:"qtip-bootstrap qtip-DANE"}});new BootstrapDialog({title:"Instancia del dialogo",message:"Mensaje generico"});$("#frmPersona").validate({errorClass:"error-form",rules:{limitacion_decidir:{required:!0}},messages:{limitacion_decidir:{required:"ERROR: Debe seleccionar si la persona tiene dificultad para entender, aprender, recordar o tomar decisiones por sí mismo(a)."}},onfocusout:function(e){$(e).valid()||$("#"+$(e).attr("id")).focus()},errorPlacement:function(e,r){$(r).parents(".form-group").first().append(e.attr("role","alert"))},highlight:function(e,r,a){$(e).parents(".form-group").first().addClass("has-error")},unhighlight:function(e,r,a){$(e).parents(".form-group").first().removeClass("has-error")},submitHandler:function(e){return!0}}),$("#btnSiguiente").on("click",function(){if($(".alert").addClass("hidden"),1==$("#frmPersona").valid()){var e=$("#frmPersona").serialize();$(":input").addClass("disabled").prop("disabled",!0),$(":button").addClass("disabled").prop("disabled",!0),$.ajax({url:base_url+"personas/persona/guardar",type:"POST",dataType:"json",data:e+"&numePers="+$("#frmPersona").data("nume_pers")+"&duracion="+duracionPagina(),beforeSend:function(){$("#msgSuccess").html("Guardando la(s) respuesta(s). Espere por favor..."),$("#divMsg").removeClass("hidden"),$("#divMsgSuccess").removeClass("hidden")}}).done(function(e){0==e.codiError?($("#msgSuccess").html(e.mensaje),$("#divMsg").removeClass("hidden"),$("#divMsgSuccess").removeClass("hidden"),$("#progressbar").html(e.avance+" COMPLETADO").css("width",e.avance),setTimeout(recargar,2e3)):($("#msgError").html(e.mensaje),$("#divMsg").removeClass("hidden"),$("#divMsgAlert").removeClass("hidden"))}).fail(function(e){window.location.href=base_url+"persona"})}}),$("#btnAnterior").on("click",function(){$(":input").addClass("disabled").prop("disabled",!0),$(":button").addClass("disabled").prop("disabled",!0),$.ajax({url:base_url+"personas/persona/regresar",type:"POST",dataType:"json",data:"duracion="+duracionPagina()}).done(function(e){0==e.codiError?($("#progressbar").html(e.avance+" COMPLETADO").css("width",e.avance),window.location.href=base_url+"personas/persona"):($("#msgError").html(e.mensaje),$("#divMsg").removeClass("hidden"),$("#divMsgAlert").removeClass("hidden"))}).fail(function(e){window.location.href=base_url+"persona"})})});
|
/**
* @module AuthController
* @description Controller for Authentication, both into HID and OAuth sites.
*/
const Boom = require('@hapi/boom');
const Hoek = require('@hapi/hoek');
const Client = require('../models/Client');
const Flood = require('../models/Flood');
const JwtToken = require('../models/JwtToken');
const OauthToken = require('../models/OauthToken');
const User = require('../models/User');
const JwtService = require('../services/JwtService');
const HelperService = require('../services/HelperService');
const AuthPolicy = require('../policies/AuthPolicy');
const config = require('../../config/env');
const { logger } = config;
/**
* Main helper function used for login. All logins go through this.
*/
async function loginHelper(request) {
const password = request.payload ? request.payload.password : false;
let email = false;
if (request.payload && request.payload.email) {
email = request.payload.email.toLowerCase();
}
if (!email || !password) {
const cuser = request.auth.credentials;
if (!cuser) {
logger.warn(
'[AuthController->loginHelper] Could not log in because of an invalid JSON Web Token',
{
request,
security: true,
user: {
email,
},
},
);
throw Boom.unauthorized('Invalid JSON Web Token');
}
cuser.sanitize(cuser);
return cuser;
}
// Set up flood count: if there has been 5 failed login attempts in the last
// five minutes, prevent authorization.
const now = Date.now();
const offset = 5 * 60 * 1000;
const d5minutes = new Date(now - offset);
// Query DB for flood count and User profile which owns email address.
const [floodCount, user] = await Promise.all([
Flood.countDocuments({ type: 'login', email, createdAt: { $gte: d5minutes.toISOString() } }),
User.findOne({ 'emails.email': email }),
]);
// If the flood count is too high, disable further attempts until the timer
// gets reset.
if (floodCount >= 5) {
logger.warn(
'[AuthController->loginHelper] Account locked for 5 minutes',
{
request,
security: true,
fail: true,
user: {
email,
},
},
);
throw Boom.tooManyRequests('Your account has been locked for 5 minutes because of too many requests.');
}
// Was the user found?
if (!user) {
logger.warn(
'[AuthController->loginHelper] Unsuccessful login attempt due to invalid email address',
{
request,
security: true,
fail: true,
},
);
throw Boom.unauthorized('invalid email or password');
}
// Is the email being used for login confirmed? User MUST demonstrate
// ownership the address before it can be used for logging in.
const loginEmail = user.emails[user.emailIndex(email)];
const loginEmailConfirmed = loginEmail !== null ? loginEmail.validated : false;
if (!loginEmailConfirmed || !user.email_verified) {
logger.warn(
'[AuthController->loginHelper] Unsuccessful login attempt due to unverified email',
{
request,
security: true,
fail: true,
user: {
id: user.id,
email,
},
},
);
throw Boom.unauthorized('Please verify your email address');
}
// Check that the password is valid.
if (!user.validPassword(password)) {
logger.warn(
'[AuthController->loginHelper] Unsuccessful login attempt due to invalid password',
{
request,
security: true,
fail: true,
user: {
id: user.id,
email,
},
},
);
// Create a flood entry
await Flood.create({ type: 'login', email, user });
throw Boom.unauthorized('invalid email or password');
}
return user;
}
function loginRedirect(request, reply, cookie = false) {
let redirect = '';
if (request.payload.response_type) {
redirect = request.payload.redirect || '/oauth/authorize';
redirect += `?client_id=${request.payload.client_id}`;
redirect += `&redirect_uri=${request.payload.redirect_uri}`;
redirect += `&response_type=${request.payload.response_type}`;
redirect += `&scope=${request.payload.scope}`;
if (request.payload.state) {
redirect += `&state=${request.payload.state}`;
}
if (request.payload.nonce) {
redirect += `&nonce=${request.payload.nonce}`;
}
} else {
redirect = '/user';
}
logger.info(
'[AuthController->loginRedirect] Successful user authentication. Redirecting.',
{
request,
security: true,
oauth: {
client_id: request.payload.client_id,
},
user: {
email: request.payload.email,
},
},
);
if (!cookie) {
return reply.redirect(redirect);
}
return reply.redirect(redirect).state(cookie.name, cookie.value, cookie.options);
}
module.exports = {
/*
* @api [post] /jsonwebtoken
* tags:
* - auth
* summary: Generate a JSON web token (JWT)
* parameters:
* - name: X-HID-TOTP
* in: header
* description: The TOTP token. Required if the user has 2FA enabled.
* required: false
* type: string
* requestBody:
* description: 'User email and password'
* required: true
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Auth'
* responses:
* '200':
* description: >-
* The User object with the JWT contained in the `token` property.
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/JWT'
* '400':
* description: 'Bad request. Missing email and/or password'
* '401':
* description: 'Wrong email and/or password'
* '429':
* description: >-
* The account was locked for 5 minutes because there were more than 5
* unsuccessful login attempts within the last 5 minutes
* security: []
*/
async authenticate(request) {
const result = await loginHelper(request);
if (result.totp === true) {
// Check to see if device is not a trusted device
const trusted = request.state['x-hid-totp-trust'];
if (!trusted || (trusted && !result.isTrustedDevice(request.headers['user-agent'], trusted))) {
const token = request.headers['x-hid-totp'];
await AuthPolicy.isTOTPValid(result, token);
}
}
const payload = { id: result._id };
if (request.payload && request.payload.exp) {
payload.exp = request.payload.exp;
}
const token = JwtService.issue(payload);
result.sanitize(result);
if (!payload.exp) {
// Creating an API key, store the token in the database
await JwtToken.create({
token,
user: result._id.toString(),
blacklist: false,
// TODO: add expires
});
logger.warn(
'[AuthController->authenticate] Created an API key',
{
request,
security: true,
user: {
id: result._id.toString(),
email: result.email,
},
},
);
return {
user: result,
token,
};
}
logger.info(
'[AuthController->authenticate] Successful user authentication. Returning JWT.',
{
request,
security: true,
user: {
email: result.email,
},
},
);
return { user: result, token };
},
/**
* POST Handler for login form submissions.
*
* Create a user session, and potentially redirect when the user arrived from
* another website.
*/
async login(request, reply) {
// Get user session.
const cookie = request.yar.get('session');
// If the user has a User ID set, and passed the optional 2FA challenge,
// they can be redirected immediately.
if (cookie && cookie.userId && cookie.totp === true) {
return loginRedirect(request, reply);
}
// The User ID is set, but it looks like 2FA is required.
if (cookie && cookie.userId && cookie.totp === false) {
try {
// Prevent form spamming by counting submissions and locking accounts
// which fail to login repeatedly in a short time window.
const now = Date.now();
const offset = 5 * 60 * 1000;
const d5minutes = new Date(now - offset);
const [floodCount, user] = await Promise.all([
Flood.countDocuments({
type: 'totp',
email: cookie.userId,
createdAt: {
$gte: d5minutes.toISOString(),
},
}),
User.findOne({ _id: cookie.userId }),
]);
// If flood-count too high, lock further attempts.
if (floodCount >= 5) {
logger.warn(
'[AuthController->login] Account locked for 5 minutes',
{
request,
security: true,
fail: true,
user: {
id: cookie.userId,
},
},
);
throw Boom.tooManyRequests('Your account has been locked for 5 minutes because of too many requests.');
}
// Check for TOTP codes
const token = request.payload['x-hid-totp'];
try {
await AuthPolicy.isTOTPValid(user, token);
} catch (err) {
if (err.output.statusCode === 401) {
// Create a flood entry
await Flood.create({
type: 'totp',
email: cookie.userId,
user,
});
}
throw err;
}
// If we got here, the user passed TOTP. We need to destroy the session
// they used to authenticate, and begin a new session with a fresh ID.
cookie.totp = true;
request.yar.reset();
request.yar.set('session', cookie);
// If save device was checked, avoid TOTP prompts for 30 days.
if (request.payload['x-hid-totp-trust']) {
await HelperService.saveTOTPDevice(request, user);
const tindex = user.trustedDeviceIndex(request.headers['user-agent']);
const random = user.totpTrusted[tindex].secret;
return loginRedirect(request, reply, {
name: 'x-hid-totp-trust',
value: random,
options: {
ttl: 30 * 24 * 60 * 60 * 1000,
domain: 'humanitarian.id',
isSameSite: false,
isHttpOnly: false,
},
});
}
// Redirect.
//
// - For plain logins, this will go to user dashboard.
// - For OAuth flows, this will either redirect to the Authorize prompt
// or it will directly send them back to the original site.
return loginRedirect(request, reply);
} catch (err) {
// User needs TOTP and header wasn't present. Show TOTP prompt.
const alert = {
type: 'error',
message: err.output.payload.message,
};
// Display form to user.
return reply.view('totp', {
title: 'Enter your Authentication code',
query: request.payload,
destination: '/login',
alert,
});
}
}
// Arriving here means the user does NOT have 2FA enabled. We will set their
// TOTP flag to true when defining the session.
try {
const result = await loginHelper(request);
if (!result.totp) {
// Store user login time.
result.auth_time = new Date();
await result.save();
// The user is now logged in. We destroy their old session and create a
// fresh session ID for their logged-in activity.
request.yar.reset();
request.yar.set('session', {
userId: result.id,
totp: true,
});
return loginRedirect(request, reply);
}
// Check to see if device is a trusted device.
const trusted = request.state['x-hid-totp-trust'];
if (trusted && result.isTrustedDevice(request.headers['user-agent'], trusted)) {
// If trusted device, go onto store user login time.
result.auth_time = new Date();
await result.save();
// Set cookie.
request.yar.set('session', {
userId: result.id,
totp: true,
});
// Redirect
return loginRedirect(request, reply);
}
// Set cookie
request.yar.set('session', {
userId: result.id,
totp: false,
});
// Display TOTP prompt
return reply.view('totp', {
title: 'Enter your Authentication code',
query: request.payload,
destination: '/login',
alert: false,
});
} catch (err) {
const params = HelperService.getOauthParams(request.payload);
let registerLink = '/register';
if (params) {
registerLink += `?${params}`;
}
let passwordLink = '/password';
if (params) {
passwordLink += `?${params}`;
}
const alertMessage = 'We could not log you in. The username or password you have entered are incorrect. Kindly try again.';
// Display login form to user.
return reply.view('login', {
title: 'Log into Humanitarian ID',
query: request.payload,
registerLink,
passwordLink,
alert: {
type: 'error',
message: alertMessage,
},
});
}
},
/**
* User-facing dialog to authorize an OAuth Client.
*
* This is the entry point for OAuth flows. Here's a list of potential events:
*
* - It requires an active user session so it first redirects to login form if
* the user isn't logged in.
* - Once the user arrives back here with a session, the OAuth Client data is
* validated to ensure that it's a legitimate attempt from the real website.
* - Now the user profile is checked to see if they have this OAuth Client in
* their approved list.
* - If YES, they redirect back to the website. The end.
* - If NO, they are presented with the Allow/Deny buttons. For further
* progress, look at submission handler.
*
* @see authorizeOauth2()
*/
async authorizeDialogOauth2(request, reply) {
// For some errors, we end up showing a prompt saying that the problem
// originated on the website which sent the user to HID. It's not always
// possible, but when we can we populate this URL so we can link them back
// to where they came from.
let errorRedirectUrl = '';
try {
const oauth = request.server.plugins['hapi-oauth2orize'];
const prompt = request.query.prompt ? request.query.prompt : '';
const redirectUrl = `${request.query.redirect_uri}?state=${request.query.state}&scope=${request.query.scope}&nonce=${request.query.nonce}`;
// Check response_type
if (!request.query.response_type) {
logger.warn(
'[AuthController->authorizeDialogOauth2] Unsuccessful OAuth2 authorization due to missing response_type',
{
request,
security: true,
fail: true,
oauth: {
client_id: request.query.client_id,
},
},
);
return reply.redirect(`${redirectUrl}&error=invalid_request`);
}
// If the user is not authenticated, redirect to the login page and preserve
// all relevant query parameters.
const cookie = request.yar.get('session');
if (!cookie || (cookie && !cookie.userId) || (cookie && !cookie.totp) || prompt === 'login') {
// If user is not logged in and prompt is set to none, throw an error message.
if (prompt === 'none') {
return reply.redirect(`${redirectUrl}&error=login_required`);
}
logger.info(
'[AuthController->authorizeDialogOauth2] Get request to /oauth/authorize without session. Redirecting to the login page.',
{
request,
security: true,
oauth: {
client_id: request.query.client_id,
redirect_uri: request.query.redirect_uri,
response_type: request.query.response_type,
},
},
);
return reply.redirect(
`/?redirect=/oauth/authorize&client_id=${request.query.client_id
}&redirect_uri=${request.query.redirect_uri
}&response_type=${request.query.response_type
}&state=${request.query.state
}&scope=${request.query.scope
}&nonce=${request.query.nonce
}#login`,
);
}
// If the user is authenticated, then check whether the user has confirmed
// authorization for this client/scope combination.
const options = {};
const user = await User.findOne({ _id: cookie.userId }).populate({ path: 'authorizedClients', select: 'id name' });
const clientId = request.query.client_id;
user.sanitize(user);
request.auth.credentials = user;
// Validate the OAuth Authorization request. If any parameters are missing
// or invalid, it will throw an error internally, but will show a generic
// message about configuration to the user.
// eslint-disable-next-line max-len
const [req] = await oauth.authorize(request, reply, options, async (oauthClientId, redirect, done) => {
try {
// Verify OAuth Client ID.
const client = await Client.findOne({ id: oauthClientId });
if (!client || !client.id) {
logger.warn(
'[AuthController->authorizeDialogOauth2] Unsuccessful OAuth2 authorization because client was not found',
{
request,
security: true,
fail: true,
user: {
id: cookie.userId,
},
oauth: {
client_id: oauthClientId,
},
},
);
throw Error(`Client ID does not exist: ${oauthClientId}`);
}
// Verify redirect_uri
if (client.redirectUri !== redirect && !client.redirectUrls.includes(redirect)) {
logger.warn(
'[AuthController->authorizeDialogOauth2] Unsuccessful OAuth2 authorization due to wrong redirect URI',
{
request,
security: true,
fail: true,
user: {
id: cookie.userId,
},
oauth: {
client_id: client.id,
redirect_uri: redirect,
},
},
);
// Extract hostname from redirect URL
const officialRedirect = client.redirectUri || client.redirectUrls[0];
errorRedirectUrl = new URL(officialRedirect).origin;
throw Error(`Wrong redirect URI: ${redirect}`);
}
// The request passed validation. Proceed.
return done(null, client, redirect);
} catch (err) {
// Check the error object and potentially log the error if it does NOT
// contain one of the validation problems we already logged. We log
// validation problems before throwing in order to provide contextual
// metadata in the logs, so that known problems can be more easily
// found in Kibana.
//
// If we didn't find any known problems, we should log the error. This
// conditional needs to have one test for each Error() in the preceding
// try() block.
if (
err.message
&& err.message.indexOf('Client ID does not exist') === -1
&& err.message.indexOf('Wrong redirect URI') === -1
) {
logger.error(
`[AuthController->authorizeDialogOauth2] ${err.message}`,
{
request,
security: true,
fail: true,
user: {
id: cookie.userId,
},
stack_trace: err.stack,
},
);
}
// Finish the OAuth validation process.
return done('catch()');
}
});
// If we made it this far, the OAuth config seems legit. Check user data
// to see if they already have this client in their approved list.
if (user.authorizedClients && user.hasAuthorizedClient(clientId)) {
request.payload = { transaction_id: req.oauth2.transactionID };
const response = await oauth.decision(request, reply);
return response;
}
// If prompt === none, redirect immediately.
if (prompt === 'none') {
return reply.redirect(`${redirectUrl}&error=interaction_required`);
}
// The user has not confirmed authorization, so display the authorization
// dialog to the user and let them decide to approve/deny.
return reply.view('authorize', {
user,
client: req.oauth2.client,
transactionID: req.oauth2.transactionID,
// csrf: req.csrfToken()
});
} catch (err) {
// Display a human-friendly error.
//
// We're not doing additional logging in this block because we logged the
// errors as they were caught in the code above.
const linktoPartnerSite = errorRedirectUrl && `<br><p>Go back to <a href="${errorRedirectUrl}">${errorRedirectUrl}</a></p>`;
return reply.view('message', {
title: 'Configuration problem on original website',
alert: {
type: 'error',
message: `
<p>The website which sent you to HID appears to have invalid configuration.</p>
<p>We have logged the problem internally.</p>
${linktoPartnerSite || ''}
`,
},
});
}
},
/**
* Form submission handler to OAuth Client authorizations.
*
* This function supports the user-facing function by handling all the form
* submissions.
*
* - If ALLOW, the OAuth Client is added to their profile, and they redirect
* to the original website.
* - If DENY, the process halts and they get redirected to their HID dashboard.
*/
async authorizeOauth2(request, reply) {
try {
const oauth = request.server.plugins['hapi-oauth2orize'];
const cookie = request.yar.get('session');
// Force users without existing sessions to log in.
if (!cookie || (cookie && !cookie.userId) || (cookie && !cookie.totp)) {
logger.info(
'[AuthController->authorizeOauth2] Got request to /oauth/authorize without session. Redirecting to the login page.',
{
request,
oauth: {
client_id: request.query.client_id,
redirect_uri: request.query.redirect_uri,
response_type: request.query.response_type,
},
},
);
return reply.redirect(
`/?redirect=/oauth/authorize&client_id=${request.query.client_id
}&redirect_uri=${request.query.redirect_uri
}&response_type=${request.query.response_type
}&state=${request.query.state
}&scope=${request.query.scope
}&nonce=${request.query.nonce
}#login`,
);
}
// Look up user in DB.
const user = await User.findOne({ _id: cookie.userId });
if (!user) {
logger.warn(
`[AuthController->authorizeOauth2] Unsuccessful OAuth2 authorization attempt. Could not find user with ID ${cookie.userId}`,
{
request,
security: true,
fail: true,
oauth: {
client_id: request.query.client_id,
redirect_uri: request.query.redirect_uri,
response_type: request.query.response_type,
},
},
);
throw Boom.badRequest('Could not find user');
}
user.sanitize(user);
request.auth.credentials = user;
// Set up OAuth Client to potentially be stored on user profile.
const clientMongoId = request.yar.authorize[request.payload.transaction_id].client;
const clientId = request.yar.authorize[request.payload.transaction_id].req.clientID;
// If user clicked 'Deny', redirect to HID homepage.
if (!request.payload.bsubmit || request.payload.bsubmit === 'Deny') {
return reply.redirect('/');
}
// If the user clicked 'Allow', save OAuth Client to user profile
if (!user.hasAuthorizedClient(clientMongoId) && request.payload.bsubmit === 'Allow') {
// TODO: we could store an array of objects including the current time
// when adding the client, in order to offer security-related info
// when the user views their OAuth settings.
//
// @see HID-2156
user.authorizedClients.push(clientMongoId);
user.markModified('authorizedClients');
await user.save();
logger.info(
'[AuthController->authorizeOauth2] Added OAuth Client to user profile',
{
request,
security: true,
user: {
id: user.id,
email: user.email,
},
oauth: {
client_id: clientId,
},
},
);
}
const response = await oauth.decision(request, reply);
return response;
} catch (err) {
logger.error(
`[AuthController->authorizeOauth2] ${err.message}`,
{
request,
security: true,
fail: true,
stack_trace: err.stack,
},
);
return err;
}
},
/**
* Issues an access_token during "Extra Secure" OAuth flows.
*
* @see https://github.com/UN-OCHA/hid_api/wiki/Integrating-with-HID-via-OAuth#step-2--request-access-and-id-tokens
*/
async accessTokenOauth2(request, reply) {
try {
const oauth = request.server.plugins['hapi-oauth2orize'];
const { code } = request.payload;
if (!code && request.payload.grant_type !== 'refresh_token') {
logger.warn(
'[AuthController->accessTokenOauth2] Unsuccessful access token request due to missing authorization code.',
{
request,
security: true,
fail: true,
},
);
return Boom.unauthorized('Missing authorization code');
}
// Check client_id and client_secret
let client = null;
let clientId = null;
let clientSecret = null;
// Are we using POST body authorization?
if (request.payload.client_id && request.payload.client_secret) {
clientId = request.payload.client_id;
clientSecret = request.payload.client_secret;
} else if (request.headers.authorization) {
// Are we using Basic Auth?
const parts = request.headers.authorization.split(' ');
if (parts.length === 2) {
const credentials = parts[1];
const buff = Buffer.from(credentials, 'base64');
const text = buff.toString('ascii');
const cparts = text.split(':');
[clientId, clientSecret] = cparts;
}
} else {
// Neither authorization method found. Log it.
logger.warn(
'[AuthController->accessTokenOAuth2] Unsuccessful access token request due to invalid client authentication.',
{
request,
security: true,
fail: true,
},
);
return Boom.unauthorized('invalid client authentication');
}
// Look up OAuth Client in DB.
client = await Client.findOne({ id: clientId });
if (!client) {
logger.warn(
'[AuthController->accessTokenOAuth2] Unsuccessful access token request due to non-existent client ID.',
{
request,
security: true,
fail: true,
oauth: {
client_id: clientId,
},
},
);
return Boom.badRequest('invalid client_id');
}
// Does the client_secret we received match the DB entry?
if (clientSecret !== client.secret) {
logger.warn(
'[AuthController->accessTokenOAuth2] Unsuccessful access token request due to wrong client authentication.',
{
request,
security: true,
fail: true,
oauth: {
client_id: clientId,
client_secret: `${clientSecret.slice(0, 3)}...${clientSecret.slice(-3)}`,
},
},
);
return Boom.unauthorized('invalid client_secret');
}
// Grab token and type.
const token = request.payload.code ? request.payload.code : request.payload.refresh_token;
const type = request.payload.code ? 'code' : 'refresh';
// Find authorization code.
const ocode = await OauthToken.findOne({ token, type }).populate('client user');
if (!ocode) {
logger.warn(
'[AuthController->accessTokenOauth2] Unsuccessful access token request due to wrong authorization code.',
{
request,
security: true,
fail: true,
oauth: {
client_id: clientId,
token: `${token.slice(0, 3)}...${token.slice(-3)}`,
type,
},
},
);
// OAuth2 standard error.
const error = Boom.badRequest('invalid authorization code');
error.output.payload.error = 'invalid_grant';
return error;
}
// If we got here, the authorization code exists.
logger.info(
'[AuthController->accessTokenOauth2] Successful access token request',
{
request,
security: true,
oauth: {
client_id: clientId,
client_secret: `${clientSecret.slice(0, 3)}...${clientSecret.slice(-3)}`,
},
},
);
request.auth.credentials = ocode.client;
const response = await oauth.token(request, reply);
return response;
} catch (err) {
logger.error(
`[AuthController->accessTokenOauth2] ${err.message}`,
{
request,
security: true,
fail: true,
stack_trace: err.stack,
},
);
// Send a documented error code back.
return Boom.badRequest(err.message);
}
},
/**
* Returns our supported OpenID Connect configuration so that a client can
* be aware of certain properties, scopes, and other attributes supported by
* the HID implementation.
*/
openIdConfiguration() {
const root = process.env.ROOT_URL;
const out = {
issuer: root,
authorization_endpoint: `${root}/oauth/authorize`,
token_endpoint: `${root}/oauth/access_token`,
token_endpoint_auth_methods_supported: [
'client_secret_basic',
'client_secret_post',
],
userinfo_endpoint: `${root}/account.json`,
jwks_uri: `${root}/oauth/jwks`,
response_types_supported: ['code', 'token', 'id_token', 'id_token token'],
subject_types_supported: ['public'],
id_token_signing_alg_values_supported: ['RS256'],
scopes_supported: ['openid', 'email', 'profile'],
claims_supported: [
'iss',
'sub',
'name',
'email',
'email_verified',
],
};
return out;
},
/**
* Serve a user's identity for OpenID Connect.
*
* This shouldn't be used for anything else when working with API. If you do
* want more info about the user, use the dedicated API method:
*
* @see /api/v3/user/{id}
* @see UserController.findOne()
*/
showAccount(request) {
// Full user object from DB.
const user = Hoek.clone(request.auth.credentials);
const client = Hoek.clone(request.auth.artifacts);
// This will be what we send back as a response.
const output = {
id: user.id,
sub: user.id,
name: user.name,
email: user.email,
email_verified: user.email_verified.toString(),
iss: process.env.ROOT_URL || 'https://auth.humanitarian.id',
};
// Log the request
logger.info(
`[AuthController->showAccount] calling /account.json for ${user.email}`,
{
request,
user: {
id: user.id,
email: user.email,
admin: user.is_admin,
},
oauth: {
client_id: client && client.id,
},
},
);
// Send response
return output;
},
jwks() {
const key = JwtService.public2jwk();
key.alg = 'RS256';
const out = {
keys: [
key,
],
};
return out;
},
/*
* @api [get] /jsonwebtoken
*
* tags:
* - auth
* summary: Retrieve the JWTs of the current user
* responses:
* '200':
* description: >-
* Array of all JWTs for the current user, including blacklisted tokens.
*/
async jwtTokens(request) {
const tokens = await JwtToken.find({ user: request.auth.credentials._id });
return tokens;
},
/*
* @api [delete] /jsonwebtoken
*
* tags:
* - auth
* summary: Blacklists a JWT for the current user
* requestBody:
* description: The token to blacklist.
* required: true
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/JWT'
* responses:
* '200':
* description: JWT was successfully blacklisted
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/JWT'
* '400':
* description: Missing token
* '403':
* description: >-
* Could not blacklist this token because you did not generate it
*/
async blacklistJwt(request) {
const token = request.payload ? request.payload.token : null;
if (!token) {
logger.warn(
'[AuthController->blacklistJwt] Missing token',
{
request,
security: true,
fail: true,
},
);
throw Boom.badRequest('Missing token');
}
// Check that blacklisted token belongs to current user
const jtoken = JwtService.verify(token);
if (jtoken.id === request.auth.credentials.id) {
// Blacklist token
logger.info(
'[AuthController->blacklistJwt] Blacklisting token',
{
request,
security: true,
jwt: jtoken.id,
user: {
id: request.auth.credentials.id,
email: request.auth.credentials.email,
},
},
);
const doc = await JwtToken.findOneAndUpdate({ token }, {
token,
user: request.auth.credentials._id,
blacklist: true,
}, { upsert: true, new: true });
return doc;
}
logger.warn(
'[AuthController->blacklistJwt] Tried to blacklist a token by a user who does not have the permission',
{
request,
security: true,
fail: true,
user: {
id: request.auth.credentials.id,
email: request.auth.credentials.email,
},
},
);
throw Boom.forbidden('Could not blacklist this token because you did not generate it');
},
};
|
// 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 ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators ../state/Constraints ../support/mathUtils".split(" "),function(b,e,k,d,l,c,g,f){Object.defineProperty(e,"__esModule",{value:!0});var m=f.rad2deg(g.TiltDefault.min),h=f.rad2deg(g.TiltDefault.max);b=function(b){function a(){var a=null!==b&&b.apply(this,arguments)||this;a.mode="auto";return a}k(a,b);Object.defineProperty(a.prototype,
"max",{get:function(){return this._get("max")},set:function(a){this._set("max",a);this.mode="manual"},enumerable:!0,configurable:!0});a.prototype.castMax=function(a){return f.clamp(a,m,h)};a.prototype.autoUpdate=function(a){"auto"===this.mode&&this._get("max")!==a&&this._set("max",a)};d([c.property({type:String})],a.prototype,"mode",void 0);d([c.property({type:Number,value:h})],a.prototype,"max",null);d([c.cast("max")],a.prototype,"castMax",null);return a=d([c.subclass("esri.views.3d.constraints.TiltConstraint")],
a)}(c.declared(l));e.TiltConstraint=b;e.default=b});
|
import styled from "styled-components"
import { setFlex, setFlexDirection, breakpoint, setColor } from "../../styles/styleHelpers"
export const StyledClassHero = styled.div`
width: 100%;
${setFlex()};
${setFlexDirection({direction: "column"})}
${breakpoint.sm`
position: relative;
`}
`
export const StyledClassHeroTitle = styled.div`
h1 {
color: ${setColor.brandPrimary[700]};
}
`
export const StyledClassHeroImage = styled.div`
${breakpoint.sm`
${setFlex({justify: "center"})};
position: absolute;
top: 0;
right: 0;
`}
`
export const StyledClassHeroSummary = styled.div`
`
|
// A minimal mock of the Fellowship One API for testing against
var express = require('express')
var passport = require('passport')
var AnonymousStrategy = require('passport-anonymous').Strategy
var api = express.Router()
function resource (path, name) {
var obj = {}
obj[name] = {
'@id': '1'
}
api.route(path + '/New').get(function (req, res) {
res.status(200).send(obj)
})
api.route(path).post(function (req, res) {
res.status(201).send(obj)
})
}
function staticResource (path, reply) {
api.route(path).get(function (req, res) {
res.status(200).send(reply)
})
}
api.use(passport.initialize())
passport.use('anonymous', new AnonymousStrategy())
api.route('*')
.all(passport.authenticate('anonymous', {
session: false
}))
api.route('/PortalUser/AccessToken')
.post(function (req, res) {
res.setHeader('oauth_token', '1')
res.setHeader('oauth_token_secret', '1')
res.setHeader('content-location', '/foo')
res.status(200).send()
})
staticResource('/People/Search', {
'results': {
'@count': '0',
'@pageNumber': '',
'@totalRecords': '0',
'@additionalPages': '0'
}
})
staticResource('/People/Statuses', {
statuses: {
status: [{
'@id': '110',
'@uri': 'https://dc.staging.fellowshiponeapi.com/v1/People/Statuses/110',
'name': 'New from Website'
}, {
'@id': '12345',
'@uri': 'https://dc.staging.fellowshiponeapi.com/v1/People/Statuses/12345',
'name': 'New from Wufoo'
}]
}
})
staticResource('/Communications/CommunicationTypes', {
communicationTypes: {
communicationType: [{
'@id': '1',
'@uri': 'https://dc.staging.fellowshiponeapi.com/v1/Communications/CommunicationTypes/1',
'@generalType': 'Telephone',
name: 'Home Phone'
}, {
'@id': '5',
'@uri': 'https://dc.staging.fellowshiponeapi.com/v1/Communications/CommunicationTypes/5',
'@generalType': 'Email',
name: 'Home Email'
}, {
'@id': '4',
'@uri': 'https://dc.staging.fellowshiponeapi.com/v1/Communications/CommunicationTypes/4',
'@generalType': 'Email',
name: 'Email'
}]
}
})
staticResource('/Addresses/AddressTypes', {
addressTypes: {
addressType: [{
'@id': '1',
'@uri': 'https://dc.staging.fellowshiponeapi.com/v1/Addresses/AddressTypes/1',
name: 'Primary'
}]
}
})
resource('/People', 'person')
resource('/Households', 'household')
resource('/People/:id/Addresses', 'address')
resource('/People/:id/Communications', 'communication')
module.exports = api
|
// @flow strict-local
import type {
Asset as IAsset,
Bundle as IBundle,
BundleGroup,
CreateBundleOpts,
Dependency as IDependency,
GraphVisitor,
MutableBundleGraph as IMutableBundleGraph,
BundlerBundleGraphTraversable,
Target,
} from '@parcel/types';
import type {ParcelOptions} from '../types';
import invariant from 'assert';
import path from 'path';
import nullthrows from 'nullthrows';
import {md5FromString} from '@parcel/utils';
import BundleGraph from './BundleGraph';
import InternalBundleGraph from '../BundleGraph';
import {Bundle, bundleToInternalBundle} from './Bundle';
import {mapVisitor, ALL_EDGE_TYPES} from '../Graph';
import {assetFromValue, assetToAssetValue} from './Asset';
import {getBundleGroupId, getPublicId} from '../utils';
import Dependency, {dependencyToInternalDependency} from './Dependency';
import {environmentToInternalEnvironment} from './Environment';
import {targetToInternalTarget} from './Target';
import {HASH_REF_PREFIX} from '../constants';
export default class MutableBundleGraph extends BundleGraph<IBundle>
implements IMutableBundleGraph {
#graph /*: InternalBundleGraph */;
#options /*: ParcelOptions */;
#bundlePublicIds /*: Set<string> */ = new Set<string>();
constructor(graph: InternalBundleGraph, options: ParcelOptions) {
super(graph, Bundle.get, options);
this.#graph = graph;
this.#options = options;
}
addAssetGraphToBundle(
asset: IAsset,
bundle: IBundle,
shouldSkipDependency?: IDependency => boolean,
) {
this.#graph.addAssetGraphToBundle(
assetToAssetValue(asset),
bundleToInternalBundle(bundle),
shouldSkipDependency
? d => shouldSkipDependency(new Dependency(d))
: undefined,
);
}
addEntryToBundle(
asset: IAsset,
bundle: IBundle,
shouldSkipDependency?: IDependency => boolean,
) {
this.#graph.addEntryToBundle(
assetToAssetValue(asset),
bundleToInternalBundle(bundle),
shouldSkipDependency
? d => shouldSkipDependency(new Dependency(d))
: undefined,
);
}
createBundleGroup(dependency: IDependency, target: Target): BundleGroup {
let dependencyNode = this.#graph._graph.getNode(dependency.id);
if (!dependencyNode) {
throw new Error('Dependency not found');
}
let resolved = this.#graph.getDependencyResolution(
dependencyToInternalDependency(dependency),
);
if (!resolved) {
throw new Error(
'Dependency did not resolve to an asset ' + dependency.id,
);
}
let bundleGroup: BundleGroup = {
target,
entryAssetId: resolved.id,
};
let bundleGroupNode = {
id: getBundleGroupId(bundleGroup),
type: 'bundle_group',
value: bundleGroup,
};
this.#graph._graph.addNode(bundleGroupNode);
let assetNodes = this.#graph._graph.getNodesConnectedFrom(dependencyNode);
this.#graph._graph.addEdge(dependencyNode.id, bundleGroupNode.id);
this.#graph._graph.replaceNodesConnectedTo(bundleGroupNode, assetNodes);
this.#graph._graph.addEdge(dependencyNode.id, resolved.id, 'references');
this.#graph._graph.removeEdge(dependencyNode.id, resolved.id);
if (dependency.isEntry) {
this.#graph._graph.addEdge(
nullthrows(this.#graph._graph.getRootNode()).id,
bundleGroupNode.id,
'bundle',
);
} else {
let inboundBundleNodes = this.#graph._graph.getNodesConnectedTo(
dependencyNode,
'contains',
);
for (let inboundBundleNode of inboundBundleNodes) {
invariant(inboundBundleNode.type === 'bundle');
this.#graph._graph.addEdge(
inboundBundleNode.id,
bundleGroupNode.id,
'bundle',
);
}
}
return bundleGroup;
}
removeBundleGroup(bundleGroup: BundleGroup): void {
this.#graph.removeBundleGroup(bundleGroup);
}
internalizeAsyncDependency(bundle: IBundle, dependency: IDependency): void {
this.#graph.internalizeAsyncDependency(
bundleToInternalBundle(bundle),
dependencyToInternalDependency(dependency),
);
}
createBundle(opts: CreateBundleOpts): Bundle {
let entryAsset = opts.entryAsset
? assetToAssetValue(opts.entryAsset)
: null;
let target = targetToInternalTarget(opts.target);
let bundleId = md5FromString(
'bundle:' +
(opts.uniqueKey ?? nullthrows(entryAsset?.id)) +
path.relative(this.#options.projectRoot, target.distDir),
);
let existing = this.#graph._graph.getNode(bundleId);
if (existing != null) {
invariant(existing.type === 'bundle');
return Bundle.get(existing.value, this.#graph, this.#options);
}
let publicId = getPublicId(bundleId, existing =>
this.#bundlePublicIds.has(existing),
);
this.#bundlePublicIds.add(publicId);
let isPlaceholder = false;
if (entryAsset) {
let entryAssetNode = this.#graph._graph.getNode(entryAsset.id);
invariant(entryAssetNode?.type === 'asset', 'Entry asset does not exist');
isPlaceholder = entryAssetNode.requested === false;
}
let bundleNode = {
type: 'bundle',
id: bundleId,
value: {
id: bundleId,
hashReference: HASH_REF_PREFIX + bundleId,
type: opts.type ?? nullthrows(entryAsset).type,
env: opts.env
? environmentToInternalEnvironment(opts.env)
: nullthrows(entryAsset).env,
entryAssetIds: entryAsset ? [entryAsset.id] : [],
mainEntryId: entryAsset?.id,
pipeline: opts.pipeline ?? entryAsset?.pipeline,
filePath: null,
isEntry: opts.isEntry,
isInline: opts.isInline,
isSplittable: opts.isSplittable ?? entryAsset?.isSplittable,
isPlaceholder,
target,
name: null,
displayName: null,
publicId,
stats: {size: 0, time: 0},
},
};
this.#graph._graph.addNode(bundleNode);
if (opts.entryAsset) {
this.#graph._graph.addEdge(bundleNode.id, opts.entryAsset.id);
}
return Bundle.get(bundleNode.value, this.#graph, this.#options);
}
addBundleToBundleGroup(bundle: IBundle, bundleGroup: BundleGroup) {
this.#graph.addBundleToBundleGroup(
bundleToInternalBundle(bundle),
bundleGroup,
);
}
createAssetReference(
dependency: IDependency,
asset: IAsset,
bundle: IBundle,
): void {
return this.#graph.createAssetReference(
dependencyToInternalDependency(dependency),
assetToAssetValue(asset),
bundleToInternalBundle(bundle),
);
}
createBundleReference(from: IBundle, to: IBundle): void {
return this.#graph.createBundleReference(
bundleToInternalBundle(from),
bundleToInternalBundle(to),
);
}
getDependencyAssets(dependency: IDependency): Array<IAsset> {
return this.#graph
.getDependencyAssets(dependencyToInternalDependency(dependency))
.map(asset => assetFromValue(asset, this.#options));
}
traverse<TContext>(
visit: GraphVisitor<BundlerBundleGraphTraversable, TContext>,
): ?TContext {
return this.#graph._graph.filteredTraverse(
node => {
if (node.type === 'asset') {
return {
type: 'asset',
value: assetFromValue(node.value, this.#options),
};
} else if (node.type === 'dependency') {
return {type: 'dependency', value: new Dependency(node.value)};
}
},
visit,
undefined, // start with root
// $FlowFixMe
ALL_EDGE_TYPES,
);
}
getBundleGroupsContainingBundle(bundle: IBundle): Array<BundleGroup> {
return this.#graph.getBundleGroupsContainingBundle(
bundleToInternalBundle(bundle),
);
}
getParentBundlesOfBundleGroup(bundleGroup: BundleGroup): Array<IBundle> {
return this.#graph
.getParentBundlesOfBundleGroup(bundleGroup)
.map(bundle => Bundle.get(bundle, this.#graph, this.#options));
}
getTotalSize(asset: IAsset): number {
return this.#graph.getTotalSize(assetToAssetValue(asset));
}
isAssetReachableFromBundle(asset: IAsset, bundle: IBundle): boolean {
return this.#graph.isAssetReachableFromBundle(
assetToAssetValue(asset),
bundleToInternalBundle(bundle),
);
}
removeAssetGraphFromBundle(asset: IAsset, bundle: IBundle) {
this.#graph.removeAssetGraphFromBundle(
assetToAssetValue(asset),
bundleToInternalBundle(bundle),
);
}
traverseContents<TContext>(
visit: GraphVisitor<BundlerBundleGraphTraversable, TContext>,
): ?TContext {
return this.#graph.traverseContents(
mapVisitor(
node =>
node.type === 'asset'
? {type: 'asset', value: assetFromValue(node.value, this.#options)}
: {
type: 'dependency',
value: new Dependency(node.value),
},
visit,
),
);
}
}
|
var app = getApp();
var pageData = {
data: {"title_ele1":{"type":"title-ele","style":"opacity:1;line-height:58.59375rpx;background-color:#f53530;border-color:rgb(34, 34, 34);border-radius:0rpx;border-style:none;border-width:0rpx;color:#ffffff;font-size:39.84375rpx;font-weight:bold;margin-left:auto;margin-right:auto;margin-top:0rpx;","content":"\u5cb3\u9633\u9ea6\u4e0a\u82b1\u5f00\u86cb\u7cd5\u5546\u57ce","customFeature":{"mode":0,"markColor":"rgb(243, 243, 243)","boxColor":"#000","boxR":"5px","boxStyle":false,"boxX":"0","boxY":"0","action":"inner-link","inner-page-link":"page10000"},"animations":[],"page_form":"","compId":"title_ele1","markColor":"rgb(243, 243, 243)","mode":0,"itemType":"title-ele","itemParentType":null,"itemIndex":"title_ele1","eventParams":"{\"inner_page_link\":\"page10000\",\"is_redirect\":0}","eventHandler":"tapInnerLinkHandler"},"carousel2":{"type":"carousel","style":"height:351.5625rpx;margin-left:0;margin-right:auto;margin-top:0;opacity:1;","content":[{"customFeature":[],"pic":"http:\/\/cdn.jisuapp.cn\/zhichi_frontend\/static\/webapp\/images\/default.png","parentCompid":"carousel2","style":"","content":""},{"customFeature":[],"pic":"http:\/\/cdn.jisuapp.cn\/zhichi_frontend\/static\/webapp\/images\/default.png","parentCompid":"carousel2","style":"","content":""}],"customFeature":{"autoplay":true,"interval":2,"carouselgroupId":"1793750"},"animations":[],"page_form":"","compId":"carousel2"},"classify3":{"type":"classify","style":"font-size:30.46875rpx;height:82.03125rpx;line-height:82.03125rpx;opacity:1;background-color:#ddd;color:rgb(136, 136, 136);;margin-top:0;margin-left:auto;","content":[{"customFeature":{"index_value":"","action":"inner-link","page-link":"prePage"},"text":"\u9c9c\u679c\u7cfb\u5217","parentCompid":"classify3","style":"","itemType":null,"itemParentType":"classify","itemIndex":0,"eventParams":"{\"inner_page_link\":\"prePage\",\"is_redirect\":1}","eventHandler":"tapInnerLinkHandler","content":""},{"customFeature":{"index_value":""},"text":"\u8d3a\u5bff\u7cfb\u5217","parentCompid":"classify3","style":"","content":""},{"customFeature":{"index_value":""},"text":"\u513f\u7ae5\u7cfb\u5217","parentCompid":"classify3","style":"","content":""},{"customFeature":{"index_value":""},"text":"\u5176\u4ed6\u7cfb\u5217","parentCompid":"classify3","style":"","content":""}],"customFeature":{"mode":"0","selected":"0","selectedColor":"#34b6fd"},"animations":[],"page_form":"","compId":"classify3"},"text4":{"type":"text","style":"background-color:rgba(0, 0, 0, 0);border-color:rgb(34, 34, 34);border-style:none;border-width:4.6875rpx;color:#e69138;font-size:39.84375rpx;font-weight:bold;height:44.53125rpx;line-height:44.53125rpx;margin-left:0;margin-top:0;opacity:1;text-align:center;","content":"- -\u7cbe\u54c1\u63a8\u8350- -","customFeature":{"boxColor":"rgb(0, 0, 0)","boxR":"5","boxStyle":false,"boxX":"0","boxY":"0","action":"none","inner-page-link":"prePage"},"animations":[],"page_form":"","compId":"text4","markColor":"","mode":0},"album5":{"type":"album","style":"background-color:rgba(0, 0, 0, 0);font-size:28.125rpx;margin-top:0rpx;opacity:1;text-align:center;margin-left:auto;","ul_style":"padding-left:7.03125rpx;padding-top:7.03125rpx;margin-left:auto;","html_mode":"","li":[{"customFeature":{"action":"custom-link","page-link":""},"action":"custom-link","li_class":"album-pic","pic":"http:\/\/img.zhichiwangluo.com\/zcimgdir\/thumb\/t_15294811595b2a07c753c67.jpg","title":"\u53d8\u5f62\u91d1\u521a","li_style":"width:364.453125rpx;margin-right:7.03125rpx;margin-bottom:7.03125rpx;margin-left:auto;","img_style":"height:234.375rpx;border-radius:0rpx;margin-left:auto;"},{"customFeature":{"action":"inner-link","page-link":"prePage"},"li_class":"album-pic router","action":"inner-link","pic":"http:\/\/img.zhichiwangluo.com\/zcimgdir\/thumb\/t_15294812225b2a0806951f8.jpg","title":"\u51b0\u96ea\u5947\u7f18","li_style":"width:364.453125rpx;margin-right:7.03125rpx;margin-bottom:7.03125rpx;margin-left:auto;","img_style":"height:234.375rpx;border-radius:0rpx;margin-left:auto;","eventParams":"{\"inner_page_link\":\"prePage\",\"is_redirect\":0}","eventHandler":"tapInnerLinkHandler"},{"customFeature":{"action":""},"action":"","li_class":"album-pic","pic":"http:\/\/img.zhichiwangluo.com\/zcimgdir\/thumb\/t_15294812595b2a082b02821.jpg","title":"\u54c6\u5566A\u68a6","li_style":"width:364.453125rpx;margin-right:7.03125rpx;margin-bottom:7.03125rpx;margin-left:auto;","img_style":"height:234.375rpx;border-radius:0rpx;margin-left:auto;"},{"customFeature":{"action":""},"action":"","li_class":"album-pic","pic":"http:\/\/img.zhichiwangluo.com\/zcimgdir\/thumb\/t_15294812715b2a0837b295a.jpg","title":"\u73ab\u7470\u5c0f\u9547","li_style":"width:364.453125rpx;margin-right:7.03125rpx;margin-bottom:7.03125rpx;margin-left:auto;","img_style":"height:234.375rpx;border-radius:0rpx;margin-left:auto;"}],"customFeature":{"col":2,"imgHeight":"100px","mode":0,"padding-left":3,"padding-top":3,"picBorderRadius":"0px","row":2,"action":"","imgWidth":155.5},"itemType":"album","itemParentType":null,"itemIndex":"album5","content":""},"text6":{"type":"text","style":"background-color:rgba(0, 0, 0, 0);border-color:rgb(34, 34, 34);border-style:none;border-width:4.6875rpx;color:#e69138;font-size:39.84375rpx;font-weight:bold;height:44.53125rpx;line-height:44.53125rpx;margin-left:0;margin-top:0;opacity:1;text-align:center;","content":"- -\u9650\u65f6\u62a2\u8d2d- -","customFeature":{"boxColor":"rgb(0, 0, 0)","boxR":"5","boxStyle":false,"boxX":"0","boxY":"0"},"animations":[],"page_form":"","compId":"text6","markColor":"","mode":0},"album7":{"type":"album","style":"background-color:rgba(0, 0, 0, 0);font-size:28.125rpx;margin-top:0rpx;opacity:1;text-align:center;margin-left:auto;","ul_style":"padding-left:7.03125rpx;padding-top:7.03125rpx;margin-left:auto;","html_mode":"","li":[{"customFeature":{"action":"custom-link","page-link":""},"action":"custom-link","li_class":"album-pic","pic":"http:\/\/img.zhichiwangluo.com\/zcimgdir\/thumb\/t_15294811595b2a07c753c67.jpg","title":"\u53d8\u5f62\u91d1\u521a","li_style":"width:364.453125rpx;margin-right:7.03125rpx;margin-bottom:7.03125rpx;margin-left:auto;","img_style":"height:234.375rpx;border-radius:0rpx;margin-left:auto;"},{"customFeature":{"action":"inner-link","page-link":"prePage"},"li_class":"album-pic router","action":"inner-link","pic":"http:\/\/img.zhichiwangluo.com\/zcimgdir\/thumb\/t_15294812225b2a0806951f8.jpg","title":"\u51b0\u96ea\u5947\u7f18","li_style":"width:364.453125rpx;margin-right:7.03125rpx;margin-bottom:7.03125rpx;margin-left:auto;","img_style":"height:234.375rpx;border-radius:0rpx;margin-left:auto;","eventParams":"{\"inner_page_link\":\"prePage\",\"is_redirect\":0}","eventHandler":"tapInnerLinkHandler"},{"customFeature":{"action":""},"action":"","li_class":"album-pic","pic":"http:\/\/img.zhichiwangluo.com\/zcimgdir\/thumb\/t_15294812595b2a082b02821.jpg","title":"\u54c6\u5566A\u68a6","li_style":"width:364.453125rpx;margin-right:7.03125rpx;margin-bottom:7.03125rpx;margin-left:auto;","img_style":"height:234.375rpx;border-radius:0rpx;margin-left:auto;"},{"customFeature":{"action":""},"action":"","li_class":"album-pic","pic":"http:\/\/img.zhichiwangluo.com\/zcimgdir\/thumb\/t_15294812715b2a0837b295a.jpg","title":"\u73ab\u7470\u5c0f\u9547","li_style":"width:364.453125rpx;margin-right:7.03125rpx;margin-bottom:7.03125rpx;margin-left:auto;","img_style":"height:234.375rpx;border-radius:0rpx;margin-left:auto;"}],"customFeature":{"col":2,"imgHeight":"100px","mode":0,"padding-left":3,"padding-top":3,"picBorderRadius":"0px","row":2,"action":"","imgWidth":155.5},"itemType":"album","itemParentType":null,"itemIndex":"album7","content":""},"has_tabbar":1,"page_hidden":true,"page_form":"","top_nav":{"navigationBarTitleText":"\u9996\u9875"},"dataId":""},
need_login: false,
page_router: 'page10000',
page_form: 'none',
dataId: '',
list_compids_params: [],
user_center_compids_params: [],
goods_compids_params: [],
prevPage:0,
tostoreComps: [],
carouselGroupidsParams: [{"compid":"carousel2","carouselgroupId":"1793750"}],
relobj_auto: [],
bbsCompIds: [],
dynamicVesselComps: [],
communityComps: [],
franchiseeComps: [],
cityLocationComps: [],
seckillOnLoadCompidParam: [],
dynamicClassifyGroupidsParams: [],
newClassifyGroupidsParams: [],
videoListComps: [],
videoProjectComps: [],
newsComps: [],
popupWindowComps: [],
formVesselComps: [],
searchComponentParam: [],
topicComps: [],
topicClassifyComps: [],
topicSortComps: [],
returnToVersionFlag: true,
requesting: false,
requestNum: 1,
modelChoose: [],
modelChooseId: '',
modelChooseName: [],
onLoad: function (e) {
if (e.statisticsType == 11) {
delete e.statisticsType
delete e.needStatistics
}
app.onPageLoad(e);
app.isNeedRewardModal();
app.checkCanUse('navigator.target', 'canIUseNavigatorTarget', ['button', 'picture', 'text', 'layout-vessel', 'static-vessel', 'free-vessel', 'title-ele', 'album', 'carousel', 'suspension', 'list', 'announce']);
},
dataInitial: function () {
app.pageDataInitial();
},
onPageScroll: function(e) {
app.onPageScroll(e);
},
onShareAppMessage: function (e) {
if (e.from == 'button') {
if (e.target.dataset.from == 'topicButton') {
return app.shareAppMessage({
path: '/informationManagement/pages/communityDetail/communityDetail?detail=' + e.target.dataset.id,
desc: e.target.dataset.desc,
success: function(addTime) {
app.getIntegralLog(addTime);
app.CountSpreadCount(e.target.dataset.id);
}
});
}
};
return app.onPageShareAppMessage(e, app.getIntegralLog);
},
onShow: function () {
app.onPageShow();
},
reachBottomFuc: [],
onReachBottom: function () {
app.onPageReachBottom( this.reachBottomFuc );
},
onUnload: function () {
app.onPageUnload();
},
changeDropDown:function(e){
app.changeDropDown(e);
},
connectWifiHandler:function(e){
app.connectWifiHandler(e)
},
tapPrevewPictureHandler: function (e) {
app.tapPrevewPictureHandler(e);
},
suspensionBottom: function () {
app.suspensionBottom();
},
pageScrollFunc: function (e) {
app.pageScrollFunc(e);
},
dynamicVesselScrollFunc: function (e) {
app.dynamicVesselScrollFunc(e);
},
goodsScrollFunc: function (e) {
app.goodsScrollFunc(e);
},
takeoutStyleScrollFunc: function(e){
app.takeoutStyleScrollFunc(e);
},
franchiseeScrollFunc: function (e) {
app.franchiseeScrollFunc(e);
},
seckillScrollFunc: function (e) {
app.seckillScrollFunc(e);
},
videoScrollFunc: function (e) {
app.videoScrollFunc(e);
},
carouselVideoClose: function(e) {
app.carouselVideoClose(e);
},
changeCount: function (e) {
app.changeCount(e);
},
inputChange: function (e) {
app.inputChange(e);
},
bindDateChange: function (e) {
app.bindDateChange(e);
},
bindTimeChange: function (e) {
app.bindTimeChange(e);
},
bindSelectChange: function (e) {
app.bindSelectChange(e);
},
bindScoreChange: function (e) {
app.bindScoreChange(e);
},
selectPicOption:function(e){
app.selectPicOption(e);
},
submitForm: function (e) {
app.submitForm(e);
},
udpateVideoSrc: function (e) {
app.udpateVideoSrc(e);
},
tapMapDetail: function (e) {
app.tapMapDetail(e);
},
uploadFormImg: function (e) {
app.uploadFormImg(e);
},
deleteUploadImg: function (e) {
app.deleteUploadImg(e);
},
listVesselTurnToPage: function (e) {
app.listVesselTurnToPage(e);
},
dynamicVesselTurnToPage: function (e) {
app.dynamicVesselTurnToPage(e);
},
userCenterTurnToPage: function (e) {
app.userCenterTurnToPage(e);
},
turnToGoodsDetail: function (e) {
app.turnToGoodsDetail(e);
},
turnToFranchiseeDetail: function (e) {
app.turnToFranchiseeDetail(e);
},
turnToSeckillDetail: function (e) {
app.turnToSeckillDetail(e);
},
sortListFunc: function (e) {
app.sortListFunc(e);
},
bbsInputComment: function (e) {
app.bbsInputComment(e);
},
bbsInputReply: function (e) {
app.bbsInputReply(e);
},
uploadBbsCommentImage: function (e) {
app.uploadBbsCommentImage(e);
},
uploadBbsReplyImage: function (e) {
app.uploadBbsReplyImage(e);
},
deleteCommentImage: function (e) {
app.deleteCommentImage(e);
},
deleteReplyImage: function (e) {
app.deleteReplyImage(e);
},
bbsPublishComment: function (e) {
app.bbsPublishComment(e);
},
clickBbsReplyBtn: function (e) {
app.clickBbsReplyBtn(e);
},
bbsPublishReply: function (e) {
app.bbsPublishReply(e);
},
searchList: function (e) {
app.searchList(e);
},
selectLocal: function (e) {
app.selectLocal(e);
},
cancelCity: function (e) {
app.cancelCity(e);
},
bindCityChange: function (e) {
app.bindCityChange(e);
},
submitCity: function (e) {
app.submitCity(e);
},
openTakeoutLocation: function (e) {
app.openTakeoutLocation(e);
},
callTakeout: function (e) {
app.callTakeout(e);
},
getMoreAssess: function (e) {
app.getMoreAssess(e);
},
changeEvaluate: function (e) {
app.changeEvaluate(e)
},
deleteAllCarts: function (e) {
app.deleteAllCarts(e);
},
deleteSingleCarts:function (e) {
app.deleteSingleCarts(e);
},
clickCategory: function (e) {
app.clickCategory(e);
},
goodsListMinus: function (e) {
app.goodsListMinus(e);
},
goodsListPlus: function (e) {
app.goodsListPlus(e);
},
cartListMinus: function (e) {
app.cartListMinus(e);
},
cartListPlus: function (e) {
app.cartListPlus(e);
},
changeAssessType: function (e) {
app.changeAssessType(e);
},
showShoppingCartPop: function (e) {
app.showShoppingCartPop(e);
},
hideShoppingCart: function (e) {
app.hideShoppingCart(e);
},
showGoodsDetail: function (e) {
app.showGoodsDetail(e);
},
hideDetailPop: function (e) {
app.hideDetailPop(e);
},
hideModelPop: function (e) {
app.hideModelPop(e);
},
chooseModel: function (e) {
app.chooseModel(e);
},
sureChooseModel: function (e) {
app.sureChooseModel(e);
},
clickChooseComplete: function (e) {
app.clickChooseComplete(e);
},
reLocalAddress: function(e){
app.reLocalAddress(e);
},
tapGoodsTradeHandler: function (e) {
app.tapGoodsTradeHandler(e);
},
tapVideoHandler: function(e){
app.tapVideoHandler(e);
},
tapVideoPlayHandler: function(e){
app.tapVideoPlayHandler(e);
},
tapInnerLinkHandler: function (e) {
app.tapInnerLinkHandler(e);
},
tapToPluginHandler: function (e) {
app.tapToPluginHandler(e);
},
tapPhoneCallHandler: function (e) {
app.tapPhoneCallHandler(e);
},
tapNewClassifyShowSubClassify: function(e){
app.tapNewClassifyShowSubClassify(e);
},
tapNewClassifyRefreshHandler: function(e){
app.tapNewClassifyRefreshHandler(e);
},
tapRefreshListHandler: function (e) {
app.tapRefreshListHandler(e);
},
tapGetCouponHandler: function (e) {
app.tapGetCouponHandler(e);
},
tapCommunityHandler: function (e) {
app.tapCommunityHandler(e);
},
tapPageShareHandler:function(e) {
app.tapPageShareHandler(e);
},
turnToCommunityPage: function (e) {
app.turnToCommunityPage(e);
},
tapToFranchiseeHandler: function (e) {
app.tapToFranchiseeHandler(e);
},
tapToTransferPageHandler: function () {
app.tapToTransferPageHandler();
},
tapToSeckillHandler: function (e) {
app.tapToSeckillHandler(e);
},
tapToPromotionHandler: function () {
app.tapToPromotionHandler();
},
tapToCouponReceiveListHandler: function () {
app.tapToCouponReceiveListHandler();
},
tapToRechargeHandler: function () {
app.tapToRechargeHandler();
},
tapToXcx: function (e) {
app.tapToXcx(e);
},
tapFranchiseeLocation: function (e) {
app.tapFranchiseeLocation(e);
},
showAddShoppingcart: function (e) {
app.showAddShoppingcart(e);
},
hideAddShoppingcart: function () {
app.hideAddShoppingcart();
},
selectGoodsSubModel: function (e) {
app.selectGoodsSubModel(e);
},
resetSelectCountPrice: function () {
app.resetSelectCountPrice();
},
inputBuyCount: function(e){
app.inputBuyCount(e)
},
clickGoodsMinusButton: function (e) {
app.clickGoodsMinusButton();
},
clickGoodsPlusButton: function (e) {
app.clickGoodsPlusButton();
},
sureAddToShoppingCart: function () {
app.sureAddToShoppingCart();
},
sureAddToBuyNow: function () {
app.sureAddToBuyNow();
},
clickTostoreMinusButton: function (e) {
app.clickTostoreMinusButton(e);
},
clickTostorePlusButton: function (e) {
app.clickTostorePlusButton(e);
},
readyToPay: function () {
app.readyToTostorePay();
},
getValidateTostore: function () {
app.getValidateTostore();
},
goToShoppingCart: function () {
app.goToShoppingCart();
},
getCartList: function () {
app.getTostoreCartList();
},
stopPropagation: function () {
},
turnToSearchPage:function (e) {
app.turnToSearchPage(e);
},
previewImage: function (e) {
var dataset = e.currentTarget.dataset;
app.previewImage({
current : dataset.src,
urls: dataset.previewImgarr,
});
},
scrollPageTop: function () {
app.pageScrollTo(0);
},
suspensionTurnToPage: function (e) {
app.suspensionTurnToPage(e);
},
tapToLuckyWheel: function (e) {
app.tapToLuckyWheel(e);
},
tapToGoldenEggs: function (e) {
app.tapToGoldenEggs(e);
},
tapToScratchCard: function (e) {
app.tapToScratchCard(e);
},
keywordList:{},
bindSearchTextChange: function (e) {
this.keywordList[e.currentTarget.dataset.compid] = e.detail.value;
},
// 文字组件跳到地图
textToMap: function(e) {
app.textToMap(e);
},
tapDynamicClassifyFunc: function(e){
app.tapDynamicClassifyFunc(e);
},
// 跳转到视频详情
turnToVideoDetail : function(e) {
app.turnToVideoDetail(e);
},
// 单个视频组件播放视频
startPlayVideo : function(e) {
app.startPlayVideo(e);
},
// 视频播放报错
videoError: function(e) {
app.showModal({
content: e.detail.errMsg
});
},
// 视频项目播放事件
videoProjectPlay: function(e){
app.videoProjectPlay(e);
},
// 视频项目暂停事件
videoProjectPause: function(e) {
app.videoProjectPause(e);
},
// 跳转到资讯详情
turnToNewsDetail: function (e) {
app.turnToNewsDetail(e)
},
//切换资讯分类
getNewsCateList: function (e) {
app.getNewsCateList(e);
},
// 跳转多商家入驻
franchiseeEnterHandler: function () {
app.franchiseeEnterHandler();
},
// 跳转多商家代理推广合作联系
franchiseeCooperationHandler: function () {
app.franchiseeCooperationHandler();
},
//bbs评论
showBbsReplyDialog: function(e){
app.showBbsReplyDialog(e);
},
hideBbsReplyDialog: function(e){
app.hideBbsReplyDialog(e);
},
popupWindowControlHandler: function(e){
app.popupWindowControlHandler(e);
},
tapMaskClosePopupWindow: function(e){
app.tapMaskClosePopupWindow(e);
},
//话题组件
topicEleScrollFunc: function (e) {
app.topicEleScrollFunc(e);
},
switchTopiclistOrderBy: function (e) {
app.switchTopiclistOrderBy(e);
},
switchTopicCategory: function (e) {
app.switchTopicCategory(e);
},
topicSearchInputAct: function (e) {
app.topicSearchInputAct(e);
},
searchForTopicAct: function (e) {
app.searchForTopicAct(e);
},
turnToTopicUserCenter: function (e) {
app.turnToTopicUserCenter(e);
},
turnToTopicNotify: function (e) {
app.turnToTopicNotify(e);
},
turnToTopicDetail: function (e) {
app.turnToTopicDetail(e);
},
pageBackTopAct: function (e) {
app.pageBackTopAct(e);
},
turnToTopicPublish: function (e) {
app.turnToTopicPublish(e);
},
showTopicCommentBox: function (e) {
app.showTopicCommentBox(e);
},
showTopicPhoneModal: function (e) {
app.showTopicPhoneModal(e);
},
topicMakePhoneCall: function (e) {
app.topicMakePhoneCall(e);
},
showTopicReplyComment: function (e) {
app.showTopicReplyComment(e);
},
topicCommentReplyInput: function (e) {
app.topicCommentReplyInput(e);
},
topicReplycommentSubmit: function (e) {
app.topicReplycommentSubmit(e);
},
topicPerformLikeAct: function (e) {
app.topicPerformLikeAct(e);
},
topicImgLoad: function (e) {
app.topicImgLoad(e);
},
topicCommentReplyfocus:function (e) {
app.topicCommentReplyfocus(e);
},
topicCommentReplyblur:function (e) {
app.topicCommentReplyblur(e);
},
// 筛选组件 综合排序tab = 0
sortByDefault: function (e) {
app.sortByDefault(e);
},
// 筛选组件 按销量排序 tab = 1
sortBySales: function (e) {
app.sortBySales(e);
},
// 筛选组件 按价格排序 tab = 2
sortByPrice: function (e) {
app.sortByPrice(e);
},
// 筛选组件 展示侧边筛选
filterList: function(e){
app.filterList(e);
},
// 筛选侧栏确定
filterConfirm: function(e){
app.filterConfirm(e);
},
// 动画结束回调函数
animationEnd: function(e){
app.animationEnd(e);
}
};
Page(pageData);
|
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import { A as arr } from '@ember/array';
module('Unit | Validator | request-filters', function(hooks) {
setupTest(hooks);
test('validate request-filters', function(assert) {
assert.expect(2);
let Validator = this.owner.lookup('validator:request-filters'),
request = {
filters: arr([
{ dimension: { id: 'dim1' }, rawValues: ['d1'] },
{ dimension: { id: 'dim2' }, rawValues: ['d2'] }
])
};
let series = arr([
{
values: { dim1: 'd1' }
},
{
values: { dim2: 'd2' }
}
]);
assert.equal(
Validator.validate(series, { request }),
true,
'request-filters returns `true` when dimensions in series match filters in request'
);
series = arr([
{
values: { dim1: 'd1' }
},
{
values: { dim1: 'd' }
},
{
values: { dim2: 'd2' }
}
]);
assert.equal(
Validator.validate(series, { request }),
false,
'request-filters returns `false` when dimensions in series are not in request filters'
);
});
});
|
const assert = require('assert');
const async = require('async');
const { parseString } = require('xml2js');
const AWS = require('aws-sdk');
const { cleanup, DummyRequestLogger, makeAuthInfo }
= require('../unit/helpers');
const { ds } = require('../../lib/data/in_memory/backend');
const { bucketPut } = require('../../lib/api/bucketPut');
const initiateMultipartUpload
= require('../../lib/api/initiateMultipartUpload');
const objectPut = require('../../lib/api/objectPut');
const objectPutCopyPart = require('../../lib/api/objectPutCopyPart');
const DummyRequest = require('../unit/DummyRequest');
const { metadata } = require('../../lib/metadata/in_memory/metadata');
const constants = require('../../constants');
const s3 = new AWS.S3();
const splitter = constants.splitter;
const log = new DummyRequestLogger();
const canonicalID = 'accessKey1';
const authInfo = makeAuthInfo(canonicalID);
const namespace = 'default';
const bucketName = 'superbucket9999999';
const mpuBucket = `${constants.mpuBucketPrefix}${bucketName}`;
const body = Buffer.from('I am a body', 'utf8');
const memLocation = 'mem-test';
const fileLocation = 'file-test';
const awsBucket = 'multitester555';
const awsLocation = 'aws-test';
const awsLocation2 = 'aws-test-2';
const awsLocationMismatch = 'aws-test-mismatch';
const partETag = 'be747eb4b75517bf6b3cf7c5fbb62f3a';
const describeSkipIfE2E = process.env.S3_END_TO_END ? describe.skip : describe;
function getSourceAndDestKeys() {
const timestamp = Date.now();
return {
sourceObjName: `supersourceobject-${timestamp}`,
destObjName: `copycatobject-${timestamp}`,
};
}
function getAwsParams(destObjName, uploadId) {
return { Bucket: awsBucket, Key: destObjName, UploadId: uploadId };
}
function getAwsParamsBucketMismatch(destObjName, uploadId) {
const params = getAwsParams(destObjName, uploadId);
params.Key = `${bucketName}/${destObjName}`;
return params;
}
function copyPutPart(bucketLoc, mpuLoc, srcObjLoc, requestHost, cb,
errorPutCopyPart) {
const keys = getSourceAndDestKeys();
const { sourceObjName, destObjName } = keys;
const post = bucketLoc ? '<?xml version="1.0" encoding="UTF-8"?>' +
'<CreateBucketConfiguration ' +
'xmlns="http://s3.amazonaws.com/doc/2006-03-01/">' +
`<LocationConstraint>${bucketLoc}</LocationConstraint>` +
'</CreateBucketConfiguration>' : '';
const bucketPutReq = new DummyRequest({
bucketName,
namespace,
headers: { host: `${bucketName}.s3.amazonaws.com` },
url: '/',
post,
});
if (requestHost) {
bucketPutReq.parsedHost = requestHost;
}
const initiateReq = {
bucketName,
namespace,
objectKey: destObjName,
headers: { host: `${bucketName}.s3.amazonaws.com` },
url: `/${destObjName}?uploads`,
};
if (mpuLoc) {
initiateReq.headers = { 'host': `${bucketName}.s3.amazonaws.com`,
'x-amz-meta-scal-location-constraint': `${mpuLoc}` };
}
if (requestHost) {
initiateReq.parsedHost = requestHost;
}
const sourceObjPutParams = {
bucketName,
namespace,
objectKey: sourceObjName,
headers: { host: `${bucketName}.s3.amazonaws.com` },
url: '/',
};
if (srcObjLoc) {
sourceObjPutParams.headers = { 'host': `${bucketName}.s3.amazonaws.com`,
'x-amz-meta-scal-location-constraint': `${srcObjLoc}` };
}
const sourceObjPutReq = new DummyRequest(sourceObjPutParams, body);
if (requestHost) {
sourceObjPutReq.parsedHost = requestHost;
}
async.waterfall([
next => {
bucketPut(authInfo, bucketPutReq, log, err => {
assert.ifError(err, 'Error putting bucket');
next(err);
});
},
next => {
objectPut(authInfo, sourceObjPutReq, undefined, log, err =>
next(err));
},
next => {
initiateMultipartUpload(authInfo, initiateReq, log, next);
},
(result, corsHeaders, next) => {
const mpuKeys = metadata.keyMaps.get(mpuBucket);
assert.strictEqual(mpuKeys.size, 1);
assert(mpuKeys.keys().next().value
.startsWith(`overview${splitter}${destObjName}`));
parseString(result, next);
},
],
(err, json) => {
// Need to build request in here since do not have
// uploadId until here
assert.ifError(err, 'Error putting source object or initiate MPU');
const testUploadId = json.InitiateMultipartUploadResult.
UploadId[0];
const copyPartParams = {
bucketName,
namespace,
objectKey: destObjName,
headers: { host: `${bucketName}.s3.amazonaws.com` },
url: `/${destObjName}?partNumber=1&uploadId=${testUploadId}`,
query: {
partNumber: '1',
uploadId: testUploadId,
},
};
const copyPartReq = new DummyRequest(copyPartParams);
return objectPutCopyPart(authInfo, copyPartReq,
bucketName, sourceObjName, undefined, log, (err, copyResult) => {
if (errorPutCopyPart) {
assert.strictEqual(err.code, errorPutCopyPart.statusCode);
assert(err[errorPutCopyPart.code]);
return cb();
}
assert.strictEqual(err, null);
return parseString(copyResult, (err, json) => {
assert.equal(err, null, `Error parsing copy result ${err}`);
assert.strictEqual(json.CopyPartResult.ETag[0],
`"${partETag}"`);
assert(json.CopyPartResult.LastModified);
return cb(keys, testUploadId);
});
});
});
}
function assertPartList(partList, uploadId) {
assert.strictEqual(partList.UploadId, uploadId);
assert.strictEqual(partList.Parts.length, 1);
assert.strictEqual(partList.Parts[0].ETag, `"${partETag}"`);
assert.strictEqual(partList.Parts[0].PartNumber, 1);
assert.strictEqual(partList.Parts[0].Size, 11);
}
describeSkipIfE2E('ObjectCopyPutPart API with multiple backends',
function testSuite() {
this.timeout(60000);
beforeEach(() => {
cleanup();
});
it('should copy part to mem based on mpu location', done => {
copyPutPart(fileLocation, memLocation, null, 'localhost', () => {
// object info is stored in ds beginning at index one,
// so an array length of two means only one object
// was stored in mem
assert.strictEqual(ds.length, 2);
assert.deepStrictEqual(ds[1].value, body);
done();
});
});
it('should copy part to file based on mpu location', done => {
copyPutPart(memLocation, fileLocation, null, 'localhost', () => {
assert.strictEqual(ds.length, 2);
done();
});
});
it('should copy part to AWS based on mpu location', done => {
copyPutPart(memLocation, awsLocation, null, 'localhost',
(keys, uploadId) => {
assert.strictEqual(ds.length, 2);
const awsReq = getAwsParams(keys.destObjName, uploadId);
s3.listParts(awsReq, (err, partList) => {
assertPartList(partList, uploadId);
s3.abortMultipartUpload(awsReq, err => {
assert.equal(err, null, `Error aborting MPU: ${err}. ` +
`You must abort MPU with upload ID ${uploadId} manually.`);
done();
});
});
});
});
it('should copy part to mem from AWS based on mpu location', done => {
copyPutPart(awsLocation, memLocation, null, 'localhost', () => {
assert.strictEqual(ds.length, 2);
assert.deepStrictEqual(ds[1].value, body);
done();
});
});
it('should copy part to mem based on bucket location', done => {
copyPutPart(memLocation, null, null, 'localhost', () => {
// ds length should be three because both source
// and copied objects should be in mem
assert.strictEqual(ds.length, 3);
assert.deepStrictEqual(ds[2].value, body);
done();
});
});
it('should copy part to file based on bucket location', done => {
copyPutPart(fileLocation, null, null, 'localhost', () => {
// ds should be empty because both source and
// coped objects should be in file
assert.deepStrictEqual(ds, []);
done();
});
});
it('should copy part to AWS based on bucket location', done => {
copyPutPart(awsLocation, null, null, 'localhost', (keys, uploadId) => {
assert.deepStrictEqual(ds, []);
const awsReq = getAwsParams(keys.destObjName, uploadId);
s3.listParts(awsReq, (err, partList) => {
assertPartList(partList, uploadId);
s3.abortMultipartUpload(awsReq, err => {
assert.equal(err, null, `Error aborting MPU: ${err}. ` +
`You must abort MPU with upload ID ${uploadId} manually.`);
done();
});
});
});
});
it('should copy part an object on AWS location that has bucketMatch ' +
'equals false to a mpu with a different AWS location', done => {
copyPutPart(null, awsLocation, awsLocationMismatch, 'localhost',
(keys, uploadId) => {
assert.deepStrictEqual(ds, []);
const awsReq = getAwsParams(keys.destObjName, uploadId);
s3.listParts(awsReq, (err, partList) => {
assertPartList(partList, uploadId);
s3.abortMultipartUpload(awsReq, err => {
assert.equal(err, null, `Error aborting MPU: ${err}. ` +
`You must abort MPU with upload ID ${uploadId} manually.`);
done();
});
});
});
});
it('should copy part an object on AWS to a mpu with a different ' +
'AWS location that has bucketMatch equals false', done => {
copyPutPart(null, awsLocationMismatch, awsLocation, 'localhost',
(keys, uploadId) => {
assert.deepStrictEqual(ds, []);
const awsReq = getAwsParamsBucketMismatch(keys.destObjName,
uploadId);
s3.listParts(awsReq, (err, partList) => {
assertPartList(partList, uploadId);
s3.abortMultipartUpload(awsReq, err => {
assert.equal(err, null, `Error aborting MPU: ${err}. ` +
`You must abort MPU with upload ID ${uploadId} manually.`);
done();
});
});
});
});
it('should return error 403 AccessDenied copying part to a ' +
'different AWS location without object READ access',
done => {
const errorPutCopyPart = { code: 'AccessDenied', statusCode: 403 };
copyPutPart(null, awsLocation, awsLocation2, 'localhost', done,
errorPutCopyPart);
});
it('should copy part to file based on request endpoint', done => {
copyPutPart(null, null, memLocation, 'localhost', () => {
assert.strictEqual(ds.length, 2);
done();
});
});
});
|
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React from 'react'
import Layout from '../../components/Layout'
import ErrorPage from './ErrorPage'
const path = '/error/'
function action() {
return {
title: 'Demo Error',
path,
component: (
<Layout path={path}>
<ErrorPage />
</Layout>
),
}
}
export default action
|
module.exports =
/******/ (function(modules, runtime) { // webpackBootstrap
/******/ "use strict";
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ __webpack_require__.ab = __dirname + "/";
/******/
/******/ // the startup function
/******/ function startup() {
/******/ // Load entry module and return exports
/******/ return __webpack_require__(996);
/******/ };
/******/
/******/ // run startup
/******/ return startup();
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, __unusedexports, __webpack_require__) {
const { requestLog } = __webpack_require__(916);
const {
restEndpointMethods
} = __webpack_require__(842);
const Core = __webpack_require__(529);
const CORE_PLUGINS = [
__webpack_require__(190),
__webpack_require__(19), // deprecated: remove in v17
requestLog,
__webpack_require__(148),
restEndpointMethods,
__webpack_require__(430),
__webpack_require__(850) // deprecated: remove in v17
];
const OctokitRest = Core.plugin(CORE_PLUGINS);
function DeprecatedOctokit(options) {
const warn =
options && options.log && options.log.warn
? options.log.warn
: console.warn;
warn(
'[@octokit/rest] `const Octokit = require("@octokit/rest")` is deprecated. Use `const { Octokit } = require("@octokit/rest")` instead'
);
return new OctokitRest(options);
}
const Octokit = Object.assign(DeprecatedOctokit, {
Octokit: OctokitRest
});
Object.keys(OctokitRest).forEach(key => {
/* istanbul ignore else */
if (OctokitRest.hasOwnProperty(key)) {
Octokit[key] = OctokitRest[key];
}
});
module.exports = Octokit;
/***/ }),
/***/ 1:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const childProcess = __webpack_require__(129);
const path = __webpack_require__(622);
const util_1 = __webpack_require__(669);
const ioUtil = __webpack_require__(672);
const exec = util_1.promisify(childProcess.exec);
/**
* Copies a file or folder.
* Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
*
* @param source source path
* @param dest destination path
* @param options optional. See CopyOptions.
*/
function cp(source, dest, options = {}) {
return __awaiter(this, void 0, void 0, function* () {
const { force, recursive } = readCopyOptions(options);
const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
// Dest is an existing file, but not forcing
if (destStat && destStat.isFile() && !force) {
return;
}
// If dest is an existing directory, should copy inside.
const newDest = destStat && destStat.isDirectory()
? path.join(dest, path.basename(source))
: dest;
if (!(yield ioUtil.exists(source))) {
throw new Error(`no such file or directory: ${source}`);
}
const sourceStat = yield ioUtil.stat(source);
if (sourceStat.isDirectory()) {
if (!recursive) {
throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
}
else {
yield cpDirRecursive(source, newDest, 0, force);
}
}
else {
if (path.relative(source, newDest) === '') {
// a file cannot be copied to itself
throw new Error(`'${newDest}' and '${source}' are the same file`);
}
yield copyFile(source, newDest, force);
}
});
}
exports.cp = cp;
/**
* Moves a path.
*
* @param source source path
* @param dest destination path
* @param options optional. See MoveOptions.
*/
function mv(source, dest, options = {}) {
return __awaiter(this, void 0, void 0, function* () {
if (yield ioUtil.exists(dest)) {
let destExists = true;
if (yield ioUtil.isDirectory(dest)) {
// If dest is directory copy src into dest
dest = path.join(dest, path.basename(source));
destExists = yield ioUtil.exists(dest);
}
if (destExists) {
if (options.force == null || options.force) {
yield rmRF(dest);
}
else {
throw new Error('Destination already exists');
}
}
}
yield mkdirP(path.dirname(dest));
yield ioUtil.rename(source, dest);
});
}
exports.mv = mv;
/**
* Remove a path recursively with force
*
* @param inputPath path to remove
*/
function rmRF(inputPath) {
return __awaiter(this, void 0, void 0, function* () {
if (ioUtil.IS_WINDOWS) {
// Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
// program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
try {
if (yield ioUtil.isDirectory(inputPath, true)) {
yield exec(`rd /s /q "${inputPath}"`);
}
else {
yield exec(`del /f /a "${inputPath}"`);
}
}
catch (err) {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid
if (err.code !== 'ENOENT')
throw err;
}
// Shelling out fails to remove a symlink folder with missing source, this unlink catches that
try {
yield ioUtil.unlink(inputPath);
}
catch (err) {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid
if (err.code !== 'ENOENT')
throw err;
}
}
else {
let isDir = false;
try {
isDir = yield ioUtil.isDirectory(inputPath);
}
catch (err) {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid
if (err.code !== 'ENOENT')
throw err;
return;
}
if (isDir) {
yield exec(`rm -rf "${inputPath}"`);
}
else {
yield ioUtil.unlink(inputPath);
}
}
});
}
exports.rmRF = rmRF;
/**
* Make a directory. Creates the full path with folders in between
* Will throw if it fails
*
* @param fsPath path to create
* @returns Promise<void>
*/
function mkdirP(fsPath) {
return __awaiter(this, void 0, void 0, function* () {
yield ioUtil.mkdirP(fsPath);
});
}
exports.mkdirP = mkdirP;
/**
* Returns path of a tool had the tool actually been invoked. Resolves via paths.
* If you check and the tool does not exist, it will throw.
*
* @param tool name of the tool
* @param check whether to check if tool exists
* @returns Promise<string> path to tool
*/
function which(tool, check) {
return __awaiter(this, void 0, void 0, function* () {
if (!tool) {
throw new Error("parameter 'tool' is required");
}
// recursive when check=true
if (check) {
const result = yield which(tool, false);
if (!result) {
if (ioUtil.IS_WINDOWS) {
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
}
else {
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
}
}
}
try {
// build the list of extensions to try
const extensions = [];
if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
for (const extension of process.env.PATHEXT.split(path.delimiter)) {
if (extension) {
extensions.push(extension);
}
}
}
// if it's rooted, return it if exists. otherwise return empty.
if (ioUtil.isRooted(tool)) {
const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
if (filePath) {
return filePath;
}
return '';
}
// if any path separators, return empty
if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
return '';
}
// build the list of directories
//
// Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
// it feels like we should not do this. Checking the current directory seems like more of a use
// case of a shell, and the which() function exposed by the toolkit should strive for consistency
// across platforms.
const directories = [];
if (process.env.PATH) {
for (const p of process.env.PATH.split(path.delimiter)) {
if (p) {
directories.push(p);
}
}
}
// return the first match
for (const directory of directories) {
const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
if (filePath) {
return filePath;
}
}
return '';
}
catch (err) {
throw new Error(`which failed with message ${err.message}`);
}
});
}
exports.which = which;
function readCopyOptions(options) {
const force = options.force == null ? true : options.force;
const recursive = Boolean(options.recursive);
return { force, recursive };
}
function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
return __awaiter(this, void 0, void 0, function* () {
// Ensure there is not a run away recursive copy
if (currentDepth >= 255)
return;
currentDepth++;
yield mkdirP(destDir);
const files = yield ioUtil.readdir(sourceDir);
for (const fileName of files) {
const srcFile = `${sourceDir}/${fileName}`;
const destFile = `${destDir}/${fileName}`;
const srcFileStat = yield ioUtil.lstat(srcFile);
if (srcFileStat.isDirectory()) {
// Recurse
yield cpDirRecursive(srcFile, destFile, currentDepth, force);
}
else {
yield copyFile(srcFile, destFile, force);
}
}
// Change the mode for the newly created directory
yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
});
}
// Buffered file copy
function copyFile(srcFile, destFile, force) {
return __awaiter(this, void 0, void 0, function* () {
if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
// unlink/re-link it
try {
yield ioUtil.lstat(destFile);
yield ioUtil.unlink(destFile);
}
catch (e) {
// Try to override file permission
if (e.code === 'EPERM') {
yield ioUtil.chmod(destFile, '0666');
yield ioUtil.unlink(destFile);
}
// other errors = it doesn't exist, no work to do
}
// Copy over symlink
const symlinkFull = yield ioUtil.readlink(srcFile);
yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
}
else if (!(yield ioUtil.exists(destFile)) || force) {
yield ioUtil.copyFile(srcFile, destFile);
}
});
}
//# sourceMappingURL=io.js.map
/***/ }),
/***/ 2:
/***/ (function(module, __unusedexports, __webpack_require__) {
"use strict";
const os = __webpack_require__(87);
const macosRelease = __webpack_require__(118);
const winRelease = __webpack_require__(49);
const osName = (platform, release) => {
if (!platform && release) {
throw new Error('You can\'t specify a `release` without specifying `platform`');
}
platform = platform || os.platform();
let id;
if (platform === 'darwin') {
if (!release && os.platform() === 'darwin') {
release = os.release();
}
const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
id = release ? macosRelease(release).name : '';
return prefix + (id ? ' ' + id : '');
}
if (platform === 'linux') {
if (!release && os.platform() === 'linux') {
release = os.release();
}
id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
return 'Linux' + (id ? ' ' + id : '');
}
if (platform === 'win32') {
if (!release && os.platform() === 'win32') {
release = os.release();
}
id = release ? winRelease(release) : '';
return 'Windows' + (id ? ' ' + id : '');
}
return platform;
};
module.exports = osName;
/***/ }),
/***/ 9:
/***/ (function(module, __unusedexports, __webpack_require__) {
var once = __webpack_require__(969);
var noop = function() {};
var isRequest = function(stream) {
return stream.setHeader && typeof stream.abort === 'function';
};
var isChildProcess = function(stream) {
return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
};
var eos = function(stream, opts, callback) {
if (typeof opts === 'function') return eos(stream, null, opts);
if (!opts) opts = {};
callback = once(callback || noop);
var ws = stream._writableState;
var rs = stream._readableState;
var readable = opts.readable || (opts.readable !== false && stream.readable);
var writable = opts.writable || (opts.writable !== false && stream.writable);
var cancelled = false;
var onlegacyfinish = function() {
if (!stream.writable) onfinish();
};
var onfinish = function() {
writable = false;
if (!readable) callback.call(stream);
};
var onend = function() {
readable = false;
if (!writable) callback.call(stream);
};
var onexit = function(exitCode) {
callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
};
var onerror = function(err) {
callback.call(stream, err);
};
var onclose = function() {
process.nextTick(onclosenexttick);
};
var onclosenexttick = function() {
if (cancelled) return;
if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
};
var onrequest = function() {
stream.req.on('finish', onfinish);
};
if (isRequest(stream)) {
stream.on('complete', onfinish);
stream.on('abort', onclose);
if (stream.req) onrequest();
else stream.on('request', onrequest);
} else if (writable && !ws) { // legacy streams
stream.on('end', onlegacyfinish);
stream.on('close', onlegacyfinish);
}
if (isChildProcess(stream)) stream.on('exit', onexit);
stream.on('end', onend);
stream.on('finish', onfinish);
if (opts.error !== false) stream.on('error', onerror);
stream.on('close', onclose);
return function() {
cancelled = true;
stream.removeListener('complete', onfinish);
stream.removeListener('abort', onclose);
stream.removeListener('request', onrequest);
if (stream.req) stream.req.removeListener('finish', onfinish);
stream.removeListener('end', onlegacyfinish);
stream.removeListener('close', onlegacyfinish);
stream.removeListener('finish', onfinish);
stream.removeListener('exit', onexit);
stream.removeListener('end', onend);
stream.removeListener('error', onerror);
stream.removeListener('close', onclose);
};
};
module.exports = eos;
/***/ }),
/***/ 11:
/***/ (function(module) {
// Returns a wrapper function that returns a wrapped callback
// The wrapper function should do some stuff, and return a
// presumably different callback function.
// This makes sure that own properties are retained, so that
// decorations and such are not lost along the way.
module.exports = wrappy
function wrappy (fn, cb) {
if (fn && cb) return wrappy(fn)(cb)
if (typeof fn !== 'function')
throw new TypeError('need wrapper function')
Object.keys(fn).forEach(function (k) {
wrapper[k] = fn[k]
})
return wrapper
function wrapper() {
var args = new Array(arguments.length)
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i]
}
var ret = fn.apply(this, args)
var cb = args[args.length-1]
if (typeof ret === 'function' && ret !== cb) {
Object.keys(cb).forEach(function (k) {
ret[k] = cb[k]
})
}
return ret
}
}
/***/ }),
/***/ 16:
/***/ (function(module) {
module.exports = require("tls");
/***/ }),
/***/ 18:
/***/ (function() {
eval("require")("encoding");
/***/ }),
/***/ 19:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = authenticationPlugin;
const { Deprecation } = __webpack_require__(692);
const once = __webpack_require__(969);
const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
const authenticate = __webpack_require__(674);
const beforeRequest = __webpack_require__(471);
const requestError = __webpack_require__(349);
function authenticationPlugin(octokit, options) {
if (options.auth) {
octokit.authenticate = () => {
deprecateAuthenticate(
octokit.log,
new Deprecation(
'[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
)
);
};
return;
}
const state = {
octokit,
auth: false
};
octokit.authenticate = authenticate.bind(null, state);
octokit.hook.before("request", beforeRequest.bind(null, state));
octokit.hook.error("request", requestError.bind(null, state));
}
/***/ }),
/***/ 20:
/***/ (function(module, __unusedexports, __webpack_require__) {
"use strict";
const cp = __webpack_require__(129);
const parse = __webpack_require__(568);
const enoent = __webpack_require__(881);
function spawn(command, args, options) {
// Parse the arguments
const parsed = parse(command, args, options);
// Spawn the child process
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
// Hook into child process "exit" event to emit an error if the command
// does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
enoent.hookChildProcess(spawned, parsed);
return spawned;
}
function spawnSync(command, args, options) {
// Parse the arguments
const parsed = parse(command, args, options);
// Spawn the child process
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
// Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
return result;
}
module.exports = spawn;
module.exports.spawn = spawn;
module.exports.sync = spawnSync;
module.exports._parse = parse;
module.exports._enoent = enoent;
/***/ }),
/***/ 34:
/***/ (function(module) {
module.exports = require("https");
/***/ }),
/***/ 39:
/***/ (function(module) {
"use strict";
module.exports = opts => {
opts = opts || {};
const env = opts.env || process.env;
const platform = opts.platform || process.platform;
if (platform !== 'win32') {
return 'PATH';
}
return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
};
/***/ }),
/***/ 47:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = factory;
const Octokit = __webpack_require__(402);
const registerPlugin = __webpack_require__(855);
function factory(plugins) {
const Api = Octokit.bind(null, plugins || []);
Api.plugin = registerPlugin.bind(null, plugins || []);
return Api;
}
/***/ }),
/***/ 48:
/***/ (function(module, exports) {
exports = module.exports = SemVer
var debug
/* istanbul ignore next */
if (typeof process === 'object' &&
process.env &&
process.env.NODE_DEBUG &&
/\bsemver\b/i.test(process.env.NODE_DEBUG)) {
debug = function () {
var args = Array.prototype.slice.call(arguments, 0)
args.unshift('SEMVER')
console.log.apply(console, args)
}
} else {
debug = function () {}
}
// Note: this is the semver.org version of the spec that it implements
// Not necessarily the package version of this code.
exports.SEMVER_SPEC_VERSION = '2.0.0'
var MAX_LENGTH = 256
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
/* istanbul ignore next */ 9007199254740991
// Max safe segment length for coercion.
var MAX_SAFE_COMPONENT_LENGTH = 16
// The actual regexps go on exports.re
var re = exports.re = []
var src = exports.src = []
var R = 0
// The following Regular Expressions can be used for tokenizing,
// validating, and parsing SemVer version strings.
// ## Numeric Identifier
// A single `0`, or a non-zero digit followed by zero or more digits.
var NUMERICIDENTIFIER = R++
src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
var NUMERICIDENTIFIERLOOSE = R++
src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
// ## Non-numeric Identifier
// Zero or more digits, followed by a letter or hyphen, and then zero or
// more letters, digits, or hyphens.
var NONNUMERICIDENTIFIER = R++
src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
// ## Main Version
// Three dot-separated numeric identifiers.
var MAINVERSION = R++
src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
'(' + src[NUMERICIDENTIFIER] + ')\\.' +
'(' + src[NUMERICIDENTIFIER] + ')'
var MAINVERSIONLOOSE = R++
src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
'(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
'(' + src[NUMERICIDENTIFIERLOOSE] + ')'
// ## Pre-release Version Identifier
// A numeric identifier, or a non-numeric identifier.
var PRERELEASEIDENTIFIER = R++
src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
'|' + src[NONNUMERICIDENTIFIER] + ')'
var PRERELEASEIDENTIFIERLOOSE = R++
src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
'|' + src[NONNUMERICIDENTIFIER] + ')'
// ## Pre-release Version
// Hyphen, followed by one or more dot-separated pre-release version
// identifiers.
var PRERELEASE = R++
src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
'(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
var PRERELEASELOOSE = R++
src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
'(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
// ## Build Metadata Identifier
// Any combination of digits, letters, or hyphens.
var BUILDIDENTIFIER = R++
src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
// ## Build Metadata
// Plus sign, followed by one or more period-separated build metadata
// identifiers.
var BUILD = R++
src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
'(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
// ## Full Version String
// A main version, followed optionally by a pre-release version and
// build metadata.
// Note that the only major, minor, patch, and pre-release sections of
// the version string are capturing groups. The build metadata is not a
// capturing group, because it should not ever be used in version
// comparison.
var FULL = R++
var FULLPLAIN = 'v?' + src[MAINVERSION] +
src[PRERELEASE] + '?' +
src[BUILD] + '?'
src[FULL] = '^' + FULLPLAIN + '$'
// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
// common in the npm registry.
var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
src[PRERELEASELOOSE] + '?' +
src[BUILD] + '?'
var LOOSE = R++
src[LOOSE] = '^' + LOOSEPLAIN + '$'
var GTLT = R++
src[GTLT] = '((?:<|>)?=?)'
// Something like "2.*" or "1.2.x".
// Note that "x.x" is a valid xRange identifer, meaning "any version"
// Only the first item is strictly required.
var XRANGEIDENTIFIERLOOSE = R++
src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
var XRANGEIDENTIFIER = R++
src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
var XRANGEPLAIN = R++
src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
'(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
'(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
'(?:' + src[PRERELEASE] + ')?' +
src[BUILD] + '?' +
')?)?'
var XRANGEPLAINLOOSE = R++
src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
'(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
'(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
'(?:' + src[PRERELEASELOOSE] + ')?' +
src[BUILD] + '?' +
')?)?'
var XRANGE = R++
src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
var XRANGELOOSE = R++
src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
// Coercion.
// Extract anything that could conceivably be a part of a valid semver
var COERCE = R++
src[COERCE] = '(?:^|[^\\d])' +
'(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
'(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
'(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
'(?:$|[^\\d])'
// Tilde ranges.
// Meaning is "reasonably at or greater than"
var LONETILDE = R++
src[LONETILDE] = '(?:~>?)'
var TILDETRIM = R++
src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
var tildeTrimReplace = '$1~'
var TILDE = R++
src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
var TILDELOOSE = R++
src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
// Caret ranges.
// Meaning is "at least and backwards compatible with"
var LONECARET = R++
src[LONECARET] = '(?:\\^)'
var CARETTRIM = R++
src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
var caretTrimReplace = '$1^'
var CARET = R++
src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
var CARETLOOSE = R++
src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
// A simple gt/lt/eq thing, or just "" to indicate "any version"
var COMPARATORLOOSE = R++
src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
var COMPARATOR = R++
src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
// An expression to strip any whitespace between the gtlt and the thing
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
var COMPARATORTRIM = R++
src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
'\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
// this one has to use the /g flag
re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
var comparatorTrimReplace = '$1$2$3'
// Something like `1.2.3 - 1.2.4`
// Note that these all use the loose form, because they'll be
// checked against either the strict or loose comparator form
// later.
var HYPHENRANGE = R++
src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
'\\s+-\\s+' +
'(' + src[XRANGEPLAIN] + ')' +
'\\s*$'
var HYPHENRANGELOOSE = R++
src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
'\\s+-\\s+' +
'(' + src[XRANGEPLAINLOOSE] + ')' +
'\\s*$'
// Star ranges basically just allow anything at all.
var STAR = R++
src[STAR] = '(<|>)?=?\\s*\\*'
// Compile to actual regexp objects.
// All are flag-free, unless they were created above with a flag.
for (var i = 0; i < R; i++) {
debug(i, src[i])
if (!re[i]) {
re[i] = new RegExp(src[i])
}
}
exports.parse = parse
function parse (version, options) {
if (!options || typeof options !== 'object') {
options = {
loose: !!options,
includePrerelease: false
}
}
if (version instanceof SemVer) {
return version
}
if (typeof version !== 'string') {
return null
}
if (version.length > MAX_LENGTH) {
return null
}
var r = options.loose ? re[LOOSE] : re[FULL]
if (!r.test(version)) {
return null
}
try {
return new SemVer(version, options)
} catch (er) {
return null
}
}
exports.valid = valid
function valid (version, options) {
var v = parse(version, options)
return v ? v.version : null
}
exports.clean = clean
function clean (version, options) {
var s = parse(version.trim().replace(/^[=v]+/, ''), options)
return s ? s.version : null
}
exports.SemVer = SemVer
function SemVer (version, options) {
if (!options || typeof options !== 'object') {
options = {
loose: !!options,
includePrerelease: false
}
}
if (version instanceof SemVer) {
if (version.loose === options.loose) {
return version
} else {
version = version.version
}
} else if (typeof version !== 'string') {
throw new TypeError('Invalid Version: ' + version)
}
if (version.length > MAX_LENGTH) {
throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
}
if (!(this instanceof SemVer)) {
return new SemVer(version, options)
}
debug('SemVer', version, options)
this.options = options
this.loose = !!options.loose
var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
if (!m) {
throw new TypeError('Invalid Version: ' + version)
}
this.raw = version
// these are actually numbers
this.major = +m[1]
this.minor = +m[2]
this.patch = +m[3]
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
throw new TypeError('Invalid major version')
}
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
throw new TypeError('Invalid minor version')
}
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
throw new TypeError('Invalid patch version')
}
// numberify any prerelease numeric ids
if (!m[4]) {
this.prerelease = []
} else {
this.prerelease = m[4].split('.').map(function (id) {
if (/^[0-9]+$/.test(id)) {
var num = +id
if (num >= 0 && num < MAX_SAFE_INTEGER) {
return num
}
}
return id
})
}
this.build = m[5] ? m[5].split('.') : []
this.format()
}
SemVer.prototype.format = function () {
this.version = this.major + '.' + this.minor + '.' + this.patch
if (this.prerelease.length) {
this.version += '-' + this.prerelease.join('.')
}
return this.version
}
SemVer.prototype.toString = function () {
return this.version
}
SemVer.prototype.compare = function (other) {
debug('SemVer.compare', this.version, this.options, other)
if (!(other instanceof SemVer)) {
other = new SemVer(other, this.options)
}
return this.compareMain(other) || this.comparePre(other)
}
SemVer.prototype.compareMain = function (other) {
if (!(other instanceof SemVer)) {
other = new SemVer(other, this.options)
}
return compareIdentifiers(this.major, other.major) ||
compareIdentifiers(this.minor, other.minor) ||
compareIdentifiers(this.patch, other.patch)
}
SemVer.prototype.comparePre = function (other) {
if (!(other instanceof SemVer)) {
other = new SemVer(other, this.options)
}
// NOT having a prerelease is > having one
if (this.prerelease.length && !other.prerelease.length) {
return -1
} else if (!this.prerelease.length && other.prerelease.length) {
return 1
} else if (!this.prerelease.length && !other.prerelease.length) {
return 0
}
var i = 0
do {
var a = this.prerelease[i]
var b = other.prerelease[i]
debug('prerelease compare', i, a, b)
if (a === undefined && b === undefined) {
return 0
} else if (b === undefined) {
return 1
} else if (a === undefined) {
return -1
} else if (a === b) {
continue
} else {
return compareIdentifiers(a, b)
}
} while (++i)
}
// preminor will bump the version up to the next minor release, and immediately
// down to pre-release. premajor and prepatch work the same way.
SemVer.prototype.inc = function (release, identifier) {
switch (release) {
case 'premajor':
this.prerelease.length = 0
this.patch = 0
this.minor = 0
this.major++
this.inc('pre', identifier)
break
case 'preminor':
this.prerelease.length = 0
this.patch = 0
this.minor++
this.inc('pre', identifier)
break
case 'prepatch':
// If this is already a prerelease, it will bump to the next version
// drop any prereleases that might already exist, since they are not
// relevant at this point.
this.prerelease.length = 0
this.inc('patch', identifier)
this.inc('pre', identifier)
break
// If the input is a non-prerelease version, this acts the same as
// prepatch.
case 'prerelease':
if (this.prerelease.length === 0) {
this.inc('patch', identifier)
}
this.inc('pre', identifier)
break
case 'major':
// If this is a pre-major version, bump up to the same major version.
// Otherwise increment major.
// 1.0.0-5 bumps to 1.0.0
// 1.1.0 bumps to 2.0.0
if (this.minor !== 0 ||
this.patch !== 0 ||
this.prerelease.length === 0) {
this.major++
}
this.minor = 0
this.patch = 0
this.prerelease = []
break
case 'minor':
// If this is a pre-minor version, bump up to the same minor version.
// Otherwise increment minor.
// 1.2.0-5 bumps to 1.2.0
// 1.2.1 bumps to 1.3.0
if (this.patch !== 0 || this.prerelease.length === 0) {
this.minor++
}
this.patch = 0
this.prerelease = []
break
case 'patch':
// If this is not a pre-release version, it will increment the patch.
// If it is a pre-release it will bump up to the same patch version.
// 1.2.0-5 patches to 1.2.0
// 1.2.0 patches to 1.2.1
if (this.prerelease.length === 0) {
this.patch++
}
this.prerelease = []
break
// This probably shouldn't be used publicly.
// 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
case 'pre':
if (this.prerelease.length === 0) {
this.prerelease = [0]
} else {
var i = this.prerelease.length
while (--i >= 0) {
if (typeof this.prerelease[i] === 'number') {
this.prerelease[i]++
i = -2
}
}
if (i === -1) {
// didn't increment anything
this.prerelease.push(0)
}
}
if (identifier) {
// 1.2.0-beta.1 bumps to 1.2.0-beta.2,
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
if (this.prerelease[0] === identifier) {
if (isNaN(this.prerelease[1])) {
this.prerelease = [identifier, 0]
}
} else {
this.prerelease = [identifier, 0]
}
}
break
default:
throw new Error('invalid increment argument: ' + release)
}
this.format()
this.raw = this.version
return this
}
exports.inc = inc
function inc (version, release, loose, identifier) {
if (typeof (loose) === 'string') {
identifier = loose
loose = undefined
}
try {
return new SemVer(version, loose).inc(release, identifier).version
} catch (er) {
return null
}
}
exports.diff = diff
function diff (version1, version2) {
if (eq(version1, version2)) {
return null
} else {
var v1 = parse(version1)
var v2 = parse(version2)
var prefix = ''
if (v1.prerelease.length || v2.prerelease.length) {
prefix = 'pre'
var defaultResult = 'prerelease'
}
for (var key in v1) {
if (key === 'major' || key === 'minor' || key === 'patch') {
if (v1[key] !== v2[key]) {
return prefix + key
}
}
}
return defaultResult // may be undefined
}
}
exports.compareIdentifiers = compareIdentifiers
var numeric = /^[0-9]+$/
function compareIdentifiers (a, b) {
var anum = numeric.test(a)
var bnum = numeric.test(b)
if (anum && bnum) {
a = +a
b = +b
}
return a === b ? 0
: (anum && !bnum) ? -1
: (bnum && !anum) ? 1
: a < b ? -1
: 1
}
exports.rcompareIdentifiers = rcompareIdentifiers
function rcompareIdentifiers (a, b) {
return compareIdentifiers(b, a)
}
exports.major = major
function major (a, loose) {
return new SemVer(a, loose).major
}
exports.minor = minor
function minor (a, loose) {
return new SemVer(a, loose).minor
}
exports.patch = patch
function patch (a, loose) {
return new SemVer(a, loose).patch
}
exports.compare = compare
function compare (a, b, loose) {
return new SemVer(a, loose).compare(new SemVer(b, loose))
}
exports.compareLoose = compareLoose
function compareLoose (a, b) {
return compare(a, b, true)
}
exports.rcompare = rcompare
function rcompare (a, b, loose) {
return compare(b, a, loose)
}
exports.sort = sort
function sort (list, loose) {
return list.sort(function (a, b) {
return exports.compare(a, b, loose)
})
}
exports.rsort = rsort
function rsort (list, loose) {
return list.sort(function (a, b) {
return exports.rcompare(a, b, loose)
})
}
exports.gt = gt
function gt (a, b, loose) {
return compare(a, b, loose) > 0
}
exports.lt = lt
function lt (a, b, loose) {
return compare(a, b, loose) < 0
}
exports.eq = eq
function eq (a, b, loose) {
return compare(a, b, loose) === 0
}
exports.neq = neq
function neq (a, b, loose) {
return compare(a, b, loose) !== 0
}
exports.gte = gte
function gte (a, b, loose) {
return compare(a, b, loose) >= 0
}
exports.lte = lte
function lte (a, b, loose) {
return compare(a, b, loose) <= 0
}
exports.cmp = cmp
function cmp (a, op, b, loose) {
switch (op) {
case '===':
if (typeof a === 'object')
a = a.version
if (typeof b === 'object')
b = b.version
return a === b
case '!==':
if (typeof a === 'object')
a = a.version
if (typeof b === 'object')
b = b.version
return a !== b
case '':
case '=':
case '==':
return eq(a, b, loose)
case '!=':
return neq(a, b, loose)
case '>':
return gt(a, b, loose)
case '>=':
return gte(a, b, loose)
case '<':
return lt(a, b, loose)
case '<=':
return lte(a, b, loose)
default:
throw new TypeError('Invalid operator: ' + op)
}
}
exports.Comparator = Comparator
function Comparator (comp, options) {
if (!options || typeof options !== 'object') {
options = {
loose: !!options,
includePrerelease: false
}
}
if (comp instanceof Comparator) {
if (comp.loose === !!options.loose) {
return comp
} else {
comp = comp.value
}
}
if (!(this instanceof Comparator)) {
return new Comparator(comp, options)
}
debug('comparator', comp, options)
this.options = options
this.loose = !!options.loose
this.parse(comp)
if (this.semver === ANY) {
this.value = ''
} else {
this.value = this.operator + this.semver.version
}
debug('comp', this)
}
var ANY = {}
Comparator.prototype.parse = function (comp) {
var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
var m = comp.match(r)
if (!m) {
throw new TypeError('Invalid comparator: ' + comp)
}
this.operator = m[1]
if (this.operator === '=') {
this.operator = ''
}
// if it literally is just '>' or '' then allow anything.
if (!m[2]) {
this.semver = ANY
} else {
this.semver = new SemVer(m[2], this.options.loose)
}
}
Comparator.prototype.toString = function () {
return this.value
}
Comparator.prototype.test = function (version) {
debug('Comparator.test', version, this.options.loose)
if (this.semver === ANY) {
return true
}
if (typeof version === 'string') {
version = new SemVer(version, this.options)
}
return cmp(version, this.operator, this.semver, this.options)
}
Comparator.prototype.intersects = function (comp, options) {
if (!(comp instanceof Comparator)) {
throw new TypeError('a Comparator is required')
}
if (!options || typeof options !== 'object') {
options = {
loose: !!options,
includePrerelease: false
}
}
var rangeTmp
if (this.operator === '') {
rangeTmp = new Range(comp.value, options)
return satisfies(this.value, rangeTmp, options)
} else if (comp.operator === '') {
rangeTmp = new Range(this.value, options)
return satisfies(comp.semver, rangeTmp, options)
}
var sameDirectionIncreasing =
(this.operator === '>=' || this.operator === '>') &&
(comp.operator === '>=' || comp.operator === '>')
var sameDirectionDecreasing =
(this.operator === '<=' || this.operator === '<') &&
(comp.operator === '<=' || comp.operator === '<')
var sameSemVer = this.semver.version === comp.semver.version
var differentDirectionsInclusive =
(this.operator === '>=' || this.operator === '<=') &&
(comp.operator === '>=' || comp.operator === '<=')
var oppositeDirectionsLessThan =
cmp(this.semver, '<', comp.semver, options) &&
((this.operator === '>=' || this.operator === '>') &&
(comp.operator === '<=' || comp.operator === '<'))
var oppositeDirectionsGreaterThan =
cmp(this.semver, '>', comp.semver, options) &&
((this.operator === '<=' || this.operator === '<') &&
(comp.operator === '>=' || comp.operator === '>'))
return sameDirectionIncreasing || sameDirectionDecreasing ||
(sameSemVer && differentDirectionsInclusive) ||
oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
}
exports.Range = Range
function Range (range, options) {
if (!options || typeof options !== 'object') {
options = {
loose: !!options,
includePrerelease: false
}
}
if (range instanceof Range) {
if (range.loose === !!options.loose &&
range.includePrerelease === !!options.includePrerelease) {
return range
} else {
return new Range(range.raw, options)
}
}
if (range instanceof Comparator) {
return new Range(range.value, options)
}
if (!(this instanceof Range)) {
return new Range(range, options)
}
this.options = options
this.loose = !!options.loose
this.includePrerelease = !!options.includePrerelease
// First, split based on boolean or ||
this.raw = range
this.set = range.split(/\s*\|\|\s*/).map(function (range) {
return this.parseRange(range.trim())
}, this).filter(function (c) {
// throw out any that are not relevant for whatever reason
return c.length
})
if (!this.set.length) {
throw new TypeError('Invalid SemVer Range: ' + range)
}
this.format()
}
Range.prototype.format = function () {
this.range = this.set.map(function (comps) {
return comps.join(' ').trim()
}).join('||').trim()
return this.range
}
Range.prototype.toString = function () {
return this.range
}
Range.prototype.parseRange = function (range) {
var loose = this.options.loose
range = range.trim()
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
range = range.replace(hr, hyphenReplace)
debug('hyphen replace', range)
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
debug('comparator trim', range, re[COMPARATORTRIM])
// `~ 1.2.3` => `~1.2.3`
range = range.replace(re[TILDETRIM], tildeTrimReplace)
// `^ 1.2.3` => `^1.2.3`
range = range.replace(re[CARETTRIM], caretTrimReplace)
// normalize spaces
range = range.split(/\s+/).join(' ')
// At this point, the range is completely trimmed and
// ready to be split into comparators.
var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
var set = range.split(' ').map(function (comp) {
return parseComparator(comp, this.options)
}, this).join(' ').split(/\s+/)
if (this.options.loose) {
// in loose mode, throw out any that are not valid comparators
set = set.filter(function (comp) {
return !!comp.match(compRe)
})
}
set = set.map(function (comp) {
return new Comparator(comp, this.options)
}, this)
return set
}
Range.prototype.intersects = function (range, options) {
if (!(range instanceof Range)) {
throw new TypeError('a Range is required')
}
return this.set.some(function (thisComparators) {
return thisComparators.every(function (thisComparator) {
return range.set.some(function (rangeComparators) {
return rangeComparators.every(function (rangeComparator) {
return thisComparator.intersects(rangeComparator, options)
})
})
})
})
}
// Mostly just for testing and legacy API reasons
exports.toComparators = toComparators
function toComparators (range, options) {
return new Range(range, options).set.map(function (comp) {
return comp.map(function (c) {
return c.value
}).join(' ').trim().split(' ')
})
}
// comprised of xranges, tildes, stars, and gtlt's at this point.
// already replaced the hyphen ranges
// turn into a set of JUST comparators.
function parseComparator (comp, options) {
debug('comp', comp, options)
comp = replaceCarets(comp, options)
debug('caret', comp)
comp = replaceTildes(comp, options)
debug('tildes', comp)
comp = replaceXRanges(comp, options)
debug('xrange', comp)
comp = replaceStars(comp, options)
debug('stars', comp)
return comp
}
function isX (id) {
return !id || id.toLowerCase() === 'x' || id === '*'
}
// ~, ~> --> * (any, kinda silly)
// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
function replaceTildes (comp, options) {
return comp.trim().split(/\s+/).map(function (comp) {
return replaceTilde(comp, options)
}).join(' ')
}
function replaceTilde (comp, options) {
var r = options.loose ? re[TILDELOOSE] : re[TILDE]
return comp.replace(r, function (_, M, m, p, pr) {
debug('tilde', comp, _, M, m, p, pr)
var ret
if (isX(M)) {
ret = ''
} else if (isX(m)) {
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
} else if (isX(p)) {
// ~1.2 == >=1.2.0 <1.3.0
ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
} else if (pr) {
debug('replaceTilde pr', pr)
ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
' <' + M + '.' + (+m + 1) + '.0'
} else {
// ~1.2.3 == >=1.2.3 <1.3.0
ret = '>=' + M + '.' + m + '.' + p +
' <' + M + '.' + (+m + 1) + '.0'
}
debug('tilde return', ret)
return ret
})
}
// ^ --> * (any, kinda silly)
// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
// ^1.2.3 --> >=1.2.3 <2.0.0
// ^1.2.0 --> >=1.2.0 <2.0.0
function replaceCarets (comp, options) {
return comp.trim().split(/\s+/).map(function (comp) {
return replaceCaret(comp, options)
}).join(' ')
}
function replaceCaret (comp, options) {
debug('caret', comp, options)
var r = options.loose ? re[CARETLOOSE] : re[CARET]
return comp.replace(r, function (_, M, m, p, pr) {
debug('caret', comp, _, M, m, p, pr)
var ret
if (isX(M)) {
ret = ''
} else if (isX(m)) {
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
} else if (isX(p)) {
if (M === '0') {
ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
} else {
ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
}
} else if (pr) {
debug('replaceCaret pr', pr)
if (M === '0') {
if (m === '0') {
ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
' <' + M + '.' + m + '.' + (+p + 1)
} else {
ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
' <' + M + '.' + (+m + 1) + '.0'
}
} else {
ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
' <' + (+M + 1) + '.0.0'
}
} else {
debug('no pr')
if (M === '0') {
if (m === '0') {
ret = '>=' + M + '.' + m + '.' + p +
' <' + M + '.' + m + '.' + (+p + 1)
} else {
ret = '>=' + M + '.' + m + '.' + p +
' <' + M + '.' + (+m + 1) + '.0'
}
} else {
ret = '>=' + M + '.' + m + '.' + p +
' <' + (+M + 1) + '.0.0'
}
}
debug('caret return', ret)
return ret
})
}
function replaceXRanges (comp, options) {
debug('replaceXRanges', comp, options)
return comp.split(/\s+/).map(function (comp) {
return replaceXRange(comp, options)
}).join(' ')
}
function replaceXRange (comp, options) {
comp = comp.trim()
var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
debug('xRange', comp, ret, gtlt, M, m, p, pr)
var xM = isX(M)
var xm = xM || isX(m)
var xp = xm || isX(p)
var anyX = xp
if (gtlt === '=' && anyX) {
gtlt = ''
}
if (xM) {
if (gtlt === '>' || gtlt === '<') {
// nothing is allowed
ret = '<0.0.0'
} else {
// nothing is forbidden
ret = '*'
}
} else if (gtlt && anyX) {
// we know patch is an x, because we have any x at all.
// replace X with 0
if (xm) {
m = 0
}
p = 0
if (gtlt === '>') {
// >1 => >=2.0.0
// >1.2 => >=1.3.0
// >1.2.3 => >= 1.2.4
gtlt = '>='
if (xm) {
M = +M + 1
m = 0
p = 0
} else {
m = +m + 1
p = 0
}
} else if (gtlt === '<=') {
// <=0.7.x is actually <0.8.0, since any 0.7.x should
// pass. Similarly, <=7.x is actually <8.0.0, etc.
gtlt = '<'
if (xm) {
M = +M + 1
} else {
m = +m + 1
}
}
ret = gtlt + M + '.' + m + '.' + p
} else if (xm) {
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
} else if (xp) {
ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
}
debug('xRange return', ret)
return ret
})
}
// Because * is AND-ed with everything else in the comparator,
// and '' means "any version", just remove the *s entirely.
function replaceStars (comp, options) {
debug('replaceStars', comp, options)
// Looseness is ignored here. star is always as loose as it gets!
return comp.trim().replace(re[STAR], '')
}
// This function is passed to string.replace(re[HYPHENRANGE])
// M, m, patch, prerelease, build
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
// 1.2 - 3.4 => >=1.2.0 <3.5.0
function hyphenReplace ($0,
from, fM, fm, fp, fpr, fb,
to, tM, tm, tp, tpr, tb) {
if (isX(fM)) {
from = ''
} else if (isX(fm)) {
from = '>=' + fM + '.0.0'
} else if (isX(fp)) {
from = '>=' + fM + '.' + fm + '.0'
} else {
from = '>=' + from
}
if (isX(tM)) {
to = ''
} else if (isX(tm)) {
to = '<' + (+tM + 1) + '.0.0'
} else if (isX(tp)) {
to = '<' + tM + '.' + (+tm + 1) + '.0'
} else if (tpr) {
to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
} else {
to = '<=' + to
}
return (from + ' ' + to).trim()
}
// if ANY of the sets match ALL of its comparators, then pass
Range.prototype.test = function (version) {
if (!version) {
return false
}
if (typeof version === 'string') {
version = new SemVer(version, this.options)
}
for (var i = 0; i < this.set.length; i++) {
if (testSet(this.set[i], version, this.options)) {
return true
}
}
return false
}
function testSet (set, version, options) {
for (var i = 0; i < set.length; i++) {
if (!set[i].test(version)) {
return false
}
}
if (version.prerelease.length && !options.includePrerelease) {
// Find the set of versions that are allowed to have prereleases
// For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
// That should allow `1.2.3-pr.2` to pass.
// However, `1.2.4-alpha.notready` should NOT be allowed,
// even though it's within the range set by the comparators.
for (i = 0; i < set.length; i++) {
debug(set[i].semver)
if (set[i].semver === ANY) {
continue
}
if (set[i].semver.prerelease.length > 0) {
var allowed = set[i].semver
if (allowed.major === version.major &&
allowed.minor === version.minor &&
allowed.patch === version.patch) {
return true
}
}
}
// Version has a -pre, but it's not one of the ones we like.
return false
}
return true
}
exports.satisfies = satisfies
function satisfies (version, range, options) {
try {
range = new Range(range, options)
} catch (er) {
return false
}
return range.test(version)
}
exports.maxSatisfying = maxSatisfying
function maxSatisfying (versions, range, options) {
var max = null
var maxSV = null
try {
var rangeObj = new Range(range, options)
} catch (er) {
return null
}
versions.forEach(function (v) {
if (rangeObj.test(v)) {
// satisfies(v, range, options)
if (!max || maxSV.compare(v) === -1) {
// compare(max, v, true)
max = v
maxSV = new SemVer(max, options)
}
}
})
return max
}
exports.minSatisfying = minSatisfying
function minSatisfying (versions, range, options) {
var min = null
var minSV = null
try {
var rangeObj = new Range(range, options)
} catch (er) {
return null
}
versions.forEach(function (v) {
if (rangeObj.test(v)) {
// satisfies(v, range, options)
if (!min || minSV.compare(v) === 1) {
// compare(min, v, true)
min = v
minSV = new SemVer(min, options)
}
}
})
return min
}
exports.minVersion = minVersion
function minVersion (range, loose) {
range = new Range(range, loose)
var minver = new SemVer('0.0.0')
if (range.test(minver)) {
return minver
}
minver = new SemVer('0.0.0-0')
if (range.test(minver)) {
return minver
}
minver = null
for (var i = 0; i < range.set.length; ++i) {
var comparators = range.set[i]
comparators.forEach(function (comparator) {
// Clone to avoid manipulating the comparator's semver object.
var compver = new SemVer(comparator.semver.version)
switch (comparator.operator) {
case '>':
if (compver.prerelease.length === 0) {
compver.patch++
} else {
compver.prerelease.push(0)
}
compver.raw = compver.format()
/* fallthrough */
case '':
case '>=':
if (!minver || gt(minver, compver)) {
minver = compver
}
break
case '<':
case '<=':
/* Ignore maximum versions */
break
/* istanbul ignore next */
default:
throw new Error('Unexpected operation: ' + comparator.operator)
}
})
}
if (minver && range.test(minver)) {
return minver
}
return null
}
exports.validRange = validRange
function validRange (range, options) {
try {
// Return '*' instead of '' so that truthiness works.
// This will throw if it's invalid anyway
return new Range(range, options).range || '*'
} catch (er) {
return null
}
}
// Determine if version is less than all the versions possible in the range
exports.ltr = ltr
function ltr (version, range, options) {
return outside(version, range, '<', options)
}
// Determine if version is greater than all the versions possible in the range.
exports.gtr = gtr
function gtr (version, range, options) {
return outside(version, range, '>', options)
}
exports.outside = outside
function outside (version, range, hilo, options) {
version = new SemVer(version, options)
range = new Range(range, options)
var gtfn, ltefn, ltfn, comp, ecomp
switch (hilo) {
case '>':
gtfn = gt
ltefn = lte
ltfn = lt
comp = '>'
ecomp = '>='
break
case '<':
gtfn = lt
ltefn = gte
ltfn = gt
comp = '<'
ecomp = '<='
break
default:
throw new TypeError('Must provide a hilo val of "<" or ">"')
}
// If it satisifes the range it is not outside
if (satisfies(version, range, options)) {
return false
}
// From now on, variable terms are as if we're in "gtr" mode.
// but note that everything is flipped for the "ltr" function.
for (var i = 0; i < range.set.length; ++i) {
var comparators = range.set[i]
var high = null
var low = null
comparators.forEach(function (comparator) {
if (comparator.semver === ANY) {
comparator = new Comparator('>=0.0.0')
}
high = high || comparator
low = low || comparator
if (gtfn(comparator.semver, high.semver, options)) {
high = comparator
} else if (ltfn(comparator.semver, low.semver, options)) {
low = comparator
}
})
// If the edge version comparator has a operator then our version
// isn't outside it
if (high.operator === comp || high.operator === ecomp) {
return false
}
// If the lowest version comparator has an operator and our version
// is less than it then it isn't higher than the range
if ((!low.operator || low.operator === comp) &&
ltefn(version, low.semver)) {
return false
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
return false
}
}
return true
}
exports.prerelease = prerelease
function prerelease (version, options) {
var parsed = parse(version, options)
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
}
exports.intersects = intersects
function intersects (r1, r2, options) {
r1 = new Range(r1, options)
r2 = new Range(r2, options)
return r1.intersects(r2)
}
exports.coerce = coerce
function coerce (version) {
if (version instanceof SemVer) {
return version
}
if (typeof version !== 'string') {
return null
}
var match = version.match(re[COERCE])
if (match == null) {
return null
}
return parse(match[1] +
'.' + (match[2] || '0') +
'.' + (match[3] || '0'))
}
/***/ }),
/***/ 49:
/***/ (function(module, __unusedexports, __webpack_require__) {
"use strict";
const os = __webpack_require__(87);
const execa = __webpack_require__(955);
// Reference: https://www.gaijin.at/en/lstwinver.php
const names = new Map([
['10.0', '10'],
['6.3', '8.1'],
['6.2', '8'],
['6.1', '7'],
['6.0', 'Vista'],
['5.2', 'Server 2003'],
['5.1', 'XP'],
['5.0', '2000'],
['4.9', 'ME'],
['4.1', '98'],
['4.0', '95']
]);
const windowsRelease = release => {
const version = /\d+\.\d/.exec(release || os.release());
if (release && !version) {
throw new Error('`release` argument doesn\'t match `n.n`');
}
const ver = (version || [])[0];
// Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime.
// If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
// then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
// If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name.
if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
const year = (stdout.match(/2008|2012|2016/) || [])[0];
if (year) {
return `Server ${year}`;
}
}
return names.get(ver);
};
module.exports = windowsRelease;
/***/ }),
/***/ 87:
/***/ (function(module) {
module.exports = require("os");
/***/ }),
/***/ 118:
/***/ (function(module, __unusedexports, __webpack_require__) {
"use strict";
const os = __webpack_require__(87);
const nameMap = new Map([
[19, 'Catalina'],
[18, 'Mojave'],
[17, 'High Sierra'],
[16, 'Sierra'],
[15, 'El Capitan'],
[14, 'Yosemite'],
[13, 'Mavericks'],
[12, 'Mountain Lion'],
[11, 'Lion'],
[10, 'Snow Leopard'],
[9, 'Leopard'],
[8, 'Tiger'],
[7, 'Panther'],
[6, 'Jaguar'],
[5, 'Puma']
]);
const macosRelease = release => {
release = Number((release || os.release()).split('.')[0]);
return {
name: nameMap.get(release),
version: '10.' + (release - 4)
};
};
module.exports = macosRelease;
// TODO: remove this in the next major version
module.exports.default = macosRelease;
/***/ }),
/***/ 126:
/***/ (function(module) {
/**
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** `Object#toString` result references. */
var funcTag = '[object Function]',
genTag = '[object GeneratorFunction]';
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
var length = array ? array.length : 0;
return !!length && baseIndexOf(array, value, 0) > -1;
}
/**
* This function is like `arrayIncludes` except that it accepts a comparator.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @param {Function} comparator The comparator invoked per element.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludesWith(array, value, comparator) {
var index = -1,
length = array ? array.length : 0;
while (++index < length) {
if (comparator(value, array[index])) {
return true;
}
}
return false;
}
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseFindIndex(array, predicate, fromIndex, fromRight) {
var length = array.length,
index = fromIndex + (fromRight ? 1 : -1);
while ((fromRight ? index-- : ++index < length)) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
}
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
if (value !== value) {
return baseFindIndex(array, baseIsNaN, fromIndex);
}
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
/**
* The base implementation of `_.isNaN` without support for number objects.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
*/
function baseIsNaN(value) {
return value !== value;
}
/**
* Checks if a cache value for `key` exists.
*
* @private
* @param {Object} cache The cache to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function cacheHas(cache, key) {
return cache.has(key);
}
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
/**
* Checks if `value` is a host object in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
*/
function isHostObject(value) {
// Many host objects are `Object` objects that can coerce to strings
// despite having improperly defined `toString` methods.
var result = false;
if (value != null && typeof value.toString != 'function') {
try {
result = !!(value + '');
} catch (e) {}
}
return result;
}
/**
* Converts `set` to an array of its values.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the values.
*/
function setToArray(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = value;
});
return result;
}
/** Used for built-in method references. */
var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/** Built-in value references. */
var splice = arrayProto.splice;
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map'),
Set = getNative(root, 'Set'),
nativeCreate = getNative(Object, 'create');
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
}
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
return this.has(key) && delete this.__data__[key];
}
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
}
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
}
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
return true;
}
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
return getMapData(this, key)['delete'](key);
}
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
getMapData(this, key).set(key, value);
return this;
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
/**
*
* Creates an array cache object to store unique values.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values ? values.length : 0;
this.__data__ = new MapCache;
while (++index < length) {
this.add(values[index]);
}
}
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
/**
* Checks if `value` is in the array cache.
*
* @private
* @name has
* @memberOf SetCache
* @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
function setCacheHas(value) {
return this.__data__.has(value);
}
// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
/**
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseUniq(array, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
length = array.length,
isCommon = true,
result = [],
seen = result;
if (comparator) {
isCommon = false;
includes = arrayIncludesWith;
}
else if (length >= LARGE_ARRAY_SIZE) {
var set = iteratee ? null : createSet(array);
if (set) {
return setToArray(set);
}
isCommon = false;
includes = cacheHas;
seen = new SetCache;
}
else {
seen = iteratee ? [] : result;
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var seenIndex = seen.length;
while (seenIndex--) {
if (seen[seenIndex] === computed) {
continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
/**
* Creates a set object of `values`.
*
* @private
* @param {Array} values The values to add to the set.
* @returns {Object} Returns the new set.
*/
var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
return new Set(values);
};
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to process.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
/**
* Creates a duplicate-free version of an array, using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons, in which only the first occurrence of each
* element is kept.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.uniq([2, 1, 2]);
* // => [2, 1]
*/
function uniq(array) {
return (array && array.length)
? baseUniq(array)
: [];
}
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* This method returns `undefined`.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Util
* @example
*
* _.times(2, _.noop);
* // => [undefined, undefined]
*/
function noop() {
// No operation performed.
}
module.exports = uniq;
/***/ }),
/***/ 129:
/***/ (function(module) {
module.exports = require("child_process");
/***/ }),
/***/ 139:
/***/ (function(module, __unusedexports, __webpack_require__) {
// Unique ID creation requires a high quality random # generator. In node.js
// this is pretty straight-forward - we use the crypto API.
var crypto = __webpack_require__(417);
module.exports = function nodeRNG() {
return crypto.randomBytes(16);
};
/***/ }),
/***/ 141:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var net = __webpack_require__(631);
var tls = __webpack_require__(16);
var http = __webpack_require__(605);
var https = __webpack_require__(34);
var events = __webpack_require__(614);
var assert = __webpack_require__(357);
var util = __webpack_require__(669);
exports.httpOverHttp = httpOverHttp;
exports.httpsOverHttp = httpsOverHttp;
exports.httpOverHttps = httpOverHttps;
exports.httpsOverHttps = httpsOverHttps;
function httpOverHttp(options) {
var agent = new TunnelingAgent(options);
agent.request = http.request;
return agent;
}
function httpsOverHttp(options) {
var agent = new TunnelingAgent(options);
agent.request = http.request;
agent.createSocket = createSecureSocket;
agent.defaultPort = 443;
return agent;
}
function httpOverHttps(options) {
var agent = new TunnelingAgent(options);
agent.request = https.request;
return agent;
}
function httpsOverHttps(options) {
var agent = new TunnelingAgent(options);
agent.request = https.request;
agent.createSocket = createSecureSocket;
agent.defaultPort = 443;
return agent;
}
function TunnelingAgent(options) {
var self = this;
self.options = options || {};
self.proxyOptions = self.options.proxy || {};
self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
self.requests = [];
self.sockets = [];
self.on('free', function onFree(socket, host, port, localAddress) {
var options = toOptions(host, port, localAddress);
for (var i = 0, len = self.requests.length; i < len; ++i) {
var pending = self.requests[i];
if (pending.host === options.host && pending.port === options.port) {
// Detect the request to connect same origin server,
// reuse the connection.
self.requests.splice(i, 1);
pending.request.onSocket(socket);
return;
}
}
socket.destroy();
self.removeSocket(socket);
});
}
util.inherits(TunnelingAgent, events.EventEmitter);
TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
var self = this;
var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
if (self.sockets.length >= this.maxSockets) {
// We are over limit so we'll add it to the queue.
self.requests.push(options);
return;
}
// If we are under maxSockets create a new one.
self.createSocket(options, function(socket) {
socket.on('free', onFree);
socket.on('close', onCloseOrRemove);
socket.on('agentRemove', onCloseOrRemove);
req.onSocket(socket);
function onFree() {
self.emit('free', socket, options);
}
function onCloseOrRemove(err) {
self.removeSocket(socket);
socket.removeListener('free', onFree);
socket.removeListener('close', onCloseOrRemove);
socket.removeListener('agentRemove', onCloseOrRemove);
}
});
};
TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
var self = this;
var placeholder = {};
self.sockets.push(placeholder);
var connectOptions = mergeOptions({}, self.proxyOptions, {
method: 'CONNECT',
path: options.host + ':' + options.port,
agent: false,
headers: {
host: options.host + ':' + options.port
}
});
if (options.localAddress) {
connectOptions.localAddress = options.localAddress;
}
if (connectOptions.proxyAuth) {
connectOptions.headers = connectOptions.headers || {};
connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
new Buffer(connectOptions.proxyAuth).toString('base64');
}
debug('making CONNECT request');
var connectReq = self.request(connectOptions);
connectReq.useChunkedEncodingByDefault = false; // for v0.6
connectReq.once('response', onResponse); // for v0.6
connectReq.once('upgrade', onUpgrade); // for v0.6
connectReq.once('connect', onConnect); // for v0.7 or later
connectReq.once('error', onError);
connectReq.end();
function onResponse(res) {
// Very hacky. This is necessary to avoid http-parser leaks.
res.upgrade = true;
}
function onUpgrade(res, socket, head) {
// Hacky.
process.nextTick(function() {
onConnect(res, socket, head);
});
}
function onConnect(res, socket, head) {
connectReq.removeAllListeners();
socket.removeAllListeners();
if (res.statusCode !== 200) {
debug('tunneling socket could not be established, statusCode=%d',
res.statusCode);
socket.destroy();
var error = new Error('tunneling socket could not be established, ' +
'statusCode=' + res.statusCode);
error.code = 'ECONNRESET';
options.request.emit('error', error);
self.removeSocket(placeholder);
return;
}
if (head.length > 0) {
debug('got illegal response body from proxy');
socket.destroy();
var error = new Error('got illegal response body from proxy');
error.code = 'ECONNRESET';
options.request.emit('error', error);
self.removeSocket(placeholder);
return;
}
debug('tunneling connection has established');
self.sockets[self.sockets.indexOf(placeholder)] = socket;
return cb(socket);
}
function onError(cause) {
connectReq.removeAllListeners();
debug('tunneling socket could not be established, cause=%s\n',
cause.message, cause.stack);
var error = new Error('tunneling socket could not be established, ' +
'cause=' + cause.message);
error.code = 'ECONNRESET';
options.request.emit('error', error);
self.removeSocket(placeholder);
}
};
TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
var pos = this.sockets.indexOf(socket)
if (pos === -1) {
return;
}
this.sockets.splice(pos, 1);
var pending = this.requests.shift();
if (pending) {
// If we have pending requests and a socket gets closed a new one
// needs to be created to take over in the pool for the one that closed.
this.createSocket(pending, function(socket) {
pending.request.onSocket(socket);
});
}
};
function createSecureSocket(options, cb) {
var self = this;
TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
var hostHeader = options.request.getHeader('host');
var tlsOptions = mergeOptions({}, self.options, {
socket: socket,
servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
});
// 0 is dummy port for v0.6
var secureSocket = tls.connect(0, tlsOptions);
self.sockets[self.sockets.indexOf(socket)] = secureSocket;
cb(secureSocket);
});
}
function toOptions(host, port, localAddress) {
if (typeof host === 'string') { // since v0.10
return {
host: host,
port: port,
localAddress: localAddress
};
}
return host; // for v0.11 or later
}
function mergeOptions(target) {
for (var i = 1, len = arguments.length; i < len; ++i) {
var overrides = arguments[i];
if (typeof overrides === 'object') {
var keys = Object.keys(overrides);
for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
var k = keys[j];
if (overrides[k] !== undefined) {
target[k] = overrides[k];
}
}
}
}
return target;
}
var debug;
if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
debug = function() {
var args = Array.prototype.slice.call(arguments);
if (typeof args[0] === 'string') {
args[0] = 'TUNNEL: ' + args[0];
} else {
args.unshift('TUNNEL:');
}
console.error.apply(console, args);
}
} else {
debug = function() {};
}
exports.debug = debug; // for test
/***/ }),
/***/ 143:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = withAuthorizationPrefix;
const atob = __webpack_require__(368);
const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
function withAuthorizationPrefix(authorization) {
if (/^(basic|bearer|token) /i.test(authorization)) {
return authorization;
}
try {
if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
return `basic ${authorization}`;
}
} catch (error) {}
if (authorization.split(/\./).length === 3) {
return `bearer ${authorization}`;
}
return `token ${authorization}`;
}
/***/ }),
/***/ 145:
/***/ (function(module, __unusedexports, __webpack_require__) {
"use strict";
const pump = __webpack_require__(453);
const bufferStream = __webpack_require__(966);
class MaxBufferError extends Error {
constructor() {
super('maxBuffer exceeded');
this.name = 'MaxBufferError';
}
}
function getStream(inputStream, options) {
if (!inputStream) {
return Promise.reject(new Error('Expected a stream'));
}
options = Object.assign({maxBuffer: Infinity}, options);
const {maxBuffer} = options;
let stream;
return new Promise((resolve, reject) => {
const rejectPromise = error => {
if (error) { // A null check
error.bufferedData = stream.getBufferedValue();
}
reject(error);
};
stream = pump(inputStream, bufferStream(options), error => {
if (error) {
rejectPromise(error);
return;
}
resolve();
});
stream.on('data', () => {
if (stream.getBufferedLength() > maxBuffer) {
rejectPromise(new MaxBufferError());
}
});
}).then(() => stream.getBufferedValue());
}
module.exports = getStream;
module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
module.exports.MaxBufferError = MaxBufferError;
/***/ }),
/***/ 148:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = paginatePlugin;
const { paginateRest } = __webpack_require__(299);
function paginatePlugin(octokit) {
Object.assign(octokit, paginateRest(octokit));
}
/***/ }),
/***/ 163:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs = __importStar(__webpack_require__(747));
function file_exists(file_path) {
if (!fs.existsSync(file_path)) {
return false;
}
const st = fs.statSync(file_path);
return st.isFile();
}
exports.file_exists = file_exists;
function folder_exists(folder_path) {
if (!fs.existsSync(folder_path)) {
return false;
}
const st = fs.statSync(folder_path);
return st.isDirectory();
}
exports.folder_exists = folder_exists;
function splitcommas(name) {
return name
.split(',')
.map(function (path) {
return path.trim();
})
.filter(name => name.length > 0);
}
exports.splitcommas = splitcommas;
function __only_unique__(value, index, self) {
return self.indexOf(value) === index;
}
function unique(values) {
return values.filter(__only_unique__);
}
exports.unique = unique;
/***/ }),
/***/ 168:
/***/ (function(module) {
"use strict";
const alias = ['stdin', 'stdout', 'stderr'];
const hasAlias = opts => alias.some(x => Boolean(opts[x]));
module.exports = opts => {
if (!opts) {
return null;
}
if (opts.stdio && hasAlias(opts)) {
throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
}
if (typeof opts.stdio === 'string') {
return opts.stdio;
}
const stdio = opts.stdio || [];
if (!Array.isArray(stdio)) {
throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
}
const result = [];
const len = Math.max(stdio.length, alias.length);
for (let i = 0; i < len; i++) {
let value = null;
if (stdio[i] !== undefined) {
value = stdio[i];
} else if (opts[alias[i]] !== undefined) {
value = opts[alias[i]];
}
result[i] = value;
}
return result;
};
/***/ }),
/***/ 190:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = authenticationPlugin;
const { createTokenAuth } = __webpack_require__(813);
const { Deprecation } = __webpack_require__(692);
const once = __webpack_require__(969);
const beforeRequest = __webpack_require__(863);
const requestError = __webpack_require__(293);
const validate = __webpack_require__(954);
const withAuthorizationPrefix = __webpack_require__(143);
const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
function authenticationPlugin(octokit, options) {
// If `options.authStrategy` is set then use it and pass in `options.auth`
if (options.authStrategy) {
const auth = options.authStrategy(options.auth);
octokit.hook.wrap("request", auth.hook);
octokit.auth = auth;
return;
}
// If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
// is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
if (!options.auth) {
octokit.auth = () =>
Promise.resolve({
type: "unauthenticated"
});
return;
}
const isBasicAuthString =
typeof options.auth === "string" &&
/^basic/.test(withAuthorizationPrefix(options.auth));
// If only `options.auth` is set to a string, use the default token authentication strategy.
if (typeof options.auth === "string" && !isBasicAuthString) {
const auth = createTokenAuth(options.auth);
octokit.hook.wrap("request", auth.hook);
octokit.auth = auth;
return;
}
// Otherwise log a deprecation message
const [deprecationMethod, deprecationMessapge] = isBasicAuthString
? [
deprecateAuthBasic,
'Setting the "new Octokit({ auth })" option to a Basic Auth string is deprecated. Use https://github.com/octokit/auth-basic.js instead. See (https://octokit.github.io/rest.js/#authentication)'
]
: [
deprecateAuthObject,
'Setting the "new Octokit({ auth })" option to an object without also setting the "authStrategy" option is deprecated and will be removed in v17. See (https://octokit.github.io/rest.js/#authentication)'
];
deprecationMethod(
octokit.log,
new Deprecation("[@octokit/rest] " + deprecationMessapge)
);
octokit.auth = () =>
Promise.resolve({
type: "deprecated",
message: deprecationMessapge
});
validate(options.auth);
const state = {
octokit,
auth: options.auth
};
octokit.hook.before("request", beforeRequest.bind(null, state));
octokit.hook.error("request", requestError.bind(null, state));
}
/***/ }),
/***/ 197:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = isexe
isexe.sync = sync
var fs = __webpack_require__(747)
function isexe (path, options, cb) {
fs.stat(path, function (er, stat) {
cb(er, er ? false : checkStat(stat, options))
})
}
function sync (path, options) {
return checkStat(fs.statSync(path), options)
}
function checkStat (stat, options) {
return stat.isFile() && checkMode(stat, options)
}
function checkMode (stat, options) {
var mod = stat.mode
var uid = stat.uid
var gid = stat.gid
var myUid = options.uid !== undefined ?
options.uid : process.getuid && process.getuid()
var myGid = options.gid !== undefined ?
options.gid : process.getgid && process.getgid()
var u = parseInt('100', 8)
var g = parseInt('010', 8)
var o = parseInt('001', 8)
var ug = u | g
var ret = (mod & o) ||
(mod & g) && gid === myGid ||
(mod & u) && uid === myUid ||
(mod & ug) && myUid === 0
return ret
}
/***/ }),
/***/ 211:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var osName = _interopDefault(__webpack_require__(2));
function getUserAgent() {
try {
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
} catch (error) {
if (/wmic os get Caption/.test(error.message)) {
return "Windows <version undetectable>";
}
return "<environment undetectable>";
}
}
exports.getUserAgent = getUserAgent;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 215:
/***/ (function(module) {
module.exports = {"_args":[["@octokit/rest@16.43.1","/Users/gabrielfalcao/projects/personal/pyenv-action"]],"_from":"@octokit/rest@16.43.1","_id":"@octokit/rest@16.43.1","_inBundle":false,"_integrity":"sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==","_location":"/@octokit/rest","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"@octokit/rest@16.43.1","name":"@octokit/rest","escapedName":"@octokit%2frest","scope":"@octokit","rawSpec":"16.43.1","saveSpec":null,"fetchSpec":"16.43.1"},"_requiredBy":["/@actions/github"],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.43.1.tgz","_spec":"16.43.1","_where":"/Users/gabrielfalcao/projects/personal/pyenv-action","author":{"name":"Gregor Martynus","url":"https://github.com/gr2m"},"bugs":{"url":"https://github.com/octokit/rest.js/issues"},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"dependencies":{"@octokit/auth-token":"^2.4.0","@octokit/plugin-paginate-rest":"^1.1.1","@octokit/plugin-request-log":"^1.0.0","@octokit/plugin-rest-endpoint-methods":"2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"description":"GitHub REST API client for Node.js","devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/auth":"^1.1.1","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^13.1.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.1.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^4.0.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","lolex":"^5.1.2","mkdirp":"^1.0.0","mocha":"^7.0.1","mustache":"^4.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^15.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^17.0.0","sinon":"^8.0.0","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"files":["index.js","index.d.ts","lib","plugins"],"homepage":"https://github.com/octokit/rest.js#readme","keywords":["octokit","github","rest","api-client"],"license":"MIT","name":"@octokit/rest","nyc":{"ignore":["test"]},"publishConfig":{"access":"public"},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"repository":{"type":"git","url":"git+https://github.com/octokit/rest.js.git"},"scripts":{"build":"npm-run-all build:*","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","build:ts":"npm run -s update-endpoints:typescript","coverage":"nyc report --reporter=html && open coverage/index.html","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","prebuild:browser":"mkdirp dist/","pretest":"npm run -s lint","prevalidate:ts":"npm run -s build:ts","start-fixtures-server":"octokit-fixtures-server","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:typescript":"node scripts/update-endpoints/typescript","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts"},"types":"index.d.ts","version":"16.43.1"};
/***/ }),
/***/ 260:
/***/ (function(module, __unusedexports, __webpack_require__) {
// Note: since nyc uses this module to output coverage, any lines
// that are in the direct sync flow of nyc's outputCoverage are
// ignored, since we can never get coverage for them.
var assert = __webpack_require__(357)
var signals = __webpack_require__(654)
var EE = __webpack_require__(614)
/* istanbul ignore if */
if (typeof EE !== 'function') {
EE = EE.EventEmitter
}
var emitter
if (process.__signal_exit_emitter__) {
emitter = process.__signal_exit_emitter__
} else {
emitter = process.__signal_exit_emitter__ = new EE()
emitter.count = 0
emitter.emitted = {}
}
// Because this emitter is a global, we have to check to see if a
// previous version of this library failed to enable infinite listeners.
// I know what you're about to say. But literally everything about
// signal-exit is a compromise with evil. Get used to it.
if (!emitter.infinite) {
emitter.setMaxListeners(Infinity)
emitter.infinite = true
}
module.exports = function (cb, opts) {
assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
if (loaded === false) {
load()
}
var ev = 'exit'
if (opts && opts.alwaysLast) {
ev = 'afterexit'
}
var remove = function () {
emitter.removeListener(ev, cb)
if (emitter.listeners('exit').length === 0 &&
emitter.listeners('afterexit').length === 0) {
unload()
}
}
emitter.on(ev, cb)
return remove
}
module.exports.unload = unload
function unload () {
if (!loaded) {
return
}
loaded = false
signals.forEach(function (sig) {
try {
process.removeListener(sig, sigListeners[sig])
} catch (er) {}
})
process.emit = originalProcessEmit
process.reallyExit = originalProcessReallyExit
emitter.count -= 1
}
function emit (event, code, signal) {
if (emitter.emitted[event]) {
return
}
emitter.emitted[event] = true
emitter.emit(event, code, signal)
}
// { <signal>: <listener fn>, ... }
var sigListeners = {}
signals.forEach(function (sig) {
sigListeners[sig] = function listener () {
// If there are no other listeners, an exit is coming!
// Simplest way: remove us and then re-send the signal.
// We know that this will kill the process, so we can
// safely emit now.
var listeners = process.listeners(sig)
if (listeners.length === emitter.count) {
unload()
emit('exit', null, sig)
/* istanbul ignore next */
emit('afterexit', null, sig)
/* istanbul ignore next */
process.kill(process.pid, sig)
}
}
})
module.exports.signals = function () {
return signals
}
module.exports.load = load
var loaded = false
function load () {
if (loaded) {
return
}
loaded = true
// This is the number of onSignalExit's that are in play.
// It's important so that we can count the correct number of
// listeners on signals, and don't wait for the other one to
// handle it instead of us.
emitter.count += 1
signals = signals.filter(function (sig) {
try {
process.on(sig, sigListeners[sig])
return true
} catch (er) {
return false
}
})
process.emit = processEmit
process.reallyExit = processReallyExit
}
var originalProcessReallyExit = process.reallyExit
function processReallyExit (code) {
process.exitCode = code || 0
emit('exit', process.exitCode, null)
/* istanbul ignore next */
emit('afterexit', process.exitCode, null)
/* istanbul ignore next */
originalProcessReallyExit.call(process, process.exitCode)
}
var originalProcessEmit = process.emit
function processEmit (ev, arg) {
if (ev === 'exit') {
if (arg !== undefined) {
process.exitCode = arg
}
var ret = originalProcessEmit.apply(this, arguments)
emit('exit', process.exitCode, null)
/* istanbul ignore next */
emit('afterexit', process.exitCode, null)
return ret
} else {
return originalProcessEmit.apply(this, arguments)
}
}
/***/ }),
/***/ 262:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __webpack_require__(747);
const os_1 = __webpack_require__(87);
class Context {
/**
* Hydrate the context from the environment
*/
constructor() {
this.payload = {};
if (process.env.GITHUB_EVENT_PATH) {
if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
}
else {
const path = process.env.GITHUB_EVENT_PATH;
process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
}
}
this.eventName = process.env.GITHUB_EVENT_NAME;
this.sha = process.env.GITHUB_SHA;
this.ref = process.env.GITHUB_REF;
this.workflow = process.env.GITHUB_WORKFLOW;
this.action = process.env.GITHUB_ACTION;
this.actor = process.env.GITHUB_ACTOR;
}
get issue() {
const payload = this.payload;
return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
}
get repo() {
if (process.env.GITHUB_REPOSITORY) {
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
return { owner, repo };
}
if (this.payload.repository) {
return {
owner: this.payload.repository.owner.login,
repo: this.payload.repository.name
};
}
throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
}
}
exports.Context = Context;
//# sourceMappingURL=context.js.map
/***/ }),
/***/ 265:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = getPage
const deprecate = __webpack_require__(370)
const getPageLinks = __webpack_require__(577)
const HttpError = __webpack_require__(297)
function getPage (octokit, link, which, headers) {
deprecate(`octokit.get${which.charAt(0).toUpperCase() + which.slice(1)}Page() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
const url = getPageLinks(link)[which]
if (!url) {
const urlError = new HttpError(`No ${which} page found`, 404)
return Promise.reject(urlError)
}
const requestOptions = {
url,
headers: applyAcceptHeader(link, headers)
}
const promise = octokit.request(requestOptions)
return promise
}
function applyAcceptHeader (res, headers) {
const previous = res.headers && res.headers['x-github-media-type']
if (!previous || (headers && headers.accept)) {
return headers
}
headers = headers || {}
headers.accept = 'application/vnd.' + previous
.replace('; param=', '.')
.replace('; format=', '+')
return headers
}
/***/ }),
/***/ 280:
/***/ (function(module) {
module.exports = register
function register (state, name, method, options) {
if (typeof method !== 'function') {
throw new Error('method for before hook must be a function')
}
if (!options) {
options = {}
}
if (Array.isArray(name)) {
return name.reverse().reduce(function (callback, name) {
return register.bind(null, state, name, callback, options)
}, method)()
}
return Promise.resolve()
.then(function () {
if (!state.registry[name]) {
return method(options)
}
return (state.registry[name]).reduce(function (method, registered) {
return registered.hook.bind(null, method, options)
}, method)()
})
}
/***/ }),
/***/ 293:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = authenticationRequestError;
const { RequestError } = __webpack_require__(463);
function authenticationRequestError(state, error, options) {
if (!error.headers) throw error;
const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
// handle "2FA required" error only
if (error.status !== 401 || !otpRequired) {
throw error;
}
if (
error.status === 401 &&
otpRequired &&
error.request &&
error.request.headers["x-github-otp"]
) {
if (state.otp) {
delete state.otp; // no longer valid, request again
} else {
throw new RequestError(
"Invalid one-time password for two-factor authentication",
401,
{
headers: error.headers,
request: options
}
);
}
}
if (typeof state.auth.on2fa !== "function") {
throw new RequestError(
"2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
401,
{
headers: error.headers,
request: options
}
);
}
return Promise.resolve()
.then(() => {
return state.auth.on2fa();
})
.then(oneTimePassword => {
const newOptions = Object.assign(options, {
headers: Object.assign(options.headers, {
"x-github-otp": oneTimePassword
})
});
return state.octokit.request(newOptions).then(response => {
// If OTP still valid, then persist it for following requests
state.otp = oneTimePassword;
return response;
});
});
}
/***/ }),
/***/ 294:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = parseOptions;
const { Deprecation } = __webpack_require__(692);
const { getUserAgent } = __webpack_require__(796);
const once = __webpack_require__(969);
const pkg = __webpack_require__(215);
const deprecateOptionsTimeout = once((log, deprecation) =>
log.warn(deprecation)
);
const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
const deprecateOptionsHeaders = once((log, deprecation) =>
log.warn(deprecation)
);
function parseOptions(options, log, hook) {
if (options.headers) {
options.headers = Object.keys(options.headers).reduce((newObj, key) => {
newObj[key.toLowerCase()] = options.headers[key];
return newObj;
}, {});
}
const clientDefaults = {
headers: options.headers || {},
request: options.request || {},
mediaType: {
previews: [],
format: ""
}
};
if (options.baseUrl) {
clientDefaults.baseUrl = options.baseUrl;
}
if (options.userAgent) {
clientDefaults.headers["user-agent"] = options.userAgent;
}
if (options.previews) {
clientDefaults.mediaType.previews = options.previews;
}
if (options.timeZone) {
clientDefaults.headers["time-zone"] = options.timeZone;
}
if (options.timeout) {
deprecateOptionsTimeout(
log,
new Deprecation(
"[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
)
);
clientDefaults.request.timeout = options.timeout;
}
if (options.agent) {
deprecateOptionsAgent(
log,
new Deprecation(
"[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
)
);
clientDefaults.request.agent = options.agent;
}
if (options.headers) {
deprecateOptionsHeaders(
log,
new Deprecation(
"[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
)
);
}
const userAgentOption = clientDefaults.headers["user-agent"];
const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
.filter(Boolean)
.join(" ");
clientDefaults.request.hook = hook.bind(null, "request");
return clientDefaults;
}
/***/ }),
/***/ 297:
/***/ (function(module) {
module.exports = class HttpError extends Error {
constructor (message, code, headers) {
super(message)
// Maintains proper stack trace (only available on V8)
/* istanbul ignore next */
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor)
}
this.name = 'HttpError'
this.code = code
this.headers = headers
}
}
/***/ }),
/***/ 299:
/***/ (function(__unusedmodule, exports) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
const VERSION = "1.1.2";
/**
* Some “list” response that can be paginated have a different response structure
*
* They have a `total_count` key in the response (search also has `incomplete_results`,
* /installation/repositories also has `repository_selection`), as well as a key with
* the list of the items which name varies from endpoint to endpoint:
*
* - https://developer.github.com/v3/search/#example (key `items`)
* - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
* - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
* - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
* - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
*
* Octokit normalizes these responses so that paginated results are always returned following
* the same structure. One challenge is that if the list response has only one page, no Link
* header is provided, so this header alone is not sufficient to check wether a response is
* paginated or not. For the exceptions with the namespace, a fallback check for the route
* paths has to be added in order to normalize the response. We cannot check for the total_count
* property because it also exists in the response of Get the combined status for a specific ref.
*/
const REGEX = [/^\/search\//, /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)([^/]|$)/, /^\/installation\/repositories([^/]|$)/, /^\/user\/installations([^/]|$)/, /^\/repos\/[^/]+\/[^/]+\/actions\/secrets([^/]|$)/, /^\/repos\/[^/]+\/[^/]+\/actions\/workflows(\/[^/]+\/runs)?([^/]|$)/, /^\/repos\/[^/]+\/[^/]+\/actions\/runs(\/[^/]+\/(artifacts|jobs))?([^/]|$)/];
function normalizePaginatedListResponse(octokit, url, response) {
const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
const responseNeedsNormalization = REGEX.find(regex => regex.test(path));
if (!responseNeedsNormalization) return; // keep the additional properties intact as there is currently no other way
// to retrieve the same information.
const incompleteResults = response.data.incomplete_results;
const repositorySelection = response.data.repository_selection;
const totalCount = response.data.total_count;
delete response.data.incomplete_results;
delete response.data.repository_selection;
delete response.data.total_count;
const namespaceKey = Object.keys(response.data)[0];
const data = response.data[namespaceKey];
response.data = data;
if (typeof incompleteResults !== "undefined") {
response.data.incomplete_results = incompleteResults;
}
if (typeof repositorySelection !== "undefined") {
response.data.repository_selection = repositorySelection;
}
response.data.total_count = totalCount;
Object.defineProperty(response.data, namespaceKey, {
get() {
octokit.log.warn(`[@octokit/paginate-rest] "response.data.${namespaceKey}" is deprecated for "GET ${path}". Get the results directly from "response.data"`);
return Array.from(data);
}
});
}
function iterator(octokit, route, parameters) {
const options = octokit.request.endpoint(route, parameters);
const method = options.method;
const headers = options.headers;
let url = options.url;
return {
[Symbol.asyncIterator]: () => ({
next() {
if (!url) {
return Promise.resolve({
done: true
});
}
return octokit.request({
method,
url,
headers
}).then(response => {
normalizePaginatedListResponse(octokit, url, response); // `response.headers.link` format:
// '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
// sets `url` to undefined if "next" URL is not present or `link` header is not set
url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
return {
value: response
};
});
}
})
};
}
function paginate(octokit, route, parameters, mapFn) {
if (typeof parameters === "function") {
mapFn = parameters;
parameters = undefined;
}
return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
}
function gather(octokit, results, iterator, mapFn) {
return iterator.next().then(result => {
if (result.done) {
return results;
}
let earlyExit = false;
function done() {
earlyExit = true;
}
results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
if (earlyExit) {
return results;
}
return gather(octokit, results, iterator, mapFn);
});
}
/**
* @param octokit Octokit instance
* @param options Options passed to Octokit constructor
*/
function paginateRest(octokit) {
return {
paginate: Object.assign(paginate.bind(null, octokit), {
iterator: iterator.bind(null, octokit)
})
};
}
paginateRest.VERSION = VERSION;
exports.paginateRest = paginateRest;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 323:
/***/ (function(module) {
"use strict";
var isStream = module.exports = function (stream) {
return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
};
isStream.writable = function (stream) {
return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
};
isStream.readable = function (stream) {
return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
};
isStream.duplex = function (stream) {
return isStream.writable(stream) && isStream.readable(stream);
};
isStream.transform = function (stream) {
return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
};
/***/ }),
/***/ 336:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = hasLastPage
const deprecate = __webpack_require__(370)
const getPageLinks = __webpack_require__(577)
function hasLastPage (link) {
deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
return getPageLinks(link).last
}
/***/ }),
/***/ 348:
/***/ (function(module, __unusedexports, __webpack_require__) {
"use strict";
module.exports = validate;
const { RequestError } = __webpack_require__(463);
const get = __webpack_require__(854);
const set = __webpack_require__(883);
function validate(octokit, options) {
if (!options.request.validate) {
return;
}
const { validate: params } = options.request;
Object.keys(params).forEach(parameterName => {
const parameter = get(params, parameterName);
const expectedType = parameter.type;
let parentParameterName;
let parentValue;
let parentParamIsPresent = true;
let parentParameterIsArray = false;
if (/\./.test(parameterName)) {
parentParameterName = parameterName.replace(/\.[^.]+$/, "");
parentParameterIsArray = parentParameterName.slice(-2) === "[]";
if (parentParameterIsArray) {
parentParameterName = parentParameterName.slice(0, -2);
}
parentValue = get(options, parentParameterName);
parentParamIsPresent =
parentParameterName === "headers" ||
(typeof parentValue === "object" && parentValue !== null);
}
const values = parentParameterIsArray
? (get(options, parentParameterName) || []).map(
value => value[parameterName.split(/\./).pop()]
)
: [get(options, parameterName)];
values.forEach((value, i) => {
const valueIsPresent = typeof value !== "undefined";
const valueIsNull = value === null;
const currentParameterName = parentParameterIsArray
? parameterName.replace(/\[\]/, `[${i}]`)
: parameterName;
if (!parameter.required && !valueIsPresent) {
return;
}
// if the parent parameter is of type object but allows null
// then the child parameters can be ignored
if (!parentParamIsPresent) {
return;
}
if (parameter.allowNull && valueIsNull) {
return;
}
if (!parameter.allowNull && valueIsNull) {
throw new RequestError(
`'${currentParameterName}' cannot be null`,
400,
{
request: options
}
);
}
if (parameter.required && !valueIsPresent) {
throw new RequestError(
`Empty value for parameter '${currentParameterName}': ${JSON.stringify(
value
)}`,
400,
{
request: options
}
);
}
// parse to integer before checking for enum
// so that string "1" will match enum with number 1
if (expectedType === "integer") {
const unparsedValue = value;
value = parseInt(value, 10);
if (isNaN(value)) {
throw new RequestError(
`Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
unparsedValue
)} is NaN`,
400,
{
request: options
}
);
}
}
if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
throw new RequestError(
`Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
value
)}`,
400,
{
request: options
}
);
}
if (parameter.validation) {
const regex = new RegExp(parameter.validation);
if (!regex.test(value)) {
throw new RequestError(
`Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
value
)}`,
400,
{
request: options
}
);
}
}
if (expectedType === "object" && typeof value === "string") {
try {
value = JSON.parse(value);
} catch (exception) {
throw new RequestError(
`JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
value
)}`,
400,
{
request: options
}
);
}
}
set(options, parameter.mapTo || currentParameterName, value);
});
});
return options;
}
/***/ }),
/***/ 349:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = authenticationRequestError;
const { RequestError } = __webpack_require__(463);
function authenticationRequestError(state, error, options) {
/* istanbul ignore next */
if (!error.headers) throw error;
const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
// handle "2FA required" error only
if (error.status !== 401 || !otpRequired) {
throw error;
}
if (
error.status === 401 &&
otpRequired &&
error.request &&
error.request.headers["x-github-otp"]
) {
throw new RequestError(
"Invalid one-time password for two-factor authentication",
401,
{
headers: error.headers,
request: options
}
);
}
if (typeof state.auth.on2fa !== "function") {
throw new RequestError(
"2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
401,
{
headers: error.headers,
request: options
}
);
}
return Promise.resolve()
.then(() => {
return state.auth.on2fa();
})
.then(oneTimePassword => {
const newOptions = Object.assign(options, {
headers: Object.assign(
{ "x-github-otp": oneTimePassword },
options.headers
)
});
return state.octokit.request(newOptions);
});
}
/***/ }),
/***/ 357:
/***/ (function(module) {
module.exports = require("assert");
/***/ }),
/***/ 368:
/***/ (function(module) {
module.exports = function atob(str) {
return Buffer.from(str, 'base64').toString('binary')
}
/***/ }),
/***/ 370:
/***/ (function(module) {
module.exports = deprecate
const loggedMessages = {}
function deprecate (message) {
if (loggedMessages[message]) {
return
}
console.warn(`DEPRECATED (@octokit/rest): ${message}`)
loggedMessages[message] = 1
}
/***/ }),
/***/ 385:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var isPlainObject = _interopDefault(__webpack_require__(696));
var universalUserAgent = __webpack_require__(562);
function lowercaseKeys(object) {
if (!object) {
return {};
}
return Object.keys(object).reduce((newObj, key) => {
newObj[key.toLowerCase()] = object[key];
return newObj;
}, {});
}
function mergeDeep(defaults, options) {
const result = Object.assign({}, defaults);
Object.keys(options).forEach(key => {
if (isPlainObject(options[key])) {
if (!(key in defaults)) Object.assign(result, {
[key]: options[key]
});else result[key] = mergeDeep(defaults[key], options[key]);
} else {
Object.assign(result, {
[key]: options[key]
});
}
});
return result;
}
function merge(defaults, route, options) {
if (typeof route === "string") {
let [method, url] = route.split(" ");
options = Object.assign(url ? {
method,
url
} : {
url: method
}, options);
} else {
options = Object.assign({}, route);
} // lowercase header names before merging with defaults to avoid duplicates
options.headers = lowercaseKeys(options.headers);
const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
if (defaults && defaults.mediaType.previews.length) {
mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
}
mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
return mergedOptions;
}
function addQueryParameters(url, parameters) {
const separator = /\?/.test(url) ? "&" : "?";
const names = Object.keys(parameters);
if (names.length === 0) {
return url;
}
return url + separator + names.map(name => {
if (name === "q") {
return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
}
return `${name}=${encodeURIComponent(parameters[name])}`;
}).join("&");
}
const urlVariableRegex = /\{[^}]+\}/g;
function removeNonChars(variableName) {
return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
}
function extractUrlVariableNames(url) {
const matches = url.match(urlVariableRegex);
if (!matches) {
return [];
}
return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
}
function omit(object, keysToOmit) {
return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
obj[key] = object[key];
return obj;
}, {});
}
// Based on https://github.com/bramstein/url-template, licensed under BSD
// TODO: create separate package.
//
// Copyright (c) 2012-2014, Bram Stein
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. The name of the author may not be used to endorse or promote products
// derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* istanbul ignore file */
function encodeReserved(str) {
return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
if (!/%[0-9A-Fa-f]/.test(part)) {
part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
}
return part;
}).join("");
}
function encodeUnreserved(str) {
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
});
}
function encodeValue(operator, value, key) {
value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
if (key) {
return encodeUnreserved(key) + "=" + value;
} else {
return value;
}
}
function isDefined(value) {
return value !== undefined && value !== null;
}
function isKeyOperator(operator) {
return operator === ";" || operator === "&" || operator === "?";
}
function getValues(context, operator, key, modifier) {
var value = context[key],
result = [];
if (isDefined(value) && value !== "") {
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
value = value.toString();
if (modifier && modifier !== "*") {
value = value.substring(0, parseInt(modifier, 10));
}
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
} else {
if (modifier === "*") {
if (Array.isArray(value)) {
value.filter(isDefined).forEach(function (value) {
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
});
} else {
Object.keys(value).forEach(function (k) {
if (isDefined(value[k])) {
result.push(encodeValue(operator, value[k], k));
}
});
}
} else {
const tmp = [];
if (Array.isArray(value)) {
value.filter(isDefined).forEach(function (value) {
tmp.push(encodeValue(operator, value));
});
} else {
Object.keys(value).forEach(function (k) {
if (isDefined(value[k])) {
tmp.push(encodeUnreserved(k));
tmp.push(encodeValue(operator, value[k].toString()));
}
});
}
if (isKeyOperator(operator)) {
result.push(encodeUnreserved(key) + "=" + tmp.join(","));
} else if (tmp.length !== 0) {
result.push(tmp.join(","));
}
}
}
} else {
if (operator === ";") {
if (isDefined(value)) {
result.push(encodeUnreserved(key));
}
} else if (value === "" && (operator === "&" || operator === "?")) {
result.push(encodeUnreserved(key) + "=");
} else if (value === "") {
result.push("");
}
}
return result;
}
function parseUrl(template) {
return {
expand: expand.bind(null, template)
};
}
function expand(template, context) {
var operators = ["+", "#", ".", "/", ";", "?", "&"];
return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
if (expression) {
let operator = "";
const values = [];
if (operators.indexOf(expression.charAt(0)) !== -1) {
operator = expression.charAt(0);
expression = expression.substr(1);
}
expression.split(/,/g).forEach(function (variable) {
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
});
if (operator && operator !== "+") {
var separator = ",";
if (operator === "?") {
separator = "&";
} else if (operator !== "#") {
separator = operator;
}
return (values.length !== 0 ? operator : "") + values.join(separator);
} else {
return values.join(",");
}
} else {
return encodeReserved(literal);
}
});
}
function parse(options) {
// https://fetch.spec.whatwg.org/#methods
let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
let headers = Object.assign({}, options.headers);
let body;
let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
const urlVariableNames = extractUrlVariableNames(url);
url = parseUrl(url).expand(parameters);
if (!/^http/.test(url)) {
url = options.baseUrl + url;
}
const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
const remainingParameters = omit(parameters, omittedParameters);
const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
if (!isBinaryRequset) {
if (options.mediaType.format) {
// e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
}
if (options.mediaType.previews.length) {
const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
return `application/vnd.github.${preview}-preview${format}`;
}).join(",");
}
} // for GET/HEAD requests, set URL query parameters from remaining parameters
// for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
if (["GET", "HEAD"].includes(method)) {
url = addQueryParameters(url, remainingParameters);
} else {
if ("data" in remainingParameters) {
body = remainingParameters.data;
} else {
if (Object.keys(remainingParameters).length) {
body = remainingParameters;
} else {
headers["content-length"] = 0;
}
}
} // default content-type for JSON if body is set
if (!headers["content-type"] && typeof body !== "undefined") {
headers["content-type"] = "application/json; charset=utf-8";
} // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
// fetch does not allow to set `content-length` header, but we can set body to an empty string
if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
body = "";
} // Only return body/request keys if present
return Object.assign({
method,
url,
headers
}, typeof body !== "undefined" ? {
body
} : null, options.request ? {
request: options.request
} : null);
}
function endpointWithDefaults(defaults, route, options) {
return parse(merge(defaults, route, options));
}
function withDefaults(oldDefaults, newDefaults) {
const DEFAULTS = merge(oldDefaults, newDefaults);
const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
return Object.assign(endpoint, {
DEFAULTS,
defaults: withDefaults.bind(null, DEFAULTS),
merge: merge.bind(null, DEFAULTS),
parse
});
}
const VERSION = "5.5.3";
const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
// So we use RequestParameters and add method as additional required property.
const DEFAULTS = {
method: "GET",
baseUrl: "https://api.github.com",
headers: {
accept: "application/vnd.github.v3+json",
"user-agent": userAgent
},
mediaType: {
format: "",
previews: []
}
};
const endpoint = withDefaults(null, DEFAULTS);
exports.endpoint = endpoint;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 389:
/***/ (function(module, __unusedexports, __webpack_require__) {
"use strict";
const fs = __webpack_require__(747);
const shebangCommand = __webpack_require__(866);
function readShebang(command) {
// Read the first 150 bytes from the file
const size = 150;
let buffer;
if (Buffer.alloc) {
// Node.js v4.5+ / v5.10+
buffer = Buffer.alloc(size);
} else {
// Old Node.js API
buffer = new Buffer(size);
buffer.fill(0); // zero-fill
}
let fd;
try {
fd = fs.openSync(command, 'r');
fs.readSync(fd, buffer, 0, size, 0);
fs.closeSync(fd);
} catch (e) { /* Empty */ }
// Attempt to extract shebang (null is returned if not a shebang)
return shebangCommand(buffer.toString());
}
module.exports = readShebang;
/***/ }),
/***/ 402:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = Octokit;
const { request } = __webpack_require__(753);
const Hook = __webpack_require__(523);
const parseClientOptions = __webpack_require__(294);
function Octokit(plugins, options) {
options = options || {};
const hook = new Hook.Collection();
const log = Object.assign(
{
debug: () => {},
info: () => {},
warn: console.warn,
error: console.error
},
options && options.log
);
const api = {
hook,
log,
request: request.defaults(parseClientOptions(options, log, hook))
};
plugins.forEach(pluginFunction => pluginFunction(api, options));
return api;
}
/***/ }),
/***/ 413:
/***/ (function(module) {
module.exports = require("stream");
/***/ }),
/***/ 417:
/***/ (function(module) {
module.exports = require("crypto");
/***/ }),
/***/ 427:
/***/ (function(module, __unusedexports, __webpack_require__) {
"use strict";
// Older verions of Node.js might not have `util.getSystemErrorName()`.
// In that case, fall back to a deprecated internal.
const util = __webpack_require__(669);
let uv;
if (typeof util.getSystemErrorName === 'function') {
module.exports = util.getSystemErrorName;
} else {
try {
uv = process.binding('uv');
if (typeof uv.errname !== 'function') {
throw new TypeError('uv.errname is not a function');
}
} catch (err) {
console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
uv = null;
}
module.exports = code => errname(uv, code);
}
// Used for testing the fallback behavior
module.exports.__test__ = errname;
function errname(uv, code) {
if (uv) {
return uv.errname(code);
}
if (!(code < 0)) {
throw new Error('err >= 0');
}
return `Unknown system error ${code}`;
}
/***/ }),
/***/ 430:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = octokitValidate;
const validate = __webpack_require__(348);
function octokitValidate(octokit) {
octokit.hook.before("request", validate.bind(null, octokit));
}
/***/ }),
/***/ 431:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const os = __importStar(__webpack_require__(87));
/**
* Commands
*
* Command Format:
* ::name key=value,key=value::message
*
* Examples:
* ::warning::This is the message
* ::set-env name=MY_VAR::some value
*/
function issueCommand(command, properties, message) {
const cmd = new Command(command, properties, message);
process.stdout.write(cmd.toString() + os.EOL);
}
exports.issueCommand = issueCommand;
function issue(name, message = '') {
issueCommand(name, {}, message);
}
exports.issue = issue;
const CMD_STRING = '::';
class Command {
constructor(command, properties, message) {
if (!command) {
command = 'missing.command';
}
this.command = command;
this.properties = properties;
this.message = message;
}
toString() {
let cmdStr = CMD_STRING + this.command;
if (this.properties && Object.keys(this.properties).length > 0) {
cmdStr += ' ';
let first = true;
for (const key in this.properties) {
if (this.properties.hasOwnProperty(key)) {
const val = this.properties[key];
if (val) {
if (first) {
first = false;
}
else {
cmdStr += ',';
}
cmdStr += `${key}=${escapeProperty(val)}`;
}
}
}
}
cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
return cmdStr;
}
}
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
function toCommandValue(input) {
if (input === null || input === undefined) {
return '';
}
else if (typeof input === 'string' || input instanceof String) {
return input;
}
return JSON.stringify(input);
}
exports.toCommandValue = toCommandValue;
function escapeData(s) {
return toCommandValue(s)
.replace(/%/g, '%25')
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A');
}
function escapeProperty(s) {
return toCommandValue(s)
.replace(/%/g, '%25')
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A')
.replace(/:/g, '%3A')
.replace(/,/g, '%2C');
}
//# sourceMappingURL=command.js.map
/***/ }),
/***/ 453:
/***/ (function(module, __unusedexports, __webpack_require__) {
var once = __webpack_require__(969)
var eos = __webpack_require__(9)
var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
var noop = function () {}
var ancient = /^v?\.0/.test(process.version)
var isFn = function (fn) {
return typeof fn === 'function'
}
var isFS = function (stream) {
if (!ancient) return false // newer node version do not need to care about fs is a special way
if (!fs) return false // browser
return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
}
var isRequest = function (stream) {
return stream.setHeader && isFn(stream.abort)
}
var destroyer = function (stream, reading, writing, callback) {
callback = once(callback)
var closed = false
stream.on('close', function () {
closed = true
})
eos(stream, {readable: reading, writable: writing}, function (err) {
if (err) return callback(err)
closed = true
callback()
})
var destroyed = false
return function (err) {
if (closed) return
if (destroyed) return
destroyed = true
if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
if (isFn(stream.destroy)) return stream.destroy()
callback(err || new Error('stream was destroyed'))
}
}
var call = function (fn) {
fn()
}
var pipe = function (from, to) {
return from.pipe(to)
}
var pump = function () {
var streams = Array.prototype.slice.call(arguments)
var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
if (Array.isArray(streams[0])) streams = streams[0]
if (streams.length < 2) throw new Error('pump requires two streams per minimum')
var error
var destroys = streams.map(function (stream, i) {
var reading = i < streams.length - 1
var writing = i > 0
return destroyer(stream, reading, writing, function (err) {
if (!error) error = err
if (err) destroys.forEach(call)
if (reading) return
destroys.forEach(call)
callback(error)
})
})
return streams.reduce(pipe)
}
module.exports = pump
/***/ }),
/***/ 454:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var Stream = _interopDefault(__webpack_require__(413));
var http = _interopDefault(__webpack_require__(605));
var Url = _interopDefault(__webpack_require__(835));
var https = _interopDefault(__webpack_require__(34));
var zlib = _interopDefault(__webpack_require__(761));
// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
// fix for "Readable" isn't a named export issue
const Readable = Stream.Readable;
const BUFFER = Symbol('buffer');
const TYPE = Symbol('type');
class Blob {
constructor() {
this[TYPE] = '';
const blobParts = arguments[0];
const options = arguments[1];
const buffers = [];
let size = 0;
if (blobParts) {
const a = blobParts;
const length = Number(a.length);
for (let i = 0; i < length; i++) {
const element = a[i];
let buffer;
if (element instanceof Buffer) {
buffer = element;
} else if (ArrayBuffer.isView(element)) {
buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
} else if (element instanceof ArrayBuffer) {
buffer = Buffer.from(element);
} else if (element instanceof Blob) {
buffer = element[BUFFER];
} else {
buffer = Buffer.from(typeof element === 'string' ? element : String(element));
}
size += buffer.length;
buffers.push(buffer);
}
}
this[BUFFER] = Buffer.concat(buffers);
let type = options && options.type !== undefined && String(options.type).toLowerCase();
if (type && !/[^\u0020-\u007E]/.test(type)) {
this[TYPE] = type;
}
}
get size() {
return this[BUFFER].length;
}
get type() {
return this[TYPE];
}
text() {
return Promise.resolve(this[BUFFER].toString());
}
arrayBuffer() {
const buf = this[BUFFER];
const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
return Promise.resolve(ab);
}
stream() {
const readable = new Readable();
readable._read = function () {};
readable.push(this[BUFFER]);
readable.push(null);
return readable;
}
toString() {
return '[object Blob]';
}
slice() {
const size = this.size;
const start = arguments[0];
const end = arguments[1];
let relativeStart, relativeEnd;
if (start === undefined) {
relativeStart = 0;
} else if (start < 0) {
relativeStart = Math.max(size + start, 0);
} else {
relativeStart = Math.min(start, size);
}
if (end === undefined) {
relativeEnd = size;
} else if (end < 0) {
relativeEnd = Math.max(size + end, 0);
} else {
relativeEnd = Math.min(end, size);
}
const span = Math.max(relativeEnd - relativeStart, 0);
const buffer = this[BUFFER];
const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
const blob = new Blob([], { type: arguments[2] });
blob[BUFFER] = slicedBuffer;
return blob;
}
}
Object.defineProperties(Blob.prototype, {
size: { enumerable: true },
type: { enumerable: true },
slice: { enumerable: true }
});
Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
value: 'Blob',
writable: false,
enumerable: false,
configurable: true
});
/**
* fetch-error.js
*
* FetchError interface for operational errors
*/
/**
* Create FetchError instance
*
* @param String message Error message for human
* @param String type Error type for machine
* @param String systemError For Node.js system error
* @return FetchError
*/
function FetchError(message, type, systemError) {
Error.call(this, message);
this.message = message;
this.type = type;
// when err.type is `system`, err.code contains system error code
if (systemError) {
this.code = this.errno = systemError.code;
}
// hide custom error implementation details from end-users
Error.captureStackTrace(this, this.constructor);
}
FetchError.prototype = Object.create(Error.prototype);
FetchError.prototype.constructor = FetchError;
FetchError.prototype.name = 'FetchError';
let convert;
try {
convert = __webpack_require__(18).convert;
} catch (e) {}
const INTERNALS = Symbol('Body internals');
// fix an issue where "PassThrough" isn't a named export for node <10
const PassThrough = Stream.PassThrough;
/**
* Body mixin
*
* Ref: https://fetch.spec.whatwg.org/#body
*
* @param Stream body Readable stream
* @param Object opts Response options
* @return Void
*/
function Body(body) {
var _this = this;
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref$size = _ref.size;
let size = _ref$size === undefined ? 0 : _ref$size;
var _ref$timeout = _ref.timeout;
let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
if (body == null) {
// body is undefined or null
body = null;
} else if (isURLSearchParams(body)) {
// body is a URLSearchParams
body = Buffer.from(body.toString());
} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
// body is ArrayBuffer
body = Buffer.from(body);
} else if (ArrayBuffer.isView(body)) {
// body is ArrayBufferView
body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
} else if (body instanceof Stream) ; else {
// none of the above
// coerce to string then buffer
body = Buffer.from(String(body));
}
this[INTERNALS] = {
body,
disturbed: false,
error: null
};
this.size = size;
this.timeout = timeout;
if (body instanceof Stream) {
body.on('error', function (err) {
const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
_this[INTERNALS].error = error;
});
}
}
Body.prototype = {
get body() {
return this[INTERNALS].body;
},
get bodyUsed() {
return this[INTERNALS].disturbed;
},
/**
* Decode response as ArrayBuffer
*
* @return Promise
*/
arrayBuffer() {
return consumeBody.call(this).then(function (buf) {
return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
});
},
/**
* Return raw response as Blob
*
* @return Promise
*/
blob() {
let ct = this.headers && this.headers.get('content-type') || '';
return consumeBody.call(this).then(function (buf) {
return Object.assign(
// Prevent copying
new Blob([], {
type: ct.toLowerCase()
}), {
[BUFFER]: buf
});
});
},
/**
* Decode response as json
*
* @return Promise
*/
json() {
var _this2 = this;
return consumeBody.call(this).then(function (buffer) {
try {
return JSON.parse(buffer.toString());
} catch (err) {
return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
}
});
},
/**
* Decode response as text
*
* @return Promise
*/
text() {
return consumeBody.call(this).then(function (buffer) {
return buffer.toString();
});
},
/**
* Decode response as buffer (non-spec api)
*
* @return Promise
*/
buffer() {
return consumeBody.call(this);
},
/**
* Decode response as text, while automatically detecting the encoding and
* trying to decode to UTF-8 (non-spec api)
*
* @return Promise
*/
textConverted() {
var _this3 = this;
return consumeBody.call(this).then(function (buffer) {
return convertBody(buffer, _this3.headers);
});
}
};
// In browsers, all properties are enumerable.
Object.defineProperties(Body.prototype, {
body: { enumerable: true },
bodyUsed: { enumerable: true },
arrayBuffer: { enumerable: true },
blob: { enumerable: true },
json: { enumerable: true },
text: { enumerable: true }
});
Body.mixIn = function (proto) {
for (const name of Object.getOwnPropertyNames(Body.prototype)) {
// istanbul ignore else: future proof
if (!(name in proto)) {
const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
Object.defineProperty(proto, name, desc);
}
}
};
/**
* Consume and convert an entire Body to a Buffer.
*
* Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
*
* @return Promise
*/
function consumeBody() {
var _this4 = this;
if (this[INTERNALS].disturbed) {
return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
}
this[INTERNALS].disturbed = true;
if (this[INTERNALS].error) {
return Body.Promise.reject(this[INTERNALS].error);
}
let body = this.body;
// body is null
if (body === null) {
return Body.Promise.resolve(Buffer.alloc(0));
}
// body is blob
if (isBlob(body)) {
body = body.stream();
}
// body is buffer
if (Buffer.isBuffer(body)) {
return Body.Promise.resolve(body);
}
// istanbul ignore if: should never happen
if (!(body instanceof Stream)) {
return Body.Promise.resolve(Buffer.alloc(0));
}
// body is stream
// get ready to actually consume the body
let accum = [];
let accumBytes = 0;
let abort = false;
return new Body.Promise(function (resolve, reject) {
let resTimeout;
// allow timeout on slow response body
if (_this4.timeout) {
resTimeout = setTimeout(function () {
abort = true;
reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
}, _this4.timeout);
}
// handle stream errors
body.on('error', function (err) {
if (err.name === 'AbortError') {
// if the request was aborted, reject with this Error
abort = true;
reject(err);
} else {
// other errors, such as incorrect content-encoding
reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
}
});
body.on('data', function (chunk) {
if (abort || chunk === null) {
return;
}
if (_this4.size && accumBytes + chunk.length > _this4.size) {
abort = true;
reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
return;
}
accumBytes += chunk.length;
accum.push(chunk);
});
body.on('end', function () {
if (abort) {
return;
}
clearTimeout(resTimeout);
try {
resolve(Buffer.concat(accum, accumBytes));
} catch (err) {
// handle streams that have accumulated too much data (issue #414)
reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
}
});
});
}
/**
* Detect buffer encoding and convert to target encoding
* ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
*
* @param Buffer buffer Incoming buffer
* @param String encoding Target encoding
* @return String
*/
function convertBody(buffer, headers) {
if (typeof convert !== 'function') {
throw new Error('The package `encoding` must be installed to use the textConverted() function');
}
const ct = headers.get('content-type');
let charset = 'utf-8';
let res, str;
// header
if (ct) {
res = /charset=([^;]*)/i.exec(ct);
}
// no charset in content type, peek at response body for at most 1024 bytes
str = buffer.slice(0, 1024).toString();
// html5
if (!res && str) {
res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
}
// html4
if (!res && str) {
res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
if (res) {
res = /charset=(.*)/i.exec(res.pop());
}
}
// xml
if (!res && str) {
res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
}
// found charset
if (res) {
charset = res.pop();
// prevent decode issues when sites use incorrect encoding
// ref: https://hsivonen.fi/encoding-menu/
if (charset === 'gb2312' || charset === 'gbk') {
charset = 'gb18030';
}
}
// turn raw buffers into a single utf-8 buffer
return convert(buffer, 'UTF-8', charset).toString();
}
/**
* Detect a URLSearchParams object
* ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
*
* @param Object obj Object to detect by type or brand
* @return String
*/
function isURLSearchParams(obj) {
// Duck-typing as a necessary condition.
if (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {
return false;
}
// Brand-checking and more duck-typing as optional condition.
return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
}
/**
* Check if `obj` is a W3C `Blob` object (which `File` inherits from)
* @param {*} obj
* @return {boolean}
*/
function isBlob(obj) {
return typeof obj === 'object' && typeof obj.arrayBuffer === 'function' && typeof obj.type === 'string' && typeof obj.stream === 'function' && typeof obj.constructor === 'function' && typeof obj.constructor.name === 'string' && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);
}
/**
* Clone body given Res/Req instance
*
* @param Mixed instance Response or Request instance
* @return Mixed
*/
function clone(instance) {
let p1, p2;
let body = instance.body;
// don't allow cloning a used body
if (instance.bodyUsed) {
throw new Error('cannot clone body after it is used');
}
// check that body is a stream and not form-data object
// note: we can't clone the form-data object without having it as a dependency
if (body instanceof Stream && typeof body.getBoundary !== 'function') {
// tee instance body
p1 = new PassThrough();
p2 = new PassThrough();
body.pipe(p1);
body.pipe(p2);
// set instance body to teed body and return the other teed body
instance[INTERNALS].body = p1;
body = p2;
}
return body;
}
/**
* Performs the operation "extract a `Content-Type` value from |object|" as
* specified in the specification:
* https://fetch.spec.whatwg.org/#concept-bodyinit-extract
*
* This function assumes that instance.body is present.
*
* @param Mixed instance Any options.body input
*/
function extractContentType(body) {
if (body === null) {
// body is null
return null;
} else if (typeof body === 'string') {
// body is string
return 'text/plain;charset=UTF-8';
} else if (isURLSearchParams(body)) {
// body is a URLSearchParams
return 'application/x-www-form-urlencoded;charset=UTF-8';
} else if (isBlob(body)) {
// body is blob
return body.type || null;
} else if (Buffer.isBuffer(body)) {
// body is buffer
return null;
} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
// body is ArrayBuffer
return null;
} else if (ArrayBuffer.isView(body)) {
// body is ArrayBufferView
return null;
} else if (typeof body.getBoundary === 'function') {
// detect form data input from form-data module
return `multipart/form-data;boundary=${body.getBoundary()}`;
} else if (body instanceof Stream) {
// body is stream
// can't really do much about this
return null;
} else {
// Body constructor defaults other things to string
return 'text/plain;charset=UTF-8';
}
}
/**
* The Fetch Standard treats this as if "total bytes" is a property on the body.
* For us, we have to explicitly get it with a function.
*
* ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
*
* @param Body instance Instance of Body
* @return Number? Number of bytes, or null if not possible
*/
function getTotalBytes(instance) {
const body = instance.body;
if (body === null) {
// body is null
return 0;
} else if (isBlob(body)) {
return body.size;
} else if (Buffer.isBuffer(body)) {
// body is buffer
return body.length;
} else if (body && typeof body.getLengthSync === 'function') {
// detect form data input from form-data module
if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
body.hasKnownLength && body.hasKnownLength()) {
// 2.x
return body.getLengthSync();
}
return null;
} else {
// body is stream
return null;
}
}
/**
* Write a Body to a Node.js WritableStream (e.g. http.Request) object.
*
* @param Body instance Instance of Body
* @return Void
*/
function writeToStream(dest, instance) {
const body = instance.body;
if (body === null) {
// body is null
dest.end();
} else if (isBlob(body)) {
body.stream().pipe(dest);
} else if (Buffer.isBuffer(body)) {
// body is buffer
dest.write(body);
dest.end();
} else {
// body is stream
body.pipe(dest);
}
}
// expose Promise
Body.Promise = global.Promise;
/**
* headers.js
*
* Headers class offers convenient helpers
*/
const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
function validateName(name) {
name = `${name}`;
if (invalidTokenRegex.test(name) || name === '') {
throw new TypeError(`${name} is not a legal HTTP header name`);
}
}
function validateValue(value) {
value = `${value}`;
if (invalidHeaderCharRegex.test(value)) {
throw new TypeError(`${value} is not a legal HTTP header value`);
}
}
/**
* Find the key in the map object given a header name.
*
* Returns undefined if not found.
*
* @param String name Header name
* @return String|Undefined
*/
function find(map, name) {
name = name.toLowerCase();
for (const key in map) {
if (key.toLowerCase() === name) {
return key;
}
}
return undefined;
}
const MAP = Symbol('map');
class Headers {
/**
* Headers class
*
* @param Object headers Response headers
* @return Void
*/
constructor() {
let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
this[MAP] = Object.create(null);
if (init instanceof Headers) {
const rawHeaders = init.raw();
const headerNames = Object.keys(rawHeaders);
for (const headerName of headerNames) {
for (const value of rawHeaders[headerName]) {
this.append(headerName, value);
}
}
return;
}
// We don't worry about converting prop to ByteString here as append()
// will handle it.
if (init == null) ; else if (typeof init === 'object') {
const method = init[Symbol.iterator];
if (method != null) {
if (typeof method !== 'function') {
throw new TypeError('Header pairs must be iterable');
}
// sequence<sequence<ByteString>>
// Note: per spec we have to first exhaust the lists then process them
const pairs = [];
for (const pair of init) {
if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
throw new TypeError('Each header pair must be iterable');
}
pairs.push(Array.from(pair));
}
for (const pair of pairs) {
if (pair.length !== 2) {
throw new TypeError('Each header pair must be a name/value tuple');
}
this.append(pair[0], pair[1]);
}
} else {
// record<ByteString, ByteString>
for (const key of Object.keys(init)) {
const value = init[key];
this.append(key, value);
}
}
} else {
throw new TypeError('Provided initializer must be an object');
}
}
/**
* Return combined header value given name
*
* @param String name Header name
* @return Mixed
*/
get(name) {
name = `${name}`;
validateName(name);
const key = find(this[MAP], name);
if (key === undefined) {
return null;
}
return this[MAP][key].join(', ');
}
/**
* Iterate over all headers
*
* @param Function callback Executed for each item with parameters (value, name, thisArg)
* @param Boolean thisArg `this` context for callback function
* @return Void
*/
forEach(callback) {
let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
let pairs = getHeaders(this);
let i = 0;
while (i < pairs.length) {
var _pairs$i = pairs[i];
const name = _pairs$i[0],
value = _pairs$i[1];
callback.call(thisArg, value, name, this);
pairs = getHeaders(this);
i++;
}
}
/**
* Overwrite header values given name
*
* @param String name Header name
* @param String value Header value
* @return Void
*/
set(name, value) {
name = `${name}`;
value = `${value}`;
validateName(name);
validateValue(value);
const key = find(this[MAP], name);
this[MAP][key !== undefined ? key : name] = [value];
}
/**
* Append a value onto existing header
*
* @param String name Header name
* @param String value Header value
* @return Void
*/
append(name, value) {
name = `${name}`;
value = `${value}`;
validateName(name);
validateValue(value);
const key = find(this[MAP], name);
if (key !== undefined) {
this[MAP][key].push(value);
} else {
this[MAP][name] = [value];
}
}
/**
* Check for header name existence
*
* @param String name Header name
* @return Boolean
*/
has(name) {
name = `${name}`;
validateName(name);
return find(this[MAP], name) !== undefined;
}
/**
* Delete all header values given name
*
* @param String name Header name
* @return Void
*/
delete(name) {
name = `${name}`;
validateName(name);
const key = find(this[MAP], name);
if (key !== undefined) {
delete this[MAP][key];
}
}
/**
* Return raw headers (non-spec api)
*
* @return Object
*/
raw() {
return this[MAP];
}
/**
* Get an iterator on keys.
*
* @return Iterator
*/
keys() {
return createHeadersIterator(this, 'key');
}
/**
* Get an iterator on values.
*
* @return Iterator
*/
values() {
return createHeadersIterator(this, 'value');
}
/**
* Get an iterator on entries.
*
* This is the default iterator of the Headers object.
*
* @return Iterator
*/
[Symbol.iterator]() {
return createHeadersIterator(this, 'key+value');
}
}
Headers.prototype.entries = Headers.prototype[Symbol.iterator];
Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
value: 'Headers',
writable: false,
enumerable: false,
configurable: true
});
Object.defineProperties(Headers.prototype, {
get: { enumerable: true },
forEach: { enumerable: true },
set: { enumerable: true },
append: { enumerable: true },
has: { enumerable: true },
delete: { enumerable: true },
keys: { enumerable: true },
values: { enumerable: true },
entries: { enumerable: true }
});
function getHeaders(headers) {
let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
const keys = Object.keys(headers[MAP]).sort();
return keys.map(kind === 'key' ? function (k) {
return k.toLowerCase();
} : kind === 'value' ? function (k) {
return headers[MAP][k].join(', ');
} : function (k) {
return [k.toLowerCase(), headers[MAP][k].join(', ')];
});
}
const INTERNAL = Symbol('internal');
function createHeadersIterator(target, kind) {
const iterator = Object.create(HeadersIteratorPrototype);
iterator[INTERNAL] = {
target,
kind,
index: 0
};
return iterator;
}
const HeadersIteratorPrototype = Object.setPrototypeOf({
next() {
// istanbul ignore if
if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
throw new TypeError('Value of `this` is not a HeadersIterator');
}
var _INTERNAL = this[INTERNAL];
const target = _INTERNAL.target,
kind = _INTERNAL.kind,
index = _INTERNAL.index;
const values = getHeaders(target, kind);
const len = values.length;
if (index >= len) {
return {
value: undefined,
done: true
};
}
this[INTERNAL].index = index + 1;
return {
value: values[index],
done: false
};
}
}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
value: 'HeadersIterator',
writable: false,
enumerable: false,
configurable: true
});
/**
* Export the Headers object in a form that Node.js can consume.
*
* @param Headers headers
* @return Object
*/
function exportNodeCompatibleHeaders(headers) {
const obj = Object.assign({ __proto__: null }, headers[MAP]);
// http.request() only supports string as Host header. This hack makes
// specifying custom Host header possible.
const hostHeaderKey = find(headers[MAP], 'Host');
if (hostHeaderKey !== undefined) {
obj[hostHeaderKey] = obj[hostHeaderKey][0];
}
return obj;
}
/**
* Create a Headers object from an object of headers, ignoring those that do
* not conform to HTTP grammar productions.
*
* @param Object obj Object of headers
* @return Headers
*/
function createHeadersLenient(obj) {
const headers = new Headers();
for (const name of Object.keys(obj)) {
if (invalidTokenRegex.test(name)) {
continue;
}
if (Array.isArray(obj[name])) {
for (const val of obj[name]) {
if (invalidHeaderCharRegex.test(val)) {
continue;
}
if (headers[MAP][name] === undefined) {
headers[MAP][name] = [val];
} else {
headers[MAP][name].push(val);
}
}
} else if (!invalidHeaderCharRegex.test(obj[name])) {
headers[MAP][name] = [obj[name]];
}
}
return headers;
}
const INTERNALS$1 = Symbol('Response internals');
// fix an issue where "STATUS_CODES" aren't a named export for node <10
const STATUS_CODES = http.STATUS_CODES;
/**
* Response class
*
* @param Stream body Readable stream
* @param Object opts Response options
* @return Void
*/
class Response {
constructor() {
let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
Body.call(this, body, opts);
const status = opts.status || 200;
const headers = new Headers(opts.headers);
if (body != null && !headers.has('Content-Type')) {
const contentType = extractContentType(body);
if (contentType) {
headers.append('Content-Type', contentType);
}
}
this[INTERNALS$1] = {
url: opts.url,
status,
statusText: opts.statusText || STATUS_CODES[status],
headers,
counter: opts.counter
};
}
get url() {
return this[INTERNALS$1].url || '';
}
get status() {
return this[INTERNALS$1].status;
}
/**
* Convenience property representing if the request ended normally
*/
get ok() {
return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
}
get redirected() {
return this[INTERNALS$1].counter > 0;
}
get statusText() {
return this[INTERNALS$1].statusText;
}
get headers() {
return this[INTERNALS$1].headers;
}
/**
* Clone this response
*
* @return Response
*/
clone() {
return new Response(clone(this), {
url: this.url,
status: this.status,
statusText: this.statusText,
headers: this.headers,
ok: this.ok,
redirected: this.redirected
});
}
}
Body.mixIn(Response.prototype);
Object.defineProperties(Response.prototype, {
url: { enumerable: true },
status: { enumerable: true },
ok: { enumerable: true },
redirected: { enumerable: true },
statusText: { enumerable: true },
headers: { enumerable: true },
clone: { enumerable: true }
});
Object.defineProperty(Response.prototype, Symbol.toStringTag, {
value: 'Response',
writable: false,
enumerable: false,
configurable: true
});
const INTERNALS$2 = Symbol('Request internals');
// fix an issue where "format", "parse" aren't a named export for node <10
const parse_url = Url.parse;
const format_url = Url.format;
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
/**
* Check if a value is an instance of Request.
*
* @param Mixed input
* @return Boolean
*/
function isRequest(input) {
return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
}
function isAbortSignal(signal) {
const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
return !!(proto && proto.constructor.name === 'AbortSignal');
}
/**
* Request class
*
* @param Mixed input Url or Request instance
* @param Object init Custom options
* @return Void
*/
class Request {
constructor(input) {
let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
let parsedURL;
// normalize input
if (!isRequest(input)) {
if (input && input.href) {
// in order to support Node.js' Url objects; though WHATWG's URL objects
// will fall into this branch also (since their `toString()` will return
// `href` property anyway)
parsedURL = parse_url(input.href);
} else {
// coerce input to a string before attempting to parse
parsedURL = parse_url(`${input}`);
}
input = {};
} else {
parsedURL = parse_url(input.url);
}
let method = init.method || input.method || 'GET';
method = method.toUpperCase();
if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
throw new TypeError('Request with GET/HEAD method cannot have body');
}
let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
Body.call(this, inputBody, {
timeout: init.timeout || input.timeout || 0,
size: init.size || input.size || 0
});
const headers = new Headers(init.headers || input.headers || {});
if (inputBody != null && !headers.has('Content-Type')) {
const contentType = extractContentType(inputBody);
if (contentType) {
headers.append('Content-Type', contentType);
}
}
let signal = isRequest(input) ? input.signal : null;
if ('signal' in init) signal = init.signal;
if (signal != null && !isAbortSignal(signal)) {
throw new TypeError('Expected signal to be an instanceof AbortSignal');
}
this[INTERNALS$2] = {
method,
redirect: init.redirect || input.redirect || 'follow',
headers,
parsedURL,
signal
};
// node-fetch-only options
this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
this.counter = init.counter || input.counter || 0;
this.agent = init.agent || input.agent;
}
get method() {
return this[INTERNALS$2].method;
}
get url() {
return format_url(this[INTERNALS$2].parsedURL);
}
get headers() {
return this[INTERNALS$2].headers;
}
get redirect() {
return this[INTERNALS$2].redirect;
}
get signal() {
return this[INTERNALS$2].signal;
}
/**
* Clone this request
*
* @return Request
*/
clone() {
return new Request(this);
}
}
Body.mixIn(Request.prototype);
Object.defineProperty(Request.prototype, Symbol.toStringTag, {
value: 'Request',
writable: false,
enumerable: false,
configurable: true
});
Object.defineProperties(Request.prototype, {
method: { enumerable: true },
url: { enumerable: true },
headers: { enumerable: true },
redirect: { enumerable: true },
clone: { enumerable: true },
signal: { enumerable: true }
});
/**
* Convert a Request to Node.js http request options.
*
* @param Request A Request instance
* @return Object The options object to be passed to http.request
*/
function getNodeRequestOptions(request) {
const parsedURL = request[INTERNALS$2].parsedURL;
const headers = new Headers(request[INTERNALS$2].headers);
// fetch step 1.3
if (!headers.has('Accept')) {
headers.set('Accept', '*/*');
}
// Basic fetch
if (!parsedURL.protocol || !parsedURL.hostname) {
throw new TypeError('Only absolute URLs are supported');
}
if (!/^https?:$/.test(parsedURL.protocol)) {
throw new TypeError('Only HTTP(S) protocols are supported');
}
if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
}
// HTTP-network-or-cache fetch steps 2.4-2.7
let contentLengthValue = null;
if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
contentLengthValue = '0';
}
if (request.body != null) {
const totalBytes = getTotalBytes(request);
if (typeof totalBytes === 'number') {
contentLengthValue = String(totalBytes);
}
}
if (contentLengthValue) {
headers.set('Content-Length', contentLengthValue);
}
// HTTP-network-or-cache fetch step 2.11
if (!headers.has('User-Agent')) {
headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
}
// HTTP-network-or-cache fetch step 2.15
if (request.compress && !headers.has('Accept-Encoding')) {
headers.set('Accept-Encoding', 'gzip,deflate');
}
let agent = request.agent;
if (typeof agent === 'function') {
agent = agent(parsedURL);
}
if (!headers.has('Connection') && !agent) {
headers.set('Connection', 'close');
}
// HTTP-network fetch step 4.2
// chunked encoding is handled by Node.js
return Object.assign({}, parsedURL, {
method: request.method,
headers: exportNodeCompatibleHeaders(headers),
agent
});
}
/**
* abort-error.js
*
* AbortError interface for cancelled requests
*/
/**
* Create AbortError instance
*
* @param String message Error message for human
* @return AbortError
*/
function AbortError(message) {
Error.call(this, message);
this.type = 'aborted';
this.message = message;
// hide custom error implementation details from end-users
Error.captureStackTrace(this, this.constructor);
}
AbortError.prototype = Object.create(Error.prototype);
AbortError.prototype.constructor = AbortError;
AbortError.prototype.name = 'AbortError';
// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
const PassThrough$1 = Stream.PassThrough;
const resolve_url = Url.resolve;
/**
* Fetch function
*
* @param Mixed url Absolute url or Request instance
* @param Object opts Fetch options
* @return Promise
*/
function fetch(url, opts) {
// allow custom promise
if (!fetch.Promise) {
throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
}
Body.Promise = fetch.Promise;
// wrap http.request into fetch
return new fetch.Promise(function (resolve, reject) {
// build request object
const request = new Request(url, opts);
const options = getNodeRequestOptions(request);
const send = (options.protocol === 'https:' ? https : http).request;
const signal = request.signal;
let response = null;
const abort = function abort() {
let error = new AbortError('The user aborted a request.');
reject(error);
if (request.body && request.body instanceof Stream.Readable) {
request.body.destroy(error);
}
if (!response || !response.body) return;
response.body.emit('error', error);
};
if (signal && signal.aborted) {
abort();
return;
}
const abortAndFinalize = function abortAndFinalize() {
abort();
finalize();
};
// send request
const req = send(options);
let reqTimeout;
if (signal) {
signal.addEventListener('abort', abortAndFinalize);
}
function finalize() {
req.abort();
if (signal) signal.removeEventListener('abort', abortAndFinalize);
clearTimeout(reqTimeout);
}
if (request.timeout) {
req.once('socket', function (socket) {
reqTimeout = setTimeout(function () {
reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
finalize();
}, request.timeout);
});
}
req.on('error', function (err) {
reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
finalize();
});
req.on('response', function (res) {
clearTimeout(reqTimeout);
const headers = createHeadersLenient(res.headers);
// HTTP fetch step 5
if (fetch.isRedirect(res.statusCode)) {
// HTTP fetch step 5.2
const location = headers.get('Location');
// HTTP fetch step 5.3
const locationURL = location === null ? null : resolve_url(request.url, location);
// HTTP fetch step 5.5
switch (request.redirect) {
case 'error':
reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
finalize();
return;
case 'manual':
// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
if (locationURL !== null) {
// handle corrupted header
try {
headers.set('Location', locationURL);
} catch (err) {
// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
reject(err);
}
}
break;
case 'follow':
// HTTP-redirect fetch step 2
if (locationURL === null) {
break;
}
// HTTP-redirect fetch step 5
if (request.counter >= request.follow) {
reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
finalize();
return;
}
// HTTP-redirect fetch step 6 (counter increment)
// Create a new Request object.
const requestOpts = {
headers: new Headers(request.headers),
follow: request.follow,
counter: request.counter + 1,
agent: request.agent,
compress: request.compress,
method: request.method,
body: request.body,
signal: request.signal,
timeout: request.timeout
};
// HTTP-redirect fetch step 9
if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
finalize();
return;
}
// HTTP-redirect fetch step 11
if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
requestOpts.method = 'GET';
requestOpts.body = undefined;
requestOpts.headers.delete('content-length');
}
// HTTP-redirect fetch step 15
resolve(fetch(new Request(locationURL, requestOpts)));
finalize();
return;
}
}
// prepare response
res.once('end', function () {
if (signal) signal.removeEventListener('abort', abortAndFinalize);
});
let body = res.pipe(new PassThrough$1());
const response_options = {
url: request.url,
status: res.statusCode,
statusText: res.statusMessage,
headers: headers,
size: request.size,
timeout: request.timeout,
counter: request.counter
};
// HTTP-network fetch step 12.1.1.3
const codings = headers.get('Content-Encoding');
// HTTP-network fetch step 12.1.1.4: handle content codings
// in following scenarios we ignore compression support
// 1. compression support is disabled
// 2. HEAD request
// 3. no Content-Encoding header
// 4. no content response (204)
// 5. content not modified response (304)
if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
response = new Response(body, response_options);
resolve(response);
return;
}
// For Node v6+
// Be less strict when decoding compressed responses, since sometimes
// servers send slightly invalid responses that are still accepted
// by common browsers.
// Always using Z_SYNC_FLUSH is what cURL does.
const zlibOptions = {
flush: zlib.Z_SYNC_FLUSH,
finishFlush: zlib.Z_SYNC_FLUSH
};
// for gzip
if (codings == 'gzip' || codings == 'x-gzip') {
body = body.pipe(zlib.createGunzip(zlibOptions));
response = new Response(body, response_options);
resolve(response);
return;
}
// for deflate
if (codings == 'deflate' || codings == 'x-deflate') {
// handle the infamous raw deflate response from old servers
// a hack for old IIS and Apache servers
const raw = res.pipe(new PassThrough$1());
raw.once('data', function (chunk) {
// see http://stackoverflow.com/questions/37519828
if ((chunk[0] & 0x0F) === 0x08) {
body = body.pipe(zlib.createInflate());
} else {
body = body.pipe(zlib.createInflateRaw());
}
response = new Response(body, response_options);
resolve(response);
});
return;
}
// for br
if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
body = body.pipe(zlib.createBrotliDecompress());
response = new Response(body, response_options);
resolve(response);
return;
}
// otherwise, use response as-is
response = new Response(body, response_options);
resolve(response);
});
writeToStream(req, request);
});
}
/**
* Redirect code matching
*
* @param Number code Status code
* @return Boolean
*/
fetch.isRedirect = function (code) {
return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
};
// expose Promise
fetch.Promise = global.Promise;
module.exports = exports = fetch;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = exports;
exports.Headers = Headers;
exports.Request = Request;
exports.Response = Response;
exports.FetchError = FetchError;
/***/ }),
/***/ 462:
/***/ (function(module) {
"use strict";
// See http://www.robvanderwoude.com/escapechars.php
const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
function escapeCommand(arg) {
// Escape meta chars
arg = arg.replace(metaCharsRegExp, '^$1');
return arg;
}
function escapeArgument(arg, doubleEscapeMetaChars) {
// Convert to string
arg = `${arg}`;
// Algorithm below is based on https://qntm.org/cmd
// Sequence of backslashes followed by a double quote:
// double up all the backslashes and escape the double quote
arg = arg.replace(/(\\*)"/g, '$1$1\\"');
// Sequence of backslashes followed by the end of the string
// (which will become a double quote later):
// double up all the backslashes
arg = arg.replace(/(\\*)$/, '$1$1');
// All other backslashes occur literally
// Quote the whole thing:
arg = `"${arg}"`;
// Escape meta chars
arg = arg.replace(metaCharsRegExp, '^$1');
// Double escape meta chars if necessary
if (doubleEscapeMetaChars) {
arg = arg.replace(metaCharsRegExp, '^$1');
}
return arg;
}
module.exports.command = escapeCommand;
module.exports.argument = escapeArgument;
/***/ }),
/***/ 463:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var deprecation = __webpack_require__(692);
var once = _interopDefault(__webpack_require__(969));
const logOnce = once(deprecation => console.warn(deprecation));
/**
* Error with extra properties to help with debugging
*/
class RequestError extends Error {
constructor(message, statusCode, options) {
super(message); // Maintains proper stack trace (only available on V8)
/* istanbul ignore next */
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
this.name = "HttpError";
this.status = statusCode;
Object.defineProperty(this, "code", {
get() {
logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
return statusCode;
}
});
this.headers = options.headers || {}; // redact request credentials without mutating original request options
const requestCopy = Object.assign({}, options.request);
if (options.request.headers.authorization) {
requestCopy.headers = Object.assign({}, options.request.headers, {
authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
});
}
requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
// see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
// see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
.replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
this.request = requestCopy;
}
}
exports.RequestError = RequestError;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 469:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
// Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
const graphql_1 = __webpack_require__(898);
const rest_1 = __webpack_require__(0);
const Context = __importStar(__webpack_require__(262));
const httpClient = __importStar(__webpack_require__(539));
// We need this in order to extend Octokit
rest_1.Octokit.prototype = new rest_1.Octokit();
exports.context = new Context.Context();
class GitHub extends rest_1.Octokit {
constructor(token, opts) {
super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
}
/**
* Disambiguates the constructor overload parameters
*/
static disambiguate(token, opts) {
return [
typeof token === 'string' ? token : '',
typeof token === 'object' ? token : opts || {}
];
}
static getOctokitOptions(args) {
const token = args[0];
const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
// Auth
const auth = GitHub.getAuthString(token, options);
if (auth) {
options.auth = auth;
}
// Proxy
const agent = GitHub.getProxyAgent(options);
if (agent) {
// Shallow clone - don't mutate the object provided by the caller
options.request = options.request ? Object.assign({}, options.request) : {};
// Set the agent
options.request.agent = agent;
}
return options;
}
static getGraphQL(args) {
const defaults = {};
const token = args[0];
const options = args[1];
// Authorization
const auth = this.getAuthString(token, options);
if (auth) {
defaults.headers = {
authorization: auth
};
}
// Proxy
const agent = GitHub.getProxyAgent(options);
if (agent) {
defaults.request = { agent };
}
return graphql_1.graphql.defaults(defaults);
}
static getAuthString(token, options) {
// Validate args
if (!token && !options.auth) {
throw new Error('Parameter token or opts.auth is required');
}
else if (token && options.auth) {
throw new Error('Parameters token and opts.auth may not both be specified');
}
return typeof options.auth === 'string' ? options.auth : `token ${token}`;
}
static getProxyAgent(options) {
var _a;
if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
const serverUrl = 'https://api.github.com';
if (httpClient.getProxyUrl(serverUrl)) {
const hc = new httpClient.HttpClient();
return hc.getAgent(serverUrl);
}
}
return undefined;
}
}
exports.GitHub = GitHub;
//# sourceMappingURL=github.js.map
/***/ }),
/***/ 470:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = __webpack_require__(431);
const os = __importStar(__webpack_require__(87));
const path = __importStar(__webpack_require__(622));
/**
* The code to exit an action
*/
var ExitCode;
(function (ExitCode) {
/**
* A code indicating that the action was successful
*/
ExitCode[ExitCode["Success"] = 0] = "Success";
/**
* A code indicating that the action was a failure
*/
ExitCode[ExitCode["Failure"] = 1] = "Failure";
})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
//-----------------------------------------------------------------------
// Variables
//-----------------------------------------------------------------------
/**
* Sets env variable for this action and future actions in the job
* @param name the name of the variable to set
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function exportVariable(name, val) {
const convertedVal = command_1.toCommandValue(val);
process.env[name] = convertedVal;
command_1.issueCommand('set-env', { name }, convertedVal);
}
exports.exportVariable = exportVariable;
/**
* Registers a secret which will get masked from logs
* @param secret value of the secret
*/
function setSecret(secret) {
command_1.issueCommand('add-mask', {}, secret);
}
exports.setSecret = setSecret;
/**
* Prepends inputPath to the PATH (for this action and future actions)
* @param inputPath
*/
function addPath(inputPath) {
command_1.issueCommand('add-path', {}, inputPath);
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
}
exports.addPath = addPath;
/**
* Gets the value of an input. The value is also trimmed.
*
* @param name name of the input to get
* @param options optional. See InputOptions.
* @returns string
*/
function getInput(name, options) {
const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
if (options && options.required && !val) {
throw new Error(`Input required and not supplied: ${name}`);
}
return val.trim();
}
exports.getInput = getInput;
/**
* Sets the value of an output.
*
* @param name name of the output to set
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setOutput(name, value) {
command_1.issueCommand('set-output', { name }, value);
}
exports.setOutput = setOutput;
/**
* Enables or disables the echoing of commands into stdout for the rest of the step.
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
*
*/
function setCommandEcho(enabled) {
command_1.issue('echo', enabled ? 'on' : 'off');
}
exports.setCommandEcho = setCommandEcho;
//-----------------------------------------------------------------------
// Results
//-----------------------------------------------------------------------
/**
* Sets the action status to failed.
* When the action exits it will be with an exit code of 1
* @param message add error issue message
*/
function setFailed(message) {
process.exitCode = ExitCode.Failure;
error(message);
}
exports.setFailed = setFailed;
//-----------------------------------------------------------------------
// Logging Commands
//-----------------------------------------------------------------------
/**
* Gets whether Actions Step Debug is on or not
*/
function isDebug() {
return process.env['RUNNER_DEBUG'] === '1';
}
exports.isDebug = isDebug;
/**
* Writes debug message to user log
* @param message debug message
*/
function debug(message) {
command_1.issueCommand('debug', {}, message);
}
exports.debug = debug;
/**
* Adds an error issue
* @param message error issue message. Errors will be converted to string via toString()
*/
function error(message) {
command_1.issue('error', message instanceof Error ? message.toString() : message);
}
exports.error = error;
/**
* Adds an warning issue
* @param message warning issue message. Errors will be converted to string via toString()
*/
function warning(message) {
command_1.issue('warning', message instanceof Error ? message.toString() : message);
}
exports.warning = warning;
/**
* Writes info to log with console.log.
* @param message info message
*/
function info(message) {
process.stdout.write(message + os.EOL);
}
exports.info = info;
/**
* Begin an output group.
*
* Output until the next `groupEnd` will be foldable in this group
*
* @param name The name of the output group
*/
function startGroup(name) {
command_1.issue('group', name);
}
exports.startGroup = startGroup;
/**
* End an output group.
*/
function endGroup() {
command_1.issue('endgroup');
}
exports.endGroup = endGroup;
/**
* Wrap an asynchronous function call in a group.
*
* Returns the same type as the function itself.
*
* @param name The name of the group
* @param fn The function to wrap in the group
*/
function group(name, fn) {
return __awaiter(this, void 0, void 0, function* () {
startGroup(name);
let result;
try {
result = yield fn();
}
finally {
endGroup();
}
return result;
});
}
exports.group = group;
//-----------------------------------------------------------------------
// Wrapper action state
//-----------------------------------------------------------------------
/**
* Saves state for current action, the state can only be retrieved by this action's post job execution.
*
* @param name name of the state to store
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function saveState(name, value) {
command_1.issueCommand('save-state', { name }, value);
}
exports.saveState = saveState;
/**
* Gets the value of an state set by this action's main execution.
*
* @param name name of the state to get
* @returns string
*/
function getState(name) {
return process.env[`STATE_${name}`] || '';
}
exports.getState = getState;
//# sourceMappingURL=core.js.map
/***/ }),
/***/ 471:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = authenticationBeforeRequest;
const btoa = __webpack_require__(675);
const uniq = __webpack_require__(126);
function authenticationBeforeRequest(state, options) {
if (!state.auth.type) {
return;
}
if (state.auth.type === "basic") {
const hash = btoa(`${state.auth.username}:${state.auth.password}`);
options.headers.authorization = `Basic ${hash}`;
return;
}
if (state.auth.type === "token") {
options.headers.authorization = `token ${state.auth.token}`;
return;
}
if (state.auth.type === "app") {
options.headers.authorization = `Bearer ${state.auth.token}`;
const acceptHeaders = options.headers.accept
.split(",")
.concat("application/vnd.github.machine-man-preview+json");
options.headers.accept = uniq(acceptHeaders)
.filter(Boolean)
.join(",");
return;
}
options.url += options.url.indexOf("?") === -1 ? "?" : "&";
if (state.auth.token) {
options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
return;
}
const key = encodeURIComponent(state.auth.key);
const secret = encodeURIComponent(state.auth.secret);
options.url += `client_id=${key}&client_secret=${secret}`;
}
/***/ }),
/***/ 489:
/***/ (function(module, __unusedexports, __webpack_require__) {
"use strict";
const path = __webpack_require__(622);
const which = __webpack_require__(814);
const pathKey = __webpack_require__(39)();
function resolveCommandAttempt(parsed, withoutPathExt) {
const cwd = process.cwd();
const hasCustomCwd = parsed.options.cwd != null;
// If a custom `cwd` was specified, we need to change the process cwd
// because `which` will do stat calls but does not support a custom cwd
if (hasCustomCwd) {
try {
process.chdir(parsed.options.cwd);
} catch (err) {
/* Empty */
}
}
let resolved;
try {
resolved = which.sync(parsed.command, {
path: (parsed.options.env || process.env)[pathKey],
pathExt: withoutPathExt ? path.delimiter : undefined,
});
} catch (e) {
/* Empty */
} finally {
process.chdir(cwd);
}
// If we successfully resolved, ensure that an absolute path is returned
// Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
if (resolved) {
resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
}
return resolved;
}
function resolveCommand(parsed) {
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
}
module.exports = resolveCommand;
/***/ }),
/***/ 510:
/***/ (function(module) {
module.exports = addHook
function addHook (state, kind, name, hook) {
var orig = hook
if (!state.registry[name]) {
state.registry[name] = []
}
if (kind === 'before') {
hook = function (method, options) {
return Promise.resolve()
.then(orig.bind(null, options))
.then(method.bind(null, options))
}
}
if (kind === 'after') {
hook = function (method, options) {
var result
return Promise.resolve()
.then(method.bind(null, options))
.then(function (result_) {
result = result_
return orig(result, options)
})
.then(function () {
return result
})
}
}
if (kind === 'error') {
hook = function (method, options) {
return Promise.resolve()
.then(method.bind(null, options))
.catch(function (error) {
return orig(error, options)
})
}
}
state.registry[name].push({
hook: hook,
orig: orig
})
}
/***/ }),
/***/ 523:
/***/ (function(module, __unusedexports, __webpack_require__) {
var register = __webpack_require__(280)
var addHook = __webpack_require__(510)
var removeHook = __webpack_require__(763)
// bind with array of arguments: https://stackoverflow.com/a/21792913
var bind = Function.bind
var bindable = bind.bind(bind)
function bindApi (hook, state, name) {
var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
hook.api = { remove: removeHookRef }
hook.remove = removeHookRef
;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
var args = name ? [state, kind, name] : [state, kind]
hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
})
}
function HookSingular () {
var singularHookName = 'h'
var singularHookState = {
registry: {}
}
var singularHook = register.bind(null, singularHookState, singularHookName)
bindApi(singularHook, singularHookState, singularHookName)
return singularHook
}
function HookCollection () {
var state = {
registry: {}
}
var hook = register.bind(null, state)
bindApi(hook, state)
return hook
}
var collectionHookDeprecationMessageDisplayed = false
function Hook () {
if (!collectionHookDeprecationMessageDisplayed) {
console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
collectionHookDeprecationMessageDisplayed = true
}
return HookCollection()
}
Hook.Singular = HookSingular.bind()
Hook.Collection = HookCollection.bind()
module.exports = Hook
// expose constructors as a named property for TypeScript
module.exports.Hook = Hook
module.exports.Singular = Hook.Singular
module.exports.Collection = Hook.Collection
/***/ }),
/***/ 529:
/***/ (function(module, __unusedexports, __webpack_require__) {
const factory = __webpack_require__(47);
module.exports = factory();
/***/ }),
/***/ 533:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(__webpack_require__(470));
const io = __importStar(__webpack_require__(1));
const fs = __importStar(__webpack_require__(747));
const os = __importStar(__webpack_require__(87));
const path = __importStar(__webpack_require__(622));
const httpm = __importStar(__webpack_require__(539));
const semver = __importStar(__webpack_require__(656));
const stream = __importStar(__webpack_require__(413));
const util = __importStar(__webpack_require__(669));
const v4_1 = __importDefault(__webpack_require__(826));
const exec_1 = __webpack_require__(986);
const assert_1 = __webpack_require__(357);
const retry_helper_1 = __webpack_require__(979);
class HTTPError extends Error {
constructor(httpStatusCode) {
super(`Unexpected HTTP response: ${httpStatusCode}`);
this.httpStatusCode = httpStatusCode;
Object.setPrototypeOf(this, new.target.prototype);
}
}
exports.HTTPError = HTTPError;
const IS_WINDOWS = process.platform === 'win32';
const userAgent = 'actions/tool-cache';
/**
* Download a tool from an url and stream it into a file
*
* @param url url of tool to download
* @param dest path to download tool
* @returns path to downloaded tool
*/
function downloadTool(url, dest) {
return __awaiter(this, void 0, void 0, function* () {
dest = dest || path.join(_getTempDirectory(), v4_1.default());
yield io.mkdirP(path.dirname(dest));
core.debug(`Downloading ${url}`);
core.debug(`Destination ${dest}`);
const maxAttempts = 3;
const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
return yield downloadToolAttempt(url, dest || '');
}), (err) => {
if (err instanceof HTTPError && err.httpStatusCode) {
// Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
if (err.httpStatusCode < 500 &&
err.httpStatusCode !== 408 &&
err.httpStatusCode !== 429) {
return false;
}
}
// Otherwise retry
return true;
});
});
}
exports.downloadTool = downloadTool;
function downloadToolAttempt(url, dest) {
return __awaiter(this, void 0, void 0, function* () {
if (fs.existsSync(dest)) {
throw new Error(`Destination file path ${dest} already exists`);
}
// Get the response headers
const http = new httpm.HttpClient(userAgent, [], {
allowRetries: false
});
const response = yield http.get(url);
if (response.message.statusCode !== 200) {
const err = new HTTPError(response.message.statusCode);
core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
throw err;
}
// Download the response body
const pipeline = util.promisify(stream.pipeline);
const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
const readStream = responseMessageFactory();
let succeeded = false;
try {
yield pipeline(readStream, fs.createWriteStream(dest));
core.debug('download complete');
succeeded = true;
return dest;
}
finally {
// Error, delete dest before retry
if (!succeeded) {
core.debug('download failed');
try {
yield io.rmRF(dest);
}
catch (err) {
core.debug(`Failed to delete '${dest}'. ${err.message}`);
}
}
}
});
}
/**
* Extract a .7z file
*
* @param file path to the .7z file
* @param dest destination directory. Optional.
* @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
* problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
* gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
* bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
* interface, it is smaller than the full command line interface, and it does support long paths. At the
* time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
* Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
* to 7zr.exe can be pass to this function.
* @returns path to the destination directory
*/
function extract7z(file, dest, _7zPath) {
return __awaiter(this, void 0, void 0, function* () {
assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
assert_1.ok(file, 'parameter "file" is required');
dest = yield _createExtractFolder(dest);
const originalCwd = process.cwd();
process.chdir(dest);
if (_7zPath) {
try {
const args = [
'x',
'-bb1',
'-bd',
'-sccUTF-8',
file
];
const options = {
silent: true
};
yield exec_1.exec(`"${_7zPath}"`, args, options);
}
finally {
process.chdir(originalCwd);
}
}
else {
const escapedScript = path
.join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
.replace(/'/g, "''")
.replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
const args = [
'-NoLogo',
'-Sta',
'-NoProfile',
'-NonInteractive',
'-ExecutionPolicy',
'Unrestricted',
'-Command',
command
];
const options = {
silent: true
};
try {
const powershellPath = yield io.which('powershell', true);
yield exec_1.exec(`"${powershellPath}"`, args, options);
}
finally {
process.chdir(originalCwd);
}
}
return dest;
});
}
exports.extract7z = extract7z;
/**
* Extract a compressed tar archive
*
* @param file path to the tar
* @param dest destination directory. Optional.
* @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
* @returns path to the destination directory
*/
function extractTar(file, dest, flags = 'xz') {
return __awaiter(this, void 0, void 0, function* () {
if (!file) {
throw new Error("parameter 'file' is required");
}
// Create dest
dest = yield _createExtractFolder(dest);
// Determine whether GNU tar
core.debug('Checking tar --version');
let versionOutput = '';
yield exec_1.exec('tar --version', [], {
ignoreReturnCode: true,
silent: true,
listeners: {
stdout: (data) => (versionOutput += data.toString()),
stderr: (data) => (versionOutput += data.toString())
}
});
core.debug(versionOutput.trim());
const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
// Initialize args
const args = [flags];
let destArg = dest;
let fileArg = file;
if (IS_WINDOWS && isGnuTar) {
args.push('--force-local');
destArg = dest.replace(/\\/g, '/');
// Technically only the dest needs to have `/` but for aesthetic consistency
// convert slashes in the file arg too.
fileArg = file.replace(/\\/g, '/');
}
if (isGnuTar) {
// Suppress warnings when using GNU tar to extract archives created by BSD tar
args.push('--warning=no-unknown-keyword');
}
args.push('-C', destArg, '-f', fileArg);
yield exec_1.exec(`tar`, args);
return dest;
});
}
exports.extractTar = extractTar;
/**
* Extract a zip
*
* @param file path to the zip
* @param dest destination directory. Optional.
* @returns path to the destination directory
*/
function extractZip(file, dest) {
return __awaiter(this, void 0, void 0, function* () {
if (!file) {
throw new Error("parameter 'file' is required");
}
dest = yield _createExtractFolder(dest);
if (IS_WINDOWS) {
yield extractZipWin(file, dest);
}
else {
yield extractZipNix(file, dest);
}
return dest;
});
}
exports.extractZip = extractZip;
function extractZipWin(file, dest) {
return __awaiter(this, void 0, void 0, function* () {
// build the powershell command
const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
// run powershell
const powershellPath = yield io.which('powershell');
const args = [
'-NoLogo',
'-Sta',
'-NoProfile',
'-NonInteractive',
'-ExecutionPolicy',
'Unrestricted',
'-Command',
command
];
yield exec_1.exec(`"${powershellPath}"`, args);
});
}
function extractZipNix(file, dest) {
return __awaiter(this, void 0, void 0, function* () {
const unzipPath = yield io.which('unzip');
yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
});
}
/**
* Caches a directory and installs it into the tool cacheDir
*
* @param sourceDir the directory to cache into tools
* @param tool tool name
* @param version version of the tool. semver format
* @param arch architecture of the tool. Optional. Defaults to machine architecture
*/
function cacheDir(sourceDir, tool, version, arch) {
return __awaiter(this, void 0, void 0, function* () {
version = semver.clean(version) || version;
arch = arch || os.arch();
core.debug(`Caching tool ${tool} ${version} ${arch}`);
core.debug(`source dir: ${sourceDir}`);
if (!fs.statSync(sourceDir).isDirectory()) {
throw new Error('sourceDir is not a directory');
}
// Create the tool dir
const destPath = yield _createToolPath(tool, version, arch);
// copy each child item. do not move. move can fail on Windows
// due to anti-virus software having an open handle on a file.
for (const itemName of fs.readdirSync(sourceDir)) {
const s = path.join(sourceDir, itemName);
yield io.cp(s, destPath, { recursive: true });
}
// write .complete
_completeToolPath(tool, version, arch);
return destPath;
});
}
exports.cacheDir = cacheDir;
/**
* Caches a downloaded file (GUID) and installs it
* into the tool cache with a given targetName
*
* @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
* @param targetFile the name of the file name in the tools directory
* @param tool tool name
* @param version version of the tool. semver format
* @param arch architecture of the tool. Optional. Defaults to machine architecture
*/
function cacheFile(sourceFile, targetFile, tool, version, arch) {
return __awaiter(this, void 0, void 0, function* () {
version = semver.clean(version) || version;
arch = arch || os.arch();
core.debug(`Caching tool ${tool} ${version} ${arch}`);
core.debug(`source file: ${sourceFile}`);
if (!fs.statSync(sourceFile).isFile()) {
throw new Error('sourceFile is not a file');
}
// create the tool dir
const destFolder = yield _createToolPath(tool, version, arch);
// copy instead of move. move can fail on Windows due to
// anti-virus software having an open handle on a file.
const destPath = path.join(destFolder, targetFile);
core.debug(`destination file ${destPath}`);
yield io.cp(sourceFile, destPath);
// write .complete
_completeToolPath(tool, version, arch);
return destFolder;
});
}
exports.cacheFile = cacheFile;
/**
* Finds the path to a tool version in the local installed tool cache
*
* @param toolName name of the tool
* @param versionSpec version of the tool
* @param arch optional arch. defaults to arch of computer
*/
function find(toolName, versionSpec, arch) {
if (!toolName) {
throw new Error('toolName parameter is required');
}
if (!versionSpec) {
throw new Error('versionSpec parameter is required');
}
arch = arch || os.arch();
// attempt to resolve an explicit version
if (!_isExplicitVersion(versionSpec)) {
const localVersions = findAllVersions(toolName, arch);
const match = _evaluateVersions(localVersions, versionSpec);
versionSpec = match;
}
// check for the explicit version in the cache
let toolPath = '';
if (versionSpec) {
versionSpec = semver.clean(versionSpec) || '';
const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
core.debug(`checking cache: ${cachePath}`);
if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
toolPath = cachePath;
}
else {
core.debug('not found');
}
}
return toolPath;
}
exports.find = find;
/**
* Finds the paths to all versions of a tool that are installed in the local tool cache
*
* @param toolName name of the tool
* @param arch optional arch. defaults to arch of computer
*/
function findAllVersions(toolName, arch) {
const versions = [];
arch = arch || os.arch();
const toolPath = path.join(_getCacheDirectory(), toolName);
if (fs.existsSync(toolPath)) {
const children = fs.readdirSync(toolPath);
for (const child of children) {
if (_isExplicitVersion(child)) {
const fullPath = path.join(toolPath, child, arch || '');
if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
versions.push(child);
}
}
}
}
return versions;
}
exports.findAllVersions = findAllVersions;
function _createExtractFolder(dest) {
return __awaiter(this, void 0, void 0, function* () {
if (!dest) {
// create a temp dir
dest = path.join(_getTempDirectory(), v4_1.default());
}
yield io.mkdirP(dest);
return dest;
});
}
function _createToolPath(tool, version, arch) {
return __awaiter(this, void 0, void 0, function* () {
const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
core.debug(`destination ${folderPath}`);
const markerPath = `${folderPath}.complete`;
yield io.rmRF(folderPath);
yield io.rmRF(markerPath);
yield io.mkdirP(folderPath);
return folderPath;
});
}
function _completeToolPath(tool, version, arch) {
const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
const markerPath = `${folderPath}.complete`;
fs.writeFileSync(markerPath, '');
core.debug('finished caching tool');
}
function _isExplicitVersion(versionSpec) {
const c = semver.clean(versionSpec) || '';
core.debug(`isExplicit: ${c}`);
const valid = semver.valid(c) != null;
core.debug(`explicit? ${valid}`);
return valid;
}
function _evaluateVersions(versions, versionSpec) {
let version = '';
core.debug(`evaluating ${versions.length} versions`);
versions = versions.sort((a, b) => {
if (semver.gt(a, b)) {
return 1;
}
return -1;
});
for (let i = versions.length - 1; i >= 0; i--) {
const potential = versions[i];
const satisfied = semver.satisfies(potential, versionSpec);
if (satisfied) {
version = potential;
break;
}
}
if (version) {
core.debug(`matched: ${version}`);
}
else {
core.debug('match not found');
}
return version;
}
/**
* Gets RUNNER_TOOL_CACHE
*/
function _getCacheDirectory() {
const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
return cacheDirectory;
}
/**
* Gets RUNNER_TEMP
*/
function _getTempDirectory() {
const tempDirectory = process.env['RUNNER_TEMP'] || '';
assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
return tempDirectory;
}
/**
* Gets a global variable
*/
function _getGlobal(key, defaultValue) {
/* eslint-disable @typescript-eslint/no-explicit-any */
const value = global[key];
/* eslint-enable @typescript-eslint/no-explicit-any */
return value !== undefined ? value : defaultValue;
}
//# sourceMappingURL=tool-cache.js.map
/***/ }),
/***/ 536:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = hasFirstPage
const deprecate = __webpack_require__(370)
const getPageLinks = __webpack_require__(577)
function hasFirstPage (link) {
deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
return getPageLinks(link).first
}
/***/ }),
/***/ 539:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const url = __webpack_require__(835);
const http = __webpack_require__(605);
const https = __webpack_require__(34);
const pm = __webpack_require__(950);
let tunnel;
var HttpCodes;
(function (HttpCodes) {
HttpCodes[HttpCodes["OK"] = 200] = "OK";
HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
var Headers;
(function (Headers) {
Headers["Accept"] = "accept";
Headers["ContentType"] = "content-type";
})(Headers = exports.Headers || (exports.Headers = {}));
var MediaTypes;
(function (MediaTypes) {
MediaTypes["ApplicationJson"] = "application/json";
})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
/**
* Returns the proxy URL, depending upon the supplied url and proxy environment variables.
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
*/
function getProxyUrl(serverUrl) {
let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
return proxyUrl ? proxyUrl.href : '';
}
exports.getProxyUrl = getProxyUrl;
const HttpRedirectCodes = [
HttpCodes.MovedPermanently,
HttpCodes.ResourceMoved,
HttpCodes.SeeOther,
HttpCodes.TemporaryRedirect,
HttpCodes.PermanentRedirect
];
const HttpResponseRetryCodes = [
HttpCodes.BadGateway,
HttpCodes.ServiceUnavailable,
HttpCodes.GatewayTimeout
];
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
const ExponentialBackoffCeiling = 10;
const ExponentialBackoffTimeSlice = 5;
class HttpClientResponse {
constructor(message) {
this.message = message;
}
readBody() {
return new Promise(async (resolve, reject) => {
let output = Buffer.alloc(0);
this.message.on('data', (chunk) => {
output = Buffer.concat([output, chunk]);
});
this.message.on('end', () => {
resolve(output.toString());
});
});
}
}
exports.HttpClientResponse = HttpClientResponse;
function isHttps(requestUrl) {
let parsedUrl = url.parse(requestUrl);
return parsedUrl.protocol === 'https:';
}
exports.isHttps = isHttps;
class HttpClient {
constructor(userAgent, handlers, requestOptions) {
this._ignoreSslError = false;
this._allowRedirects = true;
this._allowRedirectDowngrade = false;
this._maxRedirects = 50;
this._allowRetries = false;
this._maxRetries = 1;
this._keepAlive = false;
this._disposed = false;
this.userAgent = userAgent;
this.handlers = handlers || [];
this.requestOptions = requestOptions;
if (requestOptions) {
if (requestOptions.ignoreSslError != null) {
this._ignoreSslError = requestOptions.ignoreSslError;
}
this._socketTimeout = requestOptions.socketTimeout;
if (requestOptions.allowRedirects != null) {
this._allowRedirects = requestOptions.allowRedirects;
}
if (requestOptions.allowRedirectDowngrade != null) {
this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
}
if (requestOptions.maxRedirects != null) {
this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
}
if (requestOptions.keepAlive != null) {
this._keepAlive = requestOptions.keepAlive;
}
if (requestOptions.allowRetries != null) {
this._allowRetries = requestOptions.allowRetries;
}
if (requestOptions.maxRetries != null) {
this._maxRetries = requestOptions.maxRetries;
}
}
}
options(requestUrl, additionalHeaders) {
return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
}
get(requestUrl, additionalHeaders) {
return this.request('GET', requestUrl, null, additionalHeaders || {});
}
del(requestUrl, additionalHeaders) {
return this.request('DELETE', requestUrl, null, additionalHeaders || {});
}
post(requestUrl, data, additionalHeaders) {
return this.request('POST', requestUrl, data, additionalHeaders || {});
}
patch(requestUrl, data, additionalHeaders) {
return this.request('PATCH', requestUrl, data, additionalHeaders || {});
}
put(requestUrl, data, additionalHeaders) {
return this.request('PUT', requestUrl, data, additionalHeaders || {});
}
head(requestUrl, additionalHeaders) {
return this.request('HEAD', requestUrl, null, additionalHeaders || {});
}
sendStream(verb, requestUrl, stream, additionalHeaders) {
return this.request(verb, requestUrl, stream, additionalHeaders);
}
/**
* Gets a typed object from an endpoint
* Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
*/
async getJson(requestUrl, additionalHeaders = {}) {
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
let res = await this.get(requestUrl, additionalHeaders);
return this._processResponse(res, this.requestOptions);
}
async postJson(requestUrl, obj, additionalHeaders = {}) {
let data = JSON.stringify(obj, null, 2);
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
let res = await this.post(requestUrl, data, additionalHeaders);
return this._processResponse(res, this.requestOptions);
}
async putJson(requestUrl, obj, additionalHeaders = {}) {
let data = JSON.stringify(obj, null, 2);
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
let res = await this.put(requestUrl, data, additionalHeaders);
return this._processResponse(res, this.requestOptions);
}
async patchJson(requestUrl, obj, additionalHeaders = {}) {
let data = JSON.stringify(obj, null, 2);
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
let res = await this.patch(requestUrl, data, additionalHeaders);
return this._processResponse(res, this.requestOptions);
}
/**
* Makes a raw http request.
* All other methods such as get, post, patch, and request ultimately call this.
* Prefer get, del, post and patch
*/
async request(verb, requestUrl, data, headers) {
if (this._disposed) {
throw new Error('Client has already been disposed.');
}
let parsedUrl = url.parse(requestUrl);
let info = this._prepareRequest(verb, parsedUrl, headers);
// Only perform retries on reads since writes may not be idempotent.
let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
? this._maxRetries + 1
: 1;
let numTries = 0;
let response;
while (numTries < maxTries) {
response = await this.requestRaw(info, data);
// Check if it's an authentication challenge
if (response &&
response.message &&
response.message.statusCode === HttpCodes.Unauthorized) {
let authenticationHandler;
for (let i = 0; i < this.handlers.length; i++) {
if (this.handlers[i].canHandleAuthentication(response)) {
authenticationHandler = this.handlers[i];
break;
}
}
if (authenticationHandler) {
return authenticationHandler.handleAuthentication(this, info, data);
}
else {
// We have received an unauthorized response but have no handlers to handle it.
// Let the response return to the caller.
return response;
}
}
let redirectsRemaining = this._maxRedirects;
while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
this._allowRedirects &&
redirectsRemaining > 0) {
const redirectUrl = response.message.headers['location'];
if (!redirectUrl) {
// if there's no location to redirect to, we won't
break;
}
let parsedRedirectUrl = url.parse(redirectUrl);
if (parsedUrl.protocol == 'https:' &&
parsedUrl.protocol != parsedRedirectUrl.protocol &&
!this._allowRedirectDowngrade) {
throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');
}
// we need to finish reading the response before reassigning response
// which will leak the open socket.
await response.readBody();
// strip authorization header if redirected to a different hostname
if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
for (let header in headers) {
// header names are case insensitive
if (header.toLowerCase() === 'authorization') {
delete headers[header];
}
}
}
// let's make the request with the new redirectUrl
info = this._prepareRequest(verb, parsedRedirectUrl, headers);
response = await this.requestRaw(info, data);
redirectsRemaining--;
}
if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
// If not a retry code, return immediately instead of retrying
return response;
}
numTries += 1;
if (numTries < maxTries) {
await response.readBody();
await this._performExponentialBackoff(numTries);
}
}
return response;
}
/**
* Needs to be called if keepAlive is set to true in request options.
*/
dispose() {
if (this._agent) {
this._agent.destroy();
}
this._disposed = true;
}
/**
* Raw request.
* @param info
* @param data
*/
requestRaw(info, data) {
return new Promise((resolve, reject) => {
let callbackForResult = function (err, res) {
if (err) {
reject(err);
}
resolve(res);
};
this.requestRawWithCallback(info, data, callbackForResult);
});
}
/**
* Raw request with callback.
* @param info
* @param data
* @param onResult
*/
requestRawWithCallback(info, data, onResult) {
let socket;
if (typeof data === 'string') {
info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
}
let callbackCalled = false;
let handleResult = (err, res) => {
if (!callbackCalled) {
callbackCalled = true;
onResult(err, res);
}
};
let req = info.httpModule.request(info.options, (msg) => {
let res = new HttpClientResponse(msg);
handleResult(null, res);
});
req.on('socket', sock => {
socket = sock;
});
// If we ever get disconnected, we want the socket to timeout eventually
req.setTimeout(this._socketTimeout || 3 * 60000, () => {
if (socket) {
socket.end();
}
handleResult(new Error('Request timeout: ' + info.options.path), null);
});
req.on('error', function (err) {
// err has statusCode property
// res should have headers
handleResult(err, null);
});
if (data && typeof data === 'string') {
req.write(data, 'utf8');
}
if (data && typeof data !== 'string') {
data.on('close', function () {
req.end();
});
data.pipe(req);
}
else {
req.end();
}
}
/**
* Gets an http agent. This function is useful when you need an http agent that handles
* routing through a proxy server - depending upon the url and proxy environment variables.
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
*/
getAgent(serverUrl) {
let parsedUrl = url.parse(serverUrl);
return this._getAgent(parsedUrl);
}
_prepareRequest(method, requestUrl, headers) {
const info = {};
info.parsedUrl = requestUrl;
const usingSsl = info.parsedUrl.protocol === 'https:';
info.httpModule = usingSsl ? https : http;
const defaultPort = usingSsl ? 443 : 80;
info.options = {};
info.options.host = info.parsedUrl.hostname;
info.options.port = info.parsedUrl.port
? parseInt(info.parsedUrl.port)
: defaultPort;
info.options.path =
(info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
info.options.method = method;
info.options.headers = this._mergeHeaders(headers);
if (this.userAgent != null) {
info.options.headers['user-agent'] = this.userAgent;
}
info.options.agent = this._getAgent(info.parsedUrl);
// gives handlers an opportunity to participate
if (this.handlers) {
this.handlers.forEach(handler => {
handler.prepareRequest(info.options);
});
}
return info;
}
_mergeHeaders(headers) {
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
if (this.requestOptions && this.requestOptions.headers) {
return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
}
return lowercaseKeys(headers || {});
}
_getExistingOrDefaultHeader(additionalHeaders, header, _default) {
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
let clientHeader;
if (this.requestOptions && this.requestOptions.headers) {
clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
}
return additionalHeaders[header] || clientHeader || _default;
}
_getAgent(parsedUrl) {
let agent;
let proxyUrl = pm.getProxyUrl(parsedUrl);
let useProxy = proxyUrl && proxyUrl.hostname;
if (this._keepAlive && useProxy) {
agent = this._proxyAgent;
}
if (this._keepAlive && !useProxy) {
agent = this._agent;
}
// if agent is already assigned use that agent.
if (!!agent) {
return agent;
}
const usingSsl = parsedUrl.protocol === 'https:';
let maxSockets = 100;
if (!!this.requestOptions) {
maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
}
if (useProxy) {
// If using proxy, need tunnel
if (!tunnel) {
tunnel = __webpack_require__(856);
}
const agentOptions = {
maxSockets: maxSockets,
keepAlive: this._keepAlive,
proxy: {
proxyAuth: proxyUrl.auth,
host: proxyUrl.hostname,
port: proxyUrl.port
}
};
let tunnelAgent;
const overHttps = proxyUrl.protocol === 'https:';
if (usingSsl) {
tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
}
else {
tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
}
agent = tunnelAgent(agentOptions);
this._proxyAgent = agent;
}
// if reusing agent across request and tunneling agent isn't assigned create a new agent
if (this._keepAlive && !agent) {
const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
this._agent = agent;
}
// if not using private agent and tunnel agent isn't setup then use global agent
if (!agent) {
agent = usingSsl ? https.globalAgent : http.globalAgent;
}
if (usingSsl && this._ignoreSslError) {
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
// we have to cast it to any and change it directly
agent.options = Object.assign(agent.options || {}, {
rejectUnauthorized: false
});
}
return agent;
}
_performExponentialBackoff(retryNumber) {
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
return new Promise(resolve => setTimeout(() => resolve(), ms));
}
static dateTimeDeserializer(key, value) {
if (typeof value === 'string') {
let a = new Date(value);
if (!isNaN(a.valueOf())) {
return a;
}
}
return value;
}
async _processResponse(res, options) {
return new Promise(async (resolve, reject) => {
const statusCode = res.message.statusCode;
const response = {
statusCode: statusCode,
result: null,
headers: {}
};
// not found leads to null obj returned
if (statusCode == HttpCodes.NotFound) {
resolve(response);
}
let obj;
let contents;
// get the result from the body
try {
contents = await res.readBody();
if (contents && contents.length > 0) {
if (options && options.deserializeDates) {
obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
}
else {
obj = JSON.parse(contents);
}
response.result = obj;
}
response.headers = res.message.headers;
}
catch (err) {
// Invalid resource (contents not json); leaving result obj null
}
// note that 3xx redirects are handled by the http layer.
if (statusCode > 299) {
let msg;
// if exception/error in body, attempt to get better error
if (obj && obj.message) {
msg = obj.message;
}
else if (contents && contents.length > 0) {
// it may be the case that the exception is in the body message as string
msg = contents;
}
else {
msg = 'Failed request: (' + statusCode + ')';
}
let err = new Error(msg);
// attach statusCode and body obj (if available) to the error object
err['statusCode'] = statusCode;
if (response.result) {
err['result'] = response.result;
}
reject(err);
}
else {
resolve(response);
}
});
}
}
exports.HttpClient = HttpClient;
/***/ }),
/***/ 550:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = getNextPage
const getPage = __webpack_require__(265)
function getNextPage (octokit, link, headers) {
return getPage(octokit, link, 'next', headers)
}
/***/ }),
/***/ 558:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = hasPreviousPage
const deprecate = __webpack_require__(370)
const getPageLinks = __webpack_require__(577)
function hasPreviousPage (link) {
deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
return getPageLinks(link).prev
}
/***/ }),
/***/ 562:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var osName = _interopDefault(__webpack_require__(2));
function getUserAgent() {
try {
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
} catch (error) {
if (/wmic os get Caption/.test(error.message)) {
return "Windows <version undetectable>";
}
return "<environment undetectable>";
}
}
exports.getUserAgent = getUserAgent;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 563:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = getPreviousPage
const getPage = __webpack_require__(265)
function getPreviousPage (octokit, link, headers) {
return getPage(octokit, link, 'prev', headers)
}
/***/ }),
/***/ 564:
/***/ (function(__unusedmodule, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PYENV_VERSION = '1.2.18';
/***/ }),
/***/ 568:
/***/ (function(module, __unusedexports, __webpack_require__) {
"use strict";
const path = __webpack_require__(622);
const niceTry = __webpack_require__(948);
const resolveCommand = __webpack_require__(489);
const escape = __webpack_require__(462);
const readShebang = __webpack_require__(389);
const semver = __webpack_require__(48);
const isWin = process.platform === 'win32';
const isExecutableRegExp = /\.(?:com|exe)$/i;
const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
// `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
function detectShebang(parsed) {
parsed.file = resolveCommand(parsed);
const shebang = parsed.file && readShebang(parsed.file);
if (shebang) {
parsed.args.unshift(parsed.file);
parsed.command = shebang;
return resolveCommand(parsed);
}
return parsed.file;
}
function parseNonShell(parsed) {
if (!isWin) {
return parsed;
}
// Detect & add support for shebangs
const commandFile = detectShebang(parsed);
// We don't need a shell if the command filename is an executable
const needsShell = !isExecutableRegExp.test(commandFile);
// If a shell is required, use cmd.exe and take care of escaping everything correctly
// Note that `forceShell` is an hidden option used only in tests
if (parsed.options.forceShell || needsShell) {
// Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
// The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
// Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
// we need to double escape them
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
// Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
// This is necessary otherwise it will always fail with ENOENT in those cases
parsed.command = path.normalize(parsed.command);
// Escape command & arguments
parsed.command = escape.command(parsed.command);
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
const shellCommand = [parsed.command].concat(parsed.args).join(' ');
parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
parsed.command = process.env.comspec || 'cmd.exe';
parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
}
return parsed;
}
function parseShell(parsed) {
// If node supports the shell option, there's no need to mimic its behavior
if (supportsShellOption) {
return parsed;
}
// Mimic node shell option
// See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
const shellCommand = [parsed.command].concat(parsed.args).join(' ');
if (isWin) {
parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
} else {
if (typeof parsed.options.shell === 'string') {
parsed.command = parsed.options.shell;
} else if (process.platform === 'android') {
parsed.command = '/system/bin/sh';
} else {
parsed.command = '/bin/sh';
}
parsed.args = ['-c', shellCommand];
}
return parsed;
}
function parse(command, args, options) {
// Normalize arguments, similar to nodejs
if (args && !Array.isArray(args)) {
options = args;
args = null;
}
args = args ? args.slice(0) : []; // Clone array to avoid changing the original
options = Object.assign({}, options); // Clone object to avoid changing the original
// Build our parsed object
const parsed = {
command,
args,
options,
file: undefined,
original: {
command,
args,
},
};
// Delegate further parsing to shell or non-shell
return options.shell ? parseShell(parsed) : parseNonShell(parsed);
}
module.exports = parse;
/***/ }),
/***/ 577:
/***/ (function(module) {
module.exports = getPageLinks
function getPageLinks (link) {
link = link.link || link.headers.link || ''
const links = {}
// link format:
// '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
links[type] = uri
})
return links
}
/***/ }),
/***/ 605:
/***/ (function(module) {
module.exports = require("http");
/***/ }),
/***/ 614:
/***/ (function(module) {
module.exports = require("events");
/***/ }),
/***/ 621:
/***/ (function(module, __unusedexports, __webpack_require__) {
"use strict";
const path = __webpack_require__(622);
const pathKey = __webpack_require__(39);
module.exports = opts => {
opts = Object.assign({
cwd: process.cwd(),
path: process.env[pathKey()]
}, opts);
let prev;
let pth = path.resolve(opts.cwd);
const ret = [];
while (prev !== pth) {
ret.push(path.join(pth, 'node_modules/.bin'));
prev = pth;
pth = path.resolve(pth, '..');
}
// ensure the running `node` binary is used
ret.push(path.dirname(process.execPath));
return ret.concat(opts.path).join(path.delimiter);
};
module.exports.env = opts => {
opts = Object.assign({
env: process.env
}, opts);
const env = Object.assign({}, opts.env);
const path = pathKey({env});
opts.path = env[path];
env[path] = module.exports(opts);
return env;
};
/***/ }),
/***/ 622:
/***/ (function(module) {
module.exports = require("path");
/***/ }),
/***/ 631:
/***/ (function(module) {
module.exports = require("net");
/***/ }),
/***/ 643:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(__webpack_require__(622));
const fs = __importStar(__webpack_require__(747));
const core = __importStar(__webpack_require__(470));
const github = __importStar(__webpack_require__(469));
const tc = __importStar(__webpack_require__(533));
const exec = __importStar(__webpack_require__(986));
const utils = __importStar(__webpack_require__(163));
class ParsedInputs {
constructor() {
this.default_version = core.getInput('default');
this.command = core.getInput('command') || '';
this.explicit_versions = utils.splitcommas(core.getInput('versions'));
}
get versions() {
const values = utils.unique(this.explicit_versions);
if (this.default_version.length > 4) {
values.push(this.default_version);
}
values.sort();
return values;
}
get sanitized_command() {
const parts = this.command.split(/\r?\n/);
const body = parts.join(';\n');
return `${body};`;
}
get_command_as_shell_script(shell, python_version) {
return [
`#!${shell}`,
'# auto-generated by gabrielfalcao/pyenv-action',
'',
'# set python version within this script',
`export PYENV_VERSION="${python_version}";`,
'',
'set -ex;',
'# run user-provided command:',
this.sanitized_command
].join('\n');
}
}
exports.ParsedInputs = ParsedInputs;
class BuildContext {
constructor(params) {
const { pyenv_version } = params;
this.pyenv_version = pyenv_version;
this.inputs = new ParsedInputs();
}
}
exports.BuildContext = BuildContext;
class PyEnvInstaller {
constructor(pyenv_version) {
this.pyenv_version = pyenv_version;
this.archive_path = `/tmp/pyenv-${this.pyenv_version}-inflated`;
this.deflated_location = tc.find('pyenv_root', this.pyenv_version);
}
get archive_url() {
return `https://github.com/pyenv/pyenv/archive/v${this.pyenv_version}.zip`; // note the deliberate "v" prefix of pyenv version
}
get pyenv_root() {
return this.deflated_location;
}
downloadArchive() {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((accept, reject) => {
const cache_key = `pyenv-archive.zip`;
const cache_version = this.pyenv_version;
const cached_archive = tc.find(cache_key, cache_version);
if (utils.file_exists(cached_archive)) {
return accept(path.join(cached_archive, cache_key));
}
console.log(`downloading ${this.archive_url}`);
tc.downloadTool(this.archive_url)
.then(archive_path => {
tc.cacheFile(archive_path, cache_key, cache_key, cache_version)
.then(cached_path => {
if (!utils.folder_exists(cached_path)) {
return reject(new Error(`${cached_path} does not exist`));
}
accept(path.join(cached_path, cache_key));
})
.catch(error => {
console.log(`failed to cache ${archive_path}, proceeding anyway...`);
accept(archive_path);
});
})
.catch(err => {
reject(new Error(`Cannot download archive for pyenv "${this.pyenv_version}": ${err.message}`));
});
});
});
}
installFromArchive(archive_path) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((accept, reject) => {
if (utils.file_exists(this.archive_path)) {
return accept(path.join(this.archive_path, `pyenv-${this.pyenv_version}`));
}
tc.extractZip(archive_path, tc.find('pyenv_archive', this.pyenv_version))
.then(inflation_path => {
console.log(`Extracted ${archive_path} to ${inflation_path}.`);
const deflated_location = path.join(inflation_path, `pyenv-${this.pyenv_version}`); // TODO: find the path with glob matching the version
if (!utils.folder_exists(deflated_location)) {
return reject(new Error(`failed to deflate ${archive_path}: ${deflated_location} does not exist`));
}
tc.cacheDir(deflated_location, 'pyenv_root', this.pyenv_version)
.then(pyenv_root => {
core.setOutput('pyenv_root', pyenv_root);
accept(pyenv_root);
})
.catch(error => {
reject(error);
});
})
.catch(err => {
reject(err);
});
});
});
}
}
exports.PyEnvInstaller = PyEnvInstaller;
class EnvironmentManager {
constructor(params) {
const { context, pyenv_root } = params;
this.context = context;
this.inputs = context.inputs;
this.pyenv_version = context.pyenv_version;
this.pyenv_root = pyenv_root;
this.pyenv_bin_path = `${this.pyenv_root}/bin`;
this.pyenv_shims_path = `${this.pyenv_root}/shims`;
this.command_filename = 'pyenv_post_install.sh';
this.command_script_path = `/tmp/after-each-python-install-command.sh`;
if (!utils.folder_exists(this.pyenv_root)) {
throw new Error(`${this.pyenv_root} does not exist, make sure to install pyenv before setting up the environment`);
}
if (!utils.folder_exists(this.pyenv_bin_path)) {
throw new Error(`${this.pyenv_bin_path} does not exist, make sure to install pyenv before setting up the environment`);
}
}
setup() {
core.exportVariable('PYENV_ROOT', this.pyenv_root);
console.log(`export PYENV_ROOT="${this.pyenv_root}"`);
core.addPath(this.pyenv_bin_path);
core.addPath(this.pyenv_shims_path);
console.log(`Patched PATH with "${this.pyenv_bin_path}"`);
}
ensure_script_exists_with_command(version) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((accept, reject) => {
const cache_key = `pyenv-${this.pyenv_version}-command-${version}`;
const cache_version = version;
if (typeof version != 'string') {
return reject(new Error(`version ${version} is not a string`));
}
if (version.length < 4) {
return reject(new Error(`version "${version}" is invalid`));
}
const command_body = this.context.inputs.get_command_as_shell_script('/bin/bash', version);
const cached_path = tc.find(cache_key, cache_version);
if (utils.file_exists(cached_path)) {
return accept(path.join(cached_path, this.command_filename));
}
fs.writeFile(this.command_script_path, command_body, error => {
if (error)
return reject(error);
tc.cacheFile(this.command_script_path, this.command_filename, cache_key, cache_version)
.then(cached_script_path => {
const script_path = path.join(cached_script_path, this.command_filename);
accept(script_path);
})
.catch(error => {
reject(error);
});
});
});
});
}
run_command_in_python_version(version) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((accept, reject) => {
if (this.context.inputs.command.length == 0) {
console.log(`no "command" input was provided, skipping post-install command.`);
return accept(true);
}
if (typeof version != 'string') {
return reject(new Error(`version ${version} is not a string`));
}
if (version.length < 4) {
return reject(new Error(`version "${version}" is invalid`));
}
this.ensure_script_exists_with_command(version)
.then(command_path => {
exec
.exec(`bash ${command_path}`)
.then(() => {
accept(true);
})
.catch(error => {
reject(error);
});
})
.catch(error => {
reject(error);
});
});
});
}
get_path_to_python_installation(python_version) {
return `${this.pyenv_root}/versions/${python_version}`;
}
install_python_with_pyenv(version) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((accept, reject) => {
if (typeof version != 'string') {
return reject(new Error(`${version} is not a string`));
}
if (version.length < 4) {
return reject(new Error(`version "${version}" is invalid`));
}
const cache_key = `pyenv-${this.pyenv_version}-python`;
const cache_version = version;
const cached_python = tc.find(cache_key, cache_version);
if (utils.folder_exists(cached_python)) {
console.log(`Using cached python installation ${version}`);
return accept(cached_python);
}
exec
.exec(`pyenv install ${version}`)
.then(() => {
console.log(`Sucessfully installed python ${version}`);
tc.cacheDir(this.get_path_to_python_installation(version), cache_key, cache_version).then(cached_path => {
this.run_command_in_python_version(version)
.then(() => {
accept(cached_path);
})
.catch(error => {
console.error(`Failed to run command for pyenv's python ${version}`);
reject(error);
});
});
})
.catch(error => {
console.error(`Failed to install python ${version}`);
reject(error);
});
});
});
}
install_versions() {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((accept, reject) => {
const installed = [];
this.context.inputs.versions.forEach(version => {
this.install_python_with_pyenv(version)
.then(() => {
installed.push(version);
if (installed.length == this.inputs.versions.length) {
accept(installed);
}
})
.catch(error => {
reject(error);
});
});
});
});
}
set_default_version() {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((accept, reject) => {
const version = this.context.inputs.default_version;
const cached_python = tc.find(`pyenv-${this.pyenv_version}-python`, version);
if (!utils.folder_exists(cached_python)) {
return reject(new Error(`python ${version} was not installed via pyenv`));
}
exec
.exec(`pyenv local ${this.context.inputs.default_version}`)
.then(() => {
console.log(`Sucessfully installed python ${version}`);
accept(cached_python);
})
.catch(error => {
console.error(`Failed to set python ${version}: {error.message}`);
reject(error);
});
});
});
}
debug() {
const payload = JSON.stringify(github.context.payload, undefined, 2);
console.log(`Event payload: ${payload}`);
}
}
exports.EnvironmentManager = EnvironmentManager;
/***/ }),
/***/ 649:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = getLastPage
const getPage = __webpack_require__(265)
function getLastPage (octokit, link, headers) {
return getPage(octokit, link, 'last', headers)
}
/***/ }),
/***/ 654:
/***/ (function(module) {
// This is not the set of all possible signals.
//
// It IS, however, the set of all signals that trigger
// an exit on either Linux or BSD systems. Linux is a
// superset of the signal names supported on BSD, and
// the unknown signals just fail to register, so we can
// catch that easily enough.
//
// Don't bother with SIGKILL. It's uncatchable, which
// means that we can't fire any callbacks anyway.
//
// If a user does happen to register a handler on a non-
// fatal signal like SIGWINCH or something, and then
// exit, it'll end up firing `process.emit('exit')`, so
// the handler will be fired anyway.
//
// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
// artificially, inherently leave the process in a
// state from which it is not safe to try and enter JS
// listeners.
module.exports = [
'SIGABRT',
'SIGALRM',
'SIGHUP',
'SIGINT',
'SIGTERM'
]
if (process.platform !== 'win32') {
module.exports.push(
'SIGVTALRM',
'SIGXCPU',
'SIGXFSZ',
'SIGUSR2',
'SIGTRAP',
'SIGSYS',
'SIGQUIT',
'SIGIOT'
// should detect profiler and enable/disable accordingly.
// see #21
// 'SIGPROF'
)
}
if (process.platform === 'linux') {
module.exports.push(
'SIGIO',
'SIGPOLL',
'SIGPWR',
'SIGSTKFLT',
'SIGUNUSED'
)
}
/***/ }),
/***/ 656:
/***/ (function(module, exports) {
exports = module.exports = SemVer
var debug
/* istanbul ignore next */
if (typeof process === 'object' &&
process.env &&
process.env.NODE_DEBUG &&
/\bsemver\b/i.test(process.env.NODE_DEBUG)) {
debug = function () {
var args = Array.prototype.slice.call(arguments, 0)
args.unshift('SEMVER')
console.log.apply(console, args)
}
} else {
debug = function () {}
}
// Note: this is the semver.org version of the spec that it implements
// Not necessarily the package version of this code.
exports.SEMVER_SPEC_VERSION = '2.0.0'
var MAX_LENGTH = 256
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
/* istanbul ignore next */ 9007199254740991
// Max safe segment length for coercion.
var MAX_SAFE_COMPONENT_LENGTH = 16
// The actual regexps go on exports.re
var re = exports.re = []
var src = exports.src = []
var t = exports.tokens = {}
var R = 0
function tok (n) {
t[n] = R++
}
// The following Regular Expressions can be used for tokenizing,
// validating, and parsing SemVer version strings.
// ## Numeric Identifier
// A single `0`, or a non-zero digit followed by zero or more digits.
tok('NUMERICIDENTIFIER')
src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
tok('NUMERICIDENTIFIERLOOSE')
src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
// ## Non-numeric Identifier
// Zero or more digits, followed by a letter or hyphen, and then zero or
// more letters, digits, or hyphens.
tok('NONNUMERICIDENTIFIER')
src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
// ## Main Version
// Three dot-separated numeric identifiers.
tok('MAINVERSION')
src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
'(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
'(' + src[t.NUMERICIDENTIFIER] + ')'
tok('MAINVERSIONLOOSE')
src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
'(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
'(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
// ## Pre-release Version Identifier
// A numeric identifier, or a non-numeric identifier.
tok('PRERELEASEIDENTIFIER')
src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
'|' + src[t.NONNUMERICIDENTIFIER] + ')'
tok('PRERELEASEIDENTIFIERLOOSE')
src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
'|' + src[t.NONNUMERICIDENTIFIER] + ')'
// ## Pre-release Version
// Hyphen, followed by one or more dot-separated pre-release version
// identifiers.
tok('PRERELEASE')
src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
'(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
tok('PRERELEASELOOSE')
src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
'(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
// ## Build Metadata Identifier
// Any combination of digits, letters, or hyphens.
tok('BUILDIDENTIFIER')
src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
// ## Build Metadata
// Plus sign, followed by one or more period-separated build metadata
// identifiers.
tok('BUILD')
src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
'(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
// ## Full Version String
// A main version, followed optionally by a pre-release version and
// build metadata.
// Note that the only major, minor, patch, and pre-release sections of
// the version string are capturing groups. The build metadata is not a
// capturing group, because it should not ever be used in version
// comparison.
tok('FULL')
tok('FULLPLAIN')
src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
src[t.PRERELEASE] + '?' +
src[t.BUILD] + '?'
src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
// common in the npm registry.
tok('LOOSEPLAIN')
src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
src[t.PRERELEASELOOSE] + '?' +
src[t.BUILD] + '?'
tok('LOOSE')
src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
tok('GTLT')
src[t.GTLT] = '((?:<|>)?=?)'
// Something like "2.*" or "1.2.x".
// Note that "x.x" is a valid xRange identifer, meaning "any version"
// Only the first item is strictly required.
tok('XRANGEIDENTIFIERLOOSE')
src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
tok('XRANGEIDENTIFIER')
src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
tok('XRANGEPLAIN')
src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
'(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
'(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
'(?:' + src[t.PRERELEASE] + ')?' +
src[t.BUILD] + '?' +
')?)?'
tok('XRANGEPLAINLOOSE')
src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
'(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
'(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
'(?:' + src[t.PRERELEASELOOSE] + ')?' +
src[t.BUILD] + '?' +
')?)?'
tok('XRANGE')
src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
tok('XRANGELOOSE')
src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
// Coercion.
// Extract anything that could conceivably be a part of a valid semver
tok('COERCE')
src[t.COERCE] = '(^|[^\\d])' +
'(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
'(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
'(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
'(?:$|[^\\d])'
tok('COERCERTL')
re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
// Tilde ranges.
// Meaning is "reasonably at or greater than"
tok('LONETILDE')
src[t.LONETILDE] = '(?:~>?)'
tok('TILDETRIM')
src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
var tildeTrimReplace = '$1~'
tok('TILDE')
src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
tok('TILDELOOSE')
src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
// Caret ranges.
// Meaning is "at least and backwards compatible with"
tok('LONECARET')
src[t.LONECARET] = '(?:\\^)'
tok('CARETTRIM')
src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
var caretTrimReplace = '$1^'
tok('CARET')
src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
tok('CARETLOOSE')
src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
// A simple gt/lt/eq thing, or just "" to indicate "any version"
tok('COMPARATORLOOSE')
src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
tok('COMPARATOR')
src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
// An expression to strip any whitespace between the gtlt and the thing
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
tok('COMPARATORTRIM')
src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
'\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
// this one has to use the /g flag
re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
var comparatorTrimReplace = '$1$2$3'
// Something like `1.2.3 - 1.2.4`
// Note that these all use the loose form, because they'll be
// checked against either the strict or loose comparator form
// later.
tok('HYPHENRANGE')
src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
'\\s+-\\s+' +
'(' + src[t.XRANGEPLAIN] + ')' +
'\\s*$'
tok('HYPHENRANGELOOSE')
src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
'\\s+-\\s+' +
'(' + src[t.XRANGEPLAINLOOSE] + ')' +
'\\s*$'
// Star ranges basically just allow anything at all.
tok('STAR')
src[t.STAR] = '(<|>)?=?\\s*\\*'
// Compile to actual regexp objects.
// All are flag-free, unless they were created above with a flag.
for (var i = 0; i < R; i++) {
debug(i, src[i])
if (!re[i]) {
re[i] = new RegExp(src[i])
}
}
exports.parse = parse
function parse (version, options) {
if (!options || typeof options !== 'object') {
options = {
loose: !!options,
includePrerelease: false
}
}
if (version instanceof SemVer) {
return version
}
if (typeof version !== 'string') {
return null
}
if (version.length > MAX_LENGTH) {
return null
}
var r = options.loose ? re[t.LOOSE] : re[t.FULL]
if (!r.test(version)) {
return null
}
try {
return new SemVer(version, options)
} catch (er) {
return null
}
}
exports.valid = valid
function valid (version, options) {
var v = parse(version, options)
return v ? v.version : null
}
exports.clean = clean
function clean (version, options) {
var s = parse(version.trim().replace(/^[=v]+/, ''), options)
return s ? s.version : null
}
exports.SemVer = SemVer
function SemVer (version, options) {
if (!options || typeof options !== 'object') {
options = {
loose: !!options,
includePrerelease: false
}
}
if (version instanceof SemVer) {
if (version.loose === options.loose) {
return version
} else {
version = version.version
}
} else if (typeof version !== 'string') {
throw new TypeError('Invalid Version: ' + version)
}
if (version.length > MAX_LENGTH) {
throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
}
if (!(this instanceof SemVer)) {
return new SemVer(version, options)
}
debug('SemVer', version, options)
this.options = options
this.loose = !!options.loose
var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
if (!m) {
throw new TypeError('Invalid Version: ' + version)
}
this.raw = version
// these are actually numbers
this.major = +m[1]
this.minor = +m[2]
this.patch = +m[3]
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
throw new TypeError('Invalid major version')
}
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
throw new TypeError('Invalid minor version')
}
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
throw new TypeError('Invalid patch version')
}
// numberify any prerelease numeric ids
if (!m[4]) {
this.prerelease = []
} else {
this.prerelease = m[4].split('.').map(function (id) {
if (/^[0-9]+$/.test(id)) {
var num = +id
if (num >= 0 && num < MAX_SAFE_INTEGER) {
return num
}
}
return id
})
}
this.build = m[5] ? m[5].split('.') : []
this.format()
}
SemVer.prototype.format = function () {
this.version = this.major + '.' + this.minor + '.' + this.patch
if (this.prerelease.length) {
this.version += '-' + this.prerelease.join('.')
}
return this.version
}
SemVer.prototype.toString = function () {
return this.version
}
SemVer.prototype.compare = function (other) {
debug('SemVer.compare', this.version, this.options, other)
if (!(other instanceof SemVer)) {
other = new SemVer(other, this.options)
}
return this.compareMain(other) || this.comparePre(other)
}
SemVer.prototype.compareMain = function (other) {
if (!(other instanceof SemVer)) {
other = new SemVer(other, this.options)
}
return compareIdentifiers(this.major, other.major) ||
compareIdentifiers(this.minor, other.minor) ||
compareIdentifiers(this.patch, other.patch)
}
SemVer.prototype.comparePre = function (other) {
if (!(other instanceof SemVer)) {
other = new SemVer(other, this.options)
}
// NOT having a prerelease is > having one
if (this.prerelease.length && !other.prerelease.length) {
return -1
} else if (!this.prerelease.length && other.prerelease.length) {
return 1
} else if (!this.prerelease.length && !other.prerelease.length) {
return 0
}
var i = 0
do {
var a = this.prerelease[i]
var b = other.prerelease[i]
debug('prerelease compare', i, a, b)
if (a === undefined && b === undefined) {
return 0
} else if (b === undefined) {
return 1
} else if (a === undefined) {
return -1
} else if (a === b) {
continue
} else {
return compareIdentifiers(a, b)
}
} while (++i)
}
SemVer.prototype.compareBuild = function (other) {
if (!(other instanceof SemVer)) {
other = new SemVer(other, this.options)
}
var i = 0
do {
var a = this.build[i]
var b = other.build[i]
debug('prerelease compare', i, a, b)
if (a === undefined && b === undefined) {
return 0
} else if (b === undefined) {
return 1
} else if (a === undefined) {
return -1
} else if (a === b) {
continue
} else {
return compareIdentifiers(a, b)
}
} while (++i)
}
// preminor will bump the version up to the next minor release, and immediately
// down to pre-release. premajor and prepatch work the same way.
SemVer.prototype.inc = function (release, identifier) {
switch (release) {
case 'premajor':
this.prerelease.length = 0
this.patch = 0
this.minor = 0
this.major++
this.inc('pre', identifier)
break
case 'preminor':
this.prerelease.length = 0
this.patch = 0
this.minor++
this.inc('pre', identifier)
break
case 'prepatch':
// If this is already a prerelease, it will bump to the next version
// drop any prereleases that might already exist, since they are not
// relevant at this point.
this.prerelease.length = 0
this.inc('patch', identifier)
this.inc('pre', identifier)
break
// If the input is a non-prerelease version, this acts the same as
// prepatch.
case 'prerelease':
if (this.prerelease.length === 0) {
this.inc('patch', identifier)
}
this.inc('pre', identifier)
break
case 'major':
// If this is a pre-major version, bump up to the same major version.
// Otherwise increment major.
// 1.0.0-5 bumps to 1.0.0
// 1.1.0 bumps to 2.0.0
if (this.minor !== 0 ||
this.patch !== 0 ||
this.prerelease.length === 0) {
this.major++
}
this.minor = 0
this.patch = 0
this.prerelease = []
break
case 'minor':
// If this is a pre-minor version, bump up to the same minor version.
// Otherwise increment minor.
// 1.2.0-5 bumps to 1.2.0
// 1.2.1 bumps to 1.3.0
if (this.patch !== 0 || this.prerelease.length === 0) {
this.minor++
}
this.patch = 0
this.prerelease = []
break
case 'patch':
// If this is not a pre-release version, it will increment the patch.
// If it is a pre-release it will bump up to the same patch version.
// 1.2.0-5 patches to 1.2.0
// 1.2.0 patches to 1.2.1
if (this.prerelease.length === 0) {
this.patch++
}
this.prerelease = []
break
// This probably shouldn't be used publicly.
// 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
case 'pre':
if (this.prerelease.length === 0) {
this.prerelease = [0]
} else {
var i = this.prerelease.length
while (--i >= 0) {
if (typeof this.prerelease[i] === 'number') {
this.prerelease[i]++
i = -2
}
}
if (i === -1) {
// didn't increment anything
this.prerelease.push(0)
}
}
if (identifier) {
// 1.2.0-beta.1 bumps to 1.2.0-beta.2,
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
if (this.prerelease[0] === identifier) {
if (isNaN(this.prerelease[1])) {
this.prerelease = [identifier, 0]
}
} else {
this.prerelease = [identifier, 0]
}
}
break
default:
throw new Error('invalid increment argument: ' + release)
}
this.format()
this.raw = this.version
return this
}
exports.inc = inc
function inc (version, release, loose, identifier) {
if (typeof (loose) === 'string') {
identifier = loose
loose = undefined
}
try {
return new SemVer(version, loose).inc(release, identifier).version
} catch (er) {
return null
}
}
exports.diff = diff
function diff (version1, version2) {
if (eq(version1, version2)) {
return null
} else {
var v1 = parse(version1)
var v2 = parse(version2)
var prefix = ''
if (v1.prerelease.length || v2.prerelease.length) {
prefix = 'pre'
var defaultResult = 'prerelease'
}
for (var key in v1) {
if (key === 'major' || key === 'minor' || key === 'patch') {
if (v1[key] !== v2[key]) {
return prefix + key
}
}
}
return defaultResult // may be undefined
}
}
exports.compareIdentifiers = compareIdentifiers
var numeric = /^[0-9]+$/
function compareIdentifiers (a, b) {
var anum = numeric.test(a)
var bnum = numeric.test(b)
if (anum && bnum) {
a = +a
b = +b
}
return a === b ? 0
: (anum && !bnum) ? -1
: (bnum && !anum) ? 1
: a < b ? -1
: 1
}
exports.rcompareIdentifiers = rcompareIdentifiers
function rcompareIdentifiers (a, b) {
return compareIdentifiers(b, a)
}
exports.major = major
function major (a, loose) {
return new SemVer(a, loose).major
}
exports.minor = minor
function minor (a, loose) {
return new SemVer(a, loose).minor
}
exports.patch = patch
function patch (a, loose) {
return new SemVer(a, loose).patch
}
exports.compare = compare
function compare (a, b, loose) {
return new SemVer(a, loose).compare(new SemVer(b, loose))
}
exports.compareLoose = compareLoose
function compareLoose (a, b) {
return compare(a, b, true)
}
exports.compareBuild = compareBuild
function compareBuild (a, b, loose) {
var versionA = new SemVer(a, loose)
var versionB = new SemVer(b, loose)
return versionA.compare(versionB) || versionA.compareBuild(versionB)
}
exports.rcompare = rcompare
function rcompare (a, b, loose) {
return compare(b, a, loose)
}
exports.sort = sort
function sort (list, loose) {
return list.sort(function (a, b) {
return exports.compareBuild(a, b, loose)
})
}
exports.rsort = rsort
function rsort (list, loose) {
return list.sort(function (a, b) {
return exports.compareBuild(b, a, loose)
})
}
exports.gt = gt
function gt (a, b, loose) {
return compare(a, b, loose) > 0
}
exports.lt = lt
function lt (a, b, loose) {
return compare(a, b, loose) < 0
}
exports.eq = eq
function eq (a, b, loose) {
return compare(a, b, loose) === 0
}
exports.neq = neq
function neq (a, b, loose) {
return compare(a, b, loose) !== 0
}
exports.gte = gte
function gte (a, b, loose) {
return compare(a, b, loose) >= 0
}
exports.lte = lte
function lte (a, b, loose) {
return compare(a, b, loose) <= 0
}
exports.cmp = cmp
function cmp (a, op, b, loose) {
switch (op) {
case '===':
if (typeof a === 'object')
a = a.version
if (typeof b === 'object')
b = b.version
return a === b
case '!==':
if (typeof a === 'object')
a = a.version
if (typeof b === 'object')
b = b.version
return a !== b
case '':
case '=':
case '==':
return eq(a, b, loose)
case '!=':
return neq(a, b, loose)
case '>':
return gt(a, b, loose)
case '>=':
return gte(a, b, loose)
case '<':
return lt(a, b, loose)
case '<=':
return lte(a, b, loose)
default:
throw new TypeError('Invalid operator: ' + op)
}
}
exports.Comparator = Comparator
function Comparator (comp, options) {
if (!options || typeof options !== 'object') {
options = {
loose: !!options,
includePrerelease: false
}
}
if (comp instanceof Comparator) {
if (comp.loose === !!options.loose) {
return comp
} else {
comp = comp.value
}
}
if (!(this instanceof Comparator)) {
return new Comparator(comp, options)
}
debug('comparator', comp, options)
this.options = options
this.loose = !!options.loose
this.parse(comp)
if (this.semver === ANY) {
this.value = ''
} else {
this.value = this.operator + this.semver.version
}
debug('comp', this)
}
var ANY = {}
Comparator.prototype.parse = function (comp) {
var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
var m = comp.match(r)
if (!m) {
throw new TypeError('Invalid comparator: ' + comp)
}
this.operator = m[1] !== undefined ? m[1] : ''
if (this.operator === '=') {
this.operator = ''
}
// if it literally is just '>' or '' then allow anything.
if (!m[2]) {
this.semver = ANY
} else {
this.semver = new SemVer(m[2], this.options.loose)
}
}
Comparator.prototype.toString = function () {
return this.value
}
Comparator.prototype.test = function (version) {
debug('Comparator.test', version, this.options.loose)
if (this.semver === ANY || version === ANY) {
return true
}
if (typeof version === 'string') {
try {
version = new SemVer(version, this.options)
} catch (er) {
return false
}
}
return cmp(version, this.operator, this.semver, this.options)
}
Comparator.prototype.intersects = function (comp, options) {
if (!(comp instanceof Comparator)) {
throw new TypeError('a Comparator is required')
}
if (!options || typeof options !== 'object') {
options = {
loose: !!options,
includePrerelease: false
}
}
var rangeTmp
if (this.operator === '') {
if (this.value === '') {
return true
}
rangeTmp = new Range(comp.value, options)
return satisfies(this.value, rangeTmp, options)
} else if (comp.operator === '') {
if (comp.value === '') {
return true
}
rangeTmp = new Range(this.value, options)
return satisfies(comp.semver, rangeTmp, options)
}
var sameDirectionIncreasing =
(this.operator === '>=' || this.operator === '>') &&
(comp.operator === '>=' || comp.operator === '>')
var sameDirectionDecreasing =
(this.operator === '<=' || this.operator === '<') &&
(comp.operator === '<=' || comp.operator === '<')
var sameSemVer = this.semver.version === comp.semver.version
var differentDirectionsInclusive =
(this.operator === '>=' || this.operator === '<=') &&
(comp.operator === '>=' || comp.operator === '<=')
var oppositeDirectionsLessThan =
cmp(this.semver, '<', comp.semver, options) &&
((this.operator === '>=' || this.operator === '>') &&
(comp.operator === '<=' || comp.operator === '<'))
var oppositeDirectionsGreaterThan =
cmp(this.semver, '>', comp.semver, options) &&
((this.operator === '<=' || this.operator === '<') &&
(comp.operator === '>=' || comp.operator === '>'))
return sameDirectionIncreasing || sameDirectionDecreasing ||
(sameSemVer && differentDirectionsInclusive) ||
oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
}
exports.Range = Range
function Range (range, options) {
if (!options || typeof options !== 'object') {
options = {
loose: !!options,
includePrerelease: false
}
}
if (range instanceof Range) {
if (range.loose === !!options.loose &&
range.includePrerelease === !!options.includePrerelease) {
return range
} else {
return new Range(range.raw, options)
}
}
if (range instanceof Comparator) {
return new Range(range.value, options)
}
if (!(this instanceof Range)) {
return new Range(range, options)
}
this.options = options
this.loose = !!options.loose
this.includePrerelease = !!options.includePrerelease
// First, split based on boolean or ||
this.raw = range
this.set = range.split(/\s*\|\|\s*/).map(function (range) {
return this.parseRange(range.trim())
}, this).filter(function (c) {
// throw out any that are not relevant for whatever reason
return c.length
})
if (!this.set.length) {
throw new TypeError('Invalid SemVer Range: ' + range)
}
this.format()
}
Range.prototype.format = function () {
this.range = this.set.map(function (comps) {
return comps.join(' ').trim()
}).join('||').trim()
return this.range
}
Range.prototype.toString = function () {
return this.range
}
Range.prototype.parseRange = function (range) {
var loose = this.options.loose
range = range.trim()
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
range = range.replace(hr, hyphenReplace)
debug('hyphen replace', range)
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
debug('comparator trim', range, re[t.COMPARATORTRIM])
// `~ 1.2.3` => `~1.2.3`
range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
// `^ 1.2.3` => `^1.2.3`
range = range.replace(re[t.CARETTRIM], caretTrimReplace)
// normalize spaces
range = range.split(/\s+/).join(' ')
// At this point, the range is completely trimmed and
// ready to be split into comparators.
var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
var set = range.split(' ').map(function (comp) {
return parseComparator(comp, this.options)
}, this).join(' ').split(/\s+/)
if (this.options.loose) {
// in loose mode, throw out any that are not valid comparators
set = set.filter(function (comp) {
return !!comp.match(compRe)
})
}
set = set.map(function (comp) {
return new Comparator(comp, this.options)
}, this)
return set
}
Range.prototype.intersects = function (range, options) {
if (!(range instanceof Range)) {
throw new TypeError('a Range is required')
}
return this.set.some(function (thisComparators) {
return (
isSatisfiable(thisComparators, options) &&
range.set.some(function (rangeComparators) {
return (
isSatisfiable(rangeComparators, options) &&
thisComparators.every(function (thisComparator) {
return rangeComparators.every(function (rangeComparator) {
return thisComparator.intersects(rangeComparator, options)
})
})
)
})
)
})
}
// take a set of comparators and determine whether there
// exists a version which can satisfy it
function isSatisfiable (comparators, options) {
var result = true
var remainingComparators = comparators.slice()
var testComparator = remainingComparators.pop()
while (result && remainingComparators.length) {
result = remainingComparators.every(function (otherComparator) {
return testComparator.intersects(otherComparator, options)
})
testComparator = remainingComparators.pop()
}
return result
}
// Mostly just for testing and legacy API reasons
exports.toComparators = toComparators
function toComparators (range, options) {
return new Range(range, options).set.map(function (comp) {
return comp.map(function (c) {
return c.value
}).join(' ').trim().split(' ')
})
}
// comprised of xranges, tildes, stars, and gtlt's at this point.
// already replaced the hyphen ranges
// turn into a set of JUST comparators.
function parseComparator (comp, options) {
debug('comp', comp, options)
comp = replaceCarets(comp, options)
debug('caret', comp)
comp = replaceTildes(comp, options)
debug('tildes', comp)
comp = replaceXRanges(comp, options)
debug('xrange', comp)
comp = replaceStars(comp, options)
debug('stars', comp)
return comp
}
function isX (id) {
return !id || id.toLowerCase() === 'x' || id === '*'
}
// ~, ~> --> * (any, kinda silly)
// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
function replaceTildes (comp, options) {
return comp.trim().split(/\s+/).map(function (comp) {
return replaceTilde(comp, options)
}).join(' ')
}
function replaceTilde (comp, options) {
var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
return comp.replace(r, function (_, M, m, p, pr) {
debug('tilde', comp, _, M, m, p, pr)
var ret
if (isX(M)) {
ret = ''
} else if (isX(m)) {
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
} else if (isX(p)) {
// ~1.2 == >=1.2.0 <1.3.0
ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
} else if (pr) {
debug('replaceTilde pr', pr)
ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
' <' + M + '.' + (+m + 1) + '.0'
} else {
// ~1.2.3 == >=1.2.3 <1.3.0
ret = '>=' + M + '.' + m + '.' + p +
' <' + M + '.' + (+m + 1) + '.0'
}
debug('tilde return', ret)
return ret
})
}
// ^ --> * (any, kinda silly)
// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
// ^1.2.3 --> >=1.2.3 <2.0.0
// ^1.2.0 --> >=1.2.0 <2.0.0
function replaceCarets (comp, options) {
return comp.trim().split(/\s+/).map(function (comp) {
return replaceCaret(comp, options)
}).join(' ')
}
function replaceCaret (comp, options) {
debug('caret', comp, options)
var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
return comp.replace(r, function (_, M, m, p, pr) {
debug('caret', comp, _, M, m, p, pr)
var ret
if (isX(M)) {
ret = ''
} else if (isX(m)) {
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
} else if (isX(p)) {
if (M === '0') {
ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
} else {
ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
}
} else if (pr) {
debug('replaceCaret pr', pr)
if (M === '0') {
if (m === '0') {
ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
' <' + M + '.' + m + '.' + (+p + 1)
} else {
ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
' <' + M + '.' + (+m + 1) + '.0'
}
} else {
ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
' <' + (+M + 1) + '.0.0'
}
} else {
debug('no pr')
if (M === '0') {
if (m === '0') {
ret = '>=' + M + '.' + m + '.' + p +
' <' + M + '.' + m + '.' + (+p + 1)
} else {
ret = '>=' + M + '.' + m + '.' + p +
' <' + M + '.' + (+m + 1) + '.0'
}
} else {
ret = '>=' + M + '.' + m + '.' + p +
' <' + (+M + 1) + '.0.0'
}
}
debug('caret return', ret)
return ret
})
}
function replaceXRanges (comp, options) {
debug('replaceXRanges', comp, options)
return comp.split(/\s+/).map(function (comp) {
return replaceXRange(comp, options)
}).join(' ')
}
function replaceXRange (comp, options) {
comp = comp.trim()
var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
debug('xRange', comp, ret, gtlt, M, m, p, pr)
var xM = isX(M)
var xm = xM || isX(m)
var xp = xm || isX(p)
var anyX = xp
if (gtlt === '=' && anyX) {
gtlt = ''
}
// if we're including prereleases in the match, then we need
// to fix this to -0, the lowest possible prerelease value
pr = options.includePrerelease ? '-0' : ''
if (xM) {
if (gtlt === '>' || gtlt === '<') {
// nothing is allowed
ret = '<0.0.0-0'
} else {
// nothing is forbidden
ret = '*'
}
} else if (gtlt && anyX) {
// we know patch is an x, because we have any x at all.
// replace X with 0
if (xm) {
m = 0
}
p = 0
if (gtlt === '>') {
// >1 => >=2.0.0
// >1.2 => >=1.3.0
// >1.2.3 => >= 1.2.4
gtlt = '>='
if (xm) {
M = +M + 1
m = 0
p = 0
} else {
m = +m + 1
p = 0
}
} else if (gtlt === '<=') {
// <=0.7.x is actually <0.8.0, since any 0.7.x should
// pass. Similarly, <=7.x is actually <8.0.0, etc.
gtlt = '<'
if (xm) {
M = +M + 1
} else {
m = +m + 1
}
}
ret = gtlt + M + '.' + m + '.' + p + pr
} else if (xm) {
ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
} else if (xp) {
ret = '>=' + M + '.' + m + '.0' + pr +
' <' + M + '.' + (+m + 1) + '.0' + pr
}
debug('xRange return', ret)
return ret
})
}
// Because * is AND-ed with everything else in the comparator,
// and '' means "any version", just remove the *s entirely.
function replaceStars (comp, options) {
debug('replaceStars', comp, options)
// Looseness is ignored here. star is always as loose as it gets!
return comp.trim().replace(re[t.STAR], '')
}
// This function is passed to string.replace(re[t.HYPHENRANGE])
// M, m, patch, prerelease, build
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
// 1.2 - 3.4 => >=1.2.0 <3.5.0
function hyphenReplace ($0,
from, fM, fm, fp, fpr, fb,
to, tM, tm, tp, tpr, tb) {
if (isX(fM)) {
from = ''
} else if (isX(fm)) {
from = '>=' + fM + '.0.0'
} else if (isX(fp)) {
from = '>=' + fM + '.' + fm + '.0'
} else {
from = '>=' + from
}
if (isX(tM)) {
to = ''
} else if (isX(tm)) {
to = '<' + (+tM + 1) + '.0.0'
} else if (isX(tp)) {
to = '<' + tM + '.' + (+tm + 1) + '.0'
} else if (tpr) {
to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
} else {
to = '<=' + to
}
return (from + ' ' + to).trim()
}
// if ANY of the sets match ALL of its comparators, then pass
Range.prototype.test = function (version) {
if (!version) {
return false
}
if (typeof version === 'string') {
try {
version = new SemVer(version, this.options)
} catch (er) {
return false
}
}
for (var i = 0; i < this.set.length; i++) {
if (testSet(this.set[i], version, this.options)) {
return true
}
}
return false
}
function testSet (set, version, options) {
for (var i = 0; i < set.length; i++) {
if (!set[i].test(version)) {
return false
}
}
if (version.prerelease.length && !options.includePrerelease) {
// Find the set of versions that are allowed to have prereleases
// For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
// That should allow `1.2.3-pr.2` to pass.
// However, `1.2.4-alpha.notready` should NOT be allowed,
// even though it's within the range set by the comparators.
for (i = 0; i < set.length; i++) {
debug(set[i].semver)
if (set[i].semver === ANY) {
continue
}
if (set[i].semver.prerelease.length > 0) {
var allowed = set[i].semver
if (allowed.major === version.major &&
allowed.minor === version.minor &&
allowed.patch === version.patch) {
return true
}
}
}
// Version has a -pre, but it's not one of the ones we like.
return false
}
return true
}
exports.satisfies = satisfies
function satisfies (version, range, options) {
try {
range = new Range(range, options)
} catch (er) {
return false
}
return range.test(version)
}
exports.maxSatisfying = maxSatisfying
function maxSatisfying (versions, range, options) {
var max = null
var maxSV = null
try {
var rangeObj = new Range(range, options)
} catch (er) {
return null
}
versions.forEach(function (v) {
if (rangeObj.test(v)) {
// satisfies(v, range, options)
if (!max || maxSV.compare(v) === -1) {
// compare(max, v, true)
max = v
maxSV = new SemVer(max, options)
}
}
})
return max
}
exports.minSatisfying = minSatisfying
function minSatisfying (versions, range, options) {
var min = null
var minSV = null
try {
var rangeObj = new Range(range, options)
} catch (er) {
return null
}
versions.forEach(function (v) {
if (rangeObj.test(v)) {
// satisfies(v, range, options)
if (!min || minSV.compare(v) === 1) {
// compare(min, v, true)
min = v
minSV = new SemVer(min, options)
}
}
})
return min
}
exports.minVersion = minVersion
function minVersion (range, loose) {
range = new Range(range, loose)
var minver = new SemVer('0.0.0')
if (range.test(minver)) {
return minver
}
minver = new SemVer('0.0.0-0')
if (range.test(minver)) {
return minver
}
minver = null
for (var i = 0; i < range.set.length; ++i) {
var comparators = range.set[i]
comparators.forEach(function (comparator) {
// Clone to avoid manipulating the comparator's semver object.
var compver = new SemVer(comparator.semver.version)
switch (comparator.operator) {
case '>':
if (compver.prerelease.length === 0) {
compver.patch++
} else {
compver.prerelease.push(0)
}
compver.raw = compver.format()
/* fallthrough */
case '':
case '>=':
if (!minver || gt(minver, compver)) {
minver = compver
}
break
case '<':
case '<=':
/* Ignore maximum versions */
break
/* istanbul ignore next */
default:
throw new Error('Unexpected operation: ' + comparator.operator)
}
})
}
if (minver && range.test(minver)) {
return minver
}
return null
}
exports.validRange = validRange
function validRange (range, options) {
try {
// Return '*' instead of '' so that truthiness works.
// This will throw if it's invalid anyway
return new Range(range, options).range || '*'
} catch (er) {
return null
}
}
// Determine if version is less than all the versions possible in the range
exports.ltr = ltr
function ltr (version, range, options) {
return outside(version, range, '<', options)
}
// Determine if version is greater than all the versions possible in the range.
exports.gtr = gtr
function gtr (version, range, options) {
return outside(version, range, '>', options)
}
exports.outside = outside
function outside (version, range, hilo, options) {
version = new SemVer(version, options)
range = new Range(range, options)
var gtfn, ltefn, ltfn, comp, ecomp
switch (hilo) {
case '>':
gtfn = gt
ltefn = lte
ltfn = lt
comp = '>'
ecomp = '>='
break
case '<':
gtfn = lt
ltefn = gte
ltfn = gt
comp = '<'
ecomp = '<='
break
default:
throw new TypeError('Must provide a hilo val of "<" or ">"')
}
// If it satisifes the range it is not outside
if (satisfies(version, range, options)) {
return false
}
// From now on, variable terms are as if we're in "gtr" mode.
// but note that everything is flipped for the "ltr" function.
for (var i = 0; i < range.set.length; ++i) {
var comparators = range.set[i]
var high = null
var low = null
comparators.forEach(function (comparator) {
if (comparator.semver === ANY) {
comparator = new Comparator('>=0.0.0')
}
high = high || comparator
low = low || comparator
if (gtfn(comparator.semver, high.semver, options)) {
high = comparator
} else if (ltfn(comparator.semver, low.semver, options)) {
low = comparator
}
})
// If the edge version comparator has a operator then our version
// isn't outside it
if (high.operator === comp || high.operator === ecomp) {
return false
}
// If the lowest version comparator has an operator and our version
// is less than it then it isn't higher than the range
if ((!low.operator || low.operator === comp) &&
ltefn(version, low.semver)) {
return false
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
return false
}
}
return true
}
exports.prerelease = prerelease
function prerelease (version, options) {
var parsed = parse(version, options)
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
}
exports.intersects = intersects
function intersects (r1, r2, options) {
r1 = new Range(r1, options)
r2 = new Range(r2, options)
return r1.intersects(r2)
}
exports.coerce = coerce
function coerce (version, options) {
if (version instanceof SemVer) {
return version
}
if (typeof version === 'number') {
version = String(version)
}
if (typeof version !== 'string') {
return null
}
options = options || {}
var match = null
if (!options.rtl) {
match = version.match(re[t.COERCE])
} else {
// Find the right-most coercible string that does not share
// a terminus with a more left-ward coercible string.
// Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
//
// Walk through the string checking with a /g regexp
// Manually set the index so as to pick up overlapping matches.
// Stop when we get a match that ends at the string end, since no
// coercible string can be more right-ward without the same terminus.
var next
while ((next = re[t.COERCERTL].exec(version)) &&
(!match || match.index + match[0].length !== version.length)
) {
if (!match ||
next.index + next[0].length !== match.index + match[0].length) {
match = next
}
re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
}
// leave it in a clean state
re[t.COERCERTL].lastIndex = -1
}
if (match === null) {
return null
}
return parse(match[2] +
'.' + (match[3] || '0') +
'.' + (match[4] || '0'), options)
}
/***/ }),
/***/ 669:
/***/ (function(module) {
module.exports = require("util");
/***/ }),
/***/ 672:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __webpack_require__(357);
const fs = __webpack_require__(747);
const path = __webpack_require__(622);
_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
exports.IS_WINDOWS = process.platform === 'win32';
function exists(fsPath) {
return __awaiter(this, void 0, void 0, function* () {
try {
yield exports.stat(fsPath);
}
catch (err) {
if (err.code === 'ENOENT') {
return false;
}
throw err;
}
return true;
});
}
exports.exists = exists;
function isDirectory(fsPath, useStat = false) {
return __awaiter(this, void 0, void 0, function* () {
const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
return stats.isDirectory();
});
}
exports.isDirectory = isDirectory;
/**
* On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
* \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
*/
function isRooted(p) {
p = normalizeSeparators(p);
if (!p) {
throw new Error('isRooted() parameter "p" cannot be empty');
}
if (exports.IS_WINDOWS) {
return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
); // e.g. C: or C:\hello
}
return p.startsWith('/');
}
exports.isRooted = isRooted;
/**
* Recursively create a directory at `fsPath`.
*
* This implementation is optimistic, meaning it attempts to create the full
* path first, and backs up the path stack from there.
*
* @param fsPath The path to create
* @param maxDepth The maximum recursion depth
* @param depth The current recursion depth
*/
function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
return __awaiter(this, void 0, void 0, function* () {
assert_1.ok(fsPath, 'a path argument must be provided');
fsPath = path.resolve(fsPath);
if (depth >= maxDepth)
return exports.mkdir(fsPath);
try {
yield exports.mkdir(fsPath);
return;
}
catch (err) {
switch (err.code) {
case 'ENOENT': {
yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
yield exports.mkdir(fsPath);
return;
}
default: {
let stats;
try {
stats = yield exports.stat(fsPath);
}
catch (err2) {
throw err;
}
if (!stats.isDirectory())
throw err;
}
}
}
});
}
exports.mkdirP = mkdirP;
/**
* Best effort attempt to determine whether a file exists and is executable.
* @param filePath file path to check
* @param extensions additional file extensions to try
* @return if file exists and is executable, returns the file path. otherwise empty string.
*/
function tryGetExecutablePath(filePath, extensions) {
return __awaiter(this, void 0, void 0, function* () {
let stats = undefined;
try {
// test file exists
stats = yield exports.stat(filePath);
}
catch (err) {
if (err.code !== 'ENOENT') {
// eslint-disable-next-line no-console
console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
}
}
if (stats && stats.isFile()) {
if (exports.IS_WINDOWS) {
// on Windows, test for valid extension
const upperExt = path.extname(filePath).toUpperCase();
if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
return filePath;
}
}
else {
if (isUnixExecutable(stats)) {
return filePath;
}
}
}
// try each extension
const originalFilePath = filePath;
for (const extension of extensions) {
filePath = originalFilePath + extension;
stats = undefined;
try {
stats = yield exports.stat(filePath);
}
catch (err) {
if (err.code !== 'ENOENT') {
// eslint-disable-next-line no-console
console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
}
}
if (stats && stats.isFile()) {
if (exports.IS_WINDOWS) {
// preserve the case of the actual file (since an extension was appended)
try {
const directory = path.dirname(filePath);
const upperName = path.basename(filePath).toUpperCase();
for (const actualName of yield exports.readdir(directory)) {
if (upperName === actualName.toUpperCase()) {
filePath = path.join(directory, actualName);
break;
}
}
}
catch (err) {
// eslint-disable-next-line no-console
console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
}
return filePath;
}
else {
if (isUnixExecutable(stats)) {
return filePath;
}
}
}
}
return '';
});
}
exports.tryGetExecutablePath = tryGetExecutablePath;
function normalizeSeparators(p) {
p = p || '';
if (exports.IS_WINDOWS) {
// convert slashes on Windows
p = p.replace(/\//g, '\\');
// remove redundant slashes
return p.replace(/\\\\+/g, '\\');
}
// remove redundant slashes
return p.replace(/\/\/+/g, '/');
}
// on Mac/Linux, test the execute bit
// R W X R W X R W X
// 256 128 64 32 16 8 4 2 1
function isUnixExecutable(stats) {
return ((stats.mode & 1) > 0 ||
((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
((stats.mode & 64) > 0 && stats.uid === process.getuid()));
}
//# sourceMappingURL=io-util.js.map
/***/ }),
/***/ 674:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = authenticate;
const { Deprecation } = __webpack_require__(692);
const once = __webpack_require__(969);
const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
function authenticate(state, options) {
deprecateAuthenticate(
state.octokit.log,
new Deprecation(
'[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
)
);
if (!options) {
state.auth = false;
return;
}
switch (options.type) {
case "basic":
if (!options.username || !options.password) {
throw new Error(
"Basic authentication requires both a username and password to be set"
);
}
break;
case "oauth":
if (!options.token && !(options.key && options.secret)) {
throw new Error(
"OAuth2 authentication requires a token or key & secret to be set"
);
}
break;
case "token":
case "app":
if (!options.token) {
throw new Error("Token authentication requires a token to be set");
}
break;
default:
throw new Error(
"Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
);
}
state.auth = options;
}
/***/ }),
/***/ 675:
/***/ (function(module) {
module.exports = function btoa(str) {
return new Buffer(str).toString('base64')
}
/***/ }),
/***/ 686:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const os = __webpack_require__(87);
const events = __webpack_require__(614);
const child = __webpack_require__(129);
const path = __webpack_require__(622);
const io = __webpack_require__(1);
const ioUtil = __webpack_require__(672);
/* eslint-disable @typescript-eslint/unbound-method */
const IS_WINDOWS = process.platform === 'win32';
/*
* Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
*/
class ToolRunner extends events.EventEmitter {
constructor(toolPath, args, options) {
super();
if (!toolPath) {
throw new Error("Parameter 'toolPath' cannot be null or empty.");
}
this.toolPath = toolPath;
this.args = args || [];
this.options = options || {};
}
_debug(message) {
if (this.options.listeners && this.options.listeners.debug) {
this.options.listeners.debug(message);
}
}
_getCommandString(options, noPrefix) {
const toolPath = this._getSpawnFileName();
const args = this._getSpawnArgs(options);
let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
if (IS_WINDOWS) {
// Windows + cmd file
if (this._isCmdFile()) {
cmd += toolPath;
for (const a of args) {
cmd += ` ${a}`;
}
}
// Windows + verbatim
else if (options.windowsVerbatimArguments) {
cmd += `"${toolPath}"`;
for (const a of args) {
cmd += ` ${a}`;
}
}
// Windows (regular)
else {
cmd += this._windowsQuoteCmdArg(toolPath);
for (const a of args) {
cmd += ` ${this._windowsQuoteCmdArg(a)}`;
}
}
}
else {
// OSX/Linux - this can likely be improved with some form of quoting.
// creating processes on Unix is fundamentally different than Windows.
// on Unix, execvp() takes an arg array.
cmd += toolPath;
for (const a of args) {
cmd += ` ${a}`;
}
}
return cmd;
}
_processLineBuffer(data, strBuffer, onLine) {
try {
let s = strBuffer + data.toString();
let n = s.indexOf(os.EOL);
while (n > -1) {
const line = s.substring(0, n);
onLine(line);
// the rest of the string ...
s = s.substring(n + os.EOL.length);
n = s.indexOf(os.EOL);
}
strBuffer = s;
}
catch (err) {
// streaming lines to console is best effort. Don't fail a build.
this._debug(`error processing line. Failed with error ${err}`);
}
}
_getSpawnFileName() {
if (IS_WINDOWS) {
if (this._isCmdFile()) {
return process.env['COMSPEC'] || 'cmd.exe';
}
}
return this.toolPath;
}
_getSpawnArgs(options) {
if (IS_WINDOWS) {
if (this._isCmdFile()) {
let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
for (const a of this.args) {
argline += ' ';
argline += options.windowsVerbatimArguments
? a
: this._windowsQuoteCmdArg(a);
}
argline += '"';
return [argline];
}
}
return this.args;
}
_endsWith(str, end) {
return str.endsWith(end);
}
_isCmdFile() {
const upperToolPath = this.toolPath.toUpperCase();
return (this._endsWith(upperToolPath, '.CMD') ||
this._endsWith(upperToolPath, '.BAT'));
}
_windowsQuoteCmdArg(arg) {
// for .exe, apply the normal quoting rules that libuv applies
if (!this._isCmdFile()) {
return this._uvQuoteCmdArg(arg);
}
// otherwise apply quoting rules specific to the cmd.exe command line parser.
// the libuv rules are generic and are not designed specifically for cmd.exe
// command line parser.
//
// for a detailed description of the cmd.exe command line parser, refer to
// http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
// need quotes for empty arg
if (!arg) {
return '""';
}
// determine whether the arg needs to be quoted
const cmdSpecialChars = [
' ',
'\t',
'&',
'(',
')',
'[',
']',
'{',
'}',
'^',
'=',
';',
'!',
"'",
'+',
',',
'`',
'~',
'|',
'<',
'>',
'"'
];
let needsQuotes = false;
for (const char of arg) {
if (cmdSpecialChars.some(x => x === char)) {
needsQuotes = true;
break;
}
}
// short-circuit if quotes not needed
if (!needsQuotes) {
return arg;
}
// the following quoting rules are very similar to the rules that by libuv applies.
//
// 1) wrap the string in quotes
//
// 2) double-up quotes - i.e. " => ""
//
// this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
// doesn't work well with a cmd.exe command line.
//
// note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
// for example, the command line:
// foo.exe "myarg:""my val"""
// is parsed by a .NET console app into an arg array:
// [ "myarg:\"my val\"" ]
// which is the same end result when applying libuv quoting rules. although the actual
// command line from libuv quoting rules would look like:
// foo.exe "myarg:\"my val\""
//
// 3) double-up slashes that precede a quote,
// e.g. hello \world => "hello \world"
// hello\"world => "hello\\""world"
// hello\\"world => "hello\\\\""world"
// hello world\ => "hello world\\"
//
// technically this is not required for a cmd.exe command line, or the batch argument parser.
// the reasons for including this as a .cmd quoting rule are:
//
// a) this is optimized for the scenario where the argument is passed from the .cmd file to an
// external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
//
// b) it's what we've been doing previously (by deferring to node default behavior) and we
// haven't heard any complaints about that aspect.
//
// note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
// escaped when used on the command line directly - even though within a .cmd file % can be escaped
// by using %%.
//
// the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
// the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
//
// one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
// often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
// variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
// to an external program.
//
// an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
// % can be escaped within a .cmd file.
let reverse = '"';
let quoteHit = true;
for (let i = arg.length; i > 0; i--) {
// walk the string in reverse
reverse += arg[i - 1];
if (quoteHit && arg[i - 1] === '\\') {
reverse += '\\'; // double the slash
}
else if (arg[i - 1] === '"') {
quoteHit = true;
reverse += '"'; // double the quote
}
else {
quoteHit = false;
}
}
reverse += '"';
return reverse
.split('')
.reverse()
.join('');
}
_uvQuoteCmdArg(arg) {
// Tool runner wraps child_process.spawn() and needs to apply the same quoting as
// Node in certain cases where the undocumented spawn option windowsVerbatimArguments
// is used.
//
// Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
// see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
// pasting copyright notice from Node within this function:
//
// Copyright Joyent, Inc. and other Node contributors. 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.
if (!arg) {
// Need double quotation for empty argument
return '""';
}
if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
// No quotation needed
return arg;
}
if (!arg.includes('"') && !arg.includes('\\')) {
// No embedded double quotes or backslashes, so I can just wrap
// quote marks around the whole thing.
return `"${arg}"`;
}
// Expected input/output:
// input : hello"world
// output: "hello\"world"
// input : hello""world
// output: "hello\"\"world"
// input : hello\world
// output: hello\world
// input : hello\\world
// output: hello\\world
// input : hello\"world
// output: "hello\\\"world"
// input : hello\\"world
// output: "hello\\\\\"world"
// input : hello world\
// output: "hello world\\" - note the comment in libuv actually reads "hello world\"
// but it appears the comment is wrong, it should be "hello world\\"
let reverse = '"';
let quoteHit = true;
for (let i = arg.length; i > 0; i--) {
// walk the string in reverse
reverse += arg[i - 1];
if (quoteHit && arg[i - 1] === '\\') {
reverse += '\\';
}
else if (arg[i - 1] === '"') {
quoteHit = true;
reverse += '\\';
}
else {
quoteHit = false;
}
}
reverse += '"';
return reverse
.split('')
.reverse()
.join('');
}
_cloneExecOptions(options) {
options = options || {};
const result = {
cwd: options.cwd || process.cwd(),
env: options.env || process.env,
silent: options.silent || false,
windowsVerbatimArguments: options.windowsVerbatimArguments || false,
failOnStdErr: options.failOnStdErr || false,
ignoreReturnCode: options.ignoreReturnCode || false,
delay: options.delay || 10000
};
result.outStream = options.outStream || process.stdout;
result.errStream = options.errStream || process.stderr;
return result;
}
_getSpawnOptions(options, toolPath) {
options = options || {};
const result = {};
result.cwd = options.cwd;
result.env = options.env;
result['windowsVerbatimArguments'] =
options.windowsVerbatimArguments || this._isCmdFile();
if (options.windowsVerbatimArguments) {
result.argv0 = `"${toolPath}"`;
}
return result;
}
/**
* Exec a tool.
* Output will be streamed to the live console.
* Returns promise with return code
*
* @param tool path to tool to exec
* @param options optional exec options. See ExecOptions
* @returns number
*/
exec() {
return __awaiter(this, void 0, void 0, function* () {
// root the tool path if it is unrooted and contains relative pathing
if (!ioUtil.isRooted(this.toolPath) &&
(this.toolPath.includes('/') ||
(IS_WINDOWS && this.toolPath.includes('\\')))) {
// prefer options.cwd if it is specified, however options.cwd may also need to be rooted
this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
}
// if the tool is only a file name, then resolve it from the PATH
// otherwise verify it exists (add extension on Windows if necessary)
this.toolPath = yield io.which(this.toolPath, true);
return new Promise((resolve, reject) => {
this._debug(`exec tool: ${this.toolPath}`);
this._debug('arguments:');
for (const arg of this.args) {
this._debug(` ${arg}`);
}
const optionsNonNull = this._cloneExecOptions(this.options);
if (!optionsNonNull.silent && optionsNonNull.outStream) {
optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
}
const state = new ExecState(optionsNonNull, this.toolPath);
state.on('debug', (message) => {
this._debug(message);
});
const fileName = this._getSpawnFileName();
const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
const stdbuffer = '';
if (cp.stdout) {
cp.stdout.on('data', (data) => {
if (this.options.listeners && this.options.listeners.stdout) {
this.options.listeners.stdout(data);
}
if (!optionsNonNull.silent && optionsNonNull.outStream) {
optionsNonNull.outStream.write(data);
}
this._processLineBuffer(data, stdbuffer, (line) => {
if (this.options.listeners && this.options.listeners.stdline) {
this.options.listeners.stdline(line);
}
});
});
}
const errbuffer = '';
if (cp.stderr) {
cp.stderr.on('data', (data) => {
state.processStderr = true;
if (this.options.listeners && this.options.listeners.stderr) {
this.options.listeners.stderr(data);
}
if (!optionsNonNull.silent &&
optionsNonNull.errStream &&
optionsNonNull.outStream) {
const s = optionsNonNull.failOnStdErr
? optionsNonNull.errStream
: optionsNonNull.outStream;
s.write(data);
}
this._processLineBuffer(data, errbuffer, (line) => {
if (this.options.listeners && this.options.listeners.errline) {
this.options.listeners.errline(line);
}
});
});
}
cp.on('error', (err) => {
state.processError = err.message;
state.processExited = true;
state.processClosed = true;
state.CheckComplete();
});
cp.on('exit', (code) => {
state.processExitCode = code;
state.processExited = true;
this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
state.CheckComplete();
});
cp.on('close', (code) => {
state.processExitCode = code;
state.processExited = true;
state.processClosed = true;
this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
state.CheckComplete();
});
state.on('done', (error, exitCode) => {
if (stdbuffer.length > 0) {
this.emit('stdline', stdbuffer);
}
if (errbuffer.length > 0) {
this.emit('errline', errbuffer);
}
cp.removeAllListeners();
if (error) {
reject(error);
}
else {
resolve(exitCode);
}
});
});
});
}
}
exports.ToolRunner = ToolRunner;
/**
* Convert an arg string to an array of args. Handles escaping
*
* @param argString string of arguments
* @returns string[] array of arguments
*/
function argStringToArray(argString) {
const args = [];
let inQuotes = false;
let escaped = false;
let arg = '';
function append(c) {
// we only escape double quotes.
if (escaped && c !== '"') {
arg += '\\';
}
arg += c;
escaped = false;
}
for (let i = 0; i < argString.length; i++) {
const c = argString.charAt(i);
if (c === '"') {
if (!escaped) {
inQuotes = !inQuotes;
}
else {
append(c);
}
continue;
}
if (c === '\\' && escaped) {
append(c);
continue;
}
if (c === '\\' && inQuotes) {
escaped = true;
continue;
}
if (c === ' ' && !inQuotes) {
if (arg.length > 0) {
args.push(arg);
arg = '';
}
continue;
}
append(c);
}
if (arg.length > 0) {
args.push(arg.trim());
}
return args;
}
exports.argStringToArray = argStringToArray;
class ExecState extends events.EventEmitter {
constructor(options, toolPath) {
super();
this.processClosed = false; // tracks whether the process has exited and stdio is closed
this.processError = '';
this.processExitCode = 0;
this.processExited = false; // tracks whether the process has exited
this.processStderr = false; // tracks whether stderr was written to
this.delay = 10000; // 10 seconds
this.done = false;
this.timeout = null;
if (!toolPath) {
throw new Error('toolPath must not be empty');
}
this.options = options;
this.toolPath = toolPath;
if (options.delay) {
this.delay = options.delay;
}
}
CheckComplete() {
if (this.done) {
return;
}
if (this.processClosed) {
this._setResult();
}
else if (this.processExited) {
this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
}
}
_debug(message) {
this.emit('debug', message);
}
_setResult() {
// determine whether there is an error
let error;
if (this.processExited) {
if (this.processError) {
error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
}
else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
}
else if (this.processStderr && this.options.failOnStdErr) {
error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
}
}
// clear the timeout
if (this.timeout) {
clearTimeout(this.timeout);
this.timeout = null;
}
this.done = true;
this.emit('done', error, this.processExitCode);
}
static HandleTimeout(state) {
if (state.done) {
return;
}
if (!state.processClosed && state.processExited) {
const message = `The STDIO streams did not close within ${state.delay /
1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
state._debug(message);
}
state._setResult();
}
}
//# sourceMappingURL=toolrunner.js.map
/***/ }),
/***/ 692:
/***/ (function(__unusedmodule, exports) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
class Deprecation extends Error {
constructor(message) {
super(message); // Maintains proper stack trace (only available on V8)
/* istanbul ignore next */
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
this.name = 'Deprecation';
}
}
exports.Deprecation = Deprecation;
/***/ }),
/***/ 696:
/***/ (function(module) {
"use strict";
/*!
* isobject <https://github.com/jonschlinkert/isobject>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function isObject(val) {
return val != null && typeof val === 'object' && Array.isArray(val) === false;
}
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function isObjectObject(o) {
return isObject(o) === true
&& Object.prototype.toString.call(o) === '[object Object]';
}
function isPlainObject(o) {
var ctor,prot;
if (isObjectObject(o) === false) return false;
// If has modified constructor
ctor = o.constructor;
if (typeof ctor !== 'function') return false;
// If has modified prototype
prot = ctor.prototype;
if (isObjectObject(prot) === false) return false;
// If constructor does not have an Object-specific method
if (prot.hasOwnProperty('isPrototypeOf') === false) {
return false;
}
// Most likely a plain Object
return true;
}
module.exports = isPlainObject;
/***/ }),
/***/ 697:
/***/ (function(module) {
"use strict";
module.exports = (promise, onFinally) => {
onFinally = onFinally || (() => {});
return promise.then(
val => new Promise(resolve => {
resolve(onFinally());
}).then(() => val),
err => new Promise(resolve => {
resolve(onFinally());
}).then(() => {
throw err;
})
);
};
/***/ }),
/***/ 722:
/***/ (function(module) {
/**
* Convert array of 16 byte values to UUID string format of the form:
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
*/
var byteToHex = [];
for (var i = 0; i < 256; ++i) {
byteToHex[i] = (i + 0x100).toString(16).substr(1);
}
function bytesToUuid(buf, offset) {
var i = offset || 0;
var bth = byteToHex;
// join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
return ([
bth[buf[i++]], bth[buf[i++]],
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]],
bth[buf[i++]], bth[buf[i++]],
bth[buf[i++]], bth[buf[i++]]
]).join('');
}
module.exports = bytesToUuid;
/***/ }),
/***/ 742:
/***/ (function(module, __unusedexports, __webpack_require__) {
var fs = __webpack_require__(747)
var core
if (process.platform === 'win32' || global.TESTING_WINDOWS) {
core = __webpack_require__(818)
} else {
core = __webpack_require__(197)
}
module.exports = isexe
isexe.sync = sync
function isexe (path, options, cb) {
if (typeof options === 'function') {
cb = options
options = {}
}
if (!cb) {
if (typeof Promise !== 'function') {
throw new TypeError('callback not provided')
}
return new Promise(function (resolve, reject) {
isexe(path, options || {}, function (er, is) {
if (er) {
reject(er)
} else {
resolve(is)
}
})
})
}
core(path, options || {}, function (er, is) {
// ignore EACCES because that just means we aren't allowed to run it
if (er) {
if (er.code === 'EACCES' || options && options.ignoreErrors) {
er = null
is = false
}
}
cb(er, is)
})
}
function sync (path, options) {
// my kingdom for a filtered catch
try {
return core.sync(path, options || {})
} catch (er) {
if (options && options.ignoreErrors || er.code === 'EACCES') {
return false
} else {
throw er
}
}
}
/***/ }),
/***/ 747:
/***/ (function(module) {
module.exports = require("fs");
/***/ }),
/***/ 753:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var endpoint = __webpack_require__(385);
var universalUserAgent = __webpack_require__(211);
var isPlainObject = _interopDefault(__webpack_require__(696));
var nodeFetch = _interopDefault(__webpack_require__(454));
var requestError = __webpack_require__(463);
const VERSION = "5.3.2";
function getBufferResponse(response) {
return response.arrayBuffer();
}
function fetchWrapper(requestOptions) {
if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
requestOptions.body = JSON.stringify(requestOptions.body);
}
let headers = {};
let status;
let url;
const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
return fetch(requestOptions.url, Object.assign({
method: requestOptions.method,
body: requestOptions.body,
headers: requestOptions.headers,
redirect: requestOptions.redirect
}, requestOptions.request)).then(response => {
url = response.url;
status = response.status;
for (const keyAndValue of response.headers) {
headers[keyAndValue[0]] = keyAndValue[1];
}
if (status === 204 || status === 205) {
return;
} // GitHub API returns 200 for HEAD requests
if (requestOptions.method === "HEAD") {
if (status < 400) {
return;
}
throw new requestError.RequestError(response.statusText, status, {
headers,
request: requestOptions
});
}
if (status === 304) {
throw new requestError.RequestError("Not modified", status, {
headers,
request: requestOptions
});
}
if (status >= 400) {
return response.text().then(message => {
const error = new requestError.RequestError(message, status, {
headers,
request: requestOptions
});
try {
let responseBody = JSON.parse(error.message);
Object.assign(error, responseBody);
let errors = responseBody.errors; // Assumption `errors` would always be in Array format
error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
} catch (e) {// ignore, see octokit/rest.js#684
}
throw error;
});
}
const contentType = response.headers.get("content-type");
if (/application\/json/.test(contentType)) {
return response.json();
}
if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
return response.text();
}
return getBufferResponse(response);
}).then(data => {
return {
status,
url,
headers,
data
};
}).catch(error => {
if (error instanceof requestError.RequestError) {
throw error;
}
throw new requestError.RequestError(error.message, 500, {
headers,
request: requestOptions
});
});
}
function withDefaults(oldEndpoint, newDefaults) {
const endpoint = oldEndpoint.defaults(newDefaults);
const newApi = function (route, parameters) {
const endpointOptions = endpoint.merge(route, parameters);
if (!endpointOptions.request || !endpointOptions.request.hook) {
return fetchWrapper(endpoint.parse(endpointOptions));
}
const request = (route, parameters) => {
return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
};
Object.assign(request, {
endpoint,
defaults: withDefaults.bind(null, endpoint)
});
return endpointOptions.request.hook(request, endpointOptions);
};
return Object.assign(newApi, {
endpoint,
defaults: withDefaults.bind(null, endpoint)
});
}
const request = withDefaults(endpoint.endpoint, {
headers: {
"user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
}
});
exports.request = request;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 761:
/***/ (function(module) {
module.exports = require("zlib");
/***/ }),
/***/ 763:
/***/ (function(module) {
module.exports = removeHook
function removeHook (state, name, method) {
if (!state.registry[name]) {
return
}
var index = state.registry[name]
.map(function (registered) { return registered.orig })
.indexOf(method)
if (index === -1) {
return
}
state.registry[name].splice(index, 1)
}
/***/ }),
/***/ 768:
/***/ (function(module) {
"use strict";
module.exports = function (x) {
var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
if (x[x.length - 1] === lf) {
x = x.slice(0, x.length - 1);
}
if (x[x.length - 1] === cr) {
x = x.slice(0, x.length - 1);
}
return x;
};
/***/ }),
/***/ 777:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = getFirstPage
const getPage = __webpack_require__(265)
function getFirstPage (octokit, link, headers) {
return getPage(octokit, link, 'first', headers)
}
/***/ }),
/***/ 796:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var osName = _interopDefault(__webpack_require__(2));
function getUserAgent() {
try {
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
} catch (error) {
if (/wmic os get Caption/.test(error.message)) {
return "Windows <version undetectable>";
}
throw error;
}
}
exports.getUserAgent = getUserAgent;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 813:
/***/ (function(__unusedmodule, exports) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
async function auth(token) {
const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
return {
type: "token",
token: token,
tokenType
};
}
/**
* Prefix token for usage in the Authorization header
*
* @param token OAuth token or JSON Web Token
*/
function withAuthorizationPrefix(token) {
if (token.split(/\./).length === 3) {
return `bearer ${token}`;
}
return `token ${token}`;
}
async function hook(token, request, route, parameters) {
const endpoint = request.endpoint.merge(route, parameters);
endpoint.headers.authorization = withAuthorizationPrefix(token);
return request(endpoint);
}
const createTokenAuth = function createTokenAuth(token) {
if (!token) {
throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
}
if (typeof token !== "string") {
throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
}
token = token.replace(/^(token|bearer) +/i, "");
return Object.assign(auth.bind(null, token), {
hook: hook.bind(null, token)
});
};
exports.createTokenAuth = createTokenAuth;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 814:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = which
which.sync = whichSync
var isWindows = process.platform === 'win32' ||
process.env.OSTYPE === 'cygwin' ||
process.env.OSTYPE === 'msys'
var path = __webpack_require__(622)
var COLON = isWindows ? ';' : ':'
var isexe = __webpack_require__(742)
function getNotFoundError (cmd) {
var er = new Error('not found: ' + cmd)
er.code = 'ENOENT'
return er
}
function getPathInfo (cmd, opt) {
var colon = opt.colon || COLON
var pathEnv = opt.path || process.env.PATH || ''
var pathExt = ['']
pathEnv = pathEnv.split(colon)
var pathExtExe = ''
if (isWindows) {
pathEnv.unshift(process.cwd())
pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
pathExt = pathExtExe.split(colon)
// Always test the cmd itself first. isexe will check to make sure
// it's found in the pathExt set.
if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
pathExt.unshift('')
}
// If it has a slash, then we don't bother searching the pathenv.
// just check the file itself, and that's it.
if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
pathEnv = ['']
return {
env: pathEnv,
ext: pathExt,
extExe: pathExtExe
}
}
function which (cmd, opt, cb) {
if (typeof opt === 'function') {
cb = opt
opt = {}
}
var info = getPathInfo(cmd, opt)
var pathEnv = info.env
var pathExt = info.ext
var pathExtExe = info.extExe
var found = []
;(function F (i, l) {
if (i === l) {
if (opt.all && found.length)
return cb(null, found)
else
return cb(getNotFoundError(cmd))
}
var pathPart = pathEnv[i]
if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
pathPart = pathPart.slice(1, -1)
var p = path.join(pathPart, cmd)
if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
p = cmd.slice(0, 2) + p
}
;(function E (ii, ll) {
if (ii === ll) return F(i + 1, l)
var ext = pathExt[ii]
isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
if (!er && is) {
if (opt.all)
found.push(p + ext)
else
return cb(null, p + ext)
}
return E(ii + 1, ll)
})
})(0, pathExt.length)
})(0, pathEnv.length)
}
function whichSync (cmd, opt) {
opt = opt || {}
var info = getPathInfo(cmd, opt)
var pathEnv = info.env
var pathExt = info.ext
var pathExtExe = info.extExe
var found = []
for (var i = 0, l = pathEnv.length; i < l; i ++) {
var pathPart = pathEnv[i]
if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
pathPart = pathPart.slice(1, -1)
var p = path.join(pathPart, cmd)
if (!pathPart && /^\.[\\\/]/.test(cmd)) {
p = cmd.slice(0, 2) + p
}
for (var j = 0, ll = pathExt.length; j < ll; j ++) {
var cur = p + pathExt[j]
var is
try {
is = isexe.sync(cur, { pathExt: pathExtExe })
if (is) {
if (opt.all)
found.push(cur)
else
return cur
}
} catch (ex) {}
}
}
if (opt.all && found.length)
return found
if (opt.nothrow)
return null
throw getNotFoundError(cmd)
}
/***/ }),
/***/ 816:
/***/ (function(module) {
"use strict";
module.exports = /^#!.*/;
/***/ }),
/***/ 818:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = isexe
isexe.sync = sync
var fs = __webpack_require__(747)
function checkPathExt (path, options) {
var pathext = options.pathExt !== undefined ?
options.pathExt : process.env.PATHEXT
if (!pathext) {
return true
}
pathext = pathext.split(';')
if (pathext.indexOf('') !== -1) {
return true
}
for (var i = 0; i < pathext.length; i++) {
var p = pathext[i].toLowerCase()
if (p && path.substr(-p.length).toLowerCase() === p) {
return true
}
}
return false
}
function checkStat (stat, path, options) {
if (!stat.isSymbolicLink() && !stat.isFile()) {
return false
}
return checkPathExt(path, options)
}
function isexe (path, options, cb) {
fs.stat(path, function (er, stat) {
cb(er, er ? false : checkStat(stat, path, options))
})
}
function sync (path, options) {
return checkStat(fs.statSync(path), path, options)
}
/***/ }),
/***/ 826:
/***/ (function(module, __unusedexports, __webpack_require__) {
var rng = __webpack_require__(139);
var bytesToUuid = __webpack_require__(722);
function v4(options, buf, offset) {
var i = buf && offset || 0;
if (typeof(options) == 'string') {
buf = options === 'binary' ? new Array(16) : null;
options = null;
}
options = options || {};
var rnds = options.random || (options.rng || rng)();
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
rnds[6] = (rnds[6] & 0x0f) | 0x40;
rnds[8] = (rnds[8] & 0x3f) | 0x80;
// Copy bytes to buffer, if provided
if (buf) {
for (var ii = 0; ii < 16; ++ii) {
buf[i + ii] = rnds[ii];
}
}
return buf || bytesToUuid(rnds);
}
module.exports = v4;
/***/ }),
/***/ 835:
/***/ (function(module) {
module.exports = require("url");
/***/ }),
/***/ 842:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
var deprecation = __webpack_require__(692);
var endpointsByScope = {
actions: {
cancelWorkflowRun: {
method: "POST",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
run_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/actions/runs/:run_id/cancel"
},
createOrUpdateSecretForRepo: {
method: "PUT",
params: {
encrypted_value: {
type: "string"
},
key_id: {
type: "string"
},
name: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/actions/secrets/:name"
},
createRegistrationToken: {
method: "POST",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/actions/runners/registration-token"
},
createRemoveToken: {
method: "POST",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/actions/runners/remove-token"
},
deleteArtifact: {
method: "DELETE",
params: {
artifact_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
},
deleteSecretFromRepo: {
method: "DELETE",
params: {
name: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/actions/secrets/:name"
},
downloadArtifact: {
method: "GET",
params: {
archive_format: {
required: true,
type: "string"
},
artifact_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format"
},
getArtifact: {
method: "GET",
params: {
artifact_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
},
getPublicKey: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/actions/secrets/public-key"
},
getSecret: {
method: "GET",
params: {
name: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/actions/secrets/:name"
},
getSelfHostedRunner: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
runner_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/actions/runners/:runner_id"
},
getWorkflow: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
workflow_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/actions/workflows/:workflow_id"
},
getWorkflowJob: {
method: "GET",
params: {
job_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/actions/jobs/:job_id"
},
getWorkflowRun: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
run_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/actions/runs/:run_id"
},
listDownloadsForSelfHostedRunnerApplication: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/actions/runners/downloads"
},
listJobsForWorkflowRun: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
run_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/actions/runs/:run_id/jobs"
},
listRepoWorkflowRuns: {
method: "GET",
params: {
actor: {
type: "string"
},
branch: {
type: "string"
},
event: {
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
status: {
enum: ["completed", "status", "conclusion"],
type: "string"
}
},
url: "/repos/:owner/:repo/actions/runs"
},
listRepoWorkflows: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/actions/workflows"
},
listSecretsForRepo: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/actions/secrets"
},
listSelfHostedRunnersForRepo: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/actions/runners"
},
listWorkflowJobLogs: {
method: "GET",
params: {
job_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/actions/jobs/:job_id/logs"
},
listWorkflowRunArtifacts: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
run_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/actions/runs/:run_id/artifacts"
},
listWorkflowRunLogs: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
run_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/actions/runs/:run_id/logs"
},
listWorkflowRuns: {
method: "GET",
params: {
actor: {
type: "string"
},
branch: {
type: "string"
},
event: {
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
status: {
enum: ["completed", "status", "conclusion"],
type: "string"
},
workflow_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/actions/workflows/:workflow_id/runs"
},
reRunWorkflow: {
method: "POST",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
run_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/actions/runs/:run_id/rerun"
},
removeSelfHostedRunner: {
method: "DELETE",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
runner_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/actions/runners/:runner_id"
}
},
activity: {
checkStarringRepo: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/user/starred/:owner/:repo"
},
deleteRepoSubscription: {
method: "DELETE",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/subscription"
},
deleteThreadSubscription: {
method: "DELETE",
params: {
thread_id: {
required: true,
type: "integer"
}
},
url: "/notifications/threads/:thread_id/subscription"
},
getRepoSubscription: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/subscription"
},
getThread: {
method: "GET",
params: {
thread_id: {
required: true,
type: "integer"
}
},
url: "/notifications/threads/:thread_id"
},
getThreadSubscription: {
method: "GET",
params: {
thread_id: {
required: true,
type: "integer"
}
},
url: "/notifications/threads/:thread_id/subscription"
},
listEventsForOrg: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/events/orgs/:org"
},
listEventsForUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/events"
},
listFeeds: {
method: "GET",
params: {},
url: "/feeds"
},
listNotifications: {
method: "GET",
params: {
all: {
type: "boolean"
},
before: {
type: "string"
},
page: {
type: "integer"
},
participating: {
type: "boolean"
},
per_page: {
type: "integer"
},
since: {
type: "string"
}
},
url: "/notifications"
},
listNotificationsForRepo: {
method: "GET",
params: {
all: {
type: "boolean"
},
before: {
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
participating: {
type: "boolean"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
since: {
type: "string"
}
},
url: "/repos/:owner/:repo/notifications"
},
listPublicEvents: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/events"
},
listPublicEventsForOrg: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/orgs/:org/events"
},
listPublicEventsForRepoNetwork: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/networks/:owner/:repo/events"
},
listPublicEventsForUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/events/public"
},
listReceivedEventsForUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/received_events"
},
listReceivedPublicEventsForUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/received_events/public"
},
listRepoEvents: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/events"
},
listReposStarredByAuthenticatedUser: {
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
sort: {
enum: ["created", "updated"],
type: "string"
}
},
url: "/user/starred"
},
listReposStarredByUser: {
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
sort: {
enum: ["created", "updated"],
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/starred"
},
listReposWatchedByUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/subscriptions"
},
listStargazersForRepo: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/stargazers"
},
listWatchedReposForAuthenticatedUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/subscriptions"
},
listWatchersForRepo: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/subscribers"
},
markAsRead: {
method: "PUT",
params: {
last_read_at: {
type: "string"
}
},
url: "/notifications"
},
markNotificationsAsReadForRepo: {
method: "PUT",
params: {
last_read_at: {
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/notifications"
},
markThreadAsRead: {
method: "PATCH",
params: {
thread_id: {
required: true,
type: "integer"
}
},
url: "/notifications/threads/:thread_id"
},
setRepoSubscription: {
method: "PUT",
params: {
ignored: {
type: "boolean"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
subscribed: {
type: "boolean"
}
},
url: "/repos/:owner/:repo/subscription"
},
setThreadSubscription: {
method: "PUT",
params: {
ignored: {
type: "boolean"
},
thread_id: {
required: true,
type: "integer"
}
},
url: "/notifications/threads/:thread_id/subscription"
},
starRepo: {
method: "PUT",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/user/starred/:owner/:repo"
},
unstarRepo: {
method: "DELETE",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/user/starred/:owner/:repo"
}
},
apps: {
addRepoToInstallation: {
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "PUT",
params: {
installation_id: {
required: true,
type: "integer"
},
repository_id: {
required: true,
type: "integer"
}
},
url: "/user/installations/:installation_id/repositories/:repository_id"
},
checkAccountIsAssociatedWithAny: {
method: "GET",
params: {
account_id: {
required: true,
type: "integer"
}
},
url: "/marketplace_listing/accounts/:account_id"
},
checkAccountIsAssociatedWithAnyStubbed: {
method: "GET",
params: {
account_id: {
required: true,
type: "integer"
}
},
url: "/marketplace_listing/stubbed/accounts/:account_id"
},
checkAuthorization: {
deprecated: "octokit.apps.checkAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#check-an-authorization",
method: "GET",
params: {
access_token: {
required: true,
type: "string"
},
client_id: {
required: true,
type: "string"
}
},
url: "/applications/:client_id/tokens/:access_token"
},
checkToken: {
headers: {
accept: "application/vnd.github.doctor-strange-preview+json"
},
method: "POST",
params: {
access_token: {
type: "string"
},
client_id: {
required: true,
type: "string"
}
},
url: "/applications/:client_id/token"
},
createContentAttachment: {
headers: {
accept: "application/vnd.github.corsair-preview+json"
},
method: "POST",
params: {
body: {
required: true,
type: "string"
},
content_reference_id: {
required: true,
type: "integer"
},
title: {
required: true,
type: "string"
}
},
url: "/content_references/:content_reference_id/attachments"
},
createFromManifest: {
headers: {
accept: "application/vnd.github.fury-preview+json"
},
method: "POST",
params: {
code: {
required: true,
type: "string"
}
},
url: "/app-manifests/:code/conversions"
},
createInstallationToken: {
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "POST",
params: {
installation_id: {
required: true,
type: "integer"
},
permissions: {
type: "object"
},
repository_ids: {
type: "integer[]"
}
},
url: "/app/installations/:installation_id/access_tokens"
},
deleteAuthorization: {
headers: {
accept: "application/vnd.github.doctor-strange-preview+json"
},
method: "DELETE",
params: {
access_token: {
type: "string"
},
client_id: {
required: true,
type: "string"
}
},
url: "/applications/:client_id/grant"
},
deleteInstallation: {
headers: {
accept: "application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"
},
method: "DELETE",
params: {
installation_id: {
required: true,
type: "integer"
}
},
url: "/app/installations/:installation_id"
},
deleteToken: {
headers: {
accept: "application/vnd.github.doctor-strange-preview+json"
},
method: "DELETE",
params: {
access_token: {
type: "string"
},
client_id: {
required: true,
type: "string"
}
},
url: "/applications/:client_id/token"
},
findOrgInstallation: {
deprecated: "octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)",
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "GET",
params: {
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/installation"
},
findRepoInstallation: {
deprecated: "octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)",
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/installation"
},
findUserInstallation: {
deprecated: "octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)",
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "GET",
params: {
username: {
required: true,
type: "string"
}
},
url: "/users/:username/installation"
},
getAuthenticated: {
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "GET",
params: {},
url: "/app"
},
getBySlug: {
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "GET",
params: {
app_slug: {
required: true,
type: "string"
}
},
url: "/apps/:app_slug"
},
getInstallation: {
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "GET",
params: {
installation_id: {
required: true,
type: "integer"
}
},
url: "/app/installations/:installation_id"
},
getOrgInstallation: {
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "GET",
params: {
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/installation"
},
getRepoInstallation: {
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/installation"
},
getUserInstallation: {
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "GET",
params: {
username: {
required: true,
type: "string"
}
},
url: "/users/:username/installation"
},
listAccountsUserOrOrgOnPlan: {
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
plan_id: {
required: true,
type: "integer"
},
sort: {
enum: ["created", "updated"],
type: "string"
}
},
url: "/marketplace_listing/plans/:plan_id/accounts"
},
listAccountsUserOrOrgOnPlanStubbed: {
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
plan_id: {
required: true,
type: "integer"
},
sort: {
enum: ["created", "updated"],
type: "string"
}
},
url: "/marketplace_listing/stubbed/plans/:plan_id/accounts"
},
listInstallationReposForAuthenticatedUser: {
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "GET",
params: {
installation_id: {
required: true,
type: "integer"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/installations/:installation_id/repositories"
},
listInstallations: {
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/app/installations"
},
listInstallationsForAuthenticatedUser: {
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/installations"
},
listMarketplacePurchasesForAuthenticatedUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/marketplace_purchases"
},
listMarketplacePurchasesForAuthenticatedUserStubbed: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/marketplace_purchases/stubbed"
},
listPlans: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/marketplace_listing/plans"
},
listPlansStubbed: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/marketplace_listing/stubbed/plans"
},
listRepos: {
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/installation/repositories"
},
removeRepoFromInstallation: {
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "DELETE",
params: {
installation_id: {
required: true,
type: "integer"
},
repository_id: {
required: true,
type: "integer"
}
},
url: "/user/installations/:installation_id/repositories/:repository_id"
},
resetAuthorization: {
deprecated: "octokit.apps.resetAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#reset-an-authorization",
method: "POST",
params: {
access_token: {
required: true,
type: "string"
},
client_id: {
required: true,
type: "string"
}
},
url: "/applications/:client_id/tokens/:access_token"
},
resetToken: {
headers: {
accept: "application/vnd.github.doctor-strange-preview+json"
},
method: "PATCH",
params: {
access_token: {
type: "string"
},
client_id: {
required: true,
type: "string"
}
},
url: "/applications/:client_id/token"
},
revokeAuthorizationForApplication: {
deprecated: "octokit.apps.revokeAuthorizationForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-an-authorization-for-an-application",
method: "DELETE",
params: {
access_token: {
required: true,
type: "string"
},
client_id: {
required: true,
type: "string"
}
},
url: "/applications/:client_id/tokens/:access_token"
},
revokeGrantForApplication: {
deprecated: "octokit.apps.revokeGrantForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-a-grant-for-an-application",
method: "DELETE",
params: {
access_token: {
required: true,
type: "string"
},
client_id: {
required: true,
type: "string"
}
},
url: "/applications/:client_id/grants/:access_token"
},
revokeInstallationToken: {
headers: {
accept: "application/vnd.github.gambit-preview+json"
},
method: "DELETE",
params: {},
url: "/installation/token"
}
},
checks: {
create: {
headers: {
accept: "application/vnd.github.antiope-preview+json"
},
method: "POST",
params: {
actions: {
type: "object[]"
},
"actions[].description": {
required: true,
type: "string"
},
"actions[].identifier": {
required: true,
type: "string"
},
"actions[].label": {
required: true,
type: "string"
},
completed_at: {
type: "string"
},
conclusion: {
enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
type: "string"
},
details_url: {
type: "string"
},
external_id: {
type: "string"
},
head_sha: {
required: true,
type: "string"
},
name: {
required: true,
type: "string"
},
output: {
type: "object"
},
"output.annotations": {
type: "object[]"
},
"output.annotations[].annotation_level": {
enum: ["notice", "warning", "failure"],
required: true,
type: "string"
},
"output.annotations[].end_column": {
type: "integer"
},
"output.annotations[].end_line": {
required: true,
type: "integer"
},
"output.annotations[].message": {
required: true,
type: "string"
},
"output.annotations[].path": {
required: true,
type: "string"
},
"output.annotations[].raw_details": {
type: "string"
},
"output.annotations[].start_column": {
type: "integer"
},
"output.annotations[].start_line": {
required: true,
type: "integer"
},
"output.annotations[].title": {
type: "string"
},
"output.images": {
type: "object[]"
},
"output.images[].alt": {
required: true,
type: "string"
},
"output.images[].caption": {
type: "string"
},
"output.images[].image_url": {
required: true,
type: "string"
},
"output.summary": {
required: true,
type: "string"
},
"output.text": {
type: "string"
},
"output.title": {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
started_at: {
type: "string"
},
status: {
enum: ["queued", "in_progress", "completed"],
type: "string"
}
},
url: "/repos/:owner/:repo/check-runs"
},
createSuite: {
headers: {
accept: "application/vnd.github.antiope-preview+json"
},
method: "POST",
params: {
head_sha: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/check-suites"
},
get: {
headers: {
accept: "application/vnd.github.antiope-preview+json"
},
method: "GET",
params: {
check_run_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/check-runs/:check_run_id"
},
getSuite: {
headers: {
accept: "application/vnd.github.antiope-preview+json"
},
method: "GET",
params: {
check_suite_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/check-suites/:check_suite_id"
},
listAnnotations: {
headers: {
accept: "application/vnd.github.antiope-preview+json"
},
method: "GET",
params: {
check_run_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/check-runs/:check_run_id/annotations"
},
listForRef: {
headers: {
accept: "application/vnd.github.antiope-preview+json"
},
method: "GET",
params: {
check_name: {
type: "string"
},
filter: {
enum: ["latest", "all"],
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
ref: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
status: {
enum: ["queued", "in_progress", "completed"],
type: "string"
}
},
url: "/repos/:owner/:repo/commits/:ref/check-runs"
},
listForSuite: {
headers: {
accept: "application/vnd.github.antiope-preview+json"
},
method: "GET",
params: {
check_name: {
type: "string"
},
check_suite_id: {
required: true,
type: "integer"
},
filter: {
enum: ["latest", "all"],
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
status: {
enum: ["queued", "in_progress", "completed"],
type: "string"
}
},
url: "/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"
},
listSuitesForRef: {
headers: {
accept: "application/vnd.github.antiope-preview+json"
},
method: "GET",
params: {
app_id: {
type: "integer"
},
check_name: {
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
ref: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/commits/:ref/check-suites"
},
rerequestSuite: {
headers: {
accept: "application/vnd.github.antiope-preview+json"
},
method: "POST",
params: {
check_suite_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"
},
setSuitesPreferences: {
headers: {
accept: "application/vnd.github.antiope-preview+json"
},
method: "PATCH",
params: {
auto_trigger_checks: {
type: "object[]"
},
"auto_trigger_checks[].app_id": {
required: true,
type: "integer"
},
"auto_trigger_checks[].setting": {
required: true,
type: "boolean"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/check-suites/preferences"
},
update: {
headers: {
accept: "application/vnd.github.antiope-preview+json"
},
method: "PATCH",
params: {
actions: {
type: "object[]"
},
"actions[].description": {
required: true,
type: "string"
},
"actions[].identifier": {
required: true,
type: "string"
},
"actions[].label": {
required: true,
type: "string"
},
check_run_id: {
required: true,
type: "integer"
},
completed_at: {
type: "string"
},
conclusion: {
enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
type: "string"
},
details_url: {
type: "string"
},
external_id: {
type: "string"
},
name: {
type: "string"
},
output: {
type: "object"
},
"output.annotations": {
type: "object[]"
},
"output.annotations[].annotation_level": {
enum: ["notice", "warning", "failure"],
required: true,
type: "string"
},
"output.annotations[].end_column": {
type: "integer"
},
"output.annotations[].end_line": {
required: true,
type: "integer"
},
"output.annotations[].message": {
required: true,
type: "string"
},
"output.annotations[].path": {
required: true,
type: "string"
},
"output.annotations[].raw_details": {
type: "string"
},
"output.annotations[].start_column": {
type: "integer"
},
"output.annotations[].start_line": {
required: true,
type: "integer"
},
"output.annotations[].title": {
type: "string"
},
"output.images": {
type: "object[]"
},
"output.images[].alt": {
required: true,
type: "string"
},
"output.images[].caption": {
type: "string"
},
"output.images[].image_url": {
required: true,
type: "string"
},
"output.summary": {
required: true,
type: "string"
},
"output.text": {
type: "string"
},
"output.title": {
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
started_at: {
type: "string"
},
status: {
enum: ["queued", "in_progress", "completed"],
type: "string"
}
},
url: "/repos/:owner/:repo/check-runs/:check_run_id"
}
},
codesOfConduct: {
getConductCode: {
headers: {
accept: "application/vnd.github.scarlet-witch-preview+json"
},
method: "GET",
params: {
key: {
required: true,
type: "string"
}
},
url: "/codes_of_conduct/:key"
},
getForRepo: {
headers: {
accept: "application/vnd.github.scarlet-witch-preview+json"
},
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/community/code_of_conduct"
},
listConductCodes: {
headers: {
accept: "application/vnd.github.scarlet-witch-preview+json"
},
method: "GET",
params: {},
url: "/codes_of_conduct"
}
},
emojis: {
get: {
method: "GET",
params: {},
url: "/emojis"
}
},
gists: {
checkIsStarred: {
method: "GET",
params: {
gist_id: {
required: true,
type: "string"
}
},
url: "/gists/:gist_id/star"
},
create: {
method: "POST",
params: {
description: {
type: "string"
},
files: {
required: true,
type: "object"
},
"files.content": {
type: "string"
},
public: {
type: "boolean"
}
},
url: "/gists"
},
createComment: {
method: "POST",
params: {
body: {
required: true,
type: "string"
},
gist_id: {
required: true,
type: "string"
}
},
url: "/gists/:gist_id/comments"
},
delete: {
method: "DELETE",
params: {
gist_id: {
required: true,
type: "string"
}
},
url: "/gists/:gist_id"
},
deleteComment: {
method: "DELETE",
params: {
comment_id: {
required: true,
type: "integer"
},
gist_id: {
required: true,
type: "string"
}
},
url: "/gists/:gist_id/comments/:comment_id"
},
fork: {
method: "POST",
params: {
gist_id: {
required: true,
type: "string"
}
},
url: "/gists/:gist_id/forks"
},
get: {
method: "GET",
params: {
gist_id: {
required: true,
type: "string"
}
},
url: "/gists/:gist_id"
},
getComment: {
method: "GET",
params: {
comment_id: {
required: true,
type: "integer"
},
gist_id: {
required: true,
type: "string"
}
},
url: "/gists/:gist_id/comments/:comment_id"
},
getRevision: {
method: "GET",
params: {
gist_id: {
required: true,
type: "string"
},
sha: {
required: true,
type: "string"
}
},
url: "/gists/:gist_id/:sha"
},
list: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
since: {
type: "string"
}
},
url: "/gists"
},
listComments: {
method: "GET",
params: {
gist_id: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/gists/:gist_id/comments"
},
listCommits: {
method: "GET",
params: {
gist_id: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/gists/:gist_id/commits"
},
listForks: {
method: "GET",
params: {
gist_id: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/gists/:gist_id/forks"
},
listPublic: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
since: {
type: "string"
}
},
url: "/gists/public"
},
listPublicForUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
since: {
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/gists"
},
listStarred: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
since: {
type: "string"
}
},
url: "/gists/starred"
},
star: {
method: "PUT",
params: {
gist_id: {
required: true,
type: "string"
}
},
url: "/gists/:gist_id/star"
},
unstar: {
method: "DELETE",
params: {
gist_id: {
required: true,
type: "string"
}
},
url: "/gists/:gist_id/star"
},
update: {
method: "PATCH",
params: {
description: {
type: "string"
},
files: {
type: "object"
},
"files.content": {
type: "string"
},
"files.filename": {
type: "string"
},
gist_id: {
required: true,
type: "string"
}
},
url: "/gists/:gist_id"
},
updateComment: {
method: "PATCH",
params: {
body: {
required: true,
type: "string"
},
comment_id: {
required: true,
type: "integer"
},
gist_id: {
required: true,
type: "string"
}
},
url: "/gists/:gist_id/comments/:comment_id"
}
},
git: {
createBlob: {
method: "POST",
params: {
content: {
required: true,
type: "string"
},
encoding: {
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/git/blobs"
},
createCommit: {
method: "POST",
params: {
author: {
type: "object"
},
"author.date": {
type: "string"
},
"author.email": {
type: "string"
},
"author.name": {
type: "string"
},
committer: {
type: "object"
},
"committer.date": {
type: "string"
},
"committer.email": {
type: "string"
},
"committer.name": {
type: "string"
},
message: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
parents: {
required: true,
type: "string[]"
},
repo: {
required: true,
type: "string"
},
signature: {
type: "string"
},
tree: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/git/commits"
},
createRef: {
method: "POST",
params: {
owner: {
required: true,
type: "string"
},
ref: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
sha: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/git/refs"
},
createTag: {
method: "POST",
params: {
message: {
required: true,
type: "string"
},
object: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
tag: {
required: true,
type: "string"
},
tagger: {
type: "object"
},
"tagger.date": {
type: "string"
},
"tagger.email": {
type: "string"
},
"tagger.name": {
type: "string"
},
type: {
enum: ["commit", "tree", "blob"],
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/git/tags"
},
createTree: {
method: "POST",
params: {
base_tree: {
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
tree: {
required: true,
type: "object[]"
},
"tree[].content": {
type: "string"
},
"tree[].mode": {
enum: ["100644", "100755", "040000", "160000", "120000"],
type: "string"
},
"tree[].path": {
type: "string"
},
"tree[].sha": {
allowNull: true,
type: "string"
},
"tree[].type": {
enum: ["blob", "tree", "commit"],
type: "string"
}
},
url: "/repos/:owner/:repo/git/trees"
},
deleteRef: {
method: "DELETE",
params: {
owner: {
required: true,
type: "string"
},
ref: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/git/refs/:ref"
},
getBlob: {
method: "GET",
params: {
file_sha: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/git/blobs/:file_sha"
},
getCommit: {
method: "GET",
params: {
commit_sha: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/git/commits/:commit_sha"
},
getRef: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
ref: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/git/ref/:ref"
},
getTag: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
tag_sha: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/git/tags/:tag_sha"
},
getTree: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
recursive: {
enum: ["1"],
type: "integer"
},
repo: {
required: true,
type: "string"
},
tree_sha: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/git/trees/:tree_sha"
},
listMatchingRefs: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
ref: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/git/matching-refs/:ref"
},
listRefs: {
method: "GET",
params: {
namespace: {
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/git/refs/:namespace"
},
updateRef: {
method: "PATCH",
params: {
force: {
type: "boolean"
},
owner: {
required: true,
type: "string"
},
ref: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
sha: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/git/refs/:ref"
}
},
gitignore: {
getTemplate: {
method: "GET",
params: {
name: {
required: true,
type: "string"
}
},
url: "/gitignore/templates/:name"
},
listTemplates: {
method: "GET",
params: {},
url: "/gitignore/templates"
}
},
interactions: {
addOrUpdateRestrictionsForOrg: {
headers: {
accept: "application/vnd.github.sombra-preview+json"
},
method: "PUT",
params: {
limit: {
enum: ["existing_users", "contributors_only", "collaborators_only"],
required: true,
type: "string"
},
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/interaction-limits"
},
addOrUpdateRestrictionsForRepo: {
headers: {
accept: "application/vnd.github.sombra-preview+json"
},
method: "PUT",
params: {
limit: {
enum: ["existing_users", "contributors_only", "collaborators_only"],
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/interaction-limits"
},
getRestrictionsForOrg: {
headers: {
accept: "application/vnd.github.sombra-preview+json"
},
method: "GET",
params: {
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/interaction-limits"
},
getRestrictionsForRepo: {
headers: {
accept: "application/vnd.github.sombra-preview+json"
},
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/interaction-limits"
},
removeRestrictionsForOrg: {
headers: {
accept: "application/vnd.github.sombra-preview+json"
},
method: "DELETE",
params: {
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/interaction-limits"
},
removeRestrictionsForRepo: {
headers: {
accept: "application/vnd.github.sombra-preview+json"
},
method: "DELETE",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/interaction-limits"
}
},
issues: {
addAssignees: {
method: "POST",
params: {
assignees: {
type: "string[]"
},
issue_number: {
required: true,
type: "integer"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number/assignees"
},
addLabels: {
method: "POST",
params: {
issue_number: {
required: true,
type: "integer"
},
labels: {
required: true,
type: "string[]"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number/labels"
},
checkAssignee: {
method: "GET",
params: {
assignee: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/assignees/:assignee"
},
create: {
method: "POST",
params: {
assignee: {
type: "string"
},
assignees: {
type: "string[]"
},
body: {
type: "string"
},
labels: {
type: "string[]"
},
milestone: {
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
title: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues"
},
createComment: {
method: "POST",
params: {
body: {
required: true,
type: "string"
},
issue_number: {
required: true,
type: "integer"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number/comments"
},
createLabel: {
method: "POST",
params: {
color: {
required: true,
type: "string"
},
description: {
type: "string"
},
name: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/labels"
},
createMilestone: {
method: "POST",
params: {
description: {
type: "string"
},
due_on: {
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
state: {
enum: ["open", "closed"],
type: "string"
},
title: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/milestones"
},
deleteComment: {
method: "DELETE",
params: {
comment_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/comments/:comment_id"
},
deleteLabel: {
method: "DELETE",
params: {
name: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/labels/:name"
},
deleteMilestone: {
method: "DELETE",
params: {
milestone_number: {
required: true,
type: "integer"
},
number: {
alias: "milestone_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/milestones/:milestone_number"
},
get: {
method: "GET",
params: {
issue_number: {
required: true,
type: "integer"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number"
},
getComment: {
method: "GET",
params: {
comment_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/comments/:comment_id"
},
getEvent: {
method: "GET",
params: {
event_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/events/:event_id"
},
getLabel: {
method: "GET",
params: {
name: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/labels/:name"
},
getMilestone: {
method: "GET",
params: {
milestone_number: {
required: true,
type: "integer"
},
number: {
alias: "milestone_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/milestones/:milestone_number"
},
list: {
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
filter: {
enum: ["assigned", "created", "mentioned", "subscribed", "all"],
type: "string"
},
labels: {
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
since: {
type: "string"
},
sort: {
enum: ["created", "updated", "comments"],
type: "string"
},
state: {
enum: ["open", "closed", "all"],
type: "string"
}
},
url: "/issues"
},
listAssignees: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/assignees"
},
listComments: {
method: "GET",
params: {
issue_number: {
required: true,
type: "integer"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
since: {
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number/comments"
},
listCommentsForRepo: {
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
since: {
type: "string"
},
sort: {
enum: ["created", "updated"],
type: "string"
}
},
url: "/repos/:owner/:repo/issues/comments"
},
listEvents: {
method: "GET",
params: {
issue_number: {
required: true,
type: "integer"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number/events"
},
listEventsForRepo: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/events"
},
listEventsForTimeline: {
headers: {
accept: "application/vnd.github.mockingbird-preview+json"
},
method: "GET",
params: {
issue_number: {
required: true,
type: "integer"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number/timeline"
},
listForAuthenticatedUser: {
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
filter: {
enum: ["assigned", "created", "mentioned", "subscribed", "all"],
type: "string"
},
labels: {
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
since: {
type: "string"
},
sort: {
enum: ["created", "updated", "comments"],
type: "string"
},
state: {
enum: ["open", "closed", "all"],
type: "string"
}
},
url: "/user/issues"
},
listForOrg: {
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
filter: {
enum: ["assigned", "created", "mentioned", "subscribed", "all"],
type: "string"
},
labels: {
type: "string"
},
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
since: {
type: "string"
},
sort: {
enum: ["created", "updated", "comments"],
type: "string"
},
state: {
enum: ["open", "closed", "all"],
type: "string"
}
},
url: "/orgs/:org/issues"
},
listForRepo: {
method: "GET",
params: {
assignee: {
type: "string"
},
creator: {
type: "string"
},
direction: {
enum: ["asc", "desc"],
type: "string"
},
labels: {
type: "string"
},
mentioned: {
type: "string"
},
milestone: {
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
since: {
type: "string"
},
sort: {
enum: ["created", "updated", "comments"],
type: "string"
},
state: {
enum: ["open", "closed", "all"],
type: "string"
}
},
url: "/repos/:owner/:repo/issues"
},
listLabelsForMilestone: {
method: "GET",
params: {
milestone_number: {
required: true,
type: "integer"
},
number: {
alias: "milestone_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/milestones/:milestone_number/labels"
},
listLabelsForRepo: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/labels"
},
listLabelsOnIssue: {
method: "GET",
params: {
issue_number: {
required: true,
type: "integer"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number/labels"
},
listMilestonesForRepo: {
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
sort: {
enum: ["due_on", "completeness"],
type: "string"
},
state: {
enum: ["open", "closed", "all"],
type: "string"
}
},
url: "/repos/:owner/:repo/milestones"
},
lock: {
method: "PUT",
params: {
issue_number: {
required: true,
type: "integer"
},
lock_reason: {
enum: ["off-topic", "too heated", "resolved", "spam"],
type: "string"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number/lock"
},
removeAssignees: {
method: "DELETE",
params: {
assignees: {
type: "string[]"
},
issue_number: {
required: true,
type: "integer"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number/assignees"
},
removeLabel: {
method: "DELETE",
params: {
issue_number: {
required: true,
type: "integer"
},
name: {
required: true,
type: "string"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number/labels/:name"
},
removeLabels: {
method: "DELETE",
params: {
issue_number: {
required: true,
type: "integer"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number/labels"
},
replaceLabels: {
method: "PUT",
params: {
issue_number: {
required: true,
type: "integer"
},
labels: {
type: "string[]"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number/labels"
},
unlock: {
method: "DELETE",
params: {
issue_number: {
required: true,
type: "integer"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number/lock"
},
update: {
method: "PATCH",
params: {
assignee: {
type: "string"
},
assignees: {
type: "string[]"
},
body: {
type: "string"
},
issue_number: {
required: true,
type: "integer"
},
labels: {
type: "string[]"
},
milestone: {
allowNull: true,
type: "integer"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
state: {
enum: ["open", "closed"],
type: "string"
},
title: {
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number"
},
updateComment: {
method: "PATCH",
params: {
body: {
required: true,
type: "string"
},
comment_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/comments/:comment_id"
},
updateLabel: {
method: "PATCH",
params: {
color: {
type: "string"
},
current_name: {
required: true,
type: "string"
},
description: {
type: "string"
},
name: {
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/labels/:current_name"
},
updateMilestone: {
method: "PATCH",
params: {
description: {
type: "string"
},
due_on: {
type: "string"
},
milestone_number: {
required: true,
type: "integer"
},
number: {
alias: "milestone_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
state: {
enum: ["open", "closed"],
type: "string"
},
title: {
type: "string"
}
},
url: "/repos/:owner/:repo/milestones/:milestone_number"
}
},
licenses: {
get: {
method: "GET",
params: {
license: {
required: true,
type: "string"
}
},
url: "/licenses/:license"
},
getForRepo: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/license"
},
list: {
deprecated: "octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)",
method: "GET",
params: {},
url: "/licenses"
},
listCommonlyUsed: {
method: "GET",
params: {},
url: "/licenses"
}
},
markdown: {
render: {
method: "POST",
params: {
context: {
type: "string"
},
mode: {
enum: ["markdown", "gfm"],
type: "string"
},
text: {
required: true,
type: "string"
}
},
url: "/markdown"
},
renderRaw: {
headers: {
"content-type": "text/plain; charset=utf-8"
},
method: "POST",
params: {
data: {
mapTo: "data",
required: true,
type: "string"
}
},
url: "/markdown/raw"
}
},
meta: {
get: {
method: "GET",
params: {},
url: "/meta"
}
},
migrations: {
cancelImport: {
method: "DELETE",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/import"
},
deleteArchiveForAuthenticatedUser: {
headers: {
accept: "application/vnd.github.wyandotte-preview+json"
},
method: "DELETE",
params: {
migration_id: {
required: true,
type: "integer"
}
},
url: "/user/migrations/:migration_id/archive"
},
deleteArchiveForOrg: {
headers: {
accept: "application/vnd.github.wyandotte-preview+json"
},
method: "DELETE",
params: {
migration_id: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/migrations/:migration_id/archive"
},
downloadArchiveForOrg: {
headers: {
accept: "application/vnd.github.wyandotte-preview+json"
},
method: "GET",
params: {
migration_id: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/migrations/:migration_id/archive"
},
getArchiveForAuthenticatedUser: {
headers: {
accept: "application/vnd.github.wyandotte-preview+json"
},
method: "GET",
params: {
migration_id: {
required: true,
type: "integer"
}
},
url: "/user/migrations/:migration_id/archive"
},
getArchiveForOrg: {
deprecated: "octokit.migrations.getArchiveForOrg() has been renamed to octokit.migrations.downloadArchiveForOrg() (2020-01-27)",
headers: {
accept: "application/vnd.github.wyandotte-preview+json"
},
method: "GET",
params: {
migration_id: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/migrations/:migration_id/archive"
},
getCommitAuthors: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
since: {
type: "string"
}
},
url: "/repos/:owner/:repo/import/authors"
},
getImportProgress: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/import"
},
getLargeFiles: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/import/large_files"
},
getStatusForAuthenticatedUser: {
headers: {
accept: "application/vnd.github.wyandotte-preview+json"
},
method: "GET",
params: {
migration_id: {
required: true,
type: "integer"
}
},
url: "/user/migrations/:migration_id"
},
getStatusForOrg: {
headers: {
accept: "application/vnd.github.wyandotte-preview+json"
},
method: "GET",
params: {
migration_id: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/migrations/:migration_id"
},
listForAuthenticatedUser: {
headers: {
accept: "application/vnd.github.wyandotte-preview+json"
},
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/migrations"
},
listForOrg: {
headers: {
accept: "application/vnd.github.wyandotte-preview+json"
},
method: "GET",
params: {
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/orgs/:org/migrations"
},
listReposForOrg: {
headers: {
accept: "application/vnd.github.wyandotte-preview+json"
},
method: "GET",
params: {
migration_id: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/orgs/:org/migrations/:migration_id/repositories"
},
listReposForUser: {
headers: {
accept: "application/vnd.github.wyandotte-preview+json"
},
method: "GET",
params: {
migration_id: {
required: true,
type: "integer"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/:migration_id/repositories"
},
mapCommitAuthor: {
method: "PATCH",
params: {
author_id: {
required: true,
type: "integer"
},
email: {
type: "string"
},
name: {
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/import/authors/:author_id"
},
setLfsPreference: {
method: "PATCH",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
use_lfs: {
enum: ["opt_in", "opt_out"],
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/import/lfs"
},
startForAuthenticatedUser: {
method: "POST",
params: {
exclude_attachments: {
type: "boolean"
},
lock_repositories: {
type: "boolean"
},
repositories: {
required: true,
type: "string[]"
}
},
url: "/user/migrations"
},
startForOrg: {
method: "POST",
params: {
exclude_attachments: {
type: "boolean"
},
lock_repositories: {
type: "boolean"
},
org: {
required: true,
type: "string"
},
repositories: {
required: true,
type: "string[]"
}
},
url: "/orgs/:org/migrations"
},
startImport: {
method: "PUT",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
tfvc_project: {
type: "string"
},
vcs: {
enum: ["subversion", "git", "mercurial", "tfvc"],
type: "string"
},
vcs_password: {
type: "string"
},
vcs_url: {
required: true,
type: "string"
},
vcs_username: {
type: "string"
}
},
url: "/repos/:owner/:repo/import"
},
unlockRepoForAuthenticatedUser: {
headers: {
accept: "application/vnd.github.wyandotte-preview+json"
},
method: "DELETE",
params: {
migration_id: {
required: true,
type: "integer"
},
repo_name: {
required: true,
type: "string"
}
},
url: "/user/migrations/:migration_id/repos/:repo_name/lock"
},
unlockRepoForOrg: {
headers: {
accept: "application/vnd.github.wyandotte-preview+json"
},
method: "DELETE",
params: {
migration_id: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
},
repo_name: {
required: true,
type: "string"
}
},
url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"
},
updateImport: {
method: "PATCH",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
vcs_password: {
type: "string"
},
vcs_username: {
type: "string"
}
},
url: "/repos/:owner/:repo/import"
}
},
oauthAuthorizations: {
checkAuthorization: {
deprecated: "octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)",
method: "GET",
params: {
access_token: {
required: true,
type: "string"
},
client_id: {
required: true,
type: "string"
}
},
url: "/applications/:client_id/tokens/:access_token"
},
createAuthorization: {
deprecated: "octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization",
method: "POST",
params: {
client_id: {
type: "string"
},
client_secret: {
type: "string"
},
fingerprint: {
type: "string"
},
note: {
required: true,
type: "string"
},
note_url: {
type: "string"
},
scopes: {
type: "string[]"
}
},
url: "/authorizations"
},
deleteAuthorization: {
deprecated: "octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization",
method: "DELETE",
params: {
authorization_id: {
required: true,
type: "integer"
}
},
url: "/authorizations/:authorization_id"
},
deleteGrant: {
deprecated: "octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant",
method: "DELETE",
params: {
grant_id: {
required: true,
type: "integer"
}
},
url: "/applications/grants/:grant_id"
},
getAuthorization: {
deprecated: "octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization",
method: "GET",
params: {
authorization_id: {
required: true,
type: "integer"
}
},
url: "/authorizations/:authorization_id"
},
getGrant: {
deprecated: "octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant",
method: "GET",
params: {
grant_id: {
required: true,
type: "integer"
}
},
url: "/applications/grants/:grant_id"
},
getOrCreateAuthorizationForApp: {
deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app",
method: "PUT",
params: {
client_id: {
required: true,
type: "string"
},
client_secret: {
required: true,
type: "string"
},
fingerprint: {
type: "string"
},
note: {
type: "string"
},
note_url: {
type: "string"
},
scopes: {
type: "string[]"
}
},
url: "/authorizations/clients/:client_id"
},
getOrCreateAuthorizationForAppAndFingerprint: {
deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app-and-fingerprint",
method: "PUT",
params: {
client_id: {
required: true,
type: "string"
},
client_secret: {
required: true,
type: "string"
},
fingerprint: {
required: true,
type: "string"
},
note: {
type: "string"
},
note_url: {
type: "string"
},
scopes: {
type: "string[]"
}
},
url: "/authorizations/clients/:client_id/:fingerprint"
},
getOrCreateAuthorizationForAppFingerprint: {
deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)",
method: "PUT",
params: {
client_id: {
required: true,
type: "string"
},
client_secret: {
required: true,
type: "string"
},
fingerprint: {
required: true,
type: "string"
},
note: {
type: "string"
},
note_url: {
type: "string"
},
scopes: {
type: "string[]"
}
},
url: "/authorizations/clients/:client_id/:fingerprint"
},
listAuthorizations: {
deprecated: "octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations",
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/authorizations"
},
listGrants: {
deprecated: "octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants",
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/applications/grants"
},
resetAuthorization: {
deprecated: "octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)",
method: "POST",
params: {
access_token: {
required: true,
type: "string"
},
client_id: {
required: true,
type: "string"
}
},
url: "/applications/:client_id/tokens/:access_token"
},
revokeAuthorizationForApplication: {
deprecated: "octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)",
method: "DELETE",
params: {
access_token: {
required: true,
type: "string"
},
client_id: {
required: true,
type: "string"
}
},
url: "/applications/:client_id/tokens/:access_token"
},
revokeGrantForApplication: {
deprecated: "octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)",
method: "DELETE",
params: {
access_token: {
required: true,
type: "string"
},
client_id: {
required: true,
type: "string"
}
},
url: "/applications/:client_id/grants/:access_token"
},
updateAuthorization: {
deprecated: "octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization",
method: "PATCH",
params: {
add_scopes: {
type: "string[]"
},
authorization_id: {
required: true,
type: "integer"
},
fingerprint: {
type: "string"
},
note: {
type: "string"
},
note_url: {
type: "string"
},
remove_scopes: {
type: "string[]"
},
scopes: {
type: "string[]"
}
},
url: "/authorizations/:authorization_id"
}
},
orgs: {
addOrUpdateMembership: {
method: "PUT",
params: {
org: {
required: true,
type: "string"
},
role: {
enum: ["admin", "member"],
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/memberships/:username"
},
blockUser: {
method: "PUT",
params: {
org: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/blocks/:username"
},
checkBlockedUser: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/blocks/:username"
},
checkMembership: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/members/:username"
},
checkPublicMembership: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/public_members/:username"
},
concealMembership: {
method: "DELETE",
params: {
org: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/public_members/:username"
},
convertMemberToOutsideCollaborator: {
method: "PUT",
params: {
org: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/outside_collaborators/:username"
},
createHook: {
method: "POST",
params: {
active: {
type: "boolean"
},
config: {
required: true,
type: "object"
},
"config.content_type": {
type: "string"
},
"config.insecure_ssl": {
type: "string"
},
"config.secret": {
type: "string"
},
"config.url": {
required: true,
type: "string"
},
events: {
type: "string[]"
},
name: {
required: true,
type: "string"
},
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/hooks"
},
createInvitation: {
method: "POST",
params: {
email: {
type: "string"
},
invitee_id: {
type: "integer"
},
org: {
required: true,
type: "string"
},
role: {
enum: ["admin", "direct_member", "billing_manager"],
type: "string"
},
team_ids: {
type: "integer[]"
}
},
url: "/orgs/:org/invitations"
},
deleteHook: {
method: "DELETE",
params: {
hook_id: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/hooks/:hook_id"
},
get: {
method: "GET",
params: {
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org"
},
getHook: {
method: "GET",
params: {
hook_id: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/hooks/:hook_id"
},
getMembership: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/memberships/:username"
},
getMembershipForAuthenticatedUser: {
method: "GET",
params: {
org: {
required: true,
type: "string"
}
},
url: "/user/memberships/orgs/:org"
},
list: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
since: {
type: "integer"
}
},
url: "/organizations"
},
listBlockedUsers: {
method: "GET",
params: {
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/blocks"
},
listForAuthenticatedUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/orgs"
},
listForUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/orgs"
},
listHooks: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/orgs/:org/hooks"
},
listInstallations: {
headers: {
accept: "application/vnd.github.machine-man-preview+json"
},
method: "GET",
params: {
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/orgs/:org/installations"
},
listInvitationTeams: {
method: "GET",
params: {
invitation_id: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/orgs/:org/invitations/:invitation_id/teams"
},
listMembers: {
method: "GET",
params: {
filter: {
enum: ["2fa_disabled", "all"],
type: "string"
},
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
role: {
enum: ["all", "admin", "member"],
type: "string"
}
},
url: "/orgs/:org/members"
},
listMemberships: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
state: {
enum: ["active", "pending"],
type: "string"
}
},
url: "/user/memberships/orgs"
},
listOutsideCollaborators: {
method: "GET",
params: {
filter: {
enum: ["2fa_disabled", "all"],
type: "string"
},
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/orgs/:org/outside_collaborators"
},
listPendingInvitations: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/orgs/:org/invitations"
},
listPublicMembers: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/orgs/:org/public_members"
},
pingHook: {
method: "POST",
params: {
hook_id: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/hooks/:hook_id/pings"
},
publicizeMembership: {
method: "PUT",
params: {
org: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/public_members/:username"
},
removeMember: {
method: "DELETE",
params: {
org: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/members/:username"
},
removeMembership: {
method: "DELETE",
params: {
org: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/memberships/:username"
},
removeOutsideCollaborator: {
method: "DELETE",
params: {
org: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/outside_collaborators/:username"
},
unblockUser: {
method: "DELETE",
params: {
org: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/blocks/:username"
},
update: {
method: "PATCH",
params: {
billing_email: {
type: "string"
},
company: {
type: "string"
},
default_repository_permission: {
enum: ["read", "write", "admin", "none"],
type: "string"
},
description: {
type: "string"
},
email: {
type: "string"
},
has_organization_projects: {
type: "boolean"
},
has_repository_projects: {
type: "boolean"
},
location: {
type: "string"
},
members_allowed_repository_creation_type: {
enum: ["all", "private", "none"],
type: "string"
},
members_can_create_internal_repositories: {
type: "boolean"
},
members_can_create_private_repositories: {
type: "boolean"
},
members_can_create_public_repositories: {
type: "boolean"
},
members_can_create_repositories: {
type: "boolean"
},
name: {
type: "string"
},
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org"
},
updateHook: {
method: "PATCH",
params: {
active: {
type: "boolean"
},
config: {
type: "object"
},
"config.content_type": {
type: "string"
},
"config.insecure_ssl": {
type: "string"
},
"config.secret": {
type: "string"
},
"config.url": {
required: true,
type: "string"
},
events: {
type: "string[]"
},
hook_id: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/hooks/:hook_id"
},
updateMembership: {
method: "PATCH",
params: {
org: {
required: true,
type: "string"
},
state: {
enum: ["active"],
required: true,
type: "string"
}
},
url: "/user/memberships/orgs/:org"
}
},
projects: {
addCollaborator: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "PUT",
params: {
permission: {
enum: ["read", "write", "admin"],
type: "string"
},
project_id: {
required: true,
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/projects/:project_id/collaborators/:username"
},
createCard: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "POST",
params: {
column_id: {
required: true,
type: "integer"
},
content_id: {
type: "integer"
},
content_type: {
type: "string"
},
note: {
type: "string"
}
},
url: "/projects/columns/:column_id/cards"
},
createColumn: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "POST",
params: {
name: {
required: true,
type: "string"
},
project_id: {
required: true,
type: "integer"
}
},
url: "/projects/:project_id/columns"
},
createForAuthenticatedUser: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "POST",
params: {
body: {
type: "string"
},
name: {
required: true,
type: "string"
}
},
url: "/user/projects"
},
createForOrg: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "POST",
params: {
body: {
type: "string"
},
name: {
required: true,
type: "string"
},
org: {
required: true,
type: "string"
}
},
url: "/orgs/:org/projects"
},
createForRepo: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "POST",
params: {
body: {
type: "string"
},
name: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/projects"
},
delete: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "DELETE",
params: {
project_id: {
required: true,
type: "integer"
}
},
url: "/projects/:project_id"
},
deleteCard: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "DELETE",
params: {
card_id: {
required: true,
type: "integer"
}
},
url: "/projects/columns/cards/:card_id"
},
deleteColumn: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "DELETE",
params: {
column_id: {
required: true,
type: "integer"
}
},
url: "/projects/columns/:column_id"
},
get: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
project_id: {
required: true,
type: "integer"
}
},
url: "/projects/:project_id"
},
getCard: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
card_id: {
required: true,
type: "integer"
}
},
url: "/projects/columns/cards/:card_id"
},
getColumn: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
column_id: {
required: true,
type: "integer"
}
},
url: "/projects/columns/:column_id"
},
listCards: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
archived_state: {
enum: ["all", "archived", "not_archived"],
type: "string"
},
column_id: {
required: true,
type: "integer"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/projects/columns/:column_id/cards"
},
listCollaborators: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
affiliation: {
enum: ["outside", "direct", "all"],
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
project_id: {
required: true,
type: "integer"
}
},
url: "/projects/:project_id/collaborators"
},
listColumns: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
project_id: {
required: true,
type: "integer"
}
},
url: "/projects/:project_id/columns"
},
listForOrg: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
state: {
enum: ["open", "closed", "all"],
type: "string"
}
},
url: "/orgs/:org/projects"
},
listForRepo: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
state: {
enum: ["open", "closed", "all"],
type: "string"
}
},
url: "/repos/:owner/:repo/projects"
},
listForUser: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
state: {
enum: ["open", "closed", "all"],
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/projects"
},
moveCard: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "POST",
params: {
card_id: {
required: true,
type: "integer"
},
column_id: {
type: "integer"
},
position: {
required: true,
type: "string",
validation: "^(top|bottom|after:\\d+)$"
}
},
url: "/projects/columns/cards/:card_id/moves"
},
moveColumn: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "POST",
params: {
column_id: {
required: true,
type: "integer"
},
position: {
required: true,
type: "string",
validation: "^(first|last|after:\\d+)$"
}
},
url: "/projects/columns/:column_id/moves"
},
removeCollaborator: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "DELETE",
params: {
project_id: {
required: true,
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/projects/:project_id/collaborators/:username"
},
reviewUserPermissionLevel: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
project_id: {
required: true,
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/projects/:project_id/collaborators/:username/permission"
},
update: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "PATCH",
params: {
body: {
type: "string"
},
name: {
type: "string"
},
organization_permission: {
type: "string"
},
private: {
type: "boolean"
},
project_id: {
required: true,
type: "integer"
},
state: {
enum: ["open", "closed"],
type: "string"
}
},
url: "/projects/:project_id"
},
updateCard: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "PATCH",
params: {
archived: {
type: "boolean"
},
card_id: {
required: true,
type: "integer"
},
note: {
type: "string"
}
},
url: "/projects/columns/cards/:card_id"
},
updateColumn: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "PATCH",
params: {
column_id: {
required: true,
type: "integer"
},
name: {
required: true,
type: "string"
}
},
url: "/projects/columns/:column_id"
}
},
pulls: {
checkIfMerged: {
method: "GET",
params: {
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/merge"
},
create: {
method: "POST",
params: {
base: {
required: true,
type: "string"
},
body: {
type: "string"
},
draft: {
type: "boolean"
},
head: {
required: true,
type: "string"
},
maintainer_can_modify: {
type: "boolean"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
title: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls"
},
createComment: {
method: "POST",
params: {
body: {
required: true,
type: "string"
},
commit_id: {
required: true,
type: "string"
},
in_reply_to: {
deprecated: true,
description: "The comment ID to reply to. **Note**: This must be the ID of a top-level comment, not a reply to that comment. Replies to replies are not supported.",
type: "integer"
},
line: {
type: "integer"
},
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
path: {
required: true,
type: "string"
},
position: {
type: "integer"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
},
side: {
enum: ["LEFT", "RIGHT"],
type: "string"
},
start_line: {
type: "integer"
},
start_side: {
enum: ["LEFT", "RIGHT", "side"],
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/comments"
},
createCommentReply: {
deprecated: "octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)",
method: "POST",
params: {
body: {
required: true,
type: "string"
},
commit_id: {
required: true,
type: "string"
},
in_reply_to: {
deprecated: true,
description: "The comment ID to reply to. **Note**: This must be the ID of a top-level comment, not a reply to that comment. Replies to replies are not supported.",
type: "integer"
},
line: {
type: "integer"
},
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
path: {
required: true,
type: "string"
},
position: {
type: "integer"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
},
side: {
enum: ["LEFT", "RIGHT"],
type: "string"
},
start_line: {
type: "integer"
},
start_side: {
enum: ["LEFT", "RIGHT", "side"],
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/comments"
},
createFromIssue: {
deprecated: "octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request",
method: "POST",
params: {
base: {
required: true,
type: "string"
},
draft: {
type: "boolean"
},
head: {
required: true,
type: "string"
},
issue: {
required: true,
type: "integer"
},
maintainer_can_modify: {
type: "boolean"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls"
},
createReview: {
method: "POST",
params: {
body: {
type: "string"
},
comments: {
type: "object[]"
},
"comments[].body": {
required: true,
type: "string"
},
"comments[].path": {
required: true,
type: "string"
},
"comments[].position": {
required: true,
type: "integer"
},
commit_id: {
type: "string"
},
event: {
enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
type: "string"
},
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
},
createReviewCommentReply: {
method: "POST",
params: {
body: {
required: true,
type: "string"
},
comment_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"
},
createReviewRequest: {
method: "POST",
params: {
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
},
reviewers: {
type: "string[]"
},
team_reviewers: {
type: "string[]"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
},
deleteComment: {
method: "DELETE",
params: {
comment_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/comments/:comment_id"
},
deletePendingReview: {
method: "DELETE",
params: {
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
},
review_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
},
deleteReviewRequest: {
method: "DELETE",
params: {
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
},
reviewers: {
type: "string[]"
},
team_reviewers: {
type: "string[]"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
},
dismissReview: {
method: "PUT",
params: {
message: {
required: true,
type: "string"
},
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
},
review_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"
},
get: {
method: "GET",
params: {
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number"
},
getComment: {
method: "GET",
params: {
comment_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/comments/:comment_id"
},
getCommentsForReview: {
method: "GET",
params: {
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
},
review_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"
},
getReview: {
method: "GET",
params: {
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
},
review_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
},
list: {
method: "GET",
params: {
base: {
type: "string"
},
direction: {
enum: ["asc", "desc"],
type: "string"
},
head: {
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
sort: {
enum: ["created", "updated", "popularity", "long-running"],
type: "string"
},
state: {
enum: ["open", "closed", "all"],
type: "string"
}
},
url: "/repos/:owner/:repo/pulls"
},
listComments: {
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
},
since: {
type: "string"
},
sort: {
enum: ["created", "updated"],
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/comments"
},
listCommentsForRepo: {
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
since: {
type: "string"
},
sort: {
enum: ["created", "updated"],
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/comments"
},
listCommits: {
method: "GET",
params: {
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/commits"
},
listFiles: {
method: "GET",
params: {
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/files"
},
listReviewRequests: {
method: "GET",
params: {
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
},
listReviews: {
method: "GET",
params: {
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
},
merge: {
method: "PUT",
params: {
commit_message: {
type: "string"
},
commit_title: {
type: "string"
},
merge_method: {
enum: ["merge", "squash", "rebase"],
type: "string"
},
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
},
sha: {
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/merge"
},
submitReview: {
method: "POST",
params: {
body: {
type: "string"
},
event: {
enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
required: true,
type: "string"
},
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
},
review_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"
},
update: {
method: "PATCH",
params: {
base: {
type: "string"
},
body: {
type: "string"
},
maintainer_can_modify: {
type: "boolean"
},
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
},
state: {
enum: ["open", "closed"],
type: "string"
},
title: {
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number"
},
updateBranch: {
headers: {
accept: "application/vnd.github.lydian-preview+json"
},
method: "PUT",
params: {
expected_head_sha: {
type: "string"
},
owner: {
required: true,
type: "string"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/update-branch"
},
updateComment: {
method: "PATCH",
params: {
body: {
required: true,
type: "string"
},
comment_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/comments/:comment_id"
},
updateReview: {
method: "PUT",
params: {
body: {
required: true,
type: "string"
},
number: {
alias: "pull_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
pull_number: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
},
review_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
}
},
rateLimit: {
get: {
method: "GET",
params: {},
url: "/rate_limit"
}
},
reactions: {
createForCommitComment: {
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "POST",
params: {
comment_id: {
required: true,
type: "integer"
},
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/comments/:comment_id/reactions"
},
createForIssue: {
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "POST",
params: {
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
required: true,
type: "string"
},
issue_number: {
required: true,
type: "integer"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number/reactions"
},
createForIssueComment: {
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "POST",
params: {
comment_id: {
required: true,
type: "integer"
},
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
},
createForPullRequestReviewComment: {
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "POST",
params: {
comment_id: {
required: true,
type: "integer"
},
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
},
createForTeamDiscussion: {
deprecated: "octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)",
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "POST",
params: {
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
required: true,
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/reactions"
},
createForTeamDiscussionComment: {
deprecated: "octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)",
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "POST",
params: {
comment_number: {
required: true,
type: "integer"
},
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
required: true,
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
},
createForTeamDiscussionCommentInOrg: {
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "POST",
params: {
comment_number: {
required: true,
type: "integer"
},
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
required: true,
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
},
createForTeamDiscussionCommentLegacy: {
deprecated: "octokit.reactions.createForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy",
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "POST",
params: {
comment_number: {
required: true,
type: "integer"
},
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
required: true,
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
},
createForTeamDiscussionInOrg: {
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "POST",
params: {
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
required: true,
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
},
createForTeamDiscussionLegacy: {
deprecated: "octokit.reactions.createForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy",
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "POST",
params: {
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
required: true,
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/reactions"
},
delete: {
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "DELETE",
params: {
reaction_id: {
required: true,
type: "integer"
}
},
url: "/reactions/:reaction_id"
},
listForCommitComment: {
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "GET",
params: {
comment_id: {
required: true,
type: "integer"
},
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/comments/:comment_id/reactions"
},
listForIssue: {
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "GET",
params: {
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
type: "string"
},
issue_number: {
required: true,
type: "integer"
},
number: {
alias: "issue_number",
deprecated: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/:issue_number/reactions"
},
listForIssueComment: {
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "GET",
params: {
comment_id: {
required: true,
type: "integer"
},
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
},
listForPullRequestReviewComment: {
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "GET",
params: {
comment_id: {
required: true,
type: "integer"
},
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
},
listForTeamDiscussion: {
deprecated: "octokit.reactions.listForTeamDiscussion() has been renamed to octokit.reactions.listForTeamDiscussionLegacy() (2020-01-16)",
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "GET",
params: {
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/reactions"
},
listForTeamDiscussionComment: {
deprecated: "octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)",
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "GET",
params: {
comment_number: {
required: true,
type: "integer"
},
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
},
listForTeamDiscussionCommentInOrg: {
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "GET",
params: {
comment_number: {
required: true,
type: "integer"
},
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
},
listForTeamDiscussionCommentLegacy: {
deprecated: "octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy",
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "GET",
params: {
comment_number: {
required: true,
type: "integer"
},
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
},
listForTeamDiscussionInOrg: {
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "GET",
params: {
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
},
listForTeamDiscussionLegacy: {
deprecated: "octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy",
headers: {
accept: "application/vnd.github.squirrel-girl-preview+json"
},
method: "GET",
params: {
content: {
enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/reactions"
}
},
repos: {
acceptInvitation: {
method: "PATCH",
params: {
invitation_id: {
required: true,
type: "integer"
}
},
url: "/user/repository_invitations/:invitation_id"
},
addCollaborator: {
method: "PUT",
params: {
owner: {
required: true,
type: "string"
},
permission: {
enum: ["pull", "push", "admin"],
type: "string"
},
repo: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/collaborators/:username"
},
addDeployKey: {
method: "POST",
params: {
key: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
read_only: {
type: "boolean"
},
repo: {
required: true,
type: "string"
},
title: {
type: "string"
}
},
url: "/repos/:owner/:repo/keys"
},
addProtectedBranchAdminEnforcement: {
method: "POST",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
},
addProtectedBranchAppRestrictions: {
method: "POST",
params: {
apps: {
mapTo: "data",
required: true,
type: "string[]"
},
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
},
addProtectedBranchRequiredSignatures: {
headers: {
accept: "application/vnd.github.zzzax-preview+json"
},
method: "POST",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
},
addProtectedBranchRequiredStatusChecksContexts: {
method: "POST",
params: {
branch: {
required: true,
type: "string"
},
contexts: {
mapTo: "data",
required: true,
type: "string[]"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
},
addProtectedBranchTeamRestrictions: {
method: "POST",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
teams: {
mapTo: "data",
required: true,
type: "string[]"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
},
addProtectedBranchUserRestrictions: {
method: "POST",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
users: {
mapTo: "data",
required: true,
type: "string[]"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
},
checkCollaborator: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/collaborators/:username"
},
checkVulnerabilityAlerts: {
headers: {
accept: "application/vnd.github.dorian-preview+json"
},
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/vulnerability-alerts"
},
compareCommits: {
method: "GET",
params: {
base: {
required: true,
type: "string"
},
head: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/compare/:base...:head"
},
createCommitComment: {
method: "POST",
params: {
body: {
required: true,
type: "string"
},
commit_sha: {
required: true,
type: "string"
},
line: {
type: "integer"
},
owner: {
required: true,
type: "string"
},
path: {
type: "string"
},
position: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
sha: {
alias: "commit_sha",
deprecated: true,
type: "string"
}
},
url: "/repos/:owner/:repo/commits/:commit_sha/comments"
},
createDeployment: {
method: "POST",
params: {
auto_merge: {
type: "boolean"
},
description: {
type: "string"
},
environment: {
type: "string"
},
owner: {
required: true,
type: "string"
},
payload: {
type: "string"
},
production_environment: {
type: "boolean"
},
ref: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
required_contexts: {
type: "string[]"
},
task: {
type: "string"
},
transient_environment: {
type: "boolean"
}
},
url: "/repos/:owner/:repo/deployments"
},
createDeploymentStatus: {
method: "POST",
params: {
auto_inactive: {
type: "boolean"
},
deployment_id: {
required: true,
type: "integer"
},
description: {
type: "string"
},
environment: {
enum: ["production", "staging", "qa"],
type: "string"
},
environment_url: {
type: "string"
},
log_url: {
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
state: {
enum: ["error", "failure", "inactive", "in_progress", "queued", "pending", "success"],
required: true,
type: "string"
},
target_url: {
type: "string"
}
},
url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
},
createDispatchEvent: {
method: "POST",
params: {
client_payload: {
type: "object"
},
event_type: {
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/dispatches"
},
createFile: {
deprecated: "octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
method: "PUT",
params: {
author: {
type: "object"
},
"author.email": {
required: true,
type: "string"
},
"author.name": {
required: true,
type: "string"
},
branch: {
type: "string"
},
committer: {
type: "object"
},
"committer.email": {
required: true,
type: "string"
},
"committer.name": {
required: true,
type: "string"
},
content: {
required: true,
type: "string"
},
message: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
path: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
sha: {
type: "string"
}
},
url: "/repos/:owner/:repo/contents/:path"
},
createForAuthenticatedUser: {
method: "POST",
params: {
allow_merge_commit: {
type: "boolean"
},
allow_rebase_merge: {
type: "boolean"
},
allow_squash_merge: {
type: "boolean"
},
auto_init: {
type: "boolean"
},
delete_branch_on_merge: {
type: "boolean"
},
description: {
type: "string"
},
gitignore_template: {
type: "string"
},
has_issues: {
type: "boolean"
},
has_projects: {
type: "boolean"
},
has_wiki: {
type: "boolean"
},
homepage: {
type: "string"
},
is_template: {
type: "boolean"
},
license_template: {
type: "string"
},
name: {
required: true,
type: "string"
},
private: {
type: "boolean"
},
team_id: {
type: "integer"
},
visibility: {
enum: ["public", "private", "visibility", "internal"],
type: "string"
}
},
url: "/user/repos"
},
createFork: {
method: "POST",
params: {
organization: {
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/forks"
},
createHook: {
method: "POST",
params: {
active: {
type: "boolean"
},
config: {
required: true,
type: "object"
},
"config.content_type": {
type: "string"
},
"config.insecure_ssl": {
type: "string"
},
"config.secret": {
type: "string"
},
"config.url": {
required: true,
type: "string"
},
events: {
type: "string[]"
},
name: {
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/hooks"
},
createInOrg: {
method: "POST",
params: {
allow_merge_commit: {
type: "boolean"
},
allow_rebase_merge: {
type: "boolean"
},
allow_squash_merge: {
type: "boolean"
},
auto_init: {
type: "boolean"
},
delete_branch_on_merge: {
type: "boolean"
},
description: {
type: "string"
},
gitignore_template: {
type: "string"
},
has_issues: {
type: "boolean"
},
has_projects: {
type: "boolean"
},
has_wiki: {
type: "boolean"
},
homepage: {
type: "string"
},
is_template: {
type: "boolean"
},
license_template: {
type: "string"
},
name: {
required: true,
type: "string"
},
org: {
required: true,
type: "string"
},
private: {
type: "boolean"
},
team_id: {
type: "integer"
},
visibility: {
enum: ["public", "private", "visibility", "internal"],
type: "string"
}
},
url: "/orgs/:org/repos"
},
createOrUpdateFile: {
method: "PUT",
params: {
author: {
type: "object"
},
"author.email": {
required: true,
type: "string"
},
"author.name": {
required: true,
type: "string"
},
branch: {
type: "string"
},
committer: {
type: "object"
},
"committer.email": {
required: true,
type: "string"
},
"committer.name": {
required: true,
type: "string"
},
content: {
required: true,
type: "string"
},
message: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
path: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
sha: {
type: "string"
}
},
url: "/repos/:owner/:repo/contents/:path"
},
createRelease: {
method: "POST",
params: {
body: {
type: "string"
},
draft: {
type: "boolean"
},
name: {
type: "string"
},
owner: {
required: true,
type: "string"
},
prerelease: {
type: "boolean"
},
repo: {
required: true,
type: "string"
},
tag_name: {
required: true,
type: "string"
},
target_commitish: {
type: "string"
}
},
url: "/repos/:owner/:repo/releases"
},
createStatus: {
method: "POST",
params: {
context: {
type: "string"
},
description: {
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
sha: {
required: true,
type: "string"
},
state: {
enum: ["error", "failure", "pending", "success"],
required: true,
type: "string"
},
target_url: {
type: "string"
}
},
url: "/repos/:owner/:repo/statuses/:sha"
},
createUsingTemplate: {
headers: {
accept: "application/vnd.github.baptiste-preview+json"
},
method: "POST",
params: {
description: {
type: "string"
},
name: {
required: true,
type: "string"
},
owner: {
type: "string"
},
private: {
type: "boolean"
},
template_owner: {
required: true,
type: "string"
},
template_repo: {
required: true,
type: "string"
}
},
url: "/repos/:template_owner/:template_repo/generate"
},
declineInvitation: {
method: "DELETE",
params: {
invitation_id: {
required: true,
type: "integer"
}
},
url: "/user/repository_invitations/:invitation_id"
},
delete: {
method: "DELETE",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo"
},
deleteCommitComment: {
method: "DELETE",
params: {
comment_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/comments/:comment_id"
},
deleteDownload: {
method: "DELETE",
params: {
download_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/downloads/:download_id"
},
deleteFile: {
method: "DELETE",
params: {
author: {
type: "object"
},
"author.email": {
type: "string"
},
"author.name": {
type: "string"
},
branch: {
type: "string"
},
committer: {
type: "object"
},
"committer.email": {
type: "string"
},
"committer.name": {
type: "string"
},
message: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
path: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
sha: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/contents/:path"
},
deleteHook: {
method: "DELETE",
params: {
hook_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/hooks/:hook_id"
},
deleteInvitation: {
method: "DELETE",
params: {
invitation_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/invitations/:invitation_id"
},
deleteRelease: {
method: "DELETE",
params: {
owner: {
required: true,
type: "string"
},
release_id: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/releases/:release_id"
},
deleteReleaseAsset: {
method: "DELETE",
params: {
asset_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/releases/assets/:asset_id"
},
disableAutomatedSecurityFixes: {
headers: {
accept: "application/vnd.github.london-preview+json"
},
method: "DELETE",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/automated-security-fixes"
},
disablePagesSite: {
headers: {
accept: "application/vnd.github.switcheroo-preview+json"
},
method: "DELETE",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pages"
},
disableVulnerabilityAlerts: {
headers: {
accept: "application/vnd.github.dorian-preview+json"
},
method: "DELETE",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/vulnerability-alerts"
},
enableAutomatedSecurityFixes: {
headers: {
accept: "application/vnd.github.london-preview+json"
},
method: "PUT",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/automated-security-fixes"
},
enablePagesSite: {
headers: {
accept: "application/vnd.github.switcheroo-preview+json"
},
method: "POST",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
source: {
type: "object"
},
"source.branch": {
enum: ["master", "gh-pages"],
type: "string"
},
"source.path": {
type: "string"
}
},
url: "/repos/:owner/:repo/pages"
},
enableVulnerabilityAlerts: {
headers: {
accept: "application/vnd.github.dorian-preview+json"
},
method: "PUT",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/vulnerability-alerts"
},
get: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo"
},
getAppsWithAccessToProtectedBranch: {
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
},
getArchiveLink: {
method: "GET",
params: {
archive_format: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
ref: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/:archive_format/:ref"
},
getBranch: {
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch"
},
getBranchProtection: {
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection"
},
getClones: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
per: {
enum: ["day", "week"],
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/traffic/clones"
},
getCodeFrequencyStats: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/stats/code_frequency"
},
getCollaboratorPermissionLevel: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/collaborators/:username/permission"
},
getCombinedStatusForRef: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
ref: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/commits/:ref/status"
},
getCommit: {
method: "GET",
params: {
commit_sha: {
alias: "ref",
deprecated: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
ref: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
sha: {
alias: "ref",
deprecated: true,
type: "string"
}
},
url: "/repos/:owner/:repo/commits/:ref"
},
getCommitActivityStats: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/stats/commit_activity"
},
getCommitComment: {
method: "GET",
params: {
comment_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/comments/:comment_id"
},
getCommitRefSha: {
deprecated: "octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit",
headers: {
accept: "application/vnd.github.v3.sha"
},
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
ref: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/commits/:ref"
},
getContents: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
path: {
required: true,
type: "string"
},
ref: {
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/contents/:path"
},
getContributorsStats: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/stats/contributors"
},
getDeployKey: {
method: "GET",
params: {
key_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/keys/:key_id"
},
getDeployment: {
method: "GET",
params: {
deployment_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/deployments/:deployment_id"
},
getDeploymentStatus: {
method: "GET",
params: {
deployment_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
status_id: {
required: true,
type: "integer"
}
},
url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"
},
getDownload: {
method: "GET",
params: {
download_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/downloads/:download_id"
},
getHook: {
method: "GET",
params: {
hook_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/hooks/:hook_id"
},
getLatestPagesBuild: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pages/builds/latest"
},
getLatestRelease: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/releases/latest"
},
getPages: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pages"
},
getPagesBuild: {
method: "GET",
params: {
build_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pages/builds/:build_id"
},
getParticipationStats: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/stats/participation"
},
getProtectedBranchAdminEnforcement: {
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
},
getProtectedBranchPullRequestReviewEnforcement: {
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
},
getProtectedBranchRequiredSignatures: {
headers: {
accept: "application/vnd.github.zzzax-preview+json"
},
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
},
getProtectedBranchRequiredStatusChecks: {
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
},
getProtectedBranchRestrictions: {
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
},
getPunchCardStats: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/stats/punch_card"
},
getReadme: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
ref: {
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/readme"
},
getRelease: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
release_id: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/releases/:release_id"
},
getReleaseAsset: {
method: "GET",
params: {
asset_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/releases/assets/:asset_id"
},
getReleaseByTag: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
tag: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/releases/tags/:tag"
},
getTeamsWithAccessToProtectedBranch: {
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
},
getTopPaths: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/traffic/popular/paths"
},
getTopReferrers: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/traffic/popular/referrers"
},
getUsersWithAccessToProtectedBranch: {
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
},
getViews: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
per: {
enum: ["day", "week"],
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/traffic/views"
},
list: {
method: "GET",
params: {
affiliation: {
type: "string"
},
direction: {
enum: ["asc", "desc"],
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
sort: {
enum: ["created", "updated", "pushed", "full_name"],
type: "string"
},
type: {
enum: ["all", "owner", "public", "private", "member"],
type: "string"
},
visibility: {
enum: ["all", "public", "private"],
type: "string"
}
},
url: "/user/repos"
},
listAppsWithAccessToProtectedBranch: {
deprecated: "octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)",
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
},
listAssetsForRelease: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
release_id: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/releases/:release_id/assets"
},
listBranches: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
protected: {
type: "boolean"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches"
},
listBranchesForHeadCommit: {
headers: {
accept: "application/vnd.github.groot-preview+json"
},
method: "GET",
params: {
commit_sha: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head"
},
listCollaborators: {
method: "GET",
params: {
affiliation: {
enum: ["outside", "direct", "all"],
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/collaborators"
},
listCommentsForCommit: {
method: "GET",
params: {
commit_sha: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
ref: {
alias: "commit_sha",
deprecated: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/commits/:commit_sha/comments"
},
listCommitComments: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/comments"
},
listCommits: {
method: "GET",
params: {
author: {
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
path: {
type: "string"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
sha: {
type: "string"
},
since: {
type: "string"
},
until: {
type: "string"
}
},
url: "/repos/:owner/:repo/commits"
},
listContributors: {
method: "GET",
params: {
anon: {
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/contributors"
},
listDeployKeys: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/keys"
},
listDeploymentStatuses: {
method: "GET",
params: {
deployment_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
},
listDeployments: {
method: "GET",
params: {
environment: {
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
ref: {
type: "string"
},
repo: {
required: true,
type: "string"
},
sha: {
type: "string"
},
task: {
type: "string"
}
},
url: "/repos/:owner/:repo/deployments"
},
listDownloads: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/downloads"
},
listForOrg: {
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
sort: {
enum: ["created", "updated", "pushed", "full_name"],
type: "string"
},
type: {
enum: ["all", "public", "private", "forks", "sources", "member", "internal"],
type: "string"
}
},
url: "/orgs/:org/repos"
},
listForUser: {
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
sort: {
enum: ["created", "updated", "pushed", "full_name"],
type: "string"
},
type: {
enum: ["all", "owner", "member"],
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/repos"
},
listForks: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
},
sort: {
enum: ["newest", "oldest", "stargazers"],
type: "string"
}
},
url: "/repos/:owner/:repo/forks"
},
listHooks: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/hooks"
},
listInvitations: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/invitations"
},
listInvitationsForAuthenticatedUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/repository_invitations"
},
listLanguages: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/languages"
},
listPagesBuilds: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pages/builds"
},
listProtectedBranchRequiredStatusChecksContexts: {
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
},
listProtectedBranchTeamRestrictions: {
deprecated: "octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)",
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
},
listProtectedBranchUserRestrictions: {
deprecated: "octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)",
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
},
listPublic: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
since: {
type: "integer"
}
},
url: "/repositories"
},
listPullRequestsAssociatedWithCommit: {
headers: {
accept: "application/vnd.github.groot-preview+json"
},
method: "GET",
params: {
commit_sha: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/commits/:commit_sha/pulls"
},
listReleases: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/releases"
},
listStatusesForRef: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
ref: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/commits/:ref/statuses"
},
listTags: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/tags"
},
listTeams: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/teams"
},
listTeamsWithAccessToProtectedBranch: {
deprecated: "octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)",
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
},
listTopics: {
headers: {
accept: "application/vnd.github.mercy-preview+json"
},
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/topics"
},
listUsersWithAccessToProtectedBranch: {
deprecated: "octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)",
method: "GET",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
},
merge: {
method: "POST",
params: {
base: {
required: true,
type: "string"
},
commit_message: {
type: "string"
},
head: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/merges"
},
pingHook: {
method: "POST",
params: {
hook_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/hooks/:hook_id/pings"
},
removeBranchProtection: {
method: "DELETE",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection"
},
removeCollaborator: {
method: "DELETE",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/collaborators/:username"
},
removeDeployKey: {
method: "DELETE",
params: {
key_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/keys/:key_id"
},
removeProtectedBranchAdminEnforcement: {
method: "DELETE",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
},
removeProtectedBranchAppRestrictions: {
method: "DELETE",
params: {
apps: {
mapTo: "data",
required: true,
type: "string[]"
},
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
},
removeProtectedBranchPullRequestReviewEnforcement: {
method: "DELETE",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
},
removeProtectedBranchRequiredSignatures: {
headers: {
accept: "application/vnd.github.zzzax-preview+json"
},
method: "DELETE",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
},
removeProtectedBranchRequiredStatusChecks: {
method: "DELETE",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
},
removeProtectedBranchRequiredStatusChecksContexts: {
method: "DELETE",
params: {
branch: {
required: true,
type: "string"
},
contexts: {
mapTo: "data",
required: true,
type: "string[]"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
},
removeProtectedBranchRestrictions: {
method: "DELETE",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
},
removeProtectedBranchTeamRestrictions: {
method: "DELETE",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
teams: {
mapTo: "data",
required: true,
type: "string[]"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
},
removeProtectedBranchUserRestrictions: {
method: "DELETE",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
users: {
mapTo: "data",
required: true,
type: "string[]"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
},
replaceProtectedBranchAppRestrictions: {
method: "PUT",
params: {
apps: {
mapTo: "data",
required: true,
type: "string[]"
},
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
},
replaceProtectedBranchRequiredStatusChecksContexts: {
method: "PUT",
params: {
branch: {
required: true,
type: "string"
},
contexts: {
mapTo: "data",
required: true,
type: "string[]"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
},
replaceProtectedBranchTeamRestrictions: {
method: "PUT",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
teams: {
mapTo: "data",
required: true,
type: "string[]"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
},
replaceProtectedBranchUserRestrictions: {
method: "PUT",
params: {
branch: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
users: {
mapTo: "data",
required: true,
type: "string[]"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
},
replaceTopics: {
headers: {
accept: "application/vnd.github.mercy-preview+json"
},
method: "PUT",
params: {
names: {
required: true,
type: "string[]"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/topics"
},
requestPageBuild: {
method: "POST",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/pages/builds"
},
retrieveCommunityProfileMetrics: {
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/community/profile"
},
testPushHook: {
method: "POST",
params: {
hook_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/hooks/:hook_id/tests"
},
transfer: {
method: "POST",
params: {
new_owner: {
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
team_ids: {
type: "integer[]"
}
},
url: "/repos/:owner/:repo/transfer"
},
update: {
method: "PATCH",
params: {
allow_merge_commit: {
type: "boolean"
},
allow_rebase_merge: {
type: "boolean"
},
allow_squash_merge: {
type: "boolean"
},
archived: {
type: "boolean"
},
default_branch: {
type: "string"
},
delete_branch_on_merge: {
type: "boolean"
},
description: {
type: "string"
},
has_issues: {
type: "boolean"
},
has_projects: {
type: "boolean"
},
has_wiki: {
type: "boolean"
},
homepage: {
type: "string"
},
is_template: {
type: "boolean"
},
name: {
type: "string"
},
owner: {
required: true,
type: "string"
},
private: {
type: "boolean"
},
repo: {
required: true,
type: "string"
},
visibility: {
enum: ["public", "private", "visibility", "internal"],
type: "string"
}
},
url: "/repos/:owner/:repo"
},
updateBranchProtection: {
method: "PUT",
params: {
allow_deletions: {
type: "boolean"
},
allow_force_pushes: {
allowNull: true,
type: "boolean"
},
branch: {
required: true,
type: "string"
},
enforce_admins: {
allowNull: true,
required: true,
type: "boolean"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
required_linear_history: {
type: "boolean"
},
required_pull_request_reviews: {
allowNull: true,
required: true,
type: "object"
},
"required_pull_request_reviews.dismiss_stale_reviews": {
type: "boolean"
},
"required_pull_request_reviews.dismissal_restrictions": {
type: "object"
},
"required_pull_request_reviews.dismissal_restrictions.teams": {
type: "string[]"
},
"required_pull_request_reviews.dismissal_restrictions.users": {
type: "string[]"
},
"required_pull_request_reviews.require_code_owner_reviews": {
type: "boolean"
},
"required_pull_request_reviews.required_approving_review_count": {
type: "integer"
},
required_status_checks: {
allowNull: true,
required: true,
type: "object"
},
"required_status_checks.contexts": {
required: true,
type: "string[]"
},
"required_status_checks.strict": {
required: true,
type: "boolean"
},
restrictions: {
allowNull: true,
required: true,
type: "object"
},
"restrictions.apps": {
type: "string[]"
},
"restrictions.teams": {
required: true,
type: "string[]"
},
"restrictions.users": {
required: true,
type: "string[]"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection"
},
updateCommitComment: {
method: "PATCH",
params: {
body: {
required: true,
type: "string"
},
comment_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/comments/:comment_id"
},
updateFile: {
deprecated: "octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
method: "PUT",
params: {
author: {
type: "object"
},
"author.email": {
required: true,
type: "string"
},
"author.name": {
required: true,
type: "string"
},
branch: {
type: "string"
},
committer: {
type: "object"
},
"committer.email": {
required: true,
type: "string"
},
"committer.name": {
required: true,
type: "string"
},
content: {
required: true,
type: "string"
},
message: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
path: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
sha: {
type: "string"
}
},
url: "/repos/:owner/:repo/contents/:path"
},
updateHook: {
method: "PATCH",
params: {
active: {
type: "boolean"
},
add_events: {
type: "string[]"
},
config: {
type: "object"
},
"config.content_type": {
type: "string"
},
"config.insecure_ssl": {
type: "string"
},
"config.secret": {
type: "string"
},
"config.url": {
required: true,
type: "string"
},
events: {
type: "string[]"
},
hook_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
remove_events: {
type: "string[]"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/hooks/:hook_id"
},
updateInformationAboutPagesSite: {
method: "PUT",
params: {
cname: {
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
source: {
enum: ['"gh-pages"', '"master"', '"master /docs"'],
type: "string"
}
},
url: "/repos/:owner/:repo/pages"
},
updateInvitation: {
method: "PATCH",
params: {
invitation_id: {
required: true,
type: "integer"
},
owner: {
required: true,
type: "string"
},
permissions: {
enum: ["read", "write", "admin"],
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/invitations/:invitation_id"
},
updateProtectedBranchPullRequestReviewEnforcement: {
method: "PATCH",
params: {
branch: {
required: true,
type: "string"
},
dismiss_stale_reviews: {
type: "boolean"
},
dismissal_restrictions: {
type: "object"
},
"dismissal_restrictions.teams": {
type: "string[]"
},
"dismissal_restrictions.users": {
type: "string[]"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
require_code_owner_reviews: {
type: "boolean"
},
required_approving_review_count: {
type: "integer"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
},
updateProtectedBranchRequiredStatusChecks: {
method: "PATCH",
params: {
branch: {
required: true,
type: "string"
},
contexts: {
type: "string[]"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
strict: {
type: "boolean"
}
},
url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
},
updateRelease: {
method: "PATCH",
params: {
body: {
type: "string"
},
draft: {
type: "boolean"
},
name: {
type: "string"
},
owner: {
required: true,
type: "string"
},
prerelease: {
type: "boolean"
},
release_id: {
required: true,
type: "integer"
},
repo: {
required: true,
type: "string"
},
tag_name: {
type: "string"
},
target_commitish: {
type: "string"
}
},
url: "/repos/:owner/:repo/releases/:release_id"
},
updateReleaseAsset: {
method: "PATCH",
params: {
asset_id: {
required: true,
type: "integer"
},
label: {
type: "string"
},
name: {
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
}
},
url: "/repos/:owner/:repo/releases/assets/:asset_id"
},
uploadReleaseAsset: {
method: "POST",
params: {
data: {
mapTo: "data",
required: true,
type: "string | object"
},
file: {
alias: "data",
deprecated: true,
type: "string | object"
},
headers: {
required: true,
type: "object"
},
"headers.content-length": {
required: true,
type: "integer"
},
"headers.content-type": {
required: true,
type: "string"
},
label: {
type: "string"
},
name: {
required: true,
type: "string"
},
url: {
required: true,
type: "string"
}
},
url: ":url"
}
},
search: {
code: {
method: "GET",
params: {
order: {
enum: ["desc", "asc"],
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
q: {
required: true,
type: "string"
},
sort: {
enum: ["indexed"],
type: "string"
}
},
url: "/search/code"
},
commits: {
headers: {
accept: "application/vnd.github.cloak-preview+json"
},
method: "GET",
params: {
order: {
enum: ["desc", "asc"],
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
q: {
required: true,
type: "string"
},
sort: {
enum: ["author-date", "committer-date"],
type: "string"
}
},
url: "/search/commits"
},
issues: {
deprecated: "octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)",
method: "GET",
params: {
order: {
enum: ["desc", "asc"],
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
q: {
required: true,
type: "string"
},
sort: {
enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
type: "string"
}
},
url: "/search/issues"
},
issuesAndPullRequests: {
method: "GET",
params: {
order: {
enum: ["desc", "asc"],
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
q: {
required: true,
type: "string"
},
sort: {
enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
type: "string"
}
},
url: "/search/issues"
},
labels: {
method: "GET",
params: {
order: {
enum: ["desc", "asc"],
type: "string"
},
q: {
required: true,
type: "string"
},
repository_id: {
required: true,
type: "integer"
},
sort: {
enum: ["created", "updated"],
type: "string"
}
},
url: "/search/labels"
},
repos: {
method: "GET",
params: {
order: {
enum: ["desc", "asc"],
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
q: {
required: true,
type: "string"
},
sort: {
enum: ["stars", "forks", "help-wanted-issues", "updated"],
type: "string"
}
},
url: "/search/repositories"
},
topics: {
method: "GET",
params: {
q: {
required: true,
type: "string"
}
},
url: "/search/topics"
},
users: {
method: "GET",
params: {
order: {
enum: ["desc", "asc"],
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
q: {
required: true,
type: "string"
},
sort: {
enum: ["followers", "repositories", "joined"],
type: "string"
}
},
url: "/search/users"
}
},
teams: {
addMember: {
deprecated: "octokit.teams.addMember() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)",
method: "PUT",
params: {
team_id: {
required: true,
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/teams/:team_id/members/:username"
},
addMemberLegacy: {
deprecated: "octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy",
method: "PUT",
params: {
team_id: {
required: true,
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/teams/:team_id/members/:username"
},
addOrUpdateMembership: {
deprecated: "octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)",
method: "PUT",
params: {
role: {
enum: ["member", "maintainer"],
type: "string"
},
team_id: {
required: true,
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/teams/:team_id/memberships/:username"
},
addOrUpdateMembershipInOrg: {
method: "PUT",
params: {
org: {
required: true,
type: "string"
},
role: {
enum: ["member", "maintainer"],
type: "string"
},
team_slug: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/memberships/:username"
},
addOrUpdateMembershipLegacy: {
deprecated: "octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy",
method: "PUT",
params: {
role: {
enum: ["member", "maintainer"],
type: "string"
},
team_id: {
required: true,
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/teams/:team_id/memberships/:username"
},
addOrUpdateProject: {
deprecated: "octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)",
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "PUT",
params: {
permission: {
enum: ["read", "write", "admin"],
type: "string"
},
project_id: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/projects/:project_id"
},
addOrUpdateProjectInOrg: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "PUT",
params: {
org: {
required: true,
type: "string"
},
permission: {
enum: ["read", "write", "admin"],
type: "string"
},
project_id: {
required: true,
type: "integer"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/projects/:project_id"
},
addOrUpdateProjectLegacy: {
deprecated: "octokit.teams.addOrUpdateProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-project-legacy",
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "PUT",
params: {
permission: {
enum: ["read", "write", "admin"],
type: "string"
},
project_id: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/projects/:project_id"
},
addOrUpdateRepo: {
deprecated: "octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)",
method: "PUT",
params: {
owner: {
required: true,
type: "string"
},
permission: {
enum: ["pull", "push", "admin"],
type: "string"
},
repo: {
required: true,
type: "string"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/repos/:owner/:repo"
},
addOrUpdateRepoInOrg: {
method: "PUT",
params: {
org: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
permission: {
enum: ["pull", "push", "admin"],
type: "string"
},
repo: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
},
addOrUpdateRepoLegacy: {
deprecated: "octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy",
method: "PUT",
params: {
owner: {
required: true,
type: "string"
},
permission: {
enum: ["pull", "push", "admin"],
type: "string"
},
repo: {
required: true,
type: "string"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/repos/:owner/:repo"
},
checkManagesRepo: {
deprecated: "octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)",
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/repos/:owner/:repo"
},
checkManagesRepoInOrg: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
},
checkManagesRepoLegacy: {
deprecated: "octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy",
method: "GET",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/repos/:owner/:repo"
},
create: {
method: "POST",
params: {
description: {
type: "string"
},
maintainers: {
type: "string[]"
},
name: {
required: true,
type: "string"
},
org: {
required: true,
type: "string"
},
parent_team_id: {
type: "integer"
},
permission: {
enum: ["pull", "push", "admin"],
type: "string"
},
privacy: {
enum: ["secret", "closed"],
type: "string"
},
repo_names: {
type: "string[]"
}
},
url: "/orgs/:org/teams"
},
createDiscussion: {
deprecated: "octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)",
method: "POST",
params: {
body: {
required: true,
type: "string"
},
private: {
type: "boolean"
},
team_id: {
required: true,
type: "integer"
},
title: {
required: true,
type: "string"
}
},
url: "/teams/:team_id/discussions"
},
createDiscussionComment: {
deprecated: "octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)",
method: "POST",
params: {
body: {
required: true,
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/comments"
},
createDiscussionCommentInOrg: {
method: "POST",
params: {
body: {
required: true,
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
},
createDiscussionCommentLegacy: {
deprecated: "octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy",
method: "POST",
params: {
body: {
required: true,
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/comments"
},
createDiscussionInOrg: {
method: "POST",
params: {
body: {
required: true,
type: "string"
},
org: {
required: true,
type: "string"
},
private: {
type: "boolean"
},
team_slug: {
required: true,
type: "string"
},
title: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/discussions"
},
createDiscussionLegacy: {
deprecated: "octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy",
method: "POST",
params: {
body: {
required: true,
type: "string"
},
private: {
type: "boolean"
},
team_id: {
required: true,
type: "integer"
},
title: {
required: true,
type: "string"
}
},
url: "/teams/:team_id/discussions"
},
delete: {
deprecated: "octokit.teams.delete() has been renamed to octokit.teams.deleteLegacy() (2020-01-16)",
method: "DELETE",
params: {
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id"
},
deleteDiscussion: {
deprecated: "octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)",
method: "DELETE",
params: {
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number"
},
deleteDiscussionComment: {
deprecated: "octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)",
method: "DELETE",
params: {
comment_number: {
required: true,
type: "integer"
},
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
},
deleteDiscussionCommentInOrg: {
method: "DELETE",
params: {
comment_number: {
required: true,
type: "integer"
},
discussion_number: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
},
deleteDiscussionCommentLegacy: {
deprecated: "octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy",
method: "DELETE",
params: {
comment_number: {
required: true,
type: "integer"
},
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
},
deleteDiscussionInOrg: {
method: "DELETE",
params: {
discussion_number: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
},
deleteDiscussionLegacy: {
deprecated: "octokit.teams.deleteDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy",
method: "DELETE",
params: {
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number"
},
deleteInOrg: {
method: "DELETE",
params: {
org: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug"
},
deleteLegacy: {
deprecated: "octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy",
method: "DELETE",
params: {
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id"
},
get: {
deprecated: "octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)",
method: "GET",
params: {
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id"
},
getByName: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug"
},
getDiscussion: {
deprecated: "octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)",
method: "GET",
params: {
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number"
},
getDiscussionComment: {
deprecated: "octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)",
method: "GET",
params: {
comment_number: {
required: true,
type: "integer"
},
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
},
getDiscussionCommentInOrg: {
method: "GET",
params: {
comment_number: {
required: true,
type: "integer"
},
discussion_number: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
},
getDiscussionCommentLegacy: {
deprecated: "octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy",
method: "GET",
params: {
comment_number: {
required: true,
type: "integer"
},
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
},
getDiscussionInOrg: {
method: "GET",
params: {
discussion_number: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
},
getDiscussionLegacy: {
deprecated: "octokit.teams.getDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#get-a-single-discussion-legacy",
method: "GET",
params: {
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number"
},
getLegacy: {
deprecated: "octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy",
method: "GET",
params: {
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id"
},
getMember: {
deprecated: "octokit.teams.getMember() has been renamed to octokit.teams.getMemberLegacy() (2020-01-16)",
method: "GET",
params: {
team_id: {
required: true,
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/teams/:team_id/members/:username"
},
getMemberLegacy: {
deprecated: "octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy",
method: "GET",
params: {
team_id: {
required: true,
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/teams/:team_id/members/:username"
},
getMembership: {
deprecated: "octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)",
method: "GET",
params: {
team_id: {
required: true,
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/teams/:team_id/memberships/:username"
},
getMembershipInOrg: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/memberships/:username"
},
getMembershipLegacy: {
deprecated: "octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy",
method: "GET",
params: {
team_id: {
required: true,
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/teams/:team_id/memberships/:username"
},
list: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/orgs/:org/teams"
},
listChild: {
deprecated: "octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)",
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/teams"
},
listChildInOrg: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/teams"
},
listChildLegacy: {
deprecated: "octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy",
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/teams"
},
listDiscussionComments: {
deprecated: "octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)",
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/comments"
},
listDiscussionCommentsInOrg: {
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
},
listDiscussionCommentsLegacy: {
deprecated: "octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy",
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/comments"
},
listDiscussions: {
deprecated: "octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)",
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions"
},
listDiscussionsInOrg: {
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/discussions"
},
listDiscussionsLegacy: {
deprecated: "octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy",
method: "GET",
params: {
direction: {
enum: ["asc", "desc"],
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions"
},
listForAuthenticatedUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/teams"
},
listMembers: {
deprecated: "octokit.teams.listMembers() has been renamed to octokit.teams.listMembersLegacy() (2020-01-16)",
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
role: {
enum: ["member", "maintainer", "all"],
type: "string"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/members"
},
listMembersInOrg: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
role: {
enum: ["member", "maintainer", "all"],
type: "string"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/members"
},
listMembersLegacy: {
deprecated: "octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy",
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
role: {
enum: ["member", "maintainer", "all"],
type: "string"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/members"
},
listPendingInvitations: {
deprecated: "octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)",
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/invitations"
},
listPendingInvitationsInOrg: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/invitations"
},
listPendingInvitationsLegacy: {
deprecated: "octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy",
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/invitations"
},
listProjects: {
deprecated: "octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)",
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/projects"
},
listProjectsInOrg: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/projects"
},
listProjectsLegacy: {
deprecated: "octokit.teams.listProjectsLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-projects-legacy",
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/projects"
},
listRepos: {
deprecated: "octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)",
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/repos"
},
listReposInOrg: {
method: "GET",
params: {
org: {
required: true,
type: "string"
},
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/repos"
},
listReposLegacy: {
deprecated: "octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy",
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/repos"
},
removeMember: {
deprecated: "octokit.teams.removeMember() has been renamed to octokit.teams.removeMemberLegacy() (2020-01-16)",
method: "DELETE",
params: {
team_id: {
required: true,
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/teams/:team_id/members/:username"
},
removeMemberLegacy: {
deprecated: "octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy",
method: "DELETE",
params: {
team_id: {
required: true,
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/teams/:team_id/members/:username"
},
removeMembership: {
deprecated: "octokit.teams.removeMembership() has been renamed to octokit.teams.removeMembershipLegacy() (2020-01-16)",
method: "DELETE",
params: {
team_id: {
required: true,
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/teams/:team_id/memberships/:username"
},
removeMembershipInOrg: {
method: "DELETE",
params: {
org: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/memberships/:username"
},
removeMembershipLegacy: {
deprecated: "octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy",
method: "DELETE",
params: {
team_id: {
required: true,
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/teams/:team_id/memberships/:username"
},
removeProject: {
deprecated: "octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)",
method: "DELETE",
params: {
project_id: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/projects/:project_id"
},
removeProjectInOrg: {
method: "DELETE",
params: {
org: {
required: true,
type: "string"
},
project_id: {
required: true,
type: "integer"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/projects/:project_id"
},
removeProjectLegacy: {
deprecated: "octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy",
method: "DELETE",
params: {
project_id: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/projects/:project_id"
},
removeRepo: {
deprecated: "octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)",
method: "DELETE",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/repos/:owner/:repo"
},
removeRepoInOrg: {
method: "DELETE",
params: {
org: {
required: true,
type: "string"
},
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
},
removeRepoLegacy: {
deprecated: "octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy",
method: "DELETE",
params: {
owner: {
required: true,
type: "string"
},
repo: {
required: true,
type: "string"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/repos/:owner/:repo"
},
reviewProject: {
deprecated: "octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)",
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
project_id: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/projects/:project_id"
},
reviewProjectInOrg: {
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
org: {
required: true,
type: "string"
},
project_id: {
required: true,
type: "integer"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/projects/:project_id"
},
reviewProjectLegacy: {
deprecated: "octokit.teams.reviewProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#review-a-team-project-legacy",
headers: {
accept: "application/vnd.github.inertia-preview+json"
},
method: "GET",
params: {
project_id: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/projects/:project_id"
},
update: {
deprecated: "octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)",
method: "PATCH",
params: {
description: {
type: "string"
},
name: {
required: true,
type: "string"
},
parent_team_id: {
type: "integer"
},
permission: {
enum: ["pull", "push", "admin"],
type: "string"
},
privacy: {
enum: ["secret", "closed"],
type: "string"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id"
},
updateDiscussion: {
deprecated: "octokit.teams.updateDiscussion() has been renamed to octokit.teams.updateDiscussionLegacy() (2020-01-16)",
method: "PATCH",
params: {
body: {
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
},
title: {
type: "string"
}
},
url: "/teams/:team_id/discussions/:discussion_number"
},
updateDiscussionComment: {
deprecated: "octokit.teams.updateDiscussionComment() has been renamed to octokit.teams.updateDiscussionCommentLegacy() (2020-01-16)",
method: "PATCH",
params: {
body: {
required: true,
type: "string"
},
comment_number: {
required: true,
type: "integer"
},
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
},
updateDiscussionCommentInOrg: {
method: "PATCH",
params: {
body: {
required: true,
type: "string"
},
comment_number: {
required: true,
type: "integer"
},
discussion_number: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
},
updateDiscussionCommentLegacy: {
deprecated: "octokit.teams.updateDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment-legacy",
method: "PATCH",
params: {
body: {
required: true,
type: "string"
},
comment_number: {
required: true,
type: "integer"
},
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
},
updateDiscussionInOrg: {
method: "PATCH",
params: {
body: {
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
org: {
required: true,
type: "string"
},
team_slug: {
required: true,
type: "string"
},
title: {
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
},
updateDiscussionLegacy: {
deprecated: "octokit.teams.updateDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#edit-a-discussion-legacy",
method: "PATCH",
params: {
body: {
type: "string"
},
discussion_number: {
required: true,
type: "integer"
},
team_id: {
required: true,
type: "integer"
},
title: {
type: "string"
}
},
url: "/teams/:team_id/discussions/:discussion_number"
},
updateInOrg: {
method: "PATCH",
params: {
description: {
type: "string"
},
name: {
required: true,
type: "string"
},
org: {
required: true,
type: "string"
},
parent_team_id: {
type: "integer"
},
permission: {
enum: ["pull", "push", "admin"],
type: "string"
},
privacy: {
enum: ["secret", "closed"],
type: "string"
},
team_slug: {
required: true,
type: "string"
}
},
url: "/orgs/:org/teams/:team_slug"
},
updateLegacy: {
deprecated: "octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy",
method: "PATCH",
params: {
description: {
type: "string"
},
name: {
required: true,
type: "string"
},
parent_team_id: {
type: "integer"
},
permission: {
enum: ["pull", "push", "admin"],
type: "string"
},
privacy: {
enum: ["secret", "closed"],
type: "string"
},
team_id: {
required: true,
type: "integer"
}
},
url: "/teams/:team_id"
}
},
users: {
addEmails: {
method: "POST",
params: {
emails: {
required: true,
type: "string[]"
}
},
url: "/user/emails"
},
block: {
method: "PUT",
params: {
username: {
required: true,
type: "string"
}
},
url: "/user/blocks/:username"
},
checkBlocked: {
method: "GET",
params: {
username: {
required: true,
type: "string"
}
},
url: "/user/blocks/:username"
},
checkFollowing: {
method: "GET",
params: {
username: {
required: true,
type: "string"
}
},
url: "/user/following/:username"
},
checkFollowingForUser: {
method: "GET",
params: {
target_user: {
required: true,
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/following/:target_user"
},
createGpgKey: {
method: "POST",
params: {
armored_public_key: {
type: "string"
}
},
url: "/user/gpg_keys"
},
createPublicKey: {
method: "POST",
params: {
key: {
type: "string"
},
title: {
type: "string"
}
},
url: "/user/keys"
},
deleteEmails: {
method: "DELETE",
params: {
emails: {
required: true,
type: "string[]"
}
},
url: "/user/emails"
},
deleteGpgKey: {
method: "DELETE",
params: {
gpg_key_id: {
required: true,
type: "integer"
}
},
url: "/user/gpg_keys/:gpg_key_id"
},
deletePublicKey: {
method: "DELETE",
params: {
key_id: {
required: true,
type: "integer"
}
},
url: "/user/keys/:key_id"
},
follow: {
method: "PUT",
params: {
username: {
required: true,
type: "string"
}
},
url: "/user/following/:username"
},
getAuthenticated: {
method: "GET",
params: {},
url: "/user"
},
getByUsername: {
method: "GET",
params: {
username: {
required: true,
type: "string"
}
},
url: "/users/:username"
},
getContextForUser: {
method: "GET",
params: {
subject_id: {
type: "string"
},
subject_type: {
enum: ["organization", "repository", "issue", "pull_request"],
type: "string"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/hovercard"
},
getGpgKey: {
method: "GET",
params: {
gpg_key_id: {
required: true,
type: "integer"
}
},
url: "/user/gpg_keys/:gpg_key_id"
},
getPublicKey: {
method: "GET",
params: {
key_id: {
required: true,
type: "integer"
}
},
url: "/user/keys/:key_id"
},
list: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
since: {
type: "string"
}
},
url: "/users"
},
listBlocked: {
method: "GET",
params: {},
url: "/user/blocks"
},
listEmails: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/emails"
},
listFollowersForAuthenticatedUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/followers"
},
listFollowersForUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/followers"
},
listFollowingForAuthenticatedUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/following"
},
listFollowingForUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/following"
},
listGpgKeys: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/gpg_keys"
},
listGpgKeysForUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/gpg_keys"
},
listPublicEmails: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/public_emails"
},
listPublicKeys: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
}
},
url: "/user/keys"
},
listPublicKeysForUser: {
method: "GET",
params: {
page: {
type: "integer"
},
per_page: {
type: "integer"
},
username: {
required: true,
type: "string"
}
},
url: "/users/:username/keys"
},
togglePrimaryEmailVisibility: {
method: "PATCH",
params: {
email: {
required: true,
type: "string"
},
visibility: {
required: true,
type: "string"
}
},
url: "/user/email/visibility"
},
unblock: {
method: "DELETE",
params: {
username: {
required: true,
type: "string"
}
},
url: "/user/blocks/:username"
},
unfollow: {
method: "DELETE",
params: {
username: {
required: true,
type: "string"
}
},
url: "/user/following/:username"
},
updateAuthenticated: {
method: "PATCH",
params: {
bio: {
type: "string"
},
blog: {
type: "string"
},
company: {
type: "string"
},
email: {
type: "string"
},
hireable: {
type: "boolean"
},
location: {
type: "string"
},
name: {
type: "string"
}
},
url: "/user"
}
}
};
const VERSION = "2.4.0";
function registerEndpoints(octokit, routes) {
Object.keys(routes).forEach(namespaceName => {
if (!octokit[namespaceName]) {
octokit[namespaceName] = {};
}
Object.keys(routes[namespaceName]).forEach(apiName => {
const apiOptions = routes[namespaceName][apiName];
const endpointDefaults = ["method", "url", "headers"].reduce((map, key) => {
if (typeof apiOptions[key] !== "undefined") {
map[key] = apiOptions[key];
}
return map;
}, {});
endpointDefaults.request = {
validate: apiOptions.params
};
let request = octokit.request.defaults(endpointDefaults); // patch request & endpoint methods to support deprecated parameters.
// Not the most elegant solution, but we don’t want to move deprecation
// logic into octokit/endpoint.js as it’s out of scope
const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(key => apiOptions.params[key].deprecated);
if (hasDeprecatedParam) {
const patch = patchForDeprecation.bind(null, octokit, apiOptions);
request = patch(octokit.request.defaults(endpointDefaults), `.${namespaceName}.${apiName}()`);
request.endpoint = patch(request.endpoint, `.${namespaceName}.${apiName}.endpoint()`);
request.endpoint.merge = patch(request.endpoint.merge, `.${namespaceName}.${apiName}.endpoint.merge()`);
}
if (apiOptions.deprecated) {
octokit[namespaceName][apiName] = Object.assign(function deprecatedEndpointMethod() {
octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`));
octokit[namespaceName][apiName] = request;
return request.apply(null, arguments);
}, request);
return;
}
octokit[namespaceName][apiName] = request;
});
});
}
function patchForDeprecation(octokit, apiOptions, method, methodName) {
const patchedMethod = options => {
options = Object.assign({}, options);
Object.keys(options).forEach(key => {
if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
const aliasKey = apiOptions.params[key].alias;
octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`));
if (!(aliasKey in options)) {
options[aliasKey] = options[key];
}
delete options[key];
}
});
return method(options);
};
Object.keys(method).forEach(key => {
patchedMethod[key] = method[key];
});
return patchedMethod;
}
/**
* This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary
* goal is to rebuild @octokit/rest on top of @octokit/core. Once that is
* done, we will remove the registerEndpoints methods and return the methods
* directly as with the other plugins. At that point we will also remove the
* legacy workarounds and deprecations.
*
* See the plan at
* https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1
*/
function restEndpointMethods(octokit) {
// @ts-ignore
octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
registerEndpoints(octokit, endpointsByScope); // Aliasing scopes for backward compatibility
// See https://github.com/octokit/rest.js/pull/1134
[["gitdata", "git"], ["authorization", "oauthAuthorizations"], ["pullRequests", "pulls"]].forEach(([deprecatedScope, scope]) => {
Object.defineProperty(octokit, deprecatedScope, {
get() {
octokit.log.warn( // @ts-ignore
new deprecation.Deprecation(`[@octokit/plugin-rest-endpoint-methods] "octokit.${deprecatedScope}.*" methods are deprecated, use "octokit.${scope}.*" instead`)); // @ts-ignore
return octokit[scope];
}
});
});
return {};
}
restEndpointMethods.VERSION = VERSION;
exports.restEndpointMethods = restEndpointMethods;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 850:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = paginationMethodsPlugin
function paginationMethodsPlugin (octokit) {
octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
octokit.hasFirstPage = __webpack_require__(536)
octokit.hasLastPage = __webpack_require__(336)
octokit.hasNextPage = __webpack_require__(929)
octokit.hasPreviousPage = __webpack_require__(558)
}
/***/ }),
/***/ 854:
/***/ (function(module) {
/**
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** `Object#toString` result references. */
var funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
symbolTag = '[object Symbol]';
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/,
reLeadingDot = /^\./,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
/**
* Checks if `value` is a host object in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
*/
function isHostObject(value) {
// Many host objects are `Object` objects that can coerce to strings
// despite having improperly defined `toString` methods.
var result = false;
if (value != null && typeof value.toString != 'function') {
try {
result = !!(value + '');
} catch (e) {}
}
return result;
}
/** Used for built-in method references. */
var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/** Built-in value references. */
var Symbol = root.Symbol,
splice = arrayProto.splice;
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map'),
nativeCreate = getNative(Object, 'create');
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
}
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
return this.has(key) && delete this.__data__[key];
}
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
}
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
}
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
return true;
}
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
return getMapData(this, key)['delete'](key);
}
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
getMapData(this, key).set(key, value);
return this;
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
/**
* The base implementation of `_.get` without support for default values.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @returns {*} Returns the resolved value.
*/
function baseGet(object, path) {
path = isKey(path, object) ? [path] : castPath(path);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
}
return (index && index == length) ? object : undefined;
}
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
/**
* The base implementation of `_.toString` which doesn't convert nullish
* values to empty strings.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value) {
return isArray(value) ? value : stringToPath(value);
}
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
/**
* Checks if `value` is a property name and not a property path.
*
* @private
* @param {*} value The value to check.
* @param {Object} [object] The object to query keys on.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*/
function isKey(value, object) {
if (isArray(value)) {
return false;
}
var type = typeof value;
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
value == null || isSymbol(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object));
}
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoize(function(string) {
string = toString(string);
var result = [];
if (reLeadingDot.test(string)) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;
});
/**
* Converts `value` to a string key if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the key.
*/
function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to process.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided, it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] The function to resolve the cache key.
* @returns {Function} Returns the new memoized function.
* @example
*
* var object = { 'a': 1, 'b': 2 };
* var other = { 'c': 3, 'd': 4 };
*
* var values = _.memoize(_.values);
* values(object);
* // => [1, 2]
*
* values(other);
* // => [3, 4]
*
* object.a = 2;
* values(object);
* // => [1, 2]
*
* // Modify the result cache.
* values.cache.set(object, ['a', 'b']);
* values(object);
* // => ['a', 'b']
*
* // Replace `_.memoize.Cache`.
* _.memoize.Cache = WeakMap;
*/
function memoize(func, resolver) {
if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result);
return result;
};
memoized.cache = new (memoize.Cache || MapCache);
return memoized;
}
// Assign cache to `_.memoize`.
memoize.Cache = MapCache;
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && objectToString.call(value) == symbolTag);
}
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {string} Returns the string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined`, the `defaultValue` is returned in its place.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
module.exports = get;
/***/ }),
/***/ 855:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = registerPlugin;
const factory = __webpack_require__(47);
function registerPlugin(plugins, pluginFunction) {
return factory(
plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
);
}
/***/ }),
/***/ 856:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = __webpack_require__(141);
/***/ }),
/***/ 863:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = authenticationBeforeRequest;
const btoa = __webpack_require__(675);
const withAuthorizationPrefix = __webpack_require__(143);
function authenticationBeforeRequest(state, options) {
if (typeof state.auth === "string") {
options.headers.authorization = withAuthorizationPrefix(state.auth);
return;
}
if (state.auth.username) {
const hash = btoa(`${state.auth.username}:${state.auth.password}`);
options.headers.authorization = `Basic ${hash}`;
if (state.otp) {
options.headers["x-github-otp"] = state.otp;
}
return;
}
if (state.auth.clientId) {
// There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
// Basic Authorization instead of query parameters. The only routes where that applies share the same
// URL though: `/applications/:client_id/tokens/:access_token`.
//
// 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
// 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
// 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
//
// We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
// as well as "/applications/123/tokens/token456"
if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
options.headers.authorization = `Basic ${hash}`;
return;
}
options.url += options.url.indexOf("?") === -1 ? "?" : "&";
options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
return;
}
return Promise.resolve()
.then(() => {
return state.auth();
})
.then(authorization => {
options.headers.authorization = withAuthorizationPrefix(authorization);
});
}
/***/ }),
/***/ 866:
/***/ (function(module, __unusedexports, __webpack_require__) {
"use strict";
var shebangRegex = __webpack_require__(816);
module.exports = function (str) {
var match = str.match(shebangRegex);
if (!match) {
return null;
}
var arr = match[0].replace(/#! ?/, '').split(' ');
var bin = arr[0].split('/').pop();
var arg = arr[1];
return (bin === 'env' ?
arg :
bin + (arg ? ' ' + arg : '')
);
};
/***/ }),
/***/ 881:
/***/ (function(module) {
"use strict";
const isWin = process.platform === 'win32';
function notFoundError(original, syscall) {
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
code: 'ENOENT',
errno: 'ENOENT',
syscall: `${syscall} ${original.command}`,
path: original.command,
spawnargs: original.args,
});
}
function hookChildProcess(cp, parsed) {
if (!isWin) {
return;
}
const originalEmit = cp.emit;
cp.emit = function (name, arg1) {
// If emitting "exit" event and exit code is 1, we need to check if
// the command exists and emit an "error" instead
// See https://github.com/IndigoUnited/node-cross-spawn/issues/16
if (name === 'exit') {
const err = verifyENOENT(arg1, parsed, 'spawn');
if (err) {
return originalEmit.call(cp, 'error', err);
}
}
return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
};
}
function verifyENOENT(status, parsed) {
if (isWin && status === 1 && !parsed.file) {
return notFoundError(parsed.original, 'spawn');
}
return null;
}
function verifyENOENTSync(status, parsed) {
if (isWin && status === 1 && !parsed.file) {
return notFoundError(parsed.original, 'spawnSync');
}
return null;
}
module.exports = {
hookChildProcess,
verifyENOENT,
verifyENOENTSync,
notFoundError,
};
/***/ }),
/***/ 883:
/***/ (function(module) {
/**
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_SAFE_INTEGER = 9007199254740991;
/** `Object#toString` result references. */
var funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
symbolTag = '[object Symbol]';
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/,
reLeadingDot = /^\./,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
/**
* Checks if `value` is a host object in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
*/
function isHostObject(value) {
// Many host objects are `Object` objects that can coerce to strings
// despite having improperly defined `toString` methods.
var result = false;
if (value != null && typeof value.toString != 'function') {
try {
result = !!(value + '');
} catch (e) {}
}
return result;
}
/** Used for built-in method references. */
var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/** Built-in value references. */
var Symbol = root.Symbol,
splice = arrayProto.splice;
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map'),
nativeCreate = getNative(Object, 'create');
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
}
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
return this.has(key) && delete this.__data__[key];
}
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
}
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
}
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
return true;
}
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
return getMapData(this, key)['delete'](key);
}
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
getMapData(this, key).set(key, value);
return this;
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {
object[key] = value;
}
}
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
/**
* The base implementation of `_.set`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseSet(object, path, value, customizer) {
if (!isObject(object)) {
return object;
}
path = isKey(path, object) ? [path] : castPath(path);
var index = -1,
length = path.length,
lastIndex = length - 1,
nested = object;
while (nested != null && ++index < length) {
var key = toKey(path[index]),
newValue = value;
if (index != lastIndex) {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) {
newValue = isObject(objValue)
? objValue
: (isIndex(path[index + 1]) ? [] : {});
}
}
assignValue(nested, key, newValue);
nested = nested[key];
}
return object;
}
/**
* The base implementation of `_.toString` which doesn't convert nullish
* values to empty strings.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value) {
return isArray(value) ? value : stringToPath(value);
}
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
}
/**
* Checks if `value` is a property name and not a property path.
*
* @private
* @param {*} value The value to check.
* @param {Object} [object] The object to query keys on.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*/
function isKey(value, object) {
if (isArray(value)) {
return false;
}
var type = typeof value;
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
value == null || isSymbol(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object));
}
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoize(function(string) {
string = toString(string);
var result = [];
if (reLeadingDot.test(string)) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;
});
/**
* Converts `value` to a string key if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the key.
*/
function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to process.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided, it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] The function to resolve the cache key.
* @returns {Function} Returns the new memoized function.
* @example
*
* var object = { 'a': 1, 'b': 2 };
* var other = { 'c': 3, 'd': 4 };
*
* var values = _.memoize(_.values);
* values(object);
* // => [1, 2]
*
* values(other);
* // => [3, 4]
*
* object.a = 2;
* values(object);
* // => [1, 2]
*
* // Modify the result cache.
* values.cache.set(object, ['a', 'b']);
* values(object);
* // => ['a', 'b']
*
* // Replace `_.memoize.Cache`.
* _.memoize.Cache = WeakMap;
*/
function memoize(func, resolver) {
if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result);
return result;
};
memoized.cache = new (memoize.Cache || MapCache);
return memoized;
}
// Assign cache to `_.memoize`.
memoize.Cache = MapCache;
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && objectToString.call(value) == symbolTag);
}
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {string} Returns the string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
/**
* Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
* it's created. Arrays are created for missing index properties while objects
* are created for all other missing properties. Use `_.setWith` to customize
* `path` creation.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @returns {Object} Returns `object`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.set(object, 'a[0].b.c', 4);
* console.log(object.a[0].b.c);
* // => 4
*
* _.set(object, ['x', '0', 'y', 'z'], 5);
* console.log(object.x[0].y.z);
* // => 5
*/
function set(object, path, value) {
return object == null ? object : baseSet(object, path, value);
}
module.exports = set;
/***/ }),
/***/ 898:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
var request = __webpack_require__(753);
var universalUserAgent = __webpack_require__(796);
const VERSION = "4.3.1";
class GraphqlError extends Error {
constructor(request, response) {
const message = response.data.errors[0].message;
super(message);
Object.assign(this, response.data);
this.name = "GraphqlError";
this.request = request; // Maintains proper stack trace (only available on V8)
/* istanbul ignore next */
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
}
}
const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
function graphql(request, query, options) {
options = typeof query === "string" ? options = Object.assign({
query
}, options) : options = query;
const requestOptions = Object.keys(options).reduce((result, key) => {
if (NON_VARIABLE_OPTIONS.includes(key)) {
result[key] = options[key];
return result;
}
if (!result.variables) {
result.variables = {};
}
result.variables[key] = options[key];
return result;
}, {});
return request(requestOptions).then(response => {
if (response.data.errors) {
throw new GraphqlError(requestOptions, {
data: response.data
});
}
return response.data.data;
});
}
function withDefaults(request$1, newDefaults) {
const newRequest = request$1.defaults(newDefaults);
const newApi = (query, options) => {
return graphql(newRequest, query, options);
};
return Object.assign(newApi, {
defaults: withDefaults.bind(null, newRequest),
endpoint: request.request.endpoint
});
}
const graphql$1 = withDefaults(request.request, {
headers: {
"user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
},
method: "POST",
url: "/graphql"
});
function withCustomRequest(customRequest) {
return withDefaults(customRequest, {
method: "POST",
url: "/graphql"
});
}
exports.graphql = graphql$1;
exports.withCustomRequest = withCustomRequest;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 916:
/***/ (function(__unusedmodule, exports) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
const VERSION = "1.0.0";
/**
* @param octokit Octokit instance
* @param options Options passed to Octokit constructor
*/
function requestLog(octokit) {
octokit.hook.wrap("request", (request, options) => {
octokit.log.debug("request", options);
const start = Date.now();
const requestOptions = octokit.request.endpoint.parse(options);
const path = requestOptions.url.replace(options.baseUrl, "");
return request(options).then(response => {
octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
return response;
}).catch(error => {
octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
throw error;
});
});
}
requestLog.VERSION = VERSION;
exports.requestLog = requestLog;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 929:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports = hasNextPage
const deprecate = __webpack_require__(370)
const getPageLinks = __webpack_require__(577)
function hasNextPage (link) {
deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
return getPageLinks(link).next
}
/***/ }),
/***/ 948:
/***/ (function(module) {
"use strict";
/**
* Tries to execute a function and discards any error that occurs.
* @param {Function} fn - Function that might or might not throw an error.
* @returns {?*} Return-value of the function when no error occurred.
*/
module.exports = function(fn) {
try { return fn() } catch (e) {}
}
/***/ }),
/***/ 950:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const url = __webpack_require__(835);
function getProxyUrl(reqUrl) {
let usingSsl = reqUrl.protocol === 'https:';
let proxyUrl;
if (checkBypass(reqUrl)) {
return proxyUrl;
}
let proxyVar;
if (usingSsl) {
proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
}
else {
proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
}
if (proxyVar) {
proxyUrl = url.parse(proxyVar);
}
return proxyUrl;
}
exports.getProxyUrl = getProxyUrl;
function checkBypass(reqUrl) {
if (!reqUrl.hostname) {
return false;
}
let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
if (!noProxy) {
return false;
}
// Determine the request port
let reqPort;
if (reqUrl.port) {
reqPort = Number(reqUrl.port);
}
else if (reqUrl.protocol === 'http:') {
reqPort = 80;
}
else if (reqUrl.protocol === 'https:') {
reqPort = 443;
}
// Format the request hostname and hostname with port
let upperReqHosts = [reqUrl.hostname.toUpperCase()];
if (typeof reqPort === 'number') {
upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
}
// Compare request host against noproxy
for (let upperNoProxyItem of noProxy
.split(',')
.map(x => x.trim().toUpperCase())
.filter(x => x)) {
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
return true;
}
}
return false;
}
exports.checkBypass = checkBypass;
/***/ }),
/***/ 954:
/***/ (function(module) {
module.exports = validateAuth;
function validateAuth(auth) {
if (typeof auth === "string") {
return;
}
if (typeof auth === "function") {
return;
}
if (auth.username && auth.password) {
return;
}
if (auth.clientId && auth.clientSecret) {
return;
}
throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
}
/***/ }),
/***/ 955:
/***/ (function(module, __unusedexports, __webpack_require__) {
"use strict";
const path = __webpack_require__(622);
const childProcess = __webpack_require__(129);
const crossSpawn = __webpack_require__(20);
const stripEof = __webpack_require__(768);
const npmRunPath = __webpack_require__(621);
const isStream = __webpack_require__(323);
const _getStream = __webpack_require__(145);
const pFinally = __webpack_require__(697);
const onExit = __webpack_require__(260);
const errname = __webpack_require__(427);
const stdio = __webpack_require__(168);
const TEN_MEGABYTES = 1000 * 1000 * 10;
function handleArgs(cmd, args, opts) {
let parsed;
opts = Object.assign({
extendEnv: true,
env: {}
}, opts);
if (opts.extendEnv) {
opts.env = Object.assign({}, process.env, opts.env);
}
if (opts.__winShell === true) {
delete opts.__winShell;
parsed = {
command: cmd,
args,
options: opts,
file: cmd,
original: {
cmd,
args
}
};
} else {
parsed = crossSpawn._parse(cmd, args, opts);
}
opts = Object.assign({
maxBuffer: TEN_MEGABYTES,
buffer: true,
stripEof: true,
preferLocal: true,
localDir: parsed.options.cwd || process.cwd(),
encoding: 'utf8',
reject: true,
cleanup: true
}, parsed.options);
opts.stdio = stdio(opts);
if (opts.preferLocal) {
opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
}
if (opts.detached) {
// #115
opts.cleanup = false;
}
if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
// #116
parsed.args.unshift('/q');
}
return {
cmd: parsed.command,
args: parsed.args,
opts,
parsed
};
}
function handleInput(spawned, input) {
if (input === null || input === undefined) {
return;
}
if (isStream(input)) {
input.pipe(spawned.stdin);
} else {
spawned.stdin.end(input);
}
}
function handleOutput(opts, val) {
if (val && opts.stripEof) {
val = stripEof(val);
}
return val;
}
function handleShell(fn, cmd, opts) {
let file = '/bin/sh';
let args = ['-c', cmd];
opts = Object.assign({}, opts);
if (process.platform === 'win32') {
opts.__winShell = true;
file = process.env.comspec || 'cmd.exe';
args = ['/s', '/c', `"${cmd}"`];
opts.windowsVerbatimArguments = true;
}
if (opts.shell) {
file = opts.shell;
delete opts.shell;
}
return fn(file, args, opts);
}
function getStream(process, stream, {encoding, buffer, maxBuffer}) {
if (!process[stream]) {
return null;
}
let ret;
if (!buffer) {
// TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
ret = new Promise((resolve, reject) => {
process[stream]
.once('end', resolve)
.once('error', reject);
});
} else if (encoding) {
ret = _getStream(process[stream], {
encoding,
maxBuffer
});
} else {
ret = _getStream.buffer(process[stream], {maxBuffer});
}
return ret.catch(err => {
err.stream = stream;
err.message = `${stream} ${err.message}`;
throw err;
});
}
function makeError(result, options) {
const {stdout, stderr} = result;
let err = result.error;
const {code, signal} = result;
const {parsed, joinedCmd} = options;
const timedOut = options.timedOut || false;
if (!err) {
let output = '';
if (Array.isArray(parsed.opts.stdio)) {
if (parsed.opts.stdio[2] !== 'inherit') {
output += output.length > 0 ? stderr : `\n${stderr}`;
}
if (parsed.opts.stdio[1] !== 'inherit') {
output += `\n${stdout}`;
}
} else if (parsed.opts.stdio !== 'inherit') {
output = `\n${stderr}${stdout}`;
}
err = new Error(`Command failed: ${joinedCmd}${output}`);
err.code = code < 0 ? errname(code) : code;
}
err.stdout = stdout;
err.stderr = stderr;
err.failed = true;
err.signal = signal || null;
err.cmd = joinedCmd;
err.timedOut = timedOut;
return err;
}
function joinCmd(cmd, args) {
let joinedCmd = cmd;
if (Array.isArray(args) && args.length > 0) {
joinedCmd += ' ' + args.join(' ');
}
return joinedCmd;
}
module.exports = (cmd, args, opts) => {
const parsed = handleArgs(cmd, args, opts);
const {encoding, buffer, maxBuffer} = parsed.opts;
const joinedCmd = joinCmd(cmd, args);
let spawned;
try {
spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
} catch (err) {
return Promise.reject(err);
}
let removeExitHandler;
if (parsed.opts.cleanup) {
removeExitHandler = onExit(() => {
spawned.kill();
});
}
let timeoutId = null;
let timedOut = false;
const cleanup = () => {
if (timeoutId) {
clearTimeout(timeoutId);
timeoutId = null;
}
if (removeExitHandler) {
removeExitHandler();
}
};
if (parsed.opts.timeout > 0) {
timeoutId = setTimeout(() => {
timeoutId = null;
timedOut = true;
spawned.kill(parsed.opts.killSignal);
}, parsed.opts.timeout);
}
const processDone = new Promise(resolve => {
spawned.on('exit', (code, signal) => {
cleanup();
resolve({code, signal});
});
spawned.on('error', err => {
cleanup();
resolve({error: err});
});
if (spawned.stdin) {
spawned.stdin.on('error', err => {
cleanup();
resolve({error: err});
});
}
});
function destroy() {
if (spawned.stdout) {
spawned.stdout.destroy();
}
if (spawned.stderr) {
spawned.stderr.destroy();
}
}
const handlePromise = () => pFinally(Promise.all([
processDone,
getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
]).then(arr => {
const result = arr[0];
result.stdout = arr[1];
result.stderr = arr[2];
if (result.error || result.code !== 0 || result.signal !== null) {
const err = makeError(result, {
joinedCmd,
parsed,
timedOut
});
// TODO: missing some timeout logic for killed
// https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
// err.killed = spawned.killed || killed;
err.killed = err.killed || spawned.killed;
if (!parsed.opts.reject) {
return err;
}
throw err;
}
return {
stdout: handleOutput(parsed.opts, result.stdout),
stderr: handleOutput(parsed.opts, result.stderr),
code: 0,
failed: false,
killed: false,
signal: null,
cmd: joinedCmd,
timedOut: false
};
}), destroy);
crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
handleInput(spawned, parsed.opts.input);
spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
spawned.catch = onrejected => handlePromise().catch(onrejected);
return spawned;
};
// TODO: set `stderr: 'ignore'` when that option is implemented
module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
// TODO: set `stdout: 'ignore'` when that option is implemented
module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
module.exports.sync = (cmd, args, opts) => {
const parsed = handleArgs(cmd, args, opts);
const joinedCmd = joinCmd(cmd, args);
if (isStream(parsed.opts.input)) {
throw new TypeError('The `input` option cannot be a stream in sync mode');
}
const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
result.code = result.status;
if (result.error || result.status !== 0 || result.signal !== null) {
const err = makeError(result, {
joinedCmd,
parsed
});
if (!parsed.opts.reject) {
return err;
}
throw err;
}
return {
stdout: handleOutput(parsed.opts, result.stdout),
stderr: handleOutput(parsed.opts, result.stderr),
code: 0,
failed: false,
signal: null,
cmd: joinedCmd,
timedOut: false
};
};
module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
/***/ }),
/***/ 966:
/***/ (function(module, __unusedexports, __webpack_require__) {
"use strict";
const {PassThrough} = __webpack_require__(413);
module.exports = options => {
options = Object.assign({}, options);
const {array} = options;
let {encoding} = options;
const buffer = encoding === 'buffer';
let objectMode = false;
if (array) {
objectMode = !(encoding || buffer);
} else {
encoding = encoding || 'utf8';
}
if (buffer) {
encoding = null;
}
let len = 0;
const ret = [];
const stream = new PassThrough({objectMode});
if (encoding) {
stream.setEncoding(encoding);
}
stream.on('data', chunk => {
ret.push(chunk);
if (objectMode) {
len = ret.length;
} else {
len += chunk.length;
}
});
stream.getBufferedValue = () => {
if (array) {
return ret;
}
return buffer ? Buffer.concat(ret, len) : ret.join('');
};
stream.getBufferedLength = () => len;
return stream;
};
/***/ }),
/***/ 969:
/***/ (function(module, __unusedexports, __webpack_require__) {
var wrappy = __webpack_require__(11)
module.exports = wrappy(once)
module.exports.strict = wrappy(onceStrict)
once.proto = once(function () {
Object.defineProperty(Function.prototype, 'once', {
value: function () {
return once(this)
},
configurable: true
})
Object.defineProperty(Function.prototype, 'onceStrict', {
value: function () {
return onceStrict(this)
},
configurable: true
})
})
function once (fn) {
var f = function () {
if (f.called) return f.value
f.called = true
return f.value = fn.apply(this, arguments)
}
f.called = false
return f
}
function onceStrict (fn) {
var f = function () {
if (f.called)
throw new Error(f.onceError)
f.called = true
return f.value = fn.apply(this, arguments)
}
var name = fn.name || 'Function wrapped with `once`'
f.onceError = name + " shouldn't be called more than once"
f.called = false
return f
}
/***/ }),
/***/ 979:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(__webpack_require__(470));
/**
* Internal class for retries
*/
class RetryHelper {
constructor(maxAttempts, minSeconds, maxSeconds) {
if (maxAttempts < 1) {
throw new Error('max attempts should be greater than or equal to 1');
}
this.maxAttempts = maxAttempts;
this.minSeconds = Math.floor(minSeconds);
this.maxSeconds = Math.floor(maxSeconds);
if (this.minSeconds > this.maxSeconds) {
throw new Error('min seconds should be less than or equal to max seconds');
}
}
execute(action, isRetryable) {
return __awaiter(this, void 0, void 0, function* () {
let attempt = 1;
while (attempt < this.maxAttempts) {
// Try
try {
return yield action();
}
catch (err) {
if (isRetryable && !isRetryable(err)) {
throw err;
}
core.info(err.message);
}
// Sleep
const seconds = this.getSleepAmount();
core.info(`Waiting ${seconds} seconds before trying again`);
yield this.sleep(seconds);
attempt++;
}
// Last attempt
return yield action();
});
}
getSleepAmount() {
return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
this.minSeconds);
}
sleep(seconds) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise(resolve => setTimeout(resolve, seconds * 1000));
});
}
}
exports.RetryHelper = RetryHelper;
//# sourceMappingURL=retry-helper.js.map
/***/ }),
/***/ 986:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const tr = __webpack_require__(686);
/**
* Exec a command.
* Output will be streamed to the live console.
* Returns promise with return code
*
* @param commandLine command to execute (can include additional args). Must be correctly escaped.
* @param args optional arguments for tool. Escaping is handled by the lib.
* @param options optional exec options. See ExecOptions
* @returns Promise<number> exit code
*/
function exec(commandLine, args, options) {
return __awaiter(this, void 0, void 0, function* () {
const commandArgs = tr.argStringToArray(commandLine);
if (commandArgs.length === 0) {
throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
}
// Path to tool to execute should be first arg
const toolPath = commandArgs[0];
args = commandArgs.slice(1).concat(args || []);
const runner = new tr.ToolRunner(toolPath, args, options);
return runner.exec();
});
}
exports.exec = exec;
//# sourceMappingURL=exec.js.map
/***/ }),
/***/ 996:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(__webpack_require__(470));
const engine = __importStar(__webpack_require__(643));
const defaults = __importStar(__webpack_require__(564));
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
// Parse inputs and prepare context for installer
const context = new engine.BuildContext({
pyenv_version: defaults.PYENV_VERSION
});
// Download and Install pyenv
const installer = new engine.PyEnvInstaller(context.pyenv_version);
const archive_path = yield installer.downloadArchive();
const pyenv_root = yield installer.installFromArchive(archive_path);
console.log(`archive_path ${archive_path}`);
console.log(`pyenv_root ${pyenv_root}`);
// Setup build environment to support pyenv
const environment = new engine.EnvironmentManager({
context,
pyenv_root
});
// this call makes the pyenv binary available to the PATH and
// enable the command pyenv install by setting PYENV_ROOT environment variable.
// At this point pyenv is ready to be used, next we pre-install the python versions declared
environment.setup();
// pre-install all pyenv versions
yield environment.install_versions();
yield environment.set_default_version();
}
catch (error) {
core.setFailed(error.message);
}
});
}
run();
/***/ })
/******/ });
|
// Copyright (c) 2009-2017 SAP SE, All Rights Reserved
sap.ui.define([
"sap/ushell/components/tiles/utils",
"sap/ushell/components/tiles/utilsRT",
"sap/ushell/components/applicationIntegration/AppLifeCycle",
"sap/ushell/Config",
"sap/ushell/services/AppType",
"sap/m/library",
"sap/ui/model/json/JSONModel",
"sap/base/Log",
"sap/ui/thirdparty/jquery"
], function (
utils,
utilsRT,
AppLifeCycle,
Config,
AppType,
library,
JSONModel,
Log,
jQuery
) {
"use strict";
// shortcut for sap.m.GenericTileScope
var GenericTileScope = library.GenericTileScope;
var GenericTileMode = library.GenericTileMode;
/* global hasher */
sap.ui.getCore().loadLibrary("sap.m");
sap.ui.controller("sap.ushell.components.tiles.applauncher.StaticTile", {
_aDoableObject: {},
onInit: function () {
var oStaticTileView = this.getView(),
oViewData = oStaticTileView.getViewData(),
oTileApi = oViewData.chip, // instance specific CHIP API
oConfig = utilsRT.getConfiguration(oTileApi, oTileApi.configurationUi.isEnabled(), false),
oModel,
sKeywords,
aKeywords,
that = this,
sNavigationTargetUrl = oConfig.navigation_target_url,
sSystem,
oUrlParser,
oHash;
this.oShellModel = AppLifeCycle.getElementsModel();
sSystem = oTileApi.url.getApplicationSystem();
if (sSystem) { // propagate system to target application
oUrlParser = sap.ushell.Container.getService("URLParsing");
// when the navigation url is hash we want to make sure system parameter is in the parameters part
if (oUrlParser.isIntentUrl(sNavigationTargetUrl)) {
oHash = oUrlParser.parseShellHash(sNavigationTargetUrl);
if (!oHash.params) {
oHash.params = {};
}
oHash.params["sap-system"] = sSystem;
sNavigationTargetUrl = "#" + oUrlParser.constructShellHash(oHash);
} else {
sNavigationTargetUrl += ((sNavigationTargetUrl.indexOf("?") < 0) ? "?" : "&")
+ "sap-system=" + sSystem;
}
} this.navigationTargetUrl = sNavigationTargetUrl;
/*
* Model of the applauncher tile consisting of config (tile configuration), nav (target URL set to '' in case of Admin UI), and search (highlight terms)
*/
oModel = new JSONModel({
sizeBehavior: Config.last("/core/home/sizeBehavior"),
wrappingType: Config.last("/core/home/wrappingType"),
mode: oConfig.display_mode,
config: oConfig,
nav: { navigation_target_url: (oTileApi.configurationUi && oTileApi.configurationUi.isEnabled() ? "" : sNavigationTargetUrl) },
search: {
display_highlight_terms: []
}
});
oStaticTileView.setModel(oModel);
// listen for changes of the size behavior, as the end user can change it in the settings,(if enabled)
this._aDoableObject = Config.on("/core/home/sizeBehavior").do(function (sSizeBehavior) {
oModel.setProperty("/sizeBehavior", sSizeBehavior);
});
// implement types contact
// default is Tile
if (oTileApi.types) {
oTileApi.types.attachSetType(function (sType) {
if (that.tileType != sType) {
var oModel = that.getView().getModel();
if (sType === "link") {
oModel.setProperty("/mode", GenericTileMode.LineMode);
} else {
oModel.setProperty("/mode", oModel.getProperty("/config/display_mode"));
}
that.tileType = sType;
}
});
}
if (!this.tileType) {
this.tileType = "tile";
}
// implement search contract
if (oTileApi.search) {
// split and clean keyword string (may be comma + space delimited)
sKeywords = oStaticTileView.getModel().getProperty("/config/display_search_keywords");
aKeywords = sKeywords
.split(/[, ]+/)
.filter(function (n) { return n && n !== ""; });
// add title and subtitle (if present) to keywords for better FLP searching
if (oConfig.display_title_text && oConfig.display_title_text !== "" &&
aKeywords.indexOf(oConfig.display_title_text) === -1) {
aKeywords.push(oConfig.display_title_text);
}
if (oConfig.display_subtitle_text && oConfig.display_subtitle_text !== "" &&
aKeywords.indexOf(oConfig.display_subtitle_text) === -1) {
aKeywords.push(oConfig.display_subtitle_text);
}
if (oConfig.display_info_text && oConfig.display_info_text !== "" &&
aKeywords.indexOf(oConfig.display_info_text) === -1) {
aKeywords.push(oConfig.display_info_text);
}
// defined in search contract:
oTileApi.search.setKeywords(aKeywords);
oTileApi.search.attachHighlight(
function (aHighlightWords) {
oStaticTileView.getModel().setProperty("/search/display_highlight_terms", aHighlightWords);
}
);
}
// implement bag update handler
if (oTileApi.bag && oTileApi.bag.attachBagsUpdated) {
// is only called by the FLP for bookmark tiles which have been updated via bookmark service
oTileApi.bag.attachBagsUpdated(function (aUpdatedBagIds) {
if (aUpdatedBagIds.indexOf("tileProperties") > -1) {
utils._updateTilePropertiesTexts(oStaticTileView, oTileApi.bag.getBag("tileProperties"));
}
});
}
// implement configuration update handler
if (oTileApi.configuration && oTileApi.configuration.attachConfigurationUpdated) {
// is only called by the FLP for bookmark tiles which have been updated via bookmark service
oTileApi.configuration.attachConfigurationUpdated(function (aUpdatedConfigKeys) {
if (aUpdatedConfigKeys.indexOf("tileConfiguration") > -1) {
utils._updateTileConfiguration(oStaticTileView, oTileApi.configuration.getParameterValueAsString("tileConfiguration"));
}
});
}
// implement preview contract
if (oTileApi.preview) {
oTileApi.preview.setTargetUrl(sNavigationTargetUrl);
oTileApi.preview.setPreviewIcon(oConfig.display_icon_url);
oTileApi.preview.setPreviewTitle(oConfig.display_title_text);
if (oTileApi.preview.setPreviewSubtitle && typeof oTileApi.preview.setPreviewSubtitle === "function") {
oTileApi.preview.setPreviewSubtitle(oConfig.display_subtitle_text);
}
}// implement configurationUi contract: setup configuration UI
if (oTileApi.configurationUi.isEnabled()) {
oTileApi.configurationUi.setUiProvider(function () {
// attach configuration UI provider, which is essentially a components.tiles.applauncher.Configuration
var oConfigurationUi = utils.getConfigurationUi(oStaticTileView, "sap.ushell.components.tiles.applauncher.Configuration");
oTileApi.configurationUi.attachCancel(that.onCancelConfiguration.bind(null, oConfigurationUi));
oTileApi.configurationUi.attachSave(that.onSaveConfiguration.bind(null, oConfigurationUi));
return oConfigurationUi;
});
this.getView().getContent()[0].setTooltip(
utils.getResourceBundleModel().getResourceBundle()
.getText("edit_configuration.tooltip")
);
}
// attach the tile actions provider for the actions contract
if (oTileApi.actions) {
//TODO check new property name with designer dudes
var aActions = oConfig.actions, aExtendedActions;
if (aActions) {
aExtendedActions = aActions.slice();
} else {
aExtendedActions = [];
}
var sType = oModel.getProperty("/mode") === GenericTileMode.LineMode ? "link" : "tile",
tileSettingsAction = utilsRT.getTileSettingsAction(oModel, this.onSaveRuntimeSettings.bind(this), sType);
aExtendedActions.push(tileSettingsAction);
oTileApi.actions.setActionsProvider(function () {
return aExtendedActions;
});
}
},
onExit: function () {
this._aDoableObject.off();
},
// trigger to show the configuration UI if the tile is pressed in Admin mode
onPress: function (oEvent) {
var oStaticTileView = this.getView(),
oViewData = oStaticTileView.getViewData(),
oTileApi = oViewData.chip,
oTileConfig = oStaticTileView.getModel().getProperty("/config");
//scope is property of generic tile. It's default value is "Display"
if (oEvent.getSource().getScope && oEvent.getSource().getScope() === GenericTileScope.Display) {
if (oTileApi.configurationUi.isEnabled()) {
oTileApi.configurationUi.display();
} else if (this.navigationTargetUrl) {
if (this.navigationTargetUrl[0] === "#") {
hasher.setHash(this.navigationTargetUrl);
} else {
var bLogRecentActivity = Config.last("/core/shell/enableRecentActivity") && Config.last("/core/shell/enableRecentActivityLogging");
if (bLogRecentActivity) {
var oRecentEntry = {
title: oTileConfig.display_title_text,
appType: AppType.URL,
url: oTileConfig.navigation_target_url,
appId: oTileConfig.navigation_target_url
};
sap.ushell.Container.getRenderer("fiori2").logRecentActivity(oRecentEntry);
}
window.open(this.navigationTargetUrl, "_blank");
}
}
}
},
// tile settings action UI save handler
onSaveRuntimeSettings: function (oSettingsView) {
var oViewModel = oSettingsView.getModel(),
oTileApi = this.getView().getViewData().chip,
oConfigToSave = this.getView().getModel().getProperty("/config");
oConfigToSave.display_title_text = oViewModel.getProperty("/title");
oConfigToSave.display_subtitle_text = oViewModel.getProperty("/subtitle");
oConfigToSave.display_info_text = oViewModel.getProperty("/info");
oConfigToSave.display_search_keywords = oViewModel.getProperty("/keywords");
// use bag contract in order to store translatable properties
var tilePropertiesBag = oTileApi.bag.getBag("tileProperties");
tilePropertiesBag.setText("display_title_text", oConfigToSave.display_title_text);
tilePropertiesBag.setText("display_subtitle_text", oConfigToSave.display_subtitle_text);
tilePropertiesBag.setText("display_info_text", oConfigToSave.display_info_text);
tilePropertiesBag.setText("display_search_keywords", oConfigToSave.display_search_keywords);
function logErrorAndReject (oError) {
Log.error(oError, null, "sap.ushell.components.tiles.applauncher.StaticTile.controller");
}
// saving the relevant properteis
tilePropertiesBag.save(
// success handler
function () {
Log.debug("property bag 'tileProperties' saved successfully");
// update tile's model
this.getView().getModel().setProperty("/config/display_title_text", oConfigToSave.display_title_text);
this.getView().getModel().setProperty("/config/display_subtitle_text", oConfigToSave.display_subtitle_text);
this.getView().getModel().setProperty("/config/display_info_text", oConfigToSave.display_info_text);
this.getView().getModel().setProperty("/config/display_search_keywords", oConfigToSave.display_search_keywords);
// call to refresh model which (due to the binding) will refresh the tile
this.getView().getModel().refresh();
}.bind(this),
logErrorAndReject // error handler
);
},
// configuration save handler
onSaveConfiguration: function (oConfigurationView) {
// the deferred object required from the configurationUi contract
var oDeferred = jQuery.Deferred();
var oModel = oConfigurationView.getModel();
// tile model placed into configuration model by getConfigurationUi
var oTileModel = oModel.getProperty("/tileModel");
var oTileApi = oConfigurationView.getViewData().chip;
var aTileNavigationActions = utils.tileActionsRows2TileActionsArray(oModel.getProperty("/config/tile_actions_rows"));
// get the configuration to save from the model
var configToSave = {
display_icon_url: oModel.getProperty("/config/display_icon_url"),
navigation_use_semantic_object: oModel.getProperty("/config/navigation_use_semantic_object"),
navigation_target_url: oModel.getProperty("/config/navigation_target_url"),
navigation_semantic_object: jQuery.trim(oModel.getProperty("/config/navigation_semantic_object")) || "",
navigation_semantic_action: jQuery.trim(oModel.getProperty("/config/navigation_semantic_action")) || "",
navigation_semantic_parameters: jQuery.trim(oModel.getProperty("/config/navigation_semantic_parameters")),
display_search_keywords: oModel.getProperty("/config/display_search_keywords")
};
//If the input fields icon, semantic object and action are failing the input validations, then through an error message requesting the user to enter/correct those fields
var bReject = utils.checkInputOnSaveConfig(oConfigurationView);
if (!bReject) {
bReject = utils.checkTileActions(oConfigurationView);
}
if (bReject) {
oDeferred.reject("mandatory_fields_missing");
return oDeferred.promise();
}
// overwrite target URL in case of semantic object navigation
if (configToSave.navigation_use_semantic_object) {
configToSave.navigation_target_url = utilsRT.getSemanticNavigationUrl(configToSave);
oModel.setProperty("/config/navigation_target_url", configToSave.navigation_target_url);
}
// use bag in order to store translatable properties
var tilePropertiesBag = oTileApi.bag.getBag("tileProperties");
tilePropertiesBag.setText("display_title_text", oModel.getProperty("/config/display_title_text"));
tilePropertiesBag.setText("display_subtitle_text", oModel.getProperty("/config/display_subtitle_text"));
tilePropertiesBag.setText("display_info_text", oModel.getProperty("/config/display_info_text"));
tilePropertiesBag.setText("display_search_keywords", configToSave.display_search_keywords);
var tileNavigationActionsBag = oTileApi.bag.getBag("tileNavigationActions");
//forward populating of tile navigation actions array into the bag, to Utils
utils.populateTileNavigationActionsBag(tileNavigationActionsBag, aTileNavigationActions);
function logErrorAndReject (oError, oErrorInfo) {
Log.error(oError, null, "sap.ushell.components.tiles.applauncher.StaticTile.controller");
oDeferred.reject(oError, oErrorInfo);
}
// use configuration contract to write parameter values
oTileApi.writeConfiguration.setParameterValues(
{ tileConfiguration: JSON.stringify(configToSave) },
// success handler
function () {
var oConfigurationConfig = utilsRT.getConfiguration(oTileApi, false, false),
oTileConfig = utilsRT.getConfiguration(oTileApi, true, false),
// switching the model under the tile -> keep the tile model
oModel = new JSONModel({
config: oConfigurationConfig,
// set empty target url in configuration mode
nav: { navigation_target_url: "" },
// keep tile model
tileModel: oTileModel
});
oConfigurationView.setModel(oModel);
// update tile model
oTileModel.setData({ config: oTileConfig, nav: { navigation_target_url: "" } }, false);
// update tile model
if (oTileApi.preview) {
oTileApi.preview.setTargetUrl(oConfigurationConfig.navigation_target_url);
oTileApi.preview.setPreviewIcon(oConfigurationConfig.display_icon_url);
oTileApi.preview.setPreviewTitle(oConfigurationConfig.display_title_text);
if (oTileApi.preview.setPreviewSubtitle && typeof oTileApi.preview.setPreviewSubtitle === "function") {
oTileApi.preview.setPreviewSubtitle(oConfigurationConfig.display_subtitle_text);
}
}
tilePropertiesBag.save(
// success handler
function () {
Log.debug("property bag 'tileProperties' saved successfully");
// update possibly changed values via contracts
if (oTileApi.title) {
oTileApi.title.setTitle(
oConfigurationConfig.display_title_text,
// success handler
function () {
oDeferred.resolve();
},
logErrorAndReject // error handler
);
} else {
oDeferred.resolve();
}
},
logErrorAndReject // error handler
);
tileNavigationActionsBag.save(
// success handler
function () {
Log.debug("property bag 'navigationProperties' saved successfully");
},
logErrorAndReject // error handler
);
},
logErrorAndReject // error handler
);
return oDeferred.promise();
},
// configuration cancel handler
onCancelConfiguration: function (oConfigurationView) {
// re-load old configuration and display
var oViewData = oConfigurationView.getViewData(),
oModel = oConfigurationView.getModel(),
// tile model placed into configuration model by getConfigurationUi
oTileModel = oModel.getProperty("/tileModel"),
oTileApi = oViewData.chip,
oCurrentConfig = utilsRT.getConfiguration(oTileApi, oTileApi.configurationUi.isEnabled(), false);
oConfigurationView.getModel().setData({
config: oCurrentConfig,
// set empty target url in configuration mode
nav: { navigation_target_url: "" },
tileModel: oTileModel
}, false);
}
});
}, /* bExport= */ false);
|
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { AutoForm } from 'meteor/aldeed:autoform';
import { Users } from '/imports/api/users/users.js';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { Roles } from 'meteor/alanning:roles';
import './edit-profile.html';
AutoForm.hooks({
editProfileForm: {
before: {
update(doc) {
return doc;
},
},
after: {
update(error, result) {
if (error) {
if (error.reason) {
alert(error.reason);
}
} else if (result) {
Materialize.toast('Your profile was updated successfully', 4000);
// Continues to '/'
FlowRouter.go('App.home');
}
},
},
},
});
Template.editProfile.onCreated(function () {
});
Template.editProfile.helpers({
currentUser() {
return Meteor.user();
},
email() {
const user = Meteor.users.findOne({ _id: Meteor.userId() });
return user.emails[0].address;
},
usersCollection() {
return Users;
},
usersSchema() {
return Users.simpleSchema();
},
});
Template.editProfile.events({
// Update the hidden field 'name'
'change input[name="profile.firstName"]'() {
const name = `${$('input[name="profile.firstName"]').val()} ${$('input[name="profile.lastName"]').val()}`;
$('input[name="profile.name"]').val(name);
},
'change input[name="profile.lastName"]'() {
const name = `${$('input[name="profile.firstName"]').val() } ${ $('input[name="profile.lastName"]').val()}`;
$('input[name="profile.name"]').val(name);
},
});
|
deepmacDetailCallback("00261f000000/24",[{"d":"2009-05-10","t":"add","a":"SAE Technology Centre\n6 Science Park East Avenue\nHong Kong Science Park Shatin, New Territories\n","c":"HONG KONG","o":"SAE Magnetics (H.K.) Ltd.","s":"wireshark.org"},{"d":"2015-08-27","t":"change","a":"SAE Technology Centre Hong Kong Science Park Shatin, New Territories HK","c":"HK","o":"SAE Magnetics (H.K.) Ltd."}]);
|
import { hits } from 'instantsearch.js/es/widgets';
import template from './hit.html';
import './hit.scss';
export default class Hit {
constructor(search) {
search.addWidget(
hits({
container: '#results',
templates: {
empty: '',
item: template,
},
})
);
}
}
|
import React, { Component } from "react";
import PropTypes from "prop-types";
import ProfilePresenter from "./ProfilePresenter";
class ProfileContainer extends Component {
state = {
loading: true,
seeFollowers: false,
seeFollowings: false
};
static propTypes = {
getProfile: PropTypes.func.isRequired,
goToCreateChannel: PropTypes.func.isRequired
};
componentDidMount() {
const { getProfile } = this.props;
getProfile();
}
componentWillReceiveProps = nextProps => {
if (nextProps.yourProfile) {
this.setState({
loading: false
});
}
};
render() {
const { loading, seeFollowers, seeFollowings } = this.state;
const { yourProfile } = this.props;
return (
<ProfilePresenter
loading={loading}
yourProfile={yourProfile}
seeFollowers={seeFollowers}
seeFollowings={seeFollowings}
toggleFollowers={this._toggleFollowers}
toggleFollowings={this._toggleFollowings}
goCraeteFunc={this._goCreateFunc}
/>
);
}
_toggleFollowers = () => {
this.setState(state => {
return {
seeFollowers: !state.seeFollowers
};
});
};
_toggleFollowings = () => {
this.setState(state => {
return {
seeFollowings: !state.seeFollowings
};
});
};
_goCreateFunc = () => {
const { goToCreateChannel } = this.props;
goToCreateChannel();
};
}
export default ProfileContainer;
|
// customize the experiment by specifying a view order and a trial structure
exp.customize = function() {
// specify view order
this.views_seq = [
intro,
main,
postTest,
thanks
];
// prepare information about trials (procedure)
// randomize main trial order, but keep practice trial order fixed
this.trial_info.main_trials = _.shuffle(main_trials);
// adds progress bars to the views listed
// view's name is the same as object's name
this.progress_bar_in = ['main'];
// this.progress_bar_in = ['practice', 'main'];
// styles: chunks, separate or default
this.progress_bar_style = 'default';
// the width of the progress bar or a single chunk
this.progress_bar_width = 100;
};
|
import {Component} from '../Component';
import {ComponentPropertiesDlg} from '../Dlg/ComponentPropertiesDlg';
/**
* Component: n-to-1 Multiplexer
*
* Works for both busses and single-bit inputs.
* @constructor
*/
export const BusMultiplexer = function() {
Component.call(this);
this.height = 80;
this.width = 32;
// Number of inputs
this.size = 2;
this.lastIn = null;
this.bus = true;
// Size inputs and one output
this.circuitIns = [];
this.addOut(this.width/2, 0, 8, "O").bus = true;
const inp = this.addIn(0, -this.height / 2 + 10, 13, "");
inp.orientation = "n";
this.ensureIO();
};
BusMultiplexer.prototype = Object.create(Component.prototype);
BusMultiplexer.prototype.constructor = BusMultiplexer;
BusMultiplexer.prototype.prefix = null;
BusMultiplexer.prototype.indent = 10;
BusMultiplexer.type = "Multiplexer"; ///< Name to use in files
BusMultiplexer.label = "Multiplexer"; ///< Label for the palette
BusMultiplexer.desc = "Multiplexer"; ///< Description for the palette
BusMultiplexer.img = "multiplexer.png"; ///< Image to use for the palette
BusMultiplexer.description = `<h2>Multiplexer</h2><p>Multiplexes 2 to 16 inputs to a single output. The
inputs and outputs and can be configured as buses or single bits.</p>
<p>The value of the input pin or bus determines which input is routed to O. The input will be a single
bit if there are two choices (binary) or a bus if there are more than 2 choices. </p>`;
BusMultiplexer.order = 402;
BusMultiplexer.help = 'multiplexer';
/**
* Compute the gate result
* @param state
*/
BusMultiplexer.prototype.compute = function(state) {
// Which input?
var in0 = state[0];
if(in0 === undefined) {
this.outs[0].set(undefined);
this.lastIn = null;
return;
}
if(Array.isArray(in0)) {
var in0a = 0;
var in0p = 1;
in0.forEach(function(i) {
if(i) {
in0a += in0p;
}
in0p *= 2;
})
in0 = in0a;
} else {
in0 = in0 ? 1 : 0;
}
if(in0 <= state.length) {
this.outs[0].set(state[in0+1]);
this.lastIn = in0;
} else {
this.outs[0].set(undefined);
this.lastIn = null;
}
};
/**
* Clone this component object.
* @returns {BusMultiplexer}
*/
BusMultiplexer.prototype.clone = function() {
const copy = new BusMultiplexer();
copy.size = this.size;
copy.bus = this.bus;
copy.ensureIO();
copy.copyFrom(this);
return copy;
};
/**
* Load this object from an object converted from JSON
* @param obj Object from JSON
*/
BusMultiplexer.prototype.load = function(obj) {
this.size = obj["size"];
this.bus = obj["bus"] !== false;
this.ensureIO();
Component.prototype.load.call(this, obj);
};
/**
* Create a save object suitable for conversion to JSON for export.
* @returns {*}
*/
BusMultiplexer.prototype.save = function() {
var obj = Component.prototype.save.call(this);
obj.size = this.size;
obj.bus = this.bus;
return obj;
};
/**
* Ensure the actual number of inputs matches the
* defined bus size.
*/
BusMultiplexer.prototype.ensureIO = function() {
if(this.bus !== this.outs[0].bus) {
this.outs[0].clear();
this.outs[0].bus = this.bus;
// Clear the inputs after the first one (selector)
for(i=1; i<this.ins.length; i++) {
this.ins[i].clear();
}
this.ins.splice(1, this.ins.length-1);
}
const spacing = 16;
this.height = this.size * spacing + 16;
if(this.height < 48) {
this.height = 48;
}
var x = this.width / 2;
var in0 = this.ins[0];
in0.x = 0;
in0.y = -this.height / 2 + this.indent / 2;
in0.bus = this.size > 2;
var startY = this.size / 2 * spacing - 8;
for(var i=0; i<this.size; i++) {
if(i >= (this.ins.length - 1)) {
break;
}
var ins = this.ins[i+1];
ins.name = "I" + i;
ins.x = -x;
ins.y = startY - i * spacing;
ins.len = 8;
}
// Add any new pins
for(; i<this.size; i++) {
this.addIn(-x, startY - i * spacing, 8, "I" + i).bus = this.bus;
}
// Delete pins that have ceased to exist
i++;
if(i < this.ins.length) {
for( ; i<this.ins.length; i++) {
this.ins[i].clear();
}
this.ins.splice(this.size+1);
}
}
/**
* Draw component object.
* @param context Display context
* @param view View object
*/
BusMultiplexer.prototype.draw = function(context, view) {
this.selectStyle(context, view);
this.drawTrap(context, 0, this.indent);
if(this.lastIn !== null) {
const spacing = 16;
const x1 = this.x - 4;
const x2 = this.x + 4;
const y2 = this.y - 1;
const startY = this.y + this.size / 2 * spacing - 10;
const y1 = startY - this.lastIn * 16;
this.jaggedLine(context, x1, y1, x2, y2, 0.5);
}
this.drawIO(context, view);
};
BusMultiplexer.prototype.properties = function(main) {
const dlg = new ComponentPropertiesDlg(this, main);
const id = dlg.uniqueId();
let html = `<div class="control1 center gap"><label for="${id}">Number of inputs: </label>
<input class="number" type="text" name="${id}" id="${id}" value="${this.size}"></div>`;
html += '<div class="control center"><div class="choosers">';
const busId = dlg.uniqueId();
html += `
<label><input type="radio" name="${busId}" ${this.bus ? 'checked' : ''} value="1"> Bus</label>
<label><input type="radio" name="${busId}" ${!this.bus ? 'checked' : ''} value="0"> Single Bit</label>`;
html += '</div></div>';
dlg.extra(html, () => {
const size = parseInt(document.getElementById(id).value);
if(isNaN(size) || size < 2 || size > 16) {
document.getElementById(id).select();
return "Must be an integer from 2 to 16";
}
return null;
}, () => {
this.size = parseInt(document.getElementById(id).value);
this.bus = document.querySelector(`input[name=${busId}]:checked`).value === '1';
this.ensureIO();
});
dlg.open();
};
|
import foo from './foo.js';
function x () {
var answer = foo();
return { answer };
}
assert.equal( x().answer, 42 );
|
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.openAPIMajor = exports.detectOpenAPI = exports.lintDocument = exports.lint = exports.OasMajorVersion = exports.OasVersion = void 0;
const resolve_1 = require("./resolve");
const visitors_1 = require("./visitors");
const oas3_1 = require("./types/oas3");
const oas2_1 = require("./types/oas2");
const walk_1 = require("./walk");
const types_1 = require("./types");
const rules_1 = require("./config/rules");
const ajv_1 = require("./rules/ajv");
var OasVersion;
(function (OasVersion) {
OasVersion["Version2"] = "oas2";
OasVersion["Version3_0"] = "oas3_0";
})(OasVersion = exports.OasVersion || (exports.OasVersion = {}));
var OasMajorVersion;
(function (OasMajorVersion) {
OasMajorVersion["Version2"] = "oas2";
OasMajorVersion["Version3"] = "oas3";
})(OasMajorVersion = exports.OasMajorVersion || (exports.OasMajorVersion = {}));
function lint(opts) {
return __awaiter(this, void 0, void 0, function* () {
const { ref, externalRefResolver = new resolve_1.BaseResolver(opts.config.resolve) } = opts;
const document = (yield externalRefResolver.resolveDocument(null, ref));
return lintDocument(Object.assign(Object.assign({ document }, opts), { externalRefResolver, config: opts.config.lint }));
});
}
exports.lint = lint;
function lintDocument(opts) {
return __awaiter(this, void 0, void 0, function* () {
ajv_1.releaseAjvInstance(); // FIXME: preprocessors can modify nodes which are then cached to ajv-instance by absolute path
const { document, customTypes, externalRefResolver, config } = opts;
const oasVersion = detectOpenAPI(document.parsed);
const oasMajorVersion = openAPIMajor(oasVersion);
const rules = config.getRulesForOasVersion(oasMajorVersion);
const types = types_1.normalizeTypes(config.extendTypes((customTypes !== null && customTypes !== void 0 ? customTypes : oasMajorVersion === OasMajorVersion.Version3) ? oas3_1.Oas3Types : oas2_1.Oas2Types, oasVersion));
const ctx = {
problems: [],
oasVersion: oasVersion,
};
const preprocessors = rules_1.initRules(rules, config, 'preprocessors', oasVersion);
const regularRules = rules_1.initRules(rules, config, 'rules', oasVersion);
//@ts-ignore
const normalizedVisitors = visitors_1.normalizeVisitors([...preprocessors, ...regularRules], types);
const resolvedRefMap = yield resolve_1.resolveDocument({
rootDocument: document,
rootType: types.DefinitionRoot,
externalRefResolver,
});
walk_1.walkDocument({
document,
rootType: types.DefinitionRoot,
normalizedVisitors,
resolvedRefMap,
ctx,
});
return ctx.problems.map((problem) => config.addProblemToIgnore(problem));
});
}
exports.lintDocument = lintDocument;
function detectOpenAPI(root) {
if (typeof root !== 'object') {
throw new Error(`Document must be JSON object, got ${typeof root}`);
}
if (!(root.openapi || root.swagger)) {
throw new Error('This doesn’t look like an OpenAPI document.\n');
}
if (root.openapi && root.openapi.startsWith('3.0')) {
return OasVersion.Version3_0;
}
if (root.swagger && root.swagger === '2.0') {
return OasVersion.Version2;
}
throw new Error(`Unsupported OpenAPI Version: ${root.openapi || root.swagger}`);
}
exports.detectOpenAPI = detectOpenAPI;
function openAPIMajor(version) {
if (version === OasVersion.Version2) {
return OasMajorVersion.Version2;
}
else {
return OasMajorVersion.Version3;
}
}
exports.openAPIMajor = openAPIMajor;
|
// @flow
import React from 'react';
import Link from 'gatsby-link';
import './Menu.scss';
const Menu = () => (
<nav className="c-menu">
<Link className="c-menu__link" to="/dizin" activeClassName="is-active">
Dizin
</Link>
<Link className="c-menu__link" to="/konular" activeClassName="is-active">
Konular
</Link>
<a
href={`${process.env.GATSBY_REPO_URL || ''}/blob/master/CONTRIBUTING.md`}
target="_blank"
rel="noopener noreferrer"
className="c-button c-button--primary"
>
Katkıda Bulun
</a>
</nav>
);
export default Menu;
|
const db = require('../db');
module.exports = async (publisherId) => {
const { cdnHostname } = await db.strictFindById('publishers', publisherId, {
projection: { cdnHostname: 1 },
});
return cdnHostname;
};
|
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(808);
module.exports = __webpack_require__(808);
/***/ }),
/***/ 808:
/***/ (function(module, exports) {
(function( window, undefined ) {
kendo.cultures["twq"] = {
name: "twq",
numberFormat: {
pattern: ["-n"],
decimals: 2,
",": " ",
".": ".",
groupSize: [3],
percent: {
pattern: ["-n%","n%"],
decimals: 2,
",": " ",
".": ".",
groupSize: [3],
symbol: "%"
},
currency: {
name: "",
abbr: "",
pattern: ["-n$","n$"],
decimals: 0,
",": " ",
".": ".",
groupSize: [3],
symbol: "CFA"
}
},
calendars: {
standard: {
days: {
names: ["Alhadi","Atinni","Atalaata","Alarba","Alhamiisa","Alzuma","Asibti"],
namesAbbr: ["Alh","Ati","Ata","Ala","Alm","Alz","Asi"],
namesShort: ["Alh","Ati","Ata","Ala","Alm","Alz","Asi"]
},
months: {
names: ["Žanwiye","Feewiriye","Marsi","Awiril","Me","Žuweŋ","Žuyye","Ut","Sektanbur","Oktoobur","Noowanbur","Deesanbur"],
namesAbbr: ["Žan","Fee","Mar","Awi","Me","Žuw","Žuy","Ut","Sek","Okt","Noo","Dee"]
},
AM: ["Subbaahi","subbaahi","SUBBAAHI"],
PM: ["Zaarikay b","zaarikay b","ZAARIKAY B"],
patterns: {
d: "d/M/yyyy",
D: "dddd d MMMM yyyy",
F: "dddd d MMMM yyyy HH:mm:ss",
g: "d/M/yyyy HH:mm",
G: "d/M/yyyy HH:mm:ss",
m: "MMMM d",
M: "MMMM d",
s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
t: "HH:mm",
T: "HH:mm:ss",
u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
y: "yyyy MMMM",
Y: "yyyy MMMM"
},
"/": "/",
":": ":",
firstDay: 1
}
}
}
})(this);
/***/ })
/******/ });
|
import { bind, OpaqueToken } from 'angular2/di';
export class Options {
// TODO(tbosch): use static initializer when our transpiler supports it
static get SAMPLE_ID() { return _SAMPLE_ID; }
// TODO(tbosch): use static initializer when our transpiler supports it
static get DEFAULT_DESCRIPTION() { return _DEFAULT_DESCRIPTION; }
// TODO(tbosch): use static initializer when our transpiler supports it
static get SAMPLE_DESCRIPTION() { return _SAMPLE_DESCRIPTION; }
// TODO(tbosch): use static initializer when our transpiler supports it
static get FORCE_GC() { return _FORCE_GC; }
// TODO(tbosch): use static initializer when our transpiler supports it
static get PREPARE() { return _PREPARE; }
// TODO(tbosch): use static initializer when our transpiler supports it
static get EXECUTE() { return _EXECUTE; }
}
var _SAMPLE_ID = new OpaqueToken('SampleDescription.sampleId');
var _DEFAULT_DESCRIPTION = new OpaqueToken('SampleDescription.defaultDescription');
var _SAMPLE_DESCRIPTION = new OpaqueToken('SampleDescription.sampleDescription');
var _FORCE_GC = new OpaqueToken('Sampler.forceGc');
var _PREPARE = new OpaqueToken('Sampler.prepare');
var _EXECUTE = new OpaqueToken('Sampler.execute');
|
export default {
props: {
type: { type: 'enum', values: ['paragraph'] },
content: {
type: 'array',
items: ['inline'],
allowUnsupportedInline: true,
optional: true,
},
marks: { type: 'array', items: [], optional: true },
},
};
//# sourceMappingURL=paragraph.js.map
|
import React from 'react';
import {
Image,
Subtitle,
Overlay,
Title,
Divider,
TouchableOpacity,
Tile,
} from '@shoutem/ui';
export default class ListMenuView extends React.Component {
static propTypes = {
onPress: React.PropTypes.func,
item: React.PropTypes.object.isRequired,
};
constructor(props) {
super(props);
this.onPress = this.onPress.bind(this);
}
onPress() {
this.props.onPress(this.props.item);
}
render() {
const { item } = this.props;
const price = item.price ? (
<Overlay style={{ backgroundColor: 'white' }}>
<Subtitle styleName="sm-gutter-horizontal">{item.price}</Subtitle>
</Overlay>) : null;
return (
<TouchableOpacity key={item.id} onPress={this.onPress}>
<Image
styleName="large-banner placeholder"
source={{ uri: item.image ? item.image.url : undefined }}
>
<Tile>
<Title styleName="md-gutter-bottom">{item.name.toUpperCase()}</Title>
{price}
</Tile>
</Image>
<Divider styleName="line" />
</TouchableOpacity>
);
}
}
|
/**
* @file shouldUpdate
* @desc use 'onComponentShouldUpdate' lifecycle hook to determine if component should update or not
* @author Roman Zanettin <roman.zanettin@ringieraxelspringer.ch>
* @date 2017-01-06
*/
import withLifecycle from './withLifecycle';
/**
* @param {Function} - onComponentShouldUpdate - should update check function returning a boolean value
* @param {Function} - component
* @param {Object} - component props
* @returns {Function}
*/
export default (function (onComponentShouldUpdate) {
return function (component) {
return function (props) {
return withLifecycle({ onComponentShouldUpdate: onComponentShouldUpdate })(component)(props);
};
};
});
|
import React from 'react'
import PropTypes from 'prop-types'
import Episode from '../Episode/Episode'
import './EpisodeList.styl'
const EpisodeList = ({
episodes,
setPlayingEpisode,
currentlyPlaying,
pauseCurrentEpisode,
}) => (
<div className="EpisodeList">
{episodes.map(episode => {
const data = {
...episode,
isPlaying: episode.guid === currentlyPlaying,
}
return (
<Episode
playEpisode={setPlayingEpisode}
pauseEpisode={pauseCurrentEpisode}
episode={data}
key={episode.guid}
/>
)
})}
</div>
)
EpisodeList.propTypes = {
episodes: PropTypes.arrayOf(
PropTypes.shape({
title: PropTypes.string,
description: PropTypes.string,
}),
).isRequired,
setPlayingEpisode: PropTypes.func.isRequired,
currentlyPlaying: PropTypes.string,
pauseCurrentEpisode: PropTypes.func.isRequired,
}
EpisodeList.defaultProps = {
currentlyPlaying: null,
}
export default EpisodeList
|
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var _default = (0, _createSvgIcon.default)(_react.default.createElement("path", {
d: "M2 6H0v16h20v-2H2V6zm22-2H14l-2-2H4v16h20V4zM7 15l4.5-6 3.5 4.51 2.5-3.01L21 15H7z"
}), 'PermMediaSharp');
exports.default = _default;
|
const db = require('../db/db.js');
const q = require('../db/queries.js');
const shoutoutController = {};
/**
* getShoutouts - retrieve all shoutouts from the database and store them into res.locals
* before moving on to next middleware.
*/
shoutoutController.getShoutouts = async (req, res, next) => {
const shoutouts = await db.query(q.getShoutouts).catch((err) => console.error(err));
res.locals.shoutouts = shoutouts.rows;
return next();
};
/**
* createShoutout - create and save a new shoutout into the database.
*/
shoutoutController.postShoutout = (req, res, next) => {
const { contents, sender_id, recipient_id, timestamp } = req.body.shoutout;
const valueObj = { contents, sender_id, recipient_id, timestamp };
const value = Object.values(valueObj);
db.query(q.postShoutout, value, (err, result) => {
if (err) return next(err);
return next();
});
};
module.exports = shoutoutController;
|
'use strict';
// exports
module.exports = {
name: 'notifications',
schema: {
id: {
allowNull: false,
primaryKey: true,
type: 'Sequelize.TEXT'
},
app_id: {
allowNull: false,
type: 'Sequelize.TEXT'
},
title: {
allowNull: false,
type: 'Sequelize.TEXT'
},
type: {
allowNull: false,
type: 'Sequelize.TEXT'
},
params_json: {
allowNull: false,
type: 'Sequelize.JSON'
}
},
indexes: [{
name: 'notification_idx_app_id',
fields: ['app_id']
},
{
name: 'notification_idx_type',
fields: ['type']
}],
constraints: []
};
|
import Vue from 'vue';
import App from './app';
import VueAirloy from 'vue-airloy/src';
import AirloyWeb from 'airloy-web/src';
import config from './config.json';
VueAirloy.configure(config.airloy);
VueAirloy.use(AirloyWeb);
Vue.use(VueAirloy);
new Vue({ // eslint-disable-line
el: '#app',
render: h => h(App)
});
|
function a(b){if(c)for(var d=1,e=b.f();;d++){}}
|
import React from "react"
import PropTypes from "prop-types"
export default class HTML extends React.Component {
render() {
return (
<html {...this.props.htmlAttributes}>
<head>
<meta charSet="utf-8" />
<meta httpEquiv="x-ua-compatible" content="ie=edge" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"/>
{this.props.headComponents}
</head>
<body {...this.props.bodyAttributes}>
{this.props.preBodyComponents}
<div
key={`body`}
id="___gatsby"
dangerouslySetInnerHTML={{ __html: this.props.body }}
/>
{this.props.postBodyComponents}
</body>
</html>
)
}
}
HTML.propTypes = {
htmlAttributes: PropTypes.object,
headComponents: PropTypes.array,
bodyAttributes: PropTypes.object,
preBodyComponents: PropTypes.array,
body: PropTypes.string,
postBodyComponents: PropTypes.array,
}
|
angular.module('demoApp')
.controller('rxRadioCtrl', function ($scope) {
$scope.validEnabled = 1;
$scope.validDisabled = 1;
$scope.validNgDisabled = 1;
$scope.invalidEnabled = 1;
$scope.invalidDisabled = 1;
$scope.invalidNgDisabled = 1;
$scope.radCreateDestroy = 'destroyed';
$scope.plainHtmlRadio = 'isChecked';
});
|
import React from 'react';
import PropTypes from 'prop-types';
const UilCar = (props) => {
const { color, size, ...otherProps } = props
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
height: size,
viewBox: '0 0 24 24',
fill: color,
...otherProps
}, React.createElement('path', {
d: 'M6.62,13.08a.9.9,0,0,0-.54.54,1,1,0,0,0,1.3,1.3,1.15,1.15,0,0,0,.33-.21,1.15,1.15,0,0,0,.21-.33A.84.84,0,0,0,8,14a1.05,1.05,0,0,0-.29-.71A1,1,0,0,0,6.62,13.08Zm13.14-4L18.4,5.05a3,3,0,0,0-2.84-2H8.44A3,3,0,0,0,5.6,5.05L4.24,9.11A3,3,0,0,0,2,12v4a3,3,0,0,0,2,2.82V20a1,1,0,0,0,2,0V19H18v1a1,1,0,0,0,2,0V18.82A3,3,0,0,0,22,16V12A3,3,0,0,0,19.76,9.11ZM7.49,5.68A1,1,0,0,1,8.44,5h7.12a1,1,0,0,1,1,.68L17.61,9H6.39ZM20,16a1,1,0,0,1-1,1H5a1,1,0,0,1-1-1V12a1,1,0,0,1,1-1H19a1,1,0,0,1,1,1Zm-3.38-2.92a.9.9,0,0,0-.54.54,1,1,0,0,0,1.3,1.3.9.9,0,0,0,.54-.54A.84.84,0,0,0,18,14a1.05,1.05,0,0,0-.29-.71A1,1,0,0,0,16.62,13.08ZM13,13H11a1,1,0,0,0,0,2h2a1,1,0,0,0,0-2Z'
}));
};
UilCar.propTypes = {
color: PropTypes.string,
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};
UilCar.defaultProps = {
color: 'currentColor',
size: '24',
};
export default UilCar;
|
import { Mongo } from 'meteor/mongo';
import { Random } from 'meteor/random';
import { getRedisPusher } from '../redis/getRedisClient';
import { EJSON } from 'meteor/ejson';
import getFields from '../utils/getFields';
import { Events, RedisPipe } from '../constants';
import containsOperators from '../mongo/lib/containsOperators';
/**
* call(Mongo.Collection).insert(data)
* @param channelOrCollection {Mongo.Collection|string}
*/
export default class SyntheticMutator {
/**
* @param channels
* @param data
*/
static publish(channels, data) {
const client = getRedisPusher();
channels.forEach(channel => {
client.publish(channel, EJSON.stringify(data));
});
}
/**
* @param channels
* @param data
*/
static insert(channels, data) {
channels = SyntheticMutator._extractChannels(channels, data._id);
if (!data._id) {
data._id = Random.id();
}
SyntheticMutator.publish(channels, {
[RedisPipe.EVENT]: Events.INSERT,
[RedisPipe.SYNTHETIC]: true,
[RedisPipe.DOC]: data,
});
}
/**
* @param channels
* @param _id
* @param modifier
*/
static update(channels, _id, modifier) {
channels = SyntheticMutator._extractChannels(channels, _id);
if (!containsOperators(modifier)) {
throw new Meteor.Error(
'Synthetic update can only be done through MongoDB operators.'
);
}
const { topLevelFields } = getFields(modifier);
let message = {
[RedisPipe.EVENT]: Events.UPDATE,
[RedisPipe.SYNTHETIC]: true,
[RedisPipe.DOC]: { _id },
[RedisPipe.MODIFIER]: modifier,
[RedisPipe.MODIFIED_TOP_LEVEL_FIELDS]: topLevelFields,
};
SyntheticMutator.publish(channels, message);
}
/**
* @param channels
* @param _id
*/
static remove(channels, _id) {
channels = SyntheticMutator._extractChannels(channels, _id);
SyntheticMutator.publish(channels, {
[RedisPipe.EVENT]: Events.REMOVE,
[RedisPipe.SYNTHETIC]: true,
[RedisPipe.DOC]: { _id },
});
}
/**
* @param channels
* @param _id
* @returns {*}
* @private
*/
static _extractChannels(channels, _id) {
if (!_.isArray(channels)) {
if (channels instanceof Mongo.Collection) {
const name = channels._name;
channels = [name];
if (_id) {
channels.push(`${name}::${_id}`);
}
} else {
channels = [channels];
}
}
return channels;
}
}
|
describe ("Basic Chart Tests", function () {
var db;
beforeEach(function () {
$("#dbTarget").empty().removeClass("");
$("#dbTarget").css({
width: 1000
});
});
var chart_timeout = 400;
afterEach(function() {
db.pro.dispose();
$(".rfTooltip").remove();
});
var createChart = function (seriesA, seriesB, yAxis, yAxisName) {
seriesA = seriesA ? seriesA : {};
seriesB = seriesB ? seriesB : {};
yAxisName = yAxisName ? yAxisName : "";
yAxis = yAxis ? yAxis : {};
var chart = new ChartComponent();
chart.setDimensions (4, 4);
chart.setYAxis(yAxisName, yAxis)
chart.setCaption("2011 Sales");
chart.setLabels (["Beverages", "Vegetables"])
chart.addSeries ("sales", "Sales", [1343, 7741], seriesA);
chart.addSeries ("quantity", "Quantity", [300, 800], seriesB);
return chart;
}
it("Should display labels on X Axis", function (done) {
db = new Dashboard ();
var chart = createChart();
db.addComponent(chart);
db.embedTo("dbTarget");
var th = new TestHelper ();
th.start(done)
.wait(chart_timeout)
.setContext(chart.pro.renderer.$core.parent())
.drillContext(".rc-axis:eq(0)")
.assertText("text:eq(0)", "Beverages")
.svgMeasure("text:eq(0)", "y", t3.approximate(14, 1))
.assertText("text:eq(1)", "Vegetables")
.finish();
});
it("Should display items on Y Axis", function (done) {
db = new Dashboard ();
var chart = createChart();
db.addComponent(chart);
db.embedTo("dbTarget");
var th = new TestHelper ();
th.start(done)
.wait(chart_timeout)
.setContext(chart.pro.renderer.$core.parent())
.drillContext(".rc-axis:eq(1)")
.assertText("text:eq(0)", "0")
.svgMeasure("text:eq(0)", "y", t3.approximate(0, 0.1))
.assertText("text:eq(1)", "1,600")
.finish();
});
it("Should format numbers on Y Axis", function (done) {
db = new Dashboard ();
var chart = createChart({}, {}, {
numberPrefix: "$"
});
db.addComponent(chart);
db.embedTo("dbTarget");
t3.start(done)
.wait(chart_timeout)
.setContext(chart.pro.renderer.$core.parent())
.drillContext(".rc-axis:eq(1)")
.assertText("text:eq(1)", "$1,600")
.finish();
});
it("Should display rectangles for columns", function (done) {
db = new Dashboard ();
var chart = createChart();
db.addComponent(chart);
db.embedTo("dbTarget");
t3.start(done)
.wait(chart_timeout)
.setContext(chart.pro.renderer.$core.parent())
.drillContext("g.rc-series-1")
.count('rect', 2, {op: '=`'})
.svgMeasure("rect:eq(0)", "width", t3.approximate(36, 2))
.svgMeasure("rect:eq(0)", "height", t3.approximate(33, 1))
.svgMeasure("rect:eq(1)", "height", t3.approximate(191, 2))
.svgMeasure("rect:eq(1)", "width", t3.approximate(36, 2))
.finish();
});
it("Should display a valid tooltip when there's a mouseover event", function (done) {
db = new Dashboard ();
var chart = createChart({}, {}, {
numberPrefix: "$"
});
db.addComponent(chart);
db.embedTo("dbTarget");
t3.start(done)
.wait(chart_timeout)
.setContext(chart.pro.renderer.$core.parent())
.svgTriggerEvent("rect:eq(0)", "mouseover")
.wait(200)
.enterTempContext($(".rfTooltip:eq(0)"))
.assertText(".rfTooltipLabel", "Sales", {trim: true})
.assertText(".rfTooltipValue", "$1,343")
.assertText(".rfTooltipMainLabel", "Beverages")
.assertCSS(".", "left", t3.approximate(67, 3))
.assertCSS(".", "top", t3.approximate(205, 2))
.exitTempContext()
.svgTriggerEvent("rect:eq(0)", "mouseout")
.wait(200)
.svgTriggerEvent("rect:eq(1)", "mouseover")
.wait(200)
.enterTempContext($(".rfTooltip:eq(0)"))
.assertText(".rfTooltipLabel", "Sales", {trim: true})
.assertText(".rfTooltipValue", "$7,741")
.assertText(".rfTooltipMainLabel", "Vegetables")
.assertCSS(".", "left", t3.approximate(186, 2))
.assertCSS(".", "top", t3.approximate(47, 2))
.exitTempContext()
.svgTriggerEvent("rect:eq(1)", "mouseout")
.finish();
});
it("Should hide/show a series after clicking legend", function (done) {
db = new Dashboard ();
var chart = createChart({}, {}, {
numberPrefix: "$"
});
db.addComponent(chart);
db.embedTo("dbTarget");
t3.start(done)
.wait(chart_timeout)
.setContext(chart.pro.renderer.$core)
.click('.rfLegendKey:eq(0)')
.wait(200)
.setContext (function () {
return chart.pro.renderer.$core;
})
.assertClass('.rfLegendKey:eq(0)', "disabled")
.assert(function (contextDiv, success, fail) {
if(contextDiv.find(".rc-column-chart").children().length !== 1) {
fail("Expected column chart container to have just 1 child. It doesn't.");
}
success ();
})
.click('.rfLegendKey:eq(0)')
.wait(200)
.setContext (function () {
return chart.pro.renderer.$core;
})
.assert(function (contextDiv, success, fail) {
if(contextDiv.find(".rc-column-chart").children().length !== 2) {
fail("Expected column chart container to have just 2 children. It doesn't.");
}
success ();
})
.finish();
});
it("Should respect series colors everywhere", function (done) {
db = new Dashboard ();
var chart = createChart({
seriesColor: "a4c9f3"
}, { seriesColor: "#ff0000"}, {
});
db.addComponent(chart);
db.embedTo("dbTarget");
t3.start(done)
.wait(chart_timeout)
.setContext(chart.pro.renderer.$core.parent())
.enterTempContext("g.rc-series-1")
.assertAttrs("rect:eq(0)", "fill", "#a4c9f3")
.exitTempContext("g.rc-series-1")
.enterTempContext("g.rc-series-2")
.assertAttrs("rect:eq(0)", "fill", "#ff0000")
.exitTempContext("g.rc-series-2")
.assertCSS(".rfLegendKey:eq(0) > .legendColor", "background-color", "rgb(164, 201, 243)")
.assertCSS(".rfLegendKey:eq(1) > .legendColor", "background-color", "rgb(255, 0, 0)")
.svgTriggerEvent("rect:eq(1)", "mouseover")
.wait(200)
.enterTempContext($(".rfTooltip:eq(0)"))
.assertCSS(".rfTooltipLabel", "color", "rgb(164, 201, 243)")
.exitTempContext(".rfTooltip:eq(0)")
.svgTriggerEvent("rect:eq(0)", "mouseout")
.svgTriggerEvent("rect:eq(2)", "mouseover")
.wait(200)
.enterTempContext($(".rfTooltip:eq(0)"))
.assertCSS(".rfTooltipLabel", "color", "rgb(255, 0, 0)")
.exitTempContext(".rfTooltip:eq(0)")
.svgTriggerEvent("rect:eq(2)", "mouseout")
.finish();
});
});
|
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let NavigationMoreVert = (props) => (
<SvgIcon {...props}>
<path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>
</SvgIcon>
);
NavigationMoreVert = pure(NavigationMoreVert);
NavigationMoreVert.displayName = 'NavigationMoreVert';
NavigationMoreVert.muiName = 'SvgIcon';
export default NavigationMoreVert;
|
import React from 'react';
const VideoDetail = ({video}) => {
if(!video){
return <div>Loading...</div>;
}
const videoId = video.id.videoId;
const url = `https://www.youtube.com/embed/${videoId}`;
return (
<div className="video-detail col-md-8">
<div className="embed-responsive embed-responsive-16by9">
<iframe className="embed-responsive-item" src={url}></iframe>
</div>
<div className="details">
<div>{video.snippet.title}</div>
<div>{video.snippet.description}</div>
</div>
</div>
);
};
export default VideoDetail;
|
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import Gridicon from 'gridicons';
import { registerBlockType } from '@wordpress/blocks';
import { RawHTML } from '@wordpress/element';
/**
* Internal dependencies
*/
import Block from './block';
import getShortcode from '../../utils/get-shortcode';
import sharedAttributes from '../../utils/shared-attributes';
registerBlockType( 'woocommerce/product-top-rated', {
title: __( 'Top Rated Products', 'woo-gutenberg-products-block' ),
icon: <Gridicon icon="trophy" />,
category: 'woocommerce',
keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
description: __(
'Display a grid of your top rated products.',
'woo-gutenberg-products-block'
),
supports: {
align: [ 'wide', 'full' ],
},
attributes: {
...sharedAttributes,
},
/**
* Renders and manages the block.
*/
edit( props ) {
return <Block { ...props } />;
},
/**
* Save the block content in the post content. Block content is saved as a products shortcode.
*
* @return string
*/
save( props ) {
const {
align,
} = props.attributes; /* eslint-disable-line react/prop-types */
return (
<RawHTML className={ align ? `align${ align }` : '' }>
{ getShortcode( props, 'woocommerce/product-top-rated' ) }
</RawHTML>
);
},
} );
|
import React from 'react';
import Layout from "../components/Layout"
const contact = () => {
return (
<Layout>Contacts!</Layout>
)
}
export default contact;
|
// postbuild script
// use shelljs for cross platform
/* eslint-disable import/no-extraneous-dependencies */
const shell = require('shelljs');
// copy corpora folder
shell.cp('-r', 'src/corpora/*.txt', 'build/corpora/');
shell.echo('postbuild successful');
|
import fs from "fs/promises";
import { shuffle } from "d3-array";
import Block from "./block.js";
import Twitter from "./twitter.js";
import { uniq } from "./util.js";
const twitter = new Twitter();
const hour = new Date().getHours();
const dark = hour >= 23 || hour < 10;
const background = "⬛";
const lightBackground = "⬜";
const newline = "\n";
const shapes = [
[
["🟦", null, null],
["🟦", "🟦", "🟦"],
],
[
["🟥", "🟥", "🟥"],
["🟥", null, null],
],
[
["🟨", "🟨"],
["🟨", "🟨"],
],
[["🟧", "🟧", "🟧", "🟧"]],
[
["🟪", "🟪", "🟪"],
[null, "🟪", null],
],
[
["🟩", "🟩", null],
[null, "🟩", "🟩"],
],
[
[null, "🟫", "🟫"],
["🟫", "🟫", null],
],
];
class Game {
constructor(width = 10, height = 18, interval = 500, paused = false) {
this.interval = interval;
this.paused = paused;
this.width = width;
this.height = height;
this.start();
}
start() {
this.blocks = [];
this.rows = new Array(this.height)
.fill(null)
.map((row) => new Array(this.width).fill(background));
this.addBlock();
}
addBlock() {
const shape = shuffle([...shapes])[0];
let block = new Block(shape);
const coords = block.translate();
const x = Math.floor(Math.random() * (this.width - coords[0].length));
block.position = [-1, x];
block.rotation = Math.floor(Math.random() * 4);
if (!this.checkCollision(block)) {
this.blocks.push(block);
} else {
this.start();
}
}
shouldFix(block) {
const rows = block.translate();
if (rows.flat(1).some(([y, x, cell]) => y >= this.height - 1)) {
return true;
}
return rows.some((row, rowPos) =>
row.some(
([y, x, cell], colPos) =>
cell &&
(rowPos + 1 >= rows.length || rows[rowPos + 1][colPos][2] == null) &&
this.withinBounds(y + 1, x) &&
this.rows[y + 1][x] != background
)
);
}
withinBounds(y, x) {
return y >= 0 && x >= 0 && y < this.height && x < this.width;
}
clearBlock(block) {
block
.translate()
.flat(1)
.filter(([y, x, cell]) => this.withinBounds(y, x) && cell)
.forEach(([y, x, cell]) => (this.rows[y][x] = background));
}
drawBlock(block) {
block
.translate()
.flat(1)
.filter(([y, x, cell]) => this.withinBounds(y, x) && cell)
.forEach(([y, x, cell]) => (this.rows[y][x] = cell));
}
checkCollision(block, y, x) {
const rows = block.translate();
return rows.some((row, rowPos) =>
row
.filter(
(cell, colPos) =>
cell[2] &&
this.withinBounds(cell[0] + y, cell[1] + x) &&
(rowPos + y >= rows.length ||
rowPos + y < 0 ||
colPos + x >= rows[0].length ||
colPos + x < 0 ||
rows[rowPos + y][colPos + x][2] == null)
)
.some((cell) => this.rows[cell[0] + y][cell[1] + x] != background)
);
}
move(block, y = 0, x = 0) {
if (!this.checkCollision(block, y, x)) {
this.clearBlock(block);
if (!block.fixed) {
block.position[0] += y;
}
block.position[1] += x;
this.drawBlock(block);
}
}
rowsToClear(block) {
return uniq(
block
.translate()
.flat(1)
.map(([y]) => y)
)
.filter((y) => y > 0 && y < this.height)
.filter((y) => this.rows[y].every((cell) => cell != background));
}
clearRows(rows) {
for (const row of rows) {
for (let cur = row, above = row - 1; above >= 0; cur--, above--) {
for (let i = 0; i < this.width; i++) {
this.rows[cur][i] = this.rows[above][i];
}
}
}
}
async update() {
for (const block of this.blocks) {
if (!block.fixed) {
if (this.shouldFix(block)) {
block.fixed = true;
}
this.move(block, 1);
try {
const replies = await twitter.getReplies(
(
await twitter.getLastTweet()
).id
);
const left = replies.filter(
(tweet) =>
tweet.text.toLowerCase().includes("left") ||
tweet.text.includes("⬅️") ||
tweet.text.includes("◀️")
).length;
const right = replies.filter(
(tweet) =>
tweet.text.toLowerCase().includes("right") ||
tweet.text.includes("➡️")
).length;
const spin = replies.filter(
(tweet) =>
tweet.text.toLowerCase().includes("spin") ||
tweet.text.toLowerCase().includes("tilt") ||
tweet.text.toLowerCase().includes("turn") ||
tweet.text.toLowerCase().includes("flip") ||
tweet.text.includes("⤴️") ||
tweet.text.includes("↩️")
).length;
const down = replies.filter(
(tweet) =>
tweet.text.toLowerCase().includes("down") ||
tweet.text.toLowerCase().includes("drop") ||
tweet.text.includes("⬇️")
).length;
if (spin > 0 && spin > left && spin > right && spin > down) {
console.log("spin left");
this.tiltLeft();
} else if (left > 0 && left > right && left > down) {
console.log("go left");
this.left();
} else if (right > 0 && right > down) {
console.log("go right");
this.right();
}
else if (down > 0) {
console.log("go down");
this.down();
}
} catch (e) {
console.log(e);
}
if (block.fixed) {
if (block.position[0] <= 0) {
this.start();
return;
}
this.clearRows(this.rowsToClear(block));
}
}
}
if (this.blocks.map((block) => block.fixed).every((fixed) => fixed)) {
this.addBlock();
}
}
left() {
let block = this.blocks[this.blocks.length - 1];
if (block.position[1] > 0) {
this.move(block, 0, -1);
}
}
right() {
let block = this.blocks[this.blocks.length - 1];
if (
Math.max(
...block
.translate()
.flat(1)
.map(([_, x]) => x)
) <
this.width - 1
) {
this.move(block, 0, 1);
}
}
down() {
let block = this.blocks[this.blocks.length - 1];
const rows = block.translate();
for (let y = block.position[0] + rows.length; y <= this.height - 1; y++) {
this.move(block, 1);
}
}
tiltLeft() {
for (const block of this.blocks) {
if (!block.fixed) {
this.clearBlock(block);
block.rotation++;
const rows = block.translate();
if (block.position[0] + rows.length >= this.height) {
block.position[0] = this.height - rows.length;
}
if (block.position[1] + rows[0].length >= this.width) {
block.position[1] = this.width - rows[0].length;
}
this.drawBlock(block);
}
}
}
tiltRight() {
for (const block of this.blocks) {
if (!block.fixed) {
this.clearBlock(block);
block.rotation--;
const rows = block.translate();
if (block.position[0] + rows.length >= this.height) {
block.position[0] = this.height - rows.length;
}
if (block.position[1] + rows[0].length >= this.width) {
block.position[1] = this.width - rows[0].length;
}
console.log(block.rotation);
this.drawBlock(block);
}
}
}
wait() {
return new Promise((accept) =>
setTimeout(() => requestAnimationFrame(accept), this.interval)
);
}
draw() {
return this.rows
.map((row) => row.join(""))
.join(newline)
.replaceAll(background, dark ? background : lightBackground);
}
async *show() {
while (!this.paused) {
this.update();
yield html`<center>${this.draw()}</center>`;
await this.wait();
}
}
toJSON() {
return {
blocks: this.blocks.map((block) => block.toJSON()),
rows: this.rows,
};
}
static fromJSON(json) {
const game = new Game(json.rows[0].length, json.rows.length);
game.blocks = json.blocks.map((block) => Block.fromJSON(block));
game.rows = json.rows;
return game;
}
static async readFile(file) {
const json = await fs.readFile(file, "utf8");
const data = JSON.parse(json);
return Game.fromJSON(data);
}
async writeFile(file) {
await fs.writeFile(file, JSON.stringify(this, null, 2));
}
}
export default Game;
|
/**
* Copyright 2016 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Services} from '../../../src/services';
import {SignatureVerifier, VerificationStatus} from './signature-verifier';
import {
is3pThrottled,
getAmpAdRenderOutsideViewport,
incrementLoadingAds,
} from '../../amp-ad/0.1/concurrent-load';
import {createElementWithAttributes} from '../../../src/dom';
import {cancellation, isCancellation} from '../../../src/error';
import {
installFriendlyIframeEmbed,
setFriendlyIframeEmbedVisible,
} from '../../../src/friendly-iframe-embed';
import {isLayoutSizeDefined, Layout} from '../../../src/layout';
import {isAdPositionAllowed} from '../../../src/ad-helper';
import {dev, user, duplicateErrorIfNecessary} from '../../../src/log';
import {dict} from '../../../src/utils/object';
import {getMode} from '../../../src/mode';
import {isArray, isObject, isEnumValue} from '../../../src/types';
import {utf8Decode} from '../../../src/utils/bytes';
import {getBinaryType, isExperimentOn} from '../../../src/experiments';
import {setStyle} from '../../../src/style';
import {
assertHttpsUrl,
isSecureUrl,
tryDecodeUriComponent,
} from '../../../src/url';
import {parseJson} from '../../../src/json';
import {handleClick} from '../../../ads/alp/handler';
import {
getDefaultBootstrapBaseUrl,
generateSentinel,
} from '../../../src/3p-frame';
import {
installUrlReplacementsForEmbed,
} from '../../../src/service/url-replacements-impl';
import {A4AVariableSource} from './a4a-variable-source';
// TODO(tdrl): Temporary. Remove when we migrate to using amp-analytics.
import {getTimingDataAsync} from '../../../src/service/variable-source';
import {getContextMetadata} from '../../../src/iframe-attributes';
import {getBinaryTypeNumericalCode} from '../../../ads/google/a4a/utils';
import {signingServerURLs} from '../../../ads/_a4a-config';
import {triggerAnalyticsEvent} from '../../../src/analytics';
import {insertAnalyticsElement} from '../../../src/extension-analytics';
/** @type {Array<string>} */
const METADATA_STRINGS = [
'<script amp-ad-metadata type=application/json>',
'<script type="application/json" amp-ad-metadata>',
'<script type=application/json amp-ad-metadata>'];
// TODO(tdrl): Temporary, while we're verifying whether SafeFrame is an
// acceptable solution to the 'Safari on iOS doesn't fetch iframe src from
// cache' issue. See https://github.com/ampproject/amphtml/issues/5614
/** @type {string} */
export const DEFAULT_SAFEFRAME_VERSION = '1-0-15';
/** @const {string} */
export const CREATIVE_SIZE_HEADER = 'X-CreativeSize';
/** @type {string} @visibleForTesting */
export const RENDERING_TYPE_HEADER = 'X-AmpAdRender';
/** @type {string} @visibleForTesting */
export const SAFEFRAME_VERSION_HEADER = 'X-AmpSafeFrameVersion';
/** @type {string} @visibleForTesting */
export const EXPERIMENT_FEATURE_HEADER_NAME = 'amp-ff-exps';
/** @type {string} */
const TAG = 'amp-a4a';
/** @type {string} */
export const NO_CONTENT_RESPONSE = 'NO-CONTENT-RESPONSE';
/** @enum {string} */
export const XORIGIN_MODE = {
CLIENT_CACHE: 'client_cache',
SAFEFRAME: 'safeframe',
NAMEFRAME: 'nameframe',
};
/** @type {!Object} @private */
const SHARED_IFRAME_PROPERTIES = dict({
'frameborder': '0',
'allowfullscreen': '',
'allowtransparency': '',
'scrolling': 'no',
'marginwidth': '0',
'marginheight': '0',
});
/** @typedef {{width: number, height: number}} */
export let SizeInfoDef;
/** @typedef {{
minifiedCreative: string,
customElementExtensions: !Array<string>,
customStylesheets: !Array<{href: string}>,
images: (Array<string>|undefined),
}} */
export let CreativeMetaDataDef;
/** @private */
export const LIFECYCLE_STAGES = {
// Note: Use strings as values here, rather than numbers, so that "0" does
// not test as `false` later.
adSlotCleared: '-1',
urlBuilt: '1',
adRequestStart: '2',
adRequestEnd: '3',
adResponseValidateStart: '5',
renderFriendlyStart: '6', // TODO(dvoytenko): this signal and similar are actually "embed-create", not "render-start".
renderCrossDomainStart: '7',
renderFriendlyEnd: '8',
renderCrossDomainEnd: '9',
preAdThrottle: '10',
renderSafeFrameStart: '11',
throttled3p: '12',
adResponseValidateEnd: '13',
xDomIframeLoaded: '14',
friendlyIframeLoaded: '15',
adSlotCollapsed: '16',
adSlotUnhidden: '17',
layoutAdPromiseDelay: '18',
signatureVerifySuccess: '19',
networkError: '20',
friendlyIframeIniLoad: '21',
visHalf: '22',
visHalfIniLoad: '23',
firstVisible: '24',
visLoadAndOneSec: '25',
iniLoad: '26',
resumeCallback: '27',
visIniLoad: '29',
upgradeDelay: '30',
// TODO(warrengm): This should replace xDomIframeLoaded once delayed fetch
// is fully deprecated. A new lifecycle stage, crossDomainIframeLoaded, was
// introduced since xDomIframeLoaded is handled in AmpAdXOriginIframeHandler
// outside A4A.
crossDomainIframeLoaded: '31',
};
/**
* Name of A4A lifecycle triggers.
* @enum {string}
*/
export const AnalyticsTrigger = {
AD_REQUEST_START: 'ad-request-start',
AD_RESPONSE_END: 'ad-response-end',
AD_RENDER_START: 'ad-render-start',
AD_RENDER_END: 'ad-render-end',
AD_IFRAME_LOADED: 'ad-iframe-loaded',
};
/**
* Maps the names of lifecycle events to analytics triggers.
* @const {!Object<string, !AnalyticsTrigger>}
*/
const LIFECYCLE_STAGE_TO_ANALYTICS_TRIGGER = {
'adRequestStart': AnalyticsTrigger.AD_REQUEST_START,
'adRequestEnd': AnalyticsTrigger.AD_RESPONSE_END,
'renderFriendlyStart': AnalyticsTrigger.AD_RENDER_START,
'renderCrossDomainStart': AnalyticsTrigger.AD_RENDER_START,
'renderSafeFrameStart': AnalyticsTrigger.AD_RENDER_START,
'renderFriendlyEnd': AnalyticsTrigger.AD_RENDER_END,
'renderCrossDomainEnd': AnalyticsTrigger.AD_RENDER_END,
'friendlyIframeIniLoad': AnalyticsTrigger.AD_IFRAME_LOADED,
'crossDomainIframeLoaded': AnalyticsTrigger.AD_IFRAME_LOADED,
};
/**
* Utility function that ensures any error thrown is handled by optional
* onError handler (if none provided or handler throws, error is swallowed and
* undefined is returned).
* @param {!Function} fn to protect
* @param {T=} inThis An optional object to use as the 'this' object
* when calling the function. If not provided, undefined is bound as this
* when calling function.
* @param {function(this:T, !Error, ...*):?=} onError function given error
* and arguments provided to function call.
* @return {!Function} protected function
* @template T
* @visibleForTesting
*/
export function protectFunctionWrapper(
fn, inThis = undefined, onError = undefined) {
return (...fnArgs) => {
try {
return fn.apply(inThis, fnArgs);
} catch (err) {
if (onError) {
try {
// Ideally we could use [err, ...var_args] but linter disallows
// spread so instead using unshift :(
fnArgs.unshift(err);
return onError.apply(inThis, fnArgs);
} catch (captureErr) {
// swallow error if error handler throws.
}
}
// In the event of no optional on error function or its execution throws,
// return undefined.
return undefined;
}
};
};
export class AmpA4A extends AMP.BaseElement {
// TODO: Add more error handling throughout code.
// TODO: Handle creatives that do not fill.
/**
* @param {!Element} element
*/
constructor(element) {
super(element);
dev().assert(AMP.AmpAdUIHandler);
dev().assert(AMP.AmpAdXOriginIframeHandler);
/** @private {?Promise<undefined>} */
this.keysetPromise_ = null;
/** @private {?Promise<?CreativeMetaDataDef>} */
this.adPromise_ = null;
/**
* @private {number} unique ID of the currently executing promise to allow
* for cancellation.
*/
this.promiseId_ = 0;
/** @private {?string} */
this.adUrl_ = null;
/** @private {?../../../src/friendly-iframe-embed.FriendlyIframeEmbed} */
this.friendlyIframeEmbed_ = null;
/** {?AMP.AmpAdUIHandler} */
this.uiHandler = null;
/** @private {?AMP.AmpAdXOriginIframeHandler} */
this.xOriginIframeHandler_ = null;
/** @private {boolean} whether creative has been verified as AMP */
this.isVerifiedAmpCreative_ = false;
/** @private {?ArrayBuffer} */
this.creativeBody_ = null;
/**
* Initialize this with the slot width/height attributes, and override
* later with what the network implementation returns via extractSize.
* Note: Either value may be 'auto' (i.e., non-numeric).
*
* @private {?({width, height}|../../../src/layout-rect.LayoutRectDef)}
*/
this.creativeSize_ = null;
/** @private {?../../../src/layout-rect.LayoutRectDef} */
this.originalSlotSize_ = null;
/**
* Note(keithwrightbos) - ensure the default here is null so that ios
* uses safeframe when response header is not specified.
* @private {?XORIGIN_MODE}
*/
this.experimentalNonAmpCreativeRenderMethod_ =
this.getNonAmpCreativeRenderingMethod();
/**
* Gets a notion of current time, in ms. The value is not necessarily
* absolute, so should be used only for computing deltas. When available,
* the performance system will be used; otherwise Date.now() will be
* returned.
*
* @const {function():number}
*/
this.getNow_ = (this.win.performance && this.win.performance.now) ?
this.win.performance.now.bind(this.win.performance) : Date.now;
/**
* Protected version of emitLifecycleEvent that ensures error does not
* cause promise chain to reject.
* @private {function(string, !Object=)}
*/
this.protectedEmitLifecycleEvent_ = protectFunctionWrapper(
this.emitLifecycleEvent, this,
(err, varArgs) => {
dev().error(TAG, this.element.getAttribute('type'),
'Error on emitLifecycleEvent', err, varArgs) ;
});
/** @const {string} */
this.sentinel = generateSentinel(window);
/**
* Used to indicate whether this slot should be collapsed or not. Marked
* true if the ad response has status 204, is null, or has a null
* arrayBuffer.
* @private {boolean}
*/
this.isCollapsed_ = false;
/**
* Frame in which the creative renders (friendly if validated AMP, xdomain
* otherwise).
* {?HTMLIframeElement}
*/
this.iframe = null;
/**
* TODO(keithwrightbos) - remove once resume behavior is verified.
* {boolean} whether most recent ad request was generated as part
* of resume callback.
*/
this.fromResumeCallback = false;
/** @protected {string} */
this.safeframeVersion = DEFAULT_SAFEFRAME_VERSION;
/**
* @protected {boolean} Indicates whether the ad is currently in the
* process of being refreshed.
*/
this.isRefreshing = false;
/** @protected {boolean} */
this.isRelayoutNeededFlag = false;
/**
* Used as a signal in some of the CSI pings.
* @private @const {string}
*/
this.releaseType_ = getBinaryTypeNumericalCode(getBinaryType(this.win)) ||
'-1';
/**
* Mapping of feature name to value extracted from ad response header
* amp-ff-exps with comma separated pairs of '=' separated key/value.
* @type {!Object<string,string>}
*/
this.postAdResponseExperimentFeatures = {};
/**
* The configuration for amp-analytics. If null, no amp-analytics element
* will be inserted and no analytics events will be fired.
* This will be initialized inside of buildCallback.
* @private {?JsonObject}
*/
this.a4aAnalyticsConfig_ = null;
/**
* The amp-analytics element that for this impl's analytics config. It will
* be null before buildCallback() executes or if the impl does not provide
* an analytice config.
* @private {?Element}
*/
this.a4aAnalyticsElement_ = null;
}
/** @override */
getPriority() {
// Priority used for scheduling preload and layout callback. Because
// AMP creatives will be injected as part of the promise chain created
// within onLayoutMeasure, this is only relevant to non-AMP creatives
// therefore we want this to match the 3p priority.
const isPWA = !this.element.getAmpDoc().isSingleDoc();
// give the ad higher priority if it is inside a PWA
return isPWA ? 1 : 2;
}
/** @override */
isLayoutSupported(layout) {
return isLayoutSizeDefined(layout);
}
/** @override */
isRelayoutNeeded() {
return this.isRelayoutNeededFlag;
}
/** @override */
buildCallback() {
this.creativeSize_ = {
width: this.element.getAttribute('width'),
height: this.element.getAttribute('height'),
};
const upgradeDelayMs = Math.round(this.getResource().getUpgradeDelayMs());
dev().info(TAG,
`upgradeDelay ${this.element.getAttribute('type')}: ${upgradeDelayMs}`);
this.handleLifecycleStage_('upgradeDelay', {
'forced_delta': upgradeDelayMs,
});
this.uiHandler = new AMP.AmpAdUIHandler(this);
const verifier = signatureVerifierFor(this.win);
this.keysetPromise_ =
Services.viewerForDoc(this.getAmpDoc()).whenFirstVisible().then(() => {
this.getSigningServiceNames().forEach(signingServiceName => {
verifier.loadKeyset(signingServiceName);
});
});
this.a4aAnalyticsConfig_ = this.getA4aAnalyticsConfig();
if (this.a4aAnalyticsConfig_) {
// TODO(warrengm): Consider having page-level singletons for networks that
// use the same config for all ads.
this.a4aAnalyticsElement_ = insertAnalyticsElement(
this.element, this.a4aAnalyticsConfig_, true /* loadAnalytics */);
}
}
/** @override */
renderOutsideViewport() {
// Ensure non-verified AMP creatives are throttled.
if (!this.isVerifiedAmpCreative_ && is3pThrottled(this.win)) {
this.handleLifecycleStage_('throttled3p');
return false;
}
// Otherwise the ad is good to go.
const elementCheck = getAmpAdRenderOutsideViewport(this.element);
return elementCheck !== null ?
elementCheck : super.renderOutsideViewport();
}
/**
* To be overridden by network specific implementation indicating if element
* (and environment generally) are valid for sending XHR queries.
* @return {boolean} whether element is valid and ad request should be
* sent. If false, no ad request is sent and slot will be collapsed if
* possible.
*/
isValidElement() {
return true;
}
/**
* @return {boolean} whether ad request should be delayed until
* renderOutsideViewport is met.
*/
delayAdRequestEnabled() {
return false;
}
/**
* Returns preconnect urls for A4A. Ad network should overwrite in their
* Fast Fetch implementation and return an array of urls for the runtime to
* preconnect to.
* @return {!Array<string>}
*/
getPreconnectUrls() {
return [];
}
/**
* Returns prefetch urls for A4A. Ad network should overwrite in their
* Fast Fetch implementation and return an array of urls for the runtime to
* prefetch.
* @return {!Array<string>}
*/
getPrefetchUrls() {
return [];
}
/**
* Returns true if this element was loaded from an amp-ad element. For use by
* network-specific implementations that don't want to allow themselves to be
* embedded directly into a page.
* @return {boolean}
*/
isAmpAdElement() {
return this.element.tagName == 'AMP-AD' ||
this.element.tagName == 'AMP-EMBED';
}
/**
* Prefetches and preconnects URLs related to the ad using adPreconnect
* registration which assumes ad request domain used for 3p is applicable.
* @param {boolean=} unusedOnLayout
* @override
*/
preconnectCallback(unusedOnLayout) {
this.preconnect.preload(this.getSafeframePath_());
this.preconnect.preload(getDefaultBootstrapBaseUrl(this.win, 'nameframe'));
const preconnect = this.getPreconnectUrls();
// NOTE(keithwrightbos): using onLayout to indicate if preconnect should be
// given preferential treatment. Currently this would be false when
// relevant (i.e. want to preconnect on or before onLayoutMeasure) which
// causes preconnect to delay for 1 sec (see custom-element#preconnect)
// therefore hard coding to true.
// NOTE(keithwrightbos): Does not take isValidElement into account so could
// preconnect unnecessarily, however it is assumed that isValidElement
// matches amp-ad loader predicate such that A4A impl does not load.
if (preconnect) {
preconnect.forEach(p => {
this.preconnect.url(p, true);
});
}
}
/** @override */
resumeCallback() {
// FIE that was not destroyed on unlayoutCallback does not require a new
// ad request.
if (this.friendlyIframeEmbed_) {
return;
}
this.handleLifecycleStage_('resumeCallback');
this.fromResumeCallback = true;
// If layout of page has not changed, onLayoutMeasure will not be called
// so do so explicitly.
const resource = this.getResource();
if (resource.hasBeenMeasured() && !resource.isMeasureRequested()) {
this.onLayoutMeasure();
}
}
/**
* @return {!../../../src/service/resource.Resource}
* @visibileForTesting
*/
getResource() {
return this.element.getResources().getResourceForElement(this.element);
}
/**
* @return {boolean} whether adPromise was initialized (indicator of
* element validity).
* @protected
*/
hasAdPromise() {
return !!this.adPromise_;
}
/**
* @return {boolean} whether environment/element should initialize ad request
* promise chain.
* @private
*/
shouldInitializePromiseChain_() {
const slotRect = this.getIntersectionElementLayoutBox();
if (this.getLayout() != Layout.FLUID &&
(slotRect.height == 0 || slotRect.width == 0)) {
dev().fine(
TAG, 'onLayoutMeasure canceled due height/width 0', this.element);
return false;
}
if (!isAdPositionAllowed(this.element, this.win)) {
user().warn(TAG, `<${this.element.tagName}> is not allowed to be ` +
`placed in elements with position:fixed: ${this.element}`);
return false;
}
// OnLayoutMeasure can be called when page is in prerender so delay until
// visible. Assume that it is ok to call isValidElement as it should
// only being looking at window, immutable properties (i.e. location) and
// its element ancestry.
if (!this.isValidElement()) {
// TODO(kjwright): collapse?
user().warn(TAG, this.element.getAttribute('type'),
'Amp ad element ignored as invalid', this.element);
return false;
}
return true;
}
/** @override */
onLayoutMeasure() {
this.initiateAdRequest();
}
/**
* This is the entry point into the ad promise chain.
*
* Calling this function will initiate the following sequence of events: ad
* url construction, ad request issuance, creative verification, and metadata
* parsing.
*
* @protected
*/
initiateAdRequest() {
if (this.xOriginIframeHandler_) {
this.xOriginIframeHandler_.onLayoutMeasure();
}
if (this.adPromise_ || !this.shouldInitializePromiseChain_()) {
return;
}
// If in localDev `type=fake` Ad specifies `force3p`, it will be forced
// to go via 3p.
if (getMode().localDev &&
this.element.getAttribute('type') == 'fake' &&
this.element.getAttribute('force3p') == 'true') {
this.adUrl_ = this.getAdUrl();
this.adPromise_ = Promise.resolve();
return;
}
// Increment unique promise ID so that if its value changes within the
// promise chain due to cancel from unlayout, the promise will be rejected.
++this.promiseId_;
// Shorthand for: reject promise if current promise chain is out of date.
const checkStillCurrent = this.verifyStillCurrent();
// Return value from this chain: True iff rendering was "successful"
// (i.e., shouldn't try to render later via iframe); false iff should
// try to render later in iframe.
// Cases to handle in this chain:
// - Everything ok => Render; return true
// - Empty network response returned => Don't render; return true
// - Can't parse creative out of response => Don't render; return false
// - Can parse, but creative is empty => Don't render; return true
// - Validation fails => return false
// - Rendering fails => return false
// - Chain cancelled => don't return; drop error
// - Uncaught error otherwise => don't return; percolate error up
this.adPromise_ = Services.viewerForDoc(this.getAmpDoc()).whenFirstVisible()
.then(() => {
checkStillCurrent();
// See if experiment that delays request until slot is within
// renderOutsideViewport. Within render outside viewport will not
// resolve if already within viewport thus the check for already
// meeting the definition as opposed to waiting on the promise.
if (this.delayAdRequestEnabled() &&
!this.getResource().renderOutsideViewport()) {
return this.getResource().whenWithinRenderOutsideViewport();
}
})
// This block returns the ad URL, if one is available.
/** @return {!Promise<?string>} */
.then(() => {
checkStillCurrent();
return /** @type {!Promise<?string>} */(
this.getAdUrl(this.tryExecuteRealTimeConfig_()));
})
// This block returns the (possibly empty) response to the XHR request.
/** @return {!Promise<?Response>} */
.then(adUrl => {
checkStillCurrent();
this.adUrl_ = adUrl;
this.handleLifecycleStage_('urlBuilt');
return adUrl && this.sendXhrRequest(adUrl);
})
// The following block returns either the response (as a {bytes, headers}
// object), or null if no response is available / response is empty.
/** @return {?Promise<?{bytes: !ArrayBuffer, headers: !Headers}>} */
.then(fetchResponse => {
checkStillCurrent();
this.handleLifecycleStage_('adRequestEnd');
// If the response is null, we want to return null so that
// unlayoutCallback will attempt to render via x-domain iframe,
// assuming ad url or creative exist.
if (!fetchResponse) {
return null;
}
if (fetchResponse.headers && fetchResponse.headers.has(
EXPERIMENT_FEATURE_HEADER_NAME)) {
this.populatePostAdResponseExperimentFeatures_(
fetchResponse.headers.get(EXPERIMENT_FEATURE_HEADER_NAME));
}
if (getMode().localDev && this.win.location &&
this.win.location.search) {
// Allow for setting experiment features via query param which
// will potentially override values returned in response.
const match = /(?:\?|&)a4a_feat_exp=([^&]+)/.exec(
this.win.location.search);
if (match && match[1]) {
dev().info(TAG, `Using debug exp features: ${match[1]}`);
this.populatePostAdResponseExperimentFeatures_(
tryDecodeUriComponent(match[1]));
}
}
// If the response has response code 204, or arrayBuffer is null,
// collapse it.
if (!fetchResponse.arrayBuffer || fetchResponse.status == 204) {
this.forceCollapse();
return Promise.reject(NO_CONTENT_RESPONSE);
}
// TODO(tdrl): Temporary, while we're verifying whether SafeFrame is
// an acceptable solution to the 'Safari on iOS doesn't fetch
// iframe src from cache' issue. See
// https://github.com/ampproject/amphtml/issues/5614
const method = this.getNonAmpCreativeRenderingMethod(
fetchResponse.headers.get(RENDERING_TYPE_HEADER));
this.experimentalNonAmpCreativeRenderMethod_ = method;
const safeframeVersionHeader =
fetchResponse.headers.get(SAFEFRAME_VERSION_HEADER);
if (/^[0-9-]+$/.test(safeframeVersionHeader) &&
safeframeVersionHeader != DEFAULT_SAFEFRAME_VERSION) {
this.safeframeVersion = safeframeVersionHeader;
this.preconnect.preload(this.getSafeframePath_());
}
// Note: Resolving a .then inside a .then because we need to capture
// two fields of fetchResponse, one of which is, itself, a promise,
// and one of which isn't. If we just return
// fetchResponse.arrayBuffer(), the next step in the chain will
// resolve it to a concrete value, but we'll lose track of
// fetchResponse.headers.
return fetchResponse.arrayBuffer().then(bytes => {
if (bytes.byteLength == 0) {
// The server returned no content. Instead of displaying a blank
// rectangle, we collapse the slot instead.
this.forceCollapse();
return Promise.reject(NO_CONTENT_RESPONSE);
}
return {
bytes,
headers: fetchResponse.headers,
};
});
})
/** @return {!Promise<?ArrayBuffer>} */
.then(responseParts => {
checkStillCurrent();
// Keep a handle to the creative body so that we can render into
// SafeFrame or NameFrame later, if necessary. TODO(tdrl): Temporary,
// while we
// assess whether this is the right solution to the Safari+iOS iframe
// src cache issue. If we decide to keep a SafeFrame-like solution,
// we should restructure the promise chain to pass this info along
// more cleanly, without use of an object variable outside the chain.
if (!responseParts) {
return Promise.resolve();
}
const {bytes, headers} = responseParts;
const size = this.extractSize(responseParts.headers);
this.creativeSize_ = size || this.creativeSize_;
if (this.experimentalNonAmpCreativeRenderMethod_ !=
XORIGIN_MODE.CLIENT_CACHE &&
bytes) {
this.creativeBody_ = bytes;
}
return this.maybeValidateAmpCreative(bytes, headers);
})
.then(creative => {
checkStillCurrent();
// Need to know if creative was verified as part of render outside
// viewport but cannot wait on promise. Sadly, need a state a
// variable.
this.isVerifiedAmpCreative_ = !!creative;
return creative && utf8Decode(creative);
})
// This block returns CreativeMetaDataDef iff the creative was verified
// as AMP and could be properly parsed for friendly iframe render.
/** @return {?CreativeMetaDataDef} */
.then(creativeDecoded => {
checkStillCurrent();
// Note: It's critical that #getAmpAdMetadata be called
// on precisely the same creative that was validated
// via #validateAdResponse_. See GitHub issue
// https://github.com/ampproject/amphtml/issues/4187
let creativeMetaDataDef;
if (!creativeDecoded ||
!(creativeMetaDataDef = this.getAmpAdMetadata(creativeDecoded))) {
return null;
}
// Update priority.
this.updatePriority(0);
// Load any extensions; do not wait on their promises as this
// is just to prefetch.
const extensions = Services.extensionsFor(this.win);
creativeMetaDataDef.customElementExtensions.forEach(
extensionId => extensions.preloadExtension(extensionId));
// Preload any fonts.
(creativeMetaDataDef.customStylesheets || []).forEach(font =>
this.preconnect.preload(font.href));
// Preload any AMP images.
(creativeMetaDataDef.images || []).forEach(image =>
isSecureUrl(image) && this.preconnect.preload(image));
return creativeMetaDataDef;
})
.catch(error => {
if (error == NO_CONTENT_RESPONSE) {
return {
minifiedCreative: '',
customElementExtensions: [],
customStylesheets: [],
};
}
// If error in chain occurs, report it and return null so that
// layoutCallback can render via cross domain iframe assuming ad
// url or creative exist.
this.promiseErrorHandler_(error);
return null;
});
}
/**
* This block returns the ad creative if it exists and validates as AMP;
* null otherwise.
* @param {!ArrayBuffer} bytes
* @param {!Headers} headers
* @return {!Promise<?ArrayBuffer>}
*/
maybeValidateAmpCreative(bytes, headers) {
this.handleLifecycleStage_('adResponseValidateStart');
const checkStillCurrent = this.verifyStillCurrent();
return this.keysetPromise_
.then(() => signatureVerifierFor(this.win)
.verify(bytes, headers, (eventName, extraVariables) => {
this.handleLifecycleStage_(
eventName, extraVariables);
}))
.then(status => {
checkStillCurrent();
if (getMode().localDev &&
this.element.getAttribute('type') == 'fake') {
// do not verify signature for fake type ad
status = VerificationStatus.OK;
}
this.handleLifecycleStage_('adResponseValidateEnd', {
'signatureValidationResult': status,
'releaseType': this.releaseType_,
});
switch (status) {
case VerificationStatus.OK:
return bytes;
case VerificationStatus.UNVERIFIED:
return null;
case VerificationStatus.CRYPTO_UNAVAILABLE:
return this.shouldPreferentialRenderWithoutCrypto() ?
bytes : null;
// TODO(@taymonbeal, #9274): differentiate between these
case VerificationStatus.ERROR_KEY_NOT_FOUND:
case VerificationStatus.ERROR_SIGNATURE_MISMATCH:
user().error(
TAG, this.element.getAttribute('type'),
'Signature verification failed');
return null;
}
});
}
/**
* Populates object mapping of feature to value used for post ad response
* behavior experimentation. Assumes comma separated, = delimited key/value
* pairs. If key appears more than once, last value wins.
* @param {string} input
* @private
*/
populatePostAdResponseExperimentFeatures_(input) {
input.split(',').forEach(line => {
if (!line) {
return;
}
const parts = line.split('=');
if (parts.length != 2 || !parts[0]) {
dev().warn(TAG, `invalid experiment feature ${line}`);
return;
}
this.postAdResponseExperimentFeatures[parts[0]] = parts[1];
});
}
/**
* Refreshes ad slot by fetching a new creative and rendering it. This leaves
* the current creative displayed until the next one is ready.
*
* @param {function()} refreshEndCallback When called, this function will
* restart the refresh cycle.
* @return {Promise} A promise that resolves when all asynchronous portions of
* the refresh function complete. This is particularly handy for testing.
*/
refresh(refreshEndCallback) {
dev().assert(!this.isRefreshing);
this.isRefreshing = true;
this.tearDownSlot();
this.initiateAdRequest();
dev().assert(this.adPromise_);
const promiseId = this.promiseId_;
return this.adPromise_.then(() => {
if (!this.isRefreshing || promiseId != this.promiseId_) {
// If this refresh cycle was canceled, such as in a no-content
// response case, keep showing the old creative.
refreshEndCallback();
return;
}
return this.mutateElement(() => {
this.togglePlaceholder(true);
// This delay provides a 1 second buffer where the ad loader is
// displayed in between the creatives.
return Services.timerFor(this.win).promise(1000).then(() => {
this.isRelayoutNeededFlag = true;
this.getResource().layoutCanceled();
Services.resourcesForDoc(this.getAmpDoc())
./*OK*/requireLayout(this.element);
});
});
});
}
/**
* Handles uncaught errors within promise flow.
* @param {*} error
* @param {boolean=} opt_ignoreStack
* @private
*/
promiseErrorHandler_(error, opt_ignoreStack) {
if (isCancellation(error)) {
// Rethrow if cancellation.
throw error;
}
if (error && error.message) {
error = duplicateErrorIfNecessary(/** @type {!Error} */(error));
} else {
error = new Error('unknown error ' + error);
}
if (opt_ignoreStack) {
error.ignoreStack = opt_ignoreStack;
}
// Add `type` to the message. Ensure to preserve the original stack.
const type = this.element.getAttribute('type') || 'notype';
if (error.message.indexOf(`${TAG}: ${type}:`) != 0) {
error.message = `${TAG}: ${type}: ${error.message}`;
}
// Additional arguments.
assignAdUrlToError(/** @type {!Error} */(error), this.adUrl_);
if (getMode().development || getMode().localDev || getMode().log) {
user().error(TAG, error);
} else {
user().warn(TAG, error);
// Report with 1% sampling as an expected dev error.
if (Math.random() < 0.01) {
dev().expectedError(TAG, error);
}
}
}
/** @override */
layoutCallback() {
if (this.isRefreshing) {
this.destroyFrame(true);
}
return this.attemptToRenderCreative();
}
/**
* Attemps to render the returned creative following the resolution of the
* adPromise.
*
* @return {!Promise<boolean>|!Promise<undefined>} A promise that resolves
* when the rendering attempt has finished.
* @protected
*/
attemptToRenderCreative() {
// Promise may be null if element was determined to be invalid for A4A.
if (!this.adPromise_) {
if (this.shouldInitializePromiseChain_()) {
dev().error(TAG, 'Null promise in layoutCallback');
}
return Promise.resolve();
}
// There's no real throttling with A4A, but this is the signal that is
// most comparable with the layout callback for 3p ads.
this.handleLifecycleStage_('preAdThrottle');
const layoutCallbackStart = this.getNow_();
const checkStillCurrent = this.verifyStillCurrent();
// Promise chain will have determined if creative is valid AMP.
return this.adPromise_.then(creativeMetaData => {
checkStillCurrent();
const delta = this.getNow_() - layoutCallbackStart;
this.handleLifecycleStage_('layoutAdPromiseDelay', {
layoutAdPromiseDelay: Math.round(delta),
isAmpCreative: !!creativeMetaData,
});
if (this.isCollapsed_) {
return Promise.resolve();
}
// If this.iframe already exists, and we're not currently in the middle
// of refreshing, bail out here. This should only happen in
// testing context, not in production.
if (this.iframe && !this.isRefreshing) {
this.handleLifecycleStage_('iframeAlreadyExists');
return Promise.resolve();
}
if (!creativeMetaData) {
// Non-AMP creative case, will verify ad url existence.
return this.renderNonAmpCreative();
}
// Must be an AMP creative.
return this.renderAmpCreative_(creativeMetaData)
.catch(err => {
checkStillCurrent();
// Failed to render via AMP creative path so fallback to non-AMP
// rendering within cross domain iframe.
user().error(TAG, this.element.getAttribute('type'),
'Error injecting creative in friendly frame', err);
this.promiseErrorHandler_(err);
return this.renderNonAmpCreative();
});
}).catch(error => {
this.promiseErrorHandler_(error);
throw cancellation();
});
}
/** @override **/
attemptChangeSize(newHeight, newWidth) {
// Store original size of slot in order to allow re-expansion on
// unlayoutCallback so that it is reverted to original size in case
// of resumeCallback.
this.originalSlotSize_ = this.originalSlotSize_ || this.getLayoutBox();
return super.attemptChangeSize(newHeight, newWidth).catch(() => {});
}
/** @override */
unlayoutCallback() {
this.tearDownSlot();
return true;
}
/**
* Attempts to tear down and set all state variables to initial conditions.
* @protected
*/
tearDownSlot() {
// Increment promiseId to cause any pending promise to cancel.
this.promiseId_++;
this.handleLifecycleStage_('adSlotCleared');
this.uiHandler.applyUnlayoutUI();
if (this.originalSlotSize_) {
super.attemptChangeSize(
this.originalSlotSize_.height, this.originalSlotSize_.width)
.then(() => {
this.originalSlotSize_ = null;
})
.catch(err => {
// TODO(keithwrightbos): if we are unable to revert size, on next
// trigger of promise chain the ad request may fail due to invalid
// slot size. Determine how to handle this case.
dev().warn(TAG, 'unable to revert to original size', err);
});
}
this.isCollapsed_ = false;
// Remove rendering frame, if it exists.
this.destroyFrame();
this.adPromise_ = null;
this.adUrl_ = null;
this.creativeBody_ = null;
this.isVerifiedAmpCreative_ = false;
this.fromResumeCallback = false;
this.experimentalNonAmpCreativeRenderMethod_ =
this.getNonAmpCreativeRenderingMethod();
this.postAdResponseExperimentFeatures = {};
}
/**
* Attempts to remove the current frame and free any associated resources.
* This function will no-op if this ad slot is currently in the process of
* being refreshed.
*
* @param {boolean=} force Forces the removal of the frame, even if
* this.isRefreshing is true.
* @protected
*/
destroyFrame(force = false) {
if (!force && this.isRefreshing) {
return;
}
if (this.iframe && this.iframe.parentElement) {
this.iframe.parentElement.removeChild(this.iframe);
this.iframe = null;
}
if (this.xOriginIframeHandler_) {
this.xOriginIframeHandler_.freeXOriginIframe();
this.xOriginIframeHandler_ = null;
}
// Allow embed to release its resources.
if (this.friendlyIframeEmbed_) {
this.friendlyIframeEmbed_.destroy();
this.friendlyIframeEmbed_ = null;
}
}
/** @override */
viewportCallback(inViewport) {
if (this.friendlyIframeEmbed_) {
setFriendlyIframeEmbedVisible(this.friendlyIframeEmbed_, inViewport);
}
if (this.xOriginIframeHandler_) {
this.xOriginIframeHandler_.viewportCallback(inViewport);
}
}
/** @override */
createPlaceholderCallback() {
return this.uiHandler.createPlaceholder();
}
/**
* Gets the Ad URL to send an XHR Request to. To be implemented
* by network.
* @param {Promise<!Array<rtcResponseDef>>=} opt_rtcResponsesPromise
* @return {!Promise<string>|string}
*/
getAdUrl(opt_rtcResponsesPromise) {
throw new Error('getAdUrl not implemented!');
}
/**
* Resets ad url state to null, used to prevent frame get fallback if error
* is thrown after url construction but prior to layoutCallback.
*/
resetAdUrl() {
this.adUrl_ = null;
}
/**
* @return {function()} function that when called will verify if current
* ad retrieval is current (meaning unlayoutCallback was not executed).
* If not, will throw cancellation exception;
* @throws {Error}
*/
verifyStillCurrent() {
const promiseId = this.promiseId_;
return () => {
if (promiseId != this.promiseId_) {
throw cancellation();
}
};
}
/**
* Determine the desired size of the creative based on the HTTP response
* headers. Must be less than or equal to the original size of the ad slot
* along each dimension. May be overridden by network.
*
* @param {!../../../src/service/xhr-impl.FetchResponseHeaders} responseHeaders
* @return {?SizeInfoDef}
*/
extractSize(responseHeaders) {
const headerValue = responseHeaders.get(CREATIVE_SIZE_HEADER);
if (!headerValue) {
return null;
}
const match = /^([0-9]+)x([0-9]+)$/.exec(headerValue);
if (!match) {
// TODO(@taymonbeal, #9274): replace this with real error reporting
user().error(TAG, `Invalid size header: ${headerValue}`);
return null;
}
return /** @type {?SizeInfoDef} */ (
{width: Number(match[1]), height: Number(match[2])});
}
/**
* Forces the UI Handler to collapse this slot.
* @visibleForTesting
*/
forceCollapse() {
if (this.isRefreshing) {
// If, for whatever reason, the new creative would collapse this slot,
// stick with the old creative until the next refresh cycle.
this.isRefreshing = false;
return;
}
dev().assert(this.uiHandler);
// Store original size to allow for reverting on unlayoutCallback so that
// subsequent pageview allows for ad request.
this.originalSlotSize_ = this.originalSlotSize_ || this.getLayoutBox();
this.uiHandler.applyNoContentUI();
this.isCollapsed_ = true;
}
/**
* Callback executed when creative has successfully rendered within the
* publisher page but prior to load (or ini-load for friendly frame AMP
* creative render). To be overridden by network implementations as needed.
*
* @param {?CreativeMetaDataDef} creativeMetaData metadata if AMP creative,
* null otherwise.
*/
onCreativeRender(creativeMetaData) {
const lifecycleStage =
creativeMetaData ? 'renderFriendlyEnd' : 'renderCrossDomainEnd';
this.handleLifecycleStage_(lifecycleStage);
}
/**
* @param {!Element} iframe that was just created. To be overridden for
* testing.
* @visibleForTesting
*/
onCrossDomainIframeCreated(iframe) {
dev().info(TAG, this.element.getAttribute('type'),
`onCrossDomainIframeCreated ${iframe}`);
}
/**
* Send ad request, extract the creative and signature from the response.
* @param {string} adUrl Request URL to send XHR to.
* @return {!Promise<?../../../src/service/xhr-impl.FetchResponse>}
* @protected
*/
sendXhrRequest(adUrl) {
this.handleLifecycleStage_('adRequestStart');
const xhrInit = {
mode: 'cors',
method: 'GET',
credentials: 'include',
};
return Services.xhrFor(this.win)
.fetch(adUrl, xhrInit)
.catch(error => {
// If an error occurs, let the ad be rendered via iframe after delay.
// TODO(taymonbeal): Figure out a more sophisticated test for deciding
// whether to retry with an iframe after an ad request failure or just
// give up and render the fallback content (or collapse the ad slot).
this.handleLifecycleStage_('networkError');
const networkFailureHandlerResult =
this.onNetworkFailure(error, this.adUrl_);
dev().assert(!!networkFailureHandlerResult);
if (networkFailureHandlerResult.frameGetDisabled) {
// Reset adUrl to null which will cause layoutCallback to not
// fetch via frame GET.
dev().info(
TAG, 'frame get disabled as part of network failure handler');
this.resetAdUrl();
} else {
this.adUrl_ = networkFailureHandlerResult.adUrl || this.adUrl_;
}
return null;
});
}
/**
* Called on network failure sending XHR CORS ad request allowing for
* modification of ad url and prevent frame GET request on layoutCallback.
* By default, GET frame request will be executed with same ad URL as used
* for XHR CORS request.
* @param {*} unusedError from network failure
* @param {string} unusedAdUrl used for network request
* @return {!{adUrl: (string|undefined), frameGetDisabled: (boolean|undefined)}}
*/
onNetworkFailure(unusedError, unusedAdUrl) {
return {};
}
/**
* To be overridden by network specific implementation indicating which
* signing service(s) is to be used.
* @return {!Array<string>} A list of signing services.
*/
getSigningServiceNames() {
return getMode().localDev ? ['google', 'google-dev'] : ['google'];
}
/**
* Render non-AMP creative within cross domain iframe.
* @param {boolean=} throttleApplied Whether incrementLoadingAds has already
* been called
* @return {Promise<boolean>} Whether the creative was successfully rendered.
*/
renderNonAmpCreative(throttleApplied) {
if (this.element.getAttribute('disable3pfallback') == 'true') {
user().warn(TAG, this.element.getAttribute('type'),
'fallback to 3p disabled');
return Promise.resolve(false);
}
// TODO(keithwrightbos): remove when no longer needed.
dev().warn(TAG, 'fallback to 3p');
// Haven't rendered yet, so try rendering via one of our
// cross-domain iframe solutions.
const method = this.experimentalNonAmpCreativeRenderMethod_;
let renderPromise = Promise.resolve(false);
if ((method == XORIGIN_MODE.SAFEFRAME ||
method == XORIGIN_MODE.NAMEFRAME) &&
this.creativeBody_) {
renderPromise = this.renderViaNameAttrOfXOriginIframe_(
this.creativeBody_);
this.creativeBody_ = null; // Free resources.
} else if (this.adUrl_) {
assertHttpsUrl(this.adUrl_, this.element);
renderPromise = this.renderViaCachedContentIframe_(this.adUrl_);
} else {
// Ad URL may not exist if buildAdUrl throws error or returns empty.
// If error occurred, it would have already been reported but let's
// report to user in case of empty.
user().warn(TAG, this.element.getAttribute('type'),
'No creative or URL available -- A4A can\'t render any ad');
}
if (!throttleApplied) {
incrementLoadingAds(this.win, renderPromise);
}
return renderPromise.then(
result => {
this.handleLifecycleStage_('crossDomainIframeLoaded');
// Pass on the result to the next value in the promise change.
return result;
});
}
/**
* Render a validated AMP creative directly in the parent page.
* @param {!CreativeMetaDataDef} creativeMetaData Metadata required to render
* AMP creative.
* @return {!Promise} Whether the creative was successfully rendered.
* @private
*/
renderAmpCreative_(creativeMetaData) {
dev().assert(creativeMetaData.minifiedCreative,
'missing minified creative');
dev().assert(!!this.element.ownerDocument, 'missing owner document?!');
this.handleLifecycleStage_('renderFriendlyStart');
// Create and setup friendly iframe.
this.iframe = /** @type {!HTMLIFrameElement} */(
createElementWithAttributes(
/** @type {!Document} */(this.element.ownerDocument), 'iframe',
dict({
// NOTE: It is possible for either width or height to be 'auto',
// a non-numeric value.
'height': this.creativeSize_.height,
'width': this.creativeSize_.width,
'frameborder': '0',
'allowfullscreen': '',
'allowtransparency': '',
'scrolling': 'no',
})));
this.applyFillContent(this.iframe);
const fontsArray = [];
if (creativeMetaData.customStylesheets) {
creativeMetaData.customStylesheets.forEach(s => {
const href = s['href'];
if (href) {
fontsArray.push(href);
}
});
}
const checkStillCurrent = this.verifyStillCurrent();
return installFriendlyIframeEmbed(
this.iframe, this.element, {
host: this.element,
url: this.adUrl_,
html: creativeMetaData.minifiedCreative,
extensionIds: creativeMetaData.customElementExtensions || [],
fonts: fontsArray,
}, embedWin => {
installUrlReplacementsForEmbed(this.getAmpDoc(), embedWin,
new A4AVariableSource(this.getAmpDoc(), embedWin));
}).then(friendlyIframeEmbed => {
checkStillCurrent();
this.friendlyIframeEmbed_ = friendlyIframeEmbed;
setFriendlyIframeEmbedVisible(
friendlyIframeEmbed, this.isInViewport());
// Ensure visibility hidden has been removed (set by boilerplate).
const frameDoc = friendlyIframeEmbed.iframe.contentDocument ||
friendlyIframeEmbed.win.document;
setStyle(frameDoc.body, 'visibility', 'visible');
// Bubble phase click handlers on the ad.
this.registerAlpHandler_(friendlyIframeEmbed.win);
// Capture timing info for friendly iframe load completion.
getTimingDataAsync(
friendlyIframeEmbed.win,
'navigationStart', 'loadEventEnd').then(delta => {
checkStillCurrent();
this.handleLifecycleStage_('friendlyIframeLoaded', {
'navStartToLoadEndDelta.AD_SLOT_ID': Math.round(delta),
});
}).catch(err => {
dev().error(TAG, this.element.getAttribute('type'),
'getTimingDataAsync for renderFriendlyEnd failed: ', err);
});
protectFunctionWrapper(this.onCreativeRender, this, err => {
dev().error(TAG, this.element.getAttribute('type'),
'Error executing onCreativeRender', err);
})(creativeMetaData);
// It's enough to wait for "ini-load" signal because in a FIE case
// we know that the embed no longer consumes significant resources
// after the initial load.
return friendlyIframeEmbed.whenIniLoaded();
}).then(() => {
checkStillCurrent();
// Capture ini-load ping.
this.handleLifecycleStage_('friendlyIframeIniLoad');
});
}
/**
* Shared functionality for cross-domain iframe-based rendering methods.
* @param {!JsonObject<string, string>} attributes The attributes of the iframe.
* @return {!Promise} awaiting load event for ad frame
* @private
*/
iframeRenderHelper_(attributes) {
const mergedAttributes = Object.assign(attributes, dict({
'height': this.creativeSize_.height,
'width': this.creativeSize_.width,
}));
if (this.sentinel) {
mergedAttributes['data-amp-3p-sentinel'] = this.sentinel;
}
this.iframe = createElementWithAttributes(
/** @type {!Document} */ (this.element.ownerDocument),
'iframe', /** @type {!JsonObject} */ (
Object.assign(mergedAttributes, SHARED_IFRAME_PROPERTIES)));
// TODO(keithwrightbos): noContentCallback?
this.xOriginIframeHandler_ = new AMP.AmpAdXOriginIframeHandler(this);
// Iframe is appended to element as part of xorigin frame handler init.
// Executive onCreativeRender after init to ensure it can get reference
// to frame but prior to load to allow for earlier access.
const frameLoadPromise =
this.xOriginIframeHandler_.init(this.iframe, /* opt_isA4A */ true);
protectFunctionWrapper(this.onCreativeRender, this, err => {
dev().error(TAG, this.element.getAttribute('type'),
'Error executing onCreativeRender', err);
})(null);
return frameLoadPromise;
}
/**
* Creates iframe whose src matches that of the ad URL. The response should
* have been cached causing the browser to render without callout. However,
* it is possible for cache miss to occur which can be detected server-side
* by missing ORIGIN header.
*
* Note: As of 2016-10-18, the fill-from-cache assumption appears to fail on
* Safari-on-iOS, which issues a fresh network request, even though the
* content is already in cache.
*
* @param {string} adUrl Ad request URL, as sent to #sendXhrRequest (i.e.,
* before any modifications that XHR module does to it.)
* @return {!Promise} awaiting ad completed insertion.
* @private
*/
renderViaCachedContentIframe_(adUrl) {
this.handleLifecycleStage_('renderCrossDomainStart', {
'isAmpCreative': this.isVerifiedAmpCreative_,
'releaseType': this.releaseType_,
});
return this.iframeRenderHelper_(dict({
'src': Services.xhrFor(this.win).getCorsUrl(this.win, adUrl),
'name': JSON.stringify(
getContextMetadata(this.win, this.element, this.sentinel)),
}));
}
/**
* Render the creative via some "cross domain iframe that accepts the creative
* in the name attribute". This could be SafeFrame or the AMP-native
* NameFrame.
*
* @param {!ArrayBuffer} creativeBody
* @return {!Promise} awaiting load event for ad frame
* @private
*/
renderViaNameAttrOfXOriginIframe_(creativeBody) {
/** @type {string} */
const method = this.experimentalNonAmpCreativeRenderMethod_;
dev().assert(method == XORIGIN_MODE.SAFEFRAME ||
method == XORIGIN_MODE.NAMEFRAME,
'Unrecognized A4A cross-domain rendering mode: %s', method);
this.handleLifecycleStage_('renderSafeFrameStart', {
'isAmpCreative': this.isVerifiedAmpCreative_,
'releaseType': this.releaseType_,
});
const checkStillCurrent = this.verifyStillCurrent();
return Promise.resolve(utf8Decode(creativeBody)).then(creative => {
checkStillCurrent();
let srcPath;
let name = '';
switch (method) {
case XORIGIN_MODE.SAFEFRAME:
srcPath = this.getSafeframePath_() + '?n=0';
break;
case XORIGIN_MODE.NAMEFRAME:
srcPath = getDefaultBootstrapBaseUrl(this.win, 'nameframe');
// Name will be set for real below in nameframe case.
break;
default:
// Shouldn't be able to get here, but... Because of the assert, above,
// we can only get here in non-dev mode, so give user feedback.
user().error('A4A', 'A4A received unrecognized cross-domain name'
+ ' attribute iframe rendering mode request: %s. Unable to'
+ ' render a creative for'
+ ' slot %s.', method, this.element.getAttribute('id'));
return Promise.reject('Unrecognized rendering mode request');
}
// TODO(bradfrizzell): change name of function and var
let contextMetadata = getContextMetadata(
this.win, this.element, this.sentinel,
this.getAdditionalContextMetadata());
// TODO(bradfrizzell) Clean up name assigning.
if (method == XORIGIN_MODE.NAMEFRAME) {
contextMetadata['creative'] = creative;
name = JSON.stringify(contextMetadata);
} else if (method == XORIGIN_MODE.SAFEFRAME) {
contextMetadata = JSON.stringify(contextMetadata);
name = `${this.safeframeVersion};${creative.length};${creative}` +
`${contextMetadata}`;
}
return this.iframeRenderHelper_(dict({'src': srcPath, 'name': name}));
});
}
/**
*
* Throws {@code SyntaxError} if the metadata block delimiters are missing
* or corrupted or if the metadata content doesn't parse as JSON.
* @param {string} creative from which CSS is extracted
* @return {?CreativeMetaDataDef} Object result of parsing JSON data blob inside
* the metadata markers on the ad text, or null if no metadata markers are
* found.
* TODO(keithwrightbos@): report error cases
*/
getAmpAdMetadata(creative) {
let metadataStart = -1;
let metadataString;
for (let i = 0; i < METADATA_STRINGS.length; i++) {
metadataString = METADATA_STRINGS[i];
metadataStart = creative.lastIndexOf(metadataString);
if (metadataStart >= 0) {
break;
}
}
if (metadataStart < 0) {
// Couldn't find a metadata blob.
dev().warn(TAG, this.element.getAttribute('type'),
'Could not locate start index for amp meta data in: %s', creative);
return null;
}
const metadataEnd = creative.lastIndexOf('</script>');
if (metadataEnd < 0) {
// Couldn't find a metadata blob.
dev().warn(TAG, this.element.getAttribute('type'),
'Could not locate closing script tag for amp meta data in: %s',
creative);
return null;
}
try {
const metaDataObj = parseJson(
creative.slice(metadataStart + metadataString.length, metadataEnd));
const ampRuntimeUtf16CharOffsets =
metaDataObj['ampRuntimeUtf16CharOffsets'];
if (!isArray(ampRuntimeUtf16CharOffsets) ||
ampRuntimeUtf16CharOffsets.length != 2 ||
typeof ampRuntimeUtf16CharOffsets[0] !== 'number' ||
typeof ampRuntimeUtf16CharOffsets[1] !== 'number') {
throw new Error('Invalid runtime offsets');
}
const metaData = {};
if (metaDataObj['customElementExtensions']) {
metaData.customElementExtensions =
metaDataObj['customElementExtensions'];
if (!isArray(metaData.customElementExtensions)) {
throw new Error(
'Invalid extensions', metaData.customElementExtensions);
}
} else {
metaData.customElementExtensions = [];
}
if (metaDataObj['customStylesheets']) {
// Expect array of objects with at least one key being 'href' whose
// value is URL.
metaData.customStylesheets = metaDataObj['customStylesheets'];
const errorMsg = 'Invalid custom stylesheets';
if (!isArray(metaData.customStylesheets)) {
throw new Error(errorMsg);
}
metaData.customStylesheets.forEach(stylesheet => {
if (!isObject(stylesheet) || !stylesheet['href'] ||
typeof stylesheet['href'] !== 'string' ||
!isSecureUrl(stylesheet['href'])) {
throw new Error(errorMsg);
}
});
}
if (isArray(metaDataObj['images'])) {
// Load maximum of 5 images.
metaData.images = metaDataObj['images'].splice(0, 5);
}
// TODO(keithwrightbos): OK to assume ampRuntimeUtf16CharOffsets is before
// metadata as its in the head?
metaData.minifiedCreative =
creative.slice(0, ampRuntimeUtf16CharOffsets[0]) +
creative.slice(ampRuntimeUtf16CharOffsets[1], metadataStart) +
creative.slice(metadataEnd + '</script>'.length);
return metaData;
} catch (err) {
dev().warn(
TAG, this.element.getAttribute('type'), 'Invalid amp metadata: %s',
creative.slice(metadataStart + metadataString.length, metadataEnd));
return null;
}
}
/**
* Registers a click handler for "A2A" (AMP-to-AMP navigation where the AMP
* viewer navigates to an AMP destination on our behalf.
* @param {!Window} iframeWin
*/
registerAlpHandler_(iframeWin) {
if (!isExperimentOn(this.win, 'alp-for-a4a')) {
return;
}
iframeWin.document.documentElement.addEventListener('click', event => {
handleClick(event, url => {
Services.viewerForDoc(this.getAmpDoc()).navigateTo(url, 'a4a');
});
});
}
/**
* @return {string} full url to safeframe implementation.
* @private
*/
getSafeframePath_() {
return 'https://tpc.googlesyndication.com/safeframe/' +
`${this.safeframeVersion}/html/container.html`;
}
/**
* Receive collapse notifications and record lifecycle events for them.
*
* @param unusedElement {!AmpElement}
* @override
*/
collapsedCallback(unusedElement) {
this.handleLifecycleStage_('adSlotCollapsed');
}
/**
* Handles a lifecycle event by triggering the corresponding analytics event
* (if such an event exists) and by forwarding the event to the impl-specific
* handler in #emitLifecycleEvent.
* @param {string} eventName
* @param {!Object<string, string>=} opt_vars
* @private
*/
handleLifecycleStage_(eventName, opt_vars) {
this.maybeTriggerAnalyticsEvent_(eventName);
this.protectedEmitLifecycleEvent_(eventName, opt_vars);
}
/**
* Checks if the given lifecycle event has a corresponding amp-analytics event
* and fires the analytics trigger if so.
* @param {string} lifecycleStage
* @private
*/
maybeTriggerAnalyticsEvent_(lifecycleStage) {
if (!this.a4aAnalyticsConfig_) {
// No config exists that will listen to this event.
return;
}
const analyticsEvent =
LIFECYCLE_STAGE_TO_ANALYTICS_TRIGGER[lifecycleStage];
if (!analyticsEvent) {
// No analytics event is defined for this lifecycle stage.
return;
}
const analyticsVars = Object.assign(
{'time': Math.round(this.getNow_())},
this.getA4aAnalyticsVars(analyticsEvent));
triggerAnalyticsEvent(this.element, analyticsEvent, analyticsVars);
}
/**
* Returns variables to be included on an analytics event. This can be
* overridden by specific network implementations.
* Note that this function is called for each time an analytics event is
* fired.
* @param {string} unusedAnalyticsEvent The name of the analytics event.
* @return {!Object<string, string>}
*/
getA4aAnalyticsVars(unusedAnalyticsEvent) { return {}; }
/**
* Returns network-specific config for amp-analytics. It should overridden
* with network-specific configurations.
* This function may return null. If so, no amp-analytics element will be
* added to this A4A element and no A4A triggers will be fired.
* @return {?JsonObject}
*/
getA4aAnalyticsConfig() { return null; }
/**
* To be overriden by network specific implementation.
* This function will be called for each lifecycle event as specified in the
* LIFECYCLE_STAGES enum declaration. It may additionally pass extra
* variables of the form { name: val }. It is up to the subclass what to
* do with those variables.
*
* @param {string} unusedEventName
* @param {!Object<string, string|number>=} opt_extraVariables
*/
emitLifecycleEvent(unusedEventName, opt_extraVariables) {}
/**
* Attempts to execute Real Time Config, if the ad network has enabled it.
* If it is not supported by the network, but the publisher has included
* the rtc-config attribute on the amp-ad element, warn.
* @return {Promise<!Array<!rtcResponseDef>>|undefined}
*/
tryExecuteRealTimeConfig_() {
if (!!AMP.maybeExecuteRealTimeConfig) {
try {
return AMP.maybeExecuteRealTimeConfig(
this, this.getCustomRealTimeConfigMacros_());
} catch (err) {
user().error(TAG, 'Could not perform Real Time Config.', err);
}
} else if (this.element.getAttribute('rtc-config')) {
user().error(TAG, 'RTC not supported for ad network ' +
`${this.element.getAttribute('type')}`);
}
}
/**
* To be overriden by network impl. Should return a mapping of macro keys
* to values for substitution in publisher-specified URLs for RTC.
* @return {?Object<string,
* !../../../src/service/variable-source.SyncResolverDef>}
*/
getCustomRealTimeConfigMacros_() {
return null;
}
/**
* Whether preferential render should still be utilized if web crypto is unavailable,
* and crypto signature header is present.
* @return {boolean}
*/
shouldPreferentialRenderWithoutCrypto() {
return false;
}
/**
* @param {string=} headerValue Method as given in header.
*/
getNonAmpCreativeRenderingMethod(headerValue) {
if (headerValue) {
if (!isEnumValue(XORIGIN_MODE, headerValue)) {
dev().error(
'AMP-A4A', `cross-origin render mode header ${headerValue}`);
} else {
return headerValue;
}
}
return Services.platformFor(this.win).isIos() ?
XORIGIN_MODE.SAFEFRAME : null;
}
/**
* Returns base object that will be written to cross-domain iframe name
* attribute.
* @return {!JsonObject}
*/
getAdditionalContextMetadata() {
return /** @type {!JsonObject} */ ({});
}
}
/**
* Attachs query string portion of ad url to error.
* @param {!Error} error
* @param {string} adUrl
*/
export function assignAdUrlToError(error, adUrl) {
if (!adUrl || (error.args && error.args['au'])) {
return;
}
const adQueryIdx = adUrl.indexOf('?');
if (adQueryIdx == -1) {
return;
}
(error.args || (error.args = {}))['au'] =
adUrl.substring(adQueryIdx + 1, adQueryIdx + 251);
};
/**
* Returns the signature verifier for the given window. Lazily creates it if it
* doesn't already exist.
*
* This ensures that only one signature verifier exists per window, which allows
* multiple Fast Fetch ad slots on a page (even ones from different ad networks)
* to share the same cached public keys.
*
* @param {!Window} win
* @return {!SignatureVerifier}
* @visibleForTesting
*/
export function signatureVerifierFor(win) {
const propertyName = 'AMP_FAST_FETCH_SIGNATURE_VERIFIER_';
return win[propertyName] ||
(win[propertyName] = new SignatureVerifier(win, signingServerURLs));
}
|
(function(e){const t=e["da"]=e["da"]||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 af %1","Align cell text to the bottom":"Justér tekstcelle til bunden","Align cell text to the center":"Justér tekstcelle centreret","Align cell text to the left":"Justér tekstcelle til venstre","Align cell text to the middle":"Justér tekstcelle til midten","Align cell text to the right":"Justér tekstcelle til højre","Align cell text to the top":"Justér tekstcelle til top","Align center":"Justér center","Align left":"Justér venstre","Align right":"Justér højre","Align table to the left":"Justér tabel til venstre","Align table to the right":"Justér tabel til højre",Alignment:"Justering",Aquamarine:"Marineblå",Background:"Baggrund",Big:"Stor",Black:"Sort","Block quote":"Blot citat",Blue:"Blå",Bold:"Fed",Border:"Ramme","Break text":"","Bulleted List":"Punktopstilling","Bulleted list styles toolbar":"",Cancel:"Annullér","Cell properties":"Celleegenskaber","Center table":"Centrér tabel","Centered image":"Centreret billede","Change image text alternative":"Skift alternativ billedtekst","Choose heading":"Vælg overskrift",Circle:"",Color:"Farve","Color picker":"",Column:"Kolonne",Dashed:"Stiplet (streg)",Decimal:"","Decimal with leading zero":"","Decrease indent":"Formindsk indrykning",Default:"Standard","Delete column":"Slet kolonne","Delete row":"Slet række","Dim grey":"Dunkel grå",Dimensions:"Dimensioner",Disc:"","Document colors":"Dokumentfarve",Dotted:"Stiplet (prik)",Double:"Dobbel",Downloadable:"Kan downloades","Dropdown toolbar":"Dropdown værktøjslinje","Edit block":"Redigér blok","Edit link":"Redigér link","Editor toolbar":"Editor værktøjslinje","Enter image caption":"Indtast billedoverskrift","Enter table caption":"","Font Background Color":"Skrift baggrundsfarve","Font Color":"Skriftfarve","Font Family":"Skriftfamilie","Font Size":"Skriftstørrelse","Full size image":"Fuld billedstørrelse",Green:"Grøn",Grey:"Grå",Groove:"Not","Header column":"Headerkolonne","Header row":"Headerrække",Heading:"Overskrift","Heading 1":"Overskrift 1","Heading 2":"Overskrift 2","Heading 3":"Overskrift 3","Heading 4":"Overskrift 4","Heading 5":"Overskrift 5","Heading 6":"Overskrift 6",Height:"Højde","Horizontal line":"Horisontal linje","Horizontal text alignment toolbar":"Horisontal tekstjustering værktøjslinje",Huge:"Kæmpe","Image resize list":"","Image toolbar":"Billedværktøjslinje","image widget":"billed widget","In line":"","Increase indent":"Forøg indrykning",Insert:"","Insert code block":"Indsæt kodeblok","Insert column left":"Indsæt kolonne venstre","Insert column right":"Indsæt kolonne højre","Insert image":"Indsæt billede","Insert image via URL":"","Insert media":"Indsæt medie","Insert paragraph after block":"","Insert paragraph before block":"","Insert row above":"Indsæt header over","Insert row below":"Indsæt header under","Insert table":"Indsæt tabel",Inset:"Forsænket",Italic:"Kursiv",Justify:"Justér","Justify cell text":"Justér tekstcelle","Left aligned image":"Venstrestillet billede","Light blue":"Lys blå","Light green":"Lys grøn","Light grey":"Lys grå",Link:"Link","Link image":"","Link URL":"Link URL","Lower-latin":"","Lower–roman":"","Media toolbar":"Medie værktøjslinje","Media URL":"Medie URL","media widget":"mediewidget","Merge cell down":"Flet celler ned","Merge cell left":"Flet celler venstre","Merge cell right":"Flet celler højre","Merge cell up":"Flet celler op","Merge cells":"Flet celler",Next:"Næste",None:"Ingen","Numbered List":"Opstilling med tal","Numbered list styles toolbar":"","Open in a new tab":"Åben i ny fane","Open link in new tab":"Åben link i ny fane",Orange:"Orange",Original:"",Outset:"Fra starten",Padding:"Fyld","Page break":"Sideskift",Paragraph:"Afsnit","Paste the media URL in the input.":"Indsæt medie URLen i feltet.","Plain text":"Plain tekst",Previous:"Forrige",Purple:"Lilla",Red:"Rød",Redo:"Gentag","Remove color":"Fjern farve","Resize image":"","Resize image to %0":"","Resize image to the original size":"","Restore default":"","Rich Text Editor":"Wysiwyg editor","Rich Text Editor, %0":"Wysiwyg editor, %0",Ridge:"Kam","Right aligned image":"Højrestillet billede",Row:"Række",Save:"Gem","Select column":"","Select row":"","Show more items":"Vis flere emner","Side image":"Sidebillede",Small:"Lille",Solid:"Massiv","Split cell horizontally":"Del celle horisontalt","Split cell vertically":"Del celle vertikalt",Square:"",Style:"Stil","Table alignment toolbar":"Tabeljustering værktøjslinje","Table cell text alignment":"Tabelcelle tekstjustering","Table properties":"Tabelegenskaber","Table toolbar":"Tabel værktøjslinje","Text alignment":"Tekstjustering","Text alignment toolbar":"Tekstjustering værktøjslinje","Text alternative":"Alternativ tekst",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':'Farven er ugyldig. Prøv "#FF0000" eller "rgb(255,0,0)" eller "red".',"The URL must not be empty.":"URLen kan ikke være tom.",'The value is invalid. Try "10px" or "2em" or simply "2".':'Værdien er ugyldig. Prøv "10px" eller "2em" eller ganske enkelt "2".',"This link has no URL":"Dette link har ingen URL","This media URL is not supported.":"Denne medie URL understøttes ikke.",Tiny:"Lillebitte","Tip: Paste the URL into the content to embed faster.":"Tip: Indsæt URLen i indholdet for at indlejre hurtigere.","To-do List":"To-do liste","Toggle caption off":"","Toggle caption on":"","Toggle the circle list style":"","Toggle the decimal list style":"","Toggle the decimal with leading zero list style":"","Toggle the disc list style":"","Toggle the lower–latin list style":"","Toggle the lower–roman list style":"","Toggle the square list style":"","Toggle the upper–latin list style":"","Toggle the upper–roman list style":"",Turquoise:"Turkis","Type or paste your content here.":"Skriv eller indsæt dit indhold her.","Type your title":"Skriv din titel",Underline:"Understreget",Undo:"Fortryd",Unlink:"Fjern link",Update:"","Update image URL":"","Upload failed":"Upload fejlede","Upload in progress":"Upload i gang","Upper-latin":"","Upper-roman":"","Vertical text alignment toolbar":"Vertikal tekstjustering værktøjslinje",White:"Hvid","Widget toolbar":"Widget værktøjslinje",Width:"Bredde","Wrap text":"",Yellow:"Gyl"});t.getPluralForm=function(e){return e!=1}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
(async function(testRunner) {
var {page, session, dp} = await testRunner.startHTML(`
<link rel='stylesheet' media='print and (min-width: 8.5in)' href='${testRunner.url('./resources/media-queries.css')}'></link>
<link rel='stylesheet' href='${testRunner.url('./resources/active-media-queries.css')}'></link>
<style>
@media screen and (device-aspect-ratio: 16/9), screen and (device-aspect-ratio: 16/10) {
* {
padding: 1em;
}
@media (max-width: 200px) and (min-width: 100px) {
* {
margin: 1in;
}
}
}
</style>
`, 'Verify that media queries are reported properly.');
await dp.DOM.enable();
await dp.CSS.enable();
var response = await dp.CSS.getMediaQueries();
var medias = response.result.medias;
medias.sort((media1, media2) => {
var compareValue = (value1, value2) => value1 < value2 ? -1 : value1 > value2 ? 1 : 0;
if (media1.text != media2.text)
return compareValue(media1.text, media2.text);
var hasSource1 = !!(media1.styleSheetId && media1.range);
var hasSource2 = !!(media2.styleSheetId && media2.range);
if (hasSource1 != hasSource2)
return compareValue(hasSource1, hasSource2);
if (media1.range.startLine != media2.range.startLine)
return compareValue(media1.range.startLine, media2.range.startLine);
if (media1.range.startColumn != media2.range.startColumn)
return compareValue(media1.range.startColumn, media2.range.startColumn);
if (media1.range.endLine != media2.range.endLine)
return compareValue(media1.range.endLine, media2.range.endLine);
if (media1.range.endColumn != media2.range.endColumn)
return compareValue(media1.range.endColumn, media2.range.endColumn);
return 0;
});
var styleSheetIds = new Set(medias.map(media => media.styleSheetId).filter(styleSheetId => !!styleSheetId));
var styleSheetTexts = new Map();
for (var styleSheetId of styleSheetIds)
styleSheetTexts.set(styleSheetId, (await dp.CSS.getStyleSheetText({styleSheetId})).result.text);
for (var i = 0; i < medias.length; ++i) {
var mediaRule = medias[i];
testRunner.log('mediaRule #' + i);
testRunner.log(' text: ' + mediaRule.text);
testRunner.log(' source: ' + mediaRule.source);
testRunner.log(' range: ' + JSON.stringify(mediaRule.range));
if (mediaRule.styleSheetId && mediaRule.range)
testRunner.log(' computedText: ' + extractText(mediaRule.styleSheetId, mediaRule.range));
if (!mediaRule.mediaList) {
testRunner.log(' mediaList is empty');
continue;
}
for (var j = 0; j < mediaRule.mediaList.length; ++j) {
var mediaQuery = mediaRule.mediaList[j];
var suffix = mediaRule.sourceURL.indexOf('active-media-queries.css') !== -1 ? ' active: ' + mediaQuery.active : '';
testRunner.log(' mediaQuery #' + j + suffix);
for (var k = 0; k < mediaQuery.expressions.length; ++k) {
var expression = mediaQuery.expressions[k];
testRunner.log(' mediaExpression #' + k);
testRunner.log(' feature: ' + expression.feature);
testRunner.log(' value: ' + expression.value);
testRunner.log(' unit: ' + expression.unit);
if (expression.valueRange) {
testRunner.log(' valueRange: ' + JSON.stringify(expression.valueRange));
if (mediaRule.styleSheetId)
testRunner.log(' computedText: ' + extractText(mediaRule.styleSheetId, expression.valueRange));
}
if (expression.computedLength)
testRunner.log(' computed length: ' + expression.computedLength);
}
}
}
testRunner.completeTest();
function extractText(styleSheetId, range) {
var text = styleSheetTexts.get(styleSheetId);
var lines = text.split('\n');
var result = [];
for (var line = range.startLine; line <= range.endLine; ++line) {
var start = line === range.startLine ? range.startColumn : 0;
var end = line === range.endLine ? range.endColumn : lines[line].length;
result.push(lines[line].substring(start, end));
}
return result.join('\\n');
}
});
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.