first commit
This commit is contained in:
commit
604fef891f
8368 files changed
+1285228
No files matched your search
+1
@@ -0,0 +1 @@
|
||||
const e=/^(?:( )+|\t+)/,t=`space`;function n(e,n,r){return e&&n===t&&r===1}function r(r,a){let o=new Map,s=0,c,l;for(let u of r.split(/\n/g)){if(!u)continue;let r=u.match(e);if(r===null)s=0,c=``;else{let e=r[0].length,u=r[1]?t:`tab`;if(n(a,u,e))continue;u!==c&&(s=0),c=u;let d=1,f=0,p=e-s;if(s=e,p===0)d=0,f=1;else{let e=Math.abs(p);if(n(a,u,e))continue;l=i(u,e)}let m=o.get(l);o.set(l,m===void 0?[1,0]:[m[0]+d,m[1]+f])}}return o}function i(e,n){return(e===t?`s`:`t`)+String(n)}function a(e){return{type:e[0]===`s`?t:`tab`,amount:Number(e.slice(1))}}function o(e){let t,n=0,r=0;for(let[i,[a,o]]of e)(a>n||a===n&&o>r)&&(n=a,r=o,t=i);return t}function s(e,n){return(e===t?` `:` `).repeat(n)}function c(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);let t=r(e,!0);t.size===0&&(t=r(e,!1));let n=o(t),i,c=0,l=``;return n!==void 0&&({type:i,amount:c}=a(n),l=s(i,c)),{amount:c,type:i,indent:l}}export{c as t};
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import{t as e}from"../rolldown-runtime.mjs";var t=e(((e,t)=>{let{hasOwnProperty:n}=Object.prototype,r=(e,t={})=>{typeof t==`string`&&(t={section:t}),t.align=t.align===!0,t.newline=t.newline===!0,t.sort=t.sort===!0,t.whitespace=t.whitespace===!0||t.align===!0,t.platform=t.platform||typeof process<`u`&&process.platform,t.bracketedArray=t.bracketedArray!==!1;let n=t.platform===`win32`?`\r
|
||||
`:`
|
||||
`,a=t.whitespace?` = `:`=`,o=[],c=t.sort?Object.keys(e).sort():Object.keys(e),l=0;t.align&&(l=s(c.filter(t=>e[t]===null||Array.isArray(e[t])||typeof e[t]!=`object`).map(t=>Array.isArray(e[t])?`${t}[]`:t).concat([``]).reduce((e,t)=>s(e).length>=s(t).length?e:t)).length);let u=``,d=t.bracketedArray?`[]`:``;for(let t of c){let r=e[t];if(r&&Array.isArray(r))for(let e of r)u+=s(`${t}${d}`).padEnd(l,` `)+a+s(e)+n;else r&&typeof r==`object`?o.push(t):u+=s(t).padEnd(l,` `)+a+s(r)+n}t.section&&u.length&&(u=`[`+s(t.section)+`]`+(t.newline?n+n:n)+u);for(let a of o){let o=i(a,`.`).join(`\\.`),s=(t.section?t.section+`.`:``)+o,c=r(e[a],{...t,section:s});u.length&&c.length&&(u+=n),u+=c}return u};function i(e,t){var n=0,r=0,i=0,a=[];do if(i=e.indexOf(t,n),i!==-1){if(n=i+t.length,i>0&&e[i-1]===`\\`)continue;a.push(e.slice(r,i)),r=i+t.length}while(i!==-1);return a.push(e.slice(r)),a}let a=(e,t={})=>{t.bracketedArray=t.bracketedArray!==!1;let r=Object.create(null),a=r,o=null,s=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,l=e.split(/[\r\n]+/g),u={};for(let e of l){if(!e||e.match(/^\s*[;#]/)||e.match(/^\s*$/))continue;let i=e.match(s);if(!i)continue;if(i[1]!==void 0){if(o=c(i[1]),o===`__proto__`){a=Object.create(null);continue}a=r[o]=r[o]||Object.create(null);continue}let l=c(i[2]),d;t.bracketedArray?d=l.length>2&&l.slice(-2)===`[]`:(u[l]=(u?.[l]||0)+1,d=u[l]>1);let f=d&&l.endsWith(`[]`)?l.slice(0,-2):l;if(f===`__proto__`)continue;let p=i[3]?c(i[4]):!0,m=p===`true`||p===`false`||p===`null`?JSON.parse(p):p;d&&(n.call(a,f)?Array.isArray(a[f])||(a[f]=[a[f]]):a[f]=[]),Array.isArray(a[f])?a[f].push(m):a[f]=m}let d=[];for(let e of Object.keys(r)){if(!n.call(r,e)||typeof r[e]!=`object`||Array.isArray(r[e]))continue;let t=i(e,`.`);a=r;let o=t.pop(),s=o.replace(/\\\./g,`.`);for(let e of t)e!==`__proto__`&&((!n.call(a,e)||typeof a[e]!=`object`)&&(a[e]=Object.create(null)),a=a[e]);a===r&&s===o||(a[s]=r[e],d.push(e))}for(let e of d)delete r[e];return r},o=e=>e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`),s=e=>typeof e!=`string`||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&o(e)||e!==e.trim()?JSON.stringify(e):e.split(`;`).join(`\\;`).split(`#`).join(`\\#`),c=e=>{if(e=(e||``).trim(),o(e)){e.charAt(0)===`'`&&(e=e.slice(1,-1));try{e=JSON.parse(e)}catch{}}else{let t=!1,n=``;for(let r=0,i=e.length;r<i;r++){let i=e.charAt(r);if(t)`\\;#`.indexOf(i)===-1?n+=`\\`+i:n+=i,t=!1;else if(`;#`.indexOf(i)!==-1)break;else i===`\\`?t=!0:n+=i}return t&&(n+=`\\`),n.trim()}return e};t.exports={parse:a,decode:a,stringify:r,encode:r,safe:s,unsafe:c}}));export{t};
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
|
||||
function e(e){return e==null}function t(e){return typeof e==`object`&&!!e}function n(t){return Array.isArray(t)?t:e(t)?[]:[t]}function r(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function i(e,t){var n=``,r;for(r=0;r<t;r+=1)n+=e;return n}function a(e){return e===0&&1/e==-1/0}var o={isNothing:e,isObject:t,toArray:n,repeat:i,isNegativeZero:a,extend:r};function s(e,t){var n=``,r=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+=`
|
||||
|
||||
`+e.mark.snippet),r+` `+n):r}function c(e,t){Error.call(this),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=s(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``}c.prototype=Object.create(Error.prototype),c.prototype.constructor=c,c.prototype.toString=function(e){return this.name+`: `+s(this,e)};var l=c;function u(e,t,n,r,i){var a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function d(e,t){return o.repeat(` `,t-e.length)+e}function f(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||=79,typeof t.indent!=`number`&&(t.indent=1),typeof t.linesBefore!=`number`&&(t.linesBefore=3),typeof t.linesAfter!=`number`&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],a,s=-1;a=n.exec(e.buffer);)i.push(a.index),r.push(a.index+a[0].length),e.position<=a.index&&s<0&&(s=r.length-2);s<0&&(s=r.length-1);var c=``,l,f,p=Math.min(e.line+t.linesAfter,i.length).toString().length,m=t.maxLength-(t.indent+p+3);for(l=1;l<=t.linesBefore&&!(s-l<0);l++)f=u(e.buffer,r[s-l],i[s-l],e.position-(r[s]-r[s-l]),m),c=o.repeat(` `,t.indent)+d((e.line-l+1).toString(),p)+` | `+f.str+`
|
||||
`+c;for(f=u(e.buffer,r[s],i[s],e.position,m),c+=o.repeat(` `,t.indent)+d((e.line+1).toString(),p)+` | `+f.str+`
|
||||
`,c+=o.repeat(`-`,t.indent+p+3+f.pos)+`^
|
||||
`,l=1;l<=t.linesAfter&&!(s+l>=i.length);l++)f=u(e.buffer,r[s+l],i[s+l],e.position-(r[s]-r[s+l]),m),c+=o.repeat(` `,t.indent)+d((e.line+l+1).toString(),p)+` | `+f.str+`
|
||||
`;return c.replace(/\n$/,``)}var p=f,m=[`kind`,`multi`,`resolve`,`construct`,`instanceOf`,`predicate`,`represent`,`representName`,`defaultStyle`,`styleAliases`],h=[`scalar`,`sequence`,`mapping`];function g(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function _(e,t){if(t||={},Object.keys(t).forEach(function(t){if(m.indexOf(t)===-1)throw new l(`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=g(t.styleAliases||null),h.indexOf(this.kind)===-1)throw new l(`Unknown kind "`+this.kind+`" is specified for "`+e+`" YAML type.`)}var v=_;function ee(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}function te(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(t){t.multi?(e.multi[t.kind].push(t),e.multi.fallback.push(t)):e[t.kind][t.tag]=e.fallback[t.tag]=t}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function y(e){return this.extend(e)}y.prototype.extend=function(e){var t=[],n=[];if(e instanceof v)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new l(`Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })`);t.forEach(function(e){if(!(e instanceof v))throw new l(`Specified list of YAML types (or a single Type object) contains a non-Type object.`);if(e.loadKind&&e.loadKind!==`scalar`)throw new l(`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 l(`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 v))throw new l(`Specified list of YAML types (or a single Type object) contains a non-Type object.`)});var r=Object.create(y.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=ee(r,`implicit`),r.compiledExplicit=ee(r,`explicit`),r.compiledTypeMap=te(r.compiledImplicit,r.compiledExplicit),r};var ne=new y({explicit:[new v(`tag:yaml.org,2002:str`,{kind:`scalar`,construct:function(e){return e===null?``:e}}),new v(`tag:yaml.org,2002:seq`,{kind:`sequence`,construct:function(e){return e===null?[]:e}}),new v(`tag:yaml.org,2002:map`,{kind:`mapping`,construct:function(e){return e===null?{}:e}})]});function re(e){if(e===null)return!0;var t=e.length;return t===1&&e===`~`||t===4&&(e===`null`||e===`Null`||e===`NULL`)}function ie(){return null}function ae(e){return e===null}var oe=new v(`tag:yaml.org,2002:null`,{kind:`scalar`,resolve:re,construct:ie,predicate:ae,represent:{canonical:function(){return`~`},lowercase:function(){return`null`},uppercase:function(){return`NULL`},camelcase:function(){return`Null`},empty:function(){return``}},defaultStyle:`lowercase`});function se(e){if(e===null)return!1;var t=e.length;return t===4&&(e===`true`||e===`True`||e===`TRUE`)||t===5&&(e===`false`||e===`False`||e===`FALSE`)}function ce(e){return e===`true`||e===`True`||e===`TRUE`}function le(e){return Object.prototype.toString.call(e)===`[object Boolean]`}var ue=new v(`tag:yaml.org,2002:bool`,{kind:`scalar`,resolve:se,construct:ce,predicate:le,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 de(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function fe(e){return 48<=e&&e<=55}function pe(e){return 48<=e&&e<=57}function me(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i===`-`||i===`+`)&&(i=e[++n]),i===`0`){if(n+1===t)return!0;if(i=e[++n],i===`b`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(i!==`0`&&i!==`1`)return!1;r=!0}return r&&i!==`_`}if(i===`x`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(!de(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}if(i===`o`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(!fe(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}}if(i===`_`)return!1;for(;n<t;n++)if(i=e[n],i!==`_`){if(!pe(e.charCodeAt(n)))return!1;r=!0}return!(!r||i===`_`)}function he(e){var t=e,n=1,r;if(t.indexOf(`_`)!==-1&&(t=t.replace(/_/g,``)),r=t[0],(r===`-`||r===`+`)&&(r===`-`&&(n=-1),t=t.slice(1),r=t[0]),t===`0`)return 0;if(r===`0`){if(t[1]===`b`)return n*parseInt(t.slice(2),2);if(t[1]===`x`)return n*parseInt(t.slice(2),
Line truncated
|
||||
\r`;function Pe(e){if(e===null)return!1;var t,n,r=0,i=e.length,a=b;for(n=0;n<i;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8==0}function Fe(e){var t,n,r=e.replace(/[\r\n=]/g,``),i=r.length,a=b,o=0,s=[];for(t=0;t<i;t++)t%4==0&&t&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(r.charAt(t));return n=i%4*6,n===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):n===18?(s.push(o>>10&255),s.push(o>>2&255)):n===12&&s.push(o>>4&255),new Uint8Array(s)}function Ie(e){var t=``,n=0,r,i,a=e.length,o=b;for(r=0;r<a;r++)r%3==0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=a%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function Le(e){return Object.prototype.toString.call(e)===`[object Uint8Array]`}var Re=new v(`tag:yaml.org,2002:binary`,{kind:`scalar`,resolve:Pe,construct:Fe,predicate:Le,represent:Ie}),ze=Object.prototype.hasOwnProperty,Be=Object.prototype.toString;function Ve(e){if(e===null)return!0;var t=[],n,r,i,a,o,s=e;for(n=0,r=s.length;n<r;n+=1){if(i=s[n],o=!1,Be.call(i)!==`[object Object]`)return!1;for(a in i)if(ze.call(i,a))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function He(e){return e===null?[]:e}var Ue=new v(`tag:yaml.org,2002:omap`,{kind:`sequence`,resolve:Ve,construct:He}),We=Object.prototype.toString;function Ge(e){if(e===null)return!0;var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],We.call(r)!==`[object Object]`||(i=Object.keys(r),i.length!==1))return!1;a[t]=[i[0],r[i[0]]]}return!0}function Ke(e){if(e===null)return[];var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}var qe=new v(`tag:yaml.org,2002:pairs`,{kind:`sequence`,resolve:Ge,construct:Ke}),Je=Object.prototype.hasOwnProperty;function Ye(e){if(e===null)return!0;var t,n=e;for(t in n)if(Je.call(n,t)&&n[t]!==null)return!1;return!0}function Xe(e){return e===null?{}:e}var Ze=new v(`tag:yaml.org,2002:set`,{kind:`mapping`,resolve:Ye,construct:Xe}),Qe=Te.extend({implicit:[je,Ne],explicit:[Re,Ue,qe,Ze]}),x=Object.prototype.hasOwnProperty,S=1,$e=2,et=3,C=4,w=1,tt=2,nt=3,rt=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,it=/[\x85\u2028\u2029]/,at=/[,\[\]\{\}]/,ot=/^(?:!|!!|![a-z\-]+!)$/i,st=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ct(e){return Object.prototype.toString.call(e)}function T(e){return e===10||e===13}function E(e){return e===9||e===32}function D(e){return e===9||e===32||e===10||e===13}function O(e){return e===44||e===91||e===93||e===123||e===125}function lt(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function ut(e){return e===120?2:e===117?4:e===85?8:0}function dt(e){return 48<=e&&e<=57?e-48:-1}function ft(e){return e===48?`\0`:e===97?`\x07`:e===98?`\b`:e===116||e===9?` `:e===110?`
|
||||
`:e===118?`\v`:e===102?`\f`:e===114?`\r`:e===101?`\x1B`:e===32?` `:e===34?`"`:e===47?`/`:e===92?`\\`:e===78?`
`:e===95?`\xA0`:e===76?`\u2028`:e===80?`\u2029`:``}function pt(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function mt(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}for(var ht=Array(256),gt=Array(256),k=0;k<256;k++)ht[k]=ft(k)?1:0,gt[k]=ft(k);function _t(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Qe,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 vt(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=p(n),new l(t,n)}function A(e,t){throw vt(e,t)}function j(e,t){e.onWarning&&e.onWarning.call(null,vt(e,t))}var yt={YAML:function(e,t,n){var r,i,a;e.version!==null&&A(e,`duplication of %YAML directive`),n.length!==1&&A(e,`YAML directive accepts exactly one argument`),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),r===null&&A(e,`ill-formed argument of the YAML directive`),i=parseInt(r[1],10),a=parseInt(r[2],10),i!==1&&A(e,`unacceptable YAML version of the document`),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&j(e,`unsupported YAML version of the document`)},TAG:function(e,t,n){var r,i;n.length!==2&&A(e,`TAG directive accepts exactly two arguments`),r=n[0],i=n[1],ot.test(r)||A(e,`ill-formed tag handle (first argument) of the TAG directive`),x.call(e.tagMap,r)&&A(e,`there is a previously declared suffix for "`+r+`" tag handle`),st.test(i)||A(e,`ill-formed tag prefix (second argument) of the TAG directive`);try{i=decodeURIComponent(i)}catch{A(e,`tag prefix is malformed: `+i)}e.tagMap[r]=i}};function M(e,t,n,r){var i,a,o,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,a=s.length;i<a;i+=1)o=s.charCodeAt(i),o===9||32<=o&&o<=1114111||A(e,`expected valid JSON character`);else rt.test(s)&&A(e,`the stream contains non-printable characters`);e.result+=s}}function bt(e,t,n,r){var i,a,s,c;for(o.isObject(n)||A(e,`cannot merge mappings; the provided source object is unacceptable`),i=Object.keys(n),s=0,c=i.length;s<c;s+=1)a=i[s],x.call(t,a)||(mt(t,a,n[a]),r[a]=!0)}function N(e,t,n,r,i,a,o,s,c){var l,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),l=0,u=i.length;l<u;l+=1)Array.isArray(i[l])&&A(e,`nested arrays are not supported inside keys`),typeof i==`object`&&ct(i[l])===`[object Object]`&&(i[l]=`[object Object]`);if(typeof i==`object`&&ct(i)===`[object Object]`&&(i=`[object Object]`),i=String(i),t===null&&(t={}),r===`tag:yaml.org,2002:merge`)if(Array.isArray(a))for(l=0,u=a.length;l<u;l+=1)bt(e,t,a[l],n);else bt(e,t,a,n);else !e.json&&!x.call(n,i)&&x.call(t,i)&&(e.line=o||e.line,e.lineStart=s||e.lineStart,e.position=c||e.position,A(e,`duplicated mapping key`)),mt(t,i,a),delete n[i];return t}function P(e){var t=e.input.charCodeAt(e.position);t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):A(e,`a line break is expected`),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function F(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;E(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(T(i))for(P(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&j(e,`deficient indentation`),r}function I(e){var t=e.position,n=e.input.charCodeAt(t);return!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||D(n)))}function L(e,t){t===1?e.result+=` `:t>1&&(e.result+=o.repeat(`
|
||||
`,t-1))}function xt(e,t,n){var r,i,a,o,s,c,l,u,d=e.kind,f=e.result,p=e.input.charCodeAt(e.position);if(D(p)||O(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),D(i)||n&&O(i)))return!1;for(e.kind=`scalar`,e.result=``,a=o=e.position,s=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),D(i)||n&&O(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),D(r))break}else if(e.position===e.lineStart&&I(e)||n&&O(p))break;else if(T(p))if(c=e.line,l=e.lineStart,u=e.lineIndent,F(e,!1,-1),e.lineIndent>=t){s=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=l,e.lineIndent=u;break}s&&=(M(e,a,o,!1),L(e,e.line-c),a=o=e.position,!1),E(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return M(e,a,o,!1),e.result?!0:(e.kind=d,e.result=f,!1)}function St(e,t){var n=e.input.charCodeAt(e.position),r,i;if(n!==39)return!1;for(e.kind=`scalar`,e.result=``,e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(M(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else T(n)?(M(e,r,i,!0),L(e,F(e,!1,t)),r=i=e.position):e.position===e.lineStart&&I(e)?A(e,`unexpected end of the document within a single quoted scalar`):(e.position++,i=e.position);A(e,`unexpected end of the stream within a single quoted scalar`)}function Ct(e,t){var n,r,i,a,o,s=e.input.charCodeAt(e.position);if(s!==34)return!1;for(e.kind=`scalar`,e.result=``,e.position++,n=r=e.position;(s=e.input.charCodeAt(e.position))!==0;)if(s===34)return M(e,n,e.position,!0),e.position++,!0;else if(s===92){if(M(e,n,e.position,!0),s=e.input.charCodeAt(++e.position),T(s))F(e,!1,t);else if(s<256&&ht[s])e.result+=gt[s],e.position++;else if((o=ut(s))>0){for(i=o,a=0;i>0;i--)s=e.input.charCodeAt(++e.position),(o=lt(s))>=0?a=(a<<4)+o:A(e,`expected hexadecimal character`);e.result+=pt(a),e.position++}else A(e,`unknown escape sequence`);n=r=e.position}else T(s)?(M(e,n,r,!0),L(e,F(e,!1,t)),n=r=e.position):e.position===e.lineStart&&I(e)?A(e,`unexpected end of the document within a double quoted scalar`):(e.position++,r=e.position);A(e,`unexpected end of the stream within a double quoted scalar`)}function wt(e,t){var n=!0,r,i,a,o=e.tag,s,c=e.anchor,l,u,d,f,p,m=Object.create(null),h,g,_,v=e.input.charCodeAt(e.position);if(v===91)u=93,p=!1,s=[];else if(v===123)u=125,p=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),v=e.input.charCodeAt(++e.position);v!==0;){if(F(e,!0,t),v=e.input.charCodeAt(e.position),v===u)return e.position++,e.tag=o,e.anchor=c,e.kind=p?`mapping`:`sequence`,e.result=s,!0;n?v===44&&A(e,`expected the node content, but found ','`):A(e,`missed comma between flow collection entries`),g=h=_=null,d=f=!1,v===63&&(l=e.input.charCodeAt(e.position+1),D(l)&&(d=f=!0,e.position++,F(e,!0,t))),r=e.line,i=e.lineStart,a=e.position,R(e,t,S,!1,!0),g=e.tag,h=e.result,F(e,!0,t),v=e.input.charCodeAt(e.position),(f||e.line===r)&&v===58&&(d=!0,v=e.input.charCodeAt(++e.position),F(e,!0,t),R(e,t,S,!1,!0),_=e.result),p?N(e,s,m,g,h,_,r,i,a):d?s.push(N(e,null,m,g,h,_,r,i,a)):s.push(h),F(e,!0,t),v=e.input.charCodeAt(e.position),v===44?(n=!0,v=e.input.charCodeAt(++e.position)):n=!1}A(e,`unexpected end of the stream within a flow collection`)}function Tt(e,t){var n,r,i=w,a=!1,s=!1,c=t,l=0,u=!1,d,f=e.input.charCodeAt(e.position);if(f===124)r=!1;else if(f===62)r=!0;else return!1;for(e.kind=`scalar`,e.result=``;f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)w===i?i=f===43?nt:tt:A(e,`repeat of a chomping mode identifier`);else if((d=dt(f))>=0)d===0?A(e,`bad explicit indentation width of a block scalar; it cannot be less than one`):s?A(e,`repeat of an indentation width identifier`):(c=t+d-1,s=!0);else break;if(E(f)){do f=e.input.charCodeAt(++e.position);while(E(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!T(f)&&f!==0)}for(;f!==0;){for(P(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!s||e.lineIndent<c)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>c&&(c=e.lineIndent),T(f)){l++;continue}if(e.lineIndent<c){i===nt?e.result+=o.repeat(`
|
||||
`,a?1+l:l):i===w&&a&&(e.result+=`
|
||||
`);break}for(r?E(f)?(u=!0,e.result+=o.repeat(`
|
||||
`,a?1+l:l)):u?(u=!1,e.result+=o.repeat(`
|
||||
`,l+1)):l===0?a&&(e.result+=` `):e.result+=o.repeat(`
|
||||
`,l):e.result+=o.repeat(`
|
||||
`,a?1+l:l),a=!0,s=!0,l=0,n=e.position;!T(f)&&f!==0;)f=e.input.charCodeAt(++e.position);M(e,n,e.position,!1)}return!0}function Et(e,t){var n,r=e.tag,i=e.anchor,a=[],o,s=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,A(e,`tab characters must not be used in indentation`)),!(c!==45||(o=e.input.charCodeAt(e.position+1),!D(o))));){if(s=!0,e.position++,F(e,!0,-1)&&e.lineIndent<=t){a.push(null),c=e.input.charCodeAt(e.position);continue}if(n=e.line,R(e,t,et,!1,!0),a.push(e.result),F(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&c!==0)A(e,`bad indentation of a sequence entry`);else if(e.lineIndent<t)break}return s?(e.tag=r,e.anchor=i,e.kind=`sequence`,e.result=a,!0):!1}function Dt(e,t,n){var r,i,a,o,s,c,l=e.tag,u=e.anchor,d={},f=Object.create(null),p=null,m=null,h=null,g=!1,_=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),v=e.input.charCodeAt(e.position);v!==0;){if(!g&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,A(e,`tab characters must not be used in indentation`)),r=e.input.charCodeAt(e.position+1),a=e.line,(v===63||v===58)&&D(r))v===63?(g&&(N(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!0,i=!0):g?(g=!1,i=!0):A(e,`incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line`),e.position+=1,v=r;else{if(o=e.line,s=e.lineStart,c=e.position,!R(e,n,$e,!1,!0))break;if(e.line===a){for(v=e.input.charCodeAt(e.position);E(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),D(v)||A(e,`a whitespace character is expected after the key-value separator within a block mapping`),g&&(N(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!1,i=!1,p=e.tag,m=e.result;else if(_)A(e,`can not read an implicit mapping pair; a colon is missed`);else return e.tag=l,e.anchor=u,!0}else if(_)A(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return e.tag=l,e.anchor=u,!0}if((e.line===a||e.lineIndent>t)&&(g&&(o=e.line,s=e.lineStart,c=e.position),R(e,t,C,!0,i)&&(g?m=e.result:h=e.result),g||(N(e,d,f,p,m,h,o,s,c),p=m=h=null),F(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&v!==0)A(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return g&&N(e,d,f,p,m,null,o,s,c),_&&(e.tag=l,e.anchor=u,e.kind=`mapping`,e.result=d),_}function Ot(e){var t,n=!1,r=!1,i,a,o=e.input.charCodeAt(e.position);if(o!==33)return!1;if(e.tag!==null&&A(e,`duplication of a tag property`),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i=`!!`,o=e.input.charCodeAt(++e.position)):i=`!`,t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):A(e,`unexpected end of the stream within a verbatim tag`)}else{for(;o!==0&&!D(o);)o===33&&(r?A(e,`tag suffix cannot contain exclamation marks`):(i=e.input.slice(t-1,e.position+1),ot.test(i)||A(e,`named tag handle cannot contain such characters`),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),at.test(a)&&A(e,`tag suffix cannot contain flow indicator characters`)}a&&!st.test(a)&&A(e,`tag name cannot contain such characters: `+a);try{a=decodeURIComponent(a)}catch{A(e,`tag name is malformed: `+a)}return n?e.tag=a:x.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i===`!`?e.tag=`!`+a:i===`!!`?e.tag=`tag:yaml.org,2002:`+a:A(e,`undeclared tag handle "`+i+`"`),!0}function kt(e){var t,n=e.input.charCodeAt(e.position);if(n!==38)return!1;for(e.anchor!==null&&A(e,`duplication of an anchor property`),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!D(n)&&!O(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&A(e,`name of an anchor node must contain at least one character`),e.anchor=e.input.slice(t,e.position),!0}function At(e){var t,n,r=e.input.charCodeAt(e.position);if(r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!D(r)&&!O(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&A(e,`name of an alias node must contain at least one character`),n=e.input.slice(t,e.position),x.call(e.anchorMap,n)||A(e,`unidentified alias "`+n+`"`),e.result=e.anchorMap[n],F(e,!0,-1),!0}function R(e,t,n,r,i){var a,o,s,c=1,l=!1,u=!1,d,f,p,m,h,g;if(e.listener!==null&&e.listener(`open`,e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=C===n||et===n,r&&F(e,!0,-1)&&(l=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;Ot(e)||kt(e);)F(e,!0,-1)?(l=!0,s=a,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):s=!1;if(s&&=l||i,(c===1||C===n)&&(h=S===n||$e===n?t:t+1,g=e.position-e.lineStart,c===1?s&&(Et(e,g)||Dt(e,g,h))||wt(e,h)?u=!0:(o&&Tt(e,h)||St(e,h)||Ct(e,h)?u=!0:At(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&A(e,`alias node should not have any properties`)):xt(e,h,S===n)&&(u
Line truncated
|
||||
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new _t(e,t),r=e.indexOf(`\0`);for(r!==-1&&(n.position=r,A(n,`null byte is not allowed in input`)),n.input+=`\0`;n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)jt(n);return n.documents}function Nt(e,t,n){typeof t==`object`&&t&&n===void 0&&(n=t,t=null);var r=Mt(e,n);if(typeof t!=`function`)return r;for(var i=0,a=r.length;i<a;i+=1)t(r[i])}function Pt(e,t){var n=Mt(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new l(`expected a single document in the stream, but found more`)}}var Ft={loadAll:Nt,load:Pt},It=Object.prototype.toString,Lt=Object.prototype.hasOwnProperty,z=65279,Rt=9,B=10,zt=13,Bt=32,Vt=33,Ht=34,V=35,Ut=37,Wt=38,Gt=39,Kt=42,qt=44,Jt=45,H=58,Yt=61,Xt=62,Zt=63,Qt=64,$t=91,en=93,tn=96,nn=123,rn=124,an=125,U={};U[0]=`\\0`,U[7]=`\\a`,U[8]=`\\b`,U[9]=`\\t`,U[10]=`\\n`,U[11]=`\\v`,U[12]=`\\f`,U[13]=`\\r`,U[27]=`\\e`,U[34]=`\\"`,U[92]=`\\\\`,U[133]=`\\N`,U[160]=`\\_`,U[8232]=`\\L`,U[8233]=`\\P`;var on=[`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],sn=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function cn(e,t){var n,r,i,a,o,s,c;if(t===null)return{};for(n={},r=Object.keys(t),i=0,a=r.length;i<a;i+=1)o=r[i],s=String(t[o]),o.slice(0,2)===`!!`&&(o=`tag:yaml.org,2002:`+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&Lt.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[o]=s;return n}function ln(e){var t=e.toString(16).toUpperCase(),n,r;if(e<=255)n=`x`,r=2;else if(e<=65535)n=`u`,r=4;else if(e<=4294967295)n=`U`,r=8;else throw new l(`code point within a string may not be greater than 0xFFFFFFFF`);return`\\`+n+o.repeat(`0`,r-t.length)+t}var un=1,W=2;function dn(e){this.schema=e.schema||Qe,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=o.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=cn(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===`"`?W:un,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer==`function`?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=``,this.duplicates=[],this.usedDuplicates=null}function fn(e,t){for(var n=o.repeat(` `,t),r=0,i=-1,a=``,s,c=e.length;r<c;)i=e.indexOf(`
|
||||
`,r),i===-1?(s=e.slice(r),r=c):(s=e.slice(r,i+1),r=i+1),s.length&&s!==`
|
||||
`&&(a+=n),a+=s;return a}function G(e,t){return`
|
||||
`+o.repeat(` `,e.indent*t)}function pn(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function K(e){return e===Bt||e===Rt}function q(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==z||65536<=e&&e<=1114111}function mn(e){return q(e)&&e!==z&&e!==zt&&e!==B}function hn(e,t,n){var r=mn(e),i=r&&!K(e);return(n?r:r&&e!==qt&&e!==$t&&e!==en&&e!==nn&&e!==an)&&e!==V&&!(t===H&&!i)||mn(t)&&!K(t)&&e===V||t===H&&i}function gn(e){return q(e)&&e!==z&&!K(e)&&e!==Jt&&e!==Zt&&e!==H&&e!==qt&&e!==$t&&e!==en&&e!==nn&&e!==an&&e!==V&&e!==Wt&&e!==Kt&&e!==Vt&&e!==rn&&e!==Yt&&e!==Xt&&e!==Gt&&e!==Ht&&e!==Ut&&e!==Qt&&e!==tn}function _n(e){return!K(e)&&e!==H}function J(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function vn(e){return/^\n* /.test(e)}var yn=1,Y=2,bn=3,xn=4,X=5;function Sn(e,t,n,r,i,a,o,s){var c,l=0,u=null,d=!1,f=!1,p=r!==-1,m=-1,h=gn(J(e,0))&&_n(J(e,e.length-1));if(t||o)for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=J(e,c),!q(l))return X;h&&=hn(l,u,s),u=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=J(e,c),l===B)d=!0,p&&(f||=c-m-1>r&&e[m+1]!==` `,m=c);else if(!q(l))return X;h&&=hn(l,u,s),u=l}f||=p&&c-m-1>r&&e[m+1]!==` `}return!d&&!f?h&&!o&&!i(e)?yn:a===W?X:Y:n>9&&vn(e)?X:o?a===W?X:Y:f?xn:bn}function Cn(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===W?`""`:`''`;if(!e.noCompatMode&&(on.indexOf(t)!==-1||sn.test(t)))return e.quotingType===W?`"`+t+`"`:`'`+t+`'`;var a=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),s=r||e.flowLevel>-1&&n>=e.flowLevel;function c(t){return pn(e,t)}switch(Sn(t,s,e.indent,o,c,e.quotingType,e.forceQuotes&&!r,i)){case yn:return t;case Y:return`'`+t.replace(/'/g,`''`)+`'`;case bn:return`|`+wn(t,e.indent)+Tn(fn(t,a));case xn:return`>`+wn(t,e.indent)+Tn(fn(En(t,o),a));case X:return`"`+Dn(t)+`"`;default:throw new l(`impossible error: invalid scalar style`)}}()}function wn(e,t){var n=vn(e)?String(t):``,r=e[e.length-1]===`
|
||||
`;return n+(r&&(e[e.length-2]===`
|
||||
`||e===`
|
||||
`)?`+`:r?``:`-`)+`
|
||||
`}function Tn(e){return e[e.length-1]===`
|
||||
`?e.slice(0,-1):e}function En(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var r=e.indexOf(`
|
||||
`);return r=r===-1?e.length:r,n.lastIndex=r,Z(e.slice(0,r),t)}(),i=e[0]===`
|
||||
`||e[0]===` `,a,o;o=n.exec(e);){var s=o[1],c=o[2];a=c[0]===` `,r+=s+(!i&&!a&&c!==``?`
|
||||
`:``)+Z(c,t),i=a}return r}function Z(e,t){if(e===``||e[0]===` `)return e;for(var n=/ [^ ]/g,r,i=0,a,o=0,s=0,c=``;r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,c+=`
|
||||
`+e.slice(i,a),i=a+1),o=s;return c+=`
|
||||
`,e.length-i>t&&o>i?c+=e.slice(i,o)+`
|
||||
`+e.slice(o+1):c+=e.slice(i),c.slice(1)}function Dn(e){for(var t=``,n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=J(e,i),r=U[n],!r&&q(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||ln(n);return t}function On(e,t,n){var r=``,i=e.tag,a,o,s;for(a=0,o=n.length;a<o;a+=1)s=n[a],e.replacer&&(s=e.replacer.call(n,String(a),s)),(Q(e,t,s,!1,!1)||s===void 0&&Q(e,t,null,!1,!1))&&(r!==``&&(r+=`,`+(e.condenseFlow?``:` `)),r+=e.dump);e.tag=i,e.dump=`[`+r+`]`}function kn(e,t,n,r){var i=``,a=e.tag,o,s,c;for(o=0,s=n.length;o<s;o+=1)c=n[o],e.replacer&&(c=e.replacer.call(n,String(o),c)),(Q(e,t+1,c,!0,!0,!1,!0)||c===void 0&&Q(e,t+1,null,!0,!0,!1,!0))&&((!r||i!==``)&&(i+=G(e,t)),e.dump&&B===e.dump.charCodeAt(0)?i+=`-`:i+=`- `,i+=e.dump);e.tag=a,e.dump=i||`[]`}function An(e,t,n){var r=``,i=e.tag,a=Object.keys(n),o,s,c,l,u;for(o=0,s=a.length;o<s;o+=1)u=``,r!==``&&(u+=`, `),e.condenseFlow&&(u+=`"`),c=a[o],l=n[c],e.replacer&&(l=e.replacer.call(n,c,l)),Q(e,t,c,!1,!1)&&(e.dump.length>1024&&(u+=`? `),u+=e.dump+(e.condenseFlow?`"`:``)+`:`+(e.condenseFlow?``:` `),Q(e,t,l,!1,!1)&&(u+=e.dump,r+=u));e.tag=i,e.dump=`{`+r+`}`}function jn(e,t,n,r){var i=``,a=e.tag,o=Object.keys(n),s,c,u,d,f,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys==`function`)o.sort(e.sortKeys);else if(e.sortKeys)throw new l(`sortKeys must be a boolean or a function`);for(s=0,c=o.length;s<c;s+=1)p=``,(!r||i!==``)&&(p+=G(e,t)),u=o[s],d=n[u],e.replacer&&(d=e.replacer.call(n,u,d)),Q(e,t+1,u,!0,!0,!0)&&(f=e.tag!==null&&e.tag!==`?`||e.dump&&e.dump.length>1024,f&&(e.dump&&B===e.dump.charCodeAt(0)?p+=`?`:p+=`? `),p+=e.dump,f&&(p+=G(e,t)),Q(e,t+1,d,!0,f)&&(e.dump&&B===e.dump.charCodeAt(0)?p+=`:`:p+=`: `,p+=e.dump,i+=p));e.tag=a,e.dump=i||`{}`}function Mn(e,t,n){var r,i=n?e.explicitTypes:e.implicitTypes,a,o,s,c;for(a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t==`object`&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(n?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag=`?`,s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,It.call(s.represent)===`[object Function]`)r=s.represent(t,c);else if(Lt.call(s.represent,c))r=s.represent[c](t,c);else throw new l(`!<`+s.tag+`> tag resolver accepts not "`+c+`" style`);e.dump=r}return!0}return!1}function Q(e,t,n,r,i,a,o){e.tag=null,e.dump=n,Mn(e,n,!1)||Mn(e,n,!0);var s=It.call(e.dump),c=r,u;r&&=e.flowLevel<0||e.flowLevel>t;var d=s===`[object Object]`||s===`[object Array]`,f,p;if(d&&(f=e.duplicates.indexOf(n),p=f!==-1),(e.tag!==null&&e.tag!==`?`||p||e.indent!==2&&t>0)&&(i=!1),p&&e.usedDuplicates[f])e.dump=`*ref_`+f;else{if(d&&p&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),s===`[object Object]`)r&&Object.keys(e.dump).length!==0?(jn(e,t,e.dump,i),p&&(e.dump=`&ref_`+f+e.dump)):(An(e,t,e.dump),p&&(e.dump=`&ref_`+f+` `+e.dump));else if(s===`[object Array]`)r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?kn(e,t-1,e.dump,i):kn(e,t,e.dump,i),p&&(e.dump=`&ref_`+f+e.dump)):(On(e,t,e.dump),p&&(e.dump=`&ref_`+f+` `+e.dump));else if(s===`[object String]`)e.tag!==`?`&&Cn(e,e.dump,t,a,c);else if(s===`[object Undefined]`)return!1;else{if(e.skipInvalid)return!1;throw new l(`unacceptable kind of an object to dump `+s)}e.tag!==null&&e.tag!==`?`&&(u=encodeURI(e.tag[0]===`!`?e.tag.slice(1):e.tag).replace(/!/g,`%21`),u=e.tag[0]===`!`?`!`+u:u.slice(0,18)===`tag:yaml.org,2002:`?`!!`+u.slice(18):`!<`+u+`>`,e.dump=u+` `+e.dump)}return!0}function Nn(e,t){var n=[],r=[],i,a;for($(e,n,r),i=0,a=r.length;i<a;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=Array(a)}function $(e,t,n){var r,i,a;if(typeof e==`object`&&e)if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)$(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)$(e[r[i]],t,n)}function Pn(e,t){t||={};var n=new dn(t);n.noRefs||Nn(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},``,r)),Q(n,0,r,!0,!0)?n.dump+`
|
||||
`:``}var Fn={dump:Pn},In=Ft.load;Ft.loadAll;var Ln=Fn.dump;export{In as n,Ln as t};
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
import{t as e}from"../rolldown-runtime.mjs";var t=e(((e,t)=>{t.exports.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,t.exports.ID_Start=/[\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\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\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\u09FC\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\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\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\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\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\u1C80-\u1C88\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\u2160-\u2188\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-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\Line truncated
|
||||
`?(c++,l=0):e?l+=e.length:l++,e&&(s+=e.length),e}let S={default(){switch(v){case` `:case`\v`:case`\f`:case` `:case`\xA0`:case``:case`
|
||||
`:case`\r`:case`\u2028`:case`\u2029`:x();return;case`/`:x(),m=`comment`;return;case void 0:return x(),C(`eof`)}if(r.isSpaceSeparator(v)){x();return}return S[a]()},comment(){switch(v){case`*`:x(),m=`multiLineComment`;return;case`/`:x(),m=`singleLineComment`;return}throw j(x())},multiLineComment(){switch(v){case`*`:x(),m=`multiLineCommentAsterisk`;return;case void 0:throw j(x())}x()},multiLineCommentAsterisk(){switch(v){case`*`:x();return;case`/`:x(),m=`default`;return;case void 0:throw j(x())}x(),m=`multiLineComment`},singleLineComment(){switch(v){case`
|
||||
`:case`\r`:case`\u2028`:case`\u2029`:x(),m=`default`;return;case void 0:return x(),C(`eof`)}x()},value(){switch(v){case`{`:case`[`:return C(`punctuator`,x());case`n`:return x(),w(`ull`),C(`null`,null);case`t`:return x(),w(`rue`),C(`boolean`,!0);case`f`:return x(),w(`alse`),C(`boolean`,!1);case`-`:case`+`:x()===`-`&&(_=-1),m=`sign`;return;case`.`:h=x(),m=`decimalPointLeading`;return;case`0`:h=x(),m=`zero`;return;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:h=x(),m=`decimalInteger`;return;case`I`:return x(),w(`nfinity`),C(`numeric`,1/0);case`N`:return x(),w(`aN`),C(`numeric`,NaN);case`"`:case`'`:g=x()===`"`,h=``,m=`string`;return}throw j(x())},identifierNameStartEscape(){if(v!==`u`)throw j(x());x();let e=D();switch(e){case`$`:case`_`:break;default:if(!r.isIdStartChar(e))throw N();break}h+=e,m=`identifierName`},identifierName(){switch(v){case`$`:case`_`:case``:case``:h+=x();return;case`\\`:x(),m=`identifierNameEscape`;return}if(r.isIdContinueChar(v)){h+=x();return}return C(`identifier`,h)},identifierNameEscape(){if(v!==`u`)throw j(x());x();let e=D();switch(e){case`$`:case`_`:case``:case``:break;default:if(!r.isIdContinueChar(e))throw N();break}h+=e,m=`identifierName`},sign(){switch(v){case`.`:h=x(),m=`decimalPointLeading`;return;case`0`:h=x(),m=`zero`;return;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:h=x(),m=`decimalInteger`;return;case`I`:return x(),w(`nfinity`),C(`numeric`,_*(1/0));case`N`:return x(),w(`aN`),C(`numeric`,NaN)}throw j(x())},zero(){switch(v){case`.`:h+=x(),m=`decimalPoint`;return;case`e`:case`E`:h+=x(),m=`decimalExponent`;return;case`x`:case`X`:h+=x(),m=`hexadecimal`;return}return C(`numeric`,_*0)},decimalInteger(){switch(v){case`.`:h+=x(),m=`decimalPoint`;return;case`e`:case`E`:h+=x(),m=`decimalExponent`;return}if(r.isDigit(v)){h+=x();return}return C(`numeric`,_*Number(h))},decimalPointLeading(){if(r.isDigit(v)){h+=x(),m=`decimalFraction`;return}throw j(x())},decimalPoint(){switch(v){case`e`:case`E`:h+=x(),m=`decimalExponent`;return}if(r.isDigit(v)){h+=x(),m=`decimalFraction`;return}return C(`numeric`,_*Number(h))},decimalFraction(){switch(v){case`e`:case`E`:h+=x(),m=`decimalExponent`;return}if(r.isDigit(v)){h+=x();return}return C(`numeric`,_*Number(h))},decimalExponent(){switch(v){case`+`:case`-`:h+=x(),m=`decimalExponentSign`;return}if(r.isDigit(v)){h+=x(),m=`decimalExponentInteger`;return}throw j(x())},decimalExponentSign(){if(r.isDigit(v)){h+=x(),m=`decimalExponentInteger`;return}throw j(x())},decimalExponentInteger(){if(r.isDigit(v)){h+=x();return}return C(`numeric`,_*Number(h))},hexadecimal(){if(r.isHexDigit(v)){h+=x(),m=`hexadecimalInteger`;return}throw j(x())},hexadecimalInteger(){if(r.isHexDigit(v)){h+=x();return}return C(`numeric`,_*Number(h))},string(){switch(v){case`\\`:x(),h+=T();return;case`"`:if(g)return x(),C(`string`,h);h+=x();return;case`'`:if(!g)return x(),C(`string`,h);h+=x();return;case`
|
||||
`:case`\r`:throw j(x());case`\u2028`:case`\u2029`:P(v);break;case void 0:throw j(x())}h+=x()},start(){switch(v){case`{`:case`[`:return C(`punctuator`,x())}m=`value`},beforePropertyName(){switch(v){case`$`:case`_`:h=x(),m=`identifierName`;return;case`\\`:x(),m=`identifierNameStartEscape`;return;case`}`:return C(`punctuator`,x());case`"`:case`'`:g=x()===`"`,m=`string`;return}if(r.isIdStartChar(v)){h+=x(),m=`identifierName`;return}throw j(x())},afterPropertyName(){if(v===`:`)return C(`punctuator`,x());throw j(x())},beforePropertyValue(){m=`value`},afterPropertyValue(){switch(v){case`,`:case`}`:return C(`punctuator`,x())}throw j(x())},beforeArrayValue(){if(v===`]`)return C(`punctuator`,x());m=`value`},afterArrayValue(){switch(v){case`,`:case`]`:return C(`punctuator`,x())}throw j(x())},end(){throw j(x())}};function C(e,t){return{type:e,value:t,line:c,column:l}}function w(e){for(let t of e){if(b()!==t)throw j(x());x()}}function T(){switch(b()){case`b`:return x(),`\b`;case`f`:return x(),`\f`;case`n`:return x(),`
|
||||
`;case`r`:return x(),`\r`;case`t`:return x(),` `;case`v`:return x(),`\v`;case`0`:if(x(),r.isDigit(b()))throw j(x());return`\0`;case`x`:return x(),E();case`u`:return x(),D();case`
|
||||
`:case`\u2028`:case`\u2029`:return x(),``;case`\r`:return x(),b()===`
|
||||
`&&x(),``;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:throw j(x());case void 0:throw j(x())}return x()}function E(){let e=``,t=b();if(!r.isHexDigit(t)||(e+=x(),t=b(),!r.isHexDigit(t)))throw j(x());return e+=x(),String.fromCodePoint(parseInt(e,16))}function D(){let e=``,t=4;for(;t-- >0;){let t=b();if(!r.isHexDigit(t))throw j(x());e+=x()}return String.fromCodePoint(parseInt(e,16))}let O={start(){if(u.type===`eof`)throw M();k()},beforePropertyName(){switch(u.type){case`identifier`:case`string`:d=u.value,a=`afterPropertyName`;return;case`punctuator`:A();return;case`eof`:throw M()}},afterPropertyName(){if(u.type===`eof`)throw M();a=`beforePropertyValue`},beforePropertyValue(){if(u.type===`eof`)throw M();k()},beforeArrayValue(){if(u.type===`eof`)throw M();if(u.type===`punctuator`&&u.value===`]`){A();return}k()},afterPropertyValue(){if(u.type===`eof`)throw M();switch(u.value){case`,`:a=`beforePropertyName`;return;case`}`:A()}},afterArrayValue(){if(u.type===`eof`)throw M();switch(u.value){case`,`:a=`beforeArrayValue`;return;case`]`:A()}},end(){}};function k(){let e;switch(u.type){case`punctuator`:switch(u.value){case`{`:e={};break;case`[`:e=[];break}break;case`null`:case`boolean`:case`numeric`:case`string`:e=u.value;break}if(f===void 0)f=e;else{let t=o[o.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,d,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(typeof e==`object`&&e)o.push(e),a=Array.isArray(e)?`beforeArrayValue`:`beforePropertyName`;else{let e=o[o.length-1];a=e==null?`end`:Array.isArray(e)?`afterArrayValue`:`afterPropertyValue`}}function A(){o.pop();let e=o[o.length-1];a=e==null?`end`:Array.isArray(e)?`afterArrayValue`:`afterPropertyValue`}function j(e){return I(e===void 0?`JSON5: invalid end of input at ${c}:${l}`:`JSON5: invalid character '${F(e)}' at ${c}:${l}`)}function M(){return I(`JSON5: invalid end of input at ${c}:${l}`)}function N(){return l-=5,I(`JSON5: invalid identifier character at ${c}:${l}`)}function P(e){console.warn(`JSON5: '${F(e)}' in strings is not valid ECMAScript; consider escaping`)}function F(e){let t={"'":`\\'`,'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`,"\v":`\\v`,"\0":`\\0`,"\u2028":`\\u2028`,"\u2029":`\\u2029`};if(t[e])return t[e];if(e<` `){let t=e.charCodeAt(0).toString(16);return`\\x`+(`00`+t).substring(t.length)}return e}function I(e){let t=SyntaxError(e);return t.lineNumber=c,t.columnNumber=l,t}})),i=e(((e,t)=>{let r=n();t.exports=function(e,t,n){let i=[],a=``,o,s,c=``,l;if(typeof t==`object`&&t&&!Array.isArray(t)&&(n=t.space,l=t.quote,t=t.replacer),typeof t==`function`)s=t;else if(Array.isArray(t)){o=[];for(let e of t){let t;typeof e==`string`?t=e:(typeof e==`number`||e instanceof String||e instanceof Number)&&(t=String(e)),t!==void 0&&o.indexOf(t)<0&&o.push(t)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n==`number`?n>0&&(n=Math.min(10,Math.floor(n)),c=` `.substr(0,n)):typeof n==`string`&&(c=n.substr(0,10)),u(``,{"":e});function u(e,t){let n=t[e];switch(n!=null&&(typeof n.toJSON5==`function`?n=n.toJSON5(e):typeof n.toJSON==`function`&&(n=n.toJSON(e))),s&&(n=s.call(t,e,n)),n instanceof Number?n=Number(n):n instanceof String?n=String(n):n instanceof Boolean&&(n=n.valueOf()),n){case null:return`null`;case!0:return`true`;case!1:return`false`}if(typeof n==`string`)return d(n,!1);if(typeof n==`number`)return String(n);if(typeof n==`object`)return Array.isArray(n)?m(n):f(n)}function d(e){let t={"'":.1,'"':.2},n={"'":`\\'`,'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`,"\v":`\\v`,"\0":`\\0`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},i=``;for(let a=0;a<e.length;a++){let o=e[a];switch(o){case`'`:case`"`:t[o]++,i+=o;continue;case`\0`:if(r.isDigit(e[a+1])){i+=`\\x00`;continue}}if(n[o]){i+=n[o];continue}if(o<` `){let e=o.charCodeAt(0).toString(16);i+=`\\x`+(`00`+e).substring(e.length);continue}i+=o}let a=l||Object.keys(t).reduce((e,n)=>t[e]<t[n]?e:n);return i=i.replace(new RegExp(a,`g`),n[a]),a+i+a}function f(e){if(i.indexOf(e)>=0)throw TypeError(`Converting circular structure to JSON5`);i.push(e);let t=a;a+=c;let n=o||Object.keys(e),r=[];for(let t of n){let n=u(t,e);if(n!==void 0){let e=p(t)+`:`;c!==``&&(e+=` `),e+=n,r.push(e)}}let s;if(r.length===0)s=`{}`;else{let e;if(c===``)e=r.join(`,`),s=`{`+e+`}`;else{let n=`,
|
||||
`+a;e=r.join(n),s=`{
|
||||
`+a+e+`,
|
||||
`+t+`}`}}return i.pop(),a=t,s}function p(e){if(e.length===0)return d(e,!0);let t=String.fromCodePoint(e.codePointAt(0));if(!r.isIdStartChar(t))return d(e,!0);for(let n=t.length;n<e.length;n++)if(!r.isIdContinueChar(String.fromCodePoint(e.codePointAt(n))))return d(e,!0);return e}function m(e){if(i.indexOf(e)>=0)throw TypeError(`Converting circular structure to JSON5`);i.push(e);let t=a;a+=c;let n=[];for(let t=0;t<e.length;t++){let r=u(String(t),e);n.push(r===void 0?`null`:r)}let r;if(n.length===0)r=`[]`;else if(c===``)r=`[`+n.join(`,`)+`]`;else{let e=`,
|
||||
`+a,i=n.join(e);r=`[
|
||||
`+a+i+`,
|
||||
`+t+`]`}return i.pop(),a=t,r}}}));export{r as n,i as t};
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
function e(e,i=!1){let a=e.length,o=0,s=``,c=0,l=16,u=0,d=0,f=0,p=0,m=0;function h(t,n){let r=0,i=0;for(;r<t||!n;){let t=e.charCodeAt(o);if(t>=48&&t<=57)i=i*16+t-48;else if(t>=65&&t<=70)i=i*16+t-65+10;else if(t>=97&&t<=102)i=i*16+t-97+10;else break;o++,r++}return r<t&&(i=-1),i}function g(e){o=e,s=``,c=0,l=16,m=0}function _(){let t=o;if(e.charCodeAt(o)===48)o++;else for(o++;o<e.length&&r(e.charCodeAt(o));)o++;if(o<e.length&&e.charCodeAt(o)===46)if(o++,o<e.length&&r(e.charCodeAt(o)))for(o++;o<e.length&&r(e.charCodeAt(o));)o++;else return m=3,e.substring(t,o);let n=o;if(o<e.length&&(e.charCodeAt(o)===69||e.charCodeAt(o)===101))if(o++,(o<e.length&&e.charCodeAt(o)===43||e.charCodeAt(o)===45)&&o++,o<e.length&&r(e.charCodeAt(o))){for(o++;o<e.length&&r(e.charCodeAt(o));)o++;n=o}else m=3;return e.substring(t,n)}function v(){let t=``,r=o;for(;;){if(o>=a){t+=e.substring(r,o),m=2;break}let i=e.charCodeAt(o);if(i===34){t+=e.substring(r,o),o++;break}if(i===92){if(t+=e.substring(r,o),o++,o>=a){m=2;break}switch(e.charCodeAt(o++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
|
||||
`;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=h(4,!0);e>=0?t+=String.fromCharCode(e):m=4;break;default:m=5}r=o;continue}if(i>=0&&i<=31)if(n(i)){t+=e.substring(r,o),m=2;break}else m=6;o++}return t}function y(){if(s=``,m=0,c=o,d=u,p=f,o>=a)return c=a,l=17;let i=e.charCodeAt(o);if(t(i)){do o++,s+=String.fromCharCode(i),i=e.charCodeAt(o);while(t(i));return l=15}if(n(i))return o++,s+=String.fromCharCode(i),i===13&&e.charCodeAt(o)===10&&(o++,s+=`
|
||||
`),u++,f=o,l=14;switch(i){case 123:return o++,l=1;case 125:return o++,l=2;case 91:return o++,l=3;case 93:return o++,l=4;case 58:return o++,l=6;case 44:return o++,l=5;case 34:return o++,s=v(),l=10;case 47:let t=o-1;if(e.charCodeAt(o+1)===47){for(o+=2;o<a&&!n(e.charCodeAt(o));)o++;return s=e.substring(t,o),l=12}if(e.charCodeAt(o+1)===42){o+=2;let r=a-1,i=!1;for(;o<r;){let t=e.charCodeAt(o);if(t===42&&e.charCodeAt(o+1)===47){o+=2,i=!0;break}o++,n(t)&&(t===13&&e.charCodeAt(o)===10&&o++,u++,f=o)}return i||(o++,m=1),s=e.substring(t,o),l=13}return s+=String.fromCharCode(i),o++,l=16;case 45:if(s+=String.fromCharCode(i),o++,o===a||!r(e.charCodeAt(o)))return l=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return s+=_(),l=11;default:for(;o<a&&b(i);)o++,i=e.charCodeAt(o);if(c!==o){switch(s=e.substring(c,o),s){case`true`:return l=8;case`false`:return l=9;case`null`:return l=7}return l=16}return s+=String.fromCharCode(i),o++,l=16}}function b(e){if(t(e)||n(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function x(){let e;do e=y();while(e>=12&&e<=15);return e}return{setPosition:g,getPosition:()=>o,scan:i?x:y,getToken:()=>l,getTokenValue:()=>s,getTokenOffset:()=>c,getTokenLength:()=>o-c,getTokenStartLine:()=>d,getTokenStartCharacter:()=>c-p,getTokenError:()=>m}}function t(e){return e===32||e===9}function n(e){return e===10||e===13}function r(e){return e>=48&&e<=57}var i;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(i||={}),Array(20).fill(0).map((e,t)=>` `.repeat(t)),Array(200).fill(0).map((e,t)=>`
|
||||
`+` `.repeat(t)),Array(200).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(200).fill(0).map((e,t)=>`\r
|
||||
`+` `.repeat(t)),Array(200).fill(0).map((e,t)=>`
|
||||
`+` `.repeat(t)),Array(200).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(200).fill(0).map((e,t)=>`\r
|
||||
`+` `.repeat(t));var a;(function(e){e.DEFAULT={allowTrailingComma:!1}})(a||={});function o(e,t=[],n=a.DEFAULT){let r=null,i=[],o=[];function s(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return d(e,{onObjectBegin:()=>{let e={};s(e),o.push(i),i=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{i=o.pop()},onArrayBegin:()=>{let e=[];s(e),o.push(i),i=e,r=null},onArrayEnd:()=>{i=o.pop()},onLiteralValue:s,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n),i[0]}function s(e){if(!e.parent||!e.parent.children)return[];let t=s(e.parent);if(e.parent.type===`property`){let n=e.parent.children[0].value;t.push(n)}else if(e.parent.type===`array`){let n=e.parent.children.indexOf(e);n!==-1&&t.push(n)}return t}function c(e){switch(e.type){case`array`:return e.children.map(c);case`object`:let t=Object.create(null);for(let n of e.children){let e=n.children[1];e&&(t[n.children[0].value]=c(e))}return t;case`null`:case`string`:case`number`:case`boolean`:return e.value;default:return}}function l(e,t,n=!1){return t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}function u(e,t,n=!1){if(l(e,t,n)){let r=e.children;if(Array.isArray(r))for(let e=0;e<r.length&&r[e].offset<=t;e++){let i=u(r[e],t,n);if(i)return i}return e}}function d(t,n,r=a.DEFAULT){let i=e(t,!1),o=[],s=0;function c(e){return e?()=>s===0&&e(i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter()):()=>!0}function l(e){return e?t=>s===0&&e(t,i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter()):()=>!0}function u(e){return e?t=>s===0&&e(t,i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter(),()=>o.slice()):()=>!0}function d(e){return e?()=>{s>0?s++:e(i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter(),()=>o.slice())===!1&&(s=1)}:()=>!0}function f(e){return e?()=>{s>0&&s--,s===0&&e(i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter())}:()=>!0}let p=d(n.onObjectBegin),m=u(n.onObjectProperty),h=f(n.onObjectEnd),g=d(n.onArrayBegin),_=f(n.onArrayEnd),v=u(n.onLiteralValue),y=l(n.onSeparator),b=c(n.onComment),x=l(n.onError),S=r&&r.disallowComments,C=r&&r.allowTrailingComma;function w(){for(;;){let e=i.scan();switch(i.getTokenError()){case 4:T(14);break;case 5:T(15);break;case 3:T(13);break;case 1:S||T(11);break;case 2:T(12);break;case 6:T(16);break}switch(e){case 12:case 13:S?T(10):b();break;case 16:T(1);break;case 15:case 14:break;default:return e}}}function T(e,t=[],n=[]){if(x(e),t.length+n.length>0){let e=i.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){w();break}else if(n.indexOf(e)!==-1)break;e=w()}}}function E(e){let t=i.getTokenValue();return e?v(t):(m(t),o.push(t)),w(),!0}function D(){switch(i.getToken()){case 11:let e=i.getTokenValue(),t=Number(e);isNaN(t)&&(T(2),t=0),v(t);break;case 7:v(null);break;case 8:v(!0);break;case 9:v(!1);break;default:return!1}return w(),!0}function O(){return i.getToken()===10?(E(!1),i.getToken()===6?(y(`:`),w(),j()||T(4,[],[2,5])):T(5,[],[2,5]),o.pop(),!0):(T(3,[],[2,5]),!1)}function k(){p(),w();let e=!1;for(;i.getToken()!==2&&i.getToken()!==17;){if(i.getToken()===5){if(e||T(4,[],[]),y(`,`),w(),i.getToken()===2&&C)break}else e&&T(6,[],[]);O()||T(4,[],[2,5]),e=!0}return h(),i.getToken()===2?w():T(7,[2],[]),!0}function A(){g(),w();let e=!0,t=!1;for(;i.getToken()!==4&&i.getToken()!==17;){if(i.getToken()===5){if(t||T(4,[],[]),y(`,`),w(),i.getToken()===4&&C)break}else t&&T(6,[],[]);e?(o.push(0),e=!1):o[o.length-1]++,j()||T(4,[],[4,5]),t=!0}return _(),e||o.pop(),i.getToken()===4?w():T(8,[4],[]),!0}function j(){switch(i.getToken()){case 3:return A();case 1:return k();case 10:return E(!0);default:return D()}}return w(),i.getToken()===17?r.allowEmptyContent?!0:(T(4,[],[]),!1):j()?(i.getToken()!==17&&T(9,[],[]),!0):(T(4,[],[]),!1)}var f;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(f||={});var p;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(p||={});const m=o;var h;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e
Line truncated
|
||||
+249
@@ -0,0 +1,249 @@
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
function e(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function t(e,t,n){let r=e.split(/\r\n|\n|\r/g),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=`
|
||||
`,e===t&&(i+=` `.repeat(a+n+2),i+=`^
|
||||
`))}return i}var n=class extends Error{line;column;codeblock;constructor(n,r){let[i,a]=e(r.toml,r.ptr),o=t(r.toml,i,a);super(`Invalid TOML document: ${n}\n\n${o}`,r),this.line=i,this.column=a,this.codeblock=o}};
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
function r(e,t){let n=0;for(;e[t-++n]===`\\`;);return--n&&n%2}function i(e,t=0,n=e.length){let r=e.indexOf(`
|
||||
`,t);return e[r-1]===`\r`&&r--,r<=n?r:-1}function a(e,t){for(let r=t;r<e.length;r++){let i=e[r];if(i===`
|
||||
`)return r;if(i===`\r`&&e[r+1]===`
|
||||
`)return r+1;if(i<` `&&i!==` `||i===``)throw new n(`control characters are not allowed in comments`,{toml:e,ptr:t})}return e.length}function o(e,t,n,r){let i;for(;(i=e[t])===` `||i===` `||!n&&(i===`
|
||||
`||i===`\r`&&e[t+1]===`
|
||||
`);)t++;return r||i!==`#`?t:o(e,a(e,t),n)}function s(e,t,r,a,o=!1){if(!a)return t=i(e,t),t<0?e.length:t;for(let n=t;n<e.length;n++){let t=e[n];if(t===`#`)n=i(e,n);else if(t===r)return n+1;else if(t===a||o&&(t===`
|
||||
`||t===`\r`&&e[n+1]===`
|
||||
`))return n}throw new n(`cannot find end of structure`,{toml:e,ptr:t})}function c(e,t){let n=e[t],i=n===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):n;t+=i.length-1;do t=e.indexOf(i,++t);while(t>-1&&n!==`'`&&r(e,t));return t>-1&&(t+=i.length,i.length>1&&(e[t]===n&&t++,e[t]===n&&t++)),t}
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
let l=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;var u=class e extends Date{#e=!1;#t=!1;#n=null;constructor(e){let t=!0,n=!0,r=`Z`;if(typeof e==`string`){let i=e.match(l);i?(i[1]||(t=!1,e=`0000-01-01T${e}`),n=!!i[2],n&&e[10]===` `&&(e=e.replace(` `,`T`)),i[2]&&+i[2]>23?e=``:(r=i[3]||null,e=e.toUpperCase(),!r&&n&&(e+=`Z`))):e=``}super(e),isNaN(this.getTime())||(this.#e=t,this.#t=n,this.#n=r)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}};
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
let d=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,f=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,p=/^[+-]?0[0-9_]/,m=/^[0-9a-f]{2,8}$/i,h={b:`\b`,t:` `,n:`
|
||||
`,f:`\f`,r:`\r`,e:`\x1B`,'"':`"`,"\\":`\\`};function g(e,t=0,r=e.length){let i=e[t]===`'`,a=e[t++]===e[t]&&e[t]===e[t+1];a&&(r-=2,e[t+=2]===`\r`&&t++,e[t]===`
|
||||
`&&t++);let s=0,c,l=``,u=t;for(;t<r-1;){let r=e[t++];if(r===`
|
||||
`||r===`\r`&&e[t]===`
|
||||
`){if(!a)throw new n(`newlines are not allowed in strings`,{toml:e,ptr:t-1})}else if(r<` `&&r!==` `||r===``)throw new n(`control characters are not allowed in strings`,{toml:e,ptr:t-1});if(c){if(c=!1,r===`x`||r===`u`||r===`U`){let i=e.slice(t,t+=r===`x`?2:r===`u`?4:8);if(!m.test(i))throw new n(`invalid unicode escape`,{toml:e,ptr:s});try{l+=String.fromCodePoint(parseInt(i,16))}catch{throw new n(`invalid unicode escape`,{toml:e,ptr:s})}}else if(a&&(r===`
|
||||
`||r===` `||r===` `||r===`\r`)){if(t=o(e,t-1,!0),e[t]!==`
|
||||
`&&e[t]!==`\r`)throw new n(`invalid escape: only line-ending whitespace may be escaped`,{toml:e,ptr:s});t=o(e,t)}else if(r in h)l+=h[r];else throw new n(`unrecognized escape sequence`,{toml:e,ptr:s});u=t}else !i&&r===`\\`&&(s=t-1,c=!0,l+=e.slice(u,s))}return l+e.slice(u,r-1)}function _(e,t,r,i){if(e===`true`)return!0;if(e===`false`)return!1;if(e===`-inf`)return-1/0;if(e===`inf`||e===`+inf`)return 1/0;if(e===`nan`||e===`+nan`||e===`-nan`)return NaN;if(e===`-0`)return i?0n:0;let a=d.test(e);if(a||f.test(e)){if(p.test(e))throw new n(`leading zeroes are not allowed`,{toml:t,ptr:r});e=e.replace(/_/g,``);let o=+e;if(isNaN(o))throw new n(`invalid number`,{toml:t,ptr:r});if(a){if((a=!Number.isSafeInteger(o))&&!i)throw new n(`integer value cannot be represented losslessly`,{toml:t,ptr:r});(a||i===!0)&&(o=BigInt(e))}return o}let o=new u(e);if(!o.isValid())throw new n(`invalid value`,{toml:t,ptr:r});return o}
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
function v(e,t,n){let r=e.slice(t,n),i=r.indexOf(`#`);return i>-1&&(a(e,i),r=r.slice(0,i)),[r.trimEnd(),i]}function y(e,t,r,i,a){if(i===0)throw new n(`document contains excessively nested structures. aborting.`,{toml:e,ptr:t});let l=e[t];if(l===`[`||l===`{`){let[s,c]=l===`[`?C(e,t,i,a):S(e,t,i,a);if(r){if(c=o(e,c),e[c]===`,`)c++;else if(e[c]!==r)throw new n(`expected comma or end of structure`,{toml:e,ptr:c})}return[s,c]}let u;if(l===`"`||l===`'`){u=c(e,t);let i=g(e,t,u);if(r){if(u=o(e,u),e[u]&&e[u]!==`,`&&e[u]!==r&&e[u]!==`
|
||||
`&&e[u]!==`\r`)throw new n(`unexpected character encountered`,{toml:e,ptr:u});u+=+(e[u]===`,`)}return[i,u]}u=s(e,t,`,`,r);let d=v(e,t,u-+(e[u-1]===`,`));if(!d[0])throw new n(`incomplete key-value declaration: no value specified`,{toml:e,ptr:t});return r&&d[1]>-1&&(u=o(e,t+d[1]),u+=+(e[u]===`,`)),[_(d[0],e,t,a),u]}
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
let b=/^[a-zA-Z0-9-_]+[ \t]*$/;function x(e,t,r=`=`){let a=t-1,s=[],l=e.indexOf(r,t);if(l<0)throw new n(`incomplete key-value: cannot find end of key`,{toml:e,ptr:t});do{let o=e[t=++a];if(o!==` `&&o!==` `)if(o===`"`||o===`'`){if(o===e[t+1]&&o===e[t+2])throw new n(`multiline strings are not allowed in keys`,{toml:e,ptr:t});let u=c(e,t);if(u<0)throw new n(`unfinished string encountered`,{toml:e,ptr:t});a=e.indexOf(`.`,u);let d=e.slice(u,a<0||a>l?l:a),f=i(d);if(f>-1)throw new n(`newlines are not allowed in keys`,{toml:e,ptr:t+a+f});if(d.trimStart())throw new n(`found extra tokens after the string part`,{toml:e,ptr:u});if(l<u&&(l=e.indexOf(r,u),l<0))throw new n(`incomplete key-value: cannot find end of key`,{toml:e,ptr:t});s.push(g(e,t,u))}else{a=e.indexOf(`.`,t);let r=e.slice(t,a<0||a>l?l:a);if(!b.test(r))throw new n(`only letter, numbers, dashes and underscores are allowed in keys`,{toml:e,ptr:t});s.push(r.trimEnd())}}while(a+1&&a<l);return[s,o(e,l+1,!0,!0)]}function S(e,t,r,i){let o={},s=new Set,c;for(t++;(c=e[t++])!==`}`&&c;)if(c===`,`)throw new n(`expected value, found comma`,{toml:e,ptr:t-1});else if(c===`#`)t=a(e,t);else if(c!==` `&&c!==` `&&c!==`
|
||||
`&&c!==`\r`){let a,c=o,l=!1,[u,d]=x(e,t-1);for(let r=0;r<u.length;r++){if(r&&(c=l?c[a]:c[a]={}),a=u[r],(l=Object.hasOwn(c,a))&&(typeof c[a]!=`object`||s.has(c[a])))throw new n(`trying to redefine an already defined value`,{toml:e,ptr:t});!l&&a===`__proto__`&&Object.defineProperty(c,a,{enumerable:!0,configurable:!0,writable:!0})}if(l)throw new n(`trying to redefine an already defined value`,{toml:e,ptr:t});let[f,p]=y(e,d,`}`,r-1,i);s.add(f),c[a]=f,t=p}if(!c)throw new n(`unfinished table encountered`,{toml:e,ptr:t});return[o,t]}function C(e,t,r,i){let o=[],s;for(t++;(s=e[t++])!==`]`&&s;)if(s===`,`)throw new n(`expected value, found comma`,{toml:e,ptr:t-1});else if(s===`#`)t=a(e,t);else if(s!==` `&&s!==` `&&s!==`
|
||||
`&&s!==`\r`){let n=y(e,t-1,`]`,r-1,i);o.push(n[0]),t=n[1]}if(!s)throw new n(`unfinished array encountered`,{toml:e,ptr:t});return[o,t]}
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
function w(e,t,n,r){let i=t,a=n,o,s=!1,c;for(let t=0;t<e.length;t++){if(t){if(i=s?i[o]:i[o]={},a=(c=a[o]).c,r===0&&(c.t===1||c.t===2))return null;if(c.t===2){let e=i.length-1;i=i[e],a=a[e].c}}if(o=e[t],(s=Object.hasOwn(i,o))&&a[o]?.t===0&&a[o]?.d)return null;s||(o===`__proto__`&&(Object.defineProperty(i,o,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,o,{enumerable:!0,configurable:!0,writable:!0})),a[o]={t:t<e.length-1&&r===2?3:r,d:!1,i:0,c:{}})}if(c=a[o],c.t!==r&&!(r===1&&c.t===3)||(r===2&&(c.d||(c.d=!0,i[o]=[]),i[o].push(i={}),c.c[c.i++]=c={t:1,d:!1,i:0,c:{}}),c.d))return null;if(c.d=!0,r===1)i=s?i[o]:i[o]={};else if(r===0&&s)return null;return[o,i,c.c]}function T(e,{maxDepth:t=1e3,integersAsBigInt:r}={}){let i={},a={},s=i,c=a;for(let l=o(e,0);l<e.length;){if(e[l]===`[`){let t=e[++l]===`[`,r=x(e,l+=+t,`]`);if(t){if(e[r[1]-1]!==`]`)throw new n(`expected end of table declaration`,{toml:e,ptr:r[1]-1});r[1]++}let o=w(r[0],i,a,t?2:1);if(!o)throw new n(`trying to redefine an already defined table or value`,{toml:e,ptr:l});c=o[2],s=o[1],l=r[1]}else{let i=x(e,l),a=w(i[0],s,c,0);if(!a)throw new n(`trying to redefine an already defined table or value`,{toml:e,ptr:l});let o=y(e,i[1],void 0,t,r);a[1][a[0]]=o[0],l=o[1]}if(l=o(e,l,!0),e[l]&&e[l]!==`
|
||||
`&&e[l]!==`\r`)throw new n(`each key-value declaration must be followed by an end-of-line`,{toml:e,ptr:l});l=o(e,l)}return i}
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
let E=/^[a-z0-9-_]+$/i;function D(e){let t=typeof e;if(t===`object`){if(Array.isArray(e))return`array`;if(e instanceof Date)return`date`}return t}function O(e){for(let t=0;t<e.length;t++)if(D(e[t])!==`object`)return!1;return e.length!=0}function k(e){return JSON.stringify(e).replace(/\x7f/g,`\\u007f`)}function A(e,t,n,r){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);if(t===`number`)return isNaN(e)?`nan`:e===1/0?`inf`:e===-1/0?`-inf`:r&&Number.isInteger(e)?e.toFixed(1):e.toString();if(t===`bigint`||t===`boolean`)return e.toString();if(t===`string`)return k(e);if(t===`date`){if(isNaN(e.getTime()))throw TypeError(`cannot serialize invalid date`);return e.toISOString()}if(t===`object`)return j(e,n,r);if(t===`array`)return M(e,n,r)}function j(e,t,n){let r=Object.keys(e);if(r.length===0)return`{}`;let i=`{ `;for(let a=0;a<r.length;a++){let o=r[a];a&&(i+=`, `),i+=E.test(o)?o:k(o),i+=` = `,i+=A(e[o],D(e[o]),t-1,n)}return i+` }`}function M(e,t,n){if(e.length===0)return`[]`;let r=`[ `;for(let i=0;i<e.length;i++){if(i&&(r+=`, `),e[i]===null||e[i]===void 0)throw TypeError(`arrays cannot contain null or undefined values`);r+=A(e[i],D(e[i]),t-1,n)}return r+` ]`}function N(e,t,n,r){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let i=``;for(let a=0;a<e.length;a++)i+=`${i&&`
|
||||
`}[[${t}]]\n`,i+=P(0,e[a],t,n,r);return i}function P(e,t,n,r,i){if(r===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let a=``,o=``,s=Object.keys(t);for(let e=0;e<s.length;e++){let c=s[e];if(t[c]!==null&&t[c]!==void 0){let e=D(t[c]);if(e===`symbol`||e===`function`)throw TypeError(`cannot serialize values of type '${e}'`);let s=E.test(c)?c:k(c);if(e===`array`&&O(t[c]))o+=(o&&`
|
||||
`)+N(t[c],n?`${n}.${s}`:s,r-1,i);else if(e===`object`){let e=n?`${n}.${s}`:s;o+=(o&&`
|
||||
`)+P(e,t[c],e,r-1,i)}else a+=s,a+=` = `,a+=A(t[c],e,r,i),a+=`
|
||||
`}}return e&&(a||!o)&&(a=a?`[${e}]\n${a}`:`[${e}]`),a&&o?`${a}\n${o}`:a||o}function F(e,{maxDepth:t=1e3,numbersAsFloat:n=!1}={}){if(D(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let r=P(0,e,``,t,n);return r[r.length-1]===`
|
||||
`?r:r+`
|
||||
`}export{T as n,F as t};
|
||||
Reference in new issue
Block a user