apprun 3.33.4 → 3.33.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -18
- package/apprun-cli.js +14 -3
- package/cli/export.js +92 -0
- package/cli/import.js +68 -0
- package/dist/apprun-dev-tools.js +2 -1
- package/dist/apprun-dev-tools.js.LICENSE.txt +1 -13
- package/dist/apprun-dev-tools.js.map +1 -1
- package/dist/apprun-html.esm.js +1 -1
- package/dist/apprun-html.esm.js.map +1 -1
- package/dist/apprun-html.js +1 -1
- package/dist/apprun-html.js.map +1 -1
- package/dist/apprun-play-html.esm.js +3 -3
- package/dist/apprun-play-html.esm.js.map +1 -1
- package/dist/apprun-play.js.map +1 -1
- package/dist/apprun.esm.js.map +1 -1
- package/dist/apprun.js.map +1 -1
- package/esm/apprun-dev-tools.js +60 -4
- package/esm/apprun-dev-tools.js.map +1 -1
- package/esm/vdom-lit-html.js +1 -1
- package/esm/vdom-lit-html.js.map +1 -1
- package/esm/vdom-to-html.js +1 -1
- package/esm/vdom-to-html.js.map +1 -1
- package/index.html +1 -5
- package/package.json +5 -1
- package/src/app.ts +1 -1
- package/src/apprun-dev-tools.tsx +75 -17
- package/src/vdom-lit-html.ts +1 -1
- package/src/vdom-to-html.tsx +1 -1
- package/webpack.config.cjs +0 -1
- package/dist/apprun-code.js +0 -2
- package/dist/apprun-code.js.map +0 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
## Introduction
|
|
5
5
|
|
|
6
|
-
AppRun is a lightweight alternative to other frameworks and libraries. It has a unique architecture inspired by the Elm architecture that can help you manage states, routing, and other essential aspects of your web application.
|
|
6
|
+
AppRun is a lightweight alternative to other frameworks and libraries. It has a [unique architecture](https://apprun.js.org/docs/architecture/) inspired by the Elm architecture that can help you manage states, routing, and other essential aspects of your web application.
|
|
7
7
|
|
|
8
8
|
Use a _Counter_ as an example.
|
|
9
9
|
|
|
@@ -11,12 +11,12 @@ Use a _Counter_ as an example.
|
|
|
11
11
|
// define the initial state
|
|
12
12
|
const state = 0;
|
|
13
13
|
|
|
14
|
-
// view is a function to display the state
|
|
15
|
-
const view = state =>
|
|
16
|
-
<h1
|
|
14
|
+
// view is a function to display the state (JSX)
|
|
15
|
+
const view = state => <div>
|
|
16
|
+
<h1>{state}</h1>
|
|
17
17
|
<button onclick="app.run('-1')">-1</button>
|
|
18
18
|
<button onclick="app.run('+1')">+1</button>
|
|
19
|
-
</div
|
|
19
|
+
</div>;
|
|
20
20
|
|
|
21
21
|
// update is a collection of event handlers
|
|
22
22
|
const update = {
|
|
@@ -27,16 +27,15 @@ const update = {
|
|
|
27
27
|
// start the app
|
|
28
28
|
app.start(document.body, state, view, update);
|
|
29
29
|
```
|
|
30
|
-
<apprun-code
|
|
30
|
+
<apprun-code></apprun-code>
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
* AppRun is lightweight, only 6KB gzipped, but includes state management, rendering, event handling, and routing.
|
|
33
33
|
|
|
34
|
+
* With only three functions: `app.start`, `app.run`, and `app.on` in its API makes it easy to learn and use. And no worries about the incompatibility of version upgrades.
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
* One more thing, you can [use AppRun with React](https://apprun.js.org/docs/react) to simplify state management and routing of your React applications.
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
AppRun takes the familiar PubSub concept and extends it into your application's logic, providing a more structured and powerful approach to state management. The result? Cleaner, more maintainable code and a smoother development experience.
|
|
38
|
+
At its core, AppRun harnesses the power of the [event PubsSub]([Publish-Subscribe](https://apprun.js.org/docs/event-pubsub/)) pattern to streamline your application’s state handling and routing. The result? Cleaner, more maintainable code and a smoother development experience.
|
|
40
39
|
|
|
41
40
|
## AppRun Benefits
|
|
42
41
|
|
|
@@ -54,7 +53,6 @@ AppRun is distributed on npm. To get it, run:
|
|
|
54
53
|
```sh
|
|
55
54
|
npm install apprun
|
|
56
55
|
```
|
|
57
|
-
|
|
58
56
|
You can also load AppRun directly from the unpkg.com CDN:
|
|
59
57
|
|
|
60
58
|
```js
|
|
@@ -68,23 +66,25 @@ You can also load AppRun directly from the unpkg.com CDN:
|
|
|
68
66
|
</body>
|
|
69
67
|
</html>
|
|
70
68
|
```
|
|
71
|
-
<apprun-code style="
|
|
69
|
+
<apprun-code style="height:200px"></apprun-code>
|
|
72
70
|
|
|
73
71
|
Or, use the ESM version:
|
|
74
72
|
```js
|
|
75
73
|
<html>
|
|
76
74
|
<body>
|
|
77
75
|
<script type="module">
|
|
78
|
-
import { app } from 'https://unpkg.com/apprun/dist/apprun-html.esm.js';
|
|
79
|
-
const view = state => `<div>${state}</div>`;
|
|
76
|
+
import { app, html } from 'https://unpkg.com/apprun/dist/apprun-html.esm.js';
|
|
77
|
+
const view = state => html`<div>${state}</div>`;
|
|
80
78
|
app.start(document.body, 'hello ESM', view);
|
|
81
79
|
</script>
|
|
82
80
|
</body>
|
|
83
81
|
</html>
|
|
84
82
|
```
|
|
85
|
-
<apprun-code style="
|
|
83
|
+
<apprun-code style="height:200px"></apprun-code>
|
|
84
|
+
|
|
85
|
+
In addition to run directly in the browser, or with a compiler/bundler like Webpack or Vite.
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
You can run the `npm create apprun-app` command to create an AppRun project.
|
|
88
88
|
|
|
89
89
|
```sh
|
|
90
90
|
npm create apprun-app [my-app]
|
|
@@ -127,7 +127,7 @@ Have fun and send pull requests.
|
|
|
127
127
|
|
|
128
128
|
## Support
|
|
129
129
|
|
|
130
|
-
AppRun is an MIT-licensed open
|
|
130
|
+
AppRun is an MIT-licensed open-source project. Please consider [supporting the project on Patreon](https://www.patreon.com/apprun). 👍❤️🙏
|
|
131
131
|
|
|
132
132
|
### Thank you for your support
|
|
133
133
|
|
package/apprun-cli.js
CHANGED
|
@@ -2,7 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import toYaml from './cli/export.js';
|
|
6
|
+
import fromYaml from './cli/import.js';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
const cmd = process.argv[2];
|
|
9
|
+
const file = process.argv[3];
|
|
10
|
+
|
|
11
|
+
if (cmd === 'export') {
|
|
12
|
+
toYaml(file);
|
|
13
|
+
}
|
|
14
|
+
else if (cmd === 'import') {
|
|
15
|
+
fromYaml(file);
|
|
16
|
+
} else {
|
|
17
|
+
console.log('Usage: apprun-cli <export|import> <file>');
|
|
18
|
+
console.log('> If you want to create an AppRun project. Please use npm create apprun-app instead.');
|
|
19
|
+
}
|
package/cli/export.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { exec } from 'child_process';
|
|
2
|
+
import yaml from 'js-yaml';
|
|
3
|
+
import { unlinkSync } from 'fs';
|
|
4
|
+
|
|
5
|
+
function replacer(key, value) {
|
|
6
|
+
if (typeof value === 'function') return value.toString();
|
|
7
|
+
return ['', null].includes(value) || (typeof value === 'object' && (value.length === 0 || Object.keys(value).length === 0)) ? undefined : value;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function createProxy(obj) {
|
|
11
|
+
const handler = {
|
|
12
|
+
get(target, property, receiver) {
|
|
13
|
+
|
|
14
|
+
// Get the property value
|
|
15
|
+
const value = Reflect.get(target, property, receiver);
|
|
16
|
+
|
|
17
|
+
// If the value is an object (including arrays), proxy it
|
|
18
|
+
if (typeof value === 'object' && value !== null) {
|
|
19
|
+
if (Array.isArray(value)) {
|
|
20
|
+
// Proxy each element of the array if it's an object
|
|
21
|
+
return value.map(item => createProxy(item));
|
|
22
|
+
} else {
|
|
23
|
+
// Recursively proxy the object
|
|
24
|
+
return createProxy(value);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return `{${property}}`
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return Array.isArray(obj) ?
|
|
34
|
+
obj.map(item => createProxy(item)) : new Proxy(obj, handler);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function getVDOM(component) {
|
|
38
|
+
let view;
|
|
39
|
+
if (typeof component.state === 'object') {
|
|
40
|
+
const proxy = createProxy(component.state);
|
|
41
|
+
view = component.view(proxy);
|
|
42
|
+
} else {
|
|
43
|
+
view = component.view(component.state);
|
|
44
|
+
}
|
|
45
|
+
return view;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default function export_yaml(fn) {
|
|
49
|
+
|
|
50
|
+
const tmp = process.cwd() + '/_tmp.js';
|
|
51
|
+
exec(`npx esbuild ${fn} --outfile=${tmp} --format=esm --bundle`, (error, stdout, stderr) => {
|
|
52
|
+
if (error) {
|
|
53
|
+
console.error(`exec error: ${error}`);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
import(tmp).then((m) => {
|
|
58
|
+
|
|
59
|
+
const defaul_export = m.default
|
|
60
|
+
let component;
|
|
61
|
+
if (typeof defaul_export === 'function' &&
|
|
62
|
+
/^class\s/.test(Function.prototype.toString.call(defaul_export))) {
|
|
63
|
+
component = new m.default();
|
|
64
|
+
component = component.mount();
|
|
65
|
+
} else if (typeof defaul_export === 'function') {
|
|
66
|
+
component = defaul_export();
|
|
67
|
+
} else {
|
|
68
|
+
component = defaul_export;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const vdom = getVDOM(component);
|
|
72
|
+
const events = component['_actions'].map(a => a.name);
|
|
73
|
+
|
|
74
|
+
const component_def = {
|
|
75
|
+
name: component.constructor.name,
|
|
76
|
+
file: fn,
|
|
77
|
+
state: component.state,
|
|
78
|
+
view: vdom,
|
|
79
|
+
actions: events,
|
|
80
|
+
update: component.update,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const yaml_def = yaml.dump(component_def, { replacer });
|
|
84
|
+
console.log(yaml_def);
|
|
85
|
+
|
|
86
|
+
unlinkSync(tmp);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
package/cli/import.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import ymal from 'js-yaml';
|
|
2
|
+
import { readFileSync } from 'fs';
|
|
3
|
+
|
|
4
|
+
function getProp(prop) {
|
|
5
|
+
if (typeof prop === 'object') {
|
|
6
|
+
return Object.keys(prop).map(name => `${name}:${prop[name]}`).join(';');
|
|
7
|
+
}
|
|
8
|
+
else return prop.toString();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function toProps(props) {
|
|
12
|
+
return Object.keys(props)
|
|
13
|
+
.map(name => ` ${name === 'className' ? 'class' : name}="${getProp(props[name])}"`)
|
|
14
|
+
.join('');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function toHTMLArray(nodes) {
|
|
18
|
+
return nodes.map(node => toHTML(node)).join('');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function toHTML(vdom) {
|
|
22
|
+
if (!vdom) return '';
|
|
23
|
+
if (Array.isArray(vdom)) return toHTMLArray(vdom)
|
|
24
|
+
if (vdom.tag) {
|
|
25
|
+
const props = vdom.props ? toProps(vdom.props) : '';
|
|
26
|
+
const children = vdom.children ? toHTMLArray(vdom.children) : '';
|
|
27
|
+
return `<${vdom.tag}${props}>${children}</${vdom.tag}>`;
|
|
28
|
+
}
|
|
29
|
+
if (typeof vdom === 'object') return JSON.stringify(vdom);
|
|
30
|
+
else {
|
|
31
|
+
const html = vdom.toString();
|
|
32
|
+
return html.startsWith('_html:') ? html.substring(6) : html;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default function import_yaml(fn) {
|
|
37
|
+
|
|
38
|
+
const def = ymal.load(readFileSync(fn, 'utf8'))
|
|
39
|
+
|
|
40
|
+
const { name, state, view, update } = def;
|
|
41
|
+
|
|
42
|
+
const jsx = toHTML(view);
|
|
43
|
+
|
|
44
|
+
// const update_text = JSON.stringify(update, null, 2)
|
|
45
|
+
// .replace(/\\n/g, '\n');
|
|
46
|
+
|
|
47
|
+
const update_text =
|
|
48
|
+
Object.keys(update).map(key => `
|
|
49
|
+
"${key}" : ${update[key].replace(/\\n/g, '\n')}`).join(',\n'
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const component = `
|
|
53
|
+
import { app, Component } from 'apprun';
|
|
54
|
+
|
|
55
|
+
class ${name} extends Component {
|
|
56
|
+
|
|
57
|
+
state = ${JSON.stringify(state)};
|
|
58
|
+
|
|
59
|
+
view = ${jsx};
|
|
60
|
+
|
|
61
|
+
update = {
|
|
62
|
+
${update_text}
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
console.log(component);
|
|
68
|
+
}
|
package/dist/apprun-dev-tools.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! For license information please see apprun-dev-tools.js.LICENSE.txt */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.apprun=t():e.apprun=t()}(this,(()=>(()=>{"use strict";var e={752:(e,t,n)=>{n.d(t,{Z:()=>r});let i;const o="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g;o.app&&o._AppRunVersions?i=o.app:(i=new class{constructor(){this._events={}}on(e,t,n={}){this._events[e]=this._events[e]||[],this._events[e].push({fn:t,options:n})}off(e,t){const n=this._events[e]||[];this._events[e]=n.filter((e=>e.fn!==t))}find(e){return this._events[e]}run(e,...t){const n=this.getSubscribers(e,this._events);return console.assert(n&&n.length>0,"No subscriber for event: "+e),n.forEach((n=>{const{fn:i,options:o}=n;return o.delay?this.delay(e,i,t,o):Object.keys(o).length>0?i.apply(this,[...t,o]):i.apply(this,t),!n.options.once})),n.length}once(e,t,n={}){this.on(e,t,Object.assign(Object.assign({},n),{once:!0}))}delay(e,t,n,i){i._t&&clearTimeout(i._t),i._t=setTimeout((()=>{clearTimeout(i._t),Object.keys(i).length>0?t.apply(this,[...n,i]):t.apply(this,n)}),i.delay)}runAsync(e,...t){const n=this.getSubscribers(e,this._events);console.assert(n&&n.length>0,"No subscriber for event: "+e);const i=n.map((e=>{const{fn:n,options:i}=e;return Object.keys(i).length>0?n.apply(this,[...t,i]):n.apply(this,t)}));return Promise.all(i)}query(e,...t){return this.query(e,...t)}getSubscribers(e,t){const n=t[e]||[];return t[e]=n.filter((e=>!e.options.once)),Object.keys(t).filter((t=>t.endsWith("*")&&e.startsWith(t.replace("*","")))).sort(((e,t)=>t.length-e.length)).forEach((i=>n.push(...t[i].map((t=>Object.assign(Object.assign({},t),{options:Object.assign(Object.assign({},t.options),{event:e})})))))),n}},o.app=i,o._AppRunVersions="AppRun-3");const r=i}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{n.r(i);var e=n(752);function t(e){return e.map((e=>r(e))).join("")}function o(e){for(var t in e)null==e[t]?delete e[t]:"object"==typeof e[t]&&o(e[t])}function r(e){if(!e)return"";if(e._$litType$)return e.toString();if(o(e),Array.isArray(e))return t(e);if("string"==typeof e)return e.startsWith("_html:")?e.substring(6):e;if(e.tag){const n=e.props?function(e){return Object.keys(e).map((t=>{return` ${"className"===t?"class":t}="${n=e[t],"object"==typeof n?Object.keys(n).map((e=>`${e}:${n[e]}`)).join(";"):n.toString()}"`;var n})).join("")}(e.props):"",i=e.children?t(e.children):"";return`<${e.tag}${n}>${i}</${e.tag}>`}return"object"==typeof e?JSON.stringify(e):void 0}const a=r;let l;function s(e){l=window.open("",e),l.document.write(`<html>\n <title>AppRun Analyzer | ${document.location.href}</title>\n <style>\n body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI" }\n </style>\n <body><pre>`)}function c(e){l.document.write(e+"\n")}function u(){l.document.write("</pre>\n </body>\n </html>"),l.document.close()}app.debug=!0;const p=e=>{c(`import ${e.constructor.name} from '../src/${e.constructor.name}'`),c(`describe('${e.constructor.name}', ()=>{`),e._actions.forEach((t=>{"."!==t.name&&(c(` it ('should handle event: ${t.name}', (done)=>{`),c(` const component = new ${e.constructor.name}().mount();`),c(` component.run('${t.name}');`),c(" setTimeout(() => {"),c(" //expect(?).toHaveBeenCalled();"),c(" //expect(component.state).toBe(?);"),c(" done();"),c(" })"))})),c("});")};let f=!1,d=[];app.on("debug",(e=>{f&&e.vdom&&(d.push(e),console.log(`* ${d.length} state(s) recorded.`))}));function h(e){return null==e}var g={isNothing:h,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:h(e)?[]:[e]},repeat:function(e,t){var n,i="";for(n=0;n<t;n+=1)i+=e;return i},isNegativeZero:function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},extend:function(e,t){var n,i,o,r;if(t)for(n=0,i=(r=Object.keys(t)).length;n<i;n+=1)e[o=r[n]]=t[o];return e}};function m(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),i+" "+n):i}function y(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=m(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}y.prototype=Object.create(Error.prototype),y.prototype.constructor=y,y.prototype.toString=function(e){return this.name+": "+m(this,e)};var b=y;function v(e,t,n,i,o){var r="",a="",l=Math.floor(o/2)-1;return i-t>l&&(t=i-l+(r=" ... ").length),n-i>l&&(n=i+l-(a=" ...").length),{str:r+e.slice(t,n).replace(/\t/g,"→")+a,pos:i-t+r.length}}function w(e,t){return g.repeat(" ",t-e.length)+e}var A=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,i=/\r?\n|\r|\0/g,o=[0],r=[],a=-1;n=i.exec(e.buffer);)r.push(n.index),o.push(n.index+n[0].length),e.position<=n.index&&a<0&&(a=o.length-2);a<0&&(a=o.length-1);var l,s,c="",u=Math.min(e.line+t.linesAfter,r.length).toString().length,p=t.maxLength-(t.indent+u+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)s=v(e.buffer,o[a-l],r[a-l],e.position-(o[a]-o[a-l]),p),c=g.repeat(" ",t.indent)+w((e.line-l+1).toString(),u)+" | "+s.str+"\n"+c;for(s=v(e.buffer,o[a],r[a],e.position,p),c+=g.repeat(" ",t.indent)+w((e.line+1).toString(),u)+" | "+s.str+"\n",c+=g.repeat("-",t.indent+u+3+s.pos)+"^\n",l=1;l<=t.linesAfter&&!(a+l>=r.length);l++)s=v(e.buffer,o[a+l],r[a+l],e.position-(o[a]-o[a+l]),p),c+=g.repeat(" ",t.indent)+w((e.line+l+1).toString(),u)+" | "+s.str+"\n";return c.replace(/\n$/,"")},k=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],x=["scalar","sequence","mapping"],C=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===k.indexOf(t))throw new b('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===x.indexOf(this.kind))throw new b('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function S(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,i){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=i)})),n[t]=e})),n}function O(e){return this.extend(e)}O.prototype.extend=function(e){var t=[],n=[];if(e instanceof C)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new b("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof C))throw new b("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new b("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new b("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof C))throw new b("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var i=Object.create(O.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=S(i,"implicit"),i.compiledExplicit=S(i,"explicit"),i.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(i);return n}(i.compiledImplicit,i.compiledExplicit),i};var j=O,I=new C("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),_=new C("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),T=new C("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}}),E=new j({explicit:[I,_,T]}),N=new C("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),L=new C("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function M(e){return 48<=e&&e<=55}function F(e){return 48<=e&&e<=57}var $=new C("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=e.length,o=0,r=!1;if(!i)return!1;if("-"!==(t=e[o])&&"+"!==t||(t=e[++o]),"0"===t){if(o+1===i)return!0;if("b"===(t=e[++o])){for(o++;o<i;o++)if("_"!==(t=e[o])){if("0"!==t&&"1"!==t)return!1;r=!0}return r&&"_"!==t}if("x"===t){for(o++;o<i;o++)if("_"!==(t=e[o])){if(!(48<=(n=e.charCodeAt(o))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;r=!0}return r&&"_"!==t}if("o"===t){for(o++;o<i;o++)if("_"!==(t=e[o])){if(!M(e.charCodeAt(o)))return!1;r=!0}return r&&"_"!==t}}if("_"===t)return!1;for(;o<i;o++)if("_"!==(t=e[o])){if(!F(e.charCodeAt(o)))return!1;r=!0}return!(!r||"_"===t)},construct:function(e){var t,n=e,i=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(i=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return i*parseInt(n.slice(2),2);if("x"===n[1])return i*parseInt(n.slice(2),16);if("o"===n[1])return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!g.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Z=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),D=/^[-+]?[0-9]+e/,q=new C("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!Z.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||g.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(g.isNegativeZero(e))return"-0.0";return n=e.toString(10),D.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),R=E.extend({implicit:[N,L,$,q]}),U=R,Y=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),B=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),P=new C("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==Y.exec(e)||null!==B.exec(e))},construct:function(e){var t,n,i,o,r,a,l,s,c=0,u=null;if(null===(t=Y.exec(e))&&(t=B.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(n,i,o));if(r=+t[4],a=+t[5],l=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),s=new Date(Date.UTC(n,i,o,r,a,l,c)),u&&s.setTime(s.getTime()-u),s},instanceOf:Date,represent:function(e){return e.toISOString()}}),V=new C("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),W="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r",G=new C("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=0,o=e.length,r=W;for(n=0;n<o;n++)if(!((t=r.indexOf(e.charAt(n)))>64)){if(t<0)return!1;i+=6}return i%8==0},construct:function(e){var t,n,i=e.replace(/[\r\n=]/g,""),o=i.length,r=W,a=0,l=[];for(t=0;t<o;t++)t%4==0&&t&&(l.push(a>>16&255),l.push(a>>8&255),l.push(255&a)),a=a<<6|r.indexOf(i.charAt(t));return 0==(n=o%4*6)?(l.push(a>>16&255),l.push(a>>8&255),l.push(255&a)):18===n?(l.push(a>>10&255),l.push(a>>2&255)):12===n&&l.push(a>>4&255),new Uint8Array(l)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,i="",o=0,r=e.length,a=W;for(t=0;t<r;t++)t%3==0&&t&&(i+=a[o>>18&63],i+=a[o>>12&63],i+=a[o>>6&63],i+=a[63&o]),o=(o<<8)+e[t];return 0==(n=r%3)?(i+=a[o>>18&63],i+=a[o>>12&63],i+=a[o>>6&63],i+=a[63&o]):2===n?(i+=a[o>>10&63],i+=a[o>>4&63],i+=a[o<<2&63],i+=a[64]):1===n&&(i+=a[o>>2&63],i+=a[o<<4&63],i+=a[64],i+=a[64]),i}}),K=Object.prototype.hasOwnProperty,H=Object.prototype.toString,J=new C("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,o,r,a=[],l=e;for(t=0,n=l.length;t<n;t+=1){if(i=l[t],r=!1,"[object Object]"!==H.call(i))return!1;for(o in i)if(K.call(i,o)){if(r)return!1;r=!0}if(!r)return!1;if(-1!==a.indexOf(o))return!1;a.push(o)}return!0},construct:function(e){return null!==e?e:[]}}),z=Object.prototype.toString,X=new C("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,o,r,a=e;for(r=new Array(a.length),t=0,n=a.length;t<n;t+=1){if(i=a[t],"[object Object]"!==z.call(i))return!1;if(1!==(o=Object.keys(i)).length)return!1;r[t]=[o[0],i[o[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,i,o,r,a=e;for(r=new Array(a.length),t=0,n=a.length;t<n;t+=1)i=a[t],o=Object.keys(i),r[t]=[o[0],i[o[0]]];return r}}),Q=Object.prototype.hasOwnProperty,ee=new C("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(Q.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}}),te=U.extend({implicit:[P,V],explicit:[G,J,X,ee]}),ne=Object.prototype.hasOwnProperty,ie=1,oe=2,re=3,ae=4,le=1,se=2,ce=3,ue=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,pe=/[\x85\u2028\u2029]/,fe=/[,\[\]\{\}]/,de=/^(?:!|!!|![a-z\-]+!)$/i,he=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ge(e){return Object.prototype.toString.call(e)}function me(e){return 10===e||13===e}function ye(e){return 9===e||32===e}function be(e){return 9===e||32===e||10===e||13===e}function ve(e){return 44===e||91===e||93===e||123===e||125===e}function we(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function Ae(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"
":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function ke(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var xe=new Array(256),Ce=new Array(256),Se=0;Se<256;Se++)xe[Se]=Ae(Se)?1:0,Ce[Se]=Ae(Se);function Oe(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||te,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function je(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=A(n),new b(t,n)}function Ie(e,t){throw je(e,t)}function _e(e,t){e.onWarning&&e.onWarning.call(null,je(e,t))}var Te={YAML:function(e,t,n){var i,o,r;null!==e.version&&Ie(e,"duplication of %YAML directive"),1!==n.length&&Ie(e,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&Ie(e,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),r=parseInt(i[2],10),1!==o&&Ie(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=r<2,1!==r&&2!==r&&_e(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,o;2!==n.length&&Ie(e,"TAG directive accepts exactly two arguments"),i=n[0],o=n[1],de.test(i)||Ie(e,"ill-formed tag handle (first argument) of the TAG directive"),ne.call(e.tagMap,i)&&Ie(e,'there is a previously declared suffix for "'+i+'" tag handle'),he.test(o)||Ie(e,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch(t){Ie(e,"tag prefix is malformed: "+o)}e.tagMap[i]=o}};function Ee(e,t,n,i){var o,r,a,l;if(t<n){if(l=e.input.slice(t,n),i)for(o=0,r=l.length;o<r;o+=1)9===(a=l.charCodeAt(o))||32<=a&&a<=1114111||Ie(e,"expected valid JSON character");else ue.test(l)&&Ie(e,"the stream contains non-printable characters");e.result+=l}}function Ne(e,t,n,i){var o,r,a,l;for(g.isObject(n)||Ie(e,"cannot merge mappings; the provided source object is unacceptable"),a=0,l=(o=Object.keys(n)).length;a<l;a+=1)r=o[a],ne.call(t,r)||(t[r]=n[r],i[r]=!0)}function Le(e,t,n,i,o,r,a,l,s){var c,u;if(Array.isArray(o))for(c=0,u=(o=Array.prototype.slice.call(o)).length;c<u;c+=1)Array.isArray(o[c])&&Ie(e,"nested arrays are not supported inside keys"),"object"==typeof o&&"[object Object]"===ge(o[c])&&(o[c]="[object Object]");if("object"==typeof o&&"[object Object]"===ge(o)&&(o="[object Object]"),o=String(o),null===t&&(t={}),"tag:yaml.org,2002:merge"===i)if(Array.isArray(r))for(c=0,u=r.length;c<u;c+=1)Ne(e,t,r[c],n);else Ne(e,t,r,n);else e.json||ne.call(n,o)||!ne.call(t,o)||(e.line=a||e.line,e.lineStart=l||e.lineStart,e.position=s||e.position,Ie(e,"duplicated mapping key")),"__proto__"===o?Object.defineProperty(t,o,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[o]=r,delete n[o];return t}function Me(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):Ie(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Fe(e,t,n){for(var i=0,o=e.input.charCodeAt(e.position);0!==o;){for(;ye(o);)9===o&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(t&&35===o)do{o=e.input.charCodeAt(++e.position)}while(10!==o&&13!==o&&0!==o);if(!me(o))break;for(Me(e),o=e.input.charCodeAt(e.position),i++,e.lineIndent=0;32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position)}return-1!==n&&0!==i&&e.lineIndent<n&&_e(e,"deficient indentation"),i}function $e(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!be(t)))}function Ze(e,t){1===t?e.result+=" ":t>1&&(e.result+=g.repeat("\n",t-1))}function De(e,t){var n,i,o=e.tag,r=e.anchor,a=[],l=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),i=e.input.charCodeAt(e.position);0!==i&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,Ie(e,"tab characters must not be used in indentation")),45===i)&&be(e.input.charCodeAt(e.position+1));)if(l=!0,e.position++,Fe(e,!0,-1)&&e.lineIndent<=t)a.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,Ue(e,t,re,!1,!0),a.push(e.result),Fe(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)Ie(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!l&&(e.tag=o,e.anchor=r,e.kind="sequence",e.result=a,!0)}function qe(e){var t,n,i,o,r=!1,a=!1;if(33!==(o=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&Ie(e,"duplication of a tag property"),60===(o=e.input.charCodeAt(++e.position))?(r=!0,o=e.input.charCodeAt(++e.position)):33===o?(a=!0,n="!!",o=e.input.charCodeAt(++e.position)):n="!",t=e.position,r){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&62!==o);e.position<e.length?(i=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):Ie(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==o&&!be(o);)33===o&&(a?Ie(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),de.test(n)||Ie(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),fe.test(i)&&Ie(e,"tag suffix cannot contain flow indicator characters")}i&&!he.test(i)&&Ie(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch(t){Ie(e,"tag name is malformed: "+i)}return r?e.tag=i:ne.call(e.tagMap,n)?e.tag=e.tagMap[n]+i:"!"===n?e.tag="!"+i:"!!"===n?e.tag="tag:yaml.org,2002:"+i:Ie(e,'undeclared tag handle "'+n+'"'),!0}function Re(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&Ie(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!be(n)&&!ve(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Ie(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Ue(e,t,n,i,o){var r,a,l,s,c,u,p,f,d,h=1,m=!1,y=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,r=a=l=ae===n||re===n,i&&Fe(e,!0,-1)&&(m=!0,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)),1===h)for(;qe(e)||Re(e);)Fe(e,!0,-1)?(m=!0,l=r,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)):l=!1;if(l&&(l=m||o),1!==h&&ae!==n||(f=ie===n||oe===n?t:t+1,d=e.position-e.lineStart,1===h?l&&(De(e,d)||function(e,t,n){var i,o,r,a,l,s,c,u=e.tag,p=e.anchor,f={},d=Object.create(null),h=null,g=null,m=null,y=!1,b=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=f),c=e.input.charCodeAt(e.position);0!==c;){if(y||-1===e.firstTabInLine||(e.position=e.firstTabInLine,Ie(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),r=e.line,63!==c&&58!==c||!be(i)){if(a=e.line,l=e.lineStart,s=e.position,!Ue(e,n,oe,!1,!0))break;if(e.line===r){for(c=e.input.charCodeAt(e.position);ye(c);)c=e.input.charCodeAt(++e.position);if(58===c)be(c=e.input.charCodeAt(++e.position))||Ie(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Le(e,f,d,h,g,null,a,l,s),h=g=m=null),b=!0,y=!1,o=!1,h=e.tag,g=e.result;else{if(!b)return e.tag=u,e.anchor=p,!0;Ie(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!b)return e.tag=u,e.anchor=p,!0;Ie(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(y&&(Le(e,f,d,h,g,null,a,l,s),h=g=m=null),b=!0,y=!0,o=!0):y?(y=!1,o=!0):Ie(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,c=i;if((e.line===r||e.lineIndent>t)&&(y&&(a=e.line,l=e.lineStart,s=e.position),Ue(e,t,ae,!0,o)&&(y?g=e.result:m=e.result),y||(Le(e,f,d,h,g,m,a,l,s),h=g=m=null),Fe(e,!0,-1),c=e.input.charCodeAt(e.position)),(e.line===r||e.lineIndent>t)&&0!==c)Ie(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Le(e,f,d,h,g,null,a,l,s),b&&(e.tag=u,e.anchor=p,e.kind="mapping",e.result=f),b}(e,d,f))||function(e,t){var n,i,o,r,a,l,s,c,u,p,f,d,h=!0,g=e.tag,m=e.anchor,y=Object.create(null);if(91===(d=e.input.charCodeAt(e.position)))a=93,c=!1,r=[];else{if(123!==d)return!1;a=125,c=!0,r={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=r),d=e.input.charCodeAt(++e.position);0!==d;){if(Fe(e,!0,t),(d=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=g,e.anchor=m,e.kind=c?"mapping":"sequence",e.result=r,!0;h?44===d&&Ie(e,"expected the node content, but found ','"):Ie(e,"missed comma between flow collection entries"),f=null,l=s=!1,63===d&&be(e.input.charCodeAt(e.position+1))&&(l=s=!0,e.position++,Fe(e,!0,t)),n=e.line,i=e.lineStart,o=e.position,Ue(e,t,ie,!1,!0),p=e.tag,u=e.result,Fe(e,!0,t),d=e.input.charCodeAt(e.position),!s&&e.line!==n||58!==d||(l=!0,d=e.input.charCodeAt(++e.position),Fe(e,!0,t),Ue(e,t,ie,!1,!0),f=e.result),c?Le(e,r,y,p,u,f,n,i,o):l?r.push(Le(e,null,y,p,u,f,n,i,o)):r.push(u),Fe(e,!0,t),44===(d=e.input.charCodeAt(e.position))?(h=!0,d=e.input.charCodeAt(++e.position)):h=!1}Ie(e,"unexpected end of the stream within a flow collection")}(e,f)?y=!0:(a&&function(e,t){var n,i,o,r,a,l=le,s=!1,c=!1,u=t,p=0,f=!1;if(124===(r=e.input.charCodeAt(e.position)))i=!1;else{if(62!==r)return!1;i=!0}for(e.kind="scalar",e.result="";0!==r;)if(43===(r=e.input.charCodeAt(++e.position))||45===r)le===l?l=43===r?ce:se:Ie(e,"repeat of a chomping mode identifier");else{if(!((o=48<=(a=r)&&a<=57?a-48:-1)>=0))break;0===o?Ie(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Ie(e,"repeat of an indentation width identifier"):(u=t+o-1,c=!0)}if(ye(r)){do{r=e.input.charCodeAt(++e.position)}while(ye(r));if(35===r)do{r=e.input.charCodeAt(++e.position)}while(!me(r)&&0!==r)}for(;0!==r;){for(Me(e),e.lineIndent=0,r=e.input.charCodeAt(e.position);(!c||e.lineIndent<u)&&32===r;)e.lineIndent++,r=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>u&&(u=e.lineIndent),me(r))p++;else{if(e.lineIndent<u){l===ce?e.result+=g.repeat("\n",s?1+p:p):l===le&&s&&(e.result+="\n");break}for(i?ye(r)?(f=!0,e.result+=g.repeat("\n",s?1+p:p)):f?(f=!1,e.result+=g.repeat("\n",p+1)):0===p?s&&(e.result+=" "):e.result+=g.repeat("\n",p):e.result+=g.repeat("\n",s?1+p:p),s=!0,c=!0,p=0,n=e.position;!me(r)&&0!==r;)r=e.input.charCodeAt(++e.position);Ee(e,n,e.position,!1)}}return!0}(e,f)||function(e,t){var n,i,o;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(Ee(e,i,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;i=e.position,e.position++,o=e.position}else me(n)?(Ee(e,i,o,!0),Ze(e,Fe(e,!1,t)),i=o=e.position):e.position===e.lineStart&&$e(e)?Ie(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);Ie(e,"unexpected end of the stream within a single quoted scalar")}(e,f)||function(e,t){var n,i,o,r,a,l,s;if(34!==(l=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(l=e.input.charCodeAt(e.position));){if(34===l)return Ee(e,n,e.position,!0),e.position++,!0;if(92===l){if(Ee(e,n,e.position,!0),me(l=e.input.charCodeAt(++e.position)))Fe(e,!1,t);else if(l<256&&xe[l])e.result+=Ce[l],e.position++;else if((a=120===(s=l)?2:117===s?4:85===s?8:0)>0){for(o=a,r=0;o>0;o--)(a=we(l=e.input.charCodeAt(++e.position)))>=0?r=(r<<4)+a:Ie(e,"expected hexadecimal character");e.result+=ke(r),e.position++}else Ie(e,"unknown escape sequence");n=i=e.position}else me(l)?(Ee(e,n,i,!0),Ze(e,Fe(e,!1,t)),n=i=e.position):e.position===e.lineStart&&$e(e)?Ie(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}Ie(e,"unexpected end of the stream within a double quoted scalar")}(e,f)?y=!0:function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!be(i)&&!ve(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&Ie(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),ne.call(e.anchorMap,n)||Ie(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],Fe(e,!0,-1),!0}(e)?(y=!0,null===e.tag&&null===e.anchor||Ie(e,"alias node should not have any properties")):function(e,t,n){var i,o,r,a,l,s,c,u,p=e.kind,f=e.result;if(be(u=e.input.charCodeAt(e.position))||ve(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(be(i=e.input.charCodeAt(e.position+1))||n&&ve(i)))return!1;for(e.kind="scalar",e.result="",o=r=e.position,a=!1;0!==u;){if(58===u){if(be(i=e.input.charCodeAt(e.position+1))||n&&ve(i))break}else if(35===u){if(be(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&$e(e)||n&&ve(u))break;if(me(u)){if(l=e.line,s=e.lineStart,c=e.lineIndent,Fe(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=r,e.line=l,e.lineStart=s,e.lineIndent=c;break}}a&&(Ee(e,o,r,!1),Ze(e,e.line-l),o=r=e.position,a=!1),ye(u)||(r=e.position+1),u=e.input.charCodeAt(++e.position)}return Ee(e,o,r,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,f,ie===n)&&(y=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===h&&(y=l&&De(e,d))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&Ie(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),s=0,c=e.implicitTypes.length;s<c;s+=1)if((p=e.implicitTypes[s]).resolve(e.result)){e.result=p.construct(e.result),e.tag=p.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(ne.call(e.typeMap[e.kind||"fallback"],e.tag))p=e.typeMap[e.kind||"fallback"][e.tag];else for(p=null,s=0,c=(u=e.typeMap.multi[e.kind||"fallback"]).length;s<c;s+=1)if(e.tag.slice(0,u[s].tag.length)===u[s].tag){p=u[s];break}p||Ie(e,"unknown tag !<"+e.tag+">"),null!==e.result&&p.kind!==e.kind&&Ie(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+p.kind+'", not "'+e.kind+'"'),p.resolve(e.result,e.tag)?(e.result=p.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):Ie(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||y}function Ye(e){var t,n,i,o,r=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(o=e.input.charCodeAt(e.position))&&(Fe(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==o));){for(a=!0,o=e.input.charCodeAt(++e.position),t=e.position;0!==o&&!be(o);)o=e.input.charCodeAt(++e.position);for(i=[],(n=e.input.slice(t,e.position)).length<1&&Ie(e,"directive name must not be less than one character in length");0!==o;){for(;ye(o);)o=e.input.charCodeAt(++e.position);if(35===o){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&!me(o));break}if(me(o))break;for(t=e.position;0!==o&&!be(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}0!==o&&Me(e),ne.call(Te,n)?Te[n](e,n,i):_e(e,'unknown document directive "'+n+'"')}Fe(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,Fe(e,!0,-1)):a&&Ie(e,"directives end mark is expected"),Ue(e,e.lineIndent-1,ae,!1,!0),Fe(e,!0,-1),e.checkLineBreaks&&pe.test(e.input.slice(r,e.position))&&_e(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&$e(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,Fe(e,!0,-1)):e.position<e.length-1&&Ie(e,"end of the stream or a document separator is expected")}function Be(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new Oe(e,t),i=e.indexOf("\0");for(-1!==i&&(n.position=i,Ie(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Ye(n);return n.documents}var Pe={loadAll:function(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var i=Be(e,n);if("function"!=typeof t)return i;for(var o=0,r=i.length;o<r;o+=1)t(i[o])},load:function(e,t){var n=Be(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new b("expected a single document in the stream, but found more")}}},Ve=Object.prototype.toString,We=Object.prototype.hasOwnProperty,Ge=65279,Ke=9,He=10,Je=13,ze=32,Xe=33,Qe=34,et=35,tt=37,nt=38,it=39,ot=42,rt=44,at=45,lt=58,st=61,ct=62,ut=63,pt=64,ft=91,dt=93,ht=96,gt=123,mt=124,yt=125,bt={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},vt=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],wt=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function At(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else{if(!(e<=4294967295))throw new b("code point within a string may not be greater than 0xFFFFFFFF");n="U",i=8}return"\\"+n+g.repeat("0",i-t.length)+t}var kt=2;function xt(e){this.schema=e.schema||te,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=g.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,i,o,r,a,l,s;if(null===t)return{};for(n={},o=0,r=(i=Object.keys(t)).length;o<r;o+=1)a=i[o],l=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(s=e.compiledTypeMap.fallback[a])&&We.call(s.styleAliases,l)&&(l=s.styleAliases[l]),n[a]=l;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType='"'===e.quotingType?kt:1,this.forceQuotes=e.forceQuotes||!1,this.replacer="function"==typeof e.replacer?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ct(e,t){for(var n,i=g.repeat(" ",t),o=0,r=-1,a="",l=e.length;o<l;)-1===(r=e.indexOf("\n",o))?(n=e.slice(o),o=l):(n=e.slice(o,r+1),o=r+1),n.length&&"\n"!==n&&(a+=i),a+=n;return a}function St(e,t){return"\n"+g.repeat(" ",e.indent*t)}function Ot(e){return e===ze||e===Ke}function jt(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&e!==Ge||65536<=e&&e<=1114111}function It(e){return jt(e)&&e!==Ge&&e!==Je&&e!==He}function _t(e,t,n){var i=It(e),o=i&&!Ot(e);return(n?i:i&&e!==rt&&e!==ft&&e!==dt&&e!==gt&&e!==yt)&&e!==et&&!(t===lt&&!o)||It(t)&&!Ot(t)&&e===et||t===lt&&o}function Tt(e,t){var n,i=e.charCodeAt(t);return i>=55296&&i<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1))>=56320&&n<=57343?1024*(i-55296)+n-56320+65536:i}function Et(e){return/^\n* /.test(e)}var Nt=1,Lt=2,Mt=3,Ft=4,$t=5;function Zt(e,t,n,i,o){e.dump=function(){if(0===t.length)return e.quotingType===kt?'""':"''";if(!e.noCompatMode&&(-1!==vt.indexOf(t)||wt.test(t)))return e.quotingType===kt?'"'+t+'"':"'"+t+"'";var r=e.indent*Math.max(1,n),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-r),l=i||e.flowLevel>-1&&n>=e.flowLevel;switch(function(e,t,n,i,o,r,a,l){var s,c,u=0,p=null,f=!1,d=!1,h=-1!==i,g=-1,m=jt(c=Tt(e,0))&&c!==Ge&&!Ot(c)&&c!==at&&c!==ut&&c!==lt&&c!==rt&&c!==ft&&c!==dt&&c!==gt&&c!==yt&&c!==et&&c!==nt&&c!==ot&&c!==Xe&&c!==mt&&c!==st&&c!==ct&&c!==it&&c!==Qe&&c!==tt&&c!==pt&&c!==ht&&function(e){return!Ot(e)&&e!==lt}(Tt(e,e.length-1));if(t||a)for(s=0;s<e.length;u>=65536?s+=2:s++){if(!jt(u=Tt(e,s)))return $t;m=m&&_t(u,p,l),p=u}else{for(s=0;s<e.length;u>=65536?s+=2:s++){if((u=Tt(e,s))===He)f=!0,h&&(d=d||s-g-1>i&&" "!==e[g+1],g=s);else if(!jt(u))return $t;m=m&&_t(u,p,l),p=u}d=d||h&&s-g-1>i&&" "!==e[g+1]}return f||d?n>9&&Et(e)?$t:a?r===kt?$t:Lt:d?Ft:Mt:!m||a||o(e)?r===kt?$t:Lt:Nt}(t,l,e.indent,a,(function(t){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n<i;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)}),e.quotingType,e.forceQuotes&&!i,o)){case Nt:return t;case Lt:return"'"+t.replace(/'/g,"''")+"'";case Mt:return"|"+Dt(t,e.indent)+qt(Ct(t,r));case Ft:return">"+Dt(t,e.indent)+qt(Ct(function(e,t){for(var n,i,o,r=/(\n+)([^\n]*)/g,a=(o=-1!==(o=e.indexOf("\n"))?o:e.length,r.lastIndex=o,Rt(e.slice(0,o),t)),l="\n"===e[0]||" "===e[0];i=r.exec(e);){var s=i[1],c=i[2];n=" "===c[0],a+=s+(l||n||""===c?"":"\n")+Rt(c,t),l=n}return a}(t,a),r));case $t:return'"'+function(e){for(var t,n="",i=0,o=0;o<e.length;i>=65536?o+=2:o++)i=Tt(e,o),!(t=bt[i])&&jt(i)?(n+=e[o],i>=65536&&(n+=e[o+1])):n+=t||At(i);return n}(t)+'"';default:throw new b("impossible error: invalid scalar style")}}()}function Dt(e,t){var n=Et(e)?String(t):"",i="\n"===e[e.length-1];return n+(!i||"\n"!==e[e.length-2]&&"\n"!==e?i?"":"-":"+")+"\n"}function qt(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function Rt(e,t){if(""===e||" "===e[0])return e;for(var n,i,o=/ [^ ]/g,r=0,a=0,l=0,s="";n=o.exec(e);)(l=n.index)-r>t&&(i=a>r?a:l,s+="\n"+e.slice(r,i),r=i+1),a=l;return s+="\n",e.length-r>t&&a>r?s+=e.slice(r,a)+"\n"+e.slice(a+1):s+=e.slice(r),s.slice(1)}function Ut(e,t,n,i){var o,r,a,l="",s=e.tag;for(o=0,r=n.length;o<r;o+=1)a=n[o],e.replacer&&(a=e.replacer.call(n,String(o),a)),(Bt(e,t+1,a,!0,!0,!1,!0)||void 0===a&&Bt(e,t+1,null,!0,!0,!1,!0))&&(i&&""===l||(l+=St(e,t)),e.dump&&He===e.dump.charCodeAt(0)?l+="-":l+="- ",l+=e.dump);e.tag=s,e.dump=l||"[]"}function Yt(e,t,n){var i,o,r,a,l,s;for(r=0,a=(o=n?e.explicitTypes:e.implicitTypes).length;r<a;r+=1)if(((l=o[r]).instanceOf||l.predicate)&&(!l.instanceOf||"object"==typeof t&&t instanceof l.instanceOf)&&(!l.predicate||l.predicate(t))){if(n?l.multi&&l.representName?e.tag=l.representName(t):e.tag=l.tag:e.tag="?",l.represent){if(s=e.styleMap[l.tag]||l.defaultStyle,"[object Function]"===Ve.call(l.represent))i=l.represent(t,s);else{if(!We.call(l.represent,s))throw new b("!<"+l.tag+'> tag resolver accepts not "'+s+'" style');i=l.represent[s](t,s)}e.dump=i}return!0}return!1}function Bt(e,t,n,i,o,r,a){e.tag=null,e.dump=n,Yt(e,n,!1)||Yt(e,n,!0);var l,s=Ve.call(e.dump),c=i;i&&(i=e.flowLevel<0||e.flowLevel>t);var u,p,f="[object Object]"===s||"[object Array]"===s;if(f&&(p=-1!==(u=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||p||2!==e.indent&&t>0)&&(o=!1),p&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(f&&p&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),"[object Object]"===s)i&&0!==Object.keys(e.dump).length?(function(e,t,n,i){var o,r,a,l,s,c,u="",p=e.tag,f=Object.keys(n);if(!0===e.sortKeys)f.sort();else if("function"==typeof e.sortKeys)f.sort(e.sortKeys);else if(e.sortKeys)throw new b("sortKeys must be a boolean or a function");for(o=0,r=f.length;o<r;o+=1)c="",i&&""===u||(c+=St(e,t)),l=n[a=f[o]],e.replacer&&(l=e.replacer.call(n,a,l)),Bt(e,t+1,a,!0,!0,!0)&&((s=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&He===e.dump.charCodeAt(0)?c+="?":c+="? "),c+=e.dump,s&&(c+=St(e,t)),Bt(e,t+1,l,!0,s)&&(e.dump&&He===e.dump.charCodeAt(0)?c+=":":c+=": ",u+=c+=e.dump));e.tag=p,e.dump=u||"{}"}(e,t,e.dump,o),p&&(e.dump="&ref_"+u+e.dump)):(function(e,t,n){var i,o,r,a,l,s="",c=e.tag,u=Object.keys(n);for(i=0,o=u.length;i<o;i+=1)l="",""!==s&&(l+=", "),e.condenseFlow&&(l+='"'),a=n[r=u[i]],e.replacer&&(a=e.replacer.call(n,r,a)),Bt(e,t,r,!1,!1)&&(e.dump.length>1024&&(l+="? "),l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Bt(e,t,a,!1,!1)&&(s+=l+=e.dump));e.tag=c,e.dump="{"+s+"}"}(e,t,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if("[object Array]"===s)i&&0!==e.dump.length?(e.noArrayIndent&&!a&&t>0?Ut(e,t-1,e.dump,o):Ut(e,t,e.dump,o),p&&(e.dump="&ref_"+u+e.dump)):(function(e,t,n){var i,o,r,a="",l=e.tag;for(i=0,o=n.length;i<o;i+=1)r=n[i],e.replacer&&(r=e.replacer.call(n,String(i),r)),(Bt(e,t,r,!1,!1)||void 0===r&&Bt(e,t,null,!1,!1))&&(""!==a&&(a+=","+(e.condenseFlow?"":" ")),a+=e.dump);e.tag=l,e.dump="["+a+"]"}(e,t,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else{if("[object String]"!==s){if("[object Undefined]"===s)return!1;if(e.skipInvalid)return!1;throw new b("unacceptable kind of an object to dump "+s)}"?"!==e.tag&&Zt(e,e.dump,t,r,c)}null!==e.tag&&"?"!==e.tag&&(l=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),l="!"===e.tag[0]?"!"+l:"tag:yaml.org,2002:"===l.slice(0,18)?"!!"+l.slice(18):"!<"+l+">",e.dump=l+" "+e.dump)}return!0}function Pt(e,t){var n,i,o=[],r=[];for(Vt(e,o,r),n=0,i=r.length;n<i;n+=1)t.duplicates.push(o[r[n]]);t.usedDuplicates=new Array(i)}function Vt(e,t,n){var i,o,r;if(null!==e&&"object"==typeof e)if(-1!==(o=t.indexOf(e)))-1===n.indexOf(o)&&n.push(o);else if(t.push(e),Array.isArray(e))for(o=0,r=e.length;o<r;o+=1)Vt(e[o],t,n);else for(o=0,r=(i=Object.keys(e)).length;o<r;o+=1)Vt(e[i[o]],t,n)}function Wt(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}const Gt={Type:C,Schema:j,FAILSAFE_SCHEMA:E,JSON_SCHEMA:R,CORE_SCHEMA:U,DEFAULT_SCHEMA:te,load:Pe.load,loadAll:Pe.loadAll,dump:function(e,t){var n=new xt(t=t||{});n.noRefs||Pt(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),Bt(n,0,i,!0,!0)?n.dump+"\n":""},YAMLException:b,types:{binary:G,float:q,map:T,null:N,pairs:X,set:ee,timestamp:P,bool:L,int:$,merge:V,omap:J,seq:_,str:I},safeLoad:Wt("safeLoad","load"),safeLoadAll:Wt("safeLoadAll","loadAll"),safeDump:Wt("safeDump","dump")};var Kt;function Ht(e,t){return"function"==typeof t?t.toString():["",null].includes(t)||"object"==typeof t&&(0===t.length||0===Object.keys(t).length)?void 0:t}function Jt(e){const t={get(e,t,n){const i=Reflect.get(e,t,n);return"object"==typeof i&&null!==i?Array.isArray(i)?i.map((e=>Jt(e))):Jt(i):`{${t}}`}};return Array.isArray(e)?e.map((e=>Jt(e))):new Proxy(e,t)}function zt(e){let t;if("object"==typeof e.state){const n=Jt(e.state);t=e.view(n)}else t=e.view(e.state);return t}function Xt(e){const t=window.open("","_apprun_debug","toolbar=0");t.document.write(`<html>\n <title>AppRun Analyzer | ${document.location.href}</title>\n <style>\n body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI" }\n li { margin-left: 80px; }\n </style>\n <body>\n <div id="main">${e}</div>\n <\/script>\n </body>\n </html>`),t.document.close()}e.Z.debug=!0,window["_apprun-help"]=["",()=>{Object.keys(window).forEach((e=>{e.startsWith("_apprun-")&&("_apprun-help"===e?console.log("AppRun Commands:"):console.log(`* ${e.substring(8)}: ${window[e][0]}`))}))}];const Qt=()=>{const t={components:{}};e.Z.run("get-components",t);const{components:n}=t;return n};let en=Number(null===(Kt=null===window||void 0===window?void 0:window.localStorage)||void 0===Kt?void 0:Kt.getItem("__apprun_debugging__"))||0;if(e.Z.on("debug",(e=>{1&en&&e.event&&console.log(e),2&en&&e.vdom&&console.log(e)})),window["_apprun-components"]=["components [print]",t=>{(t=>{const n=Qt(),i=[];if(n instanceof Map)for(let[e,t]of n){const n="string"==typeof e?document.getElementById(e)||document.querySelector(e):e;i.push({element:n,comps:t})}else Object.keys(n).forEach((e=>{const t="string"==typeof e?document.getElementById(e)||document.querySelector(e):e;i.push({element:t,comps:n[e]})}));if(t){const t=(t=>{const n=({components:t})=>e.Z.h("ul",null,t.map((t=>{const n=zt(t),i=t._actions.map((e=>e.name)),o={state:t.state,view:n,actions:i,update:t.update};return e.Z.h("li",null,e.Z.h("div",null,t.constructor.name),e.Z.h("div",null,e.Z.h("pre",null,(r=Gt.dump(o,{replacer:Ht}))?r.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"):r)),e.Z.h("br",null));var r})));return e.Z.h("ul",null,t.map((({element:t,comps:i})=>e.Z.h("li",null,e.Z.h("div",null,(t=>e.Z.h("div",null,t.tagName.toLowerCase(),t.id?"#"+t.id:""," ",t.className&&t.className.split(" ").map((e=>"."+e)).join()))(t)),e.Z.h(n,{components:i})))))})(i);Xt(a(t))}else i.forEach((({element:e,comps:t})=>console.log(e,t)))})("print"===t)}],window["_apprun-events"]=["events [print]",t=>{(t=>{const n=e.Z._events,i={},o=Qt(),r=e=>e._actions.forEach((t=>{i[t.name]=i[t.name]||[],i[t.name].push(e)}));if(o instanceof Map)for(let[e,t]of o)t.forEach(r);else Object.keys(o).forEach((e=>o[e].forEach(r)));const l=[];if(Object.keys(i).forEach((e=>{l.push({event:e,components:i[e],global:!!n[e]})})),l.sort(((e,t)=>e.event>t.event?1:-1)).map((e=>e.event)),t){const t=(t=>{const n=({components:t})=>e.Z.h("ul",null,t.map((t=>e.Z.h("li",null,e.Z.h("div",null,t.constructor.name))))),i=({events:t,global:i})=>e.Z.h("ul",null,t&&t.filter((e=>e.global===i&&"."!==e.event)).map((({event:t,components:i})=>e.Z.h("li",null,e.Z.h("div",null,t),e.Z.h(n,{components:i})))));return e.Z.h("div",null,e.Z.h("div",null,"GLOBAL EVENTS"),e.Z.h(i,{events:t,global:!0}),e.Z.h("div",null,"LOCAL EVENTS"),e.Z.h(i,{events:t,global:!1}))})(l);Xt(a(t))}else console.log("=== GLOBAL EVENTS ==="),l.filter((e=>e.global&&"."!==e.event)).forEach((({event:e,components:t})=>console.log({event:e},t))),console.log("=== LOCAL EVENTS ==="),l.filter((e=>!e.global&&"."!==e.event)).forEach((({event:e,components:t})=>console.log({event:e},t)))})("print"===t)}],window["_apprun-log"]=["log [event|view] on|off",(e,t)=>{var n;"on"===e?en=3:"off"===e?en=0:"event"===e?"on"===t?en|=1:"off"===t&&(en&=-2):"view"===e&&("on"===t?en|=2:"off"===t&&(en&=-3)),console.log(`* log ${e} ${t||""}`),null===(n=null===window||void 0===window?void 0:window.localStorage)||void 0===n||n.setItem("__apprun_debugging__",`${en}`)}],window["_apprun-create-event-tests"]=["create-event-tests",()=>(()=>{const e={components:{}};app.run("get-components",e);const{components:t}=e;if(s(""),t instanceof Map)for(let[e,n]of t)n.forEach(p);else Object.keys(t).forEach((e=>{t[e].forEach(p)}));u()})()],window["_apprun-create-state-tests"]=["create-state-tests <start|stop>",e=>{var t;"start"===(t=e)?(d=[],f=!0,console.log("* State logging started.")):"stop"===t?(0!==d.length?(s(""),d.forEach(((e,t)=>{c(` it ('view snapshot: #${t+1}', ()=>{`),c(` const component = new ${e.component.constructor.name}()`),c(` const state = ${JSON.stringify(e.state,void 0,2)};`),c(" const vdom = component['view'](state);"),c(" expect(JSON.stringify(vdom)).toMatchSnapshot();"),c(" })")})),u()):console.log("* No state recorded."),f=!1,d=[],console.log("* State logging stopped.")):console.log("create-state-tests <start|stop>")}],window._apprun=e=>{const[t,...n]=e[0].split(" ").filter((e=>!!e)),i=window[`_apprun-${t}`];i?i[1](...n):window["_apprun-help"][1]()},console.info('AppRun DevTools 2.27: type "_apprun `help`" to list all available commands.'),window.__REDUX_DEVTOOLS_EXTENSION__){let t=!1;const n=window.__REDUX_DEVTOOLS_EXTENSION__.connect();if(n){const i=location.hash||"#";n.send(i,"");const o=[{component:null,state:""}];console.info("Connected to the Redux DevTools"),n.subscribe((n=>{if("START"===n.type)t=!0;else if("STOP"===n.type)t=!1;else if("DISPATCH"===n.type){const t=n.payload.index;if(0===t)e.Z.run(i);else{const{component:e,state:n}=o[t];null==e||e.setState(n)}}}));const r=(e,t,i)=>{null!=i&&(o.push({component:e,state:i}),n.send(t,i))};e.Z.on("debug",(e=>{if(t&&e.event){const t=e.newState,n={type:e.event,payload:e.p},i=e.component;t instanceof Promise?t.then((e=>r(i,n,e))):r(i,n,t)}}))}}})(),i})()));
|
|
2
3
|
//# sourceMappingURL=apprun-dev-tools.js.map
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
4
|
-
* This code may only be used under the BSD style license found at
|
|
5
|
-
* http://polymer.github.io/LICENSE.txt
|
|
6
|
-
* The complete set of authors may be found at
|
|
7
|
-
* http://polymer.github.io/AUTHORS.txt
|
|
8
|
-
* The complete set of contributors may be found at
|
|
9
|
-
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
10
|
-
* Code distributed by Google as part of the polymer project is also
|
|
11
|
-
* subject to an additional IP rights grant found at
|
|
12
|
-
* http://polymer.github.io/PATENTS.txt
|
|
13
|
-
*/
|
|
1
|
+
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|