diff --git a/.github/slack.yml b/.github/slack.yml
index 88f3f5c5..e3970c34 100644
--- a/.github/slack.yml
+++ b/.github/slack.yml
@@ -1,7 +1,7 @@
username: GitHub-CI
icon_url: https://octodex.github.com/images/femalecodertocat.png
-pretext: Triggered via {{eventName}} by {{actor}} {{or action "action"}} {{ref}} `{{diffRef}}`
+pretext: Triggered via {{eventName}} by {{actor}} {{default action "action"}} {{ref}} `{{diffRef}}`
title: GitHub Actions
title_link: https://support.github.com
@@ -11,7 +11,7 @@ text: |
{{#if payload.commits}}
*Commits*
{{#each payload.commits}}
- <{{this.url}}|`{{limitTo this.id 8}}`> - {{this.message}}
+ <{{this.url}}|`{{truncate this.id 8}}`> - {{this.message}}
{{/each}}
{{/if}}
@@ -20,7 +20,9 @@ fallback: |-
fields:
- title: Job Steps
- value: "{{#each jobSteps}}{{icon this.outcome}} {{@key}}\n{{/each}}"
+ value: |-
+ {{#each jobSteps}}{{#compare this.outcome '!=' 'skipped'}}{{icon this.outcome}} {{@key}}
+ {{/compare}}{{/each}}
short: false
- title: Workflow
value: "<{{{workflowUrl}}}|{{workflow}}>"
diff --git a/README.md b/README.md
index 9078c181..27959104 100644
--- a/README.md
+++ b/README.md
@@ -104,13 +104,9 @@ The following [Slack message fields](https://api.slack.com/reference/messaging/a
**Helper Functions**
-Apart from the [standard helper functions](https://handlebarsjs.com/guide/builtin-helpers.html#if) such as `#if` and `#each` there are also a few custom
-ones:
+Apart from the [standard helper functions](https://handlebarsjs.com/guide/builtin-helpers.html#if) such as `#if` and `#each` there are also more than 130 helpers from the [handlebars-helpers library](https://github.com/helpers/handlebars-helpers), plus one additional helper specific for this slack action:
- `icon` converts a job status into an icon eg. `{{icon jobStatus}}`
-- `json` dumps the value as a JSON string eg. `{{json payload.commits}}`
-- `limitTo` cuts the string at the limit eg. `{{limitTo sha 8}}`
-- `or` allows a alternative or default value eg. `{{or headRef baseRef}}`
**Example Using Config File**
diff --git a/__tests__/config.test.ts b/__tests__/config.test.ts
index be12e077..755813c1 100644
--- a/__tests__/config.test.ts
+++ b/__tests__/config.test.ts
@@ -11,8 +11,8 @@ const jobStatus = 'failure'
const jobSteps = {
'install-deps': {
outputs: {},
- outcome: 'skipped',
- conclusion: 'skipped'
+ outcome: 'success',
+ conclusion: 'success'
},
hooks: {
outputs: {},
@@ -21,8 +21,8 @@ const jobSteps = {
},
lint: {
outputs: {},
- outcome: 'skipped',
- conclusion: 'skipped'
+ outcome: 'failure',
+ conclusion: 'failure'
},
types: {
outputs: {},
@@ -36,8 +36,8 @@ const jobSteps = {
},
'integration-test': {
outputs: {},
- outcome: 'skipped',
- conclusion: 'skipped'
+ outcome: 'failure',
+ conclusion: 'failure'
}
}
const channel = '#github-ci'
@@ -122,8 +122,7 @@ test('custom config of slack action', async () => {
{
short: false,
title: 'Job Steps',
- value:
- ':heavy_minus_sign: install-deps\n:heavy_minus_sign: hooks\n:heavy_minus_sign: lint\n:heavy_minus_sign: types\n:heavy_minus_sign: unit-test\n:heavy_minus_sign: integration-test\n'
+ value: ':white_check_mark: install-deps\n:grimacing: lint\n:grimacing: integration-test\n'
},
{
short: true,
diff --git a/__tests__/fixtures/slack.yml b/__tests__/fixtures/slack.yml
index a5a3f614..d99226b1 100644
--- a/__tests__/fixtures/slack.yml
+++ b/__tests__/fixtures/slack.yml
@@ -1,7 +1,7 @@
username: GitHub-CI
icon_url: https://octodex.github.com/images/mona-the-rivetertocat.png
-pretext: Triggered via {{eventName}} by {{actor}} {{or action "action"}} {{ref}} `{{diffRef}}`
+pretext: Triggered via {{eventName}} by {{actor}} {{default action "action"}} {{ref}} `{{diffRef}}`
title: GitHub Actions
title_link: https://support.github.com
@@ -11,7 +11,7 @@ text: |
{{#if payload.commits}}
*Commits*
{{#each payload.commits}}
- <{{this.url}}|`{{limitTo this.id 8}}`> - {{this.message}}
+ <{{this.url}}|`{{truncate this.id 8}}`> - {{this.message}}
{{/each}}
{{/if}}
@@ -20,7 +20,9 @@ fallback: |-
fields:
- title: Job Steps
- value: "{{#each jobSteps}}{{icon this.outcome}} {{@key}}\n{{/each}}"
+ value: |-
+ {{#each jobSteps}}{{#compare this.outcome '!=' 'skipped'}}{{icon this.outcome}} {{@key}}
+ {{/compare}}{{/each}}
short: false
- title: Workflow
value: "<{{{workflowUrl}}}|{{workflow}}>"
diff --git a/__tests__/inputs.test.ts b/__tests__/inputs.test.ts
index a6fe3c61..61f1bf46 100644
--- a/__tests__/inputs.test.ts
+++ b/__tests__/inputs.test.ts
@@ -11,8 +11,8 @@ const jobStatus = 'in progress'
const jobSteps = {
'install-deps': {
outputs: {},
- outcome: 'skipped',
- conclusion: 'skipped'
+ outcome: 'success',
+ conclusion: 'success'
},
hooks: {
outputs: {},
@@ -21,8 +21,8 @@ const jobSteps = {
},
lint: {
outputs: {},
- outcome: 'skipped',
- conclusion: 'skipped'
+ outcome: 'failure',
+ conclusion: 'failure'
},
types: {
outputs: {},
@@ -36,8 +36,8 @@ const jobSteps = {
},
'integration-test': {
outputs: {},
- outcome: 'skipped',
- conclusion: 'skipped'
+ outcome: 'failure',
+ conclusion: 'failure'
}
}
const channel = '#deploy'
@@ -115,8 +115,7 @@ test('custom config of slack action', async () => {
{
short: false,
title: 'Job Steps',
- value:
- ':heavy_minus_sign: install-deps\n:heavy_minus_sign: hooks\n:heavy_minus_sign: lint\n:heavy_minus_sign: types\n:heavy_minus_sign: unit-test\n:heavy_minus_sign: integration-test\n'
+ value: ':white_check_mark: install-deps\n:grimacing: lint\n:grimacing: integration-test\n'
},
{
short: true,
diff --git a/dist/index.js b/dist/index.js
index e84b04b8..299fb0c5 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1,7 +1,7 @@
require('./sourcemap-register.js');/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
-/***/ 7716:
+/***/ 17716:
/***/ ((module) => {
"use strict";
@@ -43,10 +43,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
-const core = __importStar(__nccwpck_require__(2186));
-const yaml = __importStar(__nccwpck_require__(1917));
-const slack_1 = __nccwpck_require__(568);
-const fs_1 = __nccwpck_require__(5747);
+const core = __importStar(__nccwpck_require__(42186));
+const yaml = __importStar(__nccwpck_require__(21917));
+const slack_1 = __nccwpck_require__(10568);
+const fs_1 = __nccwpck_require__(35747);
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
@@ -97,7 +97,7 @@ run();
/***/ }),
-/***/ 568:
+/***/ 10568:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
@@ -135,10 +135,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.send = void 0;
-const core = __importStar(__nccwpck_require__(2186));
-const github = __importStar(__nccwpck_require__(5438));
-const webhook_1 = __nccwpck_require__(1095);
-const handlebars_1 = __importDefault(__nccwpck_require__(7492));
+const core = __importStar(__nccwpck_require__(42186));
+const github = __importStar(__nccwpck_require__(95438));
+const webhook_1 = __nccwpck_require__(81095);
+const handlebars_1 = __importDefault(__nccwpck_require__(97492));
+const handlebars_helpers_1 = __importDefault(__nccwpck_require__(89497));
function jobColor(status, opts) {
if (status.toLowerCase() === 'success')
return (opts === null || opts === void 0 ? void 0 : opts.success) || 'good';
@@ -242,18 +243,10 @@ function send(url, jobName, jobStatus, jobSteps, channel, message, opts) {
};
}
}
+ (0, handlebars_helpers_1.default)();
handlebars_1.default.registerHelper('icon', function (status) {
return stepIcon(status, opts === null || opts === void 0 ? void 0 : opts.icons);
});
- handlebars_1.default.registerHelper('json', function (context) {
- return JSON.stringify(context);
- });
- handlebars_1.default.registerHelper('limitTo', function (text, size) {
- return text.substring(0, size);
- });
- handlebars_1.default.registerHelper('or', function (op1, op2) {
- return op1 || op2;
- });
const pretextTemplate = handlebars_1.default.compile((opts === null || opts === void 0 ? void 0 : opts.pretext) || '');
const titleTemplate = handlebars_1.default.compile((opts === null || opts === void 0 ? void 0 : opts.title) || '');
const defaultText = `${'*<{{{workflowUrl}}}|Workflow _{{workflow}}_ ' +
@@ -353,7 +346,7 @@ exports.send = send;
/***/ }),
-/***/ 7351:
+/***/ 87351:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
@@ -379,7 +372,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.issue = exports.issueCommand = void 0;
-const os = __importStar(__nccwpck_require__(2087));
+const os = __importStar(__nccwpck_require__(12087));
const utils_1 = __nccwpck_require__(5278);
/**
* Commands
@@ -452,7 +445,7 @@ function escapeProperty(s) {
/***/ }),
-/***/ 2186:
+/***/ 42186:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
@@ -487,12 +480,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
-const command_1 = __nccwpck_require__(7351);
+const command_1 = __nccwpck_require__(87351);
const file_command_1 = __nccwpck_require__(717);
const utils_1 = __nccwpck_require__(5278);
-const os = __importStar(__nccwpck_require__(2087));
-const path = __importStar(__nccwpck_require__(5622));
-const oidc_utils_1 = __nccwpck_require__(8041);
+const os = __importStar(__nccwpck_require__(12087));
+const path = __importStar(__nccwpck_require__(85622));
+const oidc_utils_1 = __nccwpck_require__(98041);
/**
* The code to exit an action
*/
@@ -800,8 +793,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.issueCommand = void 0;
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
-const fs = __importStar(__nccwpck_require__(5747));
-const os = __importStar(__nccwpck_require__(2087));
+const fs = __importStar(__nccwpck_require__(35747));
+const os = __importStar(__nccwpck_require__(12087));
const utils_1 = __nccwpck_require__(5278);
function issueCommand(command, message) {
const filePath = process.env[`GITHUB_${command}`];
@@ -820,7 +813,7 @@ exports.issueCommand = issueCommand;
/***/ }),
-/***/ 8041:
+/***/ 98041:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
@@ -836,9 +829,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.OidcClient = void 0;
-const http_client_1 = __nccwpck_require__(9925);
-const auth_1 = __nccwpck_require__(3702);
-const core_1 = __nccwpck_require__(2186);
+const http_client_1 = __nccwpck_require__(39925);
+const auth_1 = __nccwpck_require__(23702);
+const core_1 = __nccwpck_require__(42186);
class OidcClient {
static createHttpClient(allowRetry = true, maxRetry = 10) {
const requestOptions = {
@@ -951,15 +944,15 @@ exports.toCommandProperties = toCommandProperties;
/***/ }),
-/***/ 4087:
+/***/ 74087:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Context = void 0;
-const fs_1 = __nccwpck_require__(5747);
-const os_1 = __nccwpck_require__(2087);
+const fs_1 = __nccwpck_require__(35747);
+const os_1 = __nccwpck_require__(12087);
class Context {
/**
* Hydrate the context from the environment
@@ -1008,7 +1001,7 @@ exports.Context = Context;
/***/ }),
-/***/ 5438:
+/***/ 95438:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
@@ -1034,8 +1027,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getOctokit = exports.context = void 0;
-const Context = __importStar(__nccwpck_require__(4087));
-const utils_1 = __nccwpck_require__(3030);
+const Context = __importStar(__nccwpck_require__(74087));
+const utils_1 = __nccwpck_require__(73030);
exports.context = new Context.Context();
/**
* Returns a hydrated octokit ready to use for GitHub Actions
@@ -1051,7 +1044,7 @@ exports.getOctokit = getOctokit;
/***/ }),
-/***/ 7914:
+/***/ 47914:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
@@ -1077,7 +1070,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0;
-const httpClient = __importStar(__nccwpck_require__(9925));
+const httpClient = __importStar(__nccwpck_require__(39925));
function getAuthString(token, options) {
if (!token && !options.auth) {
throw new Error('Parameter token or opts.auth is required');
@@ -1101,7 +1094,7 @@ exports.getApiBaseUrl = getApiBaseUrl;
/***/ }),
-/***/ 3030:
+/***/ 73030:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
@@ -1127,12 +1120,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getOctokitOptions = exports.GitHub = exports.context = void 0;
-const Context = __importStar(__nccwpck_require__(4087));
-const Utils = __importStar(__nccwpck_require__(7914));
+const Context = __importStar(__nccwpck_require__(74087));
+const Utils = __importStar(__nccwpck_require__(47914));
// octokit + plugins
-const core_1 = __nccwpck_require__(6762);
-const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
-const plugin_paginate_rest_1 = __nccwpck_require__(4193);
+const core_1 = __nccwpck_require__(76762);
+const plugin_rest_endpoint_methods_1 = __nccwpck_require__(83044);
+const plugin_paginate_rest_1 = __nccwpck_require__(64193);
exports.context = new Context.Context();
const baseUrl = Utils.getApiBaseUrl();
const defaults = {
@@ -1162,7 +1155,7 @@ exports.getOctokitOptions = getOctokitOptions;
/***/ }),
-/***/ 3702:
+/***/ 23702:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
@@ -1228,15 +1221,15 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand
/***/ }),
-/***/ 9925:
+/***/ 39925:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
-const http = __nccwpck_require__(8605);
-const https = __nccwpck_require__(7211);
-const pm = __nccwpck_require__(6443);
+const http = __nccwpck_require__(98605);
+const https = __nccwpck_require__(57211);
+const pm = __nccwpck_require__(16443);
let tunnel;
var HttpCodes;
(function (HttpCodes) {
@@ -1655,7 +1648,7 @@ class HttpClient {
if (useProxy) {
// If using proxy, need tunnel
if (!tunnel) {
- tunnel = __nccwpck_require__(4294);
+ tunnel = __nccwpck_require__(74294);
}
const agentOptions = {
maxSockets: maxSockets,
@@ -1773,7 +1766,7 @@ exports.HttpClient = HttpClient;
/***/ }),
-/***/ 6443:
+/***/ 16443:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
@@ -1838,7 +1831,7 @@ exports.checkBypass = checkBypass;
/***/ }),
-/***/ 334:
+/***/ 40334:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
@@ -1895,7 +1888,7 @@ exports.createTokenAuth = createTokenAuth;
/***/ }),
-/***/ 6762:
+/***/ 76762:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
@@ -1903,11 +1896,11 @@ exports.createTokenAuth = createTokenAuth;
Object.defineProperty(exports, "__esModule", ({ value: true }));
-var universalUserAgent = __nccwpck_require__(5030);
-var beforeAfterHook = __nccwpck_require__(3682);
-var request = __nccwpck_require__(6234);
-var graphql = __nccwpck_require__(8467);
-var authToken = __nccwpck_require__(334);
+var universalUserAgent = __nccwpck_require__(45030);
+var beforeAfterHook = __nccwpck_require__(83682);
+var request = __nccwpck_require__(36234);
+var graphql = __nccwpck_require__(88467);
+var authToken = __nccwpck_require__(40334);
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
@@ -2077,7 +2070,7 @@ exports.Octokit = Octokit;
/***/ }),
-/***/ 9440:
+/***/ 59440:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
@@ -2085,8 +2078,8 @@ exports.Octokit = Octokit;
Object.defineProperty(exports, "__esModule", ({ value: true }));
-var isPlainObject = __nccwpck_require__(558);
-var universalUserAgent = __nccwpck_require__(5030);
+var isPlainObject = __nccwpck_require__(70558);
+var universalUserAgent = __nccwpck_require__(45030);
function lowercaseKeys(object) {
if (!object) {
@@ -2475,7 +2468,7 @@ exports.endpoint = endpoint;
/***/ }),
-/***/ 558:
+/***/ 70558:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
@@ -2521,7 +2514,7 @@ exports.isPlainObject = isPlainObject;
/***/ }),
-/***/ 8467:
+/***/ 88467:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
@@ -2529,8 +2522,8 @@ exports.isPlainObject = isPlainObject;
Object.defineProperty(exports, "__esModule", ({ value: true }));
-var request = __nccwpck_require__(6234);
-var universalUserAgent = __nccwpck_require__(5030);
+var request = __nccwpck_require__(36234);
+var universalUserAgent = __nccwpck_require__(45030);
const VERSION = "4.5.7";
@@ -2637,7 +2630,7 @@ exports.withCustomRequest = withCustomRequest;
/***/ }),
-/***/ 4193:
+/***/ 64193:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
@@ -2777,7 +2770,7 @@ exports.paginateRest = paginateRest;
/***/ }),
-/***/ 3044:
+/***/ 83044:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
@@ -3939,7 +3932,7 @@ exports.restEndpointMethods = restEndpointMethods;
/***/ }),
-/***/ 537:
+/***/ 10537:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
@@ -3949,7 +3942,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
-var deprecation = __nccwpck_require__(8932);
+var deprecation = __nccwpck_require__(58932);
var once = _interopDefault(__nccwpck_require__(1223));
const logOnce = once(deprecation => console.warn(deprecation));
@@ -4002,7 +3995,7 @@ exports.RequestError = RequestError;
/***/ }),
-/***/ 6234:
+/***/ 36234:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
@@ -4012,11 +4005,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
-var endpoint = __nccwpck_require__(9440);
-var universalUserAgent = __nccwpck_require__(5030);
-var isPlainObject = __nccwpck_require__(9062);
-var nodeFetch = _interopDefault(__nccwpck_require__(1768));
-var requestError = __nccwpck_require__(537);
+var endpoint = __nccwpck_require__(59440);
+var universalUserAgent = __nccwpck_require__(45030);
+var isPlainObject = __nccwpck_require__(49062);
+var nodeFetch = _interopDefault(__nccwpck_require__(81768));
+var requestError = __nccwpck_require__(10537);
const VERSION = "5.4.10";
@@ -4158,7 +4151,7 @@ exports.request = request;
/***/ }),
-/***/ 9062:
+/***/ 49062:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
@@ -4204,7 +4197,7 @@ exports.isPlainObject = isPlainObject;
/***/ }),
-/***/ 1768:
+/***/ 81768:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
@@ -4214,11 +4207,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
-var Stream = _interopDefault(__nccwpck_require__(2413));
-var http = _interopDefault(__nccwpck_require__(8605));
-var Url = _interopDefault(__nccwpck_require__(8835));
-var https = _interopDefault(__nccwpck_require__(7211));
-var zlib = _interopDefault(__nccwpck_require__(8761));
+var Stream = _interopDefault(__nccwpck_require__(92413));
+var http = _interopDefault(__nccwpck_require__(98605));
+var Url = _interopDefault(__nccwpck_require__(78835));
+var https = _interopDefault(__nccwpck_require__(57211));
+var zlib = _interopDefault(__nccwpck_require__(78761));
// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
@@ -4369,7 +4362,7 @@ FetchError.prototype.name = 'FetchError';
let convert;
try {
- convert = __nccwpck_require__(2877).convert;
+ convert = __nccwpck_require__(22877).convert;
} catch (e) {}
const INTERNALS = Symbol('Body internals');
@@ -5861,7 +5854,7 @@ exports.FetchError = FetchError;
/***/ }),
-/***/ 3178:
+/***/ 33178:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
@@ -5870,9 +5863,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
-const axios_1 = __importDefault(__nccwpck_require__(6545));
-const errors_1 = __nccwpck_require__(8564);
-const instrument_1 = __nccwpck_require__(8645);
+const axios_1 = __importDefault(__nccwpck_require__(96545));
+const errors_1 = __nccwpck_require__(88564);
+const instrument_1 = __nccwpck_require__(98645);
/**
* A client for Slack's Incoming Webhooks
*/
@@ -5939,7 +5932,7 @@ exports.IncomingWebhook = IncomingWebhook;
/***/ }),
-/***/ 8564:
+/***/ 88564:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
@@ -5986,22 +5979,22 @@ exports.httpErrorWithOriginal = httpErrorWithOriginal;
/***/ }),
-/***/ 1095:
+/***/ 81095:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
///
Object.defineProperty(exports, "__esModule", ({ value: true }));
-var IncomingWebhook_1 = __nccwpck_require__(3178);
+var IncomingWebhook_1 = __nccwpck_require__(33178);
exports.IncomingWebhook = IncomingWebhook_1.IncomingWebhook;
-var errors_1 = __nccwpck_require__(8564);
+var errors_1 = __nccwpck_require__(88564);
exports.ErrorCode = errors_1.ErrorCode;
//# sourceMappingURL=index.js.map
/***/ }),
-/***/ 8645:
+/***/ 98645:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
@@ -6014,8 +6007,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
-const os = __importStar(__nccwpck_require__(2087));
-const packageJson = __nccwpck_require__(7716); // tslint:disable-line:no-require-imports no-var-requires
+const os = __importStar(__nccwpck_require__(12087));
+const packageJson = __nccwpck_require__(17716); // tslint:disable-line:no-require-imports no-var-requires
/**
* Replaces occurrences of '/' with ':' in a string, since '/' is meaningful inside User-Agent strings as a separator.
*/
@@ -6048,15890 +6041,70728 @@ exports.getUserAgent = getUserAgent;
/***/ }),
-/***/ 6545:
+/***/ 37967:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-module.exports = __nccwpck_require__(2618);
+"use strict";
+/*!
+ * ansi-green
+ *
+ * Copyright (c) 2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+
+
+var wrap = __nccwpck_require__(62764);
+
+module.exports = function green(message) {
+ return wrap(32, 39, message);
+};
+
/***/ }),
-/***/ 8104:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 62764:
+/***/ ((module) => {
"use strict";
-var utils = __nccwpck_require__(328);
-var settle = __nccwpck_require__(3211);
-var buildFullPath = __nccwpck_require__(1934);
-var buildURL = __nccwpck_require__(646);
-var http = __nccwpck_require__(8605);
-var https = __nccwpck_require__(7211);
-var httpFollow = __nccwpck_require__(7707).http;
-var httpsFollow = __nccwpck_require__(7707).https;
-var url = __nccwpck_require__(8835);
-var zlib = __nccwpck_require__(8761);
-var pkg = __nccwpck_require__(696);
-var createError = __nccwpck_require__(5226);
-var enhanceError = __nccwpck_require__(1516);
+module.exports = function(a, b, msg) {
+ return '\u001b['+ a + 'm' + msg + '\u001b[' + b + 'm';
+};
-var isHttps = /https:?/;
-/*eslint consistent-return:0*/
-module.exports = function httpAdapter(config) {
- return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
- var resolve = function resolve(value) {
- resolvePromise(value);
- };
- var reject = function reject(value) {
- rejectPromise(value);
- };
- var data = config.data;
- var headers = config.headers;
+/***/ }),
- // Set User-Agent (required by some servers)
- // Only set header if it hasn't been set in config
- // See https://github.com/axios/axios/issues/69
- if (!headers['User-Agent'] && !headers['user-agent']) {
- headers['User-Agent'] = 'axios/' + pkg.version;
- }
+/***/ 46505:
+/***/ (function(module) {
- if (data && !utils.isStream(data)) {
- if (Buffer.isBuffer(data)) {
- // Nothing to do...
- } else if (utils.isArrayBuffer(data)) {
- data = Buffer.from(new Uint8Array(data));
- } else if (utils.isString(data)) {
- data = Buffer.from(data, 'utf-8');
- } else {
- return reject(createError(
- 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
- config
- ));
- }
+/*!
+ * Autolinker.js
+ * 0.28.1
+ *
+ * Copyright(c) 2016 Gregory Jacobs
+ * MIT License
+ *
+ * https://github.com/gregjacobs/Autolinker.js
+ */
+;(function(root, factory) {
+ if (typeof define === 'function' && define.amd) {
+ define([], factory);
+ } else if (true) {
+ module.exports = factory();
+ } else {}
+}(this, function() {
+/**
+ * @class Autolinker
+ * @extends Object
+ *
+ * Utility class used to process a given string of text, and wrap the matches in
+ * the appropriate anchor (<a>) tags to turn them into links.
+ *
+ * Any of the configuration options may be provided in an Object (map) provided
+ * to the Autolinker constructor, which will configure how the {@link #link link()}
+ * method will process the links.
+ *
+ * For example:
+ *
+ * var autolinker = new Autolinker( {
+ * newWindow : false,
+ * truncate : 30
+ * } );
+ *
+ * var html = autolinker.link( "Joe went to www.yahoo.com" );
+ * // produces: 'Joe went to yahoo.com'
+ *
+ *
+ * The {@link #static-link static link()} method may also be used to inline
+ * options into a single call, which may be more convenient for one-off uses.
+ * For example:
+ *
+ * var html = Autolinker.link( "Joe went to www.yahoo.com", {
+ * newWindow : false,
+ * truncate : 30
+ * } );
+ * // produces: 'Joe went to yahoo.com'
+ *
+ *
+ * ## Custom Replacements of Links
+ *
+ * If the configuration options do not provide enough flexibility, a {@link #replaceFn}
+ * may be provided to fully customize the output of Autolinker. This function is
+ * called once for each URL/Email/Phone#/Twitter Handle/Hashtag match that is
+ * encountered.
+ *
+ * For example:
+ *
+ * var input = "..."; // string with URLs, Email Addresses, Phone #s, Twitter Handles, and Hashtags
+ *
+ * var linkedText = Autolinker.link( input, {
+ * replaceFn : function( autolinker, match ) {
+ * console.log( "href = ", match.getAnchorHref() );
+ * console.log( "text = ", match.getAnchorText() );
+ *
+ * switch( match.getType() ) {
+ * case 'url' :
+ * console.log( "url: ", match.getUrl() );
+ *
+ * if( match.getUrl().indexOf( 'mysite.com' ) === -1 ) {
+ * var tag = autolinker.getTagBuilder().build( match ); // returns an `Autolinker.HtmlTag` instance, which provides mutator methods for easy changes
+ * tag.setAttr( 'rel', 'nofollow' );
+ * tag.addClass( 'external-link' );
+ *
+ * return tag;
+ *
+ * } else {
+ * return true; // let Autolinker perform its normal anchor tag replacement
+ * }
+ *
+ * case 'email' :
+ * var email = match.getEmail();
+ * console.log( "email: ", email );
+ *
+ * if( email === "my@own.address" ) {
+ * return false; // don't auto-link this particular email address; leave as-is
+ * } else {
+ * return; // no return value will have Autolinker perform its normal anchor tag replacement (same as returning `true`)
+ * }
+ *
+ * case 'phone' :
+ * var phoneNumber = match.getPhoneNumber();
+ * console.log( phoneNumber );
+ *
+ * return '' + phoneNumber + '';
+ *
+ * case 'twitter' :
+ * var twitterHandle = match.getTwitterHandle();
+ * console.log( twitterHandle );
+ *
+ * return '' + twitterHandle + '';
+ *
+ * case 'hashtag' :
+ * var hashtag = match.getHashtag();
+ * console.log( hashtag );
+ *
+ * return '' + hashtag + '';
+ * }
+ * }
+ * } );
+ *
+ *
+ * The function may return the following values:
+ *
+ * - `true` (Boolean): Allow Autolinker to replace the match as it normally
+ * would.
+ * - `false` (Boolean): Do not replace the current match at all - leave as-is.
+ * - Any String: If a string is returned from the function, the string will be
+ * used directly as the replacement HTML for the match.
+ * - An {@link Autolinker.HtmlTag} instance, which can be used to build/modify
+ * an HTML tag before writing out its HTML text.
+ *
+ * @constructor
+ * @param {Object} [cfg] The configuration options for the Autolinker instance,
+ * specified in an Object (map).
+ */
+var Autolinker = function( cfg ) {
+ cfg = cfg || {};
+
+ this.version = Autolinker.version;
+
+ this.urls = this.normalizeUrlsCfg( cfg.urls );
+ this.email = typeof cfg.email === 'boolean' ? cfg.email : true;
+ this.twitter = typeof cfg.twitter === 'boolean' ? cfg.twitter : true;
+ this.phone = typeof cfg.phone === 'boolean' ? cfg.phone : true;
+ this.hashtag = cfg.hashtag || false;
+ this.newWindow = typeof cfg.newWindow === 'boolean' ? cfg.newWindow : true;
+ this.stripPrefix = typeof cfg.stripPrefix === 'boolean' ? cfg.stripPrefix : true;
+
+ // Validate the value of the `hashtag` cfg.
+ var hashtag = this.hashtag;
+ if( hashtag !== false && hashtag !== 'twitter' && hashtag !== 'facebook' && hashtag !== 'instagram' ) {
+ throw new Error( "invalid `hashtag` cfg - see docs" );
+ }
- // Add Content-Length header if data exists
- headers['Content-Length'] = data.length;
- }
+ this.truncate = this.normalizeTruncateCfg( cfg.truncate );
+ this.className = cfg.className || '';
+ this.replaceFn = cfg.replaceFn || null;
- // HTTP basic authentication
- var auth = undefined;
- if (config.auth) {
- var username = config.auth.username || '';
- var password = config.auth.password || '';
- auth = username + ':' + password;
- }
+ this.htmlParser = null;
+ this.matchers = null;
+ this.tagBuilder = null;
+};
- // Parse url
- var fullPath = buildFullPath(config.baseURL, config.url);
- var parsed = url.parse(fullPath);
- var protocol = parsed.protocol || 'http:';
- if (!auth && parsed.auth) {
- var urlAuth = parsed.auth.split(':');
- var urlUsername = urlAuth[0] || '';
- var urlPassword = urlAuth[1] || '';
- auth = urlUsername + ':' + urlPassword;
- }
- if (auth) {
- delete headers.Authorization;
- }
+/**
+ * Automatically links URLs, Email addresses, Phone Numbers, Twitter handles,
+ * and Hashtags found in the given chunk of HTML. Does not link URLs found
+ * within HTML tags.
+ *
+ * For instance, if given the text: `You should go to http://www.yahoo.com`,
+ * then the result will be `You should go to <a href="http://www.yahoo.com">http://www.yahoo.com</a>`
+ *
+ * Example:
+ *
+ * var linkedText = Autolinker.link( "Go to google.com", { newWindow: false } );
+ * // Produces: "Go to google.com"
+ *
+ * @static
+ * @param {String} textOrHtml The HTML or text to find matches within (depending
+ * on if the {@link #urls}, {@link #email}, {@link #phone}, {@link #twitter},
+ * and {@link #hashtag} options are enabled).
+ * @param {Object} [options] Any of the configuration options for the Autolinker
+ * class, specified in an Object (map). See the class description for an
+ * example call.
+ * @return {String} The HTML text, with matches automatically linked.
+ */
+Autolinker.link = function( textOrHtml, options ) {
+ var autolinker = new Autolinker( options );
+ return autolinker.link( textOrHtml );
+};
- var isHttpsRequest = isHttps.test(protocol);
- var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
- var options = {
- path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''),
- method: config.method.toUpperCase(),
- headers: headers,
- agent: agent,
- agents: { http: config.httpAgent, https: config.httpsAgent },
- auth: auth
- };
+/**
+ * @static
+ * @property {String} version (readonly)
+ *
+ * The Autolinker version number in the form major.minor.patch
+ *
+ * Ex: 0.25.1
+ */
+Autolinker.version = '0.28.1';
- if (config.socketPath) {
- options.socketPath = config.socketPath;
- } else {
- options.hostname = parsed.hostname;
- options.port = parsed.port;
- }
- var proxy = config.proxy;
- if (!proxy && proxy !== false) {
- var proxyEnv = protocol.slice(0, -1) + '_proxy';
- var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];
- if (proxyUrl) {
- var parsedProxyUrl = url.parse(proxyUrl);
- var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;
- var shouldProxy = true;
+Autolinker.prototype = {
+ constructor : Autolinker, // fix constructor property
- if (noProxyEnv) {
- var noProxy = noProxyEnv.split(',').map(function trim(s) {
- return s.trim();
- });
+ /**
+ * @cfg {Boolean/Object} [urls=true]
+ *
+ * `true` if URLs should be automatically linked, `false` if they should not
+ * be.
+ *
+ * This option also accepts an Object form with 3 properties, to allow for
+ * more customization of what exactly gets linked. All default to `true`:
+ *
+ * @param {Boolean} schemeMatches `true` to match URLs found prefixed with a
+ * scheme, i.e. `http://google.com`, or `other+scheme://google.com`,
+ * `false` to prevent these types of matches.
+ * @param {Boolean} wwwMatches `true` to match urls found prefixed with
+ * `'www.'`, i.e. `www.google.com`. `false` to prevent these types of
+ * matches. Note that if the URL had a prefixed scheme, and
+ * `schemeMatches` is true, it will still be linked.
+ * @param {Boolean} tldMatches `true` to match URLs with known top level
+ * domains (.com, .net, etc.) that are not prefixed with a scheme or
+ * `'www.'`. This option attempts to match anything that looks like a URL
+ * in the given text. Ex: `google.com`, `asdf.org/?page=1`, etc. `false`
+ * to prevent these types of matches.
+ */
- shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {
- if (!proxyElement) {
- return false;
- }
- if (proxyElement === '*') {
- return true;
- }
- if (proxyElement[0] === '.' &&
- parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {
- return true;
- }
+ /**
+ * @cfg {Boolean} [email=true]
+ *
+ * `true` if email addresses should be automatically linked, `false` if they
+ * should not be.
+ */
- return parsed.hostname === proxyElement;
- });
- }
+ /**
+ * @cfg {Boolean} [twitter=true]
+ *
+ * `true` if Twitter handles ("@example") should be automatically linked,
+ * `false` if they should not be.
+ */
+ /**
+ * @cfg {Boolean} [phone=true]
+ *
+ * `true` if Phone numbers ("(555)555-5555") should be automatically linked,
+ * `false` if they should not be.
+ */
- if (shouldProxy) {
- proxy = {
- host: parsedProxyUrl.hostname,
- port: parsedProxyUrl.port
- };
+ /**
+ * @cfg {Boolean/String} [hashtag=false]
+ *
+ * A string for the service name to have hashtags (ex: "#myHashtag")
+ * auto-linked to. The currently-supported values are:
+ *
+ * - 'twitter'
+ * - 'facebook'
+ * - 'instagram'
+ *
+ * Pass `false` to skip auto-linking of hashtags.
+ */
- if (parsedProxyUrl.auth) {
- var proxyUrlAuth = parsedProxyUrl.auth.split(':');
- proxy.auth = {
- username: proxyUrlAuth[0],
- password: proxyUrlAuth[1]
- };
- }
- }
- }
- }
+ /**
+ * @cfg {Boolean} [newWindow=true]
+ *
+ * `true` if the links should open in a new window, `false` otherwise.
+ */
- if (proxy) {
- options.hostname = proxy.host;
- options.host = proxy.host;
- options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');
- options.port = proxy.port;
- options.path = protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path;
+ /**
+ * @cfg {Boolean} [stripPrefix=true]
+ *
+ * `true` if 'http://' or 'https://' and/or the 'www.' should be stripped
+ * from the beginning of URL links' text, `false` otherwise.
+ */
- // Basic proxy authorization
- if (proxy.auth) {
- var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');
- options.headers['Proxy-Authorization'] = 'Basic ' + base64;
- }
- }
+ /**
+ * @cfg {Number/Object} [truncate=0]
+ *
+ * ## Number Form
+ *
+ * A number for how many characters matched text should be truncated to
+ * inside the text of a link. If the matched text is over this number of
+ * characters, it will be truncated to this length by adding a two period
+ * ellipsis ('..') to the end of the string.
+ *
+ * For example: A url like 'http://www.yahoo.com/some/long/path/to/a/file'
+ * truncated to 25 characters might look something like this:
+ * 'yahoo.com/some/long/pat..'
+ *
+ * Example Usage:
+ *
+ * truncate: 25
+ *
+ *
+ * Defaults to `0` for "no truncation."
+ *
+ *
+ * ## Object Form
+ *
+ * An Object may also be provided with two properties: `length` (Number) and
+ * `location` (String). `location` may be one of the following: 'end'
+ * (default), 'middle', or 'smart'.
+ *
+ * Example Usage:
+ *
+ * truncate: { length: 25, location: 'middle' }
+ *
+ * @cfg {Number} [truncate.length=0] How many characters to allow before
+ * truncation will occur. Defaults to `0` for "no truncation."
+ * @cfg {"end"/"middle"/"smart"} [truncate.location="end"]
+ *
+ * - 'end' (default): will truncate up to the number of characters, and then
+ * add an ellipsis at the end. Ex: 'yahoo.com/some/long/pat..'
+ * - 'middle': will truncate and add the ellipsis in the middle. Ex:
+ * 'yahoo.com/s..th/to/a/file'
+ * - 'smart': for URLs where the algorithm attempts to strip out unnecessary
+ * parts first (such as the 'www.', then URL scheme, hash, etc.),
+ * attempting to make the URL human-readable before looking for a good
+ * point to insert the ellipsis if it is still too long. Ex:
+ * 'yahoo.com/some..to/a/file'. For more details, see
+ * {@link Autolinker.truncate.TruncateSmart}.
+ */
- var transport;
- var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);
- if (config.transport) {
- transport = config.transport;
- } else if (config.maxRedirects === 0) {
- transport = isHttpsProxy ? https : http;
- } else {
- if (config.maxRedirects) {
- options.maxRedirects = config.maxRedirects;
- }
- transport = isHttpsProxy ? httpsFollow : httpFollow;
- }
+ /**
+ * @cfg {String} className
+ *
+ * A CSS class name to add to the generated links. This class will be added
+ * to all links, as well as this class plus match suffixes for styling
+ * url/email/phone/twitter/hashtag links differently.
+ *
+ * For example, if this config is provided as "myLink", then:
+ *
+ * - URL links will have the CSS classes: "myLink myLink-url"
+ * - Email links will have the CSS classes: "myLink myLink-email", and
+ * - Twitter links will have the CSS classes: "myLink myLink-twitter"
+ * - Phone links will have the CSS classes: "myLink myLink-phone"
+ * - Hashtag links will have the CSS classes: "myLink myLink-hashtag"
+ */
- if (config.maxContentLength && config.maxContentLength > -1) {
- options.maxBodyLength = config.maxContentLength;
- }
+ /**
+ * @cfg {Function} replaceFn
+ *
+ * A function to individually process each match found in the input string.
+ *
+ * See the class's description for usage.
+ *
+ * This function is called with the following parameters:
+ *
+ * @cfg {Autolinker} replaceFn.autolinker The Autolinker instance, which may
+ * be used to retrieve child objects from (such as the instance's
+ * {@link #getTagBuilder tag builder}).
+ * @cfg {Autolinker.match.Match} replaceFn.match The Match instance which
+ * can be used to retrieve information about the match that the `replaceFn`
+ * is currently processing. See {@link Autolinker.match.Match} subclasses
+ * for details.
+ */
- // Create the request
- var req = transport.request(options, function handleResponse(res) {
- if (req.aborted) return;
- // uncompress the response body transparently if required
- var stream = res;
- switch (res.headers['content-encoding']) {
- /*eslint default-case:0*/
- case 'gzip':
- case 'compress':
- case 'deflate':
- // add the unzipper to the body stream processing pipeline
- stream = (res.statusCode === 204) ? stream : stream.pipe(zlib.createUnzip());
+ /**
+ * @property {String} version (readonly)
+ *
+ * The Autolinker version number in the form major.minor.patch
+ *
+ * Ex: 0.25.1
+ */
- // remove the content-encoding in order to not confuse downstream operations
- delete res.headers['content-encoding'];
- break;
- }
+ /**
+ * @private
+ * @property {Autolinker.htmlParser.HtmlParser} htmlParser
+ *
+ * The HtmlParser instance used to skip over HTML tags, while finding text
+ * nodes to process. This is lazily instantiated in the {@link #getHtmlParser}
+ * method.
+ */
- // return the last request in case of redirects
- var lastRequest = res.req || req;
+ /**
+ * @private
+ * @property {Autolinker.matcher.Matcher[]} matchers
+ *
+ * The {@link Autolinker.matcher.Matcher} instances for this Autolinker
+ * instance.
+ *
+ * This is lazily created in {@link #getMatchers}.
+ */
- var response = {
- status: res.statusCode,
- statusText: res.statusMessage,
- headers: res.headers,
- config: config,
- request: lastRequest
- };
+ /**
+ * @private
+ * @property {Autolinker.AnchorTagBuilder} tagBuilder
+ *
+ * The AnchorTagBuilder instance used to build match replacement anchor tags.
+ * Note: this is lazily instantiated in the {@link #getTagBuilder} method.
+ */
- if (config.responseType === 'stream') {
- response.data = stream;
- settle(resolve, reject, response);
- } else {
- var responseBuffer = [];
- stream.on('data', function handleStreamData(chunk) {
- responseBuffer.push(chunk);
- // make sure the content length is not over the maxContentLength if specified
- if (config.maxContentLength > -1 && Buffer.concat(responseBuffer).length > config.maxContentLength) {
- stream.destroy();
- reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
- config, null, lastRequest));
- }
- });
+ /**
+ * Normalizes the {@link #urls} config into an Object with 3 properties:
+ * `schemeMatches`, `wwwMatches`, and `tldMatches`, all Booleans.
+ *
+ * See {@link #urls} config for details.
+ *
+ * @private
+ * @param {Boolean/Object} urls
+ * @return {Object}
+ */
+ normalizeUrlsCfg : function( urls ) {
+ if( urls == null ) urls = true; // default to `true`
+
+ if( typeof urls === 'boolean' ) {
+ return { schemeMatches: urls, wwwMatches: urls, tldMatches: urls };
+
+ } else { // object form
+ return {
+ schemeMatches : typeof urls.schemeMatches === 'boolean' ? urls.schemeMatches : true,
+ wwwMatches : typeof urls.wwwMatches === 'boolean' ? urls.wwwMatches : true,
+ tldMatches : typeof urls.tldMatches === 'boolean' ? urls.tldMatches : true
+ };
+ }
+ },
- stream.on('error', function handleStreamError(err) {
- if (req.aborted) return;
- reject(enhanceError(err, config, null, lastRequest));
- });
- stream.on('end', function handleStreamEnd() {
- var responseData = Buffer.concat(responseBuffer);
- if (config.responseType !== 'arraybuffer') {
- responseData = responseData.toString(config.responseEncoding);
- }
+ /**
+ * Normalizes the {@link #truncate} config into an Object with 2 properties:
+ * `length` (Number), and `location` (String).
+ *
+ * See {@link #truncate} config for details.
+ *
+ * @private
+ * @param {Number/Object} truncate
+ * @return {Object}
+ */
+ normalizeTruncateCfg : function( truncate ) {
+ if( typeof truncate === 'number' ) {
+ return { length: truncate, location: 'end' };
+
+ } else { // object, or undefined/null
+ return Autolinker.Util.defaults( truncate || {}, {
+ length : Number.POSITIVE_INFINITY,
+ location : 'end'
+ } );
+ }
+ },
- response.data = responseData;
- settle(resolve, reject, response);
- });
- }
- });
- // Handle errors
- req.on('error', function handleRequestError(err) {
- if (req.aborted) return;
- reject(enhanceError(err, config, null, req));
- });
+ /**
+ * Parses the input `textOrHtml` looking for URLs, email addresses, phone
+ * numbers, username handles, and hashtags (depending on the configuration
+ * of the Autolinker instance), and returns an array of {@link Autolinker.match.Match}
+ * objects describing those matches.
+ *
+ * This method is used by the {@link #link} method, but can also be used to
+ * simply do parsing of the input in order to discover what kinds of links
+ * there are and how many.
+ *
+ * @param {String} textOrHtml The HTML or text to find matches within
+ * (depending on if the {@link #urls}, {@link #email}, {@link #phone},
+ * {@link #twitter}, and {@link #hashtag} options are enabled).
+ * @return {Autolinker.match.Match[]} The array of Matches found in the
+ * given input `textOrHtml`.
+ */
+ parse : function( textOrHtml ) {
+ var htmlParser = this.getHtmlParser(),
+ htmlNodes = htmlParser.parse( textOrHtml ),
+ anchorTagStackCount = 0, // used to only process text around anchor tags, and any inner text/html they may have;
+ matches = [];
+
+ // Find all matches within the `textOrHtml` (but not matches that are
+ // already nested within tags)
+ for( var i = 0, len = htmlNodes.length; i < len; i++ ) {
+ var node = htmlNodes[ i ],
+ nodeType = node.getType();
+
+ if( nodeType === 'element' && node.getTagName() === 'a' ) { // Process HTML anchor element nodes in the input `textOrHtml` to find out when we're within an tag
+ if( !node.isClosing() ) { // it's the start tag
+ anchorTagStackCount++;
+ } else { // it's the end tag
+ anchorTagStackCount = Math.max( anchorTagStackCount - 1, 0 ); // attempt to handle extraneous tags by making sure the stack count never goes below 0
+ }
- // Handle request timeout
- if (config.timeout) {
- // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
- // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
- // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
- // And then these socket which be hang up will devoring CPU little by little.
- // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
- req.setTimeout(config.timeout, function handleRequestTimeout() {
- req.abort();
- reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', req));
- });
- }
+ } else if( nodeType === 'text' && anchorTagStackCount === 0 ) { // Process text nodes that are not within an tag
+ var textNodeMatches = this.parseText( node.getText(), node.getOffset() );
- if (config.cancelToken) {
- // Handle cancellation
- config.cancelToken.promise.then(function onCanceled(cancel) {
- if (req.aborted) return;
+ matches.push.apply( matches, textNodeMatches );
+ }
+ }
- req.abort();
- reject(cancel);
- });
- }
- // Send the request
- if (utils.isStream(data)) {
- data.on('error', function handleStreamError(err) {
- reject(enhanceError(err, config, null, req));
- }).pipe(req);
- } else {
- req.end(data);
- }
- });
-};
+ // After we have found all matches, remove subsequent matches that
+ // overlap with a previous match. This can happen for instance with URLs,
+ // where the url 'google.com/#link' would match '#link' as a hashtag.
+ matches = this.compactMatches( matches );
+ // And finally, remove matches for match types that have been turned
+ // off. We needed to have all match types turned on initially so that
+ // things like hashtags could be filtered out if they were really just
+ // part of a URL match (for instance, as a named anchor).
+ matches = this.removeUnwantedMatches( matches );
-/***/ }),
+ return matches;
+ },
-/***/ 3454:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+ /**
+ * After we have found all matches, we need to remove subsequent matches
+ * that overlap with a previous match. This can happen for instance with
+ * URLs, where the url 'google.com/#link' would match '#link' as a hashtag.
+ *
+ * @private
+ * @param {Autolinker.match.Match[]} matches
+ * @return {Autolinker.match.Match[]}
+ */
+ compactMatches : function( matches ) {
+ // First, the matches need to be sorted in order of offset
+ matches.sort( function( a, b ) { return a.getOffset() - b.getOffset(); } );
+
+ for( var i = 0; i < matches.length - 1; i++ ) {
+ var match = matches[ i ],
+ endIdx = match.getOffset() + match.getMatchedText().length;
+
+ // Remove subsequent matches that overlap with the current match
+ while( i + 1 < matches.length && matches[ i + 1 ].getOffset() <= endIdx ) {
+ matches.splice( i + 1, 1 );
+ }
+ }
+ return matches;
+ },
-var utils = __nccwpck_require__(328);
-var settle = __nccwpck_require__(3211);
-var buildURL = __nccwpck_require__(646);
-var buildFullPath = __nccwpck_require__(1934);
-var parseHeaders = __nccwpck_require__(6455);
-var isURLSameOrigin = __nccwpck_require__(3608);
-var createError = __nccwpck_require__(5226);
-module.exports = function xhrAdapter(config) {
- return new Promise(function dispatchXhrRequest(resolve, reject) {
- var requestData = config.data;
- var requestHeaders = config.headers;
+ /**
+ * Removes matches for matchers that were turned off in the options. For
+ * example, if {@link #hashtag hashtags} were not to be matched, we'll
+ * remove them from the `matches` array here.
+ *
+ * @private
+ * @param {Autolinker.match.Match[]} matches The array of matches to remove
+ * the unwanted matches from. Note: this array is mutated for the
+ * removals.
+ * @return {Autolinker.match.Match[]} The mutated input `matches` array.
+ */
+ removeUnwantedMatches : function( matches ) {
+ var remove = Autolinker.Util.remove;
+
+ if( !this.hashtag ) remove( matches, function( match ) { return match.getType() === 'hashtag'; } );
+ if( !this.email ) remove( matches, function( match ) { return match.getType() === 'email'; } );
+ if( !this.phone ) remove( matches, function( match ) { return match.getType() === 'phone'; } );
+ if( !this.twitter ) remove( matches, function( match ) { return match.getType() === 'twitter'; } );
+ if( !this.urls.schemeMatches ) {
+ remove( matches, function( m ) { return m.getType() === 'url' && m.getUrlMatchType() === 'scheme'; } );
+ }
+ if( !this.urls.wwwMatches ) {
+ remove( matches, function( m ) { return m.getType() === 'url' && m.getUrlMatchType() === 'www'; } );
+ }
+ if( !this.urls.tldMatches ) {
+ remove( matches, function( m ) { return m.getType() === 'url' && m.getUrlMatchType() === 'tld'; } );
+ }
- if (utils.isFormData(requestData)) {
- delete requestHeaders['Content-Type']; // Let the browser set it
- }
+ return matches;
+ },
- var request = new XMLHttpRequest();
- // HTTP basic authentication
- if (config.auth) {
- var username = config.auth.username || '';
- var password = config.auth.password || '';
- requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
- }
+ /**
+ * Parses the input `text` looking for URLs, email addresses, phone
+ * numbers, username handles, and hashtags (depending on the configuration
+ * of the Autolinker instance), and returns an array of {@link Autolinker.match.Match}
+ * objects describing those matches.
+ *
+ * This method processes a **non-HTML string**, and is used to parse and
+ * match within the text nodes of an HTML string. This method is used
+ * internally by {@link #parse}.
+ *
+ * @private
+ * @param {String} text The text to find matches within (depending on if the
+ * {@link #urls}, {@link #email}, {@link #phone}, {@link #twitter}, and
+ * {@link #hashtag} options are enabled). This must be a non-HTML string.
+ * @param {Number} [offset=0] The offset of the text node within the
+ * original string. This is used when parsing with the {@link #parse}
+ * method to generate correct offsets within the {@link Autolinker.match.Match}
+ * instances, but may be omitted if calling this method publicly.
+ * @return {Autolinker.match.Match[]} The array of Matches found in the
+ * given input `text`.
+ */
+ parseText : function( text, offset ) {
+ offset = offset || 0;
+ var matchers = this.getMatchers(),
+ matches = [];
+
+ for( var i = 0, numMatchers = matchers.length; i < numMatchers; i++ ) {
+ var textMatches = matchers[ i ].parseMatches( text );
+
+ // Correct the offset of each of the matches. They are originally
+ // the offset of the match within the provided text node, but we
+ // need to correct them to be relative to the original HTML input
+ // string (i.e. the one provided to #parse).
+ for( var j = 0, numTextMatches = textMatches.length; j < numTextMatches; j++ ) {
+ textMatches[ j ].setOffset( offset + textMatches[ j ].getOffset() );
+ }
- var fullPath = buildFullPath(config.baseURL, config.url);
- request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
+ matches.push.apply( matches, textMatches );
+ }
+ return matches;
+ },
- // Set the request timeout in MS
- request.timeout = config.timeout;
- // Listen for ready state
- request.onreadystatechange = function handleLoad() {
- if (!request || request.readyState !== 4) {
- return;
- }
+ /**
+ * Automatically links URLs, Email addresses, Phone numbers, Twitter
+ * handles, and Hashtags found in the given chunk of HTML. Does not link
+ * URLs found within HTML tags.
+ *
+ * For instance, if given the text: `You should go to http://www.yahoo.com`,
+ * then the result will be `You should go to
+ * <a href="http://www.yahoo.com">http://www.yahoo.com</a>`
+ *
+ * This method finds the text around any HTML elements in the input
+ * `textOrHtml`, which will be the text that is processed. Any original HTML
+ * elements will be left as-is, as well as the text that is already wrapped
+ * in anchor (<a>) tags.
+ *
+ * @param {String} textOrHtml The HTML or text to autolink matches within
+ * (depending on if the {@link #urls}, {@link #email}, {@link #phone},
+ * {@link #twitter}, and {@link #hashtag} options are enabled).
+ * @return {String} The HTML, with matches automatically linked.
+ */
+ link : function( textOrHtml ) {
+ if( !textOrHtml ) { return ""; } // handle `null` and `undefined`
+
+ var matches = this.parse( textOrHtml ),
+ newHtml = [],
+ lastIndex = 0;
+
+ for( var i = 0, len = matches.length; i < len; i++ ) {
+ var match = matches[ i ];
+
+ newHtml.push( textOrHtml.substring( lastIndex, match.getOffset() ) );
+ newHtml.push( this.createMatchReturnVal( match ) );
+
+ lastIndex = match.getOffset() + match.getMatchedText().length;
+ }
+ newHtml.push( textOrHtml.substring( lastIndex ) ); // handle the text after the last match
- // The request errored out and we didn't get a response, this will be
- // handled by onerror instead
- // With one exception: request that using file: protocol, most browsers
- // will return status as 0 even though it's a successful request
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
- return;
- }
+ return newHtml.join( '' );
+ },
- // Prepare the response
- var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
- var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
- var response = {
- data: responseData,
- status: request.status,
- statusText: request.statusText,
- headers: responseHeaders,
- config: config,
- request: request
- };
- settle(resolve, reject, response);
+ /**
+ * Creates the return string value for a given match in the input string.
+ *
+ * This method handles the {@link #replaceFn}, if one was provided.
+ *
+ * @private
+ * @param {Autolinker.match.Match} match The Match object that represents
+ * the match.
+ * @return {String} The string that the `match` should be replaced with.
+ * This is usually the anchor tag string, but may be the `matchStr` itself
+ * if the match is not to be replaced.
+ */
+ createMatchReturnVal : function( match ) {
+ // Handle a custom `replaceFn` being provided
+ var replaceFnResult;
+ if( this.replaceFn ) {
+ replaceFnResult = this.replaceFn.call( this, this, match ); // Autolinker instance is the context, and the first arg
+ }
- // Clean up request
- request = null;
- };
+ if( typeof replaceFnResult === 'string' ) {
+ return replaceFnResult; // `replaceFn` returned a string, use that
- // Handle browser request cancellation (as opposed to a manual cancellation)
- request.onabort = function handleAbort() {
- if (!request) {
- return;
- }
+ } else if( replaceFnResult === false ) {
+ return match.getMatchedText(); // no replacement for the match
- reject(createError('Request aborted', config, 'ECONNABORTED', request));
+ } else if( replaceFnResult instanceof Autolinker.HtmlTag ) {
+ return replaceFnResult.toAnchorString();
- // Clean up request
- request = null;
- };
+ } else { // replaceFnResult === true, or no/unknown return value from function
+ // Perform Autolinker's default anchor tag generation
+ var anchorTag = match.buildTag(); // returns an Autolinker.HtmlTag instance
- // Handle low level network errors
- request.onerror = function handleError() {
- // Real errors are hidden from us by the browser
- // onerror should only fire if it's a network error
- reject(createError('Network Error', config, null, request));
+ return anchorTag.toAnchorString();
+ }
+ },
- // Clean up request
- request = null;
- };
- // Handle timeout
- request.ontimeout = function handleTimeout() {
- var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
- if (config.timeoutErrorMessage) {
- timeoutErrorMessage = config.timeoutErrorMessage;
- }
- reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
- request));
+ /**
+ * Lazily instantiates and returns the {@link #htmlParser} instance for this
+ * Autolinker instance.
+ *
+ * @protected
+ * @return {Autolinker.htmlParser.HtmlParser}
+ */
+ getHtmlParser : function() {
+ var htmlParser = this.htmlParser;
+
+ if( !htmlParser ) {
+ htmlParser = this.htmlParser = new Autolinker.htmlParser.HtmlParser();
+ }
- // Clean up request
- request = null;
- };
+ return htmlParser;
+ },
- // Add xsrf header
- // This is only done if running in a standard browser environment.
- // Specifically not if we're in a web worker, or react-native.
- if (utils.isStandardBrowserEnv()) {
- var cookies = __nccwpck_require__(1545);
- // Add xsrf header
- var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
- cookies.read(config.xsrfCookieName) :
- undefined;
+ /**
+ * Lazily instantiates and returns the {@link Autolinker.matcher.Matcher}
+ * instances for this Autolinker instance.
+ *
+ * @protected
+ * @return {Autolinker.matcher.Matcher[]}
+ */
+ getMatchers : function() {
+ if( !this.matchers ) {
+ var matchersNs = Autolinker.matcher,
+ tagBuilder = this.getTagBuilder();
+
+ var matchers = [
+ new matchersNs.Hashtag( { tagBuilder: tagBuilder, serviceName: this.hashtag } ),
+ new matchersNs.Email( { tagBuilder: tagBuilder } ),
+ new matchersNs.Phone( { tagBuilder: tagBuilder } ),
+ new matchersNs.Twitter( { tagBuilder: tagBuilder } ),
+ new matchersNs.Url( { tagBuilder: tagBuilder, stripPrefix: this.stripPrefix } )
+ ];
+
+ return ( this.matchers = matchers );
- if (xsrfValue) {
- requestHeaders[config.xsrfHeaderName] = xsrfValue;
- }
- }
+ } else {
+ return this.matchers;
+ }
+ },
- // Add headers to the request
- if ('setRequestHeader' in request) {
- utils.forEach(requestHeaders, function setRequestHeader(val, key) {
- if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
- // Remove Content-Type if data is undefined
- delete requestHeaders[key];
- } else {
- // Otherwise add header to the request
- request.setRequestHeader(key, val);
- }
- });
- }
- // Add withCredentials to request if needed
- if (!utils.isUndefined(config.withCredentials)) {
- request.withCredentials = !!config.withCredentials;
- }
+ /**
+ * Returns the {@link #tagBuilder} instance for this Autolinker instance, lazily instantiating it
+ * if it does not yet exist.
+ *
+ * This method may be used in a {@link #replaceFn} to generate the {@link Autolinker.HtmlTag HtmlTag} instance that
+ * Autolinker would normally generate, and then allow for modifications before returning it. For example:
+ *
+ * var html = Autolinker.link( "Test google.com", {
+ * replaceFn : function( autolinker, match ) {
+ * var tag = autolinker.getTagBuilder().build( match ); // returns an {@link Autolinker.HtmlTag} instance
+ * tag.setAttr( 'rel', 'nofollow' );
+ *
+ * return tag;
+ * }
+ * } );
+ *
+ * // generated html:
+ * // Test google.com
+ *
+ * @return {Autolinker.AnchorTagBuilder}
+ */
+ getTagBuilder : function() {
+ var tagBuilder = this.tagBuilder;
+
+ if( !tagBuilder ) {
+ tagBuilder = this.tagBuilder = new Autolinker.AnchorTagBuilder( {
+ newWindow : this.newWindow,
+ truncate : this.truncate,
+ className : this.className
+ } );
+ }
- // Add responseType to request if needed
- if (config.responseType) {
- try {
- request.responseType = config.responseType;
- } catch (e) {
- // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
- // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
- if (config.responseType !== 'json') {
- throw e;
- }
- }
- }
+ return tagBuilder;
+ }
- // Handle progress if needed
- if (typeof config.onDownloadProgress === 'function') {
- request.addEventListener('progress', config.onDownloadProgress);
- }
+};
- // Not all browsers support upload events
- if (typeof config.onUploadProgress === 'function' && request.upload) {
- request.upload.addEventListener('progress', config.onUploadProgress);
- }
- if (config.cancelToken) {
- // Handle cancellation
- config.cancelToken.promise.then(function onCanceled(cancel) {
- if (!request) {
- return;
- }
+// Autolinker Namespaces
- request.abort();
- reject(cancel);
- // Clean up request
- request = null;
- });
- }
+Autolinker.match = {};
+Autolinker.matcher = {};
+Autolinker.htmlParser = {};
+Autolinker.truncate = {};
- if (requestData === undefined) {
- requestData = null;
- }
+/*global Autolinker */
+/*jshint eqnull:true, boss:true */
+/**
+ * @class Autolinker.Util
+ * @singleton
+ *
+ * A few utility methods for Autolinker.
+ */
+Autolinker.Util = {
- // Send the request
- request.send(requestData);
- });
-};
+ /**
+ * @property {Function} abstractMethod
+ *
+ * A function object which represents an abstract method.
+ */
+ abstractMethod : function() { throw "abstract"; },
-/***/ }),
+ /**
+ * @private
+ * @property {RegExp} trimRegex
+ *
+ * The regular expression used to trim the leading and trailing whitespace
+ * from a string.
+ */
+ trimRegex : /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-/***/ 2618:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+ /**
+ * Assigns (shallow copies) the properties of `src` onto `dest`.
+ *
+ * @param {Object} dest The destination object.
+ * @param {Object} src The source object.
+ * @return {Object} The destination object (`dest`)
+ */
+ assign : function( dest, src ) {
+ for( var prop in src ) {
+ if( src.hasOwnProperty( prop ) ) {
+ dest[ prop ] = src[ prop ];
+ }
+ }
+ return dest;
+ },
-var utils = __nccwpck_require__(328);
-var bind = __nccwpck_require__(7065);
-var Axios = __nccwpck_require__(8178);
-var mergeConfig = __nccwpck_require__(4831);
-var defaults = __nccwpck_require__(8190);
-/**
- * Create an instance of Axios
- *
- * @param {Object} defaultConfig The default config for the instance
- * @return {Axios} A new instance of Axios
- */
-function createInstance(defaultConfig) {
- var context = new Axios(defaultConfig);
- var instance = bind(Axios.prototype.request, context);
+ /**
+ * Assigns (shallow copies) the properties of `src` onto `dest`, if the
+ * corresponding property on `dest` === `undefined`.
+ *
+ * @param {Object} dest The destination object.
+ * @param {Object} src The source object.
+ * @return {Object} The destination object (`dest`)
+ */
+ defaults : function( dest, src ) {
+ for( var prop in src ) {
+ if( src.hasOwnProperty( prop ) && dest[ prop ] === undefined ) {
+ dest[ prop ] = src[ prop ];
+ }
+ }
- // Copy axios.prototype to instance
- utils.extend(instance, Axios.prototype, context);
+ return dest;
+ },
- // Copy context to instance
- utils.extend(instance, context);
- return instance;
-}
+ /**
+ * Extends `superclass` to create a new subclass, adding the `protoProps` to the new subclass's prototype.
+ *
+ * @param {Function} superclass The constructor function for the superclass.
+ * @param {Object} protoProps The methods/properties to add to the subclass's prototype. This may contain the
+ * special property `constructor`, which will be used as the new subclass's constructor function.
+ * @return {Function} The new subclass function.
+ */
+ extend : function( superclass, protoProps ) {
+ var superclassProto = superclass.prototype;
+
+ var F = function() {};
+ F.prototype = superclassProto;
+
+ var subclass;
+ if( protoProps.hasOwnProperty( 'constructor' ) ) {
+ subclass = protoProps.constructor;
+ } else {
+ subclass = function() { superclassProto.constructor.apply( this, arguments ); };
+ }
-// Create the default instance to be exported
-var axios = createInstance(defaults);
+ var subclassProto = subclass.prototype = new F(); // set up prototype chain
+ subclassProto.constructor = subclass; // fix constructor property
+ subclassProto.superclass = superclassProto;
-// Expose Axios class to allow class inheritance
-axios.Axios = Axios;
+ delete protoProps.constructor; // don't re-assign constructor property to the prototype, since a new function may have been created (`subclass`), which is now already there
+ Autolinker.Util.assign( subclassProto, protoProps );
-// Factory for creating new instances
-axios.create = function create(instanceConfig) {
- return createInstance(mergeConfig(axios.defaults, instanceConfig));
-};
+ return subclass;
+ },
-// Expose Cancel & CancelToken
-axios.Cancel = __nccwpck_require__(8875);
-axios.CancelToken = __nccwpck_require__(1587);
-axios.isCancel = __nccwpck_require__(4057);
-// Expose all/spread
-axios.all = function all(promises) {
- return Promise.all(promises);
-};
-axios.spread = __nccwpck_require__(4850);
+ /**
+ * Truncates the `str` at `len - ellipsisChars.length`, and adds the `ellipsisChars` to the
+ * end of the string (by default, two periods: '..'). If the `str` length does not exceed
+ * `len`, the string will be returned unchanged.
+ *
+ * @param {String} str The string to truncate and add an ellipsis to.
+ * @param {Number} truncateLen The length to truncate the string at.
+ * @param {String} [ellipsisChars=..] The ellipsis character(s) to add to the end of `str`
+ * when truncated. Defaults to '..'
+ */
+ ellipsis : function( str, truncateLen, ellipsisChars ) {
+ if( str.length > truncateLen ) {
+ ellipsisChars = ( ellipsisChars == null ) ? '..' : ellipsisChars;
+ str = str.substring( 0, truncateLen - ellipsisChars.length ) + ellipsisChars;
+ }
+ return str;
+ },
-module.exports = axios;
-// Allow use of default import syntax in TypeScript
-module.exports.default = axios;
+ /**
+ * Supports `Array.prototype.indexOf()` functionality for old IE (IE8 and below).
+ *
+ * @param {Array} arr The array to find an element of.
+ * @param {*} element The element to find in the array, and return the index of.
+ * @return {Number} The index of the `element`, or -1 if it was not found.
+ */
+ indexOf : function( arr, element ) {
+ if( Array.prototype.indexOf ) {
+ return arr.indexOf( element );
+ } else {
+ for( var i = 0, len = arr.length; i < len; i++ ) {
+ if( arr[ i ] === element ) return i;
+ }
+ return -1;
+ }
+ },
-/***/ }),
-/***/ 8875:
-/***/ ((module) => {
+ /**
+ * Removes array elements based on a filtering function. Mutates the input
+ * array.
+ *
+ * Using this instead of the ES5 Array.prototype.filter() function, to allow
+ * Autolinker compatibility with IE8, and also to prevent creating many new
+ * arrays in memory for filtering.
+ *
+ * @param {Array} arr The array to remove elements from. This array is
+ * mutated.
+ * @param {Function} fn A function which should return `true` to
+ * remove an element.
+ * @return {Array} The mutated input `arr`.
+ */
+ remove : function( arr, fn ) {
+ for( var i = arr.length - 1; i >= 0; i-- ) {
+ if( fn( arr[ i ] ) === true ) {
+ arr.splice( i, 1 );
+ }
+ }
+ },
-"use strict";
+ /**
+ * Performs the functionality of what modern browsers do when `String.prototype.split()` is called
+ * with a regular expression that contains capturing parenthesis.
+ *
+ * For example:
+ *
+ * // Modern browsers:
+ * "a,b,c".split( /(,)/ ); // --> [ 'a', ',', 'b', ',', 'c' ]
+ *
+ * // Old IE (including IE8):
+ * "a,b,c".split( /(,)/ ); // --> [ 'a', 'b', 'c' ]
+ *
+ * This method emulates the functionality of modern browsers for the old IE case.
+ *
+ * @param {String} str The string to split.
+ * @param {RegExp} splitRegex The regular expression to split the input `str` on. The splitting
+ * character(s) will be spliced into the array, as in the "modern browsers" example in the
+ * description of this method.
+ * Note #1: the supplied regular expression **must** have the 'g' flag specified.
+ * Note #2: for simplicity's sake, the regular expression does not need
+ * to contain capturing parenthesis - it will be assumed that any match has them.
+ * @return {String[]} The split array of strings, with the splitting character(s) included.
+ */
+ splitAndCapture : function( str, splitRegex ) {
+ if( !splitRegex.global ) throw new Error( "`splitRegex` must have the 'g' flag set" );
+
+ var result = [],
+ lastIdx = 0,
+ match;
+
+ while( match = splitRegex.exec( str ) ) {
+ result.push( str.substring( lastIdx, match.index ) );
+ result.push( match[ 0 ] ); // push the splitting char(s)
+
+ lastIdx = match.index + match[ 0 ].length;
+ }
+ result.push( str.substring( lastIdx ) );
+
+ return result;
+ },
+
+
+ /**
+ * Trims the leading and trailing whitespace from a string.
+ *
+ * @param {String} str The string to trim.
+ * @return {String}
+ */
+ trim : function( str ) {
+ return str.replace( this.trimRegex, '' );
+ }
+};
+/*global Autolinker */
+/*jshint boss:true */
/**
- * A `Cancel` is an object that is thrown when an operation is canceled.
+ * @class Autolinker.HtmlTag
+ * @extends Object
*
- * @class
- * @param {string=} message The message.
+ * Represents an HTML tag, which can be used to easily build/modify HTML tags programmatically.
+ *
+ * Autolinker uses this abstraction to create HTML tags, and then write them out as strings. You may also use
+ * this class in your code, especially within a {@link Autolinker#replaceFn replaceFn}.
+ *
+ * ## Examples
+ *
+ * Example instantiation:
+ *
+ * var tag = new Autolinker.HtmlTag( {
+ * tagName : 'a',
+ * attrs : { 'href': 'http://google.com', 'class': 'external-link' },
+ * innerHtml : 'Google'
+ * } );
+ *
+ * tag.toAnchorString(); // Google
+ *
+ * // Individual accessor methods
+ * tag.getTagName(); // 'a'
+ * tag.getAttr( 'href' ); // 'http://google.com'
+ * tag.hasClass( 'external-link' ); // true
+ *
+ *
+ * Using mutator methods (which may be used in combination with instantiation config properties):
+ *
+ * var tag = new Autolinker.HtmlTag();
+ * tag.setTagName( 'a' );
+ * tag.setAttr( 'href', 'http://google.com' );
+ * tag.addClass( 'external-link' );
+ * tag.setInnerHtml( 'Google' );
+ *
+ * tag.getTagName(); // 'a'
+ * tag.getAttr( 'href' ); // 'http://google.com'
+ * tag.hasClass( 'external-link' ); // true
+ *
+ * tag.toAnchorString(); // Google
+ *
+ *
+ * ## Example use within a {@link Autolinker#replaceFn replaceFn}
+ *
+ * var html = Autolinker.link( "Test google.com", {
+ * replaceFn : function( autolinker, match ) {
+ * var tag = match.buildTag(); // returns an {@link Autolinker.HtmlTag} instance, configured with the Match's href and anchor text
+ * tag.setAttr( 'rel', 'nofollow' );
+ *
+ * return tag;
+ * }
+ * } );
+ *
+ * // generated html:
+ * // Test google.com
+ *
+ *
+ * ## Example use with a new tag for the replacement
+ *
+ * var html = Autolinker.link( "Test google.com", {
+ * replaceFn : function( autolinker, match ) {
+ * var tag = new Autolinker.HtmlTag( {
+ * tagName : 'button',
+ * attrs : { 'title': 'Load URL: ' + match.getAnchorHref() },
+ * innerHtml : 'Load URL: ' + match.getAnchorText()
+ * } );
+ *
+ * return tag;
+ * }
+ * } );
+ *
+ * // generated html:
+ * // Test
*/
-function Cancel(message) {
- this.message = message;
-}
+Autolinker.HtmlTag = Autolinker.Util.extend( Object, {
-Cancel.prototype.toString = function toString() {
- return 'Cancel' + (this.message ? ': ' + this.message : '');
-};
+ /**
+ * @cfg {String} tagName
+ *
+ * The tag name. Ex: 'a', 'button', etc.
+ *
+ * Not required at instantiation time, but should be set using {@link #setTagName} before {@link #toAnchorString}
+ * is executed.
+ */
-Cancel.prototype.__CANCEL__ = true;
+ /**
+ * @cfg {Object.} attrs
+ *
+ * An key/value Object (map) of attributes to create the tag with. The keys are the attribute names, and the
+ * values are the attribute values.
+ */
-module.exports = Cancel;
+ /**
+ * @cfg {String} innerHtml
+ *
+ * The inner HTML for the tag.
+ *
+ * Note the camel case name on `innerHtml`. Acronyms are camelCased in this utility (such as not to run into the acronym
+ * naming inconsistency that the DOM developers created with `XMLHttpRequest`). You may alternatively use {@link #innerHTML}
+ * if you prefer, but this one is recommended.
+ */
+ /**
+ * @cfg {String} innerHTML
+ *
+ * Alias of {@link #innerHtml}, accepted for consistency with the browser DOM api, but prefer the camelCased version
+ * for acronym names.
+ */
-/***/ }),
-/***/ 1587:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ /**
+ * @protected
+ * @property {RegExp} whitespaceRegex
+ *
+ * Regular expression used to match whitespace in a string of CSS classes.
+ */
+ whitespaceRegex : /\s+/,
-"use strict";
+ /**
+ * @constructor
+ * @param {Object} [cfg] The configuration properties for this class, in an Object (map)
+ */
+ constructor : function( cfg ) {
+ Autolinker.Util.assign( this, cfg );
-var Cancel = __nccwpck_require__(8875);
+ this.innerHtml = this.innerHtml || this.innerHTML; // accept either the camelCased form or the fully capitalized acronym
+ },
-/**
- * A `CancelToken` is an object that can be used to request cancellation of an operation.
- *
- * @class
- * @param {Function} executor The executor function.
- */
-function CancelToken(executor) {
- if (typeof executor !== 'function') {
- throw new TypeError('executor must be a function.');
- }
- var resolvePromise;
- this.promise = new Promise(function promiseExecutor(resolve) {
- resolvePromise = resolve;
- });
+ /**
+ * Sets the tag name that will be used to generate the tag with.
+ *
+ * @param {String} tagName
+ * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained.
+ */
+ setTagName : function( tagName ) {
+ this.tagName = tagName;
+ return this;
+ },
- var token = this;
- executor(function cancel(message) {
- if (token.reason) {
- // Cancellation has already been requested
- return;
- }
- token.reason = new Cancel(message);
- resolvePromise(token.reason);
- });
-}
+ /**
+ * Retrieves the tag name.
+ *
+ * @return {String}
+ */
+ getTagName : function() {
+ return this.tagName || "";
+ },
-/**
- * Throws a `Cancel` if cancellation has been requested.
- */
-CancelToken.prototype.throwIfRequested = function throwIfRequested() {
- if (this.reason) {
- throw this.reason;
- }
-};
-/**
- * Returns an object that contains a new `CancelToken` and a function that, when called,
- * cancels the `CancelToken`.
- */
-CancelToken.source = function source() {
- var cancel;
- var token = new CancelToken(function executor(c) {
- cancel = c;
- });
- return {
- token: token,
- cancel: cancel
- };
-};
+ /**
+ * Sets an attribute on the HtmlTag.
+ *
+ * @param {String} attrName The attribute name to set.
+ * @param {String} attrValue The attribute value to set.
+ * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained.
+ */
+ setAttr : function( attrName, attrValue ) {
+ var tagAttrs = this.getAttrs();
+ tagAttrs[ attrName ] = attrValue;
+
+ return this;
+ },
-module.exports = CancelToken;
+ /**
+ * Retrieves an attribute from the HtmlTag. If the attribute does not exist, returns `undefined`.
+ *
+ * @param {String} attrName The attribute name to retrieve.
+ * @return {String} The attribute's value, or `undefined` if it does not exist on the HtmlTag.
+ */
+ getAttr : function( attrName ) {
+ return this.getAttrs()[ attrName ];
+ },
-/***/ }),
-/***/ 4057:
-/***/ ((module) => {
+ /**
+ * Sets one or more attributes on the HtmlTag.
+ *
+ * @param {Object.} attrs A key/value Object (map) of the attributes to set.
+ * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained.
+ */
+ setAttrs : function( attrs ) {
+ var tagAttrs = this.getAttrs();
+ Autolinker.Util.assign( tagAttrs, attrs );
+
+ return this;
+ },
-"use strict";
+ /**
+ * Retrieves the attributes Object (map) for the HtmlTag.
+ *
+ * @return {Object.} A key/value object of the attributes for the HtmlTag.
+ */
+ getAttrs : function() {
+ return this.attrs || ( this.attrs = {} );
+ },
-module.exports = function isCancel(value) {
- return !!(value && value.__CANCEL__);
-};
+ /**
+ * Sets the provided `cssClass`, overwriting any current CSS classes on the HtmlTag.
+ *
+ * @param {String} cssClass One or more space-separated CSS classes to set (overwrite).
+ * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained.
+ */
+ setClass : function( cssClass ) {
+ return this.setAttr( 'class', cssClass );
+ },
-/***/ }),
-/***/ 8178:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ /**
+ * Convenience method to add one or more CSS classes to the HtmlTag. Will not add duplicate CSS classes.
+ *
+ * @param {String} cssClass One or more space-separated CSS classes to add.
+ * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained.
+ */
+ addClass : function( cssClass ) {
+ var classAttr = this.getClass(),
+ whitespaceRegex = this.whitespaceRegex,
+ indexOf = Autolinker.Util.indexOf, // to support IE8 and below
+ classes = ( !classAttr ) ? [] : classAttr.split( whitespaceRegex ),
+ newClasses = cssClass.split( whitespaceRegex ),
+ newClass;
+
+ while( newClass = newClasses.shift() ) {
+ if( indexOf( classes, newClass ) === -1 ) {
+ classes.push( newClass );
+ }
+ }
-"use strict";
+ this.getAttrs()[ 'class' ] = classes.join( " " );
+ return this;
+ },
-var utils = __nccwpck_require__(328);
-var buildURL = __nccwpck_require__(646);
-var InterceptorManager = __nccwpck_require__(3214);
-var dispatchRequest = __nccwpck_require__(5062);
-var mergeConfig = __nccwpck_require__(4831);
+ /**
+ * Convenience method to remove one or more CSS classes from the HtmlTag.
+ *
+ * @param {String} cssClass One or more space-separated CSS classes to remove.
+ * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained.
+ */
+ removeClass : function( cssClass ) {
+ var classAttr = this.getClass(),
+ whitespaceRegex = this.whitespaceRegex,
+ indexOf = Autolinker.Util.indexOf, // to support IE8 and below
+ classes = ( !classAttr ) ? [] : classAttr.split( whitespaceRegex ),
+ removeClasses = cssClass.split( whitespaceRegex ),
+ removeClass;
+
+ while( classes.length && ( removeClass = removeClasses.shift() ) ) {
+ var idx = indexOf( classes, removeClass );
+ if( idx !== -1 ) {
+ classes.splice( idx, 1 );
+ }
+ }
-/**
- * Create a new instance of Axios
- *
- * @param {Object} instanceConfig The default config for the instance
- */
-function Axios(instanceConfig) {
- this.defaults = instanceConfig;
- this.interceptors = {
- request: new InterceptorManager(),
- response: new InterceptorManager()
- };
-}
+ this.getAttrs()[ 'class' ] = classes.join( " " );
+ return this;
+ },
-/**
- * Dispatch a request
- *
- * @param {Object} config The config specific for this request (merged with this.defaults)
- */
-Axios.prototype.request = function request(config) {
- /*eslint no-param-reassign:0*/
- // Allow for axios('example/url'[, config]) a la fetch API
- if (typeof config === 'string') {
- config = arguments[1] || {};
- config.url = arguments[0];
- } else {
- config = config || {};
- }
- config = mergeConfig(this.defaults, config);
+ /**
+ * Convenience method to retrieve the CSS class(es) for the HtmlTag, which will each be separated by spaces when
+ * there are multiple.
+ *
+ * @return {String}
+ */
+ getClass : function() {
+ return this.getAttrs()[ 'class' ] || "";
+ },
- // Set config.method
- if (config.method) {
- config.method = config.method.toLowerCase();
- } else if (this.defaults.method) {
- config.method = this.defaults.method.toLowerCase();
- } else {
- config.method = 'get';
- }
- // Hook up interceptors middleware
- var chain = [dispatchRequest, undefined];
- var promise = Promise.resolve(config);
+ /**
+ * Convenience method to check if the tag has a CSS class or not.
+ *
+ * @param {String} cssClass The CSS class to check for.
+ * @return {Boolean} `true` if the HtmlTag has the CSS class, `false` otherwise.
+ */
+ hasClass : function( cssClass ) {
+ return ( ' ' + this.getClass() + ' ' ).indexOf( ' ' + cssClass + ' ' ) !== -1;
+ },
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
- chain.unshift(interceptor.fulfilled, interceptor.rejected);
- });
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
- chain.push(interceptor.fulfilled, interceptor.rejected);
- });
+ /**
+ * Sets the inner HTML for the tag.
+ *
+ * @param {String} html The inner HTML to set.
+ * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained.
+ */
+ setInnerHtml : function( html ) {
+ this.innerHtml = html;
+
+ return this;
+ },
- while (chain.length) {
- promise = promise.then(chain.shift(), chain.shift());
- }
- return promise;
-};
+ /**
+ * Retrieves the inner HTML for the tag.
+ *
+ * @return {String}
+ */
+ getInnerHtml : function() {
+ return this.innerHtml || "";
+ },
-Axios.prototype.getUri = function getUri(config) {
- config = mergeConfig(this.defaults, config);
- return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
-};
-// Provide aliases for supported request methods
-utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
- /*eslint func-names:0*/
- Axios.prototype[method] = function(url, config) {
- return this.request(utils.merge(config || {}, {
- method: method,
- url: url
- }));
- };
-});
+ /**
+ * Override of superclass method used to generate the HTML string for the tag.
+ *
+ * @return {String}
+ */
+ toAnchorString : function() {
+ var tagName = this.getTagName(),
+ attrsStr = this.buildAttrsStr();
-utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
- /*eslint func-names:0*/
- Axios.prototype[method] = function(url, data, config) {
- return this.request(utils.merge(config || {}, {
- method: method,
- url: url,
- data: data
- }));
- };
-});
+ attrsStr = ( attrsStr ) ? ' ' + attrsStr : ''; // prepend a space if there are actually attributes
-module.exports = Axios;
+ return [ '<', tagName, attrsStr, '>', this.getInnerHtml(), '', tagName, '>' ].join( "" );
+ },
-/***/ }),
+ /**
+ * Support method for {@link #toAnchorString}, returns the string space-separated key="value" pairs, used to populate
+ * the stringified HtmlTag.
+ *
+ * @protected
+ * @return {String} Example return: `attr1="value1" attr2="value2"`
+ */
+ buildAttrsStr : function() {
+ if( !this.attrs ) return ""; // no `attrs` Object (map) has been set, return empty string
+
+ var attrs = this.getAttrs(),
+ attrsArr = [];
+
+ for( var prop in attrs ) {
+ if( attrs.hasOwnProperty( prop ) ) {
+ attrsArr.push( prop + '="' + attrs[ prop ] + '"' );
+ }
+ }
+ return attrsArr.join( " " );
+ }
-/***/ 3214:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+} );
-"use strict";
+/*global Autolinker */
+/**
+ * @class Autolinker.RegexLib
+ * @singleton
+ *
+ * Builds and stores a library of the common regular expressions used by the
+ * Autolinker utility.
+ *
+ * Other regular expressions may exist ad-hoc, but these are generally the
+ * regular expressions that are shared between source files.
+ */
+Autolinker.RegexLib = (function() {
+ /**
+ * The string form of a regular expression that would match all of the
+ * alphabetic ("letter") chars in the unicode character set when placed in a
+ * RegExp character class (`[]`). This includes all international alphabetic
+ * characters.
+ *
+ * These would be the characters matched by unicode regex engines `\p{L}`
+ * escape ("all letters").
+ *
+ * Taken from the XRegExp library: http://xregexp.com/
+ * Specifically: http://xregexp.com/v/3.0.0/unicode-categories.js
+ *
+ * @private
+ * @type {String}
+ */
+ var alphaCharsStr = 'A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC';
-var utils = __nccwpck_require__(328);
+ /**
+ * The string form of a regular expression that would match all of the
+ * decimal number chars in the unicode character set when placed in a RegExp
+ * character class (`[]`).
+ *
+ * These would be the characters matched by unicode regex engines `\p{Nd}`
+ * escape ("all decimal numbers")
+ *
+ * Taken from the XRegExp library: http://xregexp.com/
+ * Specifically: http://xregexp.com/v/3.0.0/unicode-categories.js
+ *
+ * @private
+ * @type {String}
+ */
+ var decimalNumbersStr = '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19';
-function InterceptorManager() {
- this.handlers = [];
-}
+ // See documentation below
+ var alphaNumericCharsStr = alphaCharsStr + decimalNumbersStr;
+
+
+ // See documentation below
+ var domainNameRegex = new RegExp( '[' + alphaNumericCharsStr + '.\\-]*[' + alphaNumericCharsStr + '\\-]' );
+
+
+ // See documentation below
+ var tldRegex = /(?:travelersinsurance|sandvikcoromant|kerryproperties|cancerresearch|weatherchannel|kerrylogistics|spreadbetting|international|wolterskluwer|lifeinsurance|construction|pamperedchef|scholarships|versicherung|bridgestone|creditunion|kerryhotels|investments|productions|blackfriday|enterprises|lamborghini|photography|motorcycles|williamhill|playstation|contractors|barclaycard|accountants|redumbrella|engineering|management|telefonica|protection|consulting|tatamotors|creditcard|vlaanderen|schaeffler|associates|properties|foundation|republican|bnpparibas|boehringer|eurovision|extraspace|industries|immobilien|university|technology|volkswagen|healthcare|restaurant|cuisinella|vistaprint|apartments|accountant|travelers|homedepot|institute|vacations|furniture|fresenius|insurance|christmas|bloomberg|solutions|barcelona|firestone|financial|kuokgroup|fairwinds|community|passagens|goldpoint|equipment|lifestyle|yodobashi|aquarelle|marketing|analytics|education|amsterdam|statefarm|melbourne|allfinanz|directory|microsoft|stockholm|montblanc|accenture|lancaster|landrover|everbank|istanbul|graphics|grainger|ipiranga|softbank|attorney|pharmacy|saarland|catering|airforce|yokohama|mortgage|frontier|mutuelle|stcgroup|memorial|pictures|football|symantec|cipriani|ventures|telecity|cityeats|verisign|flsmidth|boutique|cleaning|firmdale|clinique|clothing|redstone|infiniti|deloitte|feedback|services|broadway|plumbing|commbank|training|barclays|exchange|computer|brussels|software|delivery|barefoot|builders|business|bargains|engineer|holdings|download|security|helsinki|lighting|movistar|discount|hdfcbank|supplies|marriott|property|diamonds|capetown|partners|democrat|jpmorgan|bradesco|budapest|rexroth|zuerich|shriram|academy|science|support|youtube|singles|surgery|alibaba|statoil|dentist|schwarz|android|cruises|cricket|digital|markets|starhub|systems|courses|coupons|netbank|country|domains|corsica|network|neustar|realtor|lincoln|limited|schmidt|yamaxun|cooking|contact|auction|spiegel|liaison|leclerc|latrobe|lasalle|abogado|compare|lanxess|exposed|express|company|cologne|college|avianca|lacaixa|fashion|recipes|ferrero|komatsu|storage|wanggou|clubmed|sandvik|fishing|fitness|bauhaus|kitchen|flights|florist|flowers|watches|weather|temasek|samsung|bentley|forsale|channel|theater|frogans|theatre|okinawa|website|tickets|jewelry|gallery|tiffany|iselect|shiksha|brother|organic|wedding|genting|toshiba|origins|philips|hyundai|hotmail|hoteles|hosting|rentals|windows|cartier|bugatti|holiday|careers|whoswho|hitachi|panerai|caravan|reviews|guitars|capital|trading|hamburg|hangout|finance|stream|family|abbott|health|review|travel|report|hermes|hiphop|gratis|career|toyota|hockey|dating|repair|google|social|soccer|reisen|global|otsuka|giving|unicom|casino|photos|center|broker|rocher|orange|bostik|garden|insure|ryukyu|bharti|safety|physio|sakura|oracle|online|jaguar|gallup|piaget|tienda|futbol|pictet|joburg|webcam|berlin|office|juegos|kaufen|chanel|chrome|xihuan|church|tennis|circle|kinder|flickr|bayern|claims|clinic|viajes|nowruz|xperia|norton|yachts|studio|coffee|camera|sanofi|nissan|author|expert|events|comsec|lawyer|tattoo|viking|estate|villas|condos|realty|yandex|energy|emerck|virgin|vision|durban|living|school|coupon|london|taobao|natura|taipei|nagoya|luxury|walter|aramco|sydney|madrid|credit|maison|makeup|schule|market|anquan|direct|design|swatch|suzuki|alsace|vuelos|dental|alipay|voyage|shouji|voting|airtel|mutual|degree|supply|agency|museum|mobily|dealer|monash|select|mormon|active|moscow|racing|datsun|quebec|nissay|rodeo|email|gifts|works|photo|chloe|edeka|cheap|earth|vista|tushu|koeln|glass|shoes|globo|tunes|gmail|nokia|space|kyoto|black|ricoh|seven|lamer|sener|epson|cisco|praxi|trust|citic|crown|shell|lease|green|legal|lexus|ninja|tatar|gripe|nikon|group|video|wales|autos|gucci|party|nexus|guide|linde|adult|parts|amica|lixil|boats|azure|loans|locus|cymru|lotte|lotto|stada|click|poker|quest|dabur|lupin|nadex|paris|faith|dance|canon|place|gives|trade|skype|rocks|mango|cloud|boots|smile|final|swiss|homes|honda|media|horse|cards|deals|watch|bosch|house|pizza|miami|osaka|tours|total|xerox|coach|sucks|style|delta|toray|iinet|tools|money|codes|beats|tokyo|salon|archi|movie|baidu|study|actor|yahoo|store|apple|world|forex|today|bible|tmall|tirol|irish|tires|forum|reise|vegas|vodka|sharp|omega|weber|jetzt|audio|promo|build|bingo|chase|gallo|drive|dubai|rehab|press|solar|sale|beer|bbva|bank|band|auto|sapo|sarl|saxo|audi|asia|arte|arpa|army|yoga|ally|zara|scor|scot|sexy|seat|zero|seek|aero|adac|zone|aarp|maif|meet|meme|menu|surf|mini|mobi|mtpc|porn|desi|star|ltda|name|talk|navy|love|loan|live|link|news|limo|like|spot|life|nico|lidl|lgbt|land|taxi|team|tech|kred|kpmg|sony|song|kiwi|kddi|jprs|jobs|sohu|java|itau|tips|info|immo|icbc|hsbc|town|host|page|toys|here|help|pars|haus|guru|guge|tube|goog|golf|gold|sncf|gmbh|gift|ggee|gent|gbiz|game|vana|pics|fund|ford|ping|pink|fish|film|fast|farm|play|fans|fail|plus|skin|pohl|fage|moda|post|erni|dvag|prod|doha|prof|docs|viva|diet|luxe|site|dell|sina|dclk|show|qpon|date|vote|cyou|voto|read|coop|cool|wang|club|city|chat|cern|cash|reit|rent|casa|cars|care|camp|rest|call|cafe|weir|wien|rich|wiki|buzz|wine|book|bond|room|work|rsvp|shia|ruhr|blue|bing|shaw|bike|safe|xbox|best|pwc|mtn|lds|aig|boo|fyi|nra|nrw|ntt|car|gal|obi|zip|aeg|vin|how|one|ong|onl|dad|ooo|bet|esq|org|htc|bar|uol|ibm|ovh|gdn|ice|icu|uno|gea|ifm|bot|top|wtf|lol|day|pet|eus|wtc|ubs|tvs|aco|ing|ltd|ink|tab|abb|afl|cat|int|pid|pin|bid|cba|gle|com|cbn|ads|man|wed|ceb|gmo|sky|ist|gmx|tui|mba|fan|ski|iwc|app|pro|med|ceo|jcb|jcp|goo|dev|men|aaa|meo|pub|jlc|bom|jll|gop|jmp|mil|got|gov|win|jot|mma|joy|trv|red|cfa|cfd|bio|moe|moi|mom|ren|biz|aws|xin|bbc|dnp|buy|kfh|mov|thd|xyz|fit|kia|rio|rip|kim|dog|vet|nyc|bcg|mtr|bcn|bms|bmw|run|bzh|rwe|tel|stc|axa|kpn|fly|krd|cab|bnl|foo|crs|eat|tci|sap|srl|nec|sas|net|cal|sbs|sfr|sca|scb|csc|edu|new|xxx|hiv|fox|wme|ngo|nhk|vip|sex|frl|lat|yun|law|you|tax|soy|sew|om|ac|hu|se|sc|sg|sh|sb|sa|rw|ru|rs|ro|re|qa|py|si|pw|pt|ps|sj|sk|pr|pn|pm|pl|sl|sm|pk|sn|ph|so|pg|pf|pe|pa|zw|nz|nu|nr|np|no|nl|ni|ng|nf|sr|ne|st|nc|na|mz|my|mx|mw|mv|mu|mt|ms|mr|mq|mp|mo|su|mn|mm|ml|mk|mh|mg|me|sv|md|mc|sx|sy|ma|ly|lv|sz|lu|lt|ls|lr|lk|li|lc|lb|la|tc|kz|td|ky|kw|kr|kp|kn|km|ki|kh|tf|tg|th|kg|ke|jp|jo|jm|je|it|is|ir|tj|tk|tl|tm|iq|tn|to|io|in|im|il|ie|ad|sd|ht|hr|hn|hm|tr|hk|gy|gw|gu|gt|gs|gr|gq|tt|gp|gn|gm|gl|tv|gi|tw|tz|ua|gh|ug|uk|gg|gf|ge|gd|us|uy|uz|va|gb|ga|vc|ve|fr|fo|fm|fk|fj|vg|vi|fi|eu|et|es|er|eg|ee|ec|dz|do|dm|dk|vn|dj|de|cz|cy|cx|cw|vu|cv|cu|cr|co|cn|cm|cl|ck|ci|ch|cg|cf|cd|cc|ca|wf|bz|by|bw|bv|bt|bs|br|bo|bn|bm|bj|bi|ws|bh|bg|bf|be|bd|bb|ba|az|ax|aw|au|at|as|ye|ar|aq|ao|am|al|yt|ai|za|ag|af|ae|zm|id)\b/;
+
+
+ return {
+
+ /**
+ * The string form of a regular expression that would match all of the
+ * letters and decimal number chars in the unicode character set when placed
+ * in a RegExp character class (`[]`).
+ *
+ * These would be the characters matched by unicode regex engines `[\p{L}\p{Nd}]`
+ * escape ("all letters and decimal numbers")
+ *
+ * @property {String} alphaNumericCharsStr
+ */
+ alphaNumericCharsStr : alphaNumericCharsStr,
+
+ /**
+ * A regular expression to match domain names of a URL or email address.
+ * Ex: 'google', 'yahoo', 'some-other-company', etc.
+ *
+ * @property {RegExp} domainNameRegex
+ */
+ domainNameRegex : domainNameRegex,
+
+ /**
+ * A regular expression to match top level domains (TLDs) for a URL or
+ * email address. Ex: 'com', 'org', 'net', etc.
+ *
+ * @property {RegExp} tldRegex
+ */
+ tldRegex : tldRegex
+
+ };
+
+
+}() );
+/*global Autolinker */
+/*jshint sub:true */
/**
- * Add a new interceptor to the stack
+ * @protected
+ * @class Autolinker.AnchorTagBuilder
+ * @extends Object
*
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
- * @param {Function} rejected The function to handle `reject` for a `Promise`
+ * Builds anchor (<a>) tags for the Autolinker utility when a match is
+ * found.
*
- * @return {Number} An ID used to remove interceptor later
- */
-InterceptorManager.prototype.use = function use(fulfilled, rejected) {
- this.handlers.push({
- fulfilled: fulfilled,
- rejected: rejected
- });
- return this.handlers.length - 1;
-};
-
-/**
- * Remove an interceptor from the stack
+ * Normally this class is instantiated, configured, and used internally by an
+ * {@link Autolinker} instance, but may actually be retrieved in a {@link Autolinker#replaceFn replaceFn}
+ * to create {@link Autolinker.HtmlTag HtmlTag} instances which may be modified
+ * before returning from the {@link Autolinker#replaceFn replaceFn}. For
+ * example:
*
- * @param {Number} id The ID that was returned by `use`
- */
-InterceptorManager.prototype.eject = function eject(id) {
- if (this.handlers[id]) {
- this.handlers[id] = null;
- }
-};
-
-/**
- * Iterate over all the registered interceptors
+ * var html = Autolinker.link( "Test google.com", {
+ * replaceFn : function( autolinker, match ) {
+ * var tag = autolinker.getTagBuilder().build( match ); // returns an {@link Autolinker.HtmlTag} instance
+ * tag.setAttr( 'rel', 'nofollow' );
*
- * This method is particularly useful for skipping over any
- * interceptors that may have become `null` calling `eject`.
+ * return tag;
+ * }
+ * } );
*
- * @param {Function} fn The function to call for each interceptor
+ * // generated html:
+ * // Test google.com
*/
-InterceptorManager.prototype.forEach = function forEach(fn) {
- utils.forEach(this.handlers, function forEachHandler(h) {
- if (h !== null) {
- fn(h);
- }
- });
-};
+Autolinker.AnchorTagBuilder = Autolinker.Util.extend( Object, {
-module.exports = InterceptorManager;
+ /**
+ * @cfg {Boolean} newWindow
+ * @inheritdoc Autolinker#newWindow
+ */
+ /**
+ * @cfg {Object} truncate
+ * @inheritdoc Autolinker#truncate
+ */
-/***/ }),
+ /**
+ * @cfg {String} className
+ * @inheritdoc Autolinker#className
+ */
-/***/ 1934:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+ /**
+ * @constructor
+ * @param {Object} [cfg] The configuration options for the AnchorTagBuilder instance, specified in an Object (map).
+ */
+ constructor : function( cfg ) {
+ Autolinker.Util.assign( this, cfg );
+ },
-var isAbsoluteURL = __nccwpck_require__(1301);
-var combineURLs = __nccwpck_require__(7189);
+ /**
+ * Generates the actual anchor (<a>) tag to use in place of the
+ * matched text, via its `match` object.
+ *
+ * @param {Autolinker.match.Match} match The Match instance to generate an
+ * anchor tag from.
+ * @return {Autolinker.HtmlTag} The HtmlTag instance for the anchor tag.
+ */
+ build : function( match ) {
+ return new Autolinker.HtmlTag( {
+ tagName : 'a',
+ attrs : this.createAttrs( match.getType(), match.getAnchorHref() ),
+ innerHtml : this.processAnchorText( match.getAnchorText() )
+ } );
+ },
-/**
- * Creates a new URL by combining the baseURL with the requestedURL,
- * only when the requestedURL is not already an absolute URL.
- * If the requestURL is absolute, this function returns the requestedURL untouched.
- *
- * @param {string} baseURL The base URL
- * @param {string} requestedURL Absolute or relative URL to combine
- * @returns {string} The combined full path
- */
-module.exports = function buildFullPath(baseURL, requestedURL) {
- if (baseURL && !isAbsoluteURL(requestedURL)) {
- return combineURLs(baseURL, requestedURL);
- }
- return requestedURL;
-};
+ /**
+ * Creates the Object (map) of the HTML attributes for the anchor (<a>)
+ * tag being generated.
+ *
+ * @protected
+ * @param {"url"/"email"/"phone"/"twitter"/"hashtag"} matchType The type of
+ * match that an anchor tag is being generated for.
+ * @param {String} anchorHref The href for the anchor tag.
+ * @return {Object} A key/value Object (map) of the anchor tag's attributes.
+ */
+ createAttrs : function( matchType, anchorHref ) {
+ var attrs = {
+ 'href' : anchorHref // we'll always have the `href` attribute
+ };
-/***/ }),
+ var cssClass = this.createCssClass( matchType );
+ if( cssClass ) {
+ attrs[ 'class' ] = cssClass;
+ }
+ if( this.newWindow ) {
+ attrs[ 'target' ] = "_blank";
+ attrs[ 'rel' ] = "noopener noreferrer";
+ }
-/***/ 5226:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ return attrs;
+ },
-"use strict";
+ /**
+ * Creates the CSS class that will be used for a given anchor tag, based on
+ * the `matchType` and the {@link #className} config.
+ *
+ * @private
+ * @param {"url"/"email"/"phone"/"twitter"/"hashtag"} matchType The type of
+ * match that an anchor tag is being generated for.
+ * @return {String} The CSS class string for the link. Example return:
+ * "myLink myLink-url". If no {@link #className} was configured, returns
+ * an empty string.
+ */
+ createCssClass : function( matchType ) {
+ var className = this.className;
+
+ if( !className )
+ return "";
+ else
+ return className + " " + className + "-" + matchType; // ex: "myLink myLink-url", "myLink myLink-email", "myLink myLink-phone", "myLink myLink-twitter", or "myLink myLink-hashtag"
+ },
+
+
+ /**
+ * Processes the `anchorText` by truncating the text according to the
+ * {@link #truncate} config.
+ *
+ * @private
+ * @param {String} anchorText The anchor tag's text (i.e. what will be
+ * displayed).
+ * @return {String} The processed `anchorText`.
+ */
+ processAnchorText : function( anchorText ) {
+ anchorText = this.doTruncate( anchorText );
+
+ return anchorText;
+ },
+
+
+ /**
+ * Performs the truncation of the `anchorText` based on the {@link #truncate}
+ * option. If the `anchorText` is longer than the length specified by the
+ * {@link #truncate} option, the truncation is performed based on the
+ * `location` property. See {@link #truncate} for details.
+ *
+ * @private
+ * @param {String} anchorText The anchor tag's text (i.e. what will be
+ * displayed).
+ * @return {String} The truncated anchor text.
+ */
+ doTruncate : function( anchorText ) {
+ var truncate = this.truncate;
+ if( !truncate || !truncate.length ) return anchorText;
+
+ var truncateLength = truncate.length,
+ truncateLocation = truncate.location;
+
+ if( truncateLocation === 'smart' ) {
+ return Autolinker.truncate.TruncateSmart( anchorText, truncateLength, '..' );
+
+ } else if( truncateLocation === 'middle' ) {
+ return Autolinker.truncate.TruncateMiddle( anchorText, truncateLength, '..' );
+
+ } else {
+ return Autolinker.truncate.TruncateEnd( anchorText, truncateLength, '..' );
+ }
+ }
-var enhanceError = __nccwpck_require__(1516);
+} );
+/*global Autolinker */
/**
- * Create an Error with the specified message, config, error code, request and response.
+ * @class Autolinker.htmlParser.HtmlParser
+ * @extends Object
*
- * @param {string} message The error message.
- * @param {Object} config The config.
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
- * @param {Object} [request] The request.
- * @param {Object} [response] The response.
- * @returns {Error} The created error.
+ * An HTML parser implementation which simply walks an HTML string and returns an array of
+ * {@link Autolinker.htmlParser.HtmlNode HtmlNodes} that represent the basic HTML structure of the input string.
+ *
+ * Autolinker uses this to only link URLs/emails/Twitter handles within text nodes, effectively ignoring / "walking
+ * around" HTML tags.
*/
-module.exports = function createError(message, config, code, request, response) {
- var error = new Error(message);
- return enhanceError(error, config, code, request, response);
-};
+Autolinker.htmlParser.HtmlParser = Autolinker.Util.extend( Object, {
+ /**
+ * @private
+ * @property {RegExp} htmlRegex
+ *
+ * The regular expression used to pull out HTML tags from a string. Handles namespaced HTML tags and
+ * attribute names, as specified by http://www.w3.org/TR/html-markup/syntax.html.
+ *
+ * Capturing groups:
+ *
+ * 1. The "!DOCTYPE" tag name, if a tag is a <!DOCTYPE> tag.
+ * 2. If it is an end tag, this group will have the '/'.
+ * 3. If it is a comment tag, this group will hold the comment text (i.e.
+ * the text inside the `<!--` and `-->`.
+ * 4. The tag name for all tags (other than the <!DOCTYPE> tag)
+ */
+ htmlRegex : (function() {
+ var commentTagRegex = /!--([\s\S]+?)--/,
+ tagNameRegex = /[0-9a-zA-Z][0-9a-zA-Z:]*/,
+ attrNameRegex = /[^\s"'>\/=\x00-\x1F\x7F]+/, // the unicode range accounts for excluding control chars, and the delete char
+ attrValueRegex = /(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/, // double quoted, single quoted, or unquoted attribute values
+ nameEqualsValueRegex = attrNameRegex.source + '(?:\\s*=\\s*' + attrValueRegex.source + ')?'; // optional '=[value]'
+
+ return new RegExp( [
+ // for tag. Ex: )
+ '(?:',
+ '<(!DOCTYPE)', // *** Capturing Group 1 - If it's a doctype tag
+
+ // Zero or more attributes following the tag name
+ '(?:',
+ '\\s+', // one or more whitespace chars before an attribute
+
+ // Either:
+ // A. attr="value", or
+ // B. "value" alone (To cover example doctype tag: )
+ '(?:', nameEqualsValueRegex, '|', attrValueRegex.source + ')',
+ ')*',
+ '>',
+ ')',
+
+ '|',
+
+ // All other HTML tags (i.e. tags that are not )
+ '(?:',
+ '<(/)?', // Beginning of a tag or comment. Either '<' for a start tag, or '' for an end tag.
+ // *** Capturing Group 2: The slash or an empty string. Slash ('/') for end tag, empty string for start or self-closing tag.
+
+ '(?:',
+ commentTagRegex.source, // *** Capturing Group 3 - A Comment Tag's Text
+
+ '|',
+
+ '(?:',
+
+ // *** Capturing Group 4 - The tag name
+ '(' + tagNameRegex.source + ')',
+
+ // Zero or more attributes following the tag name
+ '(?:',
+ '(?:\\s+|\\b)', // any number of whitespace chars before an attribute. NOTE: Using \s* here throws Chrome into an infinite loop for some reason, so using \s+|\b instead
+ nameEqualsValueRegex, // attr="value" (with optional ="value" part)
+ ')*',
+
+ '\\s*/?', // any trailing spaces and optional '/' before the closing '>'
+
+ ')',
+ ')',
+ '>',
+ ')'
+ ].join( "" ), 'gi' );
+ } )(),
-/***/ }),
+ /**
+ * @private
+ * @property {RegExp} htmlCharacterEntitiesRegex
+ *
+ * The regular expression that matches common HTML character entities.
+ *
+ * Ignoring & as it could be part of a query string -- handling it separately.
+ */
+ htmlCharacterEntitiesRegex: /( | |<|<|>|>|"|"|')/gi,
-/***/ 5062:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+ /**
+ * Parses an HTML string and returns a simple array of {@link Autolinker.htmlParser.HtmlNode HtmlNodes}
+ * to represent the HTML structure of the input string.
+ *
+ * @param {String} html The HTML to parse.
+ * @return {Autolinker.htmlParser.HtmlNode[]}
+ */
+ parse : function( html ) {
+ var htmlRegex = this.htmlRegex,
+ currentResult,
+ lastIndex = 0,
+ textAndEntityNodes,
+ nodes = []; // will be the result of the method
+
+ while( ( currentResult = htmlRegex.exec( html ) ) !== null ) {
+ var tagText = currentResult[ 0 ],
+ commentText = currentResult[ 3 ], // if we've matched a comment
+ tagName = currentResult[ 1 ] || currentResult[ 4 ], // The tag (ex: "!DOCTYPE"), or another tag (ex: "a" or "img")
+ isClosingTag = !!currentResult[ 2 ],
+ offset = currentResult.index,
+ inBetweenTagsText = html.substring( lastIndex, offset );
+
+ // Push TextNodes and EntityNodes for any text found between tags
+ if( inBetweenTagsText ) {
+ textAndEntityNodes = this.parseTextAndEntityNodes( lastIndex, inBetweenTagsText );
+ nodes.push.apply( nodes, textAndEntityNodes );
+ }
+ // Push the CommentNode or ElementNode
+ if( commentText ) {
+ nodes.push( this.createCommentNode( offset, tagText, commentText ) );
+ } else {
+ nodes.push( this.createElementNode( offset, tagText, tagName, isClosingTag ) );
+ }
-var utils = __nccwpck_require__(328);
-var transformData = __nccwpck_require__(9812);
-var isCancel = __nccwpck_require__(4057);
-var defaults = __nccwpck_require__(8190);
+ lastIndex = offset + tagText.length;
+ }
-/**
- * Throws a `Cancel` if cancellation has been requested.
- */
-function throwIfCancellationRequested(config) {
- if (config.cancelToken) {
- config.cancelToken.throwIfRequested();
- }
-}
+ // Process any remaining text after the last HTML element. Will process all of the text if there were no HTML elements.
+ if( lastIndex < html.length ) {
+ var text = html.substring( lastIndex );
+
+ // Push TextNodes and EntityNodes for any text found between tags
+ if( text ) {
+ textAndEntityNodes = this.parseTextAndEntityNodes( lastIndex, text );
+ nodes.push.apply( nodes, textAndEntityNodes );
+ }
+ }
+
+ return nodes;
+ },
+
+
+ /**
+ * Parses text and HTML entity nodes from a given string. The input string
+ * should not have any HTML tags (elements) within it.
+ *
+ * @private
+ * @param {Number} offset The offset of the text node match within the
+ * original HTML string.
+ * @param {String} text The string of text to parse. This is from an HTML
+ * text node.
+ * @return {Autolinker.htmlParser.HtmlNode[]} An array of HtmlNodes to
+ * represent the {@link Autolinker.htmlParser.TextNode TextNodes} and
+ * {@link Autolinker.htmlParser.EntityNode EntityNodes} found.
+ */
+ parseTextAndEntityNodes : function( offset, text ) {
+ var nodes = [],
+ textAndEntityTokens = Autolinker.Util.splitAndCapture( text, this.htmlCharacterEntitiesRegex ); // split at HTML entities, but include the HTML entities in the results array
+
+ // Every even numbered token is a TextNode, and every odd numbered token is an EntityNode
+ // For example: an input `text` of "Test "this" today" would turn into the
+ // `textAndEntityTokens`: [ 'Test ', '"', 'this', '"', ' today' ]
+ for( var i = 0, len = textAndEntityTokens.length; i < len; i += 2 ) {
+ var textToken = textAndEntityTokens[ i ],
+ entityToken = textAndEntityTokens[ i + 1 ];
+
+ if( textToken ) {
+ nodes.push( this.createTextNode( offset, textToken ) );
+ offset += textToken.length;
+ }
+ if( entityToken ) {
+ nodes.push( this.createEntityNode( offset, entityToken ) );
+ offset += entityToken.length;
+ }
+ }
+ return nodes;
+ },
+
+
+ /**
+ * Factory method to create an {@link Autolinker.htmlParser.CommentNode CommentNode}.
+ *
+ * @private
+ * @param {Number} offset The offset of the match within the original HTML
+ * string.
+ * @param {String} tagText The full text of the tag (comment) that was
+ * matched, including its <!-- and -->.
+ * @param {String} commentText The full text of the comment that was matched.
+ */
+ createCommentNode : function( offset, tagText, commentText ) {
+ return new Autolinker.htmlParser.CommentNode( {
+ offset : offset,
+ text : tagText,
+ comment: Autolinker.Util.trim( commentText )
+ } );
+ },
+
+
+ /**
+ * Factory method to create an {@link Autolinker.htmlParser.ElementNode ElementNode}.
+ *
+ * @private
+ * @param {Number} offset The offset of the match within the original HTML
+ * string.
+ * @param {String} tagText The full text of the tag (element) that was
+ * matched, including its attributes.
+ * @param {String} tagName The name of the tag. Ex: An <img> tag would
+ * be passed to this method as "img".
+ * @param {Boolean} isClosingTag `true` if it's a closing tag, false
+ * otherwise.
+ * @return {Autolinker.htmlParser.ElementNode}
+ */
+ createElementNode : function( offset, tagText, tagName, isClosingTag ) {
+ return new Autolinker.htmlParser.ElementNode( {
+ offset : offset,
+ text : tagText,
+ tagName : tagName.toLowerCase(),
+ closing : isClosingTag
+ } );
+ },
+
+
+ /**
+ * Factory method to create a {@link Autolinker.htmlParser.EntityNode EntityNode}.
+ *
+ * @private
+ * @param {Number} offset The offset of the match within the original HTML
+ * string.
+ * @param {String} text The text that was matched for the HTML entity (such
+ * as ' ').
+ * @return {Autolinker.htmlParser.EntityNode}
+ */
+ createEntityNode : function( offset, text ) {
+ return new Autolinker.htmlParser.EntityNode( { offset: offset, text: text } );
+ },
+
+
+ /**
+ * Factory method to create a {@link Autolinker.htmlParser.TextNode TextNode}.
+ *
+ * @private
+ * @param {Number} offset The offset of the match within the original HTML
+ * string.
+ * @param {String} text The text that was matched.
+ * @return {Autolinker.htmlParser.TextNode}
+ */
+ createTextNode : function( offset, text ) {
+ return new Autolinker.htmlParser.TextNode( { offset: offset, text: text } );
+ }
+} );
+/*global Autolinker */
/**
- * Dispatch a request to the server using the configured adapter.
+ * @abstract
+ * @class Autolinker.htmlParser.HtmlNode
*
- * @param {object} config The config that is to be used for the request
- * @returns {Promise} The Promise to be fulfilled
+ * Represents an HTML node found in an input string. An HTML node is one of the
+ * following:
+ *
+ * 1. An {@link Autolinker.htmlParser.ElementNode ElementNode}, which represents
+ * HTML tags.
+ * 2. A {@link Autolinker.htmlParser.CommentNode CommentNode}, which represents
+ * HTML comments.
+ * 3. A {@link Autolinker.htmlParser.TextNode TextNode}, which represents text
+ * outside or within HTML tags.
+ * 4. A {@link Autolinker.htmlParser.EntityNode EntityNode}, which represents
+ * one of the known HTML entities that Autolinker looks for. This includes
+ * common ones such as " and
*/
-module.exports = function dispatchRequest(config) {
- throwIfCancellationRequested(config);
+Autolinker.htmlParser.HtmlNode = Autolinker.Util.extend( Object, {
- // Ensure headers exist
- config.headers = config.headers || {};
+ /**
+ * @cfg {Number} offset (required)
+ *
+ * The offset of the HTML node in the original text that was parsed.
+ */
+ offset : undefined,
- // Transform request data
- config.data = transformData(
- config.data,
- config.headers,
- config.transformRequest
- );
+ /**
+ * @cfg {String} text (required)
+ *
+ * The text that was matched for the HtmlNode.
+ *
+ * - In the case of an {@link Autolinker.htmlParser.ElementNode ElementNode},
+ * this will be the tag's text.
+ * - In the case of an {@link Autolinker.htmlParser.CommentNode CommentNode},
+ * this will be the comment's text.
+ * - In the case of a {@link Autolinker.htmlParser.TextNode TextNode}, this
+ * will be the text itself.
+ * - In the case of a {@link Autolinker.htmlParser.EntityNode EntityNode},
+ * this will be the text of the HTML entity.
+ */
+ text : undefined,
- // Flatten headers
- config.headers = utils.merge(
- config.headers.common || {},
- config.headers[config.method] || {},
- config.headers
- );
- utils.forEach(
- ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
- function cleanHeaderConfig(method) {
- delete config.headers[method];
- }
- );
+ /**
+ * @constructor
+ * @param {Object} cfg The configuration properties for the Match instance,
+ * specified in an Object (map).
+ */
+ constructor : function( cfg ) {
+ Autolinker.Util.assign( this, cfg );
+
+ if( this.offset == null ) throw new Error( '`offset` cfg required' );
+ if( this.text == null ) throw new Error( '`text` cfg required' );
+ },
- var adapter = config.adapter || defaults.adapter;
- return adapter(config).then(function onAdapterResolution(response) {
- throwIfCancellationRequested(config);
+ /**
+ * Returns a string name for the type of node that this class represents.
+ *
+ * @abstract
+ * @return {String}
+ */
+ getType : Autolinker.Util.abstractMethod,
- // Transform response data
- response.data = transformData(
- response.data,
- response.headers,
- config.transformResponse
- );
- return response;
- }, function onAdapterRejection(reason) {
- if (!isCancel(reason)) {
- throwIfCancellationRequested(config);
+ /**
+ * Retrieves the {@link #offset} of the HtmlNode. This is the offset of the
+ * HTML node in the original string that was parsed.
+ *
+ * @return {Number}
+ */
+ getOffset : function() {
+ return this.offset;
+ },
- // Transform response data
- if (reason && reason.response) {
- reason.response.data = transformData(
- reason.response.data,
- reason.response.headers,
- config.transformResponse
- );
- }
- }
- return Promise.reject(reason);
- });
-};
+ /**
+ * Retrieves the {@link #text} for the HtmlNode.
+ *
+ * @return {String}
+ */
+ getText : function() {
+ return this.text;
+ }
+
+} );
+/*global Autolinker */
+/**
+ * @class Autolinker.htmlParser.CommentNode
+ * @extends Autolinker.htmlParser.HtmlNode
+ *
+ * Represents an HTML comment node that has been parsed by the
+ * {@link Autolinker.htmlParser.HtmlParser}.
+ *
+ * See this class's superclass ({@link Autolinker.htmlParser.HtmlNode}) for more
+ * details.
+ */
+Autolinker.htmlParser.CommentNode = Autolinker.Util.extend( Autolinker.htmlParser.HtmlNode, {
+ /**
+ * @cfg {String} comment (required)
+ *
+ * The text inside the comment tag. This text is stripped of any leading or
+ * trailing whitespace.
+ */
+ comment : '',
-/***/ }),
-/***/ 1516:
-/***/ ((module) => {
+ /**
+ * Returns a string name for the type of node that this class represents.
+ *
+ * @return {String}
+ */
+ getType : function() {
+ return 'comment';
+ },
-"use strict";
+ /**
+ * Returns the comment inside the comment tag.
+ *
+ * @return {String}
+ */
+ getComment : function() {
+ return this.comment;
+ }
+} );
+/*global Autolinker */
/**
- * Update an Error with the specified config, error code, and response.
+ * @class Autolinker.htmlParser.ElementNode
+ * @extends Autolinker.htmlParser.HtmlNode
*
- * @param {Error} error The error to update.
- * @param {Object} config The config.
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
- * @param {Object} [request] The request.
- * @param {Object} [response] The response.
- * @returns {Error} The error.
+ * Represents an HTML element node that has been parsed by the {@link Autolinker.htmlParser.HtmlParser}.
+ *
+ * See this class's superclass ({@link Autolinker.htmlParser.HtmlNode}) for more
+ * details.
*/
-module.exports = function enhanceError(error, config, code, request, response) {
- error.config = config;
- if (code) {
- error.code = code;
- }
+Autolinker.htmlParser.ElementNode = Autolinker.Util.extend( Autolinker.htmlParser.HtmlNode, {
- error.request = request;
- error.response = response;
- error.isAxiosError = true;
+ /**
+ * @cfg {String} tagName (required)
+ *
+ * The name of the tag that was matched.
+ */
+ tagName : '',
- error.toJSON = function() {
- return {
- // Standard
- message: this.message,
- name: this.name,
- // Microsoft
- description: this.description,
- number: this.number,
- // Mozilla
- fileName: this.fileName,
- lineNumber: this.lineNumber,
- columnNumber: this.columnNumber,
- stack: this.stack,
- // Axios
- config: this.config,
- code: this.code
- };
- };
- return error;
-};
+ /**
+ * @cfg {Boolean} closing (required)
+ *
+ * `true` if the element (tag) is a closing tag, `false` if its an opening
+ * tag.
+ */
+ closing : false,
-/***/ }),
+ /**
+ * Returns a string name for the type of node that this class represents.
+ *
+ * @return {String}
+ */
+ getType : function() {
+ return 'element';
+ },
-/***/ 4831:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+ /**
+ * Returns the HTML element's (tag's) name. Ex: for an <img> tag,
+ * returns "img".
+ *
+ * @return {String}
+ */
+ getTagName : function() {
+ return this.tagName;
+ },
-var utils = __nccwpck_require__(328);
+ /**
+ * Determines if the HTML element (tag) is a closing tag. Ex: <div>
+ * returns `false`, while </div> returns `true`.
+ *
+ * @return {Boolean}
+ */
+ isClosing : function() {
+ return this.closing;
+ }
+} );
+/*global Autolinker */
/**
- * Config-specific merge-function which creates a new config-object
- * by merging two configuration objects together.
+ * @class Autolinker.htmlParser.EntityNode
+ * @extends Autolinker.htmlParser.HtmlNode
*
- * @param {Object} config1
- * @param {Object} config2
- * @returns {Object} New object resulting from merging config2 to config1
+ * Represents a known HTML entity node that has been parsed by the {@link Autolinker.htmlParser.HtmlParser}.
+ * Ex: ' ', or '&#160;' (which will be retrievable from the {@link #getText}
+ * method.
+ *
+ * Note that this class will only be returned from the HtmlParser for the set of
+ * checked HTML entity nodes defined by the {@link Autolinker.htmlParser.HtmlParser#htmlCharacterEntitiesRegex}.
+ *
+ * See this class's superclass ({@link Autolinker.htmlParser.HtmlNode}) for more
+ * details.
*/
-module.exports = function mergeConfig(config1, config2) {
- // eslint-disable-next-line no-param-reassign
- config2 = config2 || {};
- var config = {};
+Autolinker.htmlParser.EntityNode = Autolinker.Util.extend( Autolinker.htmlParser.HtmlNode, {
- var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];
- var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];
- var defaultToConfig2Keys = [
- 'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer',
- 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
- 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress',
- 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent',
- 'httpsAgent', 'cancelToken', 'socketPath'
- ];
+ /**
+ * Returns a string name for the type of node that this class represents.
+ *
+ * @return {String}
+ */
+ getType : function() {
+ return 'entity';
+ }
- utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
- if (typeof config2[prop] !== 'undefined') {
- config[prop] = config2[prop];
- }
- });
+} );
+/*global Autolinker */
+/**
+ * @class Autolinker.htmlParser.TextNode
+ * @extends Autolinker.htmlParser.HtmlNode
+ *
+ * Represents a text node that has been parsed by the {@link Autolinker.htmlParser.HtmlParser}.
+ *
+ * See this class's superclass ({@link Autolinker.htmlParser.HtmlNode}) for more
+ * details.
+ */
+Autolinker.htmlParser.TextNode = Autolinker.Util.extend( Autolinker.htmlParser.HtmlNode, {
- utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {
- if (utils.isObject(config2[prop])) {
- config[prop] = utils.deepMerge(config1[prop], config2[prop]);
- } else if (typeof config2[prop] !== 'undefined') {
- config[prop] = config2[prop];
- } else if (utils.isObject(config1[prop])) {
- config[prop] = utils.deepMerge(config1[prop]);
- } else if (typeof config1[prop] !== 'undefined') {
- config[prop] = config1[prop];
- }
- });
+ /**
+ * Returns a string name for the type of node that this class represents.
+ *
+ * @return {String}
+ */
+ getType : function() {
+ return 'text';
+ }
- utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
- if (typeof config2[prop] !== 'undefined') {
- config[prop] = config2[prop];
- } else if (typeof config1[prop] !== 'undefined') {
- config[prop] = config1[prop];
- }
- });
+} );
+/*global Autolinker */
+/**
+ * @abstract
+ * @class Autolinker.match.Match
+ *
+ * Represents a match found in an input string which should be Autolinked. A Match object is what is provided in a
+ * {@link Autolinker#replaceFn replaceFn}, and may be used to query for details about the match.
+ *
+ * For example:
+ *
+ * var input = "..."; // string with URLs, Email Addresses, and Twitter Handles
+ *
+ * var linkedText = Autolinker.link( input, {
+ * replaceFn : function( autolinker, match ) {
+ * console.log( "href = ", match.getAnchorHref() );
+ * console.log( "text = ", match.getAnchorText() );
+ *
+ * switch( match.getType() ) {
+ * case 'url' :
+ * console.log( "url: ", match.getUrl() );
+ *
+ * case 'email' :
+ * console.log( "email: ", match.getEmail() );
+ *
+ * case 'twitter' :
+ * console.log( "twitter: ", match.getTwitterHandle() );
+ * }
+ * }
+ * } );
+ *
+ * See the {@link Autolinker} class for more details on using the {@link Autolinker#replaceFn replaceFn}.
+ */
+Autolinker.match.Match = Autolinker.Util.extend( Object, {
- var axiosKeys = valueFromConfig2Keys
- .concat(mergeDeepPropertiesKeys)
- .concat(defaultToConfig2Keys);
+ /**
+ * @cfg {Autolinker.AnchorTagBuilder} tagBuilder (required)
+ *
+ * Reference to the AnchorTagBuilder instance to use to generate an anchor
+ * tag for the Match.
+ */
- var otherKeys = Object
- .keys(config2)
- .filter(function filterAxiosKeys(key) {
- return axiosKeys.indexOf(key) === -1;
- });
+ /**
+ * @cfg {String} matchedText (required)
+ *
+ * The original text that was matched by the {@link Autolinker.matcher.Matcher}.
+ */
- utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {
- if (typeof config2[prop] !== 'undefined') {
- config[prop] = config2[prop];
- } else if (typeof config1[prop] !== 'undefined') {
- config[prop] = config1[prop];
- }
- });
+ /**
+ * @cfg {Number} offset (required)
+ *
+ * The offset of where the match was made in the input string.
+ */
- return config;
-};
+ /**
+ * @constructor
+ * @param {Object} cfg The configuration properties for the Match
+ * instance, specified in an Object (map).
+ */
+ constructor : function( cfg ) {
+ if( cfg.tagBuilder == null ) throw new Error( '`tagBuilder` cfg required' );
+ if( cfg.matchedText == null ) throw new Error( '`matchedText` cfg required' );
+ if( cfg.offset == null ) throw new Error( '`offset` cfg required' );
+
+ this.tagBuilder = cfg.tagBuilder;
+ this.matchedText = cfg.matchedText;
+ this.offset = cfg.offset;
+ },
-/***/ }),
-/***/ 3211:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ /**
+ * Returns a string name for the type of match that this class represents.
+ *
+ * @abstract
+ * @return {String}
+ */
+ getType : Autolinker.Util.abstractMethod,
-"use strict";
+ /**
+ * Returns the original text that was matched.
+ *
+ * @return {String}
+ */
+ getMatchedText : function() {
+ return this.matchedText;
+ },
-var createError = __nccwpck_require__(5226);
-/**
- * Resolve or reject a Promise based on response status.
- *
- * @param {Function} resolve A function that resolves the promise.
- * @param {Function} reject A function that rejects the promise.
- * @param {object} response The response.
- */
-module.exports = function settle(resolve, reject, response) {
- var validateStatus = response.config.validateStatus;
- if (!validateStatus || validateStatus(response.status)) {
- resolve(response);
- } else {
- reject(createError(
- 'Request failed with status code ' + response.status,
- response.config,
- null,
- response.request,
- response
- ));
- }
-};
+ /**
+ * Sets the {@link #offset} of where the match was made in the input string.
+ *
+ * A {@link Autolinker.matcher.Matcher} will be fed only HTML text nodes,
+ * and will therefore set an original offset that is relative to the HTML
+ * text node itself. However, we want this offset to be relative to the full
+ * HTML input string, and thus if using {@link Autolinker#parse} (rather
+ * than calling a {@link Autolinker.matcher.Matcher} directly), then this
+ * offset is corrected after the Matcher itself has done its job.
+ *
+ * @param {Number} offset
+ */
+ setOffset : function( offset ) {
+ this.offset = offset;
+ },
-/***/ }),
+ /**
+ * Returns the offset of where the match was made in the input string. This
+ * is the 0-based index of the match.
+ *
+ * @return {Number}
+ */
+ getOffset : function() {
+ return this.offset;
+ },
-/***/ 9812:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+ /**
+ * Returns the anchor href that should be generated for the match.
+ *
+ * @abstract
+ * @return {String}
+ */
+ getAnchorHref : Autolinker.Util.abstractMethod,
+
+
+ /**
+ * Returns the anchor text that should be generated for the match.
+ *
+ * @abstract
+ * @return {String}
+ */
+ getAnchorText : Autolinker.Util.abstractMethod,
-var utils = __nccwpck_require__(328);
+ /**
+ * Builds and returns an {@link Autolinker.HtmlTag} instance based on the
+ * Match.
+ *
+ * This can be used to easily generate anchor tags from matches, and either
+ * return their HTML string, or modify them before doing so.
+ *
+ * Example Usage:
+ *
+ * var tag = match.buildTag();
+ * tag.addClass( 'cordova-link' );
+ * tag.setAttr( 'target', '_system' );
+ *
+ * tag.toAnchorString(); // Google
+ */
+ buildTag : function() {
+ return this.tagBuilder.build( this );
+ }
+} );
+/*global Autolinker */
/**
- * Transform the data for a request or a response
+ * @class Autolinker.match.Email
+ * @extends Autolinker.match.Match
*
- * @param {Object|String} data The data to be transformed
- * @param {Array} headers The headers for the request or response
- * @param {Array|Function} fns A single function or Array of functions
- * @returns {*} The resulting transformed data
+ * Represents a Email match found in an input string which should be Autolinked.
+ *
+ * See this class's superclass ({@link Autolinker.match.Match}) for more details.
*/
-module.exports = function transformData(data, headers, fns) {
- /*eslint no-param-reassign:0*/
- utils.forEach(fns, function transform(fn) {
- data = fn(data, headers);
- });
+Autolinker.match.Email = Autolinker.Util.extend( Autolinker.match.Match, {
- return data;
-};
+ /**
+ * @cfg {String} email (required)
+ *
+ * The email address that was matched.
+ */
-/***/ }),
+ /**
+ * @constructor
+ * @param {Object} cfg The configuration properties for the Match
+ * instance, specified in an Object (map).
+ */
+ constructor : function( cfg ) {
+ Autolinker.match.Match.prototype.constructor.call( this, cfg );
-/***/ 8190:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ if( !cfg.email ) throw new Error( '`email` cfg required' );
-"use strict";
+ this.email = cfg.email;
+ },
-var utils = __nccwpck_require__(328);
-var normalizeHeaderName = __nccwpck_require__(6240);
+ /**
+ * Returns a string name for the type of match that this class represents.
+ *
+ * @return {String}
+ */
+ getType : function() {
+ return 'email';
+ },
-var DEFAULT_CONTENT_TYPE = {
- 'Content-Type': 'application/x-www-form-urlencoded'
-};
-function setContentTypeIfUnset(headers, value) {
- if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
- headers['Content-Type'] = value;
- }
-}
+ /**
+ * Returns the email address that was matched.
+ *
+ * @return {String}
+ */
+ getEmail : function() {
+ return this.email;
+ },
-function getDefaultAdapter() {
- var adapter;
- if (typeof XMLHttpRequest !== 'undefined') {
- // For browsers use XHR adapter
- adapter = __nccwpck_require__(3454);
- } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
- // For node use HTTP adapter
- adapter = __nccwpck_require__(8104);
- }
- return adapter;
-}
-var defaults = {
- adapter: getDefaultAdapter(),
+ /**
+ * Returns the anchor href that should be generated for the match.
+ *
+ * @return {String}
+ */
+ getAnchorHref : function() {
+ return 'mailto:' + this.email;
+ },
- transformRequest: [function transformRequest(data, headers) {
- normalizeHeaderName(headers, 'Accept');
- normalizeHeaderName(headers, 'Content-Type');
- if (utils.isFormData(data) ||
- utils.isArrayBuffer(data) ||
- utils.isBuffer(data) ||
- utils.isStream(data) ||
- utils.isFile(data) ||
- utils.isBlob(data)
- ) {
- return data;
- }
- if (utils.isArrayBufferView(data)) {
- return data.buffer;
- }
- if (utils.isURLSearchParams(data)) {
- setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
- return data.toString();
- }
- if (utils.isObject(data)) {
- setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
- return JSON.stringify(data);
- }
- return data;
- }],
- transformResponse: [function transformResponse(data) {
- /*eslint no-param-reassign:0*/
- if (typeof data === 'string') {
- try {
- data = JSON.parse(data);
- } catch (e) { /* Ignore */ }
- }
- return data;
- }],
+ /**
+ * Returns the anchor text that should be generated for the match.
+ *
+ * @return {String}
+ */
+ getAnchorText : function() {
+ return this.email;
+ }
- /**
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
- * timeout is not created.
- */
- timeout: 0,
+} );
+/*global Autolinker */
+/**
+ * @class Autolinker.match.Hashtag
+ * @extends Autolinker.match.Match
+ *
+ * Represents a Hashtag match found in an input string which should be
+ * Autolinked.
+ *
+ * See this class's superclass ({@link Autolinker.match.Match}) for more
+ * details.
+ */
+Autolinker.match.Hashtag = Autolinker.Util.extend( Autolinker.match.Match, {
- xsrfCookieName: 'XSRF-TOKEN',
- xsrfHeaderName: 'X-XSRF-TOKEN',
+ /**
+ * @cfg {String} serviceName
+ *
+ * The service to point hashtag matches to. See {@link Autolinker#hashtag}
+ * for available values.
+ */
- maxContentLength: -1,
+ /**
+ * @cfg {String} hashtag (required)
+ *
+ * The Hashtag that was matched, without the '#'.
+ */
- validateStatus: function validateStatus(status) {
- return status >= 200 && status < 300;
- }
-};
-defaults.headers = {
- common: {
- 'Accept': 'application/json, text/plain, */*'
- }
-};
+ /**
+ * @constructor
+ * @param {Object} cfg The configuration properties for the Match
+ * instance, specified in an Object (map).
+ */
+ constructor : function( cfg ) {
+ Autolinker.match.Match.prototype.constructor.call( this, cfg );
+
+ // TODO: if( !serviceName ) throw new Error( '`serviceName` cfg required' );
+ if( !cfg.hashtag ) throw new Error( '`hashtag` cfg required' );
+
+ this.serviceName = cfg.serviceName;
+ this.hashtag = cfg.hashtag;
+ },
-utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
- defaults.headers[method] = {};
-});
-utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
- defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
-});
+ /**
+ * Returns the type of match that this class represents.
+ *
+ * @return {String}
+ */
+ getType : function() {
+ return 'hashtag';
+ },
-module.exports = defaults;
+ /**
+ * Returns the configured {@link #serviceName} to point the Hashtag to.
+ * Ex: 'facebook', 'twitter'.
+ *
+ * @return {String}
+ */
+ getServiceName : function() {
+ return this.serviceName;
+ },
-/***/ }),
-/***/ 7065:
-/***/ ((module) => {
+ /**
+ * Returns the matched hashtag, without the '#' character.
+ *
+ * @return {String}
+ */
+ getHashtag : function() {
+ return this.hashtag;
+ },
-"use strict";
+ /**
+ * Returns the anchor href that should be generated for the match.
+ *
+ * @return {String}
+ */
+ getAnchorHref : function() {
+ var serviceName = this.serviceName,
+ hashtag = this.hashtag;
+
+ switch( serviceName ) {
+ case 'twitter' :
+ return 'https://twitter.com/hashtag/' + hashtag;
+ case 'facebook' :
+ return 'https://www.facebook.com/hashtag/' + hashtag;
+ case 'instagram' :
+ return 'https://instagram.com/explore/tags/' + hashtag;
+
+ default : // Shouldn't happen because Autolinker's constructor should block any invalid values, but just in case.
+ throw new Error( 'Unknown service name to point hashtag to: ', serviceName );
+ }
+ },
-module.exports = function bind(fn, thisArg) {
- return function wrap() {
- var args = new Array(arguments.length);
- for (var i = 0; i < args.length; i++) {
- args[i] = arguments[i];
- }
- return fn.apply(thisArg, args);
- };
-};
+ /**
+ * Returns the anchor text that should be generated for the match.
+ *
+ * @return {String}
+ */
+ getAnchorText : function() {
+ return '#' + this.hashtag;
+ }
-/***/ }),
+} );
-/***/ 646:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/*global Autolinker */
+/**
+ * @class Autolinker.match.Phone
+ * @extends Autolinker.match.Match
+ *
+ * Represents a Phone number match found in an input string which should be
+ * Autolinked.
+ *
+ * See this class's superclass ({@link Autolinker.match.Match}) for more
+ * details.
+ */
+Autolinker.match.Phone = Autolinker.Util.extend( Autolinker.match.Match, {
-"use strict";
+ /**
+ * @protected
+ * @property {String} number (required)
+ *
+ * The phone number that was matched, without any delimiter characters.
+ *
+ * Note: This is a string to allow for prefixed 0's.
+ */
+ /**
+ * @protected
+ * @property {Boolean} plusSign (required)
+ *
+ * `true` if the matched phone number started with a '+' sign. We'll include
+ * it in the `tel:` URL if so, as this is needed for international numbers.
+ *
+ * Ex: '+1 (123) 456 7879'
+ */
-var utils = __nccwpck_require__(328);
-function encode(val) {
- return encodeURIComponent(val).
- replace(/%40/gi, '@').
- replace(/%3A/gi, ':').
- replace(/%24/g, '$').
- replace(/%2C/gi, ',').
- replace(/%20/g, '+').
- replace(/%5B/gi, '[').
- replace(/%5D/gi, ']');
-}
+ /**
+ * @constructor
+ * @param {Object} cfg The configuration properties for the Match
+ * instance, specified in an Object (map).
+ */
+ constructor : function( cfg ) {
+ Autolinker.match.Match.prototype.constructor.call( this, cfg );
+
+ if( !cfg.number ) throw new Error( '`number` cfg required' );
+ if( cfg.plusSign == null ) throw new Error( '`plusSign` cfg required' );
+
+ this.number = cfg.number;
+ this.plusSign = cfg.plusSign;
+ },
+
+
+ /**
+ * Returns a string name for the type of match that this class represents.
+ *
+ * @return {String}
+ */
+ getType : function() {
+ return 'phone';
+ },
+
+
+ /**
+ * Returns the phone number that was matched as a string, without any
+ * delimiter characters.
+ *
+ * Note: This is a string to allow for prefixed 0's.
+ *
+ * @return {String}
+ */
+ getNumber: function() {
+ return this.number;
+ },
+
+
+ /**
+ * Returns the anchor href that should be generated for the match.
+ *
+ * @return {String}
+ */
+ getAnchorHref : function() {
+ return 'tel:' + ( this.plusSign ? '+' : '' ) + this.number;
+ },
+
+
+ /**
+ * Returns the anchor text that should be generated for the match.
+ *
+ * @return {String}
+ */
+ getAnchorText : function() {
+ return this.matchedText;
+ }
+
+} );
+/*global Autolinker */
/**
- * Build a URL by appending params to the end
+ * @class Autolinker.match.Twitter
+ * @extends Autolinker.match.Match
*
- * @param {string} url The base of the url (e.g., http://www.google.com)
- * @param {object} [params] The params to be appended
- * @returns {string} The formatted url
+ * Represents a Twitter match found in an input string which should be Autolinked.
+ *
+ * See this class's superclass ({@link Autolinker.match.Match}) for more details.
*/
-module.exports = function buildURL(url, params, paramsSerializer) {
- /*eslint no-param-reassign:0*/
- if (!params) {
- return url;
- }
+Autolinker.match.Twitter = Autolinker.Util.extend( Autolinker.match.Match, {
- var serializedParams;
- if (paramsSerializer) {
- serializedParams = paramsSerializer(params);
- } else if (utils.isURLSearchParams(params)) {
- serializedParams = params.toString();
- } else {
- var parts = [];
+ /**
+ * @cfg {String} twitterHandle (required)
+ *
+ * The Twitter handle that was matched, without the '@' character.
+ */
- utils.forEach(params, function serialize(val, key) {
- if (val === null || typeof val === 'undefined') {
- return;
- }
- if (utils.isArray(val)) {
- key = key + '[]';
- } else {
- val = [val];
- }
+ /**
+ * @constructor
+ * @param {Object} cfg The configuration properties for the Match
+ * instance, specified in an Object (map).
+ */
+ constructor : function( cfg) {
+ Autolinker.match.Match.prototype.constructor.call( this, cfg );
- utils.forEach(val, function parseValue(v) {
- if (utils.isDate(v)) {
- v = v.toISOString();
- } else if (utils.isObject(v)) {
- v = JSON.stringify(v);
- }
- parts.push(encode(key) + '=' + encode(v));
- });
- });
+ if( !cfg.twitterHandle ) throw new Error( '`twitterHandle` cfg required' );
- serializedParams = parts.join('&');
- }
+ this.twitterHandle = cfg.twitterHandle;
+ },
- if (serializedParams) {
- var hashmarkIndex = url.indexOf('#');
- if (hashmarkIndex !== -1) {
- url = url.slice(0, hashmarkIndex);
- }
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
- }
+ /**
+ * Returns the type of match that this class represents.
+ *
+ * @return {String}
+ */
+ getType : function() {
+ return 'twitter';
+ },
- return url;
-};
+ /**
+ * Returns the twitter handle, without the '@' character.
+ *
+ * @return {String}
+ */
+ getTwitterHandle : function() {
+ return this.twitterHandle;
+ },
-/***/ }),
-/***/ 7189:
-/***/ ((module) => {
+ /**
+ * Returns the anchor href that should be generated for the match.
+ *
+ * @return {String}
+ */
+ getAnchorHref : function() {
+ return 'https://twitter.com/' + this.twitterHandle;
+ },
-"use strict";
+ /**
+ * Returns the anchor text that should be generated for the match.
+ *
+ * @return {String}
+ */
+ getAnchorText : function() {
+ return '@' + this.twitterHandle;
+ }
+} );
+/*global Autolinker */
/**
- * Creates a new URL by combining the specified URLs
+ * @class Autolinker.match.Url
+ * @extends Autolinker.match.Match
*
- * @param {string} baseURL The base URL
- * @param {string} relativeURL The relative URL
- * @returns {string} The combined URL
+ * Represents a Url match found in an input string which should be Autolinked.
+ *
+ * See this class's superclass ({@link Autolinker.match.Match}) for more details.
*/
-module.exports = function combineURLs(baseURL, relativeURL) {
- return relativeURL
- ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
- : baseURL;
-};
+Autolinker.match.Url = Autolinker.Util.extend( Autolinker.match.Match, {
+ /**
+ * @cfg {String} url (required)
+ *
+ * The url that was matched.
+ */
-/***/ }),
+ /**
+ * @cfg {"scheme"/"www"/"tld"} urlMatchType (required)
+ *
+ * The type of URL match that this class represents. This helps to determine
+ * if the match was made in the original text with a prefixed scheme (ex:
+ * 'http://www.google.com'), a prefixed 'www' (ex: 'www.google.com'), or
+ * was matched by a known top-level domain (ex: 'google.com').
+ */
-/***/ 1545:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ /**
+ * @cfg {Boolean} protocolUrlMatch (required)
+ *
+ * `true` if the URL is a match which already has a protocol (i.e.
+ * 'http://'), `false` if the match was from a 'www' or known TLD match.
+ */
-"use strict";
+ /**
+ * @cfg {Boolean} protocolRelativeMatch (required)
+ *
+ * `true` if the URL is a protocol-relative match. A protocol-relative match
+ * is a URL that starts with '//', and will be either http:// or https://
+ * based on the protocol that the site is loaded under.
+ */
+ /**
+ * @cfg {Boolean} stripPrefix (required)
+ * @inheritdoc Autolinker#cfg-stripPrefix
+ */
-var utils = __nccwpck_require__(328);
-module.exports = (
- utils.isStandardBrowserEnv() ?
+ /**
+ * @constructor
+ * @param {Object} cfg The configuration properties for the Match
+ * instance, specified in an Object (map).
+ */
+ constructor : function( cfg ) {
+ Autolinker.match.Match.prototype.constructor.call( this, cfg );
+
+ if( cfg.urlMatchType !== 'scheme' && cfg.urlMatchType !== 'www' && cfg.urlMatchType !== 'tld' ) throw new Error( '`urlMatchType` cfg must be one of: "scheme", "www", or "tld"' );
+ if( !cfg.url ) throw new Error( '`url` cfg required' );
+ if( cfg.protocolUrlMatch == null ) throw new Error( '`protocolUrlMatch` cfg required' );
+ if( cfg.protocolRelativeMatch == null ) throw new Error( '`protocolRelativeMatch` cfg required' );
+ if( cfg.stripPrefix == null ) throw new Error( '`stripPrefix` cfg required' );
+
+ this.urlMatchType = cfg.urlMatchType;
+ this.url = cfg.url;
+ this.protocolUrlMatch = cfg.protocolUrlMatch;
+ this.protocolRelativeMatch = cfg.protocolRelativeMatch;
+ this.stripPrefix = cfg.stripPrefix;
+ },
- // Standard browser envs support document.cookie
- (function standardBrowserEnv() {
- return {
- write: function write(name, value, expires, path, domain, secure) {
- var cookie = [];
- cookie.push(name + '=' + encodeURIComponent(value));
- if (utils.isNumber(expires)) {
- cookie.push('expires=' + new Date(expires).toGMTString());
- }
+ /**
+ * @private
+ * @property {RegExp} urlPrefixRegex
+ *
+ * A regular expression used to remove the 'http://' or 'https://' and/or the 'www.' from URLs.
+ */
+ urlPrefixRegex: /^(https?:\/\/)?(www\.)?/i,
- if (utils.isString(path)) {
- cookie.push('path=' + path);
- }
+ /**
+ * @private
+ * @property {RegExp} protocolRelativeRegex
+ *
+ * The regular expression used to remove the protocol-relative '//' from the {@link #url} string, for purposes
+ * of {@link #getAnchorText}. A protocol-relative URL is, for example, "//yahoo.com"
+ */
+ protocolRelativeRegex : /^\/\//,
- if (utils.isString(domain)) {
- cookie.push('domain=' + domain);
- }
+ /**
+ * @private
+ * @property {Boolean} protocolPrepended
+ *
+ * Will be set to `true` if the 'http://' protocol has been prepended to the {@link #url} (because the
+ * {@link #url} did not have a protocol)
+ */
+ protocolPrepended : false,
- if (secure === true) {
- cookie.push('secure');
- }
- document.cookie = cookie.join('; ');
- },
+ /**
+ * Returns a string name for the type of match that this class represents.
+ *
+ * @return {String}
+ */
+ getType : function() {
+ return 'url';
+ },
- read: function read(name) {
- var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
- return (match ? decodeURIComponent(match[3]) : null);
- },
- remove: function remove(name) {
- this.write(name, '', Date.now() - 86400000);
- }
- };
- })() :
+ /**
+ * Returns a string name for the type of URL match that this class
+ * represents.
+ *
+ * This helps to determine if the match was made in the original text with a
+ * prefixed scheme (ex: 'http://www.google.com'), a prefixed 'www' (ex:
+ * 'www.google.com'), or was matched by a known top-level domain (ex:
+ * 'google.com').
+ *
+ * @return {"scheme"/"www"/"tld"}
+ */
+ getUrlMatchType : function() {
+ return this.urlMatchType;
+ },
- // Non standard browser env (web workers, react-native) lack needed support.
- (function nonStandardBrowserEnv() {
- return {
- write: function write() {},
- read: function read() { return null; },
- remove: function remove() {}
- };
- })()
-);
+ /**
+ * Returns the url that was matched, assuming the protocol to be 'http://' if the original
+ * match was missing a protocol.
+ *
+ * @return {String}
+ */
+ getUrl : function() {
+ var url = this.url;
+
+ // if the url string doesn't begin with a protocol, assume 'http://'
+ if( !this.protocolRelativeMatch && !this.protocolUrlMatch && !this.protocolPrepended ) {
+ url = this.url = 'http://' + url;
+
+ this.protocolPrepended = true;
+ }
-/***/ }),
+ return url;
+ },
-/***/ 1301:
-/***/ ((module) => {
-"use strict";
+ /**
+ * Returns the anchor href that should be generated for the match.
+ *
+ * @return {String}
+ */
+ getAnchorHref : function() {
+ var url = this.getUrl();
+
+ return url.replace( /&/g, '&' ); // any &'s in the URL should be converted back to '&' if they were displayed as & in the source html
+ },
-/**
- * Determines whether the specified URL is absolute
- *
- * @param {string} url The URL to test
- * @returns {boolean} True if the specified URL is absolute, otherwise false
- */
-module.exports = function isAbsoluteURL(url) {
- // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL).
- // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
- // by any combination of letters, digits, plus, period, or hyphen.
- return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
-};
+ /**
+ * Returns the anchor text that should be generated for the match.
+ *
+ * @return {String}
+ */
+ getAnchorText : function() {
+ var anchorText = this.getMatchedText();
+
+ if( this.protocolRelativeMatch ) {
+ // Strip off any protocol-relative '//' from the anchor text
+ anchorText = this.stripProtocolRelativePrefix( anchorText );
+ }
+ if( this.stripPrefix ) {
+ anchorText = this.stripUrlPrefix( anchorText );
+ }
+ anchorText = this.removeTrailingSlash( anchorText ); // remove trailing slash, if there is one
+ return anchorText;
+ },
-/***/ }),
-/***/ 3608:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // ---------------------------------------
-"use strict";
+ // Utility Functionality
+ /**
+ * Strips the URL prefix (such as "http://" or "https://") from the given text.
+ *
+ * @private
+ * @param {String} text The text of the anchor that is being generated, for which to strip off the
+ * url prefix (such as stripping off "http://")
+ * @return {String} The `anchorText`, with the prefix stripped.
+ */
+ stripUrlPrefix : function( text ) {
+ return text.replace( this.urlPrefixRegex, '' );
+ },
-var utils = __nccwpck_require__(328);
-module.exports = (
- utils.isStandardBrowserEnv() ?
+ /**
+ * Strips any protocol-relative '//' from the anchor text.
+ *
+ * @private
+ * @param {String} text The text of the anchor that is being generated, for which to strip off the
+ * protocol-relative prefix (such as stripping off "//")
+ * @return {String} The `anchorText`, with the protocol-relative prefix stripped.
+ */
+ stripProtocolRelativePrefix : function( text ) {
+ return text.replace( this.protocolRelativeRegex, '' );
+ },
- // Standard browser envs have full support of the APIs needed to test
- // whether the request URL is of the same origin as current location.
- (function standardBrowserEnv() {
- var msie = /(msie|trident)/i.test(navigator.userAgent);
- var urlParsingNode = document.createElement('a');
- var originURL;
- /**
- * Parse a URL to discover it's components
- *
- * @param {String} url The URL to be parsed
- * @returns {Object}
- */
- function resolveURL(url) {
- var href = url;
+ /**
+ * Removes any trailing slash from the given `anchorText`, in preparation for the text to be displayed.
+ *
+ * @private
+ * @param {String} anchorText The text of the anchor that is being generated, for which to remove any trailing
+ * slash ('/') that may exist.
+ * @return {String} The `anchorText`, with the trailing slash removed.
+ */
+ removeTrailingSlash : function( anchorText ) {
+ if( anchorText.charAt( anchorText.length - 1 ) === '/' ) {
+ anchorText = anchorText.slice( 0, -1 );
+ }
+ return anchorText;
+ }
- if (msie) {
- // IE needs attribute set twice to normalize properties
- urlParsingNode.setAttribute('href', href);
- href = urlParsingNode.href;
- }
+} );
+/*global Autolinker */
+/**
+ * @abstract
+ * @class Autolinker.matcher.Matcher
+ *
+ * An abstract class and interface for individual matchers to find matches in
+ * an input string with linkified versions of them.
+ *
+ * Note that Matchers do not take HTML into account - they must be fed the text
+ * nodes of any HTML string, which is handled by {@link Autolinker#parse}.
+ */
+Autolinker.matcher.Matcher = Autolinker.Util.extend( Object, {
- urlParsingNode.setAttribute('href', href);
+ /**
+ * @cfg {Autolinker.AnchorTagBuilder} tagBuilder (required)
+ *
+ * Reference to the AnchorTagBuilder instance to use to generate HTML tags
+ * for {@link Autolinker.match.Match Matches}.
+ */
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
- return {
- href: urlParsingNode.href,
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
- host: urlParsingNode.host,
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
- hostname: urlParsingNode.hostname,
- port: urlParsingNode.port,
- pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
- urlParsingNode.pathname :
- '/' + urlParsingNode.pathname
- };
- }
- originURL = resolveURL(window.location.href);
+ /**
+ * @constructor
+ * @param {Object} cfg The configuration properties for the Matcher
+ * instance, specified in an Object (map).
+ */
+ constructor : function( cfg ) {
+ if( !cfg.tagBuilder ) throw new Error( '`tagBuilder` cfg required' );
+
+ this.tagBuilder = cfg.tagBuilder;
+ },
- /**
- * Determine if a URL shares the same origin as the current location
- *
- * @param {String} requestURL The URL to test
- * @returns {boolean} True if URL shares the same origin, otherwise false
- */
- return function isURLSameOrigin(requestURL) {
- var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
- return (parsed.protocol === originURL.protocol &&
- parsed.host === originURL.host);
- };
- })() :
- // Non standard browser envs (web workers, react-native) lack needed support.
- (function nonStandardBrowserEnv() {
- return function isURLSameOrigin() {
- return true;
- };
- })()
-);
+ /**
+ * Parses the input `text` and returns the array of {@link Autolinker.match.Match Matches}
+ * for the matcher.
+ *
+ * @abstract
+ * @param {String} text The text to scan and replace matches in.
+ * @return {Autolinker.match.Match[]}
+ */
+ parseMatches : Autolinker.Util.abstractMethod
+
+} );
+/*global Autolinker */
+/**
+ * @class Autolinker.matcher.Email
+ * @extends Autolinker.matcher.Matcher
+ *
+ * Matcher to find email matches in an input string.
+ *
+ * See this class's superclass ({@link Autolinker.matcher.Matcher}) for more details.
+ */
+Autolinker.matcher.Email = Autolinker.Util.extend( Autolinker.matcher.Matcher, {
+ /**
+ * The regular expression to match email addresses. Example match:
+ *
+ * person@place.com
+ *
+ * @private
+ * @property {RegExp} matcherRegex
+ */
+ matcherRegex : (function() {
+ var alphaNumericChars = Autolinker.RegexLib.alphaNumericCharsStr,
+ emailRegex = new RegExp( '[' + alphaNumericChars + '\\-_\';:&=+$.,]+@' ), // something@ for email addresses (a.k.a. local-part)
+ domainNameRegex = Autolinker.RegexLib.domainNameRegex,
+ tldRegex = Autolinker.RegexLib.tldRegex; // match our known top level domains (TLDs)
+
+ return new RegExp( [
+ emailRegex.source,
+ domainNameRegex.source,
+ '\\.', tldRegex.source // '.com', '.net', etc
+ ].join( "" ), 'gi' );
+ } )(),
-/***/ }),
-/***/ 6240:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ /**
+ * @inheritdoc
+ */
+ parseMatches : function( text ) {
+ var matcherRegex = this.matcherRegex,
+ tagBuilder = this.tagBuilder,
+ matches = [],
+ match;
+
+ while( ( match = matcherRegex.exec( text ) ) !== null ) {
+ var matchedText = match[ 0 ];
+
+ matches.push( new Autolinker.match.Email( {
+ tagBuilder : tagBuilder,
+ matchedText : matchedText,
+ offset : match.index,
+ email : matchedText
+ } ) );
+ }
-"use strict";
+ return matches;
+ }
+} );
+/*global Autolinker */
+/**
+ * @class Autolinker.matcher.Hashtag
+ * @extends Autolinker.matcher.Matcher
+ *
+ * Matcher to find Hashtag matches in an input string.
+ */
+Autolinker.matcher.Hashtag = Autolinker.Util.extend( Autolinker.matcher.Matcher, {
-var utils = __nccwpck_require__(328);
+ /**
+ * @cfg {String} serviceName
+ *
+ * The service to point hashtag matches to. See {@link Autolinker#hashtag}
+ * for available values.
+ */
-module.exports = function normalizeHeaderName(headers, normalizedName) {
- utils.forEach(headers, function processHeader(value, name) {
- if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
- headers[normalizedName] = value;
- delete headers[name];
- }
- });
-};
+ /**
+ * The regular expression to match Hashtags. Example match:
+ *
+ * #asdf
+ *
+ * @private
+ * @property {RegExp} matcherRegex
+ */
+ matcherRegex : new RegExp( '#[_' + Autolinker.RegexLib.alphaNumericCharsStr + ']{1,139}', 'g' ),
-/***/ }),
+ /**
+ * The regular expression to use to check the character before a username match to
+ * make sure we didn't accidentally match an email address.
+ *
+ * For example, the string "asdf@asdf.com" should not match "@asdf" as a username.
+ *
+ * @private
+ * @property {RegExp} nonWordCharRegex
+ */
+ nonWordCharRegex : new RegExp( '[^' + Autolinker.RegexLib.alphaNumericCharsStr + ']' ),
-/***/ 6455:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+ /**
+ * @constructor
+ * @param {Object} cfg The configuration properties for the Match instance,
+ * specified in an Object (map).
+ */
+ constructor : function( cfg ) {
+ Autolinker.matcher.Matcher.prototype.constructor.call( this, cfg );
+
+ this.serviceName = cfg.serviceName;
+ },
-var utils = __nccwpck_require__(328);
+ /**
+ * @inheritdoc
+ */
+ parseMatches : function( text ) {
+ var matcherRegex = this.matcherRegex,
+ nonWordCharRegex = this.nonWordCharRegex,
+ serviceName = this.serviceName,
+ tagBuilder = this.tagBuilder,
+ matches = [],
+ match;
+
+ while( ( match = matcherRegex.exec( text ) ) !== null ) {
+ var offset = match.index,
+ prevChar = text.charAt( offset - 1 );
+
+ // If we found the match at the beginning of the string, or we found the match
+ // and there is a whitespace char in front of it (meaning it is not a '#' char
+ // in the middle of a word), then it is a hashtag match.
+ if( offset === 0 || nonWordCharRegex.test( prevChar ) ) {
+ var matchedText = match[ 0 ],
+ hashtag = match[ 0 ].slice( 1 ); // strip off the '#' character at the beginning
+
+ matches.push( new Autolinker.match.Hashtag( {
+ tagBuilder : tagBuilder,
+ matchedText : matchedText,
+ offset : offset,
+ serviceName : serviceName,
+ hashtag : hashtag
+ } ) );
+ }
+ }
-// Headers whose duplicates are ignored by node
-// c.f. https://nodejs.org/api/http.html#http_message_headers
-var ignoreDuplicateOf = [
- 'age', 'authorization', 'content-length', 'content-type', 'etag',
- 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
- 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
- 'referer', 'retry-after', 'user-agent'
-];
+ return matches;
+ }
+} );
+/*global Autolinker */
/**
- * Parse headers into an object
+ * @class Autolinker.matcher.Phone
+ * @extends Autolinker.matcher.Matcher
*
- * ```
- * Date: Wed, 27 Aug 2014 08:58:49 GMT
- * Content-Type: application/json
- * Connection: keep-alive
- * Transfer-Encoding: chunked
- * ```
+ * Matcher to find Phone number matches in an input string.
*
- * @param {String} headers Headers needing to be parsed
- * @returns {Object} Headers parsed into an object
+ * See this class's superclass ({@link Autolinker.matcher.Matcher}) for more
+ * details.
*/
-module.exports = function parseHeaders(headers) {
- var parsed = {};
- var key;
- var val;
- var i;
+Autolinker.matcher.Phone = Autolinker.Util.extend( Autolinker.matcher.Matcher, {
- if (!headers) { return parsed; }
+ /**
+ * The regular expression to match Phone numbers. Example match:
+ *
+ * (123) 456-7890
+ *
+ * This regular expression has the following capturing groups:
+ *
+ * 1. The prefixed '+' sign, if there is one.
+ *
+ * @private
+ * @property {RegExp} matcherRegex
+ */
+ matcherRegex : /(?:(\+)?\d{1,3}[-\040.])?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]\d{4}/g, // ex: (123) 456-7890, 123 456 7890, 123-456-7890, etc.
- utils.forEach(headers.split('\n'), function parser(line) {
- i = line.indexOf(':');
- key = utils.trim(line.substr(0, i)).toLowerCase();
- val = utils.trim(line.substr(i + 1));
+ /**
+ * @inheritdoc
+ */
+ parseMatches : function( text ) {
+ var matcherRegex = this.matcherRegex,
+ tagBuilder = this.tagBuilder,
+ matches = [],
+ match;
+
+ while( ( match = matcherRegex.exec( text ) ) !== null ) {
+ // Remove non-numeric values from phone number string
+ var matchedText = match[ 0 ],
+ cleanNumber = matchedText.replace( /\D/g, '' ), // strip out non-digit characters
+ plusSign = !!match[ 1 ]; // match[ 1 ] is the prefixed plus sign, if there is one
+
+ matches.push( new Autolinker.match.Phone( {
+ tagBuilder : tagBuilder,
+ matchedText : matchedText,
+ offset : match.index,
+ number : cleanNumber,
+ plusSign : plusSign
+ } ) );
+ }
- if (key) {
- if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
- return;
- }
- if (key === 'set-cookie') {
- parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
- } else {
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
- }
- }
- });
+ return matches;
+ }
- return parsed;
-};
+} );
+/*global Autolinker */
+/**
+ * @class Autolinker.matcher.Twitter
+ * @extends Autolinker.matcher.Matcher
+ *
+ * Matcher to find/replace username matches in an input string.
+ */
+Autolinker.matcher.Twitter = Autolinker.Util.extend( Autolinker.matcher.Matcher, {
+ /**
+ * The regular expression to match username handles. Example match:
+ *
+ * @asdf
+ *
+ * @private
+ * @property {RegExp} matcherRegex
+ */
+ matcherRegex : new RegExp( '@[_' + Autolinker.RegexLib.alphaNumericCharsStr + ']{1,20}', 'g' ),
-/***/ }),
+ /**
+ * The regular expression to use to check the character before a username match to
+ * make sure we didn't accidentally match an email address.
+ *
+ * For example, the string "asdf@asdf.com" should not match "@asdf" as a username.
+ *
+ * @private
+ * @property {RegExp} nonWordCharRegex
+ */
+ nonWordCharRegex : new RegExp( '[^' + Autolinker.RegexLib.alphaNumericCharsStr + ']' ),
-/***/ 4850:
-/***/ ((module) => {
-"use strict";
+ /**
+ * @inheritdoc
+ */
+ parseMatches : function( text ) {
+ var matcherRegex = this.matcherRegex,
+ nonWordCharRegex = this.nonWordCharRegex,
+ tagBuilder = this.tagBuilder,
+ matches = [],
+ match;
+
+ while( ( match = matcherRegex.exec( text ) ) !== null ) {
+ var offset = match.index,
+ prevChar = text.charAt( offset - 1 );
+
+ // If we found the match at the beginning of the string, or we found the match
+ // and there is a whitespace char in front of it (meaning it is not an email
+ // address), then it is a username match.
+ if( offset === 0 || nonWordCharRegex.test( prevChar ) ) {
+ var matchedText = match[ 0 ],
+ twitterHandle = match[ 0 ].slice( 1 ); // strip off the '@' character at the beginning
+
+ matches.push( new Autolinker.match.Twitter( {
+ tagBuilder : tagBuilder,
+ matchedText : matchedText,
+ offset : offset,
+ twitterHandle : twitterHandle
+ } ) );
+ }
+ }
+ return matches;
+ }
+} );
+/*global Autolinker */
/**
- * Syntactic sugar for invoking a function and expanding an array for arguments.
- *
- * Common use case would be to use `Function.prototype.apply`.
+ * @class Autolinker.matcher.Url
+ * @extends Autolinker.matcher.Matcher
*
- * ```js
- * function f(x, y, z) {}
- * var args = [1, 2, 3];
- * f.apply(null, args);
- * ```
- *
- * With `spread` this example can be re-written.
- *
- * ```js
- * spread(function(x, y, z) {})([1, 2, 3]);
- * ```
+ * Matcher to find URL matches in an input string.
*
- * @param {Function} callback
- * @returns {Function}
+ * See this class's superclass ({@link Autolinker.matcher.Matcher}) for more details.
*/
-module.exports = function spread(callback) {
- return function wrap(arr) {
- return callback.apply(null, arr);
- };
-};
+Autolinker.matcher.Url = Autolinker.Util.extend( Autolinker.matcher.Matcher, {
+ /**
+ * @cfg {Boolean} stripPrefix (required)
+ * @inheritdoc Autolinker#stripPrefix
+ */
-/***/ }),
-/***/ 328:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ /**
+ * @private
+ * @property {RegExp} matcherRegex
+ *
+ * The regular expression to match URLs with an optional scheme, port
+ * number, path, query string, and hash anchor.
+ *
+ * Example matches:
+ *
+ * http://google.com
+ * www.google.com
+ * google.com/path/to/file?q1=1&q2=2#myAnchor
+ *
+ *
+ * This regular expression will have the following capturing groups:
+ *
+ * 1. Group that matches a scheme-prefixed URL (i.e. 'http://google.com').
+ * This is used to match scheme URLs with just a single word, such as
+ * 'http://localhost', where we won't double check that the domain name
+ * has at least one dot ('.') in it.
+ * 2. Group that matches a 'www.' prefixed URL. This is only matched if the
+ * 'www.' text was not prefixed by a scheme (i.e.: not prefixed by
+ * 'http://', 'ftp:', etc.)
+ * 3. A protocol-relative ('//') match for the case of a 'www.' prefixed
+ * URL. Will be an empty string if it is not a protocol-relative match.
+ * We need to know the character before the '//' in order to determine
+ * if it is a valid match or the // was in a string we don't want to
+ * auto-link.
+ * 4. Group that matches a known TLD (top level domain), when a scheme
+ * or 'www.'-prefixed domain is not matched.
+ * 5. A protocol-relative ('//') match for the case of a known TLD prefixed
+ * URL. Will be an empty string if it is not a protocol-relative match.
+ * See #3 for more info.
+ */
+ matcherRegex : (function() {
+ var schemeRegex = /(?:[A-Za-z][-.+A-Za-z0-9]*:(?![A-Za-z][-.+A-Za-z0-9]*:\/\/)(?!\d+\/?)(?:\/\/)?)/, // match protocol, allow in format "http://" or "mailto:". However, do not match the first part of something like 'link:http://www.google.com' (i.e. don't match "link:"). Also, make sure we don't interpret 'google.com:8000' as if 'google.com' was a protocol here (i.e. ignore a trailing port number in this regex)
+ wwwRegex = /(?:www\.)/, // starting with 'www.'
+ domainNameRegex = Autolinker.RegexLib.domainNameRegex,
+ tldRegex = Autolinker.RegexLib.tldRegex, // match our known top level domains (TLDs)
+ alphaNumericCharsStr = Autolinker.RegexLib.alphaNumericCharsStr,
+
+ // Allow optional path, query string, and hash anchor, not ending in the following characters: "?!:,.;"
+ // http://blog.codinghorror.com/the-problem-with-urls/
+ urlSuffixRegex = new RegExp( '[' + alphaNumericCharsStr + '\\-+&@#/%=~_()|\'$*\\[\\]?!:,.;]*[' + alphaNumericCharsStr + '\\-+&@#/%=~_()|\'$*\\[\\]]' );
+
+ return new RegExp( [
+ '(?:', // parens to cover match for scheme (optional), and domain
+ '(', // *** Capturing group $1, for a scheme-prefixed url (ex: http://google.com)
+ schemeRegex.source,
+ domainNameRegex.source,
+ ')',
+
+ '|',
+
+ '(', // *** Capturing group $2, for a 'www.' prefixed url (ex: www.google.com)
+ '(//)?', // *** Capturing group $3 for an optional protocol-relative URL. Must be at the beginning of the string or start with a non-word character (handled later)
+ wwwRegex.source,
+ domainNameRegex.source,
+ ')',
+
+ '|',
+
+ '(', // *** Capturing group $4, for known a TLD url (ex: google.com)
+ '(//)?', // *** Capturing group $5 for an optional protocol-relative URL. Must be at the beginning of the string or start with a non-word character (handled later)
+ domainNameRegex.source + '\\.',
+ tldRegex.source,
+ ')',
+ ')',
+
+ '(?:' + urlSuffixRegex.source + ')?' // match for path, query string, and/or hash anchor - optional
+ ].join( "" ), 'gi' );
+ } )(),
-"use strict";
+ /**
+ * A regular expression to use to check the character before a protocol-relative
+ * URL match. We don't want to match a protocol-relative URL if it is part
+ * of another word.
+ *
+ * For example, we want to match something like "Go to: //google.com",
+ * but we don't want to match something like "abc//google.com"
+ *
+ * This regular expression is used to test the character before the '//'.
+ *
+ * @private
+ * @type {RegExp} wordCharRegExp
+ */
+ wordCharRegExp : /\w/,
-var bind = __nccwpck_require__(7065);
-/*global toString:true*/
+ /**
+ * The regular expression to match opening parenthesis in a URL match.
+ *
+ * This is to determine if we have unbalanced parenthesis in the URL, and to
+ * drop the final parenthesis that was matched if so.
+ *
+ * Ex: The text "(check out: wikipedia.com/something_(disambiguation))"
+ * should only autolink the inner "wikipedia.com/something_(disambiguation)"
+ * part, so if we find that we have unbalanced parenthesis, we will drop the
+ * last one for the match.
+ *
+ * @private
+ * @property {RegExp}
+ */
+ openParensRe : /\(/g,
-// utils is a library of generic helper functions non-specific to axios
+ /**
+ * The regular expression to match closing parenthesis in a URL match. See
+ * {@link #openParensRe} for more information.
+ *
+ * @private
+ * @property {RegExp}
+ */
+ closeParensRe : /\)/g,
-var toString = Object.prototype.toString;
-/**
- * Determine if a value is an Array
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is an Array, otherwise false
- */
-function isArray(val) {
- return toString.call(val) === '[object Array]';
-}
+ /**
+ * @constructor
+ * @param {Object} cfg The configuration properties for the Match instance,
+ * specified in an Object (map).
+ */
+ constructor : function( cfg ) {
+ Autolinker.matcher.Matcher.prototype.constructor.call( this, cfg );
-/**
- * Determine if a value is undefined
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if the value is undefined, otherwise false
- */
-function isUndefined(val) {
- return typeof val === 'undefined';
-}
+ this.stripPrefix = cfg.stripPrefix;
-/**
- * Determine if a value is a Buffer
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a Buffer, otherwise false
- */
-function isBuffer(val) {
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
- && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
-}
+ if( this.stripPrefix == null ) throw new Error( '`stripPrefix` cfg required' );
+ },
-/**
- * Determine if a value is an ArrayBuffer
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is an ArrayBuffer, otherwise false
- */
-function isArrayBuffer(val) {
- return toString.call(val) === '[object ArrayBuffer]';
-}
+ /**
+ * @inheritdoc
+ */
+ parseMatches : function( text ) {
+ var matcherRegex = this.matcherRegex,
+ stripPrefix = this.stripPrefix,
+ tagBuilder = this.tagBuilder,
+ matches = [],
+ match;
+
+ while( ( match = matcherRegex.exec( text ) ) !== null ) {
+ var matchStr = match[ 0 ],
+ schemeUrlMatch = match[ 1 ],
+ wwwUrlMatch = match[ 2 ],
+ wwwProtocolRelativeMatch = match[ 3 ],
+ //tldUrlMatch = match[ 4 ], -- not needed at the moment
+ tldProtocolRelativeMatch = match[ 5 ],
+ offset = match.index,
+ protocolRelativeMatch = wwwProtocolRelativeMatch || tldProtocolRelativeMatch,
+ prevChar = text.charAt( offset - 1 );
+
+ if( !Autolinker.matcher.UrlMatchValidator.isValid( matchStr, schemeUrlMatch ) ) {
+ continue;
+ }
+
+ // If the match is preceded by an '@' character, then it is either
+ // an email address or a username. Skip these types of matches.
+ if( offset > 0 && prevChar === '@' ) {
+ continue;
+ }
+
+ // If it's a protocol-relative '//' match, but the character before the '//'
+ // was a word character (i.e. a letter/number), then we found the '//' in the
+ // middle of another word (such as "asdf//asdf.com"). In this case, skip the
+ // match.
+ if( offset > 0 && protocolRelativeMatch && this.wordCharRegExp.test( prevChar ) ) {
+ continue;
+ }
+
+ // Handle a closing parenthesis at the end of the match, and exclude
+ // it if there is not a matching open parenthesis in the match
+ // itself.
+ if( this.matchHasUnbalancedClosingParen( matchStr ) ) {
+ matchStr = matchStr.substr( 0, matchStr.length - 1 ); // remove the trailing ")"
+ } else {
+ // Handle an invalid character after the TLD
+ var pos = this.matchHasInvalidCharAfterTld( matchStr, schemeUrlMatch );
+ if( pos > -1 ) {
+ matchStr = matchStr.substr( 0, pos ); // remove the trailing invalid chars
+ }
+ }
+
+ var urlMatchType = schemeUrlMatch ? 'scheme' : ( wwwUrlMatch ? 'www' : 'tld' ),
+ protocolUrlMatch = !!schemeUrlMatch;
+
+ matches.push( new Autolinker.match.Url( {
+ tagBuilder : tagBuilder,
+ matchedText : matchStr,
+ offset : offset,
+ urlMatchType : urlMatchType,
+ url : matchStr,
+ protocolUrlMatch : protocolUrlMatch,
+ protocolRelativeMatch : !!protocolRelativeMatch,
+ stripPrefix : stripPrefix
+ } ) );
+ }
+
+ return matches;
+ },
+
+
+ /**
+ * Determines if a match found has an unmatched closing parenthesis. If so,
+ * this parenthesis will be removed from the match itself, and appended
+ * after the generated anchor tag.
+ *
+ * A match may have an extra closing parenthesis at the end of the match
+ * because the regular expression must include parenthesis for URLs such as
+ * "wikipedia.com/something_(disambiguation)", which should be auto-linked.
+ *
+ * However, an extra parenthesis *will* be included when the URL itself is
+ * wrapped in parenthesis, such as in the case of "(wikipedia.com/something_(disambiguation))".
+ * In this case, the last closing parenthesis should *not* be part of the
+ * URL itself, and this method will return `true`.
+ *
+ * @private
+ * @param {String} matchStr The full match string from the {@link #matcherRegex}.
+ * @return {Boolean} `true` if there is an unbalanced closing parenthesis at
+ * the end of the `matchStr`, `false` otherwise.
+ */
+ matchHasUnbalancedClosingParen : function( matchStr ) {
+ var lastChar = matchStr.charAt( matchStr.length - 1 );
+
+ if( lastChar === ')' ) {
+ var openParensMatch = matchStr.match( this.openParensRe ),
+ closeParensMatch = matchStr.match( this.closeParensRe ),
+ numOpenParens = ( openParensMatch && openParensMatch.length ) || 0,
+ numCloseParens = ( closeParensMatch && closeParensMatch.length ) || 0;
+
+ if( numOpenParens < numCloseParens ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+
+ /**
+ * Determine if there's an invalid character after the TLD in a URL. Valid
+ * characters after TLD are ':/?#'. Exclude scheme matched URLs from this
+ * check.
+ *
+ * @private
+ * @param {String} urlMatch The matched URL, if there was one. Will be an
+ * empty string if the match is not a URL match.
+ * @param {String} schemeUrlMatch The match URL string for a scheme
+ * match. Ex: 'http://yahoo.com'. This is used to match something like
+ * 'http://localhost', where we won't double check that the domain name
+ * has at least one '.' in it.
+ * @return {Number} the position where the invalid character was found. If
+ * no such character was found, returns -1
+ */
+ matchHasInvalidCharAfterTld : function( urlMatch, schemeUrlMatch ) {
+ if( !urlMatch ) {
+ return -1;
+ }
+
+ var offset = 0;
+ if ( schemeUrlMatch ) {
+ offset = urlMatch.indexOf(':');
+ urlMatch = urlMatch.slice(offset);
+ }
+
+ var re = /^((.?\/\/)?[A-Za-z0-9\u00C0-\u017F\.\-]*[A-Za-z0-9\u00C0-\u017F\-]\.[A-Za-z]+)/;
+ var res = re.exec( urlMatch );
+ if ( res === null ) {
+ return -1;
+ }
+
+ offset += res[1].length;
+ urlMatch = urlMatch.slice(res[1].length);
+ if (/^[^.A-Za-z:\/?#]/.test(urlMatch)) {
+ return offset;
+ }
+
+ return -1;
+ }
+
+} );
+/*global Autolinker */
+/*jshint scripturl:true */
/**
- * Determine if a value is a FormData
+ * @private
+ * @class Autolinker.matcher.UrlMatchValidator
+ * @singleton
*
- * @param {Object} val The value to test
- * @returns {boolean} True if value is an FormData, otherwise false
+ * Used by Autolinker to filter out false URL positives from the
+ * {@link Autolinker.matcher.Url UrlMatcher}.
+ *
+ * Due to the limitations of regular expressions (including the missing feature
+ * of look-behinds in JS regular expressions), we cannot always determine the
+ * validity of a given match. This class applies a bit of additional logic to
+ * filter out any false positives that have been matched by the
+ * {@link Autolinker.matcher.Url UrlMatcher}.
*/
-function isFormData(val) {
- return (typeof FormData !== 'undefined') && (val instanceof FormData);
-}
+Autolinker.matcher.UrlMatchValidator = {
-/**
- * Determine if a value is a view on an ArrayBuffer
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
- */
-function isArrayBufferView(val) {
- var result;
- if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
- result = ArrayBuffer.isView(val);
- } else {
- result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
- }
- return result;
-}
+ /**
+ * Regex to test for a full protocol, with the two trailing slashes. Ex: 'http://'
+ *
+ * @private
+ * @property {RegExp} hasFullProtocolRegex
+ */
+ hasFullProtocolRegex : /^[A-Za-z][-.+A-Za-z0-9]*:\/\//,
-/**
- * Determine if a value is a String
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a String, otherwise false
- */
-function isString(val) {
- return typeof val === 'string';
-}
+ /**
+ * Regex to find the URI scheme, such as 'mailto:'.
+ *
+ * This is used to filter out 'javascript:' and 'vbscript:' schemes.
+ *
+ * @private
+ * @property {RegExp} uriSchemeRegex
+ */
+ uriSchemeRegex : /^[A-Za-z][-.+A-Za-z0-9]*:/,
-/**
- * Determine if a value is a Number
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a Number, otherwise false
- */
-function isNumber(val) {
- return typeof val === 'number';
-}
+ /**
+ * Regex to determine if at least one word char exists after the protocol (i.e. after the ':')
+ *
+ * @private
+ * @property {RegExp} hasWordCharAfterProtocolRegex
+ */
+ hasWordCharAfterProtocolRegex : /:[^\s]*?[A-Za-z\u00C0-\u017F]/,
-/**
- * Determine if a value is an Object
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is an Object, otherwise false
- */
-function isObject(val) {
- return val !== null && typeof val === 'object';
-}
+ /**
+ * Regex to determine if the string is a valid IP address
+ *
+ * @private
+ * @property {RegExp} ipRegex
+ */
+ ipRegex: /[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,
-/**
- * Determine if a value is a Date
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a Date, otherwise false
- */
-function isDate(val) {
- return toString.call(val) === '[object Date]';
-}
+ /**
+ * Determines if a given URL match found by the {@link Autolinker.matcher.Url UrlMatcher}
+ * is valid. Will return `false` for:
+ *
+ * 1) URL matches which do not have at least have one period ('.') in the
+ * domain name (effectively skipping over matches like "abc:def").
+ * However, URL matches with a protocol will be allowed (ex: 'http://localhost')
+ * 2) URL matches which do not have at least one word character in the
+ * domain name (effectively skipping over matches like "git:1.0").
+ * 3) A protocol-relative url match (a URL beginning with '//') whose
+ * previous character is a word character (effectively skipping over
+ * strings like "abc//google.com")
+ *
+ * Otherwise, returns `true`.
+ *
+ * @param {String} urlMatch The matched URL, if there was one. Will be an
+ * empty string if the match is not a URL match.
+ * @param {String} protocolUrlMatch The match URL string for a protocol
+ * match. Ex: 'http://yahoo.com'. This is used to match something like
+ * 'http://localhost', where we won't double check that the domain name
+ * has at least one '.' in it.
+ * @return {Boolean} `true` if the match given is valid and should be
+ * processed, or `false` if the match is invalid and/or should just not be
+ * processed.
+ */
+ isValid : function( urlMatch, protocolUrlMatch ) {
+ if(
+ ( protocolUrlMatch && !this.isValidUriScheme( protocolUrlMatch ) ) ||
+ this.urlMatchDoesNotHaveProtocolOrDot( urlMatch, protocolUrlMatch ) || // At least one period ('.') must exist in the URL match for us to consider it an actual URL, *unless* it was a full protocol match (like 'http://localhost')
+ (this.urlMatchDoesNotHaveAtLeastOneWordChar( urlMatch, protocolUrlMatch ) && // At least one letter character must exist in the domain name after a protocol match. Ex: skip over something like "git:1.0"
+ !this.isValidIpAddress( urlMatch ) // Except if it's an IP address
+ )
+ ) {
+ return false;
+ }
-/**
- * Determine if a value is a File
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a File, otherwise false
- */
-function isFile(val) {
- return toString.call(val) === '[object File]';
-}
+ return true;
+ },
-/**
- * Determine if a value is a Blob
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a Blob, otherwise false
- */
-function isBlob(val) {
- return toString.call(val) === '[object Blob]';
-}
-/**
- * Determine if a value is a Function
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a Function, otherwise false
- */
-function isFunction(val) {
- return toString.call(val) === '[object Function]';
-}
+ isValidIpAddress : function ( uriSchemeMatch ) {
+ var newRegex = new RegExp(this.hasFullProtocolRegex.source + this.ipRegex.source);
+ var uriScheme = uriSchemeMatch.match( newRegex );
-/**
- * Determine if a value is a Stream
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a Stream, otherwise false
- */
-function isStream(val) {
- return isObject(val) && isFunction(val.pipe);
-}
+ return uriScheme !== null;
+ },
-/**
- * Determine if a value is a URLSearchParams object
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a URLSearchParams object, otherwise false
- */
-function isURLSearchParams(val) {
- return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
-}
+ /**
+ * Determines if the URI scheme is a valid scheme to be autolinked. Returns
+ * `false` if the scheme is 'javascript:' or 'vbscript:'
+ *
+ * @private
+ * @param {String} uriSchemeMatch The match URL string for a full URI scheme
+ * match. Ex: 'http://yahoo.com' or 'mailto:a@a.com'.
+ * @return {Boolean} `true` if the scheme is a valid one, `false` otherwise.
+ */
+ isValidUriScheme : function( uriSchemeMatch ) {
+ var uriScheme = uriSchemeMatch.match( this.uriSchemeRegex )[ 0 ].toLowerCase();
+
+ return ( uriScheme !== 'javascript:' && uriScheme !== 'vbscript:' );
+ },
+
+
+ /**
+ * Determines if a URL match does not have either:
+ *
+ * a) a full protocol (i.e. 'http://'), or
+ * b) at least one dot ('.') in the domain name (for a non-full-protocol
+ * match).
+ *
+ * Either situation is considered an invalid URL (ex: 'git:d' does not have
+ * either the '://' part, or at least one dot in the domain name. If the
+ * match was 'git:abc.com', we would consider this valid.)
+ *
+ * @private
+ * @param {String} urlMatch The matched URL, if there was one. Will be an
+ * empty string if the match is not a URL match.
+ * @param {String} protocolUrlMatch The match URL string for a protocol
+ * match. Ex: 'http://yahoo.com'. This is used to match something like
+ * 'http://localhost', where we won't double check that the domain name
+ * has at least one '.' in it.
+ * @return {Boolean} `true` if the URL match does not have a full protocol,
+ * or at least one dot ('.') in a non-full-protocol match.
+ */
+ urlMatchDoesNotHaveProtocolOrDot : function( urlMatch, protocolUrlMatch ) {
+ return ( !!urlMatch && ( !protocolUrlMatch || !this.hasFullProtocolRegex.test( protocolUrlMatch ) ) && urlMatch.indexOf( '.' ) === -1 );
+ },
+
+
+ /**
+ * Determines if a URL match does not have at least one word character after
+ * the protocol (i.e. in the domain name).
+ *
+ * At least one letter character must exist in the domain name after a
+ * protocol match. Ex: skip over something like "git:1.0"
+ *
+ * @private
+ * @param {String} urlMatch The matched URL, if there was one. Will be an
+ * empty string if the match is not a URL match.
+ * @param {String} protocolUrlMatch The match URL string for a protocol
+ * match. Ex: 'http://yahoo.com'. This is used to know whether or not we
+ * have a protocol in the URL string, in order to check for a word
+ * character after the protocol separator (':').
+ * @return {Boolean} `true` if the URL match does not have at least one word
+ * character in it after the protocol, `false` otherwise.
+ */
+ urlMatchDoesNotHaveAtLeastOneWordChar : function( urlMatch, protocolUrlMatch ) {
+ if( urlMatch && protocolUrlMatch ) {
+ return !this.hasWordCharAfterProtocolRegex.test( urlMatch );
+ } else {
+ return false;
+ }
+ }
+};
+/*global Autolinker */
/**
- * Trim excess whitespace off the beginning and end of a string
+ * A truncation feature where the ellipsis will be placed at the end of the URL.
*
- * @param {String} str The String to trim
- * @returns {String} The String freed of excess whitespace
+ * @param {String} anchorText
+ * @param {Number} truncateLen The maximum length of the truncated output URL string.
+ * @param {String} ellipsisChars The characters to place within the url, e.g. "..".
+ * @return {String} The truncated URL.
*/
-function trim(str) {
- return str.replace(/^\s*/, '').replace(/\s*$/, '');
-}
+Autolinker.truncate.TruncateEnd = function(anchorText, truncateLen, ellipsisChars){
+ return Autolinker.Util.ellipsis( anchorText, truncateLen, ellipsisChars );
+};
+/*global Autolinker */
/**
- * Determine if we're running in a standard browser environment
+ * Date: 2015-10-05
+ * Author: Kasper Søfren (https://github.com/kafoso)
*
- * This allows axios to run in a web worker, and react-native.
- * Both environments support XMLHttpRequest, but not fully standard globals.
- *
- * web workers:
- * typeof window -> undefined
- * typeof document -> undefined
+ * A truncation feature, where the ellipsis will be placed in the dead-center of the URL.
*
- * react-native:
- * navigator.product -> 'ReactNative'
- * nativescript
- * navigator.product -> 'NativeScript' or 'NS'
+ * @param {String} url A URL.
+ * @param {Number} truncateLen The maximum length of the truncated output URL string.
+ * @param {String} ellipsisChars The characters to place within the url, e.g. "..".
+ * @return {String} The truncated URL.
*/
-function isStandardBrowserEnv() {
- if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
- navigator.product === 'NativeScript' ||
- navigator.product === 'NS')) {
- return false;
+Autolinker.truncate.TruncateMiddle = function(url, truncateLen, ellipsisChars){
+ if (url.length <= truncateLen) {
+ return url;
}
- return (
- typeof window !== 'undefined' &&
- typeof document !== 'undefined'
- );
-}
+ var availableLength = truncateLen - ellipsisChars.length;
+ var end = "";
+ if (availableLength > 0) {
+ end = url.substr((-1)*Math.floor(availableLength/2));
+ }
+ return (url.substr(0, Math.ceil(availableLength/2)) + ellipsisChars + end).substr(0, truncateLen);
+};
+/*global Autolinker */
/**
- * Iterate over an Array or an Object invoking a function for each item.
+ * Date: 2015-10-05
+ * Author: Kasper Søfren (https://github.com/kafoso)
*
- * If `obj` is an Array callback will be called passing
- * the value, index, and complete array for each item.
- *
- * If 'obj' is an Object callback will be called passing
- * the value, key, and complete object for each property.
+ * A truncation feature, where the ellipsis will be placed at a section within
+ * the URL making it still somewhat human readable.
*
- * @param {Object|Array} obj The object to iterate
- * @param {Function} fn The callback to invoke for each item
+ * @param {String} url A URL.
+ * @param {Number} truncateLen The maximum length of the truncated output URL string.
+ * @param {String} ellipsisChars The characters to place within the url, e.g. "..".
+ * @return {String} The truncated URL.
*/
-function forEach(obj, fn) {
- // Don't bother if no value provided
- if (obj === null || typeof obj === 'undefined') {
- return;
- }
+Autolinker.truncate.TruncateSmart = function(url, truncateLen, ellipsisChars){
+ var parse_url = function(url){ // Functionality inspired by PHP function of same name
+ var urlObj = {};
+ var urlSub = url;
+ var match = urlSub.match(/^([a-z]+):\/\//i);
+ if (match) {
+ urlObj.scheme = match[1];
+ urlSub = urlSub.substr(match[0].length);
+ }
+ match = urlSub.match(/^(.*?)(?=(\?|#|\/|$))/i);
+ if (match) {
+ urlObj.host = match[1];
+ urlSub = urlSub.substr(match[0].length);
+ }
+ match = urlSub.match(/^\/(.*?)(?=(\?|#|$))/i);
+ if (match) {
+ urlObj.path = match[1];
+ urlSub = urlSub.substr(match[0].length);
+ }
+ match = urlSub.match(/^\?(.*?)(?=(#|$))/i);
+ if (match) {
+ urlObj.query = match[1];
+ urlSub = urlSub.substr(match[0].length);
+ }
+ match = urlSub.match(/^#(.*?)$/i);
+ if (match) {
+ urlObj.fragment = match[1];
+ //urlSub = urlSub.substr(match[0].length); -- not used. Uncomment if adding another block.
+ }
+ return urlObj;
+ };
- // Force an array if not already something iterable
- if (typeof obj !== 'object') {
- /*eslint no-param-reassign:0*/
- obj = [obj];
- }
+ var buildUrl = function(urlObj){
+ var url = "";
+ if (urlObj.scheme && urlObj.host) {
+ url += urlObj.scheme + "://";
+ }
+ if (urlObj.host) {
+ url += urlObj.host;
+ }
+ if (urlObj.path) {
+ url += "/" + urlObj.path;
+ }
+ if (urlObj.query) {
+ url += "?" + urlObj.query;
+ }
+ if (urlObj.fragment) {
+ url += "#" + urlObj.fragment;
+ }
+ return url;
+ };
- if (isArray(obj)) {
- // Iterate over array values
- for (var i = 0, l = obj.length; i < l; i++) {
- fn.call(null, obj[i], i, obj);
- }
- } else {
- // Iterate over object keys
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- fn.call(null, obj[key], key, obj);
- }
- }
- }
-}
+ var buildSegment = function(segment, remainingAvailableLength){
+ var remainingAvailableLengthHalf = remainingAvailableLength/ 2,
+ startOffset = Math.ceil(remainingAvailableLengthHalf),
+ endOffset = (-1)*Math.floor(remainingAvailableLengthHalf),
+ end = "";
+ if (endOffset < 0) {
+ end = segment.substr(endOffset);
+ }
+ return segment.substr(0, startOffset) + ellipsisChars + end;
+ };
+ if (url.length <= truncateLen) {
+ return url;
+ }
+ var availableLength = truncateLen - ellipsisChars.length;
+ var urlObj = parse_url(url);
+ // Clean up the URL
+ if (urlObj.query) {
+ var matchQuery = urlObj.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);
+ if (matchQuery) {
+ // Malformed URL; two or more "?". Removed any content behind the 2nd.
+ urlObj.query = urlObj.query.substr(0, matchQuery[1].length);
+ url = buildUrl(urlObj);
+ }
+ }
+ if (url.length <= truncateLen) {
+ return url;
+ }
+ if (urlObj.host) {
+ urlObj.host = urlObj.host.replace(/^www\./, "");
+ url = buildUrl(urlObj);
+ }
+ if (url.length <= truncateLen) {
+ return url;
+ }
+ // Process and build the URL
+ var str = "";
+ if (urlObj.host) {
+ str += urlObj.host;
+ }
+ if (str.length >= availableLength) {
+ if (urlObj.host.length == truncateLen) {
+ return (urlObj.host.substr(0, (truncateLen - ellipsisChars.length)) + ellipsisChars).substr(0, truncateLen);
+ }
+ return buildSegment(str, availableLength).substr(0, truncateLen);
+ }
+ var pathAndQuery = "";
+ if (urlObj.path) {
+ pathAndQuery += "/" + urlObj.path;
+ }
+ if (urlObj.query) {
+ pathAndQuery += "?" + urlObj.query;
+ }
+ if (pathAndQuery) {
+ if ((str+pathAndQuery).length >= availableLength) {
+ if ((str+pathAndQuery).length == truncateLen) {
+ return (str + pathAndQuery).substr(0, truncateLen);
+ }
+ var remainingAvailableLength = availableLength - str.length;
+ return (str + buildSegment(pathAndQuery, remainingAvailableLength)).substr(0, truncateLen);
+ } else {
+ str += pathAndQuery;
+ }
+ }
+ if (urlObj.fragment) {
+ var fragment = "#"+urlObj.fragment;
+ if ((str+fragment).length >= availableLength) {
+ if ((str+fragment).length == truncateLen) {
+ return (str + fragment).substr(0, truncateLen);
+ }
+ var remainingAvailableLength2 = availableLength - str.length;
+ return (str + buildSegment(fragment, remainingAvailableLength2)).substr(0, truncateLen);
+ } else {
+ str += fragment;
+ }
+ }
+ if (urlObj.scheme && urlObj.host) {
+ var scheme = urlObj.scheme + "://";
+ if ((str+scheme).length < availableLength) {
+ return (scheme + str).substr(0, truncateLen);
+ }
+ }
+ if (str.length <= truncateLen) {
+ return str;
+ }
+ var end = "";
+ if (availableLength > 0) {
+ end = str.substr((-1)*Math.floor(availableLength/2));
+ }
+ return (str.substr(0, Math.ceil(availableLength/2)) + ellipsisChars + end).substr(0, truncateLen);
+};
-/**
- * Accepts varargs expecting each argument to be an object, then
- * immutably merges the properties of each object and returns result.
- *
- * When multiple objects contain the same key the later object in
- * the arguments list will take precedence.
- *
- * Example:
- *
- * ```js
- * var result = merge({foo: 123}, {foo: 456});
- * console.log(result.foo); // outputs 456
- * ```
- *
- * @param {Object} obj1 Object to merge
- * @returns {Object} Result of all merge properties
- */
-function merge(/* obj1, obj2, obj3, ... */) {
- var result = {};
- function assignValue(val, key) {
- if (typeof result[key] === 'object' && typeof val === 'object') {
- result[key] = merge(result[key], val);
- } else {
- result[key] = val;
- }
- }
+return Autolinker;
+}));
- for (var i = 0, l = arguments.length; i < l; i++) {
- forEach(arguments[i], assignValue);
- }
- return result;
-}
-/**
- * Function equal to merge with the difference being that no reference
- * to original objects is kept.
- *
- * @see merge
- * @param {Object} obj1 Object to merge
- * @returns {Object} Result of all merge properties
- */
-function deepMerge(/* obj1, obj2, obj3, ... */) {
- var result = {};
- function assignValue(val, key) {
- if (typeof result[key] === 'object' && typeof val === 'object') {
- result[key] = deepMerge(result[key], val);
- } else if (typeof val === 'object') {
- result[key] = deepMerge({}, val);
- } else {
- result[key] = val;
- }
- }
-
- for (var i = 0, l = arguments.length; i < l; i++) {
- forEach(arguments[i], assignValue);
- }
- return result;
-}
-
-/**
- * Extends object a by mutably adding to it the properties of object b.
- *
- * @param {Object} a The object to be extended
- * @param {Object} b The object to copy properties from
- * @param {Object} thisArg The object to bind function to
- * @return {Object} The resulting value of object a
- */
-function extend(a, b, thisArg) {
- forEach(b, function assignValue(val, key) {
- if (thisArg && typeof val === 'function') {
- a[key] = bind(val, thisArg);
- } else {
- a[key] = val;
- }
- });
- return a;
-}
+/***/ }),
-module.exports = {
- isArray: isArray,
- isArrayBuffer: isArrayBuffer,
- isBuffer: isBuffer,
- isFormData: isFormData,
- isArrayBufferView: isArrayBufferView,
- isString: isString,
- isNumber: isNumber,
- isObject: isObject,
- isUndefined: isUndefined,
- isDate: isDate,
- isFile: isFile,
- isBlob: isBlob,
- isFunction: isFunction,
- isStream: isStream,
- isURLSearchParams: isURLSearchParams,
- isStandardBrowserEnv: isStandardBrowserEnv,
- forEach: forEach,
- merge: merge,
- deepMerge: deepMerge,
- extend: extend,
- trim: trim
-};
+/***/ 96545:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+module.exports = __nccwpck_require__(52618);
/***/ }),
-/***/ 3682:
+/***/ 68104:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var register = __nccwpck_require__(4670)
-var addHook = __nccwpck_require__(5549)
-var removeHook = __nccwpck_require__(6819)
-
-// 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
+"use strict";
- ;['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
-}
+var utils = __nccwpck_require__(20328);
+var settle = __nccwpck_require__(13211);
+var buildFullPath = __nccwpck_require__(41934);
+var buildURL = __nccwpck_require__(30646);
+var http = __nccwpck_require__(98605);
+var https = __nccwpck_require__(57211);
+var httpFollow = __nccwpck_require__(67707).http;
+var httpsFollow = __nccwpck_require__(67707).https;
+var url = __nccwpck_require__(78835);
+var zlib = __nccwpck_require__(78761);
+var pkg = __nccwpck_require__(20696);
+var createError = __nccwpck_require__(15226);
+var enhanceError = __nccwpck_require__(21516);
-function HookCollection () {
- var state = {
- registry: {}
- }
+var isHttps = /https:?/;
- var hook = register.bind(null, state)
- bindApi(hook, state)
+/*eslint consistent-return:0*/
+module.exports = function httpAdapter(config) {
+ return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
+ var resolve = function resolve(value) {
+ resolvePromise(value);
+ };
+ var reject = function reject(value) {
+ rejectPromise(value);
+ };
+ var data = config.data;
+ var headers = config.headers;
- return hook
-}
+ // Set User-Agent (required by some servers)
+ // Only set header if it hasn't been set in config
+ // See https://github.com/axios/axios/issues/69
+ if (!headers['User-Agent'] && !headers['user-agent']) {
+ headers['User-Agent'] = 'axios/' + pkg.version;
+ }
-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()
-}
+ if (data && !utils.isStream(data)) {
+ if (Buffer.isBuffer(data)) {
+ // Nothing to do...
+ } else if (utils.isArrayBuffer(data)) {
+ data = Buffer.from(new Uint8Array(data));
+ } else if (utils.isString(data)) {
+ data = Buffer.from(data, 'utf-8');
+ } else {
+ return reject(createError(
+ 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
+ config
+ ));
+ }
-Hook.Singular = HookSingular.bind()
-Hook.Collection = HookCollection.bind()
+ // Add Content-Length header if data exists
+ headers['Content-Length'] = data.length;
+ }
-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
+ // HTTP basic authentication
+ var auth = undefined;
+ if (config.auth) {
+ var username = config.auth.username || '';
+ var password = config.auth.password || '';
+ auth = username + ':' + password;
+ }
+ // Parse url
+ var fullPath = buildFullPath(config.baseURL, config.url);
+ var parsed = url.parse(fullPath);
+ var protocol = parsed.protocol || 'http:';
-/***/ }),
+ if (!auth && parsed.auth) {
+ var urlAuth = parsed.auth.split(':');
+ var urlUsername = urlAuth[0] || '';
+ var urlPassword = urlAuth[1] || '';
+ auth = urlUsername + ':' + urlPassword;
+ }
-/***/ 5549:
-/***/ ((module) => {
+ if (auth) {
+ delete headers.Authorization;
+ }
-module.exports = addHook
+ var isHttpsRequest = isHttps.test(protocol);
+ var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
-function addHook (state, kind, name, hook) {
- var orig = hook
- if (!state.registry[name]) {
- state.registry[name] = []
- }
+ var options = {
+ path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''),
+ method: config.method.toUpperCase(),
+ headers: headers,
+ agent: agent,
+ agents: { http: config.httpAgent, https: config.httpsAgent },
+ auth: auth
+ };
- if (kind === 'before') {
- hook = function (method, options) {
- return Promise.resolve()
- .then(orig.bind(null, options))
- .then(method.bind(null, options))
+ if (config.socketPath) {
+ options.socketPath = config.socketPath;
+ } else {
+ options.hostname = parsed.hostname;
+ options.port = parsed.port;
}
- }
- 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
- })
- }
- }
+ var proxy = config.proxy;
+ if (!proxy && proxy !== false) {
+ var proxyEnv = protocol.slice(0, -1) + '_proxy';
+ var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];
+ if (proxyUrl) {
+ var parsedProxyUrl = url.parse(proxyUrl);
+ var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;
+ var shouldProxy = true;
- if (kind === 'error') {
- hook = function (method, options) {
- return Promise.resolve()
- .then(method.bind(null, options))
- .catch(function (error) {
- return orig(error, options)
- })
- }
- }
+ if (noProxyEnv) {
+ var noProxy = noProxyEnv.split(',').map(function trim(s) {
+ return s.trim();
+ });
- state.registry[name].push({
- hook: hook,
- orig: orig
- })
-}
+ shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {
+ if (!proxyElement) {
+ return false;
+ }
+ if (proxyElement === '*') {
+ return true;
+ }
+ if (proxyElement[0] === '.' &&
+ parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {
+ return true;
+ }
+ return parsed.hostname === proxyElement;
+ });
+ }
-/***/ }),
-/***/ 4670:
-/***/ ((module) => {
+ if (shouldProxy) {
+ proxy = {
+ host: parsedProxyUrl.hostname,
+ port: parsedProxyUrl.port
+ };
-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)
+ if (parsedProxyUrl.auth) {
+ var proxyUrlAuth = parsedProxyUrl.auth.split(':');
+ proxy.auth = {
+ username: proxyUrlAuth[0],
+ password: proxyUrlAuth[1]
+ };
+ }
+ }
}
+ }
- return (state.registry[name]).reduce(function (method, registered) {
- return registered.hook.bind(null, method, options)
- }, method)()
- })
-}
-
-
-/***/ }),
+ if (proxy) {
+ options.hostname = proxy.host;
+ options.host = proxy.host;
+ options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');
+ options.port = proxy.port;
+ options.path = protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path;
-/***/ 6819:
-/***/ ((module) => {
+ // Basic proxy authorization
+ if (proxy.auth) {
+ var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');
+ options.headers['Proxy-Authorization'] = 'Basic ' + base64;
+ }
+ }
-module.exports = removeHook
+ var transport;
+ var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);
+ if (config.transport) {
+ transport = config.transport;
+ } else if (config.maxRedirects === 0) {
+ transport = isHttpsProxy ? https : http;
+ } else {
+ if (config.maxRedirects) {
+ options.maxRedirects = config.maxRedirects;
+ }
+ transport = isHttpsProxy ? httpsFollow : httpFollow;
+ }
-function removeHook (state, name, method) {
- if (!state.registry[name]) {
- return
- }
+ if (config.maxContentLength && config.maxContentLength > -1) {
+ options.maxBodyLength = config.maxContentLength;
+ }
- var index = state.registry[name]
- .map(function (registered) { return registered.orig })
- .indexOf(method)
+ // Create the request
+ var req = transport.request(options, function handleResponse(res) {
+ if (req.aborted) return;
- if (index === -1) {
- return
- }
+ // uncompress the response body transparently if required
+ var stream = res;
+ switch (res.headers['content-encoding']) {
+ /*eslint default-case:0*/
+ case 'gzip':
+ case 'compress':
+ case 'deflate':
+ // add the unzipper to the body stream processing pipeline
+ stream = (res.statusCode === 204) ? stream : stream.pipe(zlib.createUnzip());
- state.registry[name].splice(index, 1)
-}
+ // remove the content-encoding in order to not confuse downstream operations
+ delete res.headers['content-encoding'];
+ break;
+ }
+ // return the last request in case of redirects
+ var lastRequest = res.req || req;
-/***/ }),
+ var response = {
+ status: res.statusCode,
+ statusText: res.statusMessage,
+ headers: res.headers,
+ config: config,
+ request: lastRequest
+ };
-/***/ 8932:
-/***/ ((__unused_webpack_module, exports) => {
+ if (config.responseType === 'stream') {
+ response.data = stream;
+ settle(resolve, reject, response);
+ } else {
+ var responseBuffer = [];
+ stream.on('data', function handleStreamData(chunk) {
+ responseBuffer.push(chunk);
-"use strict";
+ // make sure the content length is not over the maxContentLength if specified
+ if (config.maxContentLength > -1 && Buffer.concat(responseBuffer).length > config.maxContentLength) {
+ stream.destroy();
+ reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
+ config, null, lastRequest));
+ }
+ });
+ stream.on('error', function handleStreamError(err) {
+ if (req.aborted) return;
+ reject(enhanceError(err, config, null, lastRequest));
+ });
-Object.defineProperty(exports, "__esModule", ({ value: true }));
+ stream.on('end', function handleStreamEnd() {
+ var responseData = Buffer.concat(responseBuffer);
+ if (config.responseType !== 'arraybuffer') {
+ responseData = responseData.toString(config.responseEncoding);
+ }
-class Deprecation extends Error {
- constructor(message) {
- super(message); // Maintains proper stack trace (only available on V8)
+ response.data = responseData;
+ settle(resolve, reject, response);
+ });
+ }
+ });
- /* istanbul ignore next */
+ // Handle errors
+ req.on('error', function handleRequestError(err) {
+ if (req.aborted) return;
+ reject(enhanceError(err, config, null, req));
+ });
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, this.constructor);
+ // Handle request timeout
+ if (config.timeout) {
+ // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
+ // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
+ // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
+ // And then these socket which be hang up will devoring CPU little by little.
+ // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
+ req.setTimeout(config.timeout, function handleRequestTimeout() {
+ req.abort();
+ reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', req));
+ });
}
- this.name = 'Deprecation';
- }
+ if (config.cancelToken) {
+ // Handle cancellation
+ config.cancelToken.promise.then(function onCanceled(cancel) {
+ if (req.aborted) return;
-}
+ req.abort();
+ reject(cancel);
+ });
+ }
-exports.Deprecation = Deprecation;
+ // Send the request
+ if (utils.isStream(data)) {
+ data.on('error', function handleStreamError(err) {
+ reject(enhanceError(err, config, null, req));
+ }).pipe(req);
+ } else {
+ req.end(data);
+ }
+ });
+};
/***/ }),
-/***/ 7707:
+/***/ 3454:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var url = __nccwpck_require__(8835);
-var http = __nccwpck_require__(8605);
-var https = __nccwpck_require__(7211);
-var assert = __nccwpck_require__(2357);
-var Writable = __nccwpck_require__(2413).Writable;
-var debug = __nccwpck_require__(3226)("follow-redirects");
+"use strict";
-// RFC7231§4.2.1: Of the request methods defined by this specification,
-// the GET, HEAD, OPTIONS, and TRACE methods are defined to be safe.
-var SAFE_METHODS = { GET: true, HEAD: true, OPTIONS: true, TRACE: true };
-// Create handlers that pass events from native requests
-var eventHandlers = Object.create(null);
-["abort", "aborted", "error", "socket", "timeout"].forEach(function (event) {
- eventHandlers[event] = function (arg) {
- this._redirectable.emit(event, arg);
- };
-});
+var utils = __nccwpck_require__(20328);
+var settle = __nccwpck_require__(13211);
+var buildURL = __nccwpck_require__(30646);
+var buildFullPath = __nccwpck_require__(41934);
+var parseHeaders = __nccwpck_require__(86455);
+var isURLSameOrigin = __nccwpck_require__(33608);
+var createError = __nccwpck_require__(15226);
-// An HTTP(S) request that can be redirected
-function RedirectableRequest(options, responseCallback) {
- // Initialize the request
- Writable.call(this);
- options.headers = options.headers || {};
- this._options = options;
- this._redirectCount = 0;
- this._redirects = [];
- this._requestBodyLength = 0;
- this._requestBodyBuffers = [];
+module.exports = function xhrAdapter(config) {
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
+ var requestData = config.data;
+ var requestHeaders = config.headers;
- // Since http.request treats host as an alias of hostname,
- // but the url module interprets host as hostname plus port,
- // eliminate the host property to avoid confusion.
- if (options.host) {
- // Use hostname if set, because it has precedence
- if (!options.hostname) {
- options.hostname = options.host;
+ if (utils.isFormData(requestData)) {
+ delete requestHeaders['Content-Type']; // Let the browser set it
}
- delete options.host;
- }
-
- // Attach a callback if passed
- if (responseCallback) {
- this.on("response", responseCallback);
- }
- // React to responses of native requests
- var self = this;
- this._onNativeResponse = function (response) {
- self._processResponse(response);
- };
+ var request = new XMLHttpRequest();
- // Complete the URL object when necessary
- if (!options.pathname && options.path) {
- var searchPos = options.path.indexOf("?");
- if (searchPos < 0) {
- options.pathname = options.path;
- }
- else {
- options.pathname = options.path.substring(0, searchPos);
- options.search = options.path.substring(searchPos);
+ // HTTP basic authentication
+ if (config.auth) {
+ var username = config.auth.username || '';
+ var password = config.auth.password || '';
+ requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
}
- }
- // Perform the first request
- this._performRequest();
-}
-RedirectableRequest.prototype = Object.create(Writable.prototype);
+ var fullPath = buildFullPath(config.baseURL, config.url);
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
-// Writes buffered data to the current native request
-RedirectableRequest.prototype.write = function (data, encoding, callback) {
- // Validate input and shift parameters if necessary
- if (!(typeof data === "string" || typeof data === "object" && ("length" in data))) {
- throw new Error("data should be a string, Buffer or Uint8Array");
- }
- if (typeof encoding === "function") {
- callback = encoding;
- encoding = null;
- }
-
- // Ignore empty buffers, since writing them doesn't invoke the callback
- // https://github.com/nodejs/node/issues/22066
- if (data.length === 0) {
- if (callback) {
- callback();
- }
- return;
- }
- // Only write when we don't exceed the maximum body length
- if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
- this._requestBodyLength += data.length;
- this._requestBodyBuffers.push({ data: data, encoding: encoding });
- this._currentRequest.write(data, encoding, callback);
- }
- // Error when we exceed the maximum body length
- else {
- this.emit("error", new Error("Request body larger than maxBodyLength limit"));
- this.abort();
- }
-};
+ // Set the request timeout in MS
+ request.timeout = config.timeout;
-// Ends the current native request
-RedirectableRequest.prototype.end = function (data, encoding, callback) {
- // Shift parameters if necessary
- if (typeof data === "function") {
- callback = data;
- data = encoding = null;
- }
- else if (typeof encoding === "function") {
- callback = encoding;
- encoding = null;
- }
+ // Listen for ready state
+ request.onreadystatechange = function handleLoad() {
+ if (!request || request.readyState !== 4) {
+ return;
+ }
- // Write data and end
- var currentRequest = this._currentRequest;
- this.write(data || "", encoding, function () {
- currentRequest.end(null, null, callback);
- });
-};
+ // The request errored out and we didn't get a response, this will be
+ // handled by onerror instead
+ // With one exception: request that using file: protocol, most browsers
+ // will return status as 0 even though it's a successful request
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
+ return;
+ }
-// Sets a header value on the current native request
-RedirectableRequest.prototype.setHeader = function (name, value) {
- this._options.headers[name] = value;
- this._currentRequest.setHeader(name, value);
-};
+ // Prepare the response
+ var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
+ var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
+ var response = {
+ data: responseData,
+ status: request.status,
+ statusText: request.statusText,
+ headers: responseHeaders,
+ config: config,
+ request: request
+ };
-// Clears a header value on the current native request
-RedirectableRequest.prototype.removeHeader = function (name) {
- delete this._options.headers[name];
- this._currentRequest.removeHeader(name);
-};
+ settle(resolve, reject, response);
-// Proxy all other public ClientRequest methods
-[
- "abort", "flushHeaders", "getHeader",
- "setNoDelay", "setSocketKeepAlive", "setTimeout",
-].forEach(function (method) {
- RedirectableRequest.prototype[method] = function (a, b) {
- return this._currentRequest[method](a, b);
- };
-});
+ // Clean up request
+ request = null;
+ };
-// Proxy all public ClientRequest properties
-["aborted", "connection", "socket"].forEach(function (property) {
- Object.defineProperty(RedirectableRequest.prototype, property, {
- get: function () { return this._currentRequest[property]; },
- });
-});
+ // Handle browser request cancellation (as opposed to a manual cancellation)
+ request.onabort = function handleAbort() {
+ if (!request) {
+ return;
+ }
-// Executes the next native request (initial or redirect)
-RedirectableRequest.prototype._performRequest = function () {
- // Load the native protocol
- var protocol = this._options.protocol;
- var nativeProtocol = this._options.nativeProtocols[protocol];
- if (!nativeProtocol) {
- this.emit("error", new Error("Unsupported protocol " + protocol));
- return;
- }
+ reject(createError('Request aborted', config, 'ECONNABORTED', request));
- // If specified, use the agent corresponding to the protocol
- // (HTTP and HTTPS use different types of agents)
- if (this._options.agents) {
- var scheme = protocol.substr(0, protocol.length - 1);
- this._options.agent = this._options.agents[scheme];
- }
+ // Clean up request
+ request = null;
+ };
- // Create the native request
- var request = this._currentRequest =
- nativeProtocol.request(this._options, this._onNativeResponse);
- this._currentUrl = url.format(this._options);
+ // Handle low level network errors
+ request.onerror = function handleError() {
+ // Real errors are hidden from us by the browser
+ // onerror should only fire if it's a network error
+ reject(createError('Network Error', config, null, request));
- // Set up event handlers
- request._redirectable = this;
- for (var event in eventHandlers) {
- /* istanbul ignore else */
- if (event) {
- request.on(event, eventHandlers[event]);
- }
- }
+ // Clean up request
+ request = null;
+ };
- // End a redirected request
- // (The first request must be ended explicitly with RedirectableRequest#end)
- if (this._isRedirect) {
- // Write the request entity and end.
- var i = 0;
- var buffers = this._requestBodyBuffers;
- (function writeNext() {
- if (i < buffers.length) {
- var buffer = buffers[i++];
- request.write(buffer.data, buffer.encoding, writeNext);
- }
- else {
- request.end();
+ // Handle timeout
+ request.ontimeout = function handleTimeout() {
+ var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
+ if (config.timeoutErrorMessage) {
+ timeoutErrorMessage = config.timeoutErrorMessage;
}
- }());
- }
-};
+ reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
+ request));
-// Processes a response from the current native request
-RedirectableRequest.prototype._processResponse = function (response) {
- // Store the redirected response
- if (this._options.trackRedirects) {
- this._redirects.push({
- url: this._currentUrl,
- headers: response.headers,
- statusCode: response.statusCode,
- });
- }
+ // Clean up request
+ request = null;
+ };
- // RFC7231§6.4: The 3xx (Redirection) class of status code indicates
- // that further action needs to be taken by the user agent in order to
- // fulfill the request. If a Location header field is provided,
- // the user agent MAY automatically redirect its request to the URI
- // referenced by the Location field value,
- // even if the specific status code is not understood.
- var location = response.headers.location;
- if (location && this._options.followRedirects !== false &&
- response.statusCode >= 300 && response.statusCode < 400) {
- // RFC7231§6.4: A client SHOULD detect and intervene
- // in cyclical redirections (i.e., "infinite" redirection loops).
- if (++this._redirectCount > this._options.maxRedirects) {
- this.emit("error", new Error("Max redirects exceeded."));
- return;
+ // Add xsrf header
+ // This is only done if running in a standard browser environment.
+ // Specifically not if we're in a web worker, or react-native.
+ if (utils.isStandardBrowserEnv()) {
+ var cookies = __nccwpck_require__(21545);
+
+ // Add xsrf header
+ var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
+ cookies.read(config.xsrfCookieName) :
+ undefined;
+
+ if (xsrfValue) {
+ requestHeaders[config.xsrfHeaderName] = xsrfValue;
+ }
}
- // RFC7231§6.4: Automatic redirection needs to done with
- // care for methods not known to be safe […],
- // since the user might not wish to redirect an unsafe request.
- // RFC7231§6.4.7: The 307 (Temporary Redirect) status code indicates
- // that the target resource resides temporarily under a different URI
- // and the user agent MUST NOT change the request method
- // if it performs an automatic redirection to that URI.
- var header;
- var headers = this._options.headers;
- if (response.statusCode !== 307 && !(this._options.method in SAFE_METHODS)) {
- this._options.method = "GET";
- // Drop a possible entity and headers related to it
- this._requestBodyBuffers = [];
- for (header in headers) {
- if (/^content-/i.test(header)) {
- delete headers[header];
+ // Add headers to the request
+ if ('setRequestHeader' in request) {
+ utils.forEach(requestHeaders, function setRequestHeader(val, key) {
+ if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
+ // Remove Content-Type if data is undefined
+ delete requestHeaders[key];
+ } else {
+ // Otherwise add header to the request
+ request.setRequestHeader(key, val);
}
- }
+ });
}
- // Drop the Host header, as the redirect might lead to a different host
- if (!this._isRedirect) {
- for (header in headers) {
- if (/^host$/i.test(header)) {
- delete headers[header];
+ // Add withCredentials to request if needed
+ if (!utils.isUndefined(config.withCredentials)) {
+ request.withCredentials = !!config.withCredentials;
+ }
+
+ // Add responseType to request if needed
+ if (config.responseType) {
+ try {
+ request.responseType = config.responseType;
+ } catch (e) {
+ // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
+ // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
+ if (config.responseType !== 'json') {
+ throw e;
}
}
}
- // Perform the redirected request
- var redirectUrl = url.resolve(this._currentUrl, location);
- debug("redirecting to", redirectUrl);
- Object.assign(this._options, url.parse(redirectUrl));
- this._isRedirect = true;
- this._performRequest();
-
- // Discard the remainder of the response to avoid waiting for data
- response.destroy();
- }
- else {
- // The response is not a redirect; return it as-is
- response.responseUrl = this._currentUrl;
- response.redirects = this._redirects;
- this.emit("response", response);
+ // Handle progress if needed
+ if (typeof config.onDownloadProgress === 'function') {
+ request.addEventListener('progress', config.onDownloadProgress);
+ }
- // Clean up
- this._requestBodyBuffers = [];
- }
-};
+ // Not all browsers support upload events
+ if (typeof config.onUploadProgress === 'function' && request.upload) {
+ request.upload.addEventListener('progress', config.onUploadProgress);
+ }
-// Wraps the key/value object of protocols with redirect functionality
-function wrap(protocols) {
- // Default settings
- var exports = {
- maxRedirects: 21,
- maxBodyLength: 10 * 1024 * 1024,
- };
+ if (config.cancelToken) {
+ // Handle cancellation
+ config.cancelToken.promise.then(function onCanceled(cancel) {
+ if (!request) {
+ return;
+ }
- // Wrap each protocol
- var nativeProtocols = {};
- Object.keys(protocols).forEach(function (scheme) {
- var protocol = scheme + ":";
- var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
- var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
+ request.abort();
+ reject(cancel);
+ // Clean up request
+ request = null;
+ });
+ }
- // Executes a request, following redirects
- wrappedProtocol.request = function (options, callback) {
- if (typeof options === "string") {
- options = url.parse(options);
- options.maxRedirects = exports.maxRedirects;
- }
- else {
- options = Object.assign({
- protocol: protocol,
- maxRedirects: exports.maxRedirects,
- maxBodyLength: exports.maxBodyLength,
- }, options);
- }
- options.nativeProtocols = nativeProtocols;
- assert.equal(options.protocol, protocol, "protocol mismatch");
- debug("options", options);
- return new RedirectableRequest(options, callback);
- };
+ if (requestData === undefined) {
+ requestData = null;
+ }
- // Executes a GET request, following redirects
- wrappedProtocol.get = function (options, callback) {
- var request = wrappedProtocol.request(options, callback);
- request.end();
- return request;
- };
+ // Send the request
+ request.send(requestData);
});
- return exports;
-}
-
-// Exports
-module.exports = wrap({ http: http, https: https });
-module.exports.wrap = wrap;
+};
/***/ }),
-/***/ 3542:
-/***/ ((module, exports, __nccwpck_require__) => {
-
-/**
- * This is the web browser implementation of `debug()`.
- *
- * Expose `debug()` as the module.
- */
+/***/ 52618:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-exports = module.exports = __nccwpck_require__(472);
-exports.log = log;
-exports.formatArgs = formatArgs;
-exports.save = save;
-exports.load = load;
-exports.useColors = useColors;
-exports.storage = 'undefined' != typeof chrome
- && 'undefined' != typeof chrome.storage
- ? chrome.storage.local
- : localstorage();
+"use strict";
-/**
- * Colors.
- */
-exports.colors = [
- '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',
- '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',
- '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',
- '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',
- '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',
- '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',
- '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',
- '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',
- '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',
- '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',
- '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'
-];
+var utils = __nccwpck_require__(20328);
+var bind = __nccwpck_require__(77065);
+var Axios = __nccwpck_require__(98178);
+var mergeConfig = __nccwpck_require__(74831);
+var defaults = __nccwpck_require__(98190);
/**
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
- * and the Firebug extension (any Firefox version) are known
- * to support "%c" CSS customizations.
+ * Create an instance of Axios
*
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ * @param {Object} defaultConfig The default config for the instance
+ * @return {Axios} A new instance of Axios
*/
+function createInstance(defaultConfig) {
+ var context = new Axios(defaultConfig);
+ var instance = bind(Axios.prototype.request, context);
-function useColors() {
- // NB: In an Electron preload script, document will be defined but not fully
- // initialized. Since we know we're in Chrome, we'll just detect this case
- // explicitly
- if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
- return true;
- }
+ // Copy axios.prototype to instance
+ utils.extend(instance, Axios.prototype, context);
- // Internet Explorer and Edge do not support colors.
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
- return false;
- }
+ // Copy context to instance
+ utils.extend(instance, context);
- // is webkit? http://stackoverflow.com/a/16459606/376773
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
- // is firebug? http://stackoverflow.com/a/398120/376773
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
- // is firefox >= v31?
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
- // double check webkit in userAgent just in case we are in a worker
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+ return instance;
}
-/**
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
- */
+// Create the default instance to be exported
+var axios = createInstance(defaults);
-exports.formatters.j = function(v) {
- try {
- return JSON.stringify(v);
- } catch (err) {
- return '[UnexpectedJSONParseError]: ' + err.message;
- }
+// Expose Axios class to allow class inheritance
+axios.Axios = Axios;
+
+// Factory for creating new instances
+axios.create = function create(instanceConfig) {
+ return createInstance(mergeConfig(axios.defaults, instanceConfig));
};
+// Expose Cancel & CancelToken
+axios.Cancel = __nccwpck_require__(98875);
+axios.CancelToken = __nccwpck_require__(71587);
+axios.isCancel = __nccwpck_require__(64057);
-/**
- * Colorize log arguments if enabled.
- *
- * @api public
- */
+// Expose all/spread
+axios.all = function all(promises) {
+ return Promise.all(promises);
+};
+axios.spread = __nccwpck_require__(74850);
-function formatArgs(args) {
- var useColors = this.useColors;
+module.exports = axios;
- args[0] = (useColors ? '%c' : '')
- + this.namespace
- + (useColors ? ' %c' : ' ')
- + args[0]
- + (useColors ? '%c ' : ' ')
- + '+' + exports.humanize(this.diff);
+// Allow use of default import syntax in TypeScript
+module.exports.default = axios;
- if (!useColors) return;
- var c = 'color: ' + this.color;
- args.splice(1, 0, c, 'color: inherit')
+/***/ }),
- // the final "%c" is somewhat tricky, because there could be other
- // arguments passed either before or after the %c, so we need to
- // figure out the correct index to insert the CSS into
- var index = 0;
- var lastC = 0;
- args[0].replace(/%[a-zA-Z%]/g, function(match) {
- if ('%%' === match) return;
- index++;
- if ('%c' === match) {
- // we only are interested in the *last* %c
- // (the user may have provided their own)
- lastC = index;
- }
- });
+/***/ 98875:
+/***/ ((module) => {
+
+"use strict";
- args.splice(lastC, 0, c);
-}
/**
- * Invokes `console.log()` when available.
- * No-op when `console.log` is not a "function".
+ * A `Cancel` is an object that is thrown when an operation is canceled.
*
- * @api public
+ * @class
+ * @param {string=} message The message.
*/
-
-function log() {
- // this hackery is required for IE8/9, where
- // the `console.log` function doesn't have 'apply'
- return 'object' === typeof console
- && console.log
- && Function.prototype.apply.call(console.log, console, arguments);
+function Cancel(message) {
+ this.message = message;
}
+Cancel.prototype.toString = function toString() {
+ return 'Cancel' + (this.message ? ': ' + this.message : '');
+};
+
+Cancel.prototype.__CANCEL__ = true;
+
+module.exports = Cancel;
+
+
+/***/ }),
+
+/***/ 71587:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+"use strict";
+
+
+var Cancel = __nccwpck_require__(98875);
+
/**
- * Save `namespaces`.
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
*
- * @param {String} namespaces
- * @api private
+ * @class
+ * @param {Function} executor The executor function.
*/
+function CancelToken(executor) {
+ if (typeof executor !== 'function') {
+ throw new TypeError('executor must be a function.');
+ }
-function save(namespaces) {
- try {
- if (null == namespaces) {
- exports.storage.removeItem('debug');
- } else {
- exports.storage.debug = namespaces;
+ var resolvePromise;
+ this.promise = new Promise(function promiseExecutor(resolve) {
+ resolvePromise = resolve;
+ });
+
+ var token = this;
+ executor(function cancel(message) {
+ if (token.reason) {
+ // Cancellation has already been requested
+ return;
}
- } catch(e) {}
+
+ token.reason = new Cancel(message);
+ resolvePromise(token.reason);
+ });
}
/**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
+ * Throws a `Cancel` if cancellation has been requested.
*/
-
-function load() {
- var r;
- try {
- r = exports.storage.debug;
- } catch(e) {}
-
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
- if (!r && typeof process !== 'undefined' && 'env' in process) {
- r = process.env.DEBUG;
+CancelToken.prototype.throwIfRequested = function throwIfRequested() {
+ if (this.reason) {
+ throw this.reason;
}
-
- return r;
-}
+};
/**
- * Enable namespaces listed in `localStorage.debug` initially.
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
+ * cancels the `CancelToken`.
*/
+CancelToken.source = function source() {
+ var cancel;
+ var token = new CancelToken(function executor(c) {
+ cancel = c;
+ });
+ return {
+ token: token,
+ cancel: cancel
+ };
+};
-exports.enable(load());
+module.exports = CancelToken;
-/**
- * Localstorage attempts to return the localstorage.
- *
- * This is necessary because safari throws
- * when a user disables cookies/localstorage
- * and you attempt to access it.
- *
- * @return {LocalStorage}
- * @api private
- */
-function localstorage() {
- try {
- return window.localStorage;
- } catch (e) {}
-}
+/***/ }),
+/***/ 64057:
+/***/ ((module) => {
-/***/ }),
+"use strict";
-/***/ 472:
-/***/ ((module, exports, __nccwpck_require__) => {
+module.exports = function isCancel(value) {
+ return !!(value && value.__CANCEL__);
+};
-/**
- * This is the common logic for both the Node.js and web browser
- * implementations of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
-exports.coerce = coerce;
-exports.disable = disable;
-exports.enable = enable;
-exports.enabled = enabled;
-exports.humanize = __nccwpck_require__(9015);
+/***/ }),
-/**
- * Active `debug` instances.
- */
-exports.instances = [];
+/***/ 98178:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-/**
- * The currently active debug mode names, and names to skip.
- */
+"use strict";
-exports.names = [];
-exports.skips = [];
+
+var utils = __nccwpck_require__(20328);
+var buildURL = __nccwpck_require__(30646);
+var InterceptorManager = __nccwpck_require__(3214);
+var dispatchRequest = __nccwpck_require__(85062);
+var mergeConfig = __nccwpck_require__(74831);
/**
- * Map of special "%n" handling functions, for the debug "format" argument.
+ * Create a new instance of Axios
*
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ * @param {Object} instanceConfig The default config for the instance
*/
-
-exports.formatters = {};
+function Axios(instanceConfig) {
+ this.defaults = instanceConfig;
+ this.interceptors = {
+ request: new InterceptorManager(),
+ response: new InterceptorManager()
+ };
+}
/**
- * Select a color.
- * @param {String} namespace
- * @return {Number}
- * @api private
+ * Dispatch a request
+ *
+ * @param {Object} config The config specific for this request (merged with this.defaults)
*/
+Axios.prototype.request = function request(config) {
+ /*eslint no-param-reassign:0*/
+ // Allow for axios('example/url'[, config]) a la fetch API
+ if (typeof config === 'string') {
+ config = arguments[1] || {};
+ config.url = arguments[0];
+ } else {
+ config = config || {};
+ }
-function selectColor(namespace) {
- var hash = 0, i;
+ config = mergeConfig(this.defaults, config);
- for (i in namespace) {
- hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
- hash |= 0; // Convert to 32bit integer
+ // Set config.method
+ if (config.method) {
+ config.method = config.method.toLowerCase();
+ } else if (this.defaults.method) {
+ config.method = this.defaults.method.toLowerCase();
+ } else {
+ config.method = 'get';
}
- return exports.colors[Math.abs(hash) % exports.colors.length];
-}
-
-/**
- * Create a debugger with the given `namespace`.
- *
- * @param {String} namespace
- * @return {Function}
- * @api public
- */
+ // Hook up interceptors middleware
+ var chain = [dispatchRequest, undefined];
+ var promise = Promise.resolve(config);
-function createDebug(namespace) {
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
+ chain.unshift(interceptor.fulfilled, interceptor.rejected);
+ });
- var prevTime;
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
+ chain.push(interceptor.fulfilled, interceptor.rejected);
+ });
- function debug() {
- // disabled?
- if (!debug.enabled) return;
+ while (chain.length) {
+ promise = promise.then(chain.shift(), chain.shift());
+ }
- var self = debug;
+ return promise;
+};
- // set `diff` timestamp
- var curr = +new Date();
- var ms = curr - (prevTime || curr);
- self.diff = ms;
- self.prev = prevTime;
- self.curr = curr;
- prevTime = curr;
+Axios.prototype.getUri = function getUri(config) {
+ config = mergeConfig(this.defaults, config);
+ return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
+};
- // turn the `arguments` into a proper Array
- var args = new Array(arguments.length);
- for (var i = 0; i < args.length; i++) {
- args[i] = arguments[i];
- }
+// Provide aliases for supported request methods
+utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
+ /*eslint func-names:0*/
+ Axios.prototype[method] = function(url, config) {
+ return this.request(utils.merge(config || {}, {
+ method: method,
+ url: url
+ }));
+ };
+});
- args[0] = exports.coerce(args[0]);
+utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
+ /*eslint func-names:0*/
+ Axios.prototype[method] = function(url, data, config) {
+ return this.request(utils.merge(config || {}, {
+ method: method,
+ url: url,
+ data: data
+ }));
+ };
+});
- if ('string' !== typeof args[0]) {
- // anything else let's inspect with %O
- args.unshift('%O');
- }
+module.exports = Axios;
- // apply any `formatters` transformations
- var index = 0;
- args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
- // if we encounter an escaped % then don't increase the array index
- if (match === '%%') return match;
- index++;
- var formatter = exports.formatters[format];
- if ('function' === typeof formatter) {
- var val = args[index];
- match = formatter.call(self, val);
- // now we need to remove `args[index]` since it's inlined in the `format`
- args.splice(index, 1);
- index--;
- }
- return match;
- });
+/***/ }),
- // apply env-specific formatting (colors, etc.)
- exports.formatArgs.call(self, args);
+/***/ 3214:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- var logFn = debug.log || exports.log || console.log.bind(console);
- logFn.apply(self, args);
- }
+"use strict";
- debug.namespace = namespace;
- debug.enabled = exports.enabled(namespace);
- debug.useColors = exports.useColors();
- debug.color = selectColor(namespace);
- debug.destroy = destroy;
- // env-specific initialization logic for debug instances
- if ('function' === typeof exports.init) {
- exports.init(debug);
- }
+var utils = __nccwpck_require__(20328);
- exports.instances.push(debug);
-
- return debug;
-}
-
-function destroy () {
- var index = exports.instances.indexOf(this);
- if (index !== -1) {
- exports.instances.splice(index, 1);
- return true;
- } else {
- return false;
- }
-}
+function InterceptorManager() {
+ this.handlers = [];
+}
/**
- * Enables a debug mode by namespaces. This can include modes
- * separated by a colon and wildcards.
+ * Add a new interceptor to the stack
*
- * @param {String} namespaces
- * @api public
- */
-
-function enable(namespaces) {
- exports.save(namespaces);
-
- exports.names = [];
- exports.skips = [];
-
- var i;
- var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
- var len = split.length;
-
- for (i = 0; i < len; i++) {
- if (!split[i]) continue; // ignore empty strings
- namespaces = split[i].replace(/\*/g, '.*?');
- if (namespaces[0] === '-') {
- exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
- } else {
- exports.names.push(new RegExp('^' + namespaces + '$'));
- }
- }
-
- for (i = 0; i < exports.instances.length; i++) {
- var instance = exports.instances[i];
- instance.enabled = exports.enabled(instance.namespace);
- }
-}
-
-/**
- * Disable debug output.
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
*
- * @api public
+ * @return {Number} An ID used to remove interceptor later
*/
-
-function disable() {
- exports.enable('');
-}
+InterceptorManager.prototype.use = function use(fulfilled, rejected) {
+ this.handlers.push({
+ fulfilled: fulfilled,
+ rejected: rejected
+ });
+ return this.handlers.length - 1;
+};
/**
- * Returns true if the given mode name is enabled, false otherwise.
+ * Remove an interceptor from the stack
*
- * @param {String} name
- * @return {Boolean}
- * @api public
+ * @param {Number} id The ID that was returned by `use`
*/
-
-function enabled(name) {
- if (name[name.length - 1] === '*') {
- return true;
- }
- var i, len;
- for (i = 0, len = exports.skips.length; i < len; i++) {
- if (exports.skips[i].test(name)) {
- return false;
- }
- }
- for (i = 0, len = exports.names.length; i < len; i++) {
- if (exports.names[i].test(name)) {
- return true;
- }
+InterceptorManager.prototype.eject = function eject(id) {
+ if (this.handlers[id]) {
+ this.handlers[id] = null;
}
- return false;
-}
+};
/**
- * Coerce `val`.
+ * Iterate over all the registered interceptors
*
- * @param {Mixed} val
- * @return {Mixed}
- * @api private
+ * This method is particularly useful for skipping over any
+ * interceptors that may have become `null` calling `eject`.
+ *
+ * @param {Function} fn The function to call for each interceptor
*/
+InterceptorManager.prototype.forEach = function forEach(fn) {
+ utils.forEach(this.handlers, function forEachHandler(h) {
+ if (h !== null) {
+ fn(h);
+ }
+ });
+};
-function coerce(val) {
- if (val instanceof Error) return val.stack || val.message;
- return val;
-}
+module.exports = InterceptorManager;
/***/ }),
-/***/ 3226:
+/***/ 41934:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-/**
- * Detect Electron renderer process, which is node, but we should
- * treat as a browser.
- */
-
-if (typeof process === 'undefined' || process.type === 'renderer') {
- module.exports = __nccwpck_require__(3542);
-} else {
- module.exports = __nccwpck_require__(8302);
-}
-
+"use strict";
-/***/ }),
-/***/ 8302:
-/***/ ((module, exports, __nccwpck_require__) => {
+var isAbsoluteURL = __nccwpck_require__(41301);
+var combineURLs = __nccwpck_require__(57189);
/**
- * Module dependencies.
+ * Creates a new URL by combining the baseURL with the requestedURL,
+ * only when the requestedURL is not already an absolute URL.
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} requestedURL Absolute or relative URL to combine
+ * @returns {string} The combined full path
*/
+module.exports = function buildFullPath(baseURL, requestedURL) {
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
+ return combineURLs(baseURL, requestedURL);
+ }
+ return requestedURL;
+};
-var tty = __nccwpck_require__(3867);
-var util = __nccwpck_require__(1669);
-/**
- * This is the Node.js implementation of `debug()`.
- *
- * Expose `debug()` as the module.
- */
+/***/ }),
-exports = module.exports = __nccwpck_require__(472);
-exports.init = init;
-exports.log = log;
-exports.formatArgs = formatArgs;
-exports.save = save;
-exports.load = load;
-exports.useColors = useColors;
+/***/ 15226:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-/**
- * Colors.
- */
+"use strict";
-exports.colors = [ 6, 2, 3, 4, 5, 1 ];
-try {
- var supportsColor = __nccwpck_require__(9318);
- if (supportsColor && supportsColor.level >= 2) {
- exports.colors = [
- 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68,
- 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134,
- 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
- 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204,
- 205, 206, 207, 208, 209, 214, 215, 220, 221
- ];
- }
-} catch (err) {
- // swallow - we only care if `supports-color` is available; it doesn't have to be.
-}
+var enhanceError = __nccwpck_require__(21516);
/**
- * Build up the default `inspectOpts` object from the environment variables.
+ * Create an Error with the specified message, config, error code, request and response.
*
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ * @param {string} message The error message.
+ * @param {Object} config The config.
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
+ * @param {Object} [request] The request.
+ * @param {Object} [response] The response.
+ * @returns {Error} The created error.
*/
+module.exports = function createError(message, config, code, request, response) {
+ var error = new Error(message);
+ return enhanceError(error, config, code, request, response);
+};
-exports.inspectOpts = Object.keys(process.env).filter(function (key) {
- return /^debug_/i.test(key);
-}).reduce(function (obj, key) {
- // camel-case
- var prop = key
- .substring(6)
- .toLowerCase()
- .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
-
- // coerce string value into JS value
- var val = process.env[key];
- if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
- else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
- else if (val === 'null') val = null;
- else val = Number(val);
- obj[prop] = val;
- return obj;
-}, {});
+/***/ }),
-/**
- * Is stdout a TTY? Colored output is enabled when `true`.
- */
+/***/ 85062:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-function useColors() {
- return 'colors' in exports.inspectOpts
- ? Boolean(exports.inspectOpts.colors)
- : tty.isatty(process.stderr.fd);
-}
+"use strict";
-/**
- * Map %o to `util.inspect()`, all on a single line.
- */
-exports.formatters.o = function(v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts)
- .split('\n').map(function(str) {
- return str.trim()
- }).join(' ');
-};
+var utils = __nccwpck_require__(20328);
+var transformData = __nccwpck_require__(19812);
+var isCancel = __nccwpck_require__(64057);
+var defaults = __nccwpck_require__(98190);
/**
- * Map %o to `util.inspect()`, allowing multiple lines if needed.
+ * Throws a `Cancel` if cancellation has been requested.
*/
-
-exports.formatters.O = function(v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts);
-};
+function throwIfCancellationRequested(config) {
+ if (config.cancelToken) {
+ config.cancelToken.throwIfRequested();
+ }
+}
/**
- * Adds ANSI color escape codes if enabled.
+ * Dispatch a request to the server using the configured adapter.
*
- * @api public
+ * @param {object} config The config that is to be used for the request
+ * @returns {Promise} The Promise to be fulfilled
*/
+module.exports = function dispatchRequest(config) {
+ throwIfCancellationRequested(config);
-function formatArgs(args) {
- var name = this.namespace;
- var useColors = this.useColors;
+ // Ensure headers exist
+ config.headers = config.headers || {};
- if (useColors) {
- var c = this.color;
- var colorCode = '\u001b[3' + (c < 8 ? c : '8;5;' + c);
- var prefix = ' ' + colorCode + ';1m' + name + ' ' + '\u001b[0m';
+ // Transform request data
+ config.data = transformData(
+ config.data,
+ config.headers,
+ config.transformRequest
+ );
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
- args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
- } else {
- args[0] = getDate() + name + ' ' + args[0];
- }
-}
+ // Flatten headers
+ config.headers = utils.merge(
+ config.headers.common || {},
+ config.headers[config.method] || {},
+ config.headers
+ );
-function getDate() {
- if (exports.inspectOpts.hideDate) {
- return '';
- } else {
- return new Date().toISOString() + ' ';
- }
-}
+ utils.forEach(
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
+ function cleanHeaderConfig(method) {
+ delete config.headers[method];
+ }
+ );
-/**
- * Invokes `util.format()` with the specified arguments and writes to stderr.
- */
+ var adapter = config.adapter || defaults.adapter;
-function log() {
- return process.stderr.write(util.format.apply(util, arguments) + '\n');
-}
+ return adapter(config).then(function onAdapterResolution(response) {
+ throwIfCancellationRequested(config);
-/**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
+ // Transform response data
+ response.data = transformData(
+ response.data,
+ response.headers,
+ config.transformResponse
+ );
-function save(namespaces) {
- if (null == namespaces) {
- // If you set a process.env field to null or undefined, it gets cast to the
- // string 'null' or 'undefined'. Just delete instead.
- delete process.env.DEBUG;
- } else {
- process.env.DEBUG = namespaces;
- }
-}
+ return response;
+ }, function onAdapterRejection(reason) {
+ if (!isCancel(reason)) {
+ throwIfCancellationRequested(config);
-/**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
+ // Transform response data
+ if (reason && reason.response) {
+ reason.response.data = transformData(
+ reason.response.data,
+ reason.response.headers,
+ config.transformResponse
+ );
+ }
+ }
-function load() {
- return process.env.DEBUG;
-}
+ return Promise.reject(reason);
+ });
+};
-/**
- * Init logic for `debug` instances.
- *
- * Create a new `inspectOpts` object in case `useColors` is set
- * differently for a particular `debug` instance.
- */
-function init (debug) {
- debug.inspectOpts = {};
+/***/ }),
+
+/***/ 21516:
+/***/ ((module) => {
+
+"use strict";
- var keys = Object.keys(exports.inspectOpts);
- for (var i = 0; i < keys.length; i++) {
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
- }
-}
/**
- * Enable namespaces listed in `process.env.DEBUG` initially.
+ * Update an Error with the specified config, error code, and response.
+ *
+ * @param {Error} error The error to update.
+ * @param {Object} config The config.
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
+ * @param {Object} [request] The request.
+ * @param {Object} [response] The response.
+ * @returns {Error} The error.
*/
+module.exports = function enhanceError(error, config, code, request, response) {
+ error.config = config;
+ if (code) {
+ error.code = code;
+ }
-exports.enable(load());
+ error.request = request;
+ error.response = response;
+ error.isAxiosError = true;
+
+ error.toJSON = function() {
+ return {
+ // Standard
+ message: this.message,
+ name: this.name,
+ // Microsoft
+ description: this.description,
+ number: this.number,
+ // Mozilla
+ fileName: this.fileName,
+ lineNumber: this.lineNumber,
+ columnNumber: this.columnNumber,
+ stack: this.stack,
+ // Axios
+ config: this.config,
+ code: this.code
+ };
+ };
+ return error;
+};
/***/ }),
-/***/ 9015:
-/***/ ((module) => {
+/***/ 74831:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-/**
- * Helpers.
- */
+"use strict";
-var s = 1000;
-var m = s * 60;
-var h = m * 60;
-var d = h * 24;
-var y = d * 365.25;
+
+var utils = __nccwpck_require__(20328);
/**
- * Parse or format the given `val`.
- *
- * Options:
- *
- * - `long` verbose formatting [false]
+ * Config-specific merge-function which creates a new config-object
+ * by merging two configuration objects together.
*
- * @param {String|Number} val
- * @param {Object} [options]
- * @throws {Error} throw an error if val is not a non-empty string or a number
- * @return {String|Number}
- * @api public
+ * @param {Object} config1
+ * @param {Object} config2
+ * @returns {Object} New object resulting from merging config2 to config1
*/
+module.exports = function mergeConfig(config1, config2) {
+ // eslint-disable-next-line no-param-reassign
+ config2 = config2 || {};
+ var config = {};
-module.exports = function(val, options) {
- options = options || {};
- var type = typeof val;
- if (type === 'string' && val.length > 0) {
- return parse(val);
- } else if (type === 'number' && isNaN(val) === false) {
- return options.long ? fmtLong(val) : fmtShort(val);
- }
- throw new Error(
- 'val is not a non-empty string or a valid number. val=' +
- JSON.stringify(val)
- );
+ var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];
+ var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];
+ var defaultToConfig2Keys = [
+ 'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer',
+ 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
+ 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress',
+ 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent',
+ 'httpsAgent', 'cancelToken', 'socketPath'
+ ];
+
+ utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
+ if (typeof config2[prop] !== 'undefined') {
+ config[prop] = config2[prop];
+ }
+ });
+
+ utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {
+ if (utils.isObject(config2[prop])) {
+ config[prop] = utils.deepMerge(config1[prop], config2[prop]);
+ } else if (typeof config2[prop] !== 'undefined') {
+ config[prop] = config2[prop];
+ } else if (utils.isObject(config1[prop])) {
+ config[prop] = utils.deepMerge(config1[prop]);
+ } else if (typeof config1[prop] !== 'undefined') {
+ config[prop] = config1[prop];
+ }
+ });
+
+ utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
+ if (typeof config2[prop] !== 'undefined') {
+ config[prop] = config2[prop];
+ } else if (typeof config1[prop] !== 'undefined') {
+ config[prop] = config1[prop];
+ }
+ });
+
+ var axiosKeys = valueFromConfig2Keys
+ .concat(mergeDeepPropertiesKeys)
+ .concat(defaultToConfig2Keys);
+
+ var otherKeys = Object
+ .keys(config2)
+ .filter(function filterAxiosKeys(key) {
+ return axiosKeys.indexOf(key) === -1;
+ });
+
+ utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {
+ if (typeof config2[prop] !== 'undefined') {
+ config[prop] = config2[prop];
+ } else if (typeof config1[prop] !== 'undefined') {
+ config[prop] = config1[prop];
+ }
+ });
+
+ return config;
};
+
+/***/ }),
+
+/***/ 13211:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+"use strict";
+
+
+var createError = __nccwpck_require__(15226);
+
/**
- * Parse the given `str` and return milliseconds.
+ * Resolve or reject a Promise based on response status.
*
- * @param {String} str
- * @return {Number}
- * @api private
+ * @param {Function} resolve A function that resolves the promise.
+ * @param {Function} reject A function that rejects the promise.
+ * @param {object} response The response.
*/
-
-function parse(str) {
- str = String(str);
- if (str.length > 100) {
- return;
- }
- var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
- str
- );
- if (!match) {
- return;
- }
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'yrs':
- case 'yr':
- case 'y':
- return n * y;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'hrs':
- case 'hr':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'mins':
- case 'min':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 'secs':
- case 'sec':
- case 's':
- return n * s;
- case 'milliseconds':
- case 'millisecond':
- case 'msecs':
- case 'msec':
- case 'ms':
- return n;
- default:
- return undefined;
+module.exports = function settle(resolve, reject, response) {
+ var validateStatus = response.config.validateStatus;
+ if (!validateStatus || validateStatus(response.status)) {
+ resolve(response);
+ } else {
+ reject(createError(
+ 'Request failed with status code ' + response.status,
+ response.config,
+ null,
+ response.request,
+ response
+ ));
}
-}
+};
-/**
- * Short format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-function fmtShort(ms) {
- if (ms >= d) {
- return Math.round(ms / d) + 'd';
- }
- if (ms >= h) {
- return Math.round(ms / h) + 'h';
- }
- if (ms >= m) {
- return Math.round(ms / m) + 'm';
- }
- if (ms >= s) {
- return Math.round(ms / s) + 's';
- }
- return ms + 'ms';
-}
+/***/ }),
-/**
- * Long format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
+/***/ 19812:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-function fmtLong(ms) {
- return plural(ms, d, 'day') ||
- plural(ms, h, 'hour') ||
- plural(ms, m, 'minute') ||
- plural(ms, s, 'second') ||
- ms + ' ms';
-}
+"use strict";
+
+
+var utils = __nccwpck_require__(20328);
/**
- * Pluralization helper.
+ * Transform the data for a request or a response
+ *
+ * @param {Object|String} data The data to be transformed
+ * @param {Array} headers The headers for the request or response
+ * @param {Array|Function} fns A single function or Array of functions
+ * @returns {*} The resulting transformed data
*/
+module.exports = function transformData(data, headers, fns) {
+ /*eslint no-param-reassign:0*/
+ utils.forEach(fns, function transform(fn) {
+ data = fn(data, headers);
+ });
-function plural(ms, n, name) {
- if (ms < n) {
- return;
- }
- if (ms < n * 1.5) {
- return Math.floor(ms / n) + ' ' + name;
- }
- return Math.ceil(ms / n) + ' ' + name + 's';
-}
+ return data;
+};
/***/ }),
-/***/ 6956:
-/***/ ((module, exports, __nccwpck_require__) => {
+/***/ 98190:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
-exports.__esModule = true;
-// istanbul ignore next
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
-var _handlebarsRuntime = __nccwpck_require__(7390);
+var utils = __nccwpck_require__(20328);
+var normalizeHeaderName = __nccwpck_require__(36240);
-var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime);
-
-// Compiler imports
+var DEFAULT_CONTENT_TYPE = {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+};
-var _handlebarsCompilerAst = __nccwpck_require__(9211);
+function setContentTypeIfUnset(headers, value) {
+ if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
+ headers['Content-Type'] = value;
+ }
+}
-var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst);
+function getDefaultAdapter() {
+ var adapter;
+ if (typeof XMLHttpRequest !== 'undefined') {
+ // For browsers use XHR adapter
+ adapter = __nccwpck_require__(3454);
+ } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
+ // For node use HTTP adapter
+ adapter = __nccwpck_require__(68104);
+ }
+ return adapter;
+}
-var _handlebarsCompilerBase = __nccwpck_require__(1475);
+var defaults = {
+ adapter: getDefaultAdapter(),
-var _handlebarsCompilerCompiler = __nccwpck_require__(9081);
+ transformRequest: [function transformRequest(data, headers) {
+ normalizeHeaderName(headers, 'Accept');
+ normalizeHeaderName(headers, 'Content-Type');
+ if (utils.isFormData(data) ||
+ utils.isArrayBuffer(data) ||
+ utils.isBuffer(data) ||
+ utils.isStream(data) ||
+ utils.isFile(data) ||
+ utils.isBlob(data)
+ ) {
+ return data;
+ }
+ if (utils.isArrayBufferView(data)) {
+ return data.buffer;
+ }
+ if (utils.isURLSearchParams(data)) {
+ setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
+ return data.toString();
+ }
+ if (utils.isObject(data)) {
+ setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
+ return JSON.stringify(data);
+ }
+ return data;
+ }],
-var _handlebarsCompilerJavascriptCompiler = __nccwpck_require__(1617);
+ transformResponse: [function transformResponse(data) {
+ /*eslint no-param-reassign:0*/
+ if (typeof data === 'string') {
+ try {
+ data = JSON.parse(data);
+ } catch (e) { /* Ignore */ }
+ }
+ return data;
+ }],
-var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
+ /**
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
+ * timeout is not created.
+ */
+ timeout: 0,
-var _handlebarsCompilerVisitor = __nccwpck_require__(4166);
+ xsrfCookieName: 'XSRF-TOKEN',
+ xsrfHeaderName: 'X-XSRF-TOKEN',
-var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor);
+ maxContentLength: -1,
-var _handlebarsNoConflict = __nccwpck_require__(1983);
+ validateStatus: function validateStatus(status) {
+ return status >= 200 && status < 300;
+ }
+};
-var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
+defaults.headers = {
+ common: {
+ 'Accept': 'application/json, text/plain, */*'
+ }
+};
-var _create = _handlebarsRuntime2['default'].create;
-function create() {
- var hb = _create();
+utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
+ defaults.headers[method] = {};
+});
- hb.compile = function (input, options) {
- return _handlebarsCompilerCompiler.compile(input, options, hb);
- };
- hb.precompile = function (input, options) {
- return _handlebarsCompilerCompiler.precompile(input, options, hb);
- };
+utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
+ defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
+});
- hb.AST = _handlebarsCompilerAst2['default'];
- hb.Compiler = _handlebarsCompilerCompiler.Compiler;
- hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2['default'];
- hb.Parser = _handlebarsCompilerBase.parser;
- hb.parse = _handlebarsCompilerBase.parse;
- hb.parseWithoutProcessing = _handlebarsCompilerBase.parseWithoutProcessing;
+module.exports = defaults;
- return hb;
-}
-var inst = create();
-inst.create = create;
+/***/ }),
-_handlebarsNoConflict2['default'](inst);
+/***/ 77065:
+/***/ ((module) => {
-inst.Visitor = _handlebarsCompilerVisitor2['default'];
+"use strict";
-inst['default'] = inst;
-exports.default = inst;
-module.exports = exports['default'];
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3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5wdXQsIG9wdGlvbnMsIGhiKTtcbiAgfTtcbiAgaGIucHJlY29tcGlsZSA9IGZ1bmN0aW9uKGlucHV0LCBvcHRpb25zKSB7XG4gICAgcmV0dXJuIHByZWNvbXBpbGUoaW5wdXQsIG9wdGlvbnMsIGhiKTtcbiAgfTtcblxuICBoYi5BU1QgPSBBU1Q7XG4gIGhiLkNvbXBpbGVyID0gQ29tcGlsZXI7XG4gIGhiLkphdmFTY3JpcHRDb21waWxlciA9IEphdmFTY3JpcHRDb21waWxlcjtcbiAgaGIuUGFyc2VyID0gUGFyc2VyO1xuICBoYi5wYXJzZSA9IHBhcnNlO1xuICBoYi5wYXJzZVdpdGhvdXRQcm9jZXNzaW5nID0gcGFyc2VXaXRob3V0UHJvY2Vzc2luZztcblxuICByZXR1cm4gaGI7XG59XG5cbmxldCBpbnN0ID0gY3JlYXRlKCk7XG5pbnN0LmNyZWF0ZSA9IGNyZWF0ZTtcblxubm9Db25mbGljdChpbnN0KTtcblxuaW5zdC5WaXNpdG9yID0gVmlzaXRvcjtcblxuaW5zdFsnZGVmYXVsdCddID0gaW5zdDtcblxuZXhwb3J0IGRlZmF1bHQgaW5zdDtcbiJdfQ==
+module.exports = function bind(fn, thisArg) {
+ return function wrap() {
+ var args = new Array(arguments.length);
+ for (var i = 0; i < args.length; i++) {
+ args[i] = arguments[i];
+ }
+ return fn.apply(thisArg, args);
+ };
+};
/***/ }),
-/***/ 7390:
-/***/ ((module, exports, __nccwpck_require__) => {
+/***/ 30646:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
-exports.__esModule = true;
-// istanbul ignore next
+var utils = __nccwpck_require__(20328);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+function encode(val) {
+ return encodeURIComponent(val).
+ replace(/%40/gi, '@').
+ replace(/%3A/gi, ':').
+ replace(/%24/g, '$').
+ replace(/%2C/gi, ',').
+ replace(/%20/g, '+').
+ replace(/%5B/gi, '[').
+ replace(/%5D/gi, ']');
+}
-// istanbul ignore next
+/**
+ * Build a URL by appending params to the end
+ *
+ * @param {string} url The base of the url (e.g., http://www.google.com)
+ * @param {object} [params] The params to be appended
+ * @returns {string} The formatted url
+ */
+module.exports = function buildURL(url, params, paramsSerializer) {
+ /*eslint no-param-reassign:0*/
+ if (!params) {
+ return url;
+ }
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
+ var serializedParams;
+ if (paramsSerializer) {
+ serializedParams = paramsSerializer(params);
+ } else if (utils.isURLSearchParams(params)) {
+ serializedParams = params.toString();
+ } else {
+ var parts = [];
-var _handlebarsBase = __nccwpck_require__(4211);
+ utils.forEach(params, function serialize(val, key) {
+ if (val === null || typeof val === 'undefined') {
+ return;
+ }
-var base = _interopRequireWildcard(_handlebarsBase);
+ if (utils.isArray(val)) {
+ key = key + '[]';
+ } else {
+ val = [val];
+ }
-// Each of these augment the Handlebars object. No need to setup here.
-// (This is done to easily share code between commonjs and browse envs)
+ utils.forEach(val, function parseValue(v) {
+ if (utils.isDate(v)) {
+ v = v.toISOString();
+ } else if (utils.isObject(v)) {
+ v = JSON.stringify(v);
+ }
+ parts.push(encode(key) + '=' + encode(v));
+ });
+ });
-var _handlebarsSafeString = __nccwpck_require__(3296);
+ serializedParams = parts.join('&');
+ }
-var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
+ if (serializedParams) {
+ var hashmarkIndex = url.indexOf('#');
+ if (hashmarkIndex !== -1) {
+ url = url.slice(0, hashmarkIndex);
+ }
-var _handlebarsException = __nccwpck_require__(2879);
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
+ }
-var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
+ return url;
+};
-var _handlebarsUtils = __nccwpck_require__(1437);
-var Utils = _interopRequireWildcard(_handlebarsUtils);
+/***/ }),
-var _handlebarsRuntime = __nccwpck_require__(7663);
+/***/ 57189:
+/***/ ((module) => {
-var runtime = _interopRequireWildcard(_handlebarsRuntime);
+"use strict";
-var _handlebarsNoConflict = __nccwpck_require__(1983);
-var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
+/**
+ * Creates a new URL by combining the specified URLs
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} relativeURL The relative URL
+ * @returns {string} The combined URL
+ */
+module.exports = function combineURLs(baseURL, relativeURL) {
+ return relativeURL
+ ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
+ : baseURL;
+};
-// For compatibility and usage outside of module systems, make the Handlebars object a namespace
-function create() {
- var hb = new base.HandlebarsEnvironment();
- Utils.extend(hb, base);
- hb.SafeString = _handlebarsSafeString2['default'];
- hb.Exception = _handlebarsException2['default'];
- hb.Utils = Utils;
- hb.escapeExpression = Utils.escapeExpression;
+/***/ }),
- hb.VM = runtime;
- hb.template = function (spec) {
- return runtime.template(spec, hb);
- };
+/***/ 21545:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- return hb;
-}
+"use strict";
-var inst = create();
-inst.create = create;
-_handlebarsNoConflict2['default'](inst);
+var utils = __nccwpck_require__(20328);
-inst['default'] = inst;
+module.exports = (
+ utils.isStandardBrowserEnv() ?
-exports.default = inst;
-module.exports = exports['default'];
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL2xpYi9oYW5kbGViYXJzLnJ1bnRpbWUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OEJBQXNCLG1CQUFtQjs7SUFBN0IsSUFBSTs7Ozs7b0NBSU8sMEJBQTBCOzs7O21DQUMzQix3QkFBd0I7Ozs7K0JBQ3ZCLG9CQUFvQjs7SUFBL0IsS0FBSzs7aUNBQ1Esc0JBQXNCOztJQUFuQy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O1xuaW5zdC5jcmVhdGUgPSBjcmVhdGU7XG5cbm5vQ29uZmxpY3QoaW5zdCk7XG5cbmluc3RbJ2RlZmF1bHQnXSA9IGluc3Q7XG5cbmV4cG9ydCBkZWZhdWx0IGluc3Q7XG4iXX0=
+ // Standard browser envs support document.cookie
+ (function standardBrowserEnv() {
+ return {
+ write: function write(name, value, expires, path, domain, secure) {
+ var cookie = [];
+ cookie.push(name + '=' + encodeURIComponent(value));
+ if (utils.isNumber(expires)) {
+ cookie.push('expires=' + new Date(expires).toGMTString());
+ }
-/***/ }),
+ if (utils.isString(path)) {
+ cookie.push('path=' + path);
+ }
-/***/ 4211:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ if (utils.isString(domain)) {
+ cookie.push('domain=' + domain);
+ }
-"use strict";
+ if (secure === true) {
+ cookie.push('secure');
+ }
+ document.cookie = cookie.join('; ');
+ },
-exports.__esModule = true;
-exports.HandlebarsEnvironment = HandlebarsEnvironment;
-// istanbul ignore next
+ read: function read(name) {
+ var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
+ return (match ? decodeURIComponent(match[3]) : null);
+ },
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+ remove: function remove(name) {
+ this.write(name, '', Date.now() - 86400000);
+ }
+ };
+ })() :
-var _utils = __nccwpck_require__(1437);
+ // Non standard browser env (web workers, react-native) lack needed support.
+ (function nonStandardBrowserEnv() {
+ return {
+ write: function write() {},
+ read: function read() { return null; },
+ remove: function remove() {}
+ };
+ })()
+);
-var _exception = __nccwpck_require__(2879);
-var _exception2 = _interopRequireDefault(_exception);
+/***/ }),
-var _helpers = __nccwpck_require__(3066);
+/***/ 41301:
+/***/ ((module) => {
-var _decorators = __nccwpck_require__(4168);
+"use strict";
-var _logger = __nccwpck_require__(7142);
-var _logger2 = _interopRequireDefault(_logger);
+/**
+ * Determines whether the specified URL is absolute
+ *
+ * @param {string} url The URL to test
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
+ */
+module.exports = function isAbsoluteURL(url) {
+ // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL).
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
+ // by any combination of letters, digits, plus, period, or hyphen.
+ return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
+};
-var _internalProtoAccess = __nccwpck_require__(6066);
-var VERSION = '4.7.7';
-exports.VERSION = VERSION;
-var COMPILER_REVISION = 8;
-exports.COMPILER_REVISION = COMPILER_REVISION;
-var LAST_COMPATIBLE_COMPILER_REVISION = 7;
+/***/ }),
-exports.LAST_COMPATIBLE_COMPILER_REVISION = LAST_COMPATIBLE_COMPILER_REVISION;
-var REVISION_CHANGES = {
- 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
- 2: '== 1.0.0-rc.3',
- 3: '== 1.0.0-rc.4',
- 4: '== 1.x.x',
- 5: '== 2.0.0-alpha.x',
- 6: '>= 2.0.0-beta.1',
- 7: '>= 4.0.0 <4.3.0',
- 8: '>= 4.3.0'
-};
+/***/ 33608:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-exports.REVISION_CHANGES = REVISION_CHANGES;
-var objectType = '[object Object]';
+"use strict";
-function HandlebarsEnvironment(helpers, partials, decorators) {
- this.helpers = helpers || {};
- this.partials = partials || {};
- this.decorators = decorators || {};
- _helpers.registerDefaultHelpers(this);
- _decorators.registerDefaultDecorators(this);
-}
+var utils = __nccwpck_require__(20328);
-HandlebarsEnvironment.prototype = {
- constructor: HandlebarsEnvironment,
+module.exports = (
+ utils.isStandardBrowserEnv() ?
- logger: _logger2['default'],
- log: _logger2['default'].log,
+ // Standard browser envs have full support of the APIs needed to test
+ // whether the request URL is of the same origin as current location.
+ (function standardBrowserEnv() {
+ var msie = /(msie|trident)/i.test(navigator.userAgent);
+ var urlParsingNode = document.createElement('a');
+ var originURL;
- registerHelper: function registerHelper(name, fn) {
- if (_utils.toString.call(name) === objectType) {
- if (fn) {
- throw new _exception2['default']('Arg not supported with multiple helpers');
- }
- _utils.extend(this.helpers, name);
- } else {
- this.helpers[name] = fn;
- }
- },
- unregisterHelper: function unregisterHelper(name) {
- delete this.helpers[name];
- },
+ /**
+ * Parse a URL to discover it's components
+ *
+ * @param {String} url The URL to be parsed
+ * @returns {Object}
+ */
+ function resolveURL(url) {
+ var href = url;
- registerPartial: function registerPartial(name, partial) {
- if (_utils.toString.call(name) === objectType) {
- _utils.extend(this.partials, name);
- } else {
- if (typeof partial === 'undefined') {
- throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
- }
- this.partials[name] = partial;
- }
- },
- unregisterPartial: function unregisterPartial(name) {
- delete this.partials[name];
- },
+ if (msie) {
+ // IE needs attribute set twice to normalize properties
+ urlParsingNode.setAttribute('href', href);
+ href = urlParsingNode.href;
+ }
- registerDecorator: function registerDecorator(name, fn) {
- if (_utils.toString.call(name) === objectType) {
- if (fn) {
- throw new _exception2['default']('Arg not supported with multiple decorators');
+ urlParsingNode.setAttribute('href', href);
+
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
+ return {
+ href: urlParsingNode.href,
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
+ host: urlParsingNode.host,
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
+ hostname: urlParsingNode.hostname,
+ port: urlParsingNode.port,
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
+ urlParsingNode.pathname :
+ '/' + urlParsingNode.pathname
+ };
}
- _utils.extend(this.decorators, name);
- } else {
- this.decorators[name] = fn;
- }
- },
- unregisterDecorator: function unregisterDecorator(name) {
- delete this.decorators[name];
- },
- /**
- * Reset the memory of illegal property accesses that have already been logged.
- * @deprecated should only be used in handlebars test-cases
- */
- resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses() {
- _internalProtoAccess.resetLoggedProperties();
- }
-};
-var log = _logger2['default'].log;
+ originURL = resolveURL(window.location.href);
-exports.log = log;
-exports.createFrame = _utils.createFrame;
-exports.logger = _logger2['default'];
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2Jhc2UuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7cUJBQThDLFNBQVM7O3lCQUNqQyxhQUFhOzs7O3VCQUNJLFdBQVc7OzBCQUNSLGNBQWM7O3NCQUNyQyxVQUFVOzs7O21DQUNTLHlCQUF5Qjs7QUFFeEQsSUFBTSxPQUFPLEdBQUcsT0FBTyxDQUFDOztBQUN4QixJQUFNLGlCQUFpQixHQUFHLENBQUMsQ0FBQzs7QUFDNUIsSUFBTSxpQ0FBaUMsR0FBRyxDQUFDLENBQUM7OztBQUU1QyxJQUFNLGdCQUFnQixHQUFHO0FBQzlCLEdBQUMsRUFBRSxhQUFhO0FBQ2hCLEdBQUMsRUFBRSxlQUFlO0FBQ2xCLEdBQUMsRUFBRSxlQUFlO0FBQ2xCLEdBQUMsRUFBRSxVQUFVO0FBQ2IsR0FBQyxFQUFFLGtCQUFrQjtBQUNyQixHQUFDLEVBQUUsaUJBQWlCO0FBQ3BCLEdBQUMsRUFBRSxpQkFBaUI7QUFDcEIsR0FBQyxFQUFFLFVBQVU7Q0FDZCxDQUFDOzs7QUFFRixJQUFNLFVBQVUsR0FBRyxpQkFBaUIsQ0FBQzs7QUFFOUIsU0FBUyxxQkFBcUIsQ0FBQyxPQUFPLEVBQUUsUUFBUSxFQUFFLFVBQVUsRUFBRTtBQUNuRSxNQUFJLENBQUMsT0FBTyxHQUFHLE9BQU8sSUFBSSxFQUFFLENBQUM7QUFDN0IsTUFBSSxDQUFDLFFBQVEsR0FBRyxRQUFRLElBQUksRUFBRSxDQUFDO0FBQy9CLE1BQUksQ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VyLmxvZztcblxuZXhwb3J0IHsgY3JlYXRlRnJhbWUsIGxvZ2dlciB9O1xuIl19
+ /**
+ * Determine if a URL shares the same origin as the current location
+ *
+ * @param {String} requestURL The URL to test
+ * @returns {boolean} True if URL shares the same origin, otherwise false
+ */
+ return function isURLSameOrigin(requestURL) {
+ var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
+ return (parsed.protocol === originURL.protocol &&
+ parsed.host === originURL.host);
+ };
+ })() :
+
+ // Non standard browser envs (web workers, react-native) lack needed support.
+ (function nonStandardBrowserEnv() {
+ return function isURLSameOrigin() {
+ return true;
+ };
+ })()
+);
/***/ }),
-/***/ 9211:
-/***/ ((module, exports) => {
+/***/ 36240:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
-exports.__esModule = true;
-var AST = {
- // Public API used to evaluate derived attributes regarding AST nodes
- helpers: {
- // a mustache is definitely a helper if:
- // * it is an eligible helper, and
- // * it has at least one parameter or hash segment
- helperExpression: function helperExpression(node) {
- return node.type === 'SubExpression' || (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && node.params.length || node.hash);
- },
-
- scopedId: function scopedId(path) {
- return (/^\.|this\b/.test(path.original)
- );
- },
+var utils = __nccwpck_require__(20328);
- // an ID is simple if it only has one part, and that part is not
- // `..` or `this`.
- simpleId: function simpleId(path) {
- return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth;
+module.exports = function normalizeHeaderName(headers, normalizedName) {
+ utils.forEach(headers, function processHeader(value, name) {
+ if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
+ headers[normalizedName] = value;
+ delete headers[name];
}
- }
+ });
};
-// Must be exported as an object rather than the root of the module as the jison lexer
-// must modify the object to operate properly.
-exports.default = AST;
-module.exports = exports['default'];
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGVi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BqaXNvbiBsZXhlclxuLy8gbXVzdCBtb2RpZnkgdGhlIG9iamVjdCB0byBvcGVyYXRlIHByb3Blcmx5LlxuZXhwb3J0IGRlZmF1bHQgQVNUO1xuIl19
-
/***/ }),
-/***/ 1475:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+/***/ 86455:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
-exports.__esModule = true;
-exports.parseWithoutProcessing = parseWithoutProcessing;
-exports.parse = parse;
-// istanbul ignore next
+var utils = __nccwpck_require__(20328);
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
+// Headers whose duplicates are ignored by node
+// c.f. https://nodejs.org/api/http.html#http_message_headers
+var ignoreDuplicateOf = [
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
+ 'referer', 'retry-after', 'user-agent'
+];
-// istanbul ignore next
+/**
+ * Parse headers into an object
+ *
+ * ```
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
+ * Content-Type: application/json
+ * Connection: keep-alive
+ * Transfer-Encoding: chunked
+ * ```
+ *
+ * @param {String} headers Headers needing to be parsed
+ * @returns {Object} Headers parsed into an object
+ */
+module.exports = function parseHeaders(headers) {
+ var parsed = {};
+ var key;
+ var val;
+ var i;
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+ if (!headers) { return parsed; }
-var _parser = __nccwpck_require__(5505);
+ utils.forEach(headers.split('\n'), function parser(line) {
+ i = line.indexOf(':');
+ key = utils.trim(line.substr(0, i)).toLowerCase();
+ val = utils.trim(line.substr(i + 1));
-var _parser2 = _interopRequireDefault(_parser);
+ if (key) {
+ if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
+ return;
+ }
+ if (key === 'set-cookie') {
+ parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
+ } else {
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
+ }
+ }
+ });
-var _whitespaceControl = __nccwpck_require__(5200);
+ return parsed;
+};
-var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
-var _helpers = __nccwpck_require__(4706);
+/***/ }),
-var Helpers = _interopRequireWildcard(_helpers);
+/***/ 74850:
+/***/ ((module) => {
-var _utils = __nccwpck_require__(1437);
+"use strict";
-exports.parser = _parser2['default'];
-var yy = {};
-_utils.extend(yy, Helpers);
+/**
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
+ *
+ * Common use case would be to use `Function.prototype.apply`.
+ *
+ * ```js
+ * function f(x, y, z) {}
+ * var args = [1, 2, 3];
+ * f.apply(null, args);
+ * ```
+ *
+ * With `spread` this example can be re-written.
+ *
+ * ```js
+ * spread(function(x, y, z) {})([1, 2, 3]);
+ * ```
+ *
+ * @param {Function} callback
+ * @returns {Function}
+ */
+module.exports = function spread(callback) {
+ return function wrap(arr) {
+ return callback.apply(null, arr);
+ };
+};
-function parseWithoutProcessing(input, options) {
- // Just return if an already-compiled AST was passed in.
- if (input.type === 'Program') {
- return input;
- }
- _parser2['default'].yy = yy;
+/***/ }),
- // Altering the shared object here, but this is ok as parser is a sync operation
- yy.locInfo = function (locInfo) {
- return new yy.SourceLocation(options && options.srcName, locInfo);
- };
+/***/ 20328:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- var ast = _parser2['default'].parse(input);
+"use strict";
- return ast;
-}
-function parse(input, options) {
- var ast = parseWithoutProcessing(input, options);
- var strip = new _whitespaceControl2['default'](options);
+var bind = __nccwpck_require__(77065);
- return strip.accept(ast);
-}
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9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gc3RyaXAgPSBuZXcgV2hpdGVzcGFjZUNvbnRyb2wob3B0aW9ucyk7XG5cbiAgcmV0dXJuIHN0cmlwLmFjY2VwdChhc3QpO1xufVxuIl19
+/*global toString:true*/
+// utils is a library of generic helper functions non-specific to axios
-/***/ }),
+var toString = Object.prototype.toString;
-/***/ 3612:
-/***/ ((module, exports, __nccwpck_require__) => {
+/**
+ * Determine if a value is an Array
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is an Array, otherwise false
+ */
+function isArray(val) {
+ return toString.call(val) === '[object Array]';
+}
-"use strict";
-/* global define */
+/**
+ * Determine if a value is undefined
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if the value is undefined, otherwise false
+ */
+function isUndefined(val) {
+ return typeof val === 'undefined';
+}
+/**
+ * Determine if a value is a Buffer
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Buffer, otherwise false
+ */
+function isBuffer(val) {
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
+ && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
+}
-exports.__esModule = true;
+/**
+ * Determine if a value is an ArrayBuffer
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
+ */
+function isArrayBuffer(val) {
+ return toString.call(val) === '[object ArrayBuffer]';
+}
-var _utils = __nccwpck_require__(1437);
+/**
+ * Determine if a value is a FormData
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is an FormData, otherwise false
+ */
+function isFormData(val) {
+ return (typeof FormData !== 'undefined') && (val instanceof FormData);
+}
-var SourceNode = undefined;
-
-try {
- /* istanbul ignore next */
- if (typeof define !== 'function' || !define.amd) {
- // We don't support this in AMD environments. For these environments, we asusme that
- // they are running on the browser and thus have no need for the source-map library.
- var SourceMap = __nccwpck_require__(3825);
- SourceNode = SourceMap.SourceNode;
+/**
+ * Determine if a value is a view on an ArrayBuffer
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
+ */
+function isArrayBufferView(val) {
+ var result;
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
+ result = ArrayBuffer.isView(val);
+ } else {
+ result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
}
-} catch (err) {}
-/* NOP */
-
-/* istanbul ignore if: tested but not covered in istanbul due to dist build */
-if (!SourceNode) {
- SourceNode = function (line, column, srcFile, chunks) {
- this.src = '';
- if (chunks) {
- this.add(chunks);
- }
- };
- /* istanbul ignore next */
- SourceNode.prototype = {
- add: function add(chunks) {
- if (_utils.isArray(chunks)) {
- chunks = chunks.join('');
- }
- this.src += chunks;
- },
- prepend: function prepend(chunks) {
- if (_utils.isArray(chunks)) {
- chunks = chunks.join('');
- }
- this.src = chunks + this.src;
- },
- toStringWithSourceMap: function toStringWithSourceMap() {
- return { code: this.toString() };
- },
- toString: function toString() {
- return this.src;
- }
- };
+ return result;
}
-function castChunk(chunk, codeGen, loc) {
- if (_utils.isArray(chunk)) {
- var ret = [];
-
- for (var i = 0, len = chunk.length; i < len; i++) {
- ret.push(codeGen.wrap(chunk[i], loc));
- }
- return ret;
- } else if (typeof chunk === 'boolean' || typeof chunk === 'number') {
- // Handle primitives that the SourceNode will throw up on
- return chunk + '';
- }
- return chunk;
+/**
+ * Determine if a value is a String
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a String, otherwise false
+ */
+function isString(val) {
+ return typeof val === 'string';
}
-function CodeGen(srcFile) {
- this.srcFile = srcFile;
- this.source = [];
+/**
+ * Determine if a value is a Number
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Number, otherwise false
+ */
+function isNumber(val) {
+ return typeof val === 'number';
}
-CodeGen.prototype = {
- isEmpty: function isEmpty() {
- return !this.source.length;
- },
- prepend: function prepend(source, loc) {
- this.source.unshift(this.wrap(source, loc));
- },
- push: function push(source, loc) {
- this.source.push(this.wrap(source, loc));
- },
-
- merge: function merge() {
- var source = this.empty();
- this.each(function (line) {
- source.add([' ', line, '\n']);
- });
- return source;
- },
+/**
+ * Determine if a value is an Object
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is an Object, otherwise false
+ */
+function isObject(val) {
+ return val !== null && typeof val === 'object';
+}
- each: function each(iter) {
- for (var i = 0, len = this.source.length; i < len; i++) {
- iter(this.source[i]);
- }
- },
+/**
+ * Determine if a value is a Date
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Date, otherwise false
+ */
+function isDate(val) {
+ return toString.call(val) === '[object Date]';
+}
- empty: function empty() {
- var loc = this.currentLocation || { start: {} };
- return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
- },
- wrap: function wrap(chunk) {
- var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1];
+/**
+ * Determine if a value is a File
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+function isFile(val) {
+ return toString.call(val) === '[object File]';
+}
- if (chunk instanceof SourceNode) {
- return chunk;
- }
+/**
+ * Determine if a value is a Blob
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Blob, otherwise false
+ */
+function isBlob(val) {
+ return toString.call(val) === '[object Blob]';
+}
- chunk = castChunk(chunk, this, loc);
+/**
+ * Determine if a value is a Function
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Function, otherwise false
+ */
+function isFunction(val) {
+ return toString.call(val) === '[object Function]';
+}
- return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk);
- },
+/**
+ * Determine if a value is a Stream
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Stream, otherwise false
+ */
+function isStream(val) {
+ return isObject(val) && isFunction(val.pipe);
+}
- functionCall: function functionCall(fn, type, params) {
- params = this.generateList(params);
- return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);
- },
+/**
+ * Determine if a value is a URLSearchParams object
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
+ */
+function isURLSearchParams(val) {
+ return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
+}
- quotedString: function quotedString(str) {
- return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4
- .replace(/\u2029/g, '\\u2029') + '"';
- },
+/**
+ * Trim excess whitespace off the beginning and end of a string
+ *
+ * @param {String} str The String to trim
+ * @returns {String} The String freed of excess whitespace
+ */
+function trim(str) {
+ return str.replace(/^\s*/, '').replace(/\s*$/, '');
+}
- objectLiteral: function objectLiteral(obj) {
- // istanbul ignore next
+/**
+ * Determine if we're running in a standard browser environment
+ *
+ * This allows axios to run in a web worker, and react-native.
+ * Both environments support XMLHttpRequest, but not fully standard globals.
+ *
+ * web workers:
+ * typeof window -> undefined
+ * typeof document -> undefined
+ *
+ * react-native:
+ * navigator.product -> 'ReactNative'
+ * nativescript
+ * navigator.product -> 'NativeScript' or 'NS'
+ */
+function isStandardBrowserEnv() {
+ if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
+ navigator.product === 'NativeScript' ||
+ navigator.product === 'NS')) {
+ return false;
+ }
+ return (
+ typeof window !== 'undefined' &&
+ typeof document !== 'undefined'
+ );
+}
- var _this = this;
+/**
+ * Iterate over an Array or an Object invoking a function for each item.
+ *
+ * If `obj` is an Array callback will be called passing
+ * the value, index, and complete array for each item.
+ *
+ * If 'obj' is an Object callback will be called passing
+ * the value, key, and complete object for each property.
+ *
+ * @param {Object|Array} obj The object to iterate
+ * @param {Function} fn The callback to invoke for each item
+ */
+function forEach(obj, fn) {
+ // Don't bother if no value provided
+ if (obj === null || typeof obj === 'undefined') {
+ return;
+ }
- var pairs = [];
+ // Force an array if not already something iterable
+ if (typeof obj !== 'object') {
+ /*eslint no-param-reassign:0*/
+ obj = [obj];
+ }
- Object.keys(obj).forEach(function (key) {
- var value = castChunk(obj[key], _this);
- if (value !== 'undefined') {
- pairs.push([_this.quotedString(key), ':', value]);
- }
- });
-
- var ret = this.generateList(pairs);
- ret.prepend('{');
- ret.add('}');
- return ret;
- },
-
- generateList: function generateList(entries) {
- var ret = this.empty();
-
- for (var i = 0, len = entries.length; i < len; i++) {
- if (i) {
- ret.add(',');
+ if (isArray(obj)) {
+ // Iterate over array values
+ for (var i = 0, l = obj.length; i < l; i++) {
+ fn.call(null, obj[i], i, obj);
+ }
+ } else {
+ // Iterate over object keys
+ for (var key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
+ fn.call(null, obj[key], key, obj);
}
+ }
+ }
+}
- ret.add(castChunk(entries[i], this));
+/**
+ * Accepts varargs expecting each argument to be an object, then
+ * immutably merges the properties of each object and returns result.
+ *
+ * When multiple objects contain the same key the later object in
+ * the arguments list will take precedence.
+ *
+ * Example:
+ *
+ * ```js
+ * var result = merge({foo: 123}, {foo: 456});
+ * console.log(result.foo); // outputs 456
+ * ```
+ *
+ * @param {Object} obj1 Object to merge
+ * @returns {Object} Result of all merge properties
+ */
+function merge(/* obj1, obj2, obj3, ... */) {
+ var result = {};
+ function assignValue(val, key) {
+ if (typeof result[key] === 'object' && typeof val === 'object') {
+ result[key] = merge(result[key], val);
+ } else {
+ result[key] = val;
}
+ }
- return ret;
- },
+ for (var i = 0, l = arguments.length; i < l; i++) {
+ forEach(arguments[i], assignValue);
+ }
+ return result;
+}
- generateArray: function generateArray(entries) {
- var ret = this.generateList(entries);
- ret.prepend('[');
- ret.add(']');
+/**
+ * Function equal to merge with the difference being that no reference
+ * to original objects is kept.
+ *
+ * @see merge
+ * @param {Object} obj1 Object to merge
+ * @returns {Object} Result of all merge properties
+ */
+function deepMerge(/* obj1, obj2, obj3, ... */) {
+ var result = {};
+ function assignValue(val, key) {
+ if (typeof result[key] === 'object' && typeof val === 'object') {
+ result[key] = deepMerge(result[key], val);
+ } else if (typeof val === 'object') {
+ result[key] = deepMerge({}, val);
+ } else {
+ result[key] = val;
+ }
+ }
- return ret;
+ for (var i = 0, l = arguments.length; i < l; i++) {
+ forEach(arguments[i], assignValue);
}
-};
+ return result;
+}
-exports.default = CodeGen;
-module.exports = exports['default'];
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2NvbXBpbGVyL2NvZGUtZ2VuLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O3FCQUN3QixVQUFVOztBQUVsQyxJQUFJLFVBQVUsWUFBQSxDQUFDOztBQUVmLElBQUk7O0FBRUYsTUFBSSxPQUFPLE1BQU0sS0FBSyxVQUFVLElBQUksQ0FBQyxNQUFNLENBQUMsR0FBRyxFQUFFOzs7QUFHL0MsUUFBSSxTQUFTLEdBQUcsT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUFDO0FBQ3RDLGNBQVUsR0FBRyxTQUFTLENBQUMsVUFBVSxDQUFDO0dBQ25DO0NBQ0YsQ0FBQyxPQUFPLEdBQUcsRUFBRSxFQUViOzs7O0FBQUEsQUFHRCxJQUFJLENBQUMsVUFBVSxFQUFFO0FBQ2YsWUFBVSxHQUFHLFVBQVMsSUFBSSxFQUFFLE1BQU0sRUFBRSxPQUFPLEVBQUUsTUFBTSxFQUFFO0FBQ25ELFFBQUksQ0FBQyxHQUFHLEdBQUcsRUFBRSxDQUFDO0FBQ2QsUUFBSSxNQUFNLEVBQUU7QUFDVixVQUFJLENBQUMsR0FBRyxDQUFDLE1BQU0sQ0FBQyxDQUFDO0tBQ2xCO0dBQ0YsQ0FBQzs7QUFFRixZQUFVLENBQUMsU0FBUyxHQUFHO0FBQ3JCLE9BQUcsRUFBRSxhQUFTLE1BQU0sRUFBRTtBQUNwQixVQUFJLGVBQVEsTUFBTSxDQUFDLEVBQUU7QUFDbkIsY0FBTSxHQUFHLE1BQ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ZWZhdWx0IENvZGVHZW47XG4iXX0=
+/**
+ * Extends object a by mutably adding to it the properties of object b.
+ *
+ * @param {Object} a The object to be extended
+ * @param {Object} b The object to copy properties from
+ * @param {Object} thisArg The object to bind function to
+ * @return {Object} The resulting value of object a
+ */
+function extend(a, b, thisArg) {
+ forEach(b, function assignValue(val, key) {
+ if (thisArg && typeof val === 'function') {
+ a[key] = bind(val, thisArg);
+ } else {
+ a[key] = val;
+ }
+ });
+ return a;
+}
+
+module.exports = {
+ isArray: isArray,
+ isArrayBuffer: isArrayBuffer,
+ isBuffer: isBuffer,
+ isFormData: isFormData,
+ isArrayBufferView: isArrayBufferView,
+ isString: isString,
+ isNumber: isNumber,
+ isObject: isObject,
+ isUndefined: isUndefined,
+ isDate: isDate,
+ isFile: isFile,
+ isBlob: isBlob,
+ isFunction: isFunction,
+ isStream: isStream,
+ isURLSearchParams: isURLSearchParams,
+ isStandardBrowserEnv: isStandardBrowserEnv,
+ forEach: forEach,
+ merge: merge,
+ deepMerge: deepMerge,
+ extend: extend,
+ trim: trim
+};
/***/ }),
-/***/ 9081:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+/***/ 83682:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-/* eslint-disable new-cap */
+var register = __nccwpck_require__(44670)
+var addHook = __nccwpck_require__(5549)
+var removeHook = __nccwpck_require__(6819)
+// 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
-exports.__esModule = true;
-exports.Compiler = Compiler;
-exports.precompile = precompile;
-exports.compile = compile;
-// istanbul ignore next
+ ;['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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+function HookSingular () {
+ var singularHookName = 'h'
+ var singularHookState = {
+ registry: {}
+ }
+ var singularHook = register.bind(null, singularHookState, singularHookName)
+ bindApi(singularHook, singularHookState, singularHookName)
+ return singularHook
+}
-var _exception = __nccwpck_require__(2879);
+function HookCollection () {
+ var state = {
+ registry: {}
+ }
-var _exception2 = _interopRequireDefault(_exception);
+ var hook = register.bind(null, state)
+ bindApi(hook, state)
-var _utils = __nccwpck_require__(1437);
+ return hook
+}
-var _ast = __nccwpck_require__(9211);
+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()
+}
-var _ast2 = _interopRequireDefault(_ast);
+Hook.Singular = HookSingular.bind()
+Hook.Collection = HookCollection.bind()
-var slice = [].slice;
+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
-function Compiler() {}
-// the foundHelper register will disambiguate helper lookup from finding a
-// function in a context. This is necessary for mustache compatibility, which
-// requires that context functions in blocks are evaluated by blockHelperMissing,
-// and then proceed as if the resulting value was provided to blockHelperMissing.
+/***/ }),
-Compiler.prototype = {
- compiler: Compiler,
+/***/ 5549:
+/***/ ((module) => {
- equals: function equals(other) {
- var len = this.opcodes.length;
- if (other.opcodes.length !== len) {
- return false;
+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))
}
+ }
- for (var i = 0; i < len; i++) {
- var opcode = this.opcodes[i],
- otherOpcode = other.opcodes[i];
- if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
- return false;
- }
+ 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
+ })
}
+ }
- // We know that length is the same between the two arrays because they are directly tied
- // to the opcode behavior above.
- len = this.children.length;
- for (var i = 0; i < len; i++) {
- if (!this.children[i].equals(other.children[i])) {
- return false;
- }
+ if (kind === 'error') {
+ hook = function (method, options) {
+ return Promise.resolve()
+ .then(method.bind(null, options))
+ .catch(function (error) {
+ return orig(error, options)
+ })
}
+ }
- return true;
- },
+ state.registry[name].push({
+ hook: hook,
+ orig: orig
+ })
+}
- guid: 0,
- compile: function compile(program, options) {
- this.sourceNode = [];
- this.opcodes = [];
- this.children = [];
- this.options = options;
- this.stringParams = options.stringParams;
- this.trackIds = options.trackIds;
+/***/ }),
- options.blockParams = options.blockParams || [];
+/***/ 44670:
+/***/ ((module) => {
- options.knownHelpers = _utils.extend(Object.create(null), {
- helperMissing: true,
- blockHelperMissing: true,
- each: true,
- 'if': true,
- unless: true,
- 'with': true,
- log: true,
- lookup: true
- }, options.knownHelpers);
+module.exports = register
- return this.accept(program);
- },
+function register (state, name, method, options) {
+ if (typeof method !== 'function') {
+ throw new Error('method for before hook must be a function')
+ }
- compileProgram: function compileProgram(program) {
- var childCompiler = new this.compiler(),
- // eslint-disable-line new-cap
- result = childCompiler.compile(program, this.options),
- guid = this.guid++;
+ if (!options) {
+ options = {}
+ }
- this.usePartial = this.usePartial || result.usePartial;
+ if (Array.isArray(name)) {
+ return name.reverse().reduce(function (callback, name) {
+ return register.bind(null, state, name, callback, options)
+ }, method)()
+ }
- this.children[guid] = result;
- this.useDepths = this.useDepths || result.useDepths;
+ return Promise.resolve()
+ .then(function () {
+ if (!state.registry[name]) {
+ return method(options)
+ }
- return guid;
- },
+ return (state.registry[name]).reduce(function (method, registered) {
+ return registered.hook.bind(null, method, options)
+ }, method)()
+ })
+}
- accept: function accept(node) {
- /* istanbul ignore next: Sanity code */
- if (!this[node.type]) {
- throw new _exception2['default']('Unknown type: ' + node.type, node);
- }
- this.sourceNode.unshift(node);
- var ret = this[node.type](node);
- this.sourceNode.shift();
- return ret;
- },
+/***/ }),
- Program: function Program(program) {
- this.options.blockParams.unshift(program.blockParams);
+/***/ 6819:
+/***/ ((module) => {
- var body = program.body,
- bodyLength = body.length;
- for (var i = 0; i < bodyLength; i++) {
- this.accept(body[i]);
- }
+module.exports = removeHook
- this.options.blockParams.shift();
+function removeHook (state, name, method) {
+ if (!state.registry[name]) {
+ return
+ }
- this.isSimple = bodyLength === 1;
- this.blockParams = program.blockParams ? program.blockParams.length : 0;
+ var index = state.registry[name]
+ .map(function (registered) { return registered.orig })
+ .indexOf(method)
- return this;
- },
+ if (index === -1) {
+ return
+ }
- BlockStatement: function BlockStatement(block) {
- transformLiteralToPath(block);
+ state.registry[name].splice(index, 1)
+}
- var program = block.program,
- inverse = block.inverse;
- program = program && this.compileProgram(program);
- inverse = inverse && this.compileProgram(inverse);
+/***/ }),
- var type = this.classifySexpr(block);
+/***/ 86563:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (type === 'helper') {
- this.helperSexpr(block, program, inverse);
- } else if (type === 'simple') {
- this.simpleSexpr(block);
+"use strict";
+/*!
+ * create-frame
+ *
+ * Copyright (c) 2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
- // now that the simple mustache is resolved, we need to
- // evaluate it by executing `blockHelperMissing`
- this.opcode('pushProgram', program);
- this.opcode('pushProgram', inverse);
- this.opcode('emptyHash');
- this.opcode('blockValue', block.path.original);
- } else {
- this.ambiguousSexpr(block, program, inverse);
- // now that the simple mustache is resolved, we need to
- // evaluate it by executing `blockHelperMissing`
- this.opcode('pushProgram', program);
- this.opcode('pushProgram', inverse);
- this.opcode('emptyHash');
- this.opcode('ambiguousBlockValue');
- }
- this.opcode('append');
- },
+var utils = __nccwpck_require__(80910);
- DecoratorBlock: function DecoratorBlock(decorator) {
- var program = decorator.program && this.compileProgram(decorator.program);
- var params = this.setupFullMustacheParams(decorator, program, undefined),
- path = decorator.path;
+module.exports = function createFrame(data) {
+ if (!utils.isObject(data)) {
+ throw new TypeError('createFrame expects data to be an object');
+ }
- this.useDecorators = true;
- this.opcode('registerDecorator', params.length, path.original);
- },
+ var extend = utils.extend;
+ var frame = extend({}, data);
+ frame._parent = data;
- PartialStatement: function PartialStatement(partial) {
- this.usePartial = true;
+ utils.define(frame, 'extend', function(data) {
+ extend(this, data);
+ });
- var program = partial.program;
- if (program) {
- program = this.compileProgram(partial.program);
+ if (arguments.length > 1) {
+ var args = [].slice.call(arguments, 1);
+ var len = args.length, i = -1;
+ while (++i < len) {
+ frame.extend(args[i] || {});
}
+ }
+ return frame;
+};
- var params = partial.params;
- if (params.length > 1) {
- throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial);
- } else if (!params.length) {
- if (this.options.explicitPartialContext) {
- this.opcode('pushLiteral', 'undefined');
- } else {
- params.push({ type: 'PathExpression', parts: [], depth: 0 });
- }
- }
- var partialName = partial.name.original,
- isDynamic = partial.name.type === 'SubExpression';
- if (isDynamic) {
- this.accept(partial.name);
- }
+/***/ }),
- this.setupFullMustacheParams(partial, program, undefined, true);
+/***/ 80910:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- var indent = partial.indent || '';
- if (this.options.preventIndent && indent) {
- this.opcode('appendContent', indent);
- indent = '';
- }
+"use strict";
- this.opcode('invokePartial', isDynamic, partialName, indent);
- this.opcode('append');
- },
- PartialBlockStatement: function PartialBlockStatement(partialBlock) {
- this.PartialStatement(partialBlock);
- },
- MustacheStatement: function MustacheStatement(mustache) {
- this.SubExpression(mustache);
+var utils = __nccwpck_require__(34698)(require);
+var fn = require;
+__nccwpck_require__(95280) = utils;
- if (mustache.escaped && !this.options.noEscape) {
- this.opcode('appendEscaped');
- } else {
- this.opcode('append');
- }
- },
- Decorator: function Decorator(decorator) {
- this.DecoratorBlock(decorator);
- },
+/**
+ * Lazily required module dependencies
+ */
- ContentStatement: function ContentStatement(content) {
- if (content.value) {
- this.opcode('appendContent', content.value);
- }
- },
+__nccwpck_require__(95280)('define-property', 'define');
+__nccwpck_require__(95280)('extend-shallow', 'extend');
+__nccwpck_require__(95280)('isobject', 'isObject');
+__nccwpck_require__(95280) = fn;
- CommentStatement: function CommentStatement() {},
+/**
+ * Expose `utils` modules
+ */
- SubExpression: function SubExpression(sexpr) {
- transformLiteralToPath(sexpr);
- var type = this.classifySexpr(sexpr);
+module.exports = utils;
- if (type === 'simple') {
- this.simpleSexpr(sexpr);
- } else if (type === 'helper') {
- this.helperSexpr(sexpr);
- } else {
- this.ambiguousSexpr(sexpr);
- }
- },
- ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
- var path = sexpr.path,
- name = path.parts[0],
- isBlock = program != null || inverse != null;
- this.opcode('getContext', path.depth);
+/***/ }),
- this.opcode('pushProgram', program);
- this.opcode('pushProgram', inverse);
+/***/ 89430:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- path.strict = true;
- this.accept(path);
+/**
+ * Expose `Date`
+ */
- this.opcode('invokeAmbiguous', name, isBlock);
- },
+module.exports = __nccwpck_require__(90056);
- simpleSexpr: function simpleSexpr(sexpr) {
- var path = sexpr.path;
- path.strict = true;
- this.accept(path);
- this.opcode('resolvePossibleLambda');
- },
- helperSexpr: function helperSexpr(sexpr, program, inverse) {
- var params = this.setupFullMustacheParams(sexpr, program, inverse),
- path = sexpr.path,
- name = path.parts[0];
+/***/ }),
- if (this.options.knownHelpers[name]) {
- this.opcode('invokeKnownHelper', params.length, name);
- } else if (this.options.knownHelpersOnly) {
- throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr);
- } else {
- path.strict = true;
- path.falsy = true;
+/***/ 36382:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- this.accept(path);
- this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path));
- }
- },
+/**
+ * Module Dependencies
+ */
- PathExpression: function PathExpression(path) {
- this.addDepth(path.depth);
- this.opcode('getContext', path.depth);
+var debug = __nccwpck_require__(7998)('date:date')
- var name = path.parts[0],
- scoped = _ast2['default'].helpers.scopedId(path),
- blockParamId = !path.depth && !scoped && this.blockParamIndex(name);
-
- if (blockParamId) {
- this.opcode('lookupBlockParam', blockParamId, path.parts);
- } else if (!name) {
- // Context reference, i.e. `{{foo .}}` or `{{foo ..}}`
- this.opcode('pushContext');
- } else if (path.data) {
- this.options.data = true;
- this.opcode('lookupData', path.depth, path.parts, path.strict);
- } else {
- this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped);
- }
- },
-
- StringLiteral: function StringLiteral(string) {
- this.opcode('pushString', string.value);
- },
+/**
+ * Time constants
+ */
- NumberLiteral: function NumberLiteral(number) {
- this.opcode('pushLiteral', number.value);
- },
+var _second = 1000
+var _minute = 60 * _second
+var _hour = 60 * _minute
+var _day = 24 * _hour
+var _week = 7 * _day
+var _year = 56 * _week
+var _daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
- BooleanLiteral: function BooleanLiteral(bool) {
- this.opcode('pushLiteral', bool.value);
- },
+/**
+ * Expose `date`
+ */
- UndefinedLiteral: function UndefinedLiteral() {
- this.opcode('pushLiteral', 'undefined');
- },
+module.exports = date
- NullLiteral: function NullLiteral() {
- this.opcode('pushLiteral', 'null');
- },
+/**
+ * Initialize `date`
+ *
+ * @param {Date} offset (optional)
+ * @return {Date}
+ * @api publics
+ */
- Hash: function Hash(hash) {
- var pairs = hash.pairs,
- i = 0,
- l = pairs.length;
+function date (offset) {
+ if (!(this instanceof date)) return new date(offset)
+ this._changed = {}
+ this.date = new Date(offset)
+}
- this.opcode('pushHash');
+/**
+ * Clone the current date
+ */
- for (; i < l; i++) {
- this.pushParam(pairs[i].value);
- }
- while (i--) {
- this.opcode('assignToHash', pairs[i].key);
- }
- this.opcode('popHash');
- },
+date.prototype.clone = function () {
+ return new Date(this.date)
+}
- // HELPERS
- opcode: function opcode(name) {
- this.opcodes.push({
- opcode: name,
- args: slice.call(arguments, 1),
- loc: this.sourceNode[0].loc
- });
- },
+/**
+ * Has changed
+ *
+ * @param {String} str
+ * @return {Boolean}
+ */
- addDepth: function addDepth(depth) {
- if (!depth) {
- return;
- }
+date.prototype.changed = function (str) {
+ if (this._changed[str] === undefined) return false
+ return this._changed[str]
+}
- this.useDepths = true;
- },
+/**
+ * add or subtract seconds
+ *
+ * @param {Number} n
+ * @return {date}
+ */
- classifySexpr: function classifySexpr(sexpr) {
- var isSimple = _ast2['default'].helpers.simpleId(sexpr.path);
+date.prototype.second = function (n) {
+ var seconds = +n * _second
+ this.update(seconds)
+ this._changed['seconds'] = true
+ return this
+}
- var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
+/**
+ * add or subtract minutes
+ *
+ * @param {Number} n
+ * @return {date}
+ */
- // a mustache is an eligible helper if:
- // * its id is simple (a single part, not `this` or `..`)
- var isHelper = !isBlockParam && _ast2['default'].helpers.helperExpression(sexpr);
+date.prototype.minute = function (n) {
+ var minutes = +n * _minute
+ this.update(minutes)
+ this._changed['minutes'] = true
+ return this
+}
- // if a mustache is an eligible helper but not a definite
- // helper, it is ambiguous, and will be resolved in a later
- // pass or at runtime.
- var isEligible = !isBlockParam && (isHelper || isSimple);
+/**
+ * add or subtract hours
+ *
+ * @param {Number} n
+ * @return {date}
+ */
- // if ambiguous, we can possibly resolve the ambiguity now
- // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc.
- if (isEligible && !isHelper) {
- var _name = sexpr.path.parts[0],
- options = this.options;
- if (options.knownHelpers[_name]) {
- isHelper = true;
- } else if (options.knownHelpersOnly) {
- isEligible = false;
- }
- }
+date.prototype.hour = function (n) {
+ var hours = +n * _hour
+ this.update(hours)
+ this._changed['hours'] = true
+ return this
+}
- if (isHelper) {
- return 'helper';
- } else if (isEligible) {
- return 'ambiguous';
- } else {
- return 'simple';
- }
- },
+/**
+ * add or subtract days
+ *
+ * @param {Number} n
+ * @return {date}
+ */
- pushParams: function pushParams(params) {
- for (var i = 0, l = params.length; i < l; i++) {
- this.pushParam(params[i]);
- }
- },
+date.prototype.day = function (n) {
+ var days = +n * _day
+ this.update(days)
+ this._changed['days'] = true
+ return this
+}
- pushParam: function pushParam(val) {
- var value = val.value != null ? val.value : val.original || '';
+/**
+ * add or subtract weeks
+ *
+ * @param {Number} n
+ * @return {date}
+ */
- if (this.stringParams) {
- if (value.replace) {
- value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.');
- }
+date.prototype.week = function (n) {
+ var weeks = +n * _week
+ this.update(weeks)
+ this._changed['weeks'] = true
+ return this
+}
- if (val.depth) {
- this.addDepth(val.depth);
- }
- this.opcode('getContext', val.depth || 0);
- this.opcode('pushStringParam', value, val.type);
+/**
+ * add or subtract months
+ *
+ * @param {Number} n
+ * @return {Date}
+ */
- if (val.type === 'SubExpression') {
- // SubExpressions get evaluated and passed in
- // in string params mode.
- this.accept(val);
- }
- } else {
- if (this.trackIds) {
- var blockParamIndex = undefined;
- if (val.parts && !_ast2['default'].helpers.scopedId(val) && !val.depth) {
- blockParamIndex = this.blockParamIndex(val.parts[0]);
- }
- if (blockParamIndex) {
- var blockParamChild = val.parts.slice(1).join('.');
- this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild);
- } else {
- value = val.original || value;
- if (value.replace) {
- value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, '');
- }
+date.prototype.month = function (n) {
+ var d = this.date
+ var day = d.getDate()
+ d.setDate(1)
+ var month = +n + d.getMonth()
+ d.setMonth(month)
+
+ // Handle dates with less days
+ var dim = this.daysInMonth(month)
+ d.setDate(Math.min(dim, day))
+ return this
+}
- this.opcode('pushId', val.type, value);
- }
- }
- this.accept(val);
- }
- },
+/**
+ * get the days in the month
+ */
- setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) {
- var params = sexpr.params;
- this.pushParams(params);
+date.prototype.daysInMonth = function (m) {
+ var dim = _daysInMonth[m]
+ var leap = leapyear(this.date.getFullYear())
+ return (1 == m && leap) ? 29 : 28
+}
- this.opcode('pushProgram', program);
- this.opcode('pushProgram', inverse);
+/**
+ * add or subtract years
+ *
+ * @param {Number} n
+ * @return {date}
+ */
- if (sexpr.hash) {
- this.accept(sexpr.hash);
- } else {
- this.opcode('emptyHash', omitEmpty);
- }
+date.prototype.year = function (n) {
+ var yr = this.date.getFullYear()
+ yr += +n
+ this.date.setFullYear(yr)
+ this._changed['years'] = true
+ return this
+}
- return params;
- },
+/**
+ * Set the time
+ *
+ * @param {String} h
+ * @param {String} m
+ * @param {String} s
+ * @return {date}
+ */
- blockParamIndex: function blockParamIndex(name) {
- for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) {
- var blockParams = this.options.blockParams[depth],
- param = blockParams && _utils.indexOf(blockParams, name);
- if (blockParams && param >= 0) {
- return [depth, param];
- }
- }
+date.prototype.time = function (h, m, s, meridiem) {
+ if (h === false) {
+ h = this.date.getHours()
+ } else {
+ h = +h || 0
+ this._changed['hours'] = h
}
-};
-function precompile(input, options, env) {
- if (input == null || typeof input !== 'string' && input.type !== 'Program') {
- throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input);
+ if (m === false) {
+ m = this.date.getMinutes()
+ } else {
+ m = +m || 0
+ this._changed['minutes'] = m
}
- options = options || {};
- if (!('data' in options)) {
- options.data = true;
- }
- if (options.compat) {
- options.useDepths = true;
+ if (s === false) {
+ s = this.date.getSeconds()
+ } else {
+ s = +s || 0
+ this._changed['seconds'] = s
}
- var ast = env.parse(input, options),
- environment = new env.Compiler().compile(ast, options);
- return new env.JavaScriptCompiler().compile(environment, options);
+ this.date.setHours(h, m, s)
+ return this
}
-function compile(input, options, env) {
- if (options === undefined) options = {};
+/**
+ * Dynamically create day functions (sunday(n), monday(n), etc.)
+ */
- if (input == null || typeof input !== 'string' && input.type !== 'Program') {
- throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input);
+var days = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday']
+days.forEach(function (day, i) {
+ date.prototype[days[i]] = function (n) {
+ this._changed['days'] = true
+ this.updateDay(i, n)
}
+})
- options = _utils.extend({}, options);
- if (!('data' in options)) {
- options.data = true;
- }
- if (options.compat) {
- options.useDepths = true;
- }
+/**
+ * go to day of week
+ *
+ * @param {Number} day
+ * @param {Number} n
+ * @return {date}
+ */
- var compiled = undefined;
+date.prototype.updateDay = function (d, n) {
+ n = +(n || 1)
+ var diff = (d - this.date.getDay() + 7) % 7
+ if (n > 0) --n
+ diff += (7 * n)
+ this.update(diff * _day)
+ return this
+}
- function compileInput() {
- var ast = env.parse(input, options),
- environment = new env.Compiler().compile(ast, options),
- templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);
- return env.template(templateSpec);
- }
+/**
+ * Update the date
+ *
+ * @param {Number} ms
+ * @return {Date}
+ * @api private
+ */
- // Template is only compiled on first use and cached after that point.
- function ret(context, execOptions) {
- if (!compiled) {
- compiled = compileInput();
- }
- return compiled.call(this, context, execOptions);
- }
- ret._setup = function (setupOptions) {
- if (!compiled) {
- compiled = compileInput();
- }
- return compiled._setup(setupOptions);
- };
- ret._child = function (i, data, blockParams, depths) {
- if (!compiled) {
- compiled = compileInput();
- }
- return compiled._child(i, data, blockParams, depths);
- };
- return ret;
+date.prototype.update = function (ms) {
+ this.date = new Date(this.date.getTime() + ms)
+ return this
}
-function argEquals(a, b) {
- if (a === b) {
- return true;
- }
-
- if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) {
- for (var i = 0; i < a.length; i++) {
- if (!argEquals(a[i], b[i])) {
- return false;
- }
- }
- return true;
- }
-}
+/**
+ * leap year
+ *
+ * @param {Number} yr
+ * @return {Boolean}
+ */
-function transformLiteralToPath(sexpr) {
- if (!sexpr.path.parts) {
- var literal = sexpr.path;
- // Casting to string here to make false and 0 literal values play nicely with the rest
- // of the system.
- sexpr.path = {
- type: 'PathExpression',
- data: false,
- depth: 0,
- parts: [literal.original + ''],
- original: literal.original + '',
- loc: literal.loc
- };
- }
+function leapyear (yr) {
+ return (yr % 4 === 0 && yr % 100 !== 0) || yr % 400 === 0
}
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2NvbXBpbGVyL2NvbXBpbGVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozt5QkFFc0IsY0FBYzs7OztxQkFDSyxVQUFVOzttQkFDbkMsT0FBTzs7OztBQUV2QixJQUFNLEtBQUssR0FBRyxFQUFFLENBQUMsS0FBSyxDQUFDOztBQUVoQixTQUFTLFFBQVEsR0FBRyxFQUFFOzs7Ozs7O0FBTzdCLFFBQVEsQ0FBQyxTQUFTLEdBQUc7QUFDbkIsVUFBUSxFQUFFLFFBQVE7O0FBRWxCLFFBQU0sRUFBRSxnQkFBUyxLQUFLLEVBQUU7QUFDdEIsUUFBSSxHQUFHLEdBQUcsSUFBSSxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUM7QUFDOUIsUUFBSSxLQUFLLENBQUMsT0FBTyxDQUFDLE1BQU0sS0FBSyxHQUFHLEVBQUU7QUFDaEMsYUFBTyxLQUFLLENBQUM7S0FDZDs7QUFFRCxTQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsR0FBRyxFQUFFLENBQUMsRUFBRSxFQUFFO0FBQzVCLFVBQUksTUFBTSxHQUFHLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDO1VBQzFCLFdBQVcsR0FBRyxLQUFLLENBQUMsT0FBTyxDQUF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hKSAmJiBpc0FycmF5KGIpICYmIGEubGVuZ3RoID09PSBiLmxlbmd0aCkge1xuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYS5sZW5ndGg7IGkrKykge1xuICAgICAgaWYgKCFhcmdFcXVhbHMoYVtpXSwgYltpXSkpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gdHJ1ZTtcbiAgfVxufVxuXG5mdW5jdGlvbiB0cmFuc2Zvcm1MaXRlcmFsVG9QYXRoKHNleHByKSB7XG4gIGlmICghc2V4cHIucGF0aC5wYXJ0cykge1xuICAgIGxldCBsaXRlcmFsID0gc2V4cHIucGF0aDtcbiAgICAvLyBDYXN0aW5nIHRvIHN0cmluZyBoZXJlIHRvIG1ha2UgZmFsc2UgYW5kIDAgbGl0ZXJhbCB2YWx1ZXMgcGxheSBuaWNlbHkgd2l0aCB0aGUgcmVzdFxuICAgIC8vIG9mIHRoZSBzeXN0ZW0uXG4gICAgc2V4cHIucGF0aCA9IHtcbiAgICAgIHR5cGU6ICdQYXRoRXhwcmVzc2lvbicsXG4gICAgICBkYXRhOiBmYWxzZSxcbiAgICAgIGRlcHRoOiAwLFxuICAgICAgcGFydHM6IFtsaXRlcmFsLm9yaWdpbmFsICsgJyddLFxuICAgICAgb3JpZ2luYWw6IGxpdGVyYWwub3JpZ2luYWwgKyAnJyxcbiAgICAgIGxvYzogbGl0ZXJhbC5sb2NcbiAgICB9O1xuICB9XG59XG4iXX0=
/***/ }),
-/***/ 4706:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+/***/ 35068:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+// Production rule module for the CFG
+// !leap year
+// !proper carry considering # of days per month
+/**
+ * Module Dependencies
+ */
-exports.__esModule = true;
-exports.SourceLocation = SourceLocation;
-exports.id = id;
-exports.stripFlags = stripFlags;
-exports.stripComment = stripComment;
-exports.preparePath = preparePath;
-exports.prepareMustache = prepareMustache;
-exports.prepareRawBlock = prepareRawBlock;
-exports.prepareBlock = prepareBlock;
-exports.prepareProgram = prepareProgram;
-exports.preparePartialBlock = preparePartialBlock;
-// istanbul ignore next
+var _ = __nccwpck_require__(22192)
+var util = __nccwpck_require__(49188)
+var symbol = __nccwpck_require__(32273)
+var tokenize = __nccwpck_require__(91997)
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+/**
+ * Export `norm`
+ */
-var _exception = __nccwpck_require__(2879);
+module.exports = norm
-var _exception2 = _interopRequireDefault(_exception);
+// a partial implementation of norm
+/**
+ * Preprocess a string using the human language for time CFG, return a triple of original str, preprocessed tokens, and the normal forms (extracted dates in normal forms)
+ */
+function norm (str, offset) {
+ try {
+ // Production rules: CFG algorithm for human language for time
+ var tokObj = tokenize(str)
+ // console.log('p#0: parse normal forms', tokObj)
+ var syms = pickTokens(tokObj.symbols) || []
+ // console.log('p#0: remove nulls, pick tokens', syms)
+ syms = reduce(syms, ['n', 'n'])
+ // console.log('p#1: arithmetics: [] ~ , + if n1 > n2, * else', syms)
+ syms = nTnRedistribute(syms)
+ // console.log('p#2: redistribute, [] ~ []', syms)
+ syms = reduce(syms, ['o', 'o'])
+ // console.log('p#3: ~ *', syms)
+
+ // preprocessing ends, now format output
+ var restored = restoreTokens(syms, tokObj)
+ return restored
+ } catch (e) {
+ return {
+ str: str,
+ tokens: [],
+ normals: []
+ }
+ }
-function validateClose(open, close) {
- close = close.path ? close.path.original : close;
+}
- if (open.path.original !== close) {
- var errorNode = { loc: open.path.loc };
+/**
+ * format a preprocessed array of symbols back into string, using some info from tokObj
+ */
+function restoreTokens (syms, tokObj) {
+ var tokens = [],
+ normals = [],
+ tokensOut = tokObj.tokensOut,
+ tokensIn = tokObj.tokensIn
+
+ syms = util.removeTnPlus(syms)
+ for (var i = 0; i < syms.length; i++) {
+ var s = syms[i],
+ sName = util.sName(s),
+ token = ''
+ switch (sName) {
+ case 'n':
+ // if token is already numeric, use it
+ token = (s.token.match(/^\s*[\d\.\-\+]+\s*$/)) ? s.token.trim() : s.value.toString()
+ break
+ case 'T':
+ // handles shits like 1 am ~ t:1h00m,dt:, am (token returned)
+ token = restoreNormal(s)
+ break
+ default:
+ // the other cases like op, o, cron, range
+ token = s.token.toString()
+ }
- throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode);
+ // extract the protected normal string
+ if (typeof token == 'string') {
+ tokens.push(token)
+ } else {
+ // get protected normal forms
+ normals.push(token.normal)
+ }
+ }
+ return {
+ tokens: tokens,
+ str: tokens.join(' ').replace(/\s+/g, ' '),
+ normals: normals
}
}
-function SourceLocation(source, locInfo) {
- this.source = source;
- this.start = {
- line: locInfo.first_line,
- column: locInfo.first_column
- };
- this.end = {
- line: locInfo.last_line,
- column: locInfo.last_column
- };
-}
-
-function id(token) {
- if (/^\[.*\]$/.test(token)) {
- return token.substring(1, token.length - 1);
+/**
+ * Given a T symbol, try to restore its normal form (return wrapped in JSON if it's a complete date string {normal: }), or just return the plain string as token
+ */
+function restoreNormal (T) {
+ var token = T.token
+ if (token.match(util.reT)) {
+ // if it is normal form, convert back into the normal1 or normal2 strings
+ var split = util.splitT(token)
+ if (_.includes(split, undefined)) {
+ // if it's normal2 form
+ // either it's a date or time
+ var dateArr = split.slice(0, 3),
+ timeArr = split.slice(3)
+ if (timeArr[0] != undefined) {
+ // check time first, it's first signature (hour) is defined
+ // return hh:mm
+ return util.TtoStdT(token).match(/(\d+\:\d+)/)[1]
+ } else {
+ // else it's a date, parse arr and return complete stdT instead
+ // return wrapped in JSON if it's a complete date string
+ return { normal: util.TtoStdT(token) }
+ }
+ } else {
+ // if it's normal1 form, use TtoStd
+ // return wrapped in JSON if it's a complete date string
+ return { normal: util.TtoStdT(token) }
+ }
+ } else if (!util.has_t(T) && util.has_dt(T) && util.has_pureTimeUnit(T)) {
+ // handle pure dt: T that are purel displacement, e.g. week, fortnight
+ var dtStr = '',
+ units = _.keys(T.dt),
+ dt = T.dt
+ // accumulate dtStr
+ for (var i = 0; i < units.length; i++) {
+ var u = units[i],
+ kval = parseFloat(dt[u]),
+ // set number has default, or is 0, 1
+ numStr = (kval != dt[u] || kval == 0 || Math.abs(kval) == 1) ? '' : dt[u].toString() + ' '
+
+ // set canon from lemma only if it exists, and key is word, else use u
+ var canon = u
+ if (T.canon != undefined) {
+ // and if it's also a timeUnit
+ canon = T.canon
+ } else {
+ // get the lemma for u, its canon and key
+ var lemma = util.lemma(u),
+ lemmaCanon = lemma.canon,
+ lemmaKey = lemma.value
+ if (lemmaKey && lemmaKey.match(/^\w+$/)) { canon = lemmaCanon }
+ }
+ // set the units, number, and canonical form of the unit
+ dtStr = dtStr + numStr + canon + ' '
+ }
+ return dtStr
} else {
- return token;
+ // else it's just plain english, return
+ return token
}
}
+// var fakes = { t: { h: '1', m: '00' }, dt: {}, token: 't:1h00m,dt:' }
+// var fakes = { t: { M: '12', d: '25', m: '00' }, dt: {}, token: 't:12M25d00m,dt:' }
+// console.log(restoreNormal(fakes))
-function stripFlags(open, close) {
- return {
- open: open.charAt(2) === '~',
- close: close.charAt(close.length - 3) === '~'
- };
-}
+/**
+ * !Backburner for future extension: Main method: Run the CFG algorithm to parse the string, return JSON of {input, output, diffStr}. Normalize the string before Matt's algorithm runs it.
+ * @example
+ * var str = 'having lunch today at 3 hours after 9am'
+ * norm(str)
+ * // => { input: 'having lunch today at 3 hours after 9am',
+ * output: '2016-03-04T05:00:09Z',
+ * difference: 'having lunch' }
+ */
+function CFGproduce (str, offset) {
+ // try all the below till all is elegantly fixed
+ var diffStr = str,
+ finalStr = null,
+ output = str
+ // Production rules: CFG algorithm for human language for time
+ // p#0: tokenize, remove nulls, pick tokens
+ var tokObj = tokenize(str)
+ var syms = pickTokens(tokObj.symbols)
+ // console.log('p#0: parse normal forms, remove nulls, pick tokens', tokObj)
-function stripComment(comment) {
- return comment.replace(/^\{\{~?!-?-?/, '').replace(/-?-?~?\}\}$/, '');
-}
+ try {
+ syms = reduce(syms, ['n', 'n'])
+ // console.log('p#1: arithmetics: [] ~ , + if n1 > n2, * else', syms)
+ syms = nTnRedistribute(syms)
+ // console.log('p#2: redistribute, [] ~ []', syms)
+ output = util.tokenToStr(syms)
+
+ // !okay replace back the normal forms in the str
+
+ // // !Till future completion: Mute from below
+ // syms = reduce(syms, ['n', 'T'])
+ // // console.log('p#3: [] ~ , * if dt, + if t', syms)
+ // syms = reduce(syms, ['T', 'T'])
+ // // console.log('p#4: [] ~ ', syms)
+ // syms = nDefTSyms(syms)
+ // // console.log('p#5: defaulter ~ , d defaults to t:h', syms)
+ // syms = reduce(syms, ['o', 'o'])
+ // // console.log('p#6: ~ *', syms)
+ // syms = autoHourModding(syms)
+ // syms = weekModding(syms, offset)
+ // // console.log('p#7: modding: meridiem, weeks', syms)
+ // syms = optReduce(syms, ['T', 'T'], ['o'], null, symbol(util.nowT(offset)))
+ // // console.log('p#8: ~ ', syms)
+
+ // // !future:
+ // // syms = reduce(syms, ['T'], ['r'])
+ // // syms = reduce(syms, ['f', 'T', 'rT'], ['c'])
+
+ // console.log('tokObj', tokObj)
+ syms = finalizeT(syms, offset)
+ // console.log('p#9: finalizeT with origin', syms)
+
+ finalStr = symsToStdT(syms, offset)
+ // console.log('finalStr', finalStr)
-function preparePath(data, parts, loc) {
- loc = this.locInfo(loc);
+ } catch (e) {}
+ // extract the tokens for difference string later
+ // diffStr = util.unparsedStr(tokObj.str, tokObj.symbols)
+ // console.log('diffStr', diffStr)
+ // !convert dt into proper terms
- var original = data ? '@' : '',
- dig = [],
- depth = 0;
+ return {
+ input: str,
+ // output: new Date(finalStr),
+ output: output,
+ difference: diffStr
+ }
- for (var i = 0, l = parts.length; i < l; i++) {
- var part = parts[i].part,
+}
- // If we have [] syntax then we do not treat path references as operators,
- // i.e. foo.[this] resolves to approximately context.foo['this']
- isLiteral = parts[i].original !== part;
- original += (parts[i].separator || '') + part;
+/**
+ * Production rule #0: pick tokens, remove nulls.
+ * 1. break into chunks of arrs delimited by triple-null-or-more
+ * 2. reorder chunks by arr length
+ * 3.1 init candidate = []
+ * 3.2 pull and push the chunks not containing into candidate
+ * 3.3 pull and push the chunks containing into candidate
+ * 4. pick the last candidate
+ */
+function pickTokens (syms) {
+ // 1. 2. 3.
+ var delimited = util.delimSyms(syms),
+ chunks = util.splitSyms(delimited, 'trinull'),
+ candidates = util.orderChunks(chunks)
+ // 4.
+ return candidates.pop()
+}
- if (!isLiteral && (part === '..' || part === '.' || part === 'this')) {
- if (dig.length > 0) {
- throw new _exception2['default']('Invalid path: ' + original, { loc: loc });
- } else if (part === '..') {
- depth++;
- }
+/**
+ * Reduce an array of symbols with binary operations between permissible symbols.
+ * @param {Array} syms Array of input symbols
+ * @param {Array} varArr String names of permissible variables.
+ * @param {Array} opArr String names of permissible operations.
+ * @return {Array} The reduced result.
+ */
+function reduce (syms, varArr, opArr) {
+ if (syms.length < 2) {
+ return syms
+ }
+ // the operator arrays
+ var opArr = opArr || ['op']
+ // endmark for handling last symbol
+ syms.push('null')
+ // the result, past-pointer(previous non-null symbol), default-op, current-op, and whether current-op is inter-symbol op, i.e. will not be used up
+ var res = [],
+ past = null,
+ defOp = null,
+ op = defOp,
+ interOp = false
+ for (var i = 0; i < syms.length; i++) {
+ var s = syms[i]
+ if (!past || !s) {
+ // edge case or null
+ if (i == 0) { past = s; }
+ } else if (util.isSym(s, opArr)) {
+ // s is an op. mark op as won't be used yet
+ op = s
+ interOp = true
+ // the nDefT for when past = 'n', s = 'o'
+ } else if (util.isSym(past, [varArr[0]]) && util.isSym(s, [varArr[1]])) {
+ // s and past are operable variables specified by varArr
+ past = execOp(past, op, s)
+ // reset after op is used
+ op = defOp
+ interOp = false
} else {
- dig.push(part);
+ // no further legal operation made, push and continue
+ // change of class, past is finalized, push to res
+ res.push(past)
+ if (Array.isArray(past)) {
+ // if past was returned from execOp as array (not executed), then flatten it and dont push op to res, since it's already included in op
+ res = _.flatten(res)
+ } else {
+ // if inter-op (not used), push a clone (prevent overwrite later)
+ if (interOp) { res.push(symbol(op.value)) }
+ }
+ // reset
+ op = defOp
+ interOp = false
+ past = s
}
}
-
- return {
- type: 'PathExpression',
- data: data,
- depth: depth,
- parts: dig,
- original: original,
- loc: loc
- };
+ return res
}
-function prepareMustache(path, params, hash, open, strip, locInfo) {
- // Must use charAt to support IE pre-10
- var escapeFlag = open.charAt(3) || open.charAt(2),
- escaped = escapeFlag !== '{' && escapeFlag !== '&';
-
- var decorator = /\*/.test(open);
- return {
- type: decorator ? 'Decorator' : 'MustacheStatement',
- path: path,
- params: params,
- hash: hash,
- escaped: escaped,
- strip: strip,
- loc: this.locInfo(locInfo)
- };
+/**
+ * Optional reduce: similar to reduce() but either argument is optional.
+ * algorithm: return a T
+ * 1. for each t, dt, do:
+ * 2. for each key in union of keys for Lt, Rt, do:
+ * 3. _Rt = _Rt op _Lt
+ * @param {Array} syms Array of input symbols
+ * @param {Array} varArr String names of permissible variables.
+ * @param {Array} opArr String names of permissible operations.
+ * @param {symbol} Ldef default for left argument
+ * @param {symbol} Rdef default for right argument
+ * @return {Array} The reduced result.
+ */
+function optReduce (syms, varArr, opArr, Ldef, Rdef) {
+ if (syms.length < 2) {
+ return syms
+ }
+ // use peek
+ var res = [],
+ sum = null,
+ L = null,
+ R = null
+ for (var i = 0; i < syms.length; i++) {
+ var s = syms[i]
+ if (util.isSym(s, opArr)) {
+ if (sum == null) {
+ L = syms[i - 1]
+ sum = (util.isSym(L, [varArr[0]])) ? L : Ldef
+ }
+ R = syms[i + 1]
+ // if is var skip it since will be consumed
+ if (util.isSym(R, [varArr[1]])) { i++; }
+ // else reset to default
+ else { R = Rdef; }
+ // compute:
+ sum = execOp(sum, s, R)
+ // before loop quits due to possible i++, push the last
+ if (i == syms.length - 1) {
+ res.push(sum)
+ }
+ } else {
+ // s is not opArr, can't have been varArr either
+ // edge case: at first dont push
+ if (i > 0) {
+ res.push(sum)
+ res.push(s)
+ sum = null
+ }
+ }
+ }
+ return res
}
-function prepareRawBlock(openRawBlock, contents, close, locInfo) {
- validateClose(openRawBlock, close);
-
- locInfo = this.locInfo(locInfo);
- var program = {
- type: 'Program',
- body: contents,
- strip: {},
- loc: locInfo
- };
-
- return {
- type: 'BlockStatement',
- path: openRawBlock.path,
- params: openRawBlock.params,
- hash: openRawBlock.hash,
- program: program,
- openStrip: {},
- inverseStrip: {},
- closeStrip: {},
- loc: locInfo
- };
+/**
+ * Execute non-commutative operation between 2 argument symbols and an op symbol; carry out respective ops according to symbol names.
+ * @param {symbol} L Left argument
+ * @param {symbol} op operation
+ * @param {symbol} R Right argument
+ * @param {str} offset The time origin offset
+ * @return {symbol} Result
+ */
+function execOp (L, op, R, offset) {
+ var otype = util.opType(L, op, R),
+ res = null
+ if (_.includes(['nn'], otype)) {
+ res = nnOp(L, op, R)
+ } else if (_.includes(['nT'], otype)) {
+ res = nTOp(L, op, R)
+ } else if (_.includes(['TT'], otype)) {
+ res = TTOp(L, op, R)
+ } else if (_.includes(['ToT', 'oT', 'To'], otype)) {
+ res = ToTOp(L, op, R, offset)
+ } else if (_.includes(['oo'], otype)) {
+ res = ooOp(L, R)
+ } else if (_.includes(['rT', 'TrT'], otype)) {
+ // has optional arg
+ res = rTOp(L, R)
+ } else if (_.includes(['cT', 'fcT', 'crT', 'fcrT'], otype)) {
+ // has optional arg
+ res = cTOp(L, R)
+ } else {
+ // not executable, e.g. not in the right order, return fully
+ res = (op == null) ? [L, R] : [L, op, R]
+ }
+ return res
}
-function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
- if (close && close.path) {
- validateClose(openBlock, close);
+/**
+ * Atomic binary arithmetic operation on the numerical level, with default overriding the argument prepended with '='.
+ * @param {string|Number} Lval The left argument value.
+ * @param {symbol} op The op symbol
+ * @param {string|Number} Rval The right argument value.
+ * @return {Number} Result from the operation.
+ */
+function atomicOp (Lval, op, Rval, dontOp) {
+ dontOp = dontOp || false
+ var oName = op.value
+ if (Lval == undefined) {
+ // if L is missing, R must exist tho
+ return (oName == 'minus') ? Rval.toString().replace(/(\d)/, '-$1') : Rval
+ } else if (Rval == undefined) {
+ // if L exists, be it def or not, R missing
+ return Lval
+ } else {
+ // or R exist or is default (parse to NaN), L can be default too but ignore then
+ var defL = Lval.toString().match(/^=/),
+ defR = Rval.toString().match(/^=/)
+ var l = parseFloat(Lval.toString().replace(/^=/, '')),
+ r = parseFloat(Rval.toString().replace(/^=/, ''))
+ if (defL && defR) {
+ // if both are default, return r 'last come last serve'
+ return r
+ } else if (defL && !defR) {
+ // if either default, return the non-default
+ return r
+ } else if (!defL && defR) {
+ return l
+ } else {
+ // none default
+ if (dontOp) {
+ // if is a don't operate together, i.e. for t, just return l
+ // 'first come first serve'
+ return l
+ } else {
+ // make the into proper floats first
+ if (oName == 'minus') {
+ return l - r
+ } else if (oName == 'plus') {
+ return l + r
+ } else if (oName == 'times') {
+ return l * r
+ } else if (oName == 'divide') {
+ return l / r
+ }
+ }
+ }
}
+}
- var decorator = /\*/.test(openBlock.open);
+/**
+ * p#1: arithmetics: [] ~ , + if n1 > n2, * else
+ */
+function nnOp (L, op, R) {
+ var l = L.value,
+ r = R.value
+ // set the default op according to value in nn op
+ if (l > r) {
+ op = op || symbol('plus')
+ } else {
+ op = op || symbol('times')
+ }
+ var res = atomicOp(l, op, r)
+ return symbol(res)
+}
- program.blockParams = openBlock.blockParams;
+/**
+ * p#2: redistribute, [] ~ []
+ * algorithm: note that from previous steps no 's can occur adjacently
+ * 1. scan array L to R, on each found:
+ * 2.1 if its R is , continue
+ * 2.2 else, this is the target. do:
+ * 3.1 init carry = []. remove and push into carry,
+ * 3.2 if its L is , remove and prepend into carry,
+ * 4.1 find the first to the left, if not , drop the carry and continue
+ * 4.2 else merge the carry after the
+ * 5. At the end of loop, rerun production rule #1
+ */
+function nTnRedistribute (syms) {
+ if (syms.length < 2) {
+ return syms
+ }
+ // 1.
+ for (var i = 0; i < syms.length; i++) {
+ var s = syms[i]
+ if (util.sName(s) != 'n') {
+ continue
+ }
+ // 1.
+
+ var R = syms[i + 1]
+ if (util.sName(R) == 'T') {
+ continue
+ }
+ // 2.2
+
+ // 3.1 prepare the carry
+ var carry = []
+ // 3.2 the Left symbol
+ var L = syms[i - 1],
+ Li = -1
+ if (util.sName(L) == 'op') {
+ // if L is an 'op', remember to pull it later
+ Li = i - 1
+ }
+ // 4.1
+ // find L...L of L that is 'n'
+ var LLi = _.findLastIndex(syms.slice(0, i - 1), function (Ls) {
+ return util.sName(Ls) == 'n'
+ })
+ if (!syms[LLi] || util.sName(syms[LLi + 1]) != 'T') {
+ // if can't find 'n' (index = -1), or the R of 'n' isn't T, abort mission
+ // syms.splice(i, 0, carry)
+ } else {
+ // 4.2
+ // else, pull s at [i], optional L at [Li], and push at LLi+1
+ carry.push(_.pullAt(syms, i)[0])
+ if (Li != -1) {
+ carry.unshift(_.pullAt(syms, Li)[0])
+ }
+ syms.splice(LLi + 1, 0, carry)
+ syms = _.flatten(syms)
+ }
+ }
- var inverse = undefined,
- inverseStrip = undefined;
+ // 5. redo the op
+ syms = reduce(syms, ['n', 'n'])
+ return syms
+}
- if (inverseAndProgram) {
- if (decorator) {
- throw new _exception2['default']('Unexpected inverse block on decorator', inverseAndProgram);
+/**
+ * p#3: [] ~ , * if dt, + if t
+ * 1. if t can be overidden, start from the highest unit set to n, then return.
+ * 2. otherwise, if
not empty,
= *
, then return
+ * 3. else, if not empty, = +, then return
+ */
+function nTOp (nL, op, TR) {
+ var tOverrideUnit = util.highestOverride(TR.t)
+ if (tOverrideUnit) {
+ // 1.
+ TR.t[tOverrideUnit] = nL.value
+ } else if (_.keys(TR.dt).length) {
+ // 2.
+ op = op || symbol('times')
+ for (var k in TR.dt) {
+ if (k == 'wd') {
+ continue
+ }
+ TR.dt[k] = atomicOp(nL.value, op, TR.dt[k])
}
-
- if (inverseAndProgram.chain) {
- inverseAndProgram.program.body[0].closeStrip = close.strip;
+ } else if (_.keys(TR.t).length) {
+ // 3.
+ op = op || symbol('plus')
+ for (var k in TR.t) {
+ TR.t[k] = atomicOp(nL.value, op, TR.t[k])
}
-
- inverseStrip = inverseAndProgram.strip;
- inverse = inverseAndProgram.program;
}
+ return TR
+}
- if (inverted) {
- inverted = inverse;
- inverse = program;
- program = inverted;
+/**
+ * p#4: [] ~
+ */
+function TTOp (TL, op, TR) {
+ // set the default op
+ op = op || symbol('plus')
+ // util.sName
+ // mutate into TL
+ for (var k in TR.t) {
+ // okay done add absolute time, just as you don't add origins together put u take gradual specificity, the 'true' param for dontOp if exist, return r
+ // override default tho, taken care of by atomic
+ TL.t[k] = atomicOp(TL.t[k], op, TR.t[k], true)
+ }
+ for (var k in TR.dt) {
+ if (k == 'wd') {
+ continue
+ }
+ TL.dt[k] = atomicOp(TL.dt[k], op, TR.dt[k])
}
+ return TL
+}
- return {
- type: decorator ? 'DecoratorBlock' : 'BlockStatement',
- path: openBlock.path,
- params: openBlock.params,
- hash: openBlock.hash,
- program: program,
- inverse: inverse,
- openStrip: openBlock.strip,
- inverseStrip: inverseStrip,
- closeStrip: close && close.strip,
- loc: this.locInfo(locInfo)
- };
+/**
+ * p#5: defaulter ~ , d defaults to t:h
+ */
+function nDefTSyms (syms) {
+ var res = []
+ for (var i = 0; i < syms.length; i++) {
+ var s = syms[i]
+ res.push(util.isSym(s, ['n']) ? nDefT(s) : s)
+ }
+ return res
}
-function prepareProgram(statements, loc) {
- if (!loc && statements.length) {
- var firstLoc = statements[0].loc,
- lastLoc = statements[statements.length - 1].loc;
+/**
+ * Helper: default a singlet n to T, i.e. next available hour
+ */
+function nDefT (n) {
+ var deft = symbol('t:1h,dt:')
+ var nVal = n.value
+ var currentHour = new Date().getHours()
+ var nextnVal = Math.floor(currentHour / 12) * 12 + nVal
+ var tHour = execOp(symbol(nextnVal), symbol('times'), deft)
+ return tHour
+}
- /* istanbul ignore else */
- if (firstLoc && lastLoc) {
- loc = {
- source: firstLoc.source,
- start: {
- line: firstLoc.start.line,
- column: firstLoc.start.column
- },
- end: {
- line: lastLoc.end.line,
- column: lastLoc.end.column
- }
- };
+/**
+ * ~ *
+ * To handle 'before next' etc.
+ */
+function ooOp (L, R) {
+ var Lsign = (L.value == 'plus') ? +1 : -1,
+ Rsign = (R.value == 'plus') ? +1 : -1,
+ LRsign = Lsign * Rsign
+ return (LRsign > 0) ? symbol('after') : symbol('before')
+}
+
+/**
+ * Next available T', given an offset, by incrementing in dt the next unit ++1 from the current largest unit in t.
+ */
+function nextAvailable (T, offset) {
+ // find the current largest and next largest unit
+ var nextUnit = util.nextLargestUnit(T)
+
+ // first finalized T
+ var finT1 = finalizeT([T], offset)[0],
+ stdStr1 = util.TtoStdT(finT1),
+ UTC1 = Date.parse(stdStr1),
+ UTCnow = Date.parse(new Date()),
+ UTCdiff = UTC1 - UTCnow
+ // if UTC1 is not in the future, add next unit
+ if (UTCdiff < 0) {
+ T.dt[nextUnit] = (T.dt[nextUnit] || 0) + 1
+ var finT2 = finalizeT([T], offset)[0]
+ return finT2
+ } else {
+ return finT1
+ }
+}
+
+/**
+ * p#6: ~
+ */
+function ToTOp (L, op, R, offset) {
+ if (L && !R) {
+ // if R is missing, set to now
+ R = symbol(util.nowT(offset))
+ } else if (!L && R) {
+ // if L missing
+ if (util.has_t(R)) {
+ // if R has t => part of origin, so L shd be the according dt
+ var nextUnit = util.nextLargestUnit(R)
+ R = nextAvailable(R, offset)
+ // so arbitrarily set as 0.5 * next largest unit
+ L = execOp(symbol(0.5), symbol('times'), symbol(nextUnit))
+ } else {
+ // R has dt only, make L an origin then
+ L = symbol(util.nowT(offset))
}
+ } else if (!L && !R) {
+ L = symbol(util.nowT(offset))
+ R = symbol(util.nowT(offset))
}
- return {
- type: 'Program',
- body: statements,
- strip: {},
- loc: loc
- };
+ var Ttype = ['t', 'dt']
+ for (var i = 0; i < Ttype.length; i++) {
+ var _Ttype = Ttype[i],
+ // the dontOp for 't'
+ dontOp = (_Ttype == 't')
+ var concatKeys = _.keys(L[_Ttype]).concat(_.keys(R[_Ttype]))
+ var keys = _.unique(concatKeys)
+ for (var j = 0; j < keys.length; j++) {
+ var k = keys[j]
+ // run atomic op, note the reversed order of R op L
+ R[_Ttype][k] = atomicOp(R[_Ttype][k], op, L[_Ttype][k], dontOp)
+ }
+ }
+ return R
}
-function preparePartialBlock(open, program, close, locInfo) {
- validateClose(open, close);
+/**
+ * p#7: auto-hour-modding: t:h mod 12
+ * then add the meridiem to t:h if exist
+ */
+function autoHourModding (syms) {
+ for (var i = 0; i < syms.length; i++) {
+ var s = syms[i]
+ if (util.isSym(s, ['T'])) {
+ if (syms[i]['t']['h']) {
+ // if t has 'h', mod it
+ var value = syms[i]['t']['h'].toString()
+ var isDefault = (value.match(/^=/) || [])[0] || ''
+ value = parseFloat(value.replace(/^=/, ''))
+ value = value > 12 ? value % 12 : value
+ syms[i]['t']['h'] = isDefault + value
+ }
+ // apply the non-0 meridiem after modding:
+ if (syms[i]['t']['mer']) {
+ var dt_h = (syms[i]['dt']['h'] || '0').toString()
+ // dump default at last
+ dt_h = dt_h.replace(/^=/, '')
+ if (syms[i]['t']['mer'] == 1) {
+ syms[i]['dt']['h'] = parseFloat(dt_h) + 12
+ }
+ // delete mer
+ delete syms[i]['t']['mer']
+ }
+ }
+ }
+ return syms
+}
- return {
- type: 'PartialBlockStatement',
- name: open.path,
- params: open.params,
- hash: open.hash,
- program: program,
- openStrip: open.strip,
- closeStrip: close && close.strip,
- loc: this.locInfo(locInfo)
- };
+// do it at last, to use like '2nd week of march'
+function weekModding (syms, offset) {
+ // weekday of the offset to calculate dt:d
+ var offsetWD = new Date(util.TtoStdT(util.nowT())).getDay()
+ for (var i = 0; i < syms.length; i++) {
+ var s = syms[i]
+ if (util.isSym(s, ['T'])) {
+ if (syms[i]['dt']['wd']) {
+ // if dt has 'wd', mod it and turn into dt:d + %wd
+ var WD = parseInt(syms[i]['dt']['wd'])
+ var diffWD = (WD - offsetWD) % 7
+ if (diffWD < 0) { diffWD = diffWD + 7 }
+ syms[i]['dt']['d'] = (syms[i]['dt']['d'] || 0) + diffWD
+ delete syms[i]['dt']['wd']
+ }
+ }
+ }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SAxXS5sb2M7XG5cbiAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgIGlmIChmaXJzdExvYyAmJiBsYXN0TG9jKSB7XG4gICAgICBsb2MgPSB7XG4gICAgICAgIHNvdXJjZTogZmlyc3RMb2Muc291cmNlLFxuICAgICAgICBzdGFydDoge1xuICAgICAgICAgIGxpbmU6IGZpcnN0TG9jLnN0YXJ0LmxpbmUsXG4gICAgICAgICAgY29sdW1uOiBmaXJzdExvYy5zdGFydC5jb2x1bW5cbiAgICAgICAgfSxcbiAgICAgICAgZW5kOiB7XG4gICAgICAgICAgbGluZTogbGFzdExvYy5lbmQubGluZSxcbiAgICAgICAgICBjb2x1bW46IGxhc3RMb2MuZW5kLmNvbHVtblxuICAgICAgICB9XG4gICAgICB9O1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiB7XG4gICAgdHlwZTogJ1Byb2dyYW0nLFxuICAgIGJvZHk6IHN0YXRlbWVudHMsXG4gICAgc3RyaXA6IHt9LFxuICAgIGxvYzogbG9jXG4gIH07XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBwcmVwYXJlUGFydGlhbEJsb2NrKG9wZW4sIHByb2dyYW0sIGNsb3NlLCBsb2NJbmZvKSB7XG4gIHZhbGlkYXRlQ2xvc2Uob3BlbiwgY2xvc2UpO1xuXG4gIHJldHVybiB7XG4gICAgdHlwZTogJ1BhcnRpYWxCbG9ja1N0YXRlbWVudCcsXG4gICAgbmFtZTogb3Blbi5wYXRoLFxuICAgIHBhcmFtczogb3Blbi5wYXJhbXMsXG4gICAgaGFzaDogb3Blbi5oYXNoLFxuICAgIHByb2dyYW0sXG4gICAgb3BlblN0cmlwOiBvcGVuLnN0cmlwLFxuICAgIGNsb3NlU3RyaXA6IGNsb3NlICYmIGNsb3NlLnN0cmlwLFxuICAgIGxvYzogdGhpcy5sb2NJbmZvKGxvY0luZm8pXG4gIH07XG59XG4iXX0=
+/**
+ * p#8: Finalize each T in syms array:
+ * 1. remove defaults from T
+ * 2. add origin symbol.nowT() with given T.t, override missing units
+ * 3. add t and dt
+ */
+function finalizeT (syms, offset) {
+ // remove defaults
+ for (var i = 0; i < syms.length; i++) {
+ syms[i] = removeDefaults(syms[i])
+ }
+ // default with origin at end
+ syms.push(symbol(util.nowT(offset)))
+ syms = reduce(syms, ['T', 'T'])
+ // combine t and dt
+ var newSyms = []
+ for (var i = 0; i < syms.length; i++) {
+ var s = syms[i],
+ sum = tdtAdd(s)
+ sum.token = util.TtoStr(sum)
+ newSyms.push(tdtAdd(s))
+ }
+ return syms
+}
-/***/ }),
+/**
+ * remove the defaults before adding with origin
+ */
+function removeDefaults (T) {
+ for (var k in T.dt) {
+ T.dt[k] = T.dt[k].toString().replace(/^=/, '')
+ }
+ for (var k in T.t) {
+ T.t[k] = T.t[k].toString().replace(/^=/, '')
+ }
+ // delete meridiem too
+ delete T['t']['mer']
-/***/ 1617:
-/***/ ((module, exports, __nccwpck_require__) => {
+ return T
+}
-"use strict";
+/**
+ * add t and dt within a T together, delete the dt keys
+ */
+function tdtAdd (T) {
+ // guard for non-T
+ if (!util.isSym(T, ['T'])) {
+ return T
+ }
+ for (var k in T.dt) {
+ // absolute add, disregard defaults
+ var t_k = (T.t[k] == undefined) ? 0 : T.t[k],
+ dt_k = T.dt[k]
+ // cleanup the default
+ t_k = t_k.toString().replace(/^=/, '')
+ dt_k = dt_k.toString().replace(/^=/, '')
+ var sum = parseFloat(t_k) + parseFloat(dt_k)
+ // set the result, remove used dt
+ T.t[k] = sum
+ delete T.dt[k]
+ }
+ return T
+}
+/**
+ * p#9: Convert an array of symbols to normalized stdT strings.
+ * if token was normal form already, parse into stdT.
+ * if is n: return n.value
+ * else return org token
+ */
+function symsToStdT (syms, offset) {
+ var tokens = []
+ for (var i = 0; i < syms.length; i++) {
+ var s = syms[i],
+ token = s.token.toString()
+ // default, don't switch unless:
+ if (util.isSym(s, ['n'])) {
+ token = s.value
+ } else if (token.match(util.reT)) {
+ // is normal T form
+ token = util.TtoStdT(token, offset)
+ }
+ tokens.push(token)
+ }
+ return tokens.join(' ')
+}
-exports.__esModule = true;
-// istanbul ignore next
+/**
+ * !to be implemented for range
+ */
+function rTOp (L, R) {
+ var start, end
+ if (!R) {
+ start = symbol(util.nowT())
+ end = L
+ } else {
+ start = L
+ end = R
+ }
+ return symbol({ start: start, end: end })
+}
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+/**
+ * !to be implemented for cron
+ */
+function cTOp (L, R) {}
-var _base = __nccwpck_require__(4211);
-var _exception = __nccwpck_require__(2879);
+/***/ }),
-var _exception2 = _interopRequireDefault(_exception);
+/***/ 90056:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var _utils = __nccwpck_require__(1437);
+/**
+ * Module Dependencies
+ */
-var _codeGen = __nccwpck_require__(3612);
+var debug = __nccwpck_require__(7998)('date:parser')
+var date = __nccwpck_require__(36382)
+var norm = __nccwpck_require__(35068)
-var _codeGen2 = _interopRequireDefault(_codeGen);
+/**
+ * Days
+ */
-function Literal(value) {
- this.value = value;
-}
+var days = (/* unused pure expression or super */ null && (['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday']))
+var months = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september',
+ 'october', 'november', 'december'
+]
-function JavaScriptCompiler() {}
+/**
+ * Regexs
+ */
-JavaScriptCompiler.prototype = {
- // PUBLIC API: You can override these methods in a subclass to provide
- // alternative compiled forms for name lookup and buffering semantics
- nameLookup: function nameLookup(parent, name /*, type */) {
- return this.internalNameLookup(parent, name);
- },
- depthedLookup: function depthedLookup(name) {
- return [this.aliasable('container.lookup'), '(depths, ', JSON.stringify(name), ')'];
- },
+// 5, 05, 5:30, 5.30, 05:30:10, 05:30.10, 05.30.10, at 5
+var rMeridiem = /^(\d{1,2})([:.](\d{1,2}))?([:.](\d{1,2}))?\s*([ap]m)/
+var rHourMinute = /^(\d{1,2})([:.](\d{1,2}))([:.](\d{1,2}))?/
+var rAtHour = /^at\s?(\d{1,2})$/
+var rDays = /\b(sun(day)?|mon(day)?|tues(day)?|wed(nesday)?|thur(sday|s)?|fri(day)?|sat(urday)?)s?\b/
+var rMonths = /^((\d{1,2})\s*(st|nd|rd|th))\s(day\s)?(of\s)?(january|february|march|april|may|june|july|august|september|october|november|december)/i
+var rPast = /\b(last|yesterday|ago)\b/
+var rDayMod = /\b(morning|noon|afternoon|night|evening|midnight)\b/
+var rAgo = /^(\d*)\s?\b(second|minute|hour|day|week|month|year)[s]?\b\s?ago$/
- compilerInfo: function compilerInfo() {
- var revision = _base.COMPILER_REVISION,
- versions = _base.REVISION_CHANGES[revision];
- return [revision, versions];
- },
+/**
+ * Expose `parser`
+ */
- appendToBuffer: function appendToBuffer(source, location, explicit) {
- // Force a source as this simplifies the merge logic.
- if (!_utils.isArray(source)) {
- source = [source];
- }
- source = this.source.wrap(source, location);
+module.exports = parser
- if (this.environment.isSimple) {
- return ['return ', source, ';'];
- } else if (explicit) {
- // This is a case where the buffer operation occurs as a child of another
- // construct, generally braces. We have to explicitly output these buffer
- // operations to ensure that the emitted code goes in the correct location.
- return ['buffer += ', source, ';'];
+/**
+ * Initialize `parser`
+ *
+ * @param {String} str
+ * @return {Date}
+ * @api publics
+ */
+
+function parser (str, offset) {
+ if (!(this instanceof parser)) return new parser(str, offset)
+ if (typeof offset == 'string') offset = parser(offset)
+
+ // CFG preprocessing into normalized format,
+ // get {str, tokens, normals}
+ // !future: return multiple parsed times, some from it
+ var prepro = norm(str, offset)
+ // console.log(prepro)
+ // reset the str to prepro str
+ str = prepro.str
+ // if proprocessed doesn't leave any str to be processed (non-date-time) format, check normals
+ if (!str) {
+ if (prepro.normals.length) {
+ // if there's normal date parsed already,
+ // !return the first
+ return new Date(prepro.normals[0])
} else {
- source.appendToBuffer = true;
- return source;
+ // otherwise go back to below to return proper Error
+ str = str
}
- },
+ }
- initializeBuffer: function initializeBuffer() {
- return this.quotedString('');
- },
- // END PUBLIC API
- internalNameLookup: function internalNameLookup(parent, name) {
- this.lookupPropertyFunctionIsUsed = true;
- return ['lookupProperty(', parent, ',', JSON.stringify(name), ')'];
- },
+ var d = offset || new Date
+ this.date = new date(d)
+ this.original = str
+ this.str = str.toLowerCase()
+ this.stash = []
+ this.tokens = []
+ while (this.advance() !== 'eos')
+ debug('tokens %j', this.tokens)
+ this.nextTime(d)
+ if (this.date.date == d) throw new Error('Invalid date')
+ return this.date.date
+}
- lookupPropertyFunctionIsUsed: false,
+/**
+ * Advance a token
+ */
- compile: function compile(environment, options, context, asObject) {
- this.environment = environment;
- this.options = options;
- this.stringParams = this.options.stringParams;
- this.trackIds = this.options.trackIds;
- this.precompile = !asObject;
+parser.prototype.advance = function () {
+ var tok = this.eos()
+ || this.space()
+ || this._next()
+ || this.last()
+ || this.dayByName()
+ || this.monthByName()
+ || this.timeAgo()
+ || this.ago()
+ || this.yesterday()
+ || this.tomorrow()
+ || this.noon()
+ || this.midnight()
+ || this.night()
+ || this.evening()
+ || this.afternoon()
+ || this.morning()
+ || this.tonight()
+ || this.meridiem()
+ || this.hourminute()
+ || this.athour()
+ || this.week()
+ || this.month()
+ || this.year()
+ || this.second()
+ || this.minute()
+ || this.hour()
+ || this.day()
+ || this.number()
+ || this.string()
+ || this.other()
+
+ this.tokens.push(tok)
+ return tok
+}
- this.name = this.environment.name;
- this.isChild = !!context;
- this.context = context || {
- decorators: [],
- programs: [],
- environments: []
- };
+/**
+ * Lookahead `n` tokens.
+ *
+ * @param {Number} n
+ * @return {Object}
+ * @api private
+ */
- this.preamble();
+parser.prototype.lookahead = function (n) {
+ var fetch = n - this.stash.length
+ if (fetch == 0) return this.lookahead(++n)
+ while (fetch-- > 0) this.stash.push(this.advance())
+ return this.stash[--n]
+}
- this.stackSlot = 0;
- this.stackVars = [];
- this.aliases = {};
- this.registers = { list: [] };
- this.hashes = [];
- this.compileStack = [];
- this.inlineStack = [];
- this.blockParams = [];
+/**
+ * Lookahead a single token.
+ *
+ * @return {Token}
+ * @api private
+ */
- this.compileChildren(environment, options);
+parser.prototype.peek = function () {
+ return this.lookahead(1)
+}
- this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat;
- this.useBlockParams = this.useBlockParams || environment.useBlockParams;
+/**
+ * Fetch next token including those stashed by peek.
+ *
+ * @return {Token}
+ * @api private
+ */
- var opcodes = environment.opcodes,
- opcode = undefined,
- firstLoc = undefined,
- i = undefined,
- l = undefined;
+parser.prototype.next = function () {
+ var tok = this.stashed() || this.advance()
+ return tok
+}
- for (i = 0, l = opcodes.length; i < l; i++) {
- opcode = opcodes[i];
+/**
+ * Return the next possibly stashed token.
+ *
+ * @return {Token}
+ * @api private
+ */
- this.source.currentLocation = opcode.loc;
- firstLoc = firstLoc || opcode.loc;
- this[opcode.opcode].apply(this, opcode.args);
- }
+parser.prototype.stashed = function () {
+ var stashed = this.stash.shift()
+ return stashed
+}
- // Flush any trailing content that might be pending.
- this.source.currentLocation = firstLoc;
- this.pushSource('');
+/**
+ * Consume the given `len`.
+ *
+ * @param {Number|Array} len
+ * @api private
+ */
- /* istanbul ignore next */
- if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
- throw new _exception2['default']('Compile completed with content left on stack');
- }
+parser.prototype.skip = function (len) {
+ this.str = this.str.substr(Array.isArray(len) ? len[0].length : len)
+}
- if (!this.decorators.isEmpty()) {
- this.useDecorators = true;
+/**
+ * EOS
+ */
- this.decorators.prepend(['var decorators = container.decorators, ', this.lookupPropertyFunctionVarDeclaration(), ';\n']);
- this.decorators.push('return fn;');
+parser.prototype.eos = function () {
+ if (this.str.length) return
+ return 'eos'
+}
- if (asObject) {
- this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]);
- } else {
- this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n');
- this.decorators.push('}\n');
- this.decorators = this.decorators.merge();
- }
- } else {
- this.decorators = undefined;
- }
+/**
+ * Space
+ */
- var fn = this.createFunctionContext(asObject);
- if (!this.isChild) {
- var ret = {
- compiler: this.compilerInfo(),
- main: fn
- };
+parser.prototype.space = function () {
+ var captures
+ if (captures = /^([ \t]+)/.exec(this.str)) {
+ this.skip(captures)
+ return this.advance()
+ }
+}
- if (this.decorators) {
- ret.main_d = this.decorators; // eslint-disable-line camelcase
- ret.useDecorators = true;
- }
+/**
+ * Second
+ */
- var _context = this.context;
- var programs = _context.programs;
- var decorators = _context.decorators;
+parser.prototype.second = function () {
+ var captures
+ if (captures = /^s(ec|econd)?s?/.exec(this.str)) {
+ this.skip(captures)
+ return 'second'
+ }
+}
- for (i = 0, l = programs.length; i < l; i++) {
- if (programs[i]) {
- ret[i] = programs[i];
- if (decorators[i]) {
- ret[i + '_d'] = decorators[i];
- ret.useDecorators = true;
- }
- }
- }
+/**
+ * Minute
+ */
- if (this.environment.usePartial) {
- ret.usePartial = true;
- }
- if (this.options.data) {
- ret.useData = true;
- }
- if (this.useDepths) {
- ret.useDepths = true;
- }
- if (this.useBlockParams) {
- ret.useBlockParams = true;
- }
- if (this.options.compat) {
- ret.compat = true;
- }
+parser.prototype.minute = function () {
+ var captures
+ if (captures = /^m(in|inute)?s?/.exec(this.str)) {
+ this.skip(captures)
+ return 'minute'
+ }
+}
- if (!asObject) {
- ret.compiler = JSON.stringify(ret.compiler);
+/**
+ * Hour
+ */
- this.source.currentLocation = { start: { line: 1, column: 0 } };
- ret = this.objectLiteral(ret);
+parser.prototype.hour = function () {
+ var captures
+ if (captures = /^h(r|our)s?/.exec(this.str)) {
+ this.skip(captures)
+ return 'hour'
+ }
+}
- if (options.srcName) {
- ret = ret.toStringWithSourceMap({ file: options.destName });
- ret.map = ret.map && ret.map.toString();
- } else {
- ret = ret.toString();
- }
- } else {
- ret.compilerOptions = this.options;
- }
+/**
+ * Day
+ */
- return ret;
- } else {
- return fn;
- }
- },
+parser.prototype.day = function () {
+ var captures
+ if (captures = /^d(ay)?s?/.exec(this.str)) {
+ this.skip(captures)
+ return 'day'
+ }
+}
- preamble: function preamble() {
- // track the last context pushed into place to allow skipping the
- // getContext opcode when it would be a noop
- this.lastContext = 0;
- this.source = new _codeGen2['default'](this.options.srcName);
- this.decorators = new _codeGen2['default'](this.options.srcName);
- },
+/**
+ * Day by name
+ */
- createFunctionContext: function createFunctionContext(asObject) {
- // istanbul ignore next
+parser.prototype.dayByName = function () {
+ var captures
+ var r = new RegExp('^' + rDays.source)
+ if (captures = r.exec(this.str)) {
+ var day = captures[1]
+ this.skip(captures)
+ this.date[day](1)
+ return captures[1]
+ }
+}
- var _this = this;
+/**
+ * Month by name
+ */
- var varDeclarations = '';
+parser.prototype.monthByName = function () {
+ var captures
+ if (captures = rMonths.exec(this.str)) {
+ var day = captures[2]
+ var month = captures[6]
+ this.date.date.setMonth((months.indexOf(month)))
+ if (day) this.date.date.setDate(parseInt(day))
+ this.skip(captures)
+ return captures[0]
+ }
+}
- var locals = this.stackVars.concat(this.registers.list);
- if (locals.length > 0) {
- varDeclarations += ', ' + locals.join(', ');
- }
+parser.prototype.timeAgo = function () {
+ var captures
+ if (captures = rAgo.exec(this.str)) {
+ var num = captures[1]
+ var mod = captures[2]
+ this.date[mod](-num)
+ this.skip(captures)
+ return 'timeAgo'
+ }
+}
- // Generate minimizer alias mappings
- //
- // When using true SourceNodes, this will update all references to the given alias
- // as the source nodes are reused in situ. For the non-source node compilation mode,
- // aliases will not be used, but this case is already being run on the client and
- // we aren't concern about minimizing the template size.
- var aliasCount = 0;
- Object.keys(this.aliases).forEach(function (alias) {
- var node = _this.aliases[alias];
- if (node.children && node.referenceCount > 1) {
- varDeclarations += ', alias' + ++aliasCount + '=' + alias;
- node.children[0] = 'alias' + aliasCount;
- }
- });
+/**
+ * Week
+ */
- if (this.lookupPropertyFunctionIsUsed) {
- varDeclarations += ', ' + this.lookupPropertyFunctionVarDeclaration();
- }
+parser.prototype.week = function () {
+ var captures
+ if (captures = /^w(k|eek)s?/.exec(this.str)) {
+ this.skip(captures)
+ return 'week'
+ }
+}
- var params = ['container', 'depth0', 'helpers', 'partials', 'data'];
+/**
+ * Month
+ */
- if (this.useBlockParams || this.useDepths) {
- params.push('blockParams');
- }
- if (this.useDepths) {
- params.push('depths');
- }
+parser.prototype.month = function () {
+ var captures
+ if (captures = /^mon(th)?(es|s)?\b/.exec(this.str)) {
+ this.skip(captures)
+ return 'month'
+ }
- // Perform a second pass over the output to merge content when possible
- var source = this.mergeSource(varDeclarations);
+}
- if (asObject) {
- params.push(source);
+/**
+ * Week
+ */
- return Function.apply(this, params);
- } else {
- return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']);
- }
- },
- mergeSource: function mergeSource(varDeclarations) {
- var isSimple = this.environment.isSimple,
- appendOnly = !this.forceBuffer,
- appendFirst = undefined,
- sourceSeen = undefined,
- bufferStart = undefined,
- bufferEnd = undefined;
- this.source.each(function (line) {
- if (line.appendToBuffer) {
- if (bufferStart) {
- line.prepend(' + ');
- } else {
- bufferStart = line;
- }
- bufferEnd = line;
- } else {
- if (bufferStart) {
- if (!sourceSeen) {
- appendFirst = true;
- } else {
- bufferStart.prepend('buffer += ');
- }
- bufferEnd.add(';');
- bufferStart = bufferEnd = undefined;
- }
+parser.prototype.year = function () {
+ var captures
+ if (captures = /^y(r|ear)s?/.exec(this.str)) {
+ this.skip(captures)
+ return 'year'
+ }
+}
- sourceSeen = true;
- if (!isSimple) {
- appendOnly = false;
- }
- }
- });
+/**
+ * Meridiem am/pm
+ */
- if (appendOnly) {
- if (bufferStart) {
- bufferStart.prepend('return ');
- bufferEnd.add(';');
- } else if (!sourceSeen) {
- this.source.push('return "";');
- }
- } else {
- varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer());
+parser.prototype.meridiem = function () {
+ var captures
+ if (captures = rMeridiem.exec(this.str)) {
+ this.skip(captures)
+ this.time(captures[1], captures[3], captures[5], captures[6])
+ return 'meridiem'
+ }
+}
- if (bufferStart) {
- bufferStart.prepend('return buffer + ');
- bufferEnd.add(';');
- } else {
- this.source.push('return buffer;');
- }
- }
+/**
+ * Hour Minute (ex. 12:30)
+ */
- if (varDeclarations) {
- this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n'));
- }
+parser.prototype.hourminute = function () {
+ var captures
+ if (captures = rHourMinute.exec(this.str)) {
+ this.skip(captures)
+ this.time(captures[1], captures[3], captures[5], this._meridiem)
+ return 'hourminute'
+ }
+}
- return this.source.merge();
- },
+/**
+ * At Hour (ex. at 5)
+ */
- lookupPropertyFunctionVarDeclaration: function lookupPropertyFunctionVarDeclaration() {
- return '\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n '.trim();
- },
+parser.prototype.athour = function () {
+ var captures
+ if (captures = rAtHour.exec(this.str)) {
+ this.skip(captures)
+ this.time(captures[1], 0, 0, this._meridiem)
+ this._meridiem = null
+ return 'athour'
+ }
+}
- // [blockValue]
- //
- // On stack, before: hash, inverse, program, value
- // On stack, after: return value of blockHelperMissing
- //
- // The purpose of this opcode is to take a block of the form
- // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and
- // replace it on the stack with the result of properly
- // invoking blockHelperMissing.
- blockValue: function blockValue(name) {
- var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'),
- params = [this.contextName(0)];
- this.setupHelperArgs(name, 0, params);
+/**
+ * Time set helper
+ */
- var blockName = this.popStack();
- params.splice(1, 0, blockName);
+parser.prototype.time = function (h, m, s, meridiem) {
+ var d = this.date
+ var before = d.clone()
- this.push(this.source.functionCall(blockHelperMissing, 'call', params));
- },
+ if (meridiem) {
+ // convert to 24 hour
+ h = ('pm' == meridiem && 12 > h) ? +h + 12 : h; // 6pm => 18
+ h = ('am' == meridiem && 12 == h) ? 0 : h; // 12am => 0
+ }
- // [ambiguousBlockValue]
- //
- // On stack, before: hash, inverse, program, value
- // Compiler value, before: lastHelper=value of last found helper, if any
- // On stack, after, if no lastHelper: same as [blockValue]
- // On stack, after, if lastHelper: value
- ambiguousBlockValue: function ambiguousBlockValue() {
- // We're being a bit cheeky and reusing the options value from the prior exec
- var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'),
- params = [this.contextName(0)];
- this.setupHelperArgs('', 0, params, true);
+ m = (!m && d.changed('minutes')) ? false : m
+ s = (!s && d.changed('seconds')) ? false : s
+ d.time(h, m, s)
+}
- this.flushInline();
+/**
+ * Best attempt to pick the next time this date will occur
+ *
+ * TODO: place at the end of the parsing
+ */
- var current = this.topStack();
- params.splice(1, 0, current);
+parser.prototype.nextTime = function (before) {
+ var d = this.date
+ var orig = this.original
- this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']);
- },
+ if (before <= d.date || rPast.test(orig)) return this
- // [appendContent]
- //
- // On stack, before: ...
- // On stack, after: ...
- //
- // Appends the string value of `content` to the current buffer
- appendContent: function appendContent(content) {
- if (this.pendingContent) {
- content = this.pendingContent + content;
+ // If time is in the past, we need to guess at the next time
+ if (rDays.test(orig)) {
+ d.day(7)
+ } else if ((before - d.date) / 1000 > 60) {
+ // If it is a month in the past, don't add a day
+ if (rMonths.test(orig)) {
+ d.day(0)
} else {
- this.pendingLocation = this.source.currentLocation;
+ d.day(1)
}
+ }
- this.pendingContent = content;
- },
+ return this
+}
- // [append]
- //
- // On stack, before: value, ...
- // On stack, after: ...
- //
- // Coerces `value` to a String and appends it to the current buffer.
- //
- // If `value` is truthy, or 0, it is coerced into a string and appended
- // Otherwise, the empty string is appended
- append: function append() {
- if (this.isInline()) {
- this.replaceStack(function (current) {
- return [' != null ? ', current, ' : ""'];
- });
+/**
+ * Yesterday
+ */
- this.pushSource(this.appendToBuffer(this.popStack()));
- } else {
- var local = this.popStack();
- this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']);
- if (this.environment.isSimple) {
- this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']);
- }
- }
- },
+parser.prototype.yesterday = function () {
+ var captures
+ if (captures = /^(yes(terday)?)/.exec(this.str)) {
+ this.skip(captures)
+ this.date.day(-1)
+ return 'yesterday'
+ }
+}
- // [appendEscaped]
- //
- // On stack, before: value, ...
- // On stack, after: ...
- //
- // Escape `value` and append it to the buffer
- appendEscaped: function appendEscaped() {
- this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')']));
- },
+/**
+ * Tomorrow
+ */
- // [getContext]
- //
- // On stack, before: ...
- // On stack, after: ...
- // Compiler value, after: lastContext=depth
- //
- // Set the value of the `lastContext` compiler value to the depth
- getContext: function getContext(depth) {
- this.lastContext = depth;
- },
+parser.prototype.tomorrow = function () {
+ var captures
+ if (captures = /^tom(orrow)?/.exec(this.str)) {
+ this.skip(captures)
+ this.date.day(1)
+ return 'tomorrow'
+ }
+}
- // [pushContext]
- //
- // On stack, before: ...
- // On stack, after: currentContext, ...
- //
- // Pushes the value of the current context onto the stack.
- pushContext: function pushContext() {
- this.pushStackLiteral(this.contextName(this.lastContext));
- },
+/**
+ * Noon
+ */
- // [lookupOnContext]
- //
- // On stack, before: ...
- // On stack, after: currentContext[name], ...
- //
- // Looks up the value of `name` on the current context and pushes
- // it onto the stack.
- lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) {
- var i = 0;
+parser.prototype.noon = function () {
+ var captures
+ if (captures = /^noon\b/.exec(this.str)) {
+ this.skip(captures)
+ var before = this.date.clone()
+ this.date.date.setHours(12, 0, 0)
+ return 'noon'
+ }
+}
- if (!scoped && this.options.compat && !this.lastContext) {
- // The depthed query is expected to handle the undefined logic for the root level that
- // is implemented below, so we evaluate that directly in compat mode
- this.push(this.depthedLookup(parts[i++]));
- } else {
- this.pushContext();
- }
+/**
+ * Midnight
+ */
- this.resolvePath('context', parts, i, falsy, strict);
- },
+parser.prototype.midnight = function () {
+ var captures
+ if (captures = /^midnight\b/.exec(this.str)) {
+ this.skip(captures)
+ var before = this.date.clone()
+ this.date.date.setHours(0, 0, 0)
+ return 'midnight'
+ }
+}
- // [lookupBlockParam]
- //
- // On stack, before: ...
- // On stack, after: blockParam[name], ...
- //
- // Looks up the value of `parts` on the given block param and pushes
- // it onto the stack.
- lookupBlockParam: function lookupBlockParam(blockParamId, parts) {
- this.useBlockParams = true;
+/**
+ * Night (arbitrarily set at 7pm)
+ */
- this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']);
- this.resolvePath('context', parts, 1);
- },
+parser.prototype.night = function () {
+ var captures
+ if (captures = /^night\b/.exec(this.str)) {
+ this.skip(captures)
+ this._meridiem = 'pm'
+ var before = this.date.clone()
+ this.date.date.setHours(19, 0, 0)
+ return 'night'
+ }
+}
- // [lookupData]
- //
- // On stack, before: ...
- // On stack, after: data, ...
- //
- // Push the data lookup operator
- lookupData: function lookupData(depth, parts, strict) {
- if (!depth) {
- this.pushStackLiteral('data');
- } else {
- this.pushStackLiteral('container.data(data, ' + depth + ')');
- }
+/**
+ * Evening (arbitrarily set at 5pm)
+ */
- this.resolvePath('data', parts, 0, true, strict);
- },
+parser.prototype.evening = function () {
+ var captures
+ if (captures = /^evening\b/.exec(this.str)) {
+ this.skip(captures)
+ this._meridiem = 'pm'
+ var before = this.date.clone()
+ this.date.date.setHours(17, 0, 0)
+ return 'evening'
+ }
+}
- resolvePath: function resolvePath(type, parts, i, falsy, strict) {
- // istanbul ignore next
+/**
+ * Afternoon (arbitrarily set at 2pm)
+ */
- var _this2 = this;
+parser.prototype.afternoon = function () {
+ var captures
+ if (captures = /^afternoon\b/.exec(this.str)) {
+ this.skip(captures)
+ this._meridiem = 'pm'
+ var before = this.date.clone()
- if (this.options.strict || this.options.assumeObjects) {
- this.push(strictLookup(this.options.strict && strict, this, parts, type));
- return;
- }
+ if (this.date.changed('hours')) return 'afternoon'
- var len = parts.length;
- for (; i < len; i++) {
- /* eslint-disable no-loop-func */
- this.replaceStack(function (current) {
- var lookup = _this2.nameLookup(current, parts[i], type);
- // We want to ensure that zero and false are handled properly if the context (falsy flag)
- // needs to have the special handling for these values.
- if (!falsy) {
- return [' != null ? ', lookup, ' : ', current];
- } else {
- // Otherwise we can use generic falsy handling
- return [' && ', lookup];
- }
- });
- /* eslint-enable no-loop-func */
- }
- },
+ this.date.date.setHours(14, 0, 0)
+ return 'afternoon'
+ }
+}
- // [resolvePossibleLambda]
- //
- // On stack, before: value, ...
- // On stack, after: resolved value, ...
- //
- // If the `value` is a lambda, replace it on the stack by
- // the return value of the lambda
- resolvePossibleLambda: function resolvePossibleLambda() {
- this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']);
- },
+/**
+ * Morning (arbitrarily set at 8am)
+ */
- // [pushStringParam]
- //
- // On stack, before: ...
- // On stack, after: string, currentContext, ...
- //
- // This opcode is designed for use in string mode, which
- // provides the string value of a parameter along with its
- // depth rather than resolving it immediately.
- pushStringParam: function pushStringParam(string, type) {
- this.pushContext();
- this.pushString(type);
+parser.prototype.morning = function () {
+ var captures
+ if (captures = /^morning\b/.exec(this.str)) {
+ this.skip(captures)
+ this._meridiem = 'am'
+ var before = this.date.clone()
+ if (!this.date.changed('hours')) this.date.date.setHours(8, 0, 0)
+ return 'morning'
+ }
+}
- // If it's a subexpression, the string result
- // will be pushed after this opcode.
- if (type !== 'SubExpression') {
- if (typeof string === 'string') {
- this.pushString(string);
- } else {
- this.pushStackLiteral(string);
- }
- }
- },
+/**
+ * Tonight
+ */
- emptyHash: function emptyHash(omitEmpty) {
- if (this.trackIds) {
- this.push('{}'); // hashIds
- }
- if (this.stringParams) {
- this.push('{}'); // hashContexts
- this.push('{}'); // hashTypes
- }
- this.pushStackLiteral(omitEmpty ? 'undefined' : '{}');
- },
- pushHash: function pushHash() {
- if (this.hash) {
- this.hashes.push(this.hash);
- }
- this.hash = { values: {}, types: [], contexts: [], ids: [] };
- },
- popHash: function popHash() {
- var hash = this.hash;
- this.hash = this.hashes.pop();
+parser.prototype.tonight = function () {
+ var captures
+ if (captures = /^tonight\b/.exec(this.str)) {
+ this.skip(captures)
+ this._meridiem = 'pm'
+ return 'tonight'
+ }
+}
- if (this.trackIds) {
- this.push(this.objectLiteral(hash.ids));
- }
- if (this.stringParams) {
- this.push(this.objectLiteral(hash.contexts));
- this.push(this.objectLiteral(hash.types));
+/**
+ * Next time
+ */
+
+parser.prototype._next = function () {
+ var captures
+ if (captures = /^next/.exec(this.str)) {
+ this.skip(captures)
+ var d = new Date(this.date.date)
+ var mod = this.peek()
+
+ // If we have a defined modifier, then update
+ if (this.date[mod]) {
+ this.next()
+ // slight hack to modify already modified
+ this.date = date(d)
+ this.date[mod](1)
+ } else if (rDayMod.test(mod)) {
+ this.date.day(1)
}
- this.push(this.objectLiteral(hash.values));
- },
+ return 'next'
+ }
+}
- // [pushString]
- //
- // On stack, before: ...
- // On stack, after: quotedString(string), ...
- //
- // Push a quoted version of `string` onto the stack
- pushString: function pushString(string) {
- this.pushStackLiteral(this.quotedString(string));
- },
+/**
+ * Last time
+ */
- // [pushLiteral]
- //
- // On stack, before: ...
- // On stack, after: value, ...
- //
- // Pushes a value onto the stack. This operation prevents
- // the compiler from creating a temporary variable to hold
- // it.
- pushLiteral: function pushLiteral(value) {
- this.pushStackLiteral(value);
- },
+parser.prototype.last = function () {
+ var captures
+ if (captures = /^last/.exec(this.str)) {
+ this.skip(captures)
+ var d = new Date(this.date.date)
+ var mod = this.peek()
- // [pushProgram]
- //
- // On stack, before: ...
- // On stack, after: program(guid), ...
- //
- // Push a program expression onto the stack. This takes
- // a compile-time guid and converts it into a runtime-accessible
- // expression.
- pushProgram: function pushProgram(guid) {
- if (guid != null) {
- this.pushStackLiteral(this.programExpression(guid));
- } else {
- this.pushStackLiteral(null);
+ // If we have a defined modifier, then update
+ if (this.date[mod]) {
+ this.next()
+ // slight hack to modify already modified
+ this.date = date(d)
+ this.date[mod](-1)
+ } else if (rDayMod.test(mod)) {
+ this.date.day(-1)
}
- },
-
- // [registerDecorator]
- //
- // On stack, before: hash, program, params..., ...
- // On stack, after: ...
- //
- // Pops off the decorator's parameters, invokes the decorator,
- // and inserts the decorator into the decorators list.
- registerDecorator: function registerDecorator(paramSize, name) {
- var foundDecorator = this.nameLookup('decorators', name, 'decorator'),
- options = this.setupHelperArgs(name, paramSize);
- this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']);
- },
+ return 'last'
+ }
+}
- // [invokeHelper]
- //
- // On stack, before: hash, inverse, program, params..., ...
- // On stack, after: result of helper invocation
- //
- // Pops off the helper's parameters, invokes the helper,
- // and pushes the helper's return value onto the stack.
- //
- // If the helper is not found, `helperMissing` is called.
- invokeHelper: function invokeHelper(paramSize, name, isSimple) {
- var nonHelper = this.popStack(),
- helper = this.setupHelper(paramSize, name);
+/**
+ * Ago
+ */
- var possibleFunctionCalls = [];
+parser.prototype.ago = function () {
+ var captures
+ if (captures = /^ago\b/.exec(this.str)) {
+ this.skip(captures)
+ return 'ago'
+ }
+}
- if (isSimple) {
- // direct call to helper
- possibleFunctionCalls.push(helper.name);
- }
- // call a function from the input object
- possibleFunctionCalls.push(nonHelper);
- if (!this.options.strict) {
- possibleFunctionCalls.push(this.aliasable('container.hooks.helperMissing'));
- }
+/**
+ * Number
+ */
- var functionLookupCode = ['(', this.itemsSeparatedBy(possibleFunctionCalls, '||'), ')'];
- var functionCall = this.source.functionCall(functionLookupCode, 'call', helper.callParams);
- this.push(functionCall);
- },
+parser.prototype.number = function () {
+ var captures
+ if (captures = /^(\d+)/.exec(this.str)) {
+ var n = captures[1]
+ this.skip(captures)
+ var mod = this.peek()
+
+ // If we have a defined modifier, then update
+ if (this.date[mod]) {
+ if ('ago' == this.peek()) n = -n
+ this.date[mod](n)
+ } else if (this._meridiem) {
+ // when we don't have meridiem, possibly use context to guess
+ this.time(n, 0, 0, this._meridiem)
+ this._meridiem = null
+ } else if (this.original.indexOf('at') > -1) {
+ this.time(n, 0, 0, this._meridiem)
+ this._meridiem = null
+ }
+
+ return 'number'
+ }
+}
- itemsSeparatedBy: function itemsSeparatedBy(items, separator) {
- var result = [];
- result.push(items[0]);
- for (var i = 1; i < items.length; i++) {
- result.push(separator, items[i]);
- }
- return result;
- },
- // [invokeKnownHelper]
- //
- // On stack, before: hash, inverse, program, params..., ...
- // On stack, after: result of helper invocation
- //
- // This operation is used when the helper is known to exist,
- // so a `helperMissing` fallback is not required.
- invokeKnownHelper: function invokeKnownHelper(paramSize, name) {
- var helper = this.setupHelper(paramSize, name);
- this.push(this.source.functionCall(helper.name, 'call', helper.callParams));
- },
+/**
+ * String
+ */
- // [invokeAmbiguous]
- //
- // On stack, before: hash, inverse, program, params..., ...
- // On stack, after: result of disambiguation
- //
- // This operation is used when an expression like `{{foo}}`
- // is provided, but we don't know at compile-time whether it
- // is a helper or a path.
- //
- // This operation emits more code than the other options,
- // and can be avoided by passing the `knownHelpers` and
- // `knownHelpersOnly` flags at compile-time.
- invokeAmbiguous: function invokeAmbiguous(name, helperCall) {
- this.useRegister('helper');
+parser.prototype.string = function () {
+ var captures
+ if (captures = /^\w+/.exec(this.str)) {
+ this.skip(captures)
+ return 'string'
+ }
+}
- var nonHelper = this.popStack();
+/**
+ * Other
+ */
- this.emptyHash();
- var helper = this.setupHelper(0, name, helperCall);
+parser.prototype.other = function () {
+ var captures
+ if (captures = /^./.exec(this.str)) {
+ this.skip(captures)
+ return 'other'
+ }
+}
- var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
- var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')'];
- if (!this.options.strict) {
- lookup[0] = '(helper = ';
- lookup.push(' != null ? helper : ', this.aliasable('container.hooks.helperMissing'));
- }
+/***/ }),
- this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']);
- },
+/***/ 22192:
+/***/ ((__unused_webpack_module, exports) => {
- // [invokePartial]
- //
- // On stack, before: context, ...
- // On stack after: result of partial invocation
- //
- // This operation pops off a context, invokes a partial with that context,
- // and pushes the result of the invocation back.
- invokePartial: function invokePartial(isDynamic, name, indent) {
- var params = [],
- options = this.setupParams(name, 1, params);
+/**
+ * Substitutes for lodash methods
+ */
- if (isDynamic) {
- name = this.popStack();
- delete options.name;
+exports.difference = function (bigArr, smallArr) {
+ var diff = []
+ for (var i = 0; i < bigArr.length; i++) {
+ var ele = bigArr[i]
+ if (smallArr.indexOf(ele) == -1) {
+ diff.push(ele)
}
+ }
+ return diff
+}
- if (indent) {
- options.indent = JSON.stringify(indent);
+exports.flatten = function (arr) {
+ return [].concat.apply([], arr)
+}
+
+exports.find = function (arr, fn) {
+ var found = null
+ for (var i = 0; i < arr.length; i++) {
+ if (fn(arr[i])) {
+ found = arr[i]
+ break
}
- options.helpers = 'helpers';
- options.partials = 'partials';
- options.decorators = 'container.decorators';
+ }
+ return found
+}
- if (!isDynamic) {
- params.unshift(this.nameLookup('partials', name, 'partial'));
- } else {
- params.unshift(name);
+exports.findLastIndex = function (arr, fn) {
+ var found = -1
+ for (var i = arr.length - 1; i >= 0; i--) {
+ if (fn(arr[i])) {
+ found = i
+ break
}
+ }
+ return found
+}
- if (this.options.compat) {
- options.depths = 'depths';
+exports.includes = function (arr, item) {
+ var found = false
+ for (var i = 0; i < arr.length; i++) {
+ if (arr[i] === item) {
+ found = true
+ break
}
- options = this.objectLiteral(options);
- params.push(options);
+ }
+ return found
+}
- this.push(this.source.functionCall('container.invokePartial', '', params));
- },
+exports.isNaN = function (n) {
+ return Number.isNaN(n)
+}
- // [assignToHash]
- //
- // On stack, before: value, ..., hash, ...
- // On stack, after: ..., hash, ...
- //
- // Pops a value off the stack and assigns it to the current hash
- assignToHash: function assignToHash(key) {
- var value = this.popStack(),
- context = undefined,
- type = undefined,
- id = undefined;
+exports.keys = function (obj) {
+ return Object.keys(obj)
+}
- if (this.trackIds) {
- id = this.popStack();
- }
- if (this.stringParams) {
- type = this.popStack();
- context = this.popStack();
- }
+exports.pullAt = function (arr, i) {
+ var res = arr.splice(i, 1)
+ return res
+}
- var hash = this.hash;
- if (context) {
- hash.contexts[key] = context;
- }
- if (type) {
- hash.types[key] = type;
- }
- if (id) {
- hash.ids[key] = id;
- }
- hash.values[key] = value;
- },
+exports.unique = function (arr, i) {
+ return arr.filter(function (elem, pos) {
+ return arr.indexOf(elem) == pos
+ })
+}
- pushId: function pushId(type, name, child) {
- if (type === 'BlockParam') {
- this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : ''));
- } else if (type === 'PathExpression') {
- this.pushString(name);
- } else if (type === 'SubExpression') {
- this.pushStackLiteral('true');
- } else {
- this.pushStackLiteral('null');
- }
- },
- // HELPERS
+/***/ }),
- compiler: JavaScriptCompiler,
+/***/ 32273:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- compileChildren: function compileChildren(environment, options) {
- var children = environment.children,
- child = undefined,
- compiler = undefined;
+// Module to enumerate all CFG symbols for the human language for time
- for (var i = 0, l = children.length; i < l; i++) {
- child = children[i];
- compiler = new this.compiler(); // eslint-disable-line new-cap
+/**
+ * Module Dependencies
+ */
- var existing = this.matchExistingProgram(child);
+var maps = __nccwpck_require__(91160)
+var util = __nccwpck_require__(49188)
- if (existing == null) {
- this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
- var index = this.context.programs.length;
- child.index = index;
- child.name = 'program' + index;
- this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
- this.context.decorators[index] = compiler.decorators;
- this.context.environments[index] = child;
+/**
+ * Constructors for all types of symbols
+ */
+var symbolConstructors = {
+ op: op,
+ c: c,
+ r: r,
+ n: n,
+ t: T,
+ dt: T,
+ T: T,
+ f: f,
+ o: o,
+ rT: rT,
+ cT: cT,
+}
- this.useDepths = this.useDepths || compiler.useDepths;
- this.useBlockParams = this.useBlockParams || compiler.useBlockParams;
- child.useDepths = this.useDepths;
- child.useBlockParams = this.useBlockParams;
- } else {
- child.index = existing.index;
- child.name = 'program' + existing.index;
+/**
+ * Export `symbol`
+ */
- this.useDepths = this.useDepths || existing.useDepths;
- this.useBlockParams = this.useBlockParams || existing.useBlockParams;
- }
- }
- },
- matchExistingProgram: function matchExistingProgram(child) {
- for (var i = 0, len = this.context.environments.length; i < len; i++) {
- var environment = this.context.environments[i];
- if (environment && environment.equals(child)) {
- return environment;
- }
- }
- },
+module.exports = symbol
- programExpression: function programExpression(guid) {
- var child = this.environment.children[guid],
- programParams = [child.index, 'data', child.blockParams];
+/**
+ * The symbol constructor, given a string, lemmatize it, then return a symbol from {∅=null,op,c,r,n,t,dt,T,f}.
+ * i.e. str -> parseFloat(str) -> new n(str) -> return
+ * or str -> lemma(str) -> new (symbol-value) -> return
+ * @param {string} str the input string
+ * @return {*} The object from the class of symbols
+ * @example
+ * symbol('90')
+ * // => n { value: 10 }
+ * symbol('hour')
+ * // a
time difference object
+ * // => dt { h: '1' }
+ * symbol('tonight')
+ * // or equivalently, takes the T string too
+ * symbol('t:=9h,dt:12h')
+ * // a T object containing ,
+ * // => T { t: t { h: '=9' }, dt: dt { h: '12' } }
+ * symbol('unrecognized')
+ * // an unrecognized string yields the null symbol ∅
+ * // => null
+ */
+function symbol (str) {
+ var s
+ if (str == null) {
+ // null gets null
+ s = null
+ } else if (str['start'] && str['end']) {
+ // range: with 'start' and 'end'
+ s = new symbolConstructors['rT'](str)
+ } else if (parseFloat(str) == str) {
+ // 'n'
+ s = new symbolConstructors['n'](str)
+ } else if (str.match(util.reT)) {
+ // if is of the T string format t:,dt:
+ s = str.match(/\s+/g) ? null : new symbolConstructors['T'](str)
+ } else {
+ var lem = util.lemma(str)
+ s = lem.name ? new symbolConstructors[lem.name](lem.value, lem.name) : null
+ // set the canonical word from lemma
+ if (s) { s.canon = lem.canon }
+ // set the original token for reference
+ }
+ if (s) { s.token = str }
+ return s
+}
- if (this.useBlockParams || this.useDepths) {
- programParams.push('blockParams');
- }
- if (this.useDepths) {
- programParams.push('depths');
- }
+// console.log(symbol('10'))
+// console.log(symbol('hour'))
+// console.log(symbol('tonight'))
+// console.log(symbol('t:=9h,dt:12h'))
+// console.log(symbol('unrecognized'))
- return 'container.program(' + programParams.join(', ') + ')';
- },
+// ///////////////////
+// the CFG symbols //
+// ///////////////////
- useRegister: function useRegister(name) {
- if (!this.registers[name]) {
- this.registers[name] = true;
- this.registers.list.push(name);
- }
- },
+/**
+ * The op for arithmetic operator.
+ * note that since scaling(*,/) is very rare, we omit its implementation for now.
+ */
+function op (value) {
+ this.value = value
+}
- push: function push(expr) {
- if (!(expr instanceof Literal)) {
- expr = this.source.wrap(expr);
- }
+/**
+ * The origin operator.
+ */
+function o (value) {
+ this.value = value
+}
- this.inlineStack.push(expr);
- return expr;
- },
+/**
+ * The range operator.
+ */
+function r (value) {
+ this.value = value
+}
- pushStackLiteral: function pushStackLiteral(item) {
- this.push(new Literal(item));
- },
+/**
+ * The cron operator.
+ */
+function c (value) {
+ this.value = value
+}
- pushSource: function pushSource(source) {
- if (this.pendingContent) {
- this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
- this.pendingContent = undefined;
- }
+/**
+ * The n number. Calls parseFloat.
+ */
+function n (value) {
+ this.value = parseFloat(value)
+}
- if (source) {
- this.source.push(source);
- }
- },
+/**
+ * The t for time t, i.e. a point in the timeline
+ * units: ms, s, m, h, d, w, M, y
+ * All values are string, to represent the "=" default in the units. so when performing numerical operation, use parseFloat.
+ * @example
+ * new t(undefined)
+ * new t("")
+ * // => t {}
+ * new t("7h30m")
+ * // => t { h: '7', m: '30' }
+ * new t("7h=30m")
+ * // => t { h: '7', m: '=30' }
+ */
+function t (value) {
+ // guard against falsy input
+ if (!value) {
+ return null
+ }
+ // 1. see if unit is prepended with "=" for default, or set to ''
+ // 2. then consume chunks of like "30m"
+ while (value) {
+ var isDefault = (value.match(/^=/) || [])[0] || ''
+ value = value.replace(/^=/, '')
+ // default number is "1"
+ var number = (value.match(/^\-?\d+(\.\d+)?/) || [])[0] || '1'
+ value = value.replace(/^\-?\d+(\.\d+)?/, '')
+ var unit = (value.match(/^[a-zA-Z]+/) || [])[0]
+ value = value.replace(/^[a-zA-Z]+/, '')
+ // prepend the number (string) with isDefault, i.e. "=" or ""
+ this[unit] = isDefault + number
+ }
+}
- replaceStack: function replaceStack(callback) {
- var prefix = ['('],
- stack = undefined,
- createdStack = undefined,
- usedLiteral = undefined;
+/**
+ * The dt for time t, i.e. a displacement in the timeline
+ * units: ms, s, m, h, d, w, M, y
+ * All values are string, to represent the "=" default in the units. so when performing numerical operation, use parseFloat.
+ * Same keys as to allow for component-wise operation, e.g. t + dt = { ms+(d)ms, s+(d)s, ... }
+ */
+function dt (value) {
+ // guard against falsy input
+ if (!value) {
+ return null
+ }
+ // 1. see if unit is prepended with "=" for default, or set to ''
+ // 2. then consume chunks of like "30m"
+ while (value) {
+ var isDefault = (value.match(/^=/) || [])[0] || ''
+ value = value.replace(/^=/, '')
+ // default number is "1"
+ var number = (value.match(/^\-?\d+(\.\d+)?/) || [])[0] || '1'
+ value = value.replace(/^\-?\d+(\.\d+)?/, '')
+ var unit = (value.match(/^[a-zA-Z]+/) || [])[0]
+ value = value.replace(/^[a-zA-Z]+/, '')
+ // prepend the number (string) with isDefault, i.e. "=" or ""
+ this[unit] = isDefault + number
+ }
+}
- /* istanbul ignore next */
- if (!this.isInline()) {
- throw new _exception2['default']('replaceStack on non-inline');
- }
+// console.log(new t(undefined))
+// console.log(new t(""))
+// console.log(new t("7h30m"))
+// console.log(new t("=7h30m"))
+// console.log(new t().constructor.name)
- // We want to merge the inline statement into the replacement statement via ','
- var top = this.popStack(true);
+/**
+ * The T, implementation-specific, is a linear combination of and
.
+ * Used to capture the human Ts, e.g. noon, afternoon, dawn, evening, today, tonight, Sunday, fortnight, weekdays, weekends, christmas, spring, summer, holidays etc.
+ * To specify T in maps.json, follow the syntax:
+ * `:` means "set", `=` means "default", use t:,dt: for the symbol-value, e.g. "t:=7h,dt:0h"
+ * evening ~ t:=7h,dt:12h, read as "t set to default 7h, dt set to 12h"
+ * later ~ t:,dt:=3h, read as "t set to nothing, dt set to default 3h"
+ * beware, "" and "0" are diferent, the former is empty, the later a numerical value.
+ * @param {string} value from the Symbol.
+ * @param {string} [name] from the Symbol.
+ * @example
+ * var T = new symbol("t:=7h,dt:0h")
+ * // => T { t: t { h: '=7' }, dt: dt { h: '0' } }
+ * T.t
+ * // => t { h: '=7' }
+ * T.dt
+ * // => t { h: '0' }
+ */
+function T (value, name) {
+ if (name == 't') {
+ this.t = new t(value)
+ this.dt = new dt()
+ } else if (name == 'dt') {
+ this.t = new t()
+ this.dt = new dt(value)
+ } else {
+ var split = value.split(','),
+ _t = split[0].split(':').pop(),
+ _dt = split[1].split(':').pop()
+ this.t = new t(_t)
+ this.dt = new dt(_dt)
+ }
+}
- if (top instanceof Literal) {
- // Literals do not need to be inlined
- stack = [top.value];
- prefix = ['(', stack];
- usedLiteral = true;
- } else {
- // Get or create the current stack name for use by the inline
- createdStack = true;
- var _name = this.incrStack();
+// var T = new T("t:=7h,dt:0h")
+// console.log(T.t)
+// console.log(T.dt)
- prefix = ['((', this.push(_name), ' = ', top, ')'];
- stack = this.topStack();
- }
+/**
+ * The product of , gives a time interval
+ */
+function rT (interval) {
+ this.start = interval.start
+ this.end = interval.end
+}
- var item = callback.call(this, stack);
+/**
+ * The f to capture frequency for .
+ */
+function f (value) {
+ this.value = value
+}
- if (!usedLiteral) {
- this.popStack();
- }
- if (createdStack) {
- this.stackSlot--;
- }
- this.push(prefix.concat(item, ')'));
- },
+/**
+ * The product of or