dumbymap
Version:
Generate interactive maps from Semantic HTML
391 lines (324 loc) • 1.13 MB
JavaScript
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
function isNothing(e){return null==e}var e$1={isNothing:isNothing,isObject:function isObject(e){return "object"==typeof e&&null!==e},toArray:function toArray(e){return Array.isArray(e)?e:isNothing(e)?[]:[e]},repeat:function repeat(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},isNegativeZero:function isNegativeZero(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},extend:function extend(e,t){var n,r,i,o;if(t)for(n=0,r=(o=Object.keys(t)).length;n<r;n+=1)e[i=o[n]]=t[i];return e}};function formatError(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+="\n\n"+e.mark.snippet),r+" "+n):r}function YAMLException$1(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=formatError(this,false),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||"";}YAMLException$1.prototype=Object.create(Error.prototype),YAMLException$1.prototype.constructor=YAMLException$1,YAMLException$1.prototype.toString=function toString(e){return this.name+": "+formatError(this,e)};var t$1=YAMLException$1;function getLine$1(e,t,n,r,i){var o="",a="",s=Math.floor(i/2)-1;return r-t>s&&(t=r-s+(o=" ... ").length),n-r>s&&(n=r+s-(a=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"→")+a,pos:r-t+o.length}}function padStart(t,n){return e$1.repeat(" ",n-t.length)+t}var n$1=function makeSnippet(t,n){if(n=Object.create(n||null),!t.buffer)return null;n.maxLength||(n.maxLength=79),"number"!=typeof n.indent&&(n.indent=1),"number"!=typeof n.linesBefore&&(n.linesBefore=3),"number"!=typeof n.linesAfter&&(n.linesAfter=2);for(var r,i=/\r?\n|\r|\0/g,o=[0],a=[],s=-1;r=i.exec(t.buffer);)a.push(r.index),o.push(r.index+r[0].length),t.position<=r.index&&s<0&&(s=o.length-2);s<0&&(s=o.length-1);var l,c,u="",p=Math.min(t.line+n.linesAfter,a.length).toString().length,f=n.maxLength-(n.indent+p+3);for(l=1;l<=n.linesBefore&&!(s-l<0);l++)c=getLine$1(t.buffer,o[s-l],a[s-l],t.position-(o[s]-o[s-l]),f),u=e$1.repeat(" ",n.indent)+padStart((t.line-l+1).toString(),p)+" | "+c.str+"\n"+u;for(c=getLine$1(t.buffer,o[s],a[s],t.position,f),u+=e$1.repeat(" ",n.indent)+padStart((t.line+1).toString(),p)+" | "+c.str+"\n",u+=e$1.repeat("-",n.indent+p+3+c.pos)+"^\n",l=1;l<=n.linesAfter&&!(s+l>=a.length);l++)c=getLine$1(t.buffer,o[s+l],a[s+l],t.position-(o[s]-o[s+l]),f),u+=e$1.repeat(" ",n.indent)+padStart((t.line+l+1).toString(),p)+" | "+c.str+"\n";return u.replace(/\n$/,"")},r$1=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],i$1=["scalar","sequence","mapping"];var o$1=function Type$1(e,n){if(n=n||{},Object.keys(n).forEach((function(n){if(-1===r$1.indexOf(n))throw new t$1('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')})),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return true},this.construct=n.construct||function(e){return e},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||false,this.styleAliases=function compileStyleAliases(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n;}));})),t}(n.styleAliases||null),-1===i$1.indexOf(this.kind))throw new t$1('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function compileList(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 Schema$1(e){return this.extend(e)}Schema$1.prototype.extend=function extend(e){var n=[],r=[];if(e instanceof o$1)r.push(e);else if(Array.isArray(e))r=r.concat(e);else {if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new t$1("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(n=n.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit));}n.forEach((function(e){if(!(e instanceof o$1))throw new t$1("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new t$1("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 t$1("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),r.forEach((function(e){if(!(e instanceof o$1))throw new t$1("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var i=Object.create(Schema$1.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=compileList(i,"implicit"),i.compiledExplicit=compileList(i,"explicit"),i.compiledTypeMap=function compileMap(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function collectType(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(collectType);return n}(i.compiledImplicit,i.compiledExplicit),i};var a$1=new Schema$1({explicit:[new o$1("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),new o$1("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),new o$1("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})]});var s$1=new o$1("tag:yaml.org,2002:null",{kind:"scalar",resolve:function resolveYamlNull(e){if(null===e)return true;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function constructYamlNull(){return null},predicate:function isNull(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"});var l$1=new o$1("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function resolveYamlBoolean(e){if(null===e)return false;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function constructYamlBoolean(e){return "true"===e||"True"===e||"TRUE"===e},predicate:function isBoolean(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 isOctCode(e){return 48<=e&&e<=55}function isDecCode(e){return 48<=e&&e<=57}var c$1=new o$1("tag:yaml.org,2002:int",{kind:"scalar",resolve:function resolveYamlInteger(e){if(null===e)return false;var t,n,r=e.length,i=0,o=false;if(!r)return false;if("-"!==(t=e[i])&&"+"!==t||(t=e[++i]),"0"===t){if(i+1===r)return true;if("b"===(t=e[++i])){for(i++;i<r;i++)if("_"!==(t=e[i])){if("0"!==t&&"1"!==t)return false;o=true;}return o&&"_"!==t}if("x"===t){for(i++;i<r;i++)if("_"!==(t=e[i])){if(!(48<=(n=e.charCodeAt(i))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return false;o=true;}return o&&"_"!==t}if("o"===t){for(i++;i<r;i++)if("_"!==(t=e[i])){if(!isOctCode(e.charCodeAt(i)))return false;o=true;}return o&&"_"!==t}}if("_"===t)return false;for(;i<r;i++)if("_"!==(t=e[i])){if(!isDecCode(e.charCodeAt(i)))return false;o=true;}return !(!o||"_"===t)},construct:function constructYamlInteger(e){var t,n=e,r=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(r=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return r*parseInt(n.slice(2),2);if("x"===n[1])return r*parseInt(n.slice(2),16);if("o"===n[1])return r*parseInt(n.slice(2),8)}return r*parseInt(n,10)},predicate:function isInteger(t){return "[object Number]"===Object.prototype.toString.call(t)&&t%1==0&&!e$1.isNegativeZero(t)},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"]}}),u$1=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var p$1=/^[-+]?[0-9]+e/;var f$1=new o$1("tag:yaml.org,2002:float",{kind:"scalar",resolve:function resolveYamlFloat(e){return null!==e&&!(!u$1.test(e)||"_"===e[e.length-1])},construct:function constructYamlFloat(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 isFloat(t){return "[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||e$1.isNegativeZero(t))},represent:function representYamlFloat(t,n){var r;if(isNaN(t))switch(n){case "lowercase":return ".nan";case "uppercase":return ".NAN";case "camelcase":return ".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(n){case "lowercase":return ".inf";case "uppercase":return ".INF";case "camelcase":return ".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(n){case "lowercase":return "-.inf";case "uppercase":return "-.INF";case "camelcase":return "-.Inf"}else if(e$1.isNegativeZero(t))return "-0.0";return r=t.toString(10),p$1.test(r)?r.replace("e",".e"):r},defaultStyle:"lowercase"}),h=a$1.extend({implicit:[s$1,l$1,c$1,f$1]}),d$1=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),m=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]))?))?$");var g=new o$1("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function resolveYamlTimestamp(e){return null!==e&&(null!==d$1.exec(e)||null!==m.exec(e))},construct:function constructYamlTimestamp(e){var t,n,r,i,o,a,s,l,c=0,u=null;if(null===(t=d$1.exec(e))&&(t=m.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(o=+t[4],a=+t[5],s=+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)),l=new Date(Date.UTC(n,r,i,o,a,s,c)),u&&l.setTime(l.getTime()-u),l},instanceOf:Date,represent:function representYamlTimestamp(e){return e.toISOString()}});var y=new o$1("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function resolveYamlMerge(e){return "<<"===e||null===e}}),b$1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var w=new o$1("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function resolveYamlBinary(e){if(null===e)return false;var t,n,r=0,i=e.length,o=b$1;for(n=0;n<i;n++)if(!((t=o.indexOf(e.charAt(n)))>64)){if(t<0)return false;r+=6;}return r%8==0},construct:function constructYamlBinary(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=b$1,a=0,s=[];for(t=0;t<i;t++)t%4==0&&t&&(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|o.indexOf(r.charAt(t));return 0===(n=i%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===n?(s.push(a>>10&255),s.push(a>>2&255)):12===n&&s.push(a>>4&255),new Uint8Array(s)},predicate:function isBinary(e){return "[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function representYamlBinary(e){var t,n,r="",i=0,o=e.length,a=b$1;for(t=0;t<o;t++)t%3==0&&t&&(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]),i=(i<<8)+e[t];return 0===(n=o%3)?(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]):2===n?(r+=a[i>>10&63],r+=a[i>>4&63],r+=a[i<<2&63],r+=a[64]):1===n&&(r+=a[i>>2&63],r+=a[i<<4&63],r+=a[64],r+=a[64]),r}}),A$1=Object.prototype.hasOwnProperty,S=Object.prototype.toString;var E=new o$1("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function resolveYamlOmap(e){if(null===e)return true;var t,n,r,i,o,a=[],s=e;for(t=0,n=s.length;t<n;t+=1){if(r=s[t],o=false,"[object Object]"!==S.call(r))return false;for(i in r)if(A$1.call(r,i)){if(o)return false;o=true;}if(!o)return false;if(-1!==a.indexOf(i))return false;a.push(i);}return true},construct:function constructYamlOmap(e){return null!==e?e:[]}}),v=Object.prototype.toString;var k=new o$1("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function resolveYamlPairs(e){if(null===e)return true;var t,n,r,i,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1){if(r=a[t],"[object Object]"!==v.call(r))return false;if(1!==(i=Object.keys(r)).length)return false;o[t]=[i[0],r[i[0]]];}return true},construct:function constructYamlPairs(e){if(null===e)return [];var t,n,r,i,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1)r=a[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}}),O$1=Object.prototype.hasOwnProperty;var C=new o$1("tag:yaml.org,2002:set",{kind:"mapping",resolve:function resolveYamlSet(e){if(null===e)return true;var t,n=e;for(t in n)if(O$1.call(n,t)&&null!==n[t])return false;return true},construct:function constructYamlSet(e){return null!==e?e:{}}}),_=h.extend({implicit:[g,y],explicit:[w,E,k,C]}),I$1=Object.prototype.hasOwnProperty,L=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,x=/[\x85\u2028\u2029]/,T=/[,\[\]\{\}]/,N=/^(?:!|!!|![a-z\-]+!)$/i,j=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function _class$2(e){return Object.prototype.toString.call(e)}function is_EOL(e){return 10===e||13===e}function is_WHITE_SPACE(e){return 9===e||32===e}function is_WS_OR_EOL(e){return 9===e||32===e||10===e||13===e}function is_FLOW_INDICATOR(e){return 44===e||91===e||93===e||123===e||125===e}function fromHexCode(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function simpleEscapeSequence(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 charFromCodepoint(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var M$1=new Array(256),F=new Array(256),Y=0;Y<256;Y++)M$1[Y]=simpleEscapeSequence(Y)?1:0,F[Y]=simpleEscapeSequence(Y);function State$1(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||_,this.onWarning=t.onWarning||null,this.legacy=t.legacy||false,this.json=t.json||false,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 generateError(e,r){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=n$1(i),new t$1(r,i)}function throwError(e,t){throw generateError(e,t)}function throwWarning(e,t){e.onWarning&&e.onWarning.call(null,generateError(e,t));}var W={YAML:function handleYamlDirective(e,t,n){var r,i,o;null!==e.version&&throwError(e,"duplication of %YAML directive"),1!==n.length&&throwError(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&throwError(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&throwError(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&throwWarning(e,"unsupported YAML version of the document");},TAG:function handleTagDirective(e,t,n){var r,i;2!==n.length&&throwError(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],N.test(r)||throwError(e,"ill-formed tag handle (first argument) of the TAG directive"),I$1.call(e.tagMap,r)&&throwError(e,'there is a previously declared suffix for "'+r+'" tag handle'),j.test(i)||throwError(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i);}catch(t){throwError(e,"tag prefix is malformed: "+i);}e.tagMap[r]=i;}};function captureSegment(e,t,n,r){var i,o,a,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,o=s.length;i<o;i+=1)9===(a=s.charCodeAt(i))||32<=a&&a<=1114111||throwError(e,"expected valid JSON character");else L.test(s)&&throwError(e,"the stream contains non-printable characters");e.result+=s;}}function mergeMappings(t,n,r,i){var o,a,s,l;for(e$1.isObject(r)||throwError(t,"cannot merge mappings; the provided source object is unacceptable"),s=0,l=(o=Object.keys(r)).length;s<l;s+=1)a=o[s],I$1.call(n,a)||(n[a]=r[a],i[a]=true);}function storeMappingPair(e,t,n,r,i,o,a,s,l){var c,u;if(Array.isArray(i))for(c=0,u=(i=Array.prototype.slice.call(i)).length;c<u;c+=1)Array.isArray(i[c])&&throwError(e,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===_class$2(i[c])&&(i[c]="[object Object]");if("object"==typeof i&&"[object Object]"===_class$2(i)&&(i="[object Object]"),i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(c=0,u=o.length;c<u;c+=1)mergeMappings(e,t,o[c],n);else mergeMappings(e,t,o,n);else e.json||I$1.call(n,i)||!I$1.call(t,i)||(e.line=a||e.line,e.lineStart=s||e.lineStart,e.position=l||e.position,throwError(e,"duplicated mapping key")),"__proto__"===i?Object.defineProperty(t,i,{configurable:true,enumerable:true,writable:true,value:o}):t[i]=o,delete n[i];return t}function readLineBreak(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):throwError(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1;}function skipSeparationSpace(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);0!==i;){for(;is_WHITE_SPACE(i);)9===i&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&35===i)do{i=e.input.charCodeAt(++e.position);}while(10!==i&&13!==i&&0!==i);if(!is_EOL(i))break;for(readLineBreak(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position);}return -1!==n&&0!==r&&e.lineIndent<n&&throwWarning(e,"deficient indentation"),r}function testDocumentSeparator(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))&&!is_WS_OR_EOL(t)))}function writeFoldedLines(t,n){1===n?t.result+=" ":n>1&&(t.result+=e$1.repeat("\n",n-1));}function readBlockSequence(e,t){var n,r,i=e.tag,o=e.anchor,a=[],s=false;if(-1!==e.firstTabInLine)return false;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),r=e.input.charCodeAt(e.position);0!==r&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,throwError(e,"tab characters must not be used in indentation")),45===r)&&is_WS_OR_EOL(e.input.charCodeAt(e.position+1));)if(s=true,e.position++,skipSeparationSpace(e,true,-1)&&e.lineIndent<=t)a.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,composeNode(e,t,3,false,true),a.push(e.result),skipSeparationSpace(e,true,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)throwError(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return !!s&&(e.tag=i,e.anchor=o,e.kind="sequence",e.result=a,true)}function readTagProperty(e){var t,n,r,i,o=false,a=false;if(33!==(i=e.input.charCodeAt(e.position)))return false;if(null!==e.tag&&throwError(e,"duplication of a tag property"),60===(i=e.input.charCodeAt(++e.position))?(o=true,i=e.input.charCodeAt(++e.position)):33===i?(a=true,n="!!",i=e.input.charCodeAt(++e.position)):n="!",t=e.position,o){do{i=e.input.charCodeAt(++e.position);}while(0!==i&&62!==i);e.position<e.length?(r=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):throwError(e,"unexpected end of the stream within a verbatim tag");}else {for(;0!==i&&!is_WS_OR_EOL(i);)33===i&&(a?throwError(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),N.test(n)||throwError(e,"named tag handle cannot contain such characters"),a=true,t=e.position+1)),i=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),T.test(r)&&throwError(e,"tag suffix cannot contain flow indicator characters");}r&&!j.test(r)&&throwError(e,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r);}catch(t){throwError(e,"tag name is malformed: "+r);}return o?e.tag=r:I$1.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:throwError(e,'undeclared tag handle "'+n+'"'),true}function readAnchorProperty(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return false;for(null!==e.anchor&&throwError(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!is_WS_OR_EOL(n)&&!is_FLOW_INDICATOR(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&throwError(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),true}function composeNode(t,n,r,i,o){var a,s,l,c,u,p,f,h,d,m=1,g=false,y=false;if(null!==t.listener&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,a=s=l=4===r||3===r,i&&skipSeparationSpace(t,true,-1)&&(g=true,t.lineIndent>n?m=1:t.lineIndent===n?m=0:t.lineIndent<n&&(m=-1)),1===m)for(;readTagProperty(t)||readAnchorProperty(t);)skipSeparationSpace(t,true,-1)?(g=true,l=a,t.lineIndent>n?m=1:t.lineIndent===n?m=0:t.lineIndent<n&&(m=-1)):l=false;if(l&&(l=g||o),1!==m&&4!==r||(h=1===r||2===r?n:n+1,d=t.position-t.lineStart,1===m?l&&(readBlockSequence(t,d)||function readBlockMapping(e,t,n){var r,i,o,a,s,l,c,u=e.tag,p=e.anchor,f={},h=Object.create(null),d=null,m=null,g=null,y=false,b=false;if(-1!==e.firstTabInLine)return false;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,throwError(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,63!==c&&58!==c||!is_WS_OR_EOL(r)){if(a=e.line,s=e.lineStart,l=e.position,!composeNode(e,n,2,false,true))break;if(e.line===o){for(c=e.input.charCodeAt(e.position);is_WHITE_SPACE(c);)c=e.input.charCodeAt(++e.position);if(58===c)is_WS_OR_EOL(c=e.input.charCodeAt(++e.position))||throwError(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(storeMappingPair(e,f,h,d,m,null,a,s,l),d=m=g=null),b=true,y=false,i=false,d=e.tag,m=e.result;else {if(!b)return e.tag=u,e.anchor=p,true;throwError(e,"can not read an implicit mapping pair; a colon is missed");}}else {if(!b)return e.tag=u,e.anchor=p,true;throwError(e,"can not read a block mapping entry; a multiline key may not be an implicit key");}}else 63===c?(y&&(storeMappingPair(e,f,h,d,m,null,a,s,l),d=m=g=null),b=true,y=true,i=true):y?(y=false,i=true):throwError(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,c=r;if((e.line===o||e.lineIndent>t)&&(y&&(a=e.line,s=e.lineStart,l=e.position),composeNode(e,t,4,true,i)&&(y?m=e.result:g=e.result),y||(storeMappingPair(e,f,h,d,m,g,a,s,l),d=m=g=null),skipSeparationSpace(e,true,-1),c=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==c)throwError(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&storeMappingPair(e,f,h,d,m,null,a,s,l),b&&(e.tag=u,e.anchor=p,e.kind="mapping",e.result=f),b}(t,d,h))||function readFlowCollection(e,t){var n,r,i,o,a,s,l,c,u,p,f,h,d=true,m=e.tag,g=e.anchor,y=Object.create(null);if(91===(h=e.input.charCodeAt(e.position)))a=93,c=false,o=[];else {if(123!==h)return false;a=125,c=true,o={};}for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),h=e.input.charCodeAt(++e.position);0!==h;){if(skipSeparationSpace(e,true,t),(h=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=m,e.anchor=g,e.kind=c?"mapping":"sequence",e.result=o,true;d?44===h&&throwError(e,"expected the node content, but found ','"):throwError(e,"missed comma between flow collection entries"),f=null,s=l=false,63===h&&is_WS_OR_EOL(e.input.charCodeAt(e.position+1))&&(s=l=true,e.position++,skipSeparationSpace(e,true,t)),n=e.line,r=e.lineStart,i=e.position,composeNode(e,t,1,false,true),p=e.tag,u=e.result,skipSeparationSpace(e,true,t),h=e.input.charCodeAt(e.position),!l&&e.line!==n||58!==h||(s=true,h=e.input.charCodeAt(++e.position),skipSeparationSpace(e,true,t),composeNode(e,t,1,false,true),f=e.result),c?storeMappingPair(e,o,y,p,u,f,n,r,i):s?o.push(storeMappingPair(e,null,y,p,u,f,n,r,i)):o.push(u),skipSeparationSpace(e,true,t),44===(h=e.input.charCodeAt(e.position))?(d=true,h=e.input.charCodeAt(++e.position)):d=false;}throwError(e,"unexpected end of the stream within a flow collection");}(t,h)?y=true:(s&&function readBlockScalar(t,n){var r,i,o,a,s,l=1,c=false,u=false,p=n,f=0,h=false;if(124===(a=t.input.charCodeAt(t.position)))i=false;else {if(62!==a)return false;i=true;}for(t.kind="scalar",t.result="";0!==a;)if(43===(a=t.input.charCodeAt(++t.position))||45===a)1===l?l=43===a?3:2:throwError(t,"repeat of a chomping mode identifier");else {if(!((o=48<=(s=a)&&s<=57?s-48:-1)>=0))break;0===o?throwError(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?throwError(t,"repeat of an indentation width identifier"):(p=n+o-1,u=true);}if(is_WHITE_SPACE(a)){do{a=t.input.charCodeAt(++t.position);}while(is_WHITE_SPACE(a));if(35===a)do{a=t.input.charCodeAt(++t.position);}while(!is_EOL(a)&&0!==a)}for(;0!==a;){for(readLineBreak(t),t.lineIndent=0,a=t.input.charCodeAt(t.position);(!u||t.lineIndent<p)&&32===a;)t.lineIndent++,a=t.input.charCodeAt(++t.position);if(!u&&t.lineIndent>p&&(p=t.lineIndent),is_EOL(a))f++;else {if(t.lineIndent<p){3===l?t.result+=e$1.repeat("\n",c?1+f:f):1===l&&c&&(t.result+="\n");break}for(i?is_WHITE_SPACE(a)?(h=true,t.result+=e$1.repeat("\n",c?1+f:f)):h?(h=false,t.result+=e$1.repeat("\n",f+1)):0===f?c&&(t.result+=" "):t.result+=e$1.repeat("\n",f):t.result+=e$1.repeat("\n",c?1+f:f),c=true,u=true,f=0,r=t.position;!is_EOL(a)&&0!==a;)a=t.input.charCodeAt(++t.position);captureSegment(t,r,t.position,false);}}return true}(t,h)||function readSingleQuotedScalar(e,t){var n,r,i;if(39!==(n=e.input.charCodeAt(e.position)))return false;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(captureSegment(e,r,e.position,true),39!==(n=e.input.charCodeAt(++e.position)))return true;r=e.position,e.position++,i=e.position;}else is_EOL(n)?(captureSegment(e,r,i,true),writeFoldedLines(e,skipSeparationSpace(e,false,t)),r=i=e.position):e.position===e.lineStart&&testDocumentSeparator(e)?throwError(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);throwError(e,"unexpected end of the stream within a single quoted scalar");}(t,h)||function readDoubleQuotedScalar(e,t){var n,r,i,o,a,s,l;if(34!==(s=e.input.charCodeAt(e.position)))return false;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return captureSegment(e,n,e.position,true),e.position++,true;if(92===s){if(captureSegment(e,n,e.position,true),is_EOL(s=e.input.charCodeAt(++e.position)))skipSeparationSpace(e,false,t);else if(s<256&&M$1[s])e.result+=F[s],e.position++;else if((a=120===(l=s)?2:117===l?4:85===l?8:0)>0){for(i=a,o=0;i>0;i--)(a=fromHexCode(s=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+a:throwError(e,"expected hexadecimal character");e.result+=charFromCodepoint(o),e.position++;}else throwError(e,"unknown escape sequence");n=r=e.position;}else is_EOL(s)?(captureSegment(e,n,r,true),writeFoldedLines(e,skipSeparationSpace(e,false,t)),n=r=e.position):e.position===e.lineStart&&testDocumentSeparator(e)?throwError(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position);}throwError(e,"unexpected end of the stream within a double quoted scalar");}(t,h)?y=true:!function readAlias(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return false;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!is_WS_OR_EOL(r)&&!is_FLOW_INDICATOR(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&throwError(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),I$1.call(e.anchorMap,n)||throwError(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],skipSeparationSpace(e,true,-1),true}(t)?function readPlainScalar(e,t,n){var r,i,o,a,s,l,c,u,p=e.kind,f=e.result;if(is_WS_OR_EOL(u=e.input.charCodeAt(e.position))||is_FLOW_INDICATOR(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return false;if((63===u||45===u)&&(is_WS_OR_EOL(r=e.input.charCodeAt(e.position+1))||n&&is_FLOW_INDICATOR(r)))return false;for(e.kind="scalar",e.result="",i=o=e.position,a=false;0!==u;){if(58===u){if(is_WS_OR_EOL(r=e.input.charCodeAt(e.position+1))||n&&is_FLOW_INDICATOR(r))break}else if(35===u){if(is_WS_OR_EOL(e.input.charCodeAt(e.position-1)))break}else {if(e.position===e.lineStart&&testDocumentSeparator(e)||n&&is_FLOW_INDICATOR(u))break;if(is_EOL(u)){if(s=e.line,l=e.lineStart,c=e.lineIndent,skipSeparationSpace(e,false,-1),e.lineIndent>=t){a=true,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=l,e.lineIndent=c;break}}a&&(captureSegment(e,i,o,false),writeFoldedLines(e,e.line-s),i=o=e.position,a=false),is_WHITE_SPACE(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position);}return captureSegment(e,i,o,false),!!e.result||(e.kind=p,e.result=f,false)}(t,h,1===r)&&(y=true,null===t.tag&&(t.tag="?")):(y=true,null===t.tag&&null===t.anchor||throwError(t,"alias node should not have any properties")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===m&&(y=l&&readBlockSequence(t,d))),null===t.tag)null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);else if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&throwError(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),c=0,u=t.implicitTypes.length;c<u;c+=1)if((f=t.implicitTypes[c]).resolve(t.result)){t.result=f.construct(t.result),t.tag=f.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else if("!"!==t.tag){if(I$1.call(t.typeMap[t.kind||"fallback"],t.tag))f=t.typeMap[t.kind||"fallback"][t.tag];else for(f=null,c=0,u=(p=t.typeMap.multi[t.kind||"fallback"]).length;c<u;c+=1)if(t.tag.slice(0,p[c].tag.length)===p[c].tag){f=p[c];break}f||throwError(t,"unknown tag !<"+t.tag+">"),null!==t.result&&f.kind!==t.kind&&throwError(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+f.kind+'", not "'+t.kind+'"'),f.resolve(t.result,t.tag)?(t.result=f.construct(t.result,t.tag),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):throwError(t,"cannot resolve a node with !<"+t.tag+"> explicit tag");}return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||y}function readDocument(e){var t,n,r,i,o=e.position,a=false;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&(skipSeparationSpace(e,true,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(a=true,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!is_WS_OR_EOL(i);)i=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&throwError(e,"directive name must not be less than one character in length");0!==i;){for(;is_WHITE_SPACE(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position);}while(0!==i&&!is_EOL(i));break}if(is_EOL(i))break;for(t=e.position;0!==i&&!is_WS_OR_EOL(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position));}0!==i&&readLineBreak(e),I$1.call(W,n)?W[n](e,n,r):throwWarning(e,'unknown document directive "'+n+'"');}skipSeparationSpace(e,true,-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,skipSeparationSpace(e,true,-1)):a&&throwError(e,"directives end mark is expected"),composeNode(e,e.lineIndent-1,4,false,true),skipSeparationSpace(e,true,-1),e.checkLineBreaks&&x.test(e.input.slice(o,e.position))&&throwWarning(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&testDocumentSeparator(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,skipSeparationSpace(e,true,-1)):e.position<e.length-1&&throwError(e,"end of the stream or a document separator is expected");}function loadDocuments(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 State$1(e,t),r=e.indexOf("\0");for(-1!==r&&(n.position=r,throwError(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;)readDocument(n);return n.documents}var D={loadAll:function loadAll$1(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var r=loadDocuments(e,n);if("function"!=typeof t)return r;for(var i=0,o=r.length;i<o;i+=1)t(r[i]);},load:function load$1(e,n){var r=loadDocuments(e,n);if(0!==r.length){if(1===r.length)return r[0];throw new t$1("expected a single document in the stream, but found more")}}},R=D.load,B=D.loadAll;const P$1=Object.freeze({use:{Leaflet:{value:"./renderers/leaflet.mjs",url:"https://github.com/outdoorsafetylab/mapclay/blob/HEAD/src/BasicLeafletRenderer.mjs",description:"Leaflet is the leading open-source JavaScript library for mobile-friendly interactive maps. It has all the mapping features most developers ever need."},Maplibre:{value:"./renderers/maplibre.mjs",url:"https://github.com/outdoorsafetylab/mapclay/blob/HEAD/src/BasicMaplibreRenderer.mjs",description:"MapLibre GL JS is a TypeScript library that uses WebGL to render interactive maps from vector tiles in a browser. The customization of the map comply with the MapLibre Style Spec."},Openlayers:{value:"./renderers/openlayers.mjs",url:"https://github.com/outdoorsafetylab/mapclay/blob/HEAD/src/BasicOpenlayersRenderer.mjs",description:"OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles, vector data and markers loaded from any source. OpenLayers has been developed to further the use of geographic information of all kinds."}}}),applyDefaultAliases=e=>({use:e.use??"Leaflet",width:"100%",...e,aliases:{...P$1,...e.aliases??{}}}),parseConfigsFromYaml=e=>{const t=[];return B(e,(e=>{"object"!=typeof e||Array.isArray(e)?t.length>0&&(t.at(-1).eval=e.toString()):t.push(e??{});})),0===t.length?[{}]:t},$={},setValueByAliases=e=>e.aliases?(Object.entries(e).filter((([e,t])=>"aliases"!==e&&"string"==typeof t&&t.match(/^[A-Z]/))).forEach((([t,n])=>{const r=e.aliases?.[t]?.[n],i="object"!=typeof r||Array.isArray(r)?r:r.value;i&&(e[t]=i,"use"===t&&(e.url=r.url,e.desc=r.desc));})),e):e,applyOtherConfig=async e=>{if(!e.apply)return e;await(async e=>{e&&!$[e]&&($[e]=await fetch(e).then((e=>{if(200!==e.status)throw Error();return e.text()})).then((e=>R(e))).catch((t=>{throw Error(`Fail to fetch applied config ${e}`,t)})));})(e.apply);const t=$[e.apply];if(!t)throw Error("Fail to fetch remote config "+e.aply);return {...t,...e,aliases:{...t.aliases,...e.aliases??{}}}},prepareRenderer=async e=>{let t;if(e.use)if(e.use.steps)t=e.use;else if("function"==typeof e.use){const n=e.use;t=new n;}else {if("string"!=typeof e.use)throw Error("Cannot get Renderer by config.use",e.use);{const n=(await import(e.use)).default;t=new n;}}else t=e;return Object.entries(e).forEach((([e,n])=>t[e]=n)),t},healthCheck=e=>{if(!e.steps)throw e.steps=[],Error("not health");return e},renderWithConfig=async e=>{e.results=[];const t=[setValueByAliases,applyOtherConfig,setValueByAliases,prepareRenderer,healthCheck],n=(e=>{let t=e;return e=>e.reduce(((e,n)=>e.then((async()=>t.results.at(-1)?.state?.match(/fail|stop/)?{state:"stop",reason:"stop by previous step"}:(t=await n(t),t))).then((e=>t.results.push({type:"prepare",func:n.valueOf(),state:e?.state??"success",result:e?.reason??t}))).catch((e=>{t.results.push({type:"prepare",func:n.valueOf(),state:"fail",result:e});})).then((()=>{t.prepareCallback?.(t,t.results);}))),Promise.resolve(t)).then((()=>t))})(e)(t).then((e=>(e=>(e.steps??[]).reduce(((t,n)=>t.then((()=>{if("stop"===e.results.at(-1).state)return {state:"stop",reason:"stop by previous step"};if(n.depends){const t=e.results.findLast((e=>e.func===n.depends))?.state;if(t.match(/skip|fail/))return {state:"skip"}}return n.valueOf().bind(e)(e)})).then((t=>e.results.push({type:"render",func:n.valueOf(),state:t?.state??"success",result:t?.reason??t}))).catch((t=>e.results.push({type:"render",func:n.valueOf(),state:"fail",result:t}))).then((()=>{e.stepCallback?.(e,e);}))),Promise.resolve()).then((()=>e)))(e))).then((e=>{const t=!e.results||0===e.results.length||!e.results.find((e=>e.state.match(/success/)))||e.results.find((e=>e.state.match(/fail|stop/)))?"unfulfilled":"fulfilled";return e?.target?.setAttribute("data-render",t),e}));return n.valueOf=()=>e.results,n},setValueOf=e=>(e.valueOf=()=>JSON.stringify(e,((e,t)=>e.match(/aliases|target/)?void 0:t)),e),shouldRender=e=>!(e.target instanceof window.HTMLElement&&e.target.classList.contains("mapclay")&&e.valueOf()===e.target.getAttribute("data-mapclay")&&"fulfilled"===e.target.getAttribute("data-render")),renderWith=e=>(t,n)=>{e=e??(e=>e);const r="object"==typeof n?Array.isArray(n)?n.map(e):[n].map(e):null;if(!r)throw Error(`Invalid config files: ${n}`);t.innerHTML="";return r.map(setValueOf).map((e=>{if(shouldRender(e)){const t=document.createElement("div");e.id&&(t.id=e.id.replaceAll(" ","_"),t.title=`ID: ${t.id}`),t.classList.add("mapclay"),e.target=t,t.dataset.render="rendering",t.dataset.mapclay=e.valueOf();}return t.append(e.target),window.CSS.supports(`width: ${e.width}`)&&(e.target.style.width=e.width),window.CSS.supports(`height: ${e.height}`)&&(e.target.style.height=e.height),e})).filter(shouldRender).map(renderWithConfig)},renderByYamlWith=(e=null)=>async(t,n=null)=>{const r=n??t.textContent,i=parseConfigsFromYaml(r);return renderWith(e)(t,i)},q=renderWith(applyDefaultAliases),U=renderByYamlWith(applyDefaultAliases);document.currentScript&&(globalThis.mapclay={render:q,renderWith:renderWith,renderByYaml:U,renderByYamlWith:renderByYamlWith});
/* eslint-disable no-bitwise */
const decodeCache = {};
function getDecodeCache (exclude) {
let cache = decodeCache[exclude];
if (cache) { return cache }
cache = decodeCache[exclude] = [];
for (let i = 0; i < 128; i++) {
const ch = String.fromCharCode(i);
cache.push(ch);
}
for (let i = 0; i < exclude.length; i++) {
const ch = exclude.charCodeAt(i);
cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2);
}
return cache
}
// Decode percent-encoded string.
//
function decode$2 (string, exclude) {
if (typeof exclude !== 'string') {
exclude = decode$2.defaultChars;
}
const cache = getDecodeCache(exclude);
return string.replace(/(%[a-f0-9]{2})+/gi, function (seq) {
let result = '';
for (let i = 0, l = seq.length; i < l; i += 3) {
const b1 = parseInt(seq.slice(i + 1, i + 3), 16);
if (b1 < 0x80) {
result += cache[b1];
continue
}
if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {
// 110xxxxx 10xxxxxx
const b2 = parseInt(seq.slice(i + 4, i + 6), 16);
if ((b2 & 0xC0) === 0x80) {
const chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F);
if (chr < 0x80) {
result += '\ufffd\ufffd';
} else {
result += String.fromCharCode(chr);
}
i += 3;
continue
}
}
if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {
// 1110xxxx 10xxxxxx 10xxxxxx
const b2 = parseInt(seq.slice(i + 4, i + 6), 16);
const b3 = parseInt(seq.slice(i + 7, i + 9), 16);
if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {
const chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F);
if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {
result += '\ufffd\ufffd\ufffd';
} else {
result += String.fromCharCode(chr);
}
i += 6;
continue
}
}
if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {
// 111110xx 10xxxxxx 10xxxxxx 10xxxxxx
const b2 = parseInt(seq.slice(i + 4, i + 6), 16);
const b3 = parseInt(seq.slice(i + 7, i + 9), 16);
const b4 = parseInt(seq.slice(i + 10, i + 12), 16);
if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {
let chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F);
if (chr < 0x10000 || chr > 0x10FFFF) {
result += '\ufffd\ufffd\ufffd\ufffd';
} else {
chr -= 0x10000;
result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF));
}
i += 9;
continue
}
}
result += '\ufffd';
}
return result
})
}
decode$2.defaultChars = ';/?:@&=+$,#';
decode$2.componentChars = '';
const encodeCache = {};
// Create a lookup array where anything but characters in `chars` string
// and alphanumeric chars is percent-encoded.
//
function getEncodeCache (exclude) {
let cache = encodeCache[exclude];
if (cache) { return cache }
cache = encodeCache[exclude] = [];
for (let i = 0; i < 128; i++) {
const ch = String.fromCharCode(i);
if (/^[0-9a-z]$/i.test(ch)) {
// always allow unencoded alphanumeric characters
cache.push(ch);
} else {
cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2));
}
}
for (let i = 0; i < exclude.length; i++) {
cache[exclude.charCodeAt(i)] = exclude[i];
}
return cache
}
// Encode unsafe characters with percent-encoding, skipping already
// encoded sequences.
//
// - string - string to encode
// - exclude - list of characters to ignore (in addition to a-zA-Z0-9)
// - keepEscaped - don't encode '%' in a correct escape sequence (default: true)
//
function encode$2 (string, exclude, keepEscaped) {
if (typeof exclude !== 'string') {
// encode(string, keepEscaped)
keepEscaped = exclude;
exclude = encode$2.defaultChars;
}
if (typeof keepEscaped === 'undefined') {
keepEscaped = true;
}
const cache = getEncodeCache(exclude);
let result = '';
for (let i = 0, l = string.length; i < l; i++) {
const code = string.charCodeAt(i);
if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {
if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {
result += string.slice(i, i + 3);
i += 2;
continue
}
}
if (code < 128) {
result += cache[code];
continue
}
if (code >= 0xD800 && code <= 0xDFFF) {
if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {
const nextCode = string.charCodeAt(i + 1);
if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {
result += encodeURIComponent(string[i] + string[i + 1]);
i++;
continue
}
}
result += '%EF%BF%BD';
continue
}
result += encodeURIComponent(string[i]);
}
return result
}
encode$2.defaultChars = ";/?:@&=+$,-_.!~*'()#";
encode$2.componentChars = "-_.!~*'()";
function format (url) {
let result = '';
result += url.protocol || '';
result += url.slashes ? '//' : '';
result += url.auth ? url.auth + '@' : '';
if (url.hostname && url.hostname.indexOf(':') !== -1) {
// ipv6 address
result += '[' + url.hostname + ']';
} else {
result += url.hostname || '';
}
result += url.port ? ':' + url.port : '';
result += url.pathname || '';
result += url.search || '';
result += url.hash || '';
return result
}
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Changes from joyent/node:
//
// 1. No leading slash in paths,
// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`
//
// 2. Backslashes are not replaced with slashes,
// so `http:\\example.org\` is treated like a relative path
//
// 3. Trailing colon is treated like a part of the path,
// i.e. in `http://example.org:foo` pathname is `:foo`
//
// 4. Nothing is URL-encoded in the resulting object,
// (in joyent/node some chars in auth and paths are encoded)
//
// 5. `url.parse()` does not have `parseQueryString` argument
//
// 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,
// which can be constructed using other parts of the url.
//
function Url () {
this.protocol = null;
this.slashes = null;
this.auth = null;
this.port = null;
this.hostname = null;
this.hash = null;
this.search = null;
this.pathname = null;
}
// Reference: RFC 3986, RFC 1808, RFC 2396
// define these here so at least they only have to be
// compiled once on the first module load.
const protocolPattern = /^([a-z0-9.+-]+:)/i;
const portPattern = /:[0-9]*$/;
// Special case for a simple path URL
/* eslint-disable-next-line no-useless-escape */
const simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/;
// RFC 2396: characters reserved for delimiting URLs.
// We actually just auto-escape these.
const delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'];
// RFC 2396: characters not allowed for various reasons.
const unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims);
// Allowed by RFCs, but cause of XSS attacks. Always escape these.
const autoEscape = ['\''].concat(unwise);
// Characters that are never ever allowed in a hostname.
// Note that any invalid chars are also handled, but these
// are the ones that are *expected* to be seen, so we fast-path
// them.
const nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape);
const hostEndingChars = ['/', '?', '#'];
const hostnameMaxLen = 255;
const hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/;
const hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/;
// protocols that can allow "unsafe" and "unwise" chars.
// protocols that never have a hostname.
const hostlessProtocol = {
javascript: true,
'javascript:': true
};
// protocols that always contain a // bit.
const slashedProtocol = {
http: true,
https: true,
ftp: true,
gopher: true,
file: true,
'http:': true,
'https:': true,
'ftp:': true,
'gopher:': true,
'file:': true
};
function urlParse (url, slashesDenoteHost) {
if (url && url instanceof Url) return url
const u = new Url();
u.parse(url, slashesDenoteHost);
return u
}
Url.prototype.parse = function (url, slashesDenoteHost) {
let lowerProto, hec, slashes;
let rest = url;
// trim before proceeding.
// This is to support parse stuff like " http://foo.com \n"
rest = rest.trim();
if (!slashesDenoteHost && url.split('#').length === 1) {
// Try fast path regexp
const simplePath = simplePathPattern.exec(rest);
if (simplePath) {
this.pathname = simplePath[1];
if (simplePath[2]) {
this.search = simplePath[2];
}
return this
}
}
let proto = protocolPattern.exec(rest);
if (proto) {
proto = proto[0];
lowerProto = proto.toLowerCase();
this.protocol = proto;
rest = rest.substr(proto.length);
}
// figure out if it's got a host
// user@server is *always* interpreted as a hostname, and url
// resolution will treat //foo/bar as host=foo,path=bar because that's
// how the browser resolves relative URLs.
/* eslint-disable-next-line no-useless-escape */
if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
slashes = rest.substr(0, 2) === '//';
if (slashes && !(proto && hostlessProtocol[proto])) {
rest = rest.substr(2);
this.slashes = true;
}
}
if (!hostlessProtocol[proto] &&
(slashes || (proto && !slashedProtocol[proto]))) {
// there's a hostname.
// the first instance of /, ?, ;, or # ends the host.
//
// If there is an @ in the hostname, then non-host chars *are* allowed
// to the left of the last @ sign, unless some host-ending character
// comes *before* the @-sign.
// URLs are obnoxious.
//
// ex:
// http://a@b@c/ => user:a@b host:c
// http://a@b?@c => user:a host:c path:/?@c
// v0.12 TODO(isaacs): This is not quite how Chrome does things.
// Review