vault backup: 2025-09-07 21:45:30
This commit is contained in:
1 parent
d0b9f7a051
commit
d7a002202d
70 files changed
+443880
-5675
No files matched your search
@@ -0,0 +1 @@
|
||||
"use strict";exports.c=function(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')};
|
||||
@@ -0,0 +1,2 @@
|
||||
/*!! License: https://unpkg.com/@marp-team/marp-cli@2.5.0/lib/bespoke.js.LICENSE.txt */
|
||||
!function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t={from:function(e,t){var n,r=1===(e.parent||e).nodeType?e.parent||e:document.querySelector(e.parent||e),o=[].filter.call("string"==typeof e.slides?r.querySelectorAll(e.slides):e.slides||r.children,(function(e){return"SCRIPT"!==e.nodeName})),i={},a=function(e,t){return(t=t||{}).index=o.indexOf(e),t.slide=e,t},s=function(e,t){i[e]=(i[e]||[]).filter((function(e){return e!==t}))},l=function(e,t){return(i[e]||[]).reduce((function(e,n){return e&&!1!==n(t)}),!0)},c=function(e,t){o[e]&&(n&&l("deactivate",a(n,t)),n=o[e],l("activate",a(n,t)))},d=function(e,t){var r=o.indexOf(n)+e;l(e>0?"next":"prev",a(n,t))&&c(r,t)},u={off:s,on:function(e,t){return(i[e]||(i[e]=[])).push(t),s.bind(null,e,t)},fire:l,slide:function(e,t){if(!arguments.length)return o.indexOf(n);l("slide",a(o[e],t))&&c(e,t)},next:d.bind(null,1),prev:d.bind(null,-1),parent:r,slides:o,destroy:function(e){l("destroy",a(n,e)),i={}}};return(t||[]).forEach((function(e){e(u)})),n||c(0),u}},n=e(t);const r=document.body,o=(...e)=>history.replaceState(...e),i="presenter",a="next",s=["",i,a],l="bespoke-marp-",c=`data-${l}`,d=(e,{protocol:t,host:n,pathname:r,hash:o}=location)=>{const i=e.toString();return`${t}//${n}${r}${i?"?":""}${i}${o}`},u=()=>r.dataset.bespokeView,f=e=>new URLSearchParams(location.search).get(e),m=(e,t={})=>{var n;const r={location,setter:o,...t},i=new URLSearchParams(r.location.search);for(const t of Object.keys(e)){const n=e[t];"string"==typeof n?i.set(t,n):i.delete(t)}try{r.setter({...null!==(n=window.history.state)&&void 0!==n?n:{}},"",d(i,r.location))}catch(e){console.error(e)}},g=(()=>{const e="bespoke-marp";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}})(),p=e=>{try{return localStorage.getItem(e)}catch(e){return null}},v=(e,t)=>{try{return localStorage.setItem(e,t),!0}catch(e){return!1}},h=e=>{try{return localStorage.removeItem(e),!0}catch(e){return!1}},y=(e,t)=>{const n="aria-hidden";t?e.setAttribute(n,"true"):e.removeAttribute(n)},b=e=>{e.parent.classList.add(`${l}parent`),e.slides.forEach((e=>e.classList.add(`${l}slide`))),e.on("activate",(t=>{const n=`${l}active`,r=t.slide,o=r.classList,i=!o.contains(n);if(e.slides.forEach((e=>{e.classList.remove(n),y(e,!0)})),o.add(n),y(r,!1),i){const e=`${n}-ready`;o.add(e),document.body.clientHeight,o.remove(e)}}))},w=e=>{let t=0,n=0;Object.defineProperty(e,"fragments",{enumerable:!0,value:e.slides.map((e=>[null,...e.querySelectorAll("[data-marpit-fragment]")]))});const r=r=>void 0!==e.fragments[t][n+r],o=(r,o)=>{t=r,n=o,e.fragments.forEach(((e,t)=>{e.forEach(((e,n)=>{if(null==e)return;const i=t<r||t===r&&n<=o;e.setAttribute(`${c}fragment`,(i?"":"in")+"active");const a=`${c}current-fragment`;t===r&&n===o?e.setAttribute(a,"current"):e.removeAttribute(a)}))})),e.fragmentIndex=o;const i={slide:e.slides[r],index:r,fragments:e.fragments[r],fragmentIndex:o};e.fire("fragment",i)};e.on("next",(({fragment:i=!0})=>{if(i){if(r(1))return o(t,n+1),!1;const i=t+1;e.fragments[i]&&o(i,0)}else{const r=e.fragments[t].length;if(n+1<r)return o(t,r-1),!1;const i=e.fragments[t+1];i&&o(t+1,i.length-1)}})),e.on("prev",(({fragment:i=!0})=>{if(r(-1)&&i)return o(t,n-1),!1;const a=t-1;e.fragments[a]&&o(a,e.fragments[a].length-1)})),e.on("slide",(({index:t,fragment:n})=>{let r=0;if(void 0!==n){const o=e.fragments[t];if(o){const{length:e}=o;r=-1===n?e-1:Math.min(Math.max(n,0),e-1)}}o(t,r)})),o(0,0)},x=document,k=()=>!(!x.fullscreenEnabled&&!x.webkitFullscreenEnabled),$=()=>!(!x.fullscreenElement&&!x.webkitFullscreenElement),E=e=>{e.fullscreen=()=>{k()&&(async()=>{return $()?null===(e=x.exitFullscreen||x.webkitExitFullscreen)||void 0===e?void 0:e.call(x):((e=x.body)=>{var t;return null===(t=e.requestFullscreen||e.webkitRequestFullscreen)||void 0===t?void 0:t.call(e)})();var e})()},document.addEventListener("keydown",(t=>{"f"!==t.key&&"F11"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!k()||(e.fullscreen(),t.preventDefault())}))},L=`${l}inactive`,S=(e=2e3)=>({parent:t,fire:n})=>{const r=t.classList,o=e=>n(`marp-${e?"":"in"}active`);let i;const a=()=>{i&&clearTimeout(i),i=setTimeout((()=>{r.add(L),o()}),e),r.contains(L)&&(r.remove(L),o(!0))};for(const e of["mousedown","mousemove","touchend"])document.addEventListener(e,a);setTimeout(a,0)},P=["AUDIO","BUTTON","INPUT","SELECT","TEXTAREA","VIDEO"],_=e=>{e.parent.addEventListener("keydown",(e=>{if(!e.target)return;const t=e.target;(P.includes(t.nodeName)||"true"===t.contentEditable)&&e.stopPropagation()}))},T=e=>{window.addEventListener("load",(()=>{for(const t of e.slides){const e=t.querySelector("marp-auto-scaling, [data-auto-scaling], [data-marp-fitting]");t.setAttribute(`${c}load`,e?"":"hideable")}}))},I=({interval:e=250}={})=>t=>{document.addEventListener("keydown",(e=>{if(" "===e.key&&e.shiftKey)t.prev();else if("ArrowLeft"===e.key||"ArrowUp"===e.key||"PageUp"===e.key)t.prev({fragment:!e.shiftKey});else if(" "!==e.kLine truncated
|
||||
@@ -0,0 +1,68 @@
|
||||
Name: bespoke
|
||||
Version: 1.2.0-dev
|
||||
License: (MIT)
|
||||
Private: false
|
||||
Description: DIY Presentation Micro-Framework
|
||||
Repository: git://github.com/bespokejs/bespoke.git
|
||||
Author: Mark Dalgleish (http://markdalgleish.com)
|
||||
License Copyright:
|
||||
===
|
||||
|
||||
Copyright (c) 2014 Mark Dalgleish
|
||||
|
||||
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.
|
||||
|
||||
|
||||
---
|
||||
|
||||
Name: vhtml
|
||||
Version: 2.2.0
|
||||
License: MIT
|
||||
Private: false
|
||||
Description: Hyperscript reviver that constructs a sanitized HTML string.
|
||||
Repository: git+https://github.com/developit/vhtml.git
|
||||
Homepage: https://github.com/developit/vhtml
|
||||
Author: Jason Miller <jason@developit.ca>
|
||||
License Copyright:
|
||||
===
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Jason Miller
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,232 @@
|
||||
"use strict";var e=require("./marp-cli-9fe562c5.js"),a=require("path"),n=require("tty"),i=require("util"),t=require("fs"),o=require("net"),s=require("events"),r=require("stream"),c=require("zlib"),p=require("buffer"),l=require("string_decoder"),u=require("querystring"),d=require("url"),m=require("http"),f=require("./_commonjs-dynamic-modules-21d62193.js"),v=require("crypto");function x(e,a){return a.forEach((function(a){a&&"string"!=typeof a&&!Array.isArray(a)&&Object.keys(a).forEach((function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(a,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return a[n]}})}}))})),Object.freeze(e)}var h={exports:{}},b={exports:{}},g=a.relative,y=function(e){if(!e)throw new TypeError("argument namespace is required");var a=S(T()[1])[0];function n(e){E.call(n,e)}return n._file=a,n._ignored=function(e){return!!process.noDeprecation||k(process.env.NO_DEPRECATION||"",e)}(e),n._namespace=e,n._traced=function(e){return!!process.traceDeprecation||k(process.env.TRACE_DEPRECATION||"",e)}(e),n._warned=Object.create(null),n.function=z,n.property=P,n},w=process.cwd();function k(e,a){for(var n=e.split(/[ ,]+/),i=String(a).toLowerCase(),t=0;t<n.length;t++){var o=n[t];if(o&&("*"===o||o.toLowerCase()===i))return!0}return!1}function j(e){var a=this.name+": "+this.namespace;this.message&&(a+=" deprecated "+this.message);for(var n=0;n<e.length;n++)a+="\n at "+e[n].toString();return a}function E(e,a){var n,i,t=(i="deprecation",("function"!=typeof(n=process).listenerCount?n.listeners(i).length:n.listenerCount(i))>0);if(t||!this._ignored){var o,s,r,c,p=0,l=!1,u=T(),d=this._file;for(a?(c=a,(r=S(u[1])).name=c.name,d=r[0]):r=c=S(u[p=2]);p<u.length;p++)if((s=(o=S(u[p]))[0])===d)l=!0;else if(s===this._file)d=this._file;else if(l)break;var m=o?c.join(":")+"__"+o.join(":"):void 0;if(void 0===m||!(m in this._warned)){this._warned[m]=!0;var f=e;if(f||(f=r!==c&&r.name?A(r):A(c)),t){var v=I(this._namespace,f,u.slice(p));process.emit("deprecation",v)}else{var x=(process.stderr.isTTY?_:O).call(this,f,o,u.slice(p));process.stderr.write(x+"\n","utf8")}}}}function S(e){var a=e.getFileName()||"<anonymous>",n=e.getLineNumber(),i=e.getColumnNumber();e.isEval()&&(a=e.getEvalOrigin()+", "+a);var t=[a,n,i];return t.callSite=e,t.name=e.getFunctionName(),t}function A(e){var a=e.callSite,n=e.name;n||(n="<anonymous@"+C(e)+">");var i=a.getThis(),t=i&&a.getTypeName();return"Object"===t&&(t=void 0),"Function"===t&&(t=i.name||t),t&&a.getMethodName()?t+"."+n:n}function O(e,a,n){var i=(new Date).toUTCString()+" "+this._namespace+" deprecated "+e;if(this._traced){for(var t=0;t<n.length;t++)i+="\n at "+n[t].toString();return i}return a&&(i+=" at "+C(a)),i}function _(e,a,n){var i="[36;1m"+this._namespace+"[22;39m [33;1mdeprecated[22;39m [0m"+e+"[39m";if(this._traced){for(var t=0;t<n.length;t++)i+="\n [36mat "+n[t].toString()+"[39m";return i}return a&&(i+=" [36m"+C(a)+"[39m"),i}function C(e){return g(w,e[0])+":"+e[1]+":"+e[2]}function T(){var e=Error.stackTraceLimit,a={},n=Error.prepareStackTrace;Error.prepareStackTrace=q,Error.stackTraceLimit=Math.max(10,e),Error.captureStackTrace(a);var i=a.stack.slice(1);return Error.prepareStackTrace=n,Error.stackTraceLimit=e,i}function q(e,a){return a}function z(e,a){if("function"!=typeof e)throw new TypeError("argument fn must be a function");var n=function(e){for(var a="",n=0;n<e;n++)a+=", arg"+n;return a.substr(2)}(e.length),i=S(T()[1]);return i.name=e.name,new Function("fn","log","deprecate","message","site",'"use strict"\nreturn function ('+n+") {log.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n}")(e,E,this,a,i)}function P(e,a,n){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("argument obj must be object");var i=Object.getOwnPropertyDescriptor(e,a);if(!i)throw new TypeError("must call property on owner object");if(!i.configurable)throw new TypeError("property must be configurable");var t=this,o=S(T()[1]);o.name=a,"value"in i&&(i=function(e,a,n){var i=Object.getOwnPropertyDescriptor(e,a),t=i.value;return i.get=function(){return t},i.writable&&(i.set=function(e){return t=e}),delete i.value,delete i.writable,Object.defineProperty(e,a,i),i}(e,a));var s=i.get,r=i.set;"function"==typeof s&&(i.get=function(){return E.call(t,n,o),s.apply(this,arguments)}),"function"==typeof r&&(i.set=function(){return E.call(t,n,o),r.apply(this,arguments)}),Object.defineProperty(e,a,i)}function I(e,a,n){var i,t=new Error;return Object.defineProperty(t,"constructor",{value:I}),Object.defineProperty(t,"message",{configurable:!0,enumerable:!1,value:a,writable:!0}),Object.defineProperty(t,"name",{enumerable:!1,configurable:!0,value:"DeprecationError",writable:!0}),Object.defineProperty(t,"namespace",{configurable:!0,enumerable:!1,value:e,writable:!0}),Object.defineProperty(t,"stack",{configurable:!0,enumerable:!1,get:function(){return void 0!==i?i:i=j.call(this,n)},set:function(e){i=e}}),t}var B,N={exports:{}};
|
||||
/*!
|
||||
* bytes
|
||||
* Copyright(c) 2012-2014 TJ Holowaychuk
|
||||
* Copyright(c) 2015 Jed Watson
|
||||
* MIT Licensed
|
||||
*/function L(){if(B)return N.exports;B=1,N.exports=function(e,a){return"string"==typeof e?o(e):"number"==typeof e?t(e,a):null},N.exports.format=t,N.exports.parse=o;var e=/\B(?=(\d{3})+(?!\d))/g,a=/(?:\.0*|(\.[^0]+)0+)$/,n={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},i=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function t(i,t){if(!Number.isFinite(i))return null;var o=Math.abs(i),s=t&&t.thousandsSeparator||"",r=t&&t.unitSeparator||"",c=t&&void 0!==t.decimalPlaces?t.decimalPlaces:2,p=Boolean(t&&t.fixedDecimals),l=t&&t.unit||"";l&&n[l.toLowerCase()]||(l=o>=n.pb?"PB":o>=n.tb?"TB":o>=n.gb?"GB":o>=n.mb?"MB":o>=n.kb?"KB":"B");var u=(i/n[l.toLowerCase()]).toFixed(c);return p||(u=u.replace(a,"$1")),s&&(u=u.split(".").map((function(a,n){return 0===n?a.replace(e,s):a})).join(".")),u+r+l}function o(e){if("number"==typeof e&&!isNaN(e))return e;if("string"!=typeof e)return null;var a,t=i.exec(e),o="b";return t?(a=parseFloat(t[1]),o=t[4].toLowerCase()):(a=parseInt(e,10),o="b"),isNaN(a)?null:Math.floor(n[o]*a)}return N.exports}var U={},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,R=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,D=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,M=/\\([\u000b\u0020-\u00ff])/g,H=/([\\"])/g,$=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
||||
/*!
|
||||
* content-type
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/function G(e){var a=String(e);if(D.test(a))return a;if(a.length>0&&!R.test(a))throw new TypeError("invalid parameter value");return'"'+a.replace(H,"\\$1")+'"'}function W(e){this.parameters=Object.create(null),this.type=e}U.format=function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var a=e.parameters,n=e.type;if(!n||!$.test(n))throw new TypeError("invalid type");var i=n;if(a&&"object"==typeof a)for(var t,o=Object.keys(a).sort(),s=0;s<o.length;s++){if(t=o[s],!D.test(t))throw new TypeError("invalid parameter name");i+="; "+t+"="+G(a[t])}return i},U.parse=function(e){if(!e)throw new TypeError("argument string is required");var a="object"==typeof e?function(e){var a;if("function"==typeof e.getHeader?a=e.getHeader("content-type"):"object"==typeof e.headers&&(a=e.headers&&e.headers["content-type"]),"string"!=typeof a)throw new TypeError("content-type header is missing from object");return a}(e):e;if("string"!=typeof a)throw new TypeError("argument string is required to be a string");var n=a.indexOf(";"),i=-1!==n?a.slice(0,n).trim():a.trim();if(!$.test(i))throw new TypeError("invalid media type");var t=new W(i.toLowerCase());if(-1!==n){var o,s,r;for(F.lastIndex=n;s=F.exec(a);){if(s.index!==n)throw new TypeError("invalid parameter format");n+=s[0].length,o=s[1].toLowerCase(),34===(r=s[2]).charCodeAt(0)&&-1!==(r=r.slice(1,-1)).indexOf("\\")&&(r=r.replace(M,"$1")),t.parameters[o]=r}if(n!==a.length)throw new TypeError("invalid parameter format")}return t};var Z={exports:{}},V=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,a){return e.__proto__=a,e}:function(e,a){for(var n in a)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=a[n]);return e}),J={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},Q=Y;function X(e){if(!Object.prototype.hasOwnProperty.call(Y.message,e))throw new Error("invalid status code: "+e);return Y.message[e]}function Y(e){if("number"==typeof e)return X(e);if("string"!=typeof e)throw new TypeError("code must be a number or string");var a=parseInt(e,10);return isNaN(a)?function(e){var a=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(Y.code,a))throw new Error('invalid status message: "'+e+'"');return Y.code[a]}(e):X(a)}Y.message=J,Y.code=function(e){var a={};return Object.keys(e).forEach((function(n){var i=e[n],t=Number(n);a[i.toLowerCase()]=t})),a}(J),Y.codes=function(e){return Object.keys(e).map((function(e){return Number(e)}))}(J),Y.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},Y.empty={204:!0,205:!0,304:!0},Y.retry={502:!0,503:!0,504:!0};var K,ee={exports:{}},ae={exports:{}};try{var ne=require("util");if("function"!=typeof ne.inherits)throw"";ee.exports=ne.inherits}catch(e){ee.exports=(K||(K=1,"function"==typeof Object.create?ae.exports=function(e,a){a&&(e.super_=a,e.prototype=Object.create(a.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ae.exports=function(e,a){if(a){e.super_=a;var n=function(){};n.prototype=a.prototype,e.prototype=new n,e.prototype.constructor=e}}),ae.exports)}var ie=ee.exports,te=function(e){return e.split(" ").map((function(e){return e.slice(0,1).toUpperCase()+e.slice(1)})).join("").replace(/[^ _0-9a-z]/gi,"")}
|
||||
/*!
|
||||
* http-errors
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2016 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/;
|
||||
/*!
|
||||
* toidentifier
|
||||
* Copyright(c) 2016 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/!function(e){var a,n=y("http-errors"),i=V,t=Q,o=ie,s=te;function r(e){return Number(String(e).charAt(0)+"00")}function c(e,a){var n=Object.getOwnPropertyDescriptor(e,"name");n&&n.configurable&&(n.value=a,Object.defineProperty(e,"name",n))}function p(e){return"Error"!==e.substr(-5)?e+"Error":e}e.exports=function e(){for(var a,i,o=500,s={},c=0;c<arguments.length;c++){var p=arguments[c],l=typeof p;if("object"===l&&p instanceof Error)o=(a=p).status||a.statusCode||o;else if("number"===l&&0===c)o=p;else if("string"===l)i=p;else{if("object"!==l)throw new TypeError("argument #"+(c+1)+" unsupported type "+l);s=p}}"number"==typeof o&&(o<400||o>=600)&&n("non-error status code; use only 4xx or 5xx status codes"),("number"!=typeof o||!t.message[o]&&(o<400||o>=600))&&(o=500);var u=e[o]||e[r(o)];for(var d in a||(a=u?new u(i):new Error(i||t.message[o]),Error.captureStackTrace(a,e)),u&&a instanceof u&&a.status===o||(a.expose=o<500,a.status=a.statusCode=o),s)"status"!==d&&"statusCode"!==d&&(a[d]=s[d]);return a},e.exports.HttpError=function(){function e(){throw new TypeError("cannot construct abstract class")}return o(e,Error),e}(),e.exports.isHttpError=(a=e.exports.HttpError,function(e){return!(!e||"object"!=typeof e)&&(e instanceof a||e instanceof Error&&"boolean"==typeof e.expose&&"number"==typeof e.statusCode&&e.status===e.statusCode)}),function(e,a,n){a.forEach((function(a){var l,u=s(t.message[a]);switch(r(a)){case 400:l=function(e,a,n){var s=p(a);function r(e){var a=null!=e?e:t.message[n],o=new Error(a);return Error.captureStackTrace(o,r),i(o,r.prototype),Object.defineProperty(o,"message",{enumerable:!0,configurable:!0,value:a,writable:!0}),Object.defineProperty(o,"name",{enumerable:!1,configurable:!0,value:s,writable:!0}),o}return o(r,e),c(r,s),r.prototype.status=n,r.prototype.statusCode=n,r.prototype.expose=!0,r}(n,u,a);break;case 500:l=function(e,a,n){var s=p(a);function r(e){var a=null!=e?e:t.message[n],o=new Error(a);return Error.captureStackTrace(o,r),i(o,r.prototype),Object.defineProperty(o,"message",{enumerable:!0,configurable:!0,value:a,writable:!0}),Object.defineProperty(o,"name",{enumerable:!1,configurable:!0,value:s,writable:!0}),o}return o(r,e),c(r,s),r.prototype.status=n,r.prototype.statusCode=n,r.prototype.expose=!1,r}(n,u,a)}l&&(e[a]=l,e[u]=l)}))}(e.exports,t.codes,e.exports.HttpError)}(Z);var oe,se,re,ce,pe=Z.exports,le={exports:{}},ue={exports:{}},de={exports:{}};function me(){return re||(re=1,function(e,a){var n;function i(e){function i(){if(i.enabled){var e=i,t=+new Date,o=t-(n||t);e.diff=o,e.prev=n,e.curr=t,n=t;for(var s=new Array(arguments.length),r=0;r<s.length;r++)s[r]=arguments[r];s[0]=a.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(n,i){if("%%"===n)return n;c++;var t=a.formatters[i];if("function"==typeof t){var o=s[c];n=t.call(e,o),s.splice(c,1),c--}return n})),a.formatArgs.call(e,s),(i.log||a.log||console.log.bind(console)).apply(e,s)}}return i.namespace=e,i.enabled=a.enabled(e),i.useColors=a.useColors(),i.color=function(e){var n,i=0;for(n in e)i=(i<<5)-i+e.charCodeAt(n),i|=0;return a.colors[Math.abs(i)%a.colors.length]}(e),"function"==typeof a.init&&a.init(i),i}(a=e.exports=i.debug=i.default=i).coerce=function(e){return e instanceof Error?e.stack||e.message:e},a.disable=function(){a.enable("")},a.enable=function(e){a.save(e),a.names=[],a.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length,t=0;t<i;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?a.skips.push(new RegExp("^"+e.substr(1)+"$")):a.names.push(new RegExp("^"+e+"$")))},a.enabled=function(e){var n,i;for(n=0,i=a.skips.length;n<i;n++)if(a.skips[n].test(e))return!1;for(n=0,i=a.names.length;n<i;n++)if(a.names[n].test(e))return!0;return!1},a.humanize=function(){if(se)return oe;se=1;var e=1e3,a=60*e,n=60*a,i=24*n;function t(e,a,n){if(!(e<a))return e<1.5*a?Math.floor(e/a)+" "+n:Math.ceil(e/a)+" "+n+"s"}return oe=function(o,s){s=s||{};var r=typeof o;if("string"===r&&o.length>0)return function(t){if(!((t=String(t)).length>100)){var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*a;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(o);if("number"===r&&!1===isNaN(o))return s.long?function(o){return t(o,i,"day")||t(o,n,"hour")||t(o,a,"minute")||t(o,e,"second")||o+" ms"}(o):function(t){return t>=i?Math.round(t/i)+"d":t>=n?Math.round(t/n)+"h":t>=a?Math.round(t/a)+"m":t>=e?Math.round(t/e)+"s":t+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringLine truncated
|
||||
/*!
|
||||
* destroy
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/var be=s.EventEmitter,ge=t.ReadStream,ye=r,we=c,ke=function(e,a){return!function(e){return e instanceof ge}(e)?function(e){return e instanceof we.Gzip||e instanceof we.Gunzip||e instanceof we.Deflate||e instanceof we.DeflateRaw||e instanceof we.Inflate||e instanceof we.InflateRaw||e instanceof we.Unzip}(e)?function(e){"function"==typeof e.destroy?e._binding?(e.destroy(),e._processing?(e._needDrain=!0,e.once("drain",Ee)):e._binding.clear()):e._destroy&&e._destroy!==ye.Transform.prototype._destroy?e.destroy():e._destroy&&"function"==typeof e.close?(e.destroyed=!0,e.close()):e.destroy():"function"==typeof e.close&&function(e){if(!0===e._hadError){var a=null===e._binding?"_binding":"_handle";e[a]={close:function(){this[a]=null}}}e.close()}(e)}(e):function(e){return e instanceof ye&&"function"==typeof e.destroy}(e)&&e.destroy():function(e){e.destroy(),"function"==typeof e.close&&e.on("open",Se)}(e),e instanceof be&&a&&(e.removeAllListeners("error"),e.addListener("error",je)),e};function je(){}function Ee(){this._binding.clear()}function Se(){"number"==typeof this.fd&&this.close()}var Ae,Oe,_e={exports:{}};function Ce(){if(Oe)return Ae;Oe=1;var e,a=p,n=a.Buffer,i={};for(e in a)a.hasOwnProperty(e)&&"SlowBuffer"!==e&&"Buffer"!==e&&(i[e]=a[e]);var t=i.Buffer={};for(e in n)n.hasOwnProperty(e)&&"allocUnsafe"!==e&&"allocUnsafeSlow"!==e&&(t[e]=n[e]);if(i.Buffer.prototype=n.prototype,t.from&&t.from!==Uint8Array.from||(t.from=function(e,a,i){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return n(e,a,i)}),t.alloc||(t.alloc=function(e,a,i){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=n(e);return a&&0!==a.length?"string"==typeof i?t.fill(a,i):t.fill(a):t.fill(0),t}),!i.kStringMaxLength)try{i.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(e){}return i.constants||(i.constants={MAX_LENGTH:i.kMaxLength},i.kStringMaxLength&&(i.constants.MAX_STRING_LENGTH=i.kStringMaxLength)),Ae=i}var Te,qe={};function ze(){if(Te)return qe;function e(e,a){this.encoder=e,this.addBOM=!0}function a(e,a){this.decoder=e,this.pass=!1,this.options=a||{}}return Te=1,qe.PrependBOM=e,e.prototype.write=function(e){return this.addBOM&&(e="\ufeff"+e,this.addBOM=!1),this.encoder.write(e)},e.prototype.end=function(){return this.encoder.end()},qe.StripBOM=a,a.prototype.write=function(e){var a=this.decoder.write(e);return this.pass||!a||("\ufeff"===a[0]&&(a=a.slice(1),"function"==typeof this.options.stripBOM&&this.options.stripBOM()),this.pass=!0),a},a.prototype.end=function(){return this.decoder.end()},qe}var Pe,Ie,Be={};function Ne(){if(Ie)return Pe;Ie=1;var e=Ce().Buffer;function a(a,n){this.enc=a.encodingName,this.bomAware=a.bomAware,"base64"===this.enc?this.encoder=o:"cesu8"===this.enc&&(this.enc="utf8",this.encoder=s,"💩"!==e.from("eda0bdedb2a9","hex").toString()&&(this.decoder=r,this.defaultCharUnicode=n.defaultCharUnicode))}Pe={utf8:{type:"_internal",bomAware:!0},cesu8:{type:"_internal",bomAware:!0},unicode11utf8:"utf8",ucs2:{type:"_internal",bomAware:!0},utf16le:"ucs2",binary:{type:"_internal"},base64:{type:"_internal"},hex:{type:"_internal"},_internal:a},a.prototype.encoder=t,a.prototype.decoder=i;var n=l.StringDecoder;function i(e,a){n.call(this,a.enc)}function t(e,a){this.enc=a.enc}function o(e,a){this.prevStr=""}function s(e,a){}function r(e,a){this.acc=0,this.contBytes=0,this.accBytes=0,this.defaultCharUnicode=a.defaultCharUnicode}return n.prototype.end||(n.prototype.end=function(){}),i.prototype=n.prototype,t.prototype.write=function(a){return e.from(a,this.enc)},t.prototype.end=function(){},o.prototype.write=function(a){var n=(a=this.prevStr+a).length-a.length%4;return this.prevStr=a.slice(n),a=a.slice(0,n),e.from(a,"base64")},o.prototype.end=function(){return e.from(this.prevStr,"base64")},s.prototype.write=function(a){for(var n=e.alloc(3*a.length),i=0,t=0;t<a.length;t++){var o=a.charCodeAt(t);o<128?n[i++]=o:o<2048?(n[i++]=192+(o>>>6),n[i++]=128+(63&o)):(n[i++]=224+(o>>>12),n[i++]=128+(o>>>6&63),n[i++]=128+(63&o))}return n.slice(0,i)},s.prototype.end=function(){},r.prototype.write=function(e){for(var a=this.acc,n=this.contBytes,i=this.accBytes,t="",o=0;o<e.length;o++){var s=e[o];128!=(192&s)?(n>0&&(t+=this.defaultCharUnicode,n=0),s<128?t+=String.fromCharCode(s):s<224?(a=31&s,n=1,i=1):s<240?(a=15&s,n=2,i=1):t+=this.defaultCharUnicode):n>0?(a=a<<6|63&s,i++,0==--n&&(t+=2===i&&a<128&&a>0||3===i&&a<2048?this.defaultCharUnicode:String.fromCharCode(a))):t+=this.defaultCharUnicode}return this.acc=a,this.contBytes=n,this.accBytes=i,t},r.prototype.end=function(){var e=0;return this.contBytes>0&&(e+=this.defaultCharUnicode),e},Pe}var LLine truncated
|
||||
/*!
|
||||
* unpipe
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/var xa,ha,ba=function(e){if(!e)throw new TypeError("argument stream is required");if("function"!=typeof e.unpipe){if(function(e){for(var a=e.listeners("data"),n=0;n<a.length;n++)if("ondata"===a[n].name)return!0;return!1}(e))for(var a,n=e.listeners("close"),i=0;i<n.length;i++)"cleanup"!==(a=n[i]).name&&"onclose"!==a.name||a.call(e)}else e.unpipe()}
|
||||
/*!
|
||||
* raw-body
|
||||
* Copyright(c) 2013-2014 Jonathan Ong
|
||||
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/;var ga={exports:{}};
|
||||
/*!
|
||||
* ee-first
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* MIT Licensed
|
||||
*/function ya(e,a){return function(n){for(var i=new Array(arguments.length),t="error"===e?n:null,o=0;o<i.length;o++)i[o]=arguments[o];a(t,this,e,i)}}
|
||||
/*!
|
||||
* on-finished
|
||||
* Copyright(c) 2013 Jonathan Ong
|
||||
* Copyright(c) 2014 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/ga.exports=function(e,a){return!1!==Ea(e)?(ja(a,null,e),e):(function(e,a){var n=e.__onFinished;n&&n.queue||(n=e.__onFinished=function(e){function a(n){if(e.__onFinished===a&&(e.__onFinished=null),a.queue){var i=a.queue;a.queue=null;for(var t=0;t<i.length;t++)i[t](n,e)}}return a.queue=[],a}(e),function(e,a){var n,i,t=!1;function o(e){n.cancel(),i.cancel(),t=!0,a(e)}function s(a){e.removeListener("socket",s),t||n===i&&(i=ka([[a,"error","close"]],o))}n=i=ka([[e,"end","finish"]],o),e.socket?s(e.socket):(e.on("socket",s),void 0===e.socket&&function(e,a){var n=e.assignSocket;"function"==typeof n&&(e.assignSocket=function(e){n.call(this,e),a(e)})}(e,s))}(e,n)),n.queue.push(a)}(e,function(e){var a;return wa.AsyncResource&&(a=new wa.AsyncResource(e.name||"bound-anonymous-fn")),a&&a.runInAsyncScope?a.runInAsyncScope.bind(a,e,null):e}(a)),e)},ga.exports.isFinished=Ea;var wa=function(){try{return require("async_hooks")}catch(e){return{}}}(),ka=function(e,a){if(!Array.isArray(e))throw new TypeError("arg must be an array of [ee, events...] arrays");for(var n=[],i=0;i<e.length;i++){var t=e[i];if(!Array.isArray(t)||t.length<2)throw new TypeError("each array member must be [ee, events...]");for(var o=t[0],s=1;s<t.length;s++){var r=t[s],c=ya(r,p);o.on(r,c),n.push({ee:o,event:r,fn:c})}}function p(){l(),a.apply(null,arguments)}function l(){for(var e,a=0;a<n.length;a++)(e=n[a]).ee.removeListener(e.event,e.fn)}function u(e){a=e}return u.cancel=l,u},ja="function"==typeof setImmediate?setImmediate:function(e){process.nextTick(e.bind.apply(e,arguments))};function Ea(e){var a=e.socket;return"boolean"==typeof e.finished?Boolean(e.finished||a&&!a.writable):"boolean"==typeof e.complete?Boolean(e.upgrade||!a||!a.readable||e.complete&&!e.readable):void 0}var Sa,Aa,Oa=ga.exports;
|
||||
/*!
|
||||
* body-parser
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/function _a(){if(Aa)return Sa;Aa=1;var a=pe,n=ke,i=function(){if(ha)return xa;ha=1;var a=function(){try{return require("async_hooks")}catch(e){return{}}}(),n=L(),i=pe,t=va(),o=ba;xa=function(i,t,o){var s=o,c=t||{};if(!0!==t&&"string"!=typeof t||(c={encoding:t}),"function"==typeof t&&(s=t,c={}),void 0!==s&&"function"!=typeof s)throw new TypeError("argument callback must be a function");if(!s&&!e.c.Promise)throw new TypeError("argument callback is required");var p=!0!==c.encoding?c.encoding:"utf-8",l=n.parse(c.limit),u=null==c.length||isNaN(c.length)?null:parseInt(c.length,10);return s?r(i,p,u,l,function(e){var n;return a.AsyncResource&&(n=new a.AsyncResource(e.name||"bound-anonymous-fn")),n&&n.runInAsyncScope?n.runInAsyncScope.bind(n,e,null):e}(s)):new Promise((function(e,a){r(i,p,u,l,(function(n,i){if(n)return a(n);e(i)}))}))};var s=/^Encoding not recognized: /;function r(e,a,n,r,c){var p=!1,l=!0;if(null!==r&&null!==n&&n>r)return v(i(413,"request entity too large",{expected:n,length:n,limit:r,type:"entity.too.large"}));var u=e._readableState;if(e._decoder||u&&(u.encoding||u.decoder))return v(i(500,"stream encoding should not be set",{type:"stream.encoding.set"}));if(void 0!==e.readable&&!e.readable)return v(i(500,"stream is not readable",{type:"stream.not.readable"}));var d,m=0;try{d=function(e){if(!e)return null;try{return t.getDecoder(e)}catch(a){if(!s.test(a.message))throw a;throw i(415,"specified encoding unsupported",{encoding:e,type:"encoding.unsupported"})}}(a)}catch(e){return v(e)}var f=d?"":[];function v(){for(var a=new Array(arguments.length),n=0;n<a.length;n++)a[n]=arguments[n];function i(){g(),a[0]&&function(e){o(e),"function"==typeof e.pause&&e.pause()}(e),c.apply(null,a)}p=!0,l?process.nextTick(i):i()}function x(){p||v(i(400,"request aborted",{code:"ECONNABORTED",expected:n,length:n,received:m,type:"request.aborted"}))}function h(e){p||(m+=e.length,null!==r&&m>r?v(i(413,"request entity too large",{limit:r,received:m,type:"entity.too.large"})):d?f+=d.write(e):f.push(e))}function b(e){if(!p){if(e)return v(e);null!==n&&m!==n?v(i(400,"request size did not match content length",{expected:n,length:n,received:m,type:"request.size.invalid"})):v(null,d?f+(d.end()||""):Buffer.concat(f))}}function g(){f=null,e.removeListener("aborted",x),e.removeListener("data",h),e.removeListener("end",b),e.removeListener("error",b),e.removeListener("close",g)}e.on("aborted",x),e.on("close",g),e.on("data",h),e.on("end",b),e.on("error",b),l=!1}return xa}(),t=va(),o=Oa,s=ba,r=c;return Sa=function(e,c,p,l,u,d){var m,f,v=d;e._body=!0;var x=null!==v.encoding?v.encoding:null,h=v.verify;try{f=function(e,n,i){var t,o=(e.headers["content-encoding"]||"identity").toLowerCase(),s=e.headers["content-length"];if(n('content-encoding "%s"',o),!1===i&&"identity"!==o)throw a(415,"content encoding unsupported",{encoding:o,type:"encoding.unsupported"});switch(o){case"deflate":t=r.createInflate(),n("inflate body"),e.pipe(t);break;case"gzip":t=r.createGunzip(),n("gunzip body"),e.pipe(t);break;case"identity":(t=e).length=s;break;default:throw a(415,'unsupported content encoding "'+o+'"',{encoding:o,type:"encoding.unsupported"})}return t}(e,u,v.inflate),m=f.length,f.length=void 0}catch(e){return p(e)}if(v.length=m,v.encoding=h?null:x,null===v.encoding&&null!==x&&!t.encodingExists(x))return p(a(415,'unsupported charset "'+x.toUpperCase()+'"',{charset:x.toLowerCase(),type:"charset.unsupported"}));u("read body"),i(f,v,(function(i,r){var d;if(i)return d="encoding.unsupported"===i.type?a(415,'unsupported charset "'+x.toUpperCase()+'"',{charset:x.toLowerCase(),type:"charset.unsupported"}):a(400,i),f!==e&&(s(e),n(f,!0)),void function(e,a){o.isFinished(e)?a():(o(e,a),e.resume())}(e,(function(){p(a(400,d))}));if(h)try{u("verify body"),h(e,c,r,x)}catch(e){return void p(a(403,e,{body:r,type:e.type||"entity.verify.failed"}))}var m=r;try{u("parse body"),m="string"!=typeof r&&null!==x?t.decode(r,x):r,e.body=l(m)}catch(e){return void p(a(400,e,{body:m,type:e.type||"entity.parse.failed"}))}p()}))},Sa}var Ca={exports:{}},Ta={},qa=/; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g,za=/^[\u0020-\u007e\u0080-\u00ff]+$/,Pa=/^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/,Ia=/\\([\u0000-\u007f])/g,Ba=/([\\"])/g,Na=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/,La=/^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/,Ua=/^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;function Fa(e){var a=String(e);if(Pa.test(a))return a;if(a.length>0&&!za.test(a))throw new TypeError("invalid parameter value");return'"'+a.replace(Ba,"\\$1")+'"'}Ta.format=function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var a=e.parameters,n=e.subtype,i=e.suffix,t=e.type;if(!t||!La.test(t))throw new TypeError("invalid type");if(!n||!Na.test(n))throw new TypeError("invalid subtype");var o=t+"/"+n;if(i){if(!La.test(i))throw new TypeError("invalid suffiLine truncated
|
||||
/*!
|
||||
* mime-types
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
!function(e){var n,i,t,o=Da,s=a.extname,r=/^\s*([^;\s]*)(?:;|\s|$)/,c=/^text\//i;function p(e){if(!e||"string"!=typeof e)return!1;var a=r.exec(e),n=a&&o[a[1].toLowerCase()];return n&&n.charset?n.charset:!(!a||!c.test(a[1]))&&"UTF-8"}e.charset=p,e.charsets={lookup:p},e.contentType=function(a){if(!a||"string"!=typeof a)return!1;var n=-1===a.indexOf("/")?e.lookup(a):a;if(!n)return!1;if(-1===n.indexOf("charset")){var i=e.charset(n);i&&(n+="; charset="+i.toLowerCase())}return n},e.extension=function(a){if(!a||"string"!=typeof a)return!1;var n=r.exec(a),i=n&&e.extensions[n[1].toLowerCase()];return!(!i||!i.length)&&i[0]},e.extensions=Object.create(null),e.lookup=function(a){if(!a||"string"!=typeof a)return!1;var n=s("x."+a).toLowerCase().substr(1);return n&&e.types[n]||!1},e.types=Object.create(null),n=e.extensions,i=e.types,t=["nginx","apache",void 0,"iana"],Object.keys(o).forEach((function(e){var a=o[e],s=a.extensions;if(s&&s.length){n[e]=s;for(var r=0;r<s.length;r++){var c=s[r];if(i[c]){var p=t.indexOf(o[i[c]].source),l=t.indexOf(a.source);if("application/octet-stream"!==i[c]&&(p>l||p===l&&"application/"===i[c].substr(0,12)))continue}i[c]=e}}}))}(Ra);
|
||||
/*!
|
||||
* type-is
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
var Ma=Ta,Ha=Ra;function $a(e,a){var n,i,t=a,o=function(e){if(!e)return null;try{return function(e){var a=Ma.parse(e);return a.parameters=void 0,Ma.format(a)}(e)}catch(e){return null}}(e);if(!o)return!1;if(t&&!Array.isArray(t))for(t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];if(!t||!t.length)return o;for(n=0;n<t.length;n++)if(Za(Wa(i=t[n]),o))return"+"===i[0]||-1!==i.indexOf("*")?o:i;return!1}function Ga(e){return void 0!==e.headers["transfer-encoding"]||!isNaN(e.headers["content-length"])}function Wa(e){if("string"!=typeof e)return!1;switch(e){case"urlencoded":return"application/x-www-form-urlencoded";case"multipart":return"multipart/*"}return"+"===e[0]?"*/*"+e:-1===e.indexOf("/")?Ha.lookup(e):e}function Za(e,a){if(!1===e)return!1;var n=a.split("/"),i=e.split("/");return 2===n.length&&2===i.length&&("*"===i[0]||i[0]===n[0])&&("*+"===i[1].substr(0,2)?i[1].length<=n[1].length+1&&i[1].substr(1)===n[1].substr(1-i[1].length):"*"===i[1]||i[1]===n[1])}Ca.exports=function(e,a){var n=a;if(!Ga(e))return null;if(arguments.length>2){n=new Array(arguments.length-1);for(var i=0;i<n.length;i++)n[i]=arguments[i+1]}return $a(e.headers["content-type"],n)},Ca.exports.is=$a,Ca.exports.hasBody=Ga,Ca.exports.normalize=Wa,Ca.exports.match=Za;var Va,Ja,Qa,Xa,Ya,Ka,en=Ca.exports;
|
||||
/*!
|
||||
* body-parser
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/var an,nn="undefined"!=typeof Symbol&&Symbol,tn=Array.prototype.slice,on=Object.prototype.toString,sn=Function.prototype.bind||function(e){var a=this;if("function"!=typeof a||"[object Function]"!==on.call(a))throw new TypeError("Function.prototype.bind called on incompatible "+a);for(var n,i=tn.call(arguments,1),t=Math.max(0,a.length-i.length),o=[],s=0;s<t;s++)o.push("$"+s);if(n=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof n){var t=a.apply(this,i.concat(tn.call(arguments)));return Object(t)===t?t:this}return a.apply(e,i.concat(tn.call(arguments)))})),a.prototype){var r=function(){};r.prototype=a.prototype,n.prototype=new r,r.prototype=null}return n},rn=sn.call(Function.call,Object.prototype.hasOwnProperty),cn=SyntaxError,pn=Function,ln=TypeError,un=function(e){try{return pn('"use strict"; return ('+e+").constructor;")()}catch(e){}},dn=Object.getOwnPropertyDescriptor;if(dn)try{dn({},"")}catch(e){dn=null}var mn=function(){throw new ln},fn=dn?function(){try{return mn}catch(e){try{return dn(arguments,"callee").get}catch(e){return mn}}}():mn,vn="function"==typeof nn&&"function"==typeof Symbol&&"symbol"==typeof nn("foo")&&"symbol"==typeof Symbol("bar")&&function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},a=Symbol("test"),n=Object(a);if("string"==typeof a)return!1;if("[object Symbol]"!==Object.prototype.toString.call(a))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(a in e[a]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==a)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,a))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var t=Object.getOwnPropertyDescriptor(e,a);if(42!==t.value||!0!==t.enumerable)return!1}return!0}(),xn=Object.getPrototypeOf||function(e){return e.__proto__},hn={},bn="undefined"==typeof Uint8Array?an:xn(Uint8Array),gn={"%AggregateError%":"undefined"==typeof AggregateError?an:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?an:ArrayBuffer,"%ArrayIteratorPrototype%":vn?xn([][Symbol.iterator]()):an,"%AsyncFromSyncIteratorPrototype%":an,"%AsyncFunction%":hn,"%AsyncGenerator%":hn,"%AsyncGeneratorFunction%":hn,"%AsyncIteratorPrototype%":hn,"%Atomics%":"undefined"==typeof Atomics?an:Atomics,"%BigInt%":"undefined"==typeof BigInt?an:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?an:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?an:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?an:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?an:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?an:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?an:FinalizationRegistry,"%Function%":pn,"%GeneratorFunction%":hn,"%Int8Array%":"undefined"==typeof Int8Array?an:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?an:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?an:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":vn?xn(xn([][Symbol.iterator]())):an,"%JSON%":"object"==typeof JSON?JSON:an,"%Map%":"undefined"==typeof Map?an:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&vn?xn((new Map)[Symbol.iterator]()):an,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?an:Promise,"%Proxy%":"undefined"==typeof Proxy?an:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?an:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?an:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&vn?xn((new Set)[Symbol.iterator]()):an,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?an:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":vn?xn(""[Symbol.iterator]()):an,"%Symbol%":vn?Symbol:an,"%SyntaxError%":cn,"%ThrowTypeError%":fn,"%TypedArray%":bn,"%TypeError%":ln,"%Uint8Array%":"undefined"==typeof Uint8Array?an:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?an:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?an:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?an:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?an:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?an:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?an:WeakSet};try{null.error}catch(e){var yn=xn(xn(e));gn["%Error.prototype%"]=yn}var wn=funLine truncated
|
||||
/*!
|
||||
* body-parser
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
!function(e,a){var n=y("body-parser"),i=Object.create(null);function t(e){return function(){return function(e){var a=i[e];if(void 0!==a)return a;switch(e){case"json":a=function(){if(Ja)return Va;Ja=1;var e=L(),a=U,n=pe,i=he()("body-parser:json"),t=_a(),o=en;Va=function(c){var p=c||{},l="number"!=typeof p.limit?e.parse(p.limit||"100kb"):p.limit,u=!1!==p.inflate,d=p.reviver,m=!1!==p.strict,f=p.type||"application/json",v=p.verify||!1;if(!1!==v&&"function"!=typeof v)throw new TypeError("option verify must be function");var x="function"!=typeof f?function(e){return function(a){return Boolean(o(a,e))}}(f):f;function h(e){if(0===e.length)return{};if(m){var a=(n=e,(t=s.exec(n))?t[1]:void 0);if("{"!==a&&"["!==a)throw i("strict violation"),function(e,a){var n=e.indexOf(a),i=-1!==n?e.substring(0,n)+"#":"";try{throw JSON.parse(i),new SyntaxError("strict violation")}catch(e){return r(e,{message:e.message.replace("#",a),stack:e.stack})}}(e,a)}var n,t;try{return i("parse json"),JSON.parse(e,d)}catch(e){throw r(e,{message:e.message,stack:e.stack})}}return function(e,s,r){if(e._body)return i("body already parsed"),void r();if(e.body=e.body||{},!o.hasBody(e))return i("skip empty body"),void r();if(i("content-type %j",e.headers["content-type"]),!x(e))return i("skip parsing"),void r();var c=function(e){try{return(a.parse(e).parameters.charset||"").toLowerCase()}catch(e){return}}(e)||"utf-8";if("utf-"!==c.slice(0,4))return i("invalid charset"),void r(n(415,'unsupported charset "'+c.toUpperCase()+'"',{charset:c,type:"charset.unsupported"}));t(e,s,r,h,i,{encoding:c,inflate:u,limit:l,verify:v})}};var s=/^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/;function r(e,a){for(var n=Object.getOwnPropertyNames(e),i=0;i<n.length;i++){var t=n[i];"stack"!==t&&"message"!==t&&delete e[t]}return e.stack=a.stack.replace(e.message,a.message),e.message=a.message,e}return Va}
|
||||
/*!
|
||||
* body-parser
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/();break;case"raw":a=function(){if(Xa)return Qa;Xa=1;var e=L(),a=he()("body-parser:raw"),n=_a(),i=en;return Qa=function(t){var o=t||{},s=!1!==o.inflate,r="number"!=typeof o.limit?e.parse(o.limit||"100kb"):o.limit,c=o.type||"application/octet-stream",p=o.verify||!1;if(!1!==p&&"function"!=typeof p)throw new TypeError("option verify must be function");var l="function"!=typeof c?function(e){return function(a){return Boolean(i(a,e))}}(c):c;function u(e){return e}return function(e,t,o){return e._body?(a("body already parsed"),void o()):(e.body=e.body||{},i.hasBody(e)?(a("content-type %j",e.headers["content-type"]),l(e)?void n(e,t,o,u,a,{encoding:null,inflate:s,limit:r,verify:p}):(a("skip parsing"),void o())):(a("skip empty body"),void o()))}},Qa}
|
||||
/*!
|
||||
* body-parser
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/();break;case"text":a=function(){if(Ka)return Ya;Ka=1;var e=L(),a=U,n=he()("body-parser:text"),i=_a(),t=en;return Ya=function(o){var s=o||{},r=s.defaultCharset||"utf-8",c=!1!==s.inflate,p="number"!=typeof s.limit?e.parse(s.limit||"100kb"):s.limit,l=s.type||"text/plain",u=s.verify||!1;if(!1!==u&&"function"!=typeof u)throw new TypeError("option verify must be function");var d="function"!=typeof l?function(e){return function(a){return Boolean(t(a,e))}}(l):l;function m(e){return e}return function(e,o,s){if(e._body)return n("body already parsed"),void s();if(e.body=e.body||{},!t.hasBody(e))return n("skip empty body"),void s();if(n("content-type %j",e.headers["content-type"]),!d(e))return n("skip parsing"),void s();var l=function(e){try{return(a.parse(e).parameters.charset||"").toLowerCase()}catch(e){return}}(e)||r;i(e,o,s,m,n,{encoding:l,inflate:c,limit:p,verify:u})}},Ya}();break;case"urlencoded":a=function(){if(Li)return Ni;Li=1;var e=L(),a=U,n=pe,i=he()("body-parser:urlencoded"),t=y("body-parser"),o=_a(),s=en;Ni=function(r){var l=r||{};void 0===l.extended&&t("undefined extended: provide extended option");var u=!1!==l.extended,d=!1!==l.inflate,m="number"!=typeof l.limit?e.parse(l.limit||"100kb"):l.limit,f=l.type||"application/x-www-form-urlencoded",v=l.verify||!1;if(!1!==v&&"function"!=typeof v)throw new TypeError("option verify must be function");var x=u?function(e){var a=void 0!==e.parameterLimit?e.parameterLimit:1e3,t=p("qs");if(isNaN(a)||a<1)throw new TypeError("option parameterLimit must be a positive number");return isFinite(a)&&(a|=0),function(e){var o=c(e,a);if(void 0===o)throw i("too many parameters"),n(413,"too many parameters",{type:"parameters.too.many"});var s=Math.max(100,o);return i("parse extended urlencoding"),t(e,{allowPrototypes:!0,arrayLimit:s,depth:1/0,parameterLimit:a})}}(l):function(e){var a=void 0!==e.parameterLimit?e.parameterLimit:1e3,t=p("querystring");if(isNaN(a)||a<1)throw new TypeError("option parameterLimit must be a positive number");return isFinite(a)&&(a|=0),function(e){if(void 0===c(e,a))throw i("too many parameters"),n(413,"too many parameters",{type:"parameters.too.many"});return i("parse urlencoding"),t(e,void 0,void 0,{maxKeys:a})}}(l),h="function"!=typeof f?function(e){return function(a){return Boolean(s(a,e))}}(f):f;function b(e){return e.length?x(e):{}}return function(e,t,r){if(e._body)return i("body already parsed"),void r();if(e.body=e.body||{},!s.hasBody(e))return i("skip empty body"),void r();if(i("content-type %j",e.headers["content-type"]),!h(e))return i("skip parsing"),void r();var c=function(e){try{return(a.parse(e).parameters.charset||"").toLowerCase()}catch(e){return}}(e)||"utf-8";if("utf-8"!==c)return i("invalid charset"),void r(n(415,'unsupported charset "'+c.toUpperCase()+'"',{charset:c,type:"charset.unsupported"}));o(e,t,r,b,i,{debug:i,encoding:c,inflate:d,limit:m,verify:v})}};var r=Object.create(null);function c(e,a){for(var n=0,i=0;-1!==(i=e.indexOf("&",i));)if(i++,++n===a)return;return n}function p(e){var a=r[e];if(void 0!==a)return a.parse;switch(e){case"qs":a=_t;break;case"querystring":a=u}return r[e]=a,a.parse}return Ni}()}return i[e]=a}(e)}}a=e.exports=n.function((function(e){var n=Object.create(e||null,{type:{configurable:!0,enumerable:!0,value:void 0,writable:!0}}),i=a.urlencoded(n),t=a.json(n);return function(e,a,n){t(e,a,(function(t){if(t)return n(t);i(e,a,n)}))}}),"bodyParser: use individual json/urlencoded middlewares"),Object.defineProperty(a,"json",{configurable:!0,enumerable:!0,get:t("json")}),Object.defineProperty(a,"raw",{configurable:!0,enumerable:!0,get:t("raw")}),Object.defineProperty(a,"text",{configurable:!0,enumerable:!0,get:t("text")}),Object.defineProperty(a,"urlencoded",{configurable:!0,enumerable:!0,get:t("urlencoded")})}(b,b.exports);var Ct,Tt,qt,zt,Pt=b.exports,It=function(e,a,n){if(!e)throw new TypeError("argument dest is required");if(!a)throw new TypeError("argument src is required");return void 0===n&&(n=!0),Object.getOwnPropertyNames(a).forEach((function(i){if(n||!Bt.call(e,i)){var t=Object.getOwnPropertyDescriptor(a,i);Object.defineProperty(e,i,t)}})),e},Bt=Object.prototype.hasOwnProperty,Nt={exports:{}},Lt={exports:{}},Ut={exports:{}},Ft={exports:{}};
|
||||
/*!
|
||||
* merge-descriptors
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/function Rt(){return qt||(qt=1,function(e,a){var n;function i(e){function i(){if(i.enabled){var e=i,t=+new Date,o=t-(n||t);e.diff=o,e.prev=n,e.curr=t,n=t;for(var s=new Array(arguments.length),r=0;r<s.length;r++)s[r]=arguments[r];s[0]=a.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(n,i){if("%%"===n)return n;c++;var t=a.formatters[i];if("function"==typeof t){var o=s[c];n=t.call(e,o),s.splice(c,1),c--}return n})),a.formatArgs.call(e,s),(i.log||a.log||console.log.bind(console)).apply(e,s)}}return i.namespace=e,i.enabled=a.enabled(e),i.useColors=a.useColors(),i.color=function(e){var n,i=0;for(n in e)i=(i<<5)-i+e.charCodeAt(n),i|=0;return a.colors[Math.abs(i)%a.colors.length]}(e),"function"==typeof a.init&&a.init(i),i}(a=Ft.exports=i.debug=i.default=i).coerce=function(e){return e instanceof Error?e.stack||e.message:e},a.disable=function(){a.enable("")},a.enable=function(e){a.save(e),a.names=[],a.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length,t=0;t<i;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?a.skips.push(new RegExp("^"+e.substr(1)+"$")):a.names.push(new RegExp("^"+e+"$")))},a.enabled=function(e){var n,i;for(n=0,i=a.skips.length;n<i;n++)if(a.skips[n].test(e))return!1;for(n=0,i=a.names.length;n<i;n++)if(a.names[n].test(e))return!0;return!1},a.humanize=function(){if(Tt)return Ct;Tt=1;var e=1e3,a=60*e,n=60*a,i=24*n;function t(e,a,n){if(!(e<a))return e<1.5*a?Math.floor(e/a)+" "+n:Math.ceil(e/a)+" "+n+"s"}return Ct=function(o,s){s=s||{};var r=typeof o;if("string"===r&&o.length>0)return function(t){if(!((t=String(t)).length>100)){var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*a;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(o);if("number"===r&&!1===isNaN(o))return s.long?function(o){return t(o,i,"day")||t(o,n,"hour")||t(o,a,"minute")||t(o,e,"second")||o+" ms"}(o):function(t){return t>=i?Math.round(t/i)+"d":t>=n?Math.round(t/n)+"h":t>=a?Math.round(t/a)+"m":t>=e?Math.round(t/e)+"s":t+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},Ct}(),a.names=[],a.skips=[],a.formatters={}}(0,Ft.exports)),Ft.exports}var Dt,Mt={exports:{}};"undefined"!=typeof process&&"renderer"===process.type?Lt.exports=(zt||(zt=1,function(e,a){function n(){var e;try{e=a.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(a=Ut.exports=Rt()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},a.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+a.humanize(this.diff),n){var i="color: "+this.color;e.splice(1,0,i,"color: inherit");var t=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(t++,"%c"===e&&(o=t))})),e.splice(o,0,i)}},a.save=function(e){try{null==e?a.storage.removeItem("debug"):a.storage.debug=e}catch(e){}},a.load=n,a.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},a.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),a.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],a.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},a.enable(n())}(0,Ut.exports)),Ut.exports):Lt.exports=(Dt||(Dt=1,function(e,a){var s=n,r=i;(a=Mt.exports=Rt()).init=function(e){e.inspectOpts={};for(var n=Object.keys(a.inspectOpts),i=0;i<n.length;i++)e.inspectOpts[n[i]]=a.inspectOpts[n[i]]},a.log=function(){return p.write(r.format.apply(r,arguments)+"\n")},a.formatArgs=function(e){var n=this.namespace;if(this.useColors){var i=this.color,t=" [3"+i+";1m"+n+" [0m";e[0]=t+e[0].split("\n").join("\n"+t),e.push("[3"+i+"m+"+a.humanize(this.diff)+"[0m")}else e[0]=(new Date).toUTCString()+" "+n+" "+e[0]},a.save=function(eLine truncated
|
||||
/*!
|
||||
* escape-html
|
||||
* Copyright(c) 2012-2013 TJ Holowaychuk
|
||||
* Copyright(c) 2015 Andreas Lubbe
|
||||
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
||||
* MIT Licensed
|
||||
*/,Gt=/(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g,Wt=/(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g,Zt="$1�$2",Vt=/["'&<>]/,Jt=function(e){var a,n=""+e,i=Vt.exec(n);if(!i)return n;var t="",o=0,s=0;for(o=i.index;o<n.length;o++){switch(n.charCodeAt(o)){case 34:a=""";break;case 38:a="&";break;case 39:a="'";break;case 60:a="<";break;case 62:a=">";break;default:continue}s!==o&&(t+=n.substring(s,o)),s=o+1,t+=a}return s!==o?t+n.substring(s,o):t},Qt={exports:{}},Xt=d,Yt=Xt.parse,Kt=Xt.Url;
|
||||
/*!
|
||||
* encodeurl
|
||||
* Copyright(c) 2016 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/function eo(e){var a=e.url;if(void 0!==a){var n=e._parsedUrl;return no(a,n)?n:((n=ao(a))._raw=a,e._parsedUrl=n)}}function ao(e){if("string"!=typeof e||47!==e.charCodeAt(0))return Yt(e);for(var a=e,n=null,i=null,t=1;t<e.length;t++)switch(e.charCodeAt(t)){case 63:null===i&&(a=e.substring(0,t),n=e.substring(t+1),i=e.substring(t));break;case 9:case 10:case 12:case 13:case 32:case 35:case 160:case 65279:return Yt(e)}var o=void 0!==Kt?new Kt:{};return o.path=e,o.href=e,o.pathname=a,null!==i&&(o.query=n,o.search=i),o}function no(e,a){return"object"==typeof a&&null!==a&&(void 0===Kt||a instanceof Kt)&&a._raw===e}Qt.exports=eo,Qt.exports.original=function(e){var a=e.originalUrl;if("string"!=typeof a)return eo(e);var n=e._parsedOriginalUrl;return no(a,n)?n:((n=ao(a))._raw=a,e._parsedOriginalUrl=n)};var io=Qt.exports,to=Ht("finalhandler"),oo=$t,so=Jt,ro=Oa,co=io,po=Q,lo=ba,uo=/\x20{2}/g,mo=/\n/g,fo="function"==typeof setImmediate?setImmediate:function(e){process.nextTick(e.bind.apply(e,arguments))},vo=ro.isFinished,xo=function(e,a,n){var i=n||{},t=i.env||"production",o=i.onerror;return function(n){var i,s,r;if(n||!ho(a)){if(n?(r=function(e){return"number"==typeof e.status&&e.status>=400&&e.status<600?e.status:"number"==typeof e.statusCode&&e.statusCode>=400&&e.statusCode<600?e.statusCode:void 0}(n),void 0===r?r=function(e){var a=e.statusCode;return("number"!=typeof a||a<400||a>599)&&(a=500),a}(a):i=function(e){if(e.headers&&"object"==typeof e.headers){for(var a=Object.create(null),n=Object.keys(e.headers),i=0;i<n.length;i++){var t=n[i];a[t]=e.headers[t]}return a}}(n),s=function(e,a,n){var i;return"production"!==n&&((i=e.stack)||"function"!=typeof e.toString||(i=e.toString())),i||po.message[a]}(n,r,t)):(r=404,s="Cannot "+e.method+" "+oo(function(e){try{return co.original(e).pathname}catch(e){return"resource"}}(e))),to("default %s",r),n&&o&&fo(o,n,e,a),ho(a))return to("cannot %d after headers sent",r),void e.socket.destroy();!function(e,a,n,i,t){function o(){var o=function(e){return'<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>'+so(e).replace(mo,"<br>").replace(uo," ")+"</pre>\n</body>\n</html>\n"}(t);a.statusCode=n,a.statusMessage=po.message[n],a.removeHeader("Content-Encoding"),a.removeHeader("Content-Language"),a.removeHeader("Content-Range"),function(e,a){if(a)for(var n=Object.keys(a),i=0;i<n.length;i++){var t=n[i];e.setHeader(t,a[t])}}(a,i),a.setHeader("Content-Security-Policy","default-src 'none'"),a.setHeader("X-Content-Type-Options","nosniff"),a.setHeader("Content-Type","text/html; charset=utf-8"),a.setHeader("Content-Length",Buffer.byteLength(o,"utf8")),"HEAD"!==e.method?a.end(o,"utf8"):a.end()}vo(e)?o():(lo(e),ro(e,o),e.resume())}(e,a,r,i,s)}else to("cannot 404 after headers sent")}};
|
||||
/*!
|
||||
* finalhandler
|
||||
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/function ho(e){return"boolean"!=typeof e.headersSent?Boolean(e._header):e.headersSent}var bo,go,yo,wo,ko={exports:{}},jo={exports:{}},Eo={exports:{}},So={exports:{}};function Ao(){return yo||(yo=1,function(e,a){var n;function i(e){function i(){if(i.enabled){var e=i,t=+new Date,o=t-(n||t);e.diff=o,e.prev=n,e.curr=t,n=t;for(var s=new Array(arguments.length),r=0;r<s.length;r++)s[r]=arguments[r];s[0]=a.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(n,i){if("%%"===n)return n;c++;var t=a.formatters[i];if("function"==typeof t){var o=s[c];n=t.call(e,o),s.splice(c,1),c--}return n})),a.formatArgs.call(e,s),(i.log||a.log||console.log.bind(console)).apply(e,s)}}return i.namespace=e,i.enabled=a.enabled(e),i.useColors=a.useColors(),i.color=function(e){var n,i=0;for(n in e)i=(i<<5)-i+e.charCodeAt(n),i|=0;return a.colors[Math.abs(i)%a.colors.length]}(e),"function"==typeof a.init&&a.init(i),i}(a=So.exports=i.debug=i.default=i).coerce=function(e){return e instanceof Error?e.stack||e.message:e},a.disable=function(){a.enable("")},a.enable=function(e){a.save(e),a.names=[],a.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length,t=0;t<i;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?a.skips.push(new RegExp("^"+e.substr(1)+"$")):a.names.push(new RegExp("^"+e+"$")))},a.enabled=function(e){var n,i;for(n=0,i=a.skips.length;n<i;n++)if(a.skips[n].test(e))return!1;for(n=0,i=a.names.length;n<i;n++)if(a.names[n].test(e))return!0;return!1},a.humanize=function(){if(go)return bo;go=1;var e=1e3,a=60*e,n=60*a,i=24*n;function t(e,a,n){if(!(e<a))return e<1.5*a?Math.floor(e/a)+" "+n:Math.ceil(e/a)+" "+n+"s"}return bo=function(o,s){s=s||{};var r=typeof o;if("string"===r&&o.length>0)return function(t){if(!((t=String(t)).length>100)){var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*a;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(o);if("number"===r&&!1===isNaN(o))return s.long?function(o){return t(o,i,"day")||t(o,n,"hour")||t(o,a,"minute")||t(o,e,"second")||o+" ms"}(o):function(t){return t>=i?Math.round(t/i)+"d":t>=n?Math.round(t/n)+"h":t>=a?Math.round(t/a)+"m":t>=e?Math.round(t/e)+"s":t+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},bo}(),a.names=[],a.skips=[],a.formatters={}}(0,So.exports)),So.exports}var Oo,_o={exports:{}};"undefined"!=typeof process&&"renderer"===process.type?jo.exports=(wo||(wo=1,function(e,a){function n(){var e;try{e=a.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(a=Eo.exports=Ao()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},a.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+a.humanize(this.diff),n){var i="color: "+this.color;e.splice(1,0,i,"color: inherit");var t=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(t++,"%c"===e&&(o=t))})),e.splice(o,0,i)}},a.save=function(e){try{null==e?a.storage.removeItem("debug"):a.storage.debug=e}catch(e){}},a.load=n,a.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},a.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),a.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],a.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},a.enable(n())}(0,Eo.exports)),Eo.exports):jo.exports=(Oo||(Oo=1,function(e,a){var s=n,r=i;(a=_o.exports=Ao()).init=function(e){e.inspectOpts={};for(var n=Object.keys(a.inspectOpts),i=0;i<n.length;i++)e.inspectOpts[n[i]]=a.inspectOpts[n[i]]},a.log=function(){return p.write(r.format.apply(r,arguments)+"\n")},a.formatArgs=function(e){var n=this.namespace;if(this.useColors){var i=this.color,t=" [3"+i+";1m"Line truncated
|
||||
/*!
|
||||
* express
|
||||
* Copyright(c) 2009-2013 TJ Holowaychuk
|
||||
* Copyright(c) 2013 Roman Shtylman
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/,Bo=Co("express:router:layer"),No=Object.prototype.hasOwnProperty,Lo=Uo;function Uo(e,a,n){if(!(this instanceof Uo))return new Uo(e,a,n);Bo("new %o",e);var i=a||{};this.handle=n,this.name=n.name||"<anonymous>",this.params=void 0,this.path=void 0,this.regexp=Io(e,this.keys=[],i),this.regexp.fast_star="*"===e,this.regexp.fast_slash="/"===e&&!1===i.end}function Fo(e){if("string"!=typeof e||0===e.length)return e;try{return decodeURIComponent(e)}catch(a){throw a instanceof URIError&&(a.message="Failed to decode param '"+e+"'",a.status=a.statusCode=400),a}}
|
||||
/*!
|
||||
* methods
|
||||
* Copyright(c) 2013-2014 TJ Holowaychuk
|
||||
* Copyright(c) 2015-2016 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/Uo.prototype.handle_error=function(e,a,n,i){var t=this.handle;if(4!==t.length)return i(e);try{t(e,a,n,i)}catch(e){i(e)}},Uo.prototype.handle_request=function(e,a,n){var i=this.handle;if(i.length>3)return n();try{i(e,a,n)}catch(e){n(e)}},Uo.prototype.match=function(e){var a;if(null!=e){if(this.regexp.fast_slash)return this.params={},this.path="",!0;if(this.regexp.fast_star)return this.params={0:Fo(e)},this.path=e,!0;a=this.regexp.exec(e)}if(!a)return this.params=void 0,this.path=void 0,!1;this.params={},this.path=a[0];for(var n=this.keys,i=this.params,t=1;t<a.length;t++){var o=n[t-1].name,s=Fo(a[t]);void 0===s&&No.call(i,o)||(i[o]=s)}return!0};var Ro=m,Do=Ro.METHODS&&Ro.METHODS.map((function(e){return e.toLowerCase()}))||["get","post","put","head","delete","options","trace","copy","lock","mkcol","move","purge","propfind","proppatch","unlock","report","mkactivity","checkout","merge","m-search","notify","subscribe","unsubscribe","patch","search","connect"],Mo=Co("express:router:route"),Ho=To,$o=Lo,Go=Do,Wo=Array.prototype.slice,Zo=Object.prototype.toString,Vo=Jo;function Jo(e){this.path=e,this.stack=[],Mo("new %o",e),this.methods={}}Jo.prototype._handles_method=function(e){if(this.methods._all)return!0;var a=e.toLowerCase();return"head"!==a||this.methods.head||(a="get"),Boolean(this.methods[a])},Jo.prototype._options=function(){var e=Object.keys(this.methods);this.methods.get&&!this.methods.head&&e.push("head");for(var a=0;a<e.length;a++)e[a]=e[a].toUpperCase();return e},Jo.prototype.dispatch=function(e,a,n){var i=0,t=this.stack,o=0;if(0===t.length)return n();var s=e.method.toLowerCase();"head"!==s||this.methods.head||(s="get"),e.route=this,function r(c){if(c&&"route"===c)return n();if(c&&"router"===c)return n(c);if(++o>100)return setImmediate(r,c);var p=t[i++];if(!p)return n(c);p.method&&p.method!==s?r(c):c?p.handle_error(c,e,a,r):p.handle_request(e,a,r),o=0}()},Jo.prototype.all=function(){for(var e=Ho(Wo.call(arguments)),a=0;a<e.length;a++){var n=e[a];if("function"!=typeof n){var i=Zo.call(n);throw new TypeError("Route.all() requires a callback function but got a "+i)}var t=$o("/",{},n);t.method=void 0,this.methods._all=!0,this.stack.push(t)}return this},Go.forEach((function(e){Jo.prototype[e]=function(){for(var a=Ho(Wo.call(arguments)),n=0;n<a.length;n++){var i=a[n];if("function"!=typeof i){var t=Zo.call(i);throw new Error("Route."+e+"() requires a callback function but got a "+t)}Mo("%s %o",e,this.path);var o=$o("/",{},i);o.method=e,this.methods[e]=!0,this.stack.push(o)}return this}}));var Qo={exports:function(e,a){if(e&&a)for(var n in a)e[n]=a[n];return e}}.exports,Xo=Vo,Yo=Lo,Ko=Do,es=Qo,as=Co("express:router"),ns=y("express"),is=To,ts=io,os=V,ss=/^\[object (\S+)\]$/,rs=Array.prototype.slice,cs=Object.prototype.toString,ps=ko.exports=function(e){var a=e||{};function n(e,a,i){n.handle(e,a,i)}return os(n,ps),n.params={},n._params=[],n.caseSensitive=a.caseSensitive,n.mergeParams=a.mergeParams,n.strict=a.strict,n.stack=[],n};function ls(e,a){for(var n=0;n<a.length;n++){var i=a[n];-1===e.indexOf(i)&&e.push(i)}}function us(e,a){try{return e.match(a)}catch(e){return e}}ps.param=function(e,a){if("function"==typeof e)return ns("router.param(fn): Refactor to use path params"),void this._params.push(e);var n,i=this._params,t=i.length;":"===e[0]&&(ns("router.param("+JSON.stringify(e)+", fn): Use router.param("+JSON.stringify(e.slice(1))+", fn) instead"),e=e.slice(1));for(var o=0;o<t;++o)(n=i[o](e,a))&&(a=n);if("function"!=typeof a)throw new Error("invalid param() call for "+e+", got "+a);return(this.params[e]=this.params[e]||[]).push(a),this},ps.handle=function(e,a,n){var i=this;as("dispatching %s %s",e.method,e.url);var t,o,s=0,r=function(e){if("string"==typeof e&&0!==e.length&&"/"!==e[0]){var a=e.indexOf("?"),n=-1!==a?a:e.length,i=e.slice(0,n).indexOf("://");return-1!==i?e.substring(0,e.indexOf("/",3+i)):void 0}}(e.url)||"",c="",p=!1,l=0,u={},d=[],m=i.stack,f=e.params,v=e.baseUrl||"",x=function(e,a){for(var n=new Array(arguments.length-2),i=new Array(arguments.length-2),t=0;t<n.length;t++)n[t]=arguments[t+2],i[t]=a[n[t]];return function(){for(var t=0;t<n.length;t++)a[n[t]]=i[t];return e.apply(this,arguments)}}(n,e,"baseUrl","next","params");function h(n){var t="route"===n?null:n;if(p&&(e.url=e.url.slice(1),p=!1),0!==c.length&&(e.baseUrl=v,e.url=r+c+e.url.slice(r.length),c=""),"router"!==t)if(s>=m.length)setImmediate(x,t);else{if(++l>100)return setImmediate(h,n);var o,b,g,y=function(e){try{return ts(e).pathname}catch(e){return}}(e);if(null==y)return x(t);for(;!0!==b&&s<m.length;)if(b=us(o=m[s++],y),g=o.route,"boolean"!=typeof b&&(t=t||b),!0===b&&g)if(t)b=!1;else{var w=e.method,k=g._handles_method(w);k||"OPTIONS"!==w||ls(d,g._options()),k||"HEAD"===w||(b=!1)}if(!0!==b)return x(t);g&&(e.route=g),e.params=i.mergeParams?function(e,a){if("object"!=typeof a||!a)return e;var n=es({},a);if(!(0 in e)||!(0 in a))return es(n,e);for(var i=0,t=0;i in e;)i++;for(;t in a;)t++;for(i--;i>=0;i--)e[i+t]=e[i],i<t&&delete e[i];retu
Line truncated
|
||||
/*!
|
||||
* express
|
||||
* Copyright(c) 2009-2013 TJ Holowaychuk
|
||||
* Copyright(c) 2013 Roman Shtylman
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/vs.init=function(e){return function(a,n,i){e.enabled("x-powered-by")&&n.setHeader("X-Powered-By","Express"),a.res=n,n.req=a,a.next=i,xs(a,e.request),xs(n,e.response),n.locals=n.locals||Object.create(null),i()}};var bs=Co("express:view"),gs=a,ys=t,ws=gs.dirname,ks=gs.basename,js=gs.extname,Es=gs.join,Ss=gs.resolve,As=Os;function Os(e,a){var n=a||{};if(this.defaultEngine=n.defaultEngine,this.ext=js(e),this.name=e,this.root=n.root,!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");var i=e;if(this.ext||(this.ext="."!==this.defaultEngine[0]?"."+this.defaultEngine:this.defaultEngine,i+=this.ext),!n.engines[this.ext]){var t=this.ext.slice(1);bs('require "%s"',t);var o=f.c(t).__express;if("function"!=typeof o)throw new Error('Module "'+t+'" does not provide a view engine.');n.engines[this.ext]=o}this.engine=n.engines[this.ext],this.path=this.lookup(i)}function _s(e){bs('stat "%s"',e);try{return ys.statSync(e)}catch(e){return}}Os.prototype.lookup=function(e){var a,n=[].concat(this.root);bs('lookup "%s"',e);for(var i=0;i<n.length&&!a;i++){var t=n[i],o=Ss(t,e),s=ws(o),r=ks(o);a=this.resolve(s,r)}return a},Os.prototype.render=function(e,a){bs('render "%s"',this.path),this.engine(this.path,e,a)},Os.prototype.resolve=function(e,a){var n=this.ext,i=Es(e,a),t=_s(i);return t&&t.isFile()||(t=_s(i=Es(e,ks(a,n),"index"+n)))&&t.isFile()?i:void 0};var Cs={},Ts={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
!function(e,a){var n=p,i=n.Buffer;function t(e,a){for(var n in e)a[n]=e[n]}function o(e,a,n){return i(e,a,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(t(n,a),a.Buffer=o),o.prototype=Object.create(i.prototype),t(i,o),o.from=function(e,a,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,a,n)},o.alloc=function(e,a,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var t=i(e);return void 0!==a?"string"==typeof n?t.fill(a,n):t.fill(a):t.fill(0),t},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}(Ts,Ts.exports);var qs=Ts.exports,zs={exports:function(e,a){var n=a||{},i=n.type||"attachment",t=function(e,a){if(void 0!==e){var n={};if("string"!=typeof e)throw new TypeError("filename must be a string");if(void 0===a&&(a=!0),"string"!=typeof a&&"boolean"!=typeof a)throw new TypeError("fallback must be a string or boolean");if("string"==typeof a&&Us.test(a))throw new TypeError("fallback must be ISO-8859-1 string");var i=Ps(e),t=Ms.test(i),o="string"!=typeof a?a&&Zs(i):Ps(a),s="string"==typeof o&&o!==i;return(s||!t||Ns.test(i))&&(n["filename*"]=i),(t||s)&&(n.filename=s?o:i),n}}(e,n.fallback);return function(e){var a=e.parameters,n=e.type;if(!n||"string"!=typeof n||!Hs.test(n))throw new TypeError("invalid type");var i=String(n).toLowerCase();if(a&&"object"==typeof a)for(var t,o=Object.keys(a).sort(),s=0;s<o.length;s++){var r="*"===(t=o[s]).substr(-1)?Xs(a[t]):Qs(a[t]);i+="; "+t+"="+r}return i}(new Ys(i,t))}};zs.exports.parse=function(e){if(!e||"string"!=typeof e)throw new TypeError("argument string is required");var a=Gs.exec(e);if(!a)throw new TypeError("invalid type format");var n,i,t=a[0].length,o=a[1].toLowerCase(),s=[],r={};for(t=Ds.lastIndex=";"===a[0].substr(-1)?t-1:t;a=Ds.exec(e);){if(a.index!==t)throw new TypeError("invalid parameter format");if(t+=a[0].length,n=a[1].toLowerCase(),i=a[2],-1!==s.indexOf(n))throw new TypeError("invalid duplicate parameter");s.push(n),n.indexOf("*")+1!==n.length?"string"!=typeof r[n]&&('"'===i[0]&&(i=i.substr(1,i.length-2).replace(Fs,"$1")),r[n]=i):(n=n.slice(0,-1),i=Ws(i),r[n]=i)}if(-1!==t&&t!==e.length)throw new TypeError("invalid parameter format");return new Ys(o,r)};var Ps=a.basename,Is=qs.Buffer,Bs=/[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g,Ns=/%[0-9A-Fa-f]{2}/,Ls=/%([0-9A-Fa-f]{2})/g,Us=/[^\x20-\x7e\xa0-\xff]/g,Fs=/\\([\u0000-\u007f])/g,Rs=/([\\"])/g,Ds=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g,Ms=/^[\x20-\x7e\x80-\xff]+$/,Hs=/^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/,$s=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/,Gs=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;function Ws(e){var a=$s.exec(e);if(!a)throw new TypeError("invalid extended field value");var n,i=a[1].toLowerCase(),t=a[2].replace(Ls,Vs);switch(i){case"iso-8859-1":n=Zs(t);break;case"utf-8":n=Is.from(t,"binary").toString("utf8");break;default:throw new TypeError("unsupported charset in extended field")}return n}function Zs(e){return String(e).replace(Us,"?")}function Vs(e,a){return String.fromCharCode(parseInt(a,16))}function Js(e){return"%"+String(e).charCodeAt(0).toString(16).toUpperCase()}function Qs(e){return'"'+String(e).replace(Rs,"\\$1")+'"'}function Xs(e){var a=String(e);return"UTF-8''"+encodeURIComponent(a).replace(Bs,Js)}function Ys(e,a){this.type=e,this.parameters=a}var Ks,er,ar,nr,ir=zs.exports,tr={exports:{}},or={exports:{}},sr={exports:{}},rr={exports:{}};function cr(){return ar||(ar=1,function(e,a){var n;function i(e){function i(){if(i.enabled){var e=i,t=+new Date,o=t-(n||t);e.diff=o,e.prev=n,e.curr=t,n=t;for(var s=new Array(arguments.length),r=0;r<s.length;r++)s[r]=arguments[r];s[0]=a.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(n,i){if("%%"===n)return n;c++;var t=a.formatters[i];if("function"==typeof t){var o=s[c];n=t.call(e,o),s.splice(c,1),c--}return n})),a.formatArgs.call(e,s),(i.log||a.log||console.log.bind(console)).apply(e,s)}}return i.namespace=e,i.enabled=a.enabled(e),i.useColors=a.useColors(),i.color=function(e){var n,i=0;for(n in e)i=(i<<5)-i+e.charCodeAt(n),i|=0;return a.colors[Math.abs(i)%a.colors.length]}(e),"function"==typeof a.init&&a.init(i),i}(a=rr.exports=i.debug=i.default=i).coerce=function(e){return e instanceof Error?e.stack||e.message:e},a.disable=function(){a.enable("")},a.enable=function(e){a.save(e),a.names=[],a.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length,t=0;t<i;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?a.skips.push(new RegExp("^"+e.substr(1)+"$")):a.names.push(new RegExp("^"+e+"$")))},a.enabled=function(e){var n,i;Line truncated
|
||||
/*!
|
||||
* etag
|
||||
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/function br(e){var a=e&&Date.parse(e);return"number"==typeof a?a:NaN}var gr=t;function yr(){this.types=Object.create(null),this.extensions=Object.create(null)}yr.prototype.define=function(e){for(var a in e){for(var n=e[a],i=0;i<n.length;i++)process.env.DEBUG_MIME&&this.types[n[i]]&&console.warn((this._loading||"define()").replace(/.*\//,""),'changes "'+n[i]+'" extension type from '+this.types[n[i]]+" to "+a),this.types[n[i]]=a;this.extensions[a]||(this.extensions[a]=n[0])}},yr.prototype.load=function(e){this._loading=e;var a={};gr.readFileSync(e,"ascii").split(/[\r\n]+/).forEach((function(e){var n=e.replace(/\s*#.*|^\s*|\s*$/g,"").split(/\s+/);a[n.shift()]=n})),this.define(a),this._loading=null},yr.prototype.lookup=function(e,a){var n=e.replace(/^.*[\.\/\\]/,"").toLowerCase();return this.types[n]||a||this.default_type},yr.prototype.extension=function(e){var a=e.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();return this.extensions[a]};var wr=new yr;wr.define({"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":[],"application/font-woff2":[],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":
Line truncated
|
||||
/*!
|
||||
* range-parser
|
||||
* Copyright(c) 2012-2014 TJ Holowaychuk
|
||||
* Copyright(c) 2015-2016 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/function Er(e,a){return{start:e.start,end:e.end,index:a}}function Sr(e){return{start:e.start,end:e.end}}function Ar(e,a){return e.index-a.index}function Or(e,a){return e.start-a.start}
|
||||
/*!
|
||||
* send
|
||||
* Copyright(c) 2012 TJ Holowaychuk
|
||||
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/var _r=pe,Cr=ur("send"),Tr=y("send"),qr=ke,zr=$t,Pr=Jt,Ir=dr,Br=hr,Nr=t,Lr=kr,Ur=e.m,Fr=Oa,Rr=jr,Dr=a,Mr=Q,Hr=r,$r=i,Gr=Dr.extname,Wr=Dr.join,Zr=Dr.normalize,Vr=Dr.resolve,Jr=Dr.sep,Qr=/^ *bytes=/,Xr=31536e6,Yr=/(?:^|[\\/])\.\.(?:[\\/]|$)/;function Kr(e,a,n){Hr.call(this);var i=n||{};if(this.options=i,this.path=a,this.req=e,this._acceptRanges=void 0===i.acceptRanges||Boolean(i.acceptRanges),this._cacheControl=void 0===i.cacheControl||Boolean(i.cacheControl),this._etag=void 0===i.etag||Boolean(i.etag),this._dotfiles=void 0!==i.dotfiles?i.dotfiles:"ignore","ignore"!==this._dotfiles&&"allow"!==this._dotfiles&&"deny"!==this._dotfiles)throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"');this._hidden=Boolean(i.hidden),void 0!==i.hidden&&Tr("hidden: use dotfiles: '"+(this._hidden?"allow":"ignore")+"' instead"),void 0===i.dotfiles&&(this._dotfiles=void 0),this._extensions=void 0!==i.extensions?ic(i.extensions,"extensions option"):[],this._immutable=void 0!==i.immutable&&Boolean(i.immutable),this._index=void 0!==i.index?ic(i.index,"index option"):["index.html"],this._lastModified=void 0===i.lastModified||Boolean(i.lastModified),this._maxage=i.maxAge||i.maxage,this._maxage="string"==typeof this._maxage?Ur(this._maxage):Number(this._maxage),this._maxage=isNaN(this._maxage)?0:Math.min(Math.max(0,this._maxage),Xr),this._root=i.root?Vr(i.root):null,!this._root&&i.from&&this.from(i.from)}function ec(e,a,n){return e+" "+(n?n.start+"-"+n.end:"*")+"/"+a}function ac(e,a){return'<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>'+e+"</title>\n</head>\n<body>\n<pre>"+a+"</pre>\n</body>\n</html>\n"}function nc(e,a){return("function"!=typeof e.listenerCount?e.listeners(a).length:e.listenerCount(a))>0}function ic(e,a){for(var n=[].concat(e||[]),i=0;i<n.length;i++)if("string"!=typeof n[i])throw new TypeError(a+" must be array of strings or false");return n}function tc(e){var a=e&&Date.parse(e);return"number"==typeof a?a:NaN}tr.exports=function(e,a,n){return new Kr(e,a,n)},tr.exports.mime=Lr,$r.inherits(Kr,Hr),Kr.prototype.etag=Tr.function((function(e){return this._etag=Boolean(e),Cr("etag %s",this._etag),this}),"send.etag: pass etag as option"),Kr.prototype.hidden=Tr.function((function(e){return this._hidden=Boolean(e),this._dotfiles=void 0,Cr("hidden %s",this._hidden),this}),"send.hidden: use dotfiles option"),Kr.prototype.index=Tr.function((function(e){var a=e?ic(e,"paths argument"):[];return Cr("index %o",e),this._index=a,this}),"send.index: pass index as option"),Kr.prototype.root=function(e){return this._root=Vr(String(e)),Cr("root %s",this._root),this},Kr.prototype.from=Tr.function(Kr.prototype.root,"send.from: pass root as option"),Kr.prototype.root=Tr.function(Kr.prototype.root,"send.root: pass root as option"),Kr.prototype.maxage=Tr.function((function(e){return this._maxage="string"==typeof e?Ur(e):Number(e),this._maxage=isNaN(this._maxage)?0:Math.min(Math.max(0,this._maxage),Xr),Cr("max-age %d",this._maxage),this}),"send.maxage: pass maxAge as option"),Kr.prototype.error=function(e,a){if(nc(this,"error"))return this.emit("error",function(e,a){return a?a instanceof Error?_r(e,a,{expose:!1}):_r(e,a):_r(e)}(e,a));var n=this.res,i=Mr.message[e]||String(e),t=ac("Error",Pr(i));!function(e){for(var a=function(e){return"function"!=typeof e.getHeaderNames?Object.keys(e._headers||{}):e.getHeaderNames()}(e),n=0;n<a.length;n++)e.removeHeader(a[n])}(n),a&&a.headers&&function(e,a){for(var n=Object.keys(a),i=0;i<n.length;i++){var t=n[i];e.setHeader(t,a[t])}}(n,a.headers),n.statusCode=e,n.setHeader("Content-Type","text/html; charset=UTF-8"),n.setHeader("Content-Length",Buffer.byteLength(t)),n.setHeader("Content-Security-Policy","default-src 'none'"),n.setHeader("X-Content-Type-Options","nosniff"),n.end(t)},Kr.prototype.hasTrailingSlash=function(){return"/"===this.path[this.path.length-1]},Kr.prototype.isConditionalGET=function(){return this.req.headers["if-match"]||this.req.headers["if-unmodified-since"]||this.req.headers["if-none-match"]||this.req.headers["if-modified-since"]},Kr.prototype.isPreconditionFailure=function(){var e=this.req,a=this.res,n=e.headers["if-match"];if(n){var i=a.getHeader("ETag");return!i||"*"!==n&&function(e){for(var a=0,n=[],i=0,t=0,o=e.length;t<o;t++)switch(e.charCodeAt(t)){case 32:i===a&&(i=a=t+1);break;case 44:i!==a&&n.push(e.substring(i,a)),i=a=t+1;break;default:a=t+1}return i!==a&&n.push(e.substring(i,a)),n}(n).every((function(e){return e!==i&&e!=="W/"+i&&"W/"+e!==i}))}var t=tc(e.headers["if-unmodified-since"]);if(!isNaN(t)){var o=tc(a.getHeader("Last-Modified"));return isNaN(o)||o>t}return!1},Kr.prototype.removeContentHeaderFields=function(){var e=this.res;e.removeHeader("Content-Encoding"),e.removeHeader("Content-Language"),e.removeHeader("Content-Length"),e.removeHeader("Content-Range"),e.removeHeader("Content-Type")},Kr.prototype.notModified=function(){var e=this.res;Cr("not modified"),this.removeContentHeaderFields(),e.statusCode=304,e.end()},Kr.prototLine truncated
|
||||
/*!
|
||||
* proxy-addr
|
||||
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/rc.exports=function(e,a){if(!e)throw new TypeError("req argument is required");if(!a)throw new TypeError("trust argument is required");var n=xc(e,a);return n[n.length-1]},rc.exports.all=xc,rc.exports.compile=hc;var lc=function(e){if(!e)throw new TypeError("argument req is required");var a=function(e){for(var a=e.length,n=[],i=e.length,t=e.length-1;t>=0;t--)switch(e.charCodeAt(t)){case 32:i===a&&(i=a=t);break;case 44:i!==a&&n.push(e.substring(i,a)),i=a=t;break;default:i=t}return i!==a&&n.push(e.substring(i,a)),n}(e.headers["x-forwarded-for"]||""),n=function(e){return e.socket?e.socket.remoteAddress:e.connection.remoteAddress}(e);return[n].concat(a)},uc=pc,dc=/^[0-9]+$/,mc=uc.isValid,fc=uc.parse,vc={linklocal:["169.254.0.0/16","fe80::/10"],loopback:["127.0.0.1/8","::1/128"],uniquelocal:["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16","fc00::/7"]};function xc(e,a){var n=lc(e);if(!a)return n;"function"!=typeof a&&(a=hc(a));for(var i=0;i<n.length-1;i++)a(n[i],i)||(n.length=i+1);return n}function hc(e){if(!e)throw new TypeError("argument is required");var a,n,i,t,o,s,r,c,p;if("string"==typeof e)a=[e];else{if(!Array.isArray(e))throw new TypeError("unsupported trust argument");a=e.slice()}for(var l=0;l<a.length;l++)e=a[l],Object.prototype.hasOwnProperty.call(vc,e)&&(e=vc[e],a.splice.apply(a,[l,1].concat(e)),l+=e.length-1);return n=function(e){for(var a=new Array(e.length),n=0;n<e.length;n++)a[n]=bc(e[n]);return a}(a),0===(i=n.length)?gc:1===i?(o=n[0],s=o[0],r=s.kind(),c="ipv4"===r,p=o[1],function(e){if(!mc(e))return!1;var a=fc(e);if(a.kind()!==r){if(c&&!a.isIPv4MappedAddress())return!1;a=c?a.toIPv4Address():a.toIPv4MappedAddress()}return a.match(s,p)}):(t=n,function(e){if(!mc(e))return!1;for(var a,n=fc(e),i=n.kind(),o=0;o<t.length;o++){var s=t[o],r=s[0],c=r.kind(),p=s[1],l=n;if(i!==c){if("ipv4"===c&&!n.isIPv4MappedAddress())continue;a||(a="ipv4"===c?n.toIPv4Address():n.toIPv4MappedAddress()),l=a}if(l.match(r,p))return!0}return!1})}function bc(e){var a=e.lastIndexOf("/"),n=-1!==a?e.substring(0,a):e;if(!mc(n))throw new TypeError("invalid IP address: "+n);var i=fc(n);-1===a&&"ipv6"===i.kind()&&i.isIPv4MappedAddress()&&(i=i.toIPv4Address());var t="ipv6"===i.kind()?128:32,o=-1!==a?e.substring(a+1,e.length):null;if((o=null===o?t:dc.test(o)?parseInt(o,10):"ipv4"===i.kind()&&mc(o)?function(e){var a=fc(e);return"ipv4"===a.kind()?a.prefixLengthFromSubnetMask():null}(o):null)<=0||o>t)throw new TypeError("invalid range on address: "+e);return[i,o]}function gc(){return!1}var yc=rc.exports;
|
||||
/*!
|
||||
* express
|
||||
* Copyright(c) 2009-2013 TJ Holowaychuk
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/!function(e){var a=qs.Buffer,n=ir,i=U,t=y("express"),o=To,s=sc.mime,r=dr,c=yc,p=_t,l=u;function d(e){return function(n,i){var t=a.isBuffer(n)?n:a.from(n,i);return r(t,e)}}function m(e){return p.parse(e,{allowPrototypes:!0})}function f(){return{}}e.etag=d({weak:!1}),e.wetag=d({weak:!0}),e.isAbsolute=function(e){return"/"===e[0]||":"===e[1]&&("\\"===e[2]||"/"===e[2])||"\\\\"===e.substring(0,2)||void 0},e.flatten=t.function(o,"utils.flatten: use array-flatten npm module instead"),e.normalizeType=function(e){return~e.indexOf("/")?function(e,a){for(var n=e.split(/ *; */),i={value:n[0],quality:1,params:{},originalIndex:void 0},t=1;t<n.length;++t){var o=n[t].split(/ *= */);"q"===o[0]?i.quality=parseFloat(o[1]):i.params[o[0]]=o[1]}return i}(e):{value:s.lookup(e),params:{}}},e.normalizeTypes=function(a){for(var n=[],i=0;i<a.length;++i)n.push(e.normalizeType(a[i]));return n},e.contentDisposition=t.function(n,"utils.contentDisposition: use content-disposition npm module instead"),e.compileETag=function(a){var n;if("function"==typeof a)return a;switch(a){case!0:case"weak":n=e.wetag;break;case!1:break;case"strong":n=e.etag;break;default:throw new TypeError("unknown value for etag function: "+a)}return n},e.compileQueryParser=function(e){var a;if("function"==typeof e)return e;switch(e){case!0:case"simple":a=l.parse;break;case!1:a=f;break;case"extended":a=m;break;default:throw new TypeError("unknown value for query parser function: "+e)}return a},e.compileTrust=function(e){return"function"==typeof e?e:!0===e?function(){return!0}:"number"==typeof e?function(a,n){return n<e}:("string"==typeof e&&(e=e.split(",").map((function(e){return e.trim()}))),c.compile(e||[]))},e.setCharset=function(e,a){if(!e||!a)return e;var n=i.parse(e);return n.parameters.charset=a,i.format(n)}}(Cs),
|
||||
/*!
|
||||
* express
|
||||
* Copyright(c) 2009-2013 TJ Holowaychuk
|
||||
* Copyright(c) 2013 Roman Shtylman
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
function(e,n){var i=xo,t=fs,o=Do,s=vs,r=hs(),c=Co("express:application"),p=As,l=m,u=Cs.compileETag,d=Cs.compileQueryParser,f=Cs.compileTrust,v=y("express"),x=To,h=Qo,b=a.resolve,g=V,w=Object.prototype.hasOwnProperty,k=Array.prototype.slice,j=e.exports={},E="@@symbol:trust_proxy_default";function S(e){"test"!==this.get("env")&&console.error(e.stack||e.toString())}j.init=function(){this.cache={},this.engines={},this.settings={},this.defaultConfiguration()},j.defaultConfiguration=function(){var e="production";this.enable("x-powered-by"),this.set("etag","weak"),this.set("env",e),this.set("query parser","extended"),this.set("subdomain offset",2),this.set("trust proxy",!1),Object.defineProperty(this.settings,E,{configurable:!0,value:!0}),c("booting in %s mode",e),this.on("mount",(function(e){!0===this.settings[E]&&"function"==typeof e.settings["trust proxy fn"]&&(delete this.settings["trust proxy"],delete this.settings["trust proxy fn"]),g(this.request,e.request),g(this.response,e.response),g(this.engines,e.engines),g(this.settings,e.settings)})),this.locals=Object.create(null),this.mountpath="/",this.locals.settings=this.settings,this.set("view",p),this.set("views",b("views")),this.set("jsonp callback name","callback"),this.enable("view cache"),Object.defineProperty(this,"router",{get:function(){throw new Error("'app.router' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app.")}})},j.lazyrouter=function(){this._router||(this._router=new t({caseSensitive:this.enabled("case sensitive routing"),strict:this.enabled("strict routing")}),this._router.use(r(this.get("query parser fn"))),this._router.use(s.init(this)))},j.handle=function(e,a,n){var t=this._router,o=n||i(e,a,{env:this.get("env"),onerror:S.bind(this)});if(!t)return c("no routes defined on app"),void o();t.handle(e,a,o)},j.use=function(e){var a=0,n="/";if("function"!=typeof e){for(var i=e;Array.isArray(i)&&0!==i.length;)i=i[0];"function"!=typeof i&&(a=1,n=e)}var t=x(k.call(arguments,a));if(0===t.length)throw new TypeError("app.use() requires a middleware function");this.lazyrouter();var o=this._router;return t.forEach((function(e){if(!e||!e.handle||!e.set)return o.use(n,e);c(".use app under %s",n),e.mountpath=n,e.parent=this,o.use(n,(function(a,n,i){var t=a.app;e.handle(a,n,(function(e){g(a,t.request),g(n,t.response),i(e)}))})),e.emit("mount",this)}),this),this},j.route=function(e){return this.lazyrouter(),this._router.route(e)},j.engine=function(e,a){if("function"!=typeof a)throw new Error("callback function required");var n="."!==e[0]?"."+e:e;return this.engines[n]=a,this},j.param=function(e,a){if(this.lazyrouter(),Array.isArray(e)){for(var n=0;n<e.length;n++)this.param(e[n],a);return this}return this._router.param(e,a),this},j.set=function(e,a){if(1!==arguments.length){switch(c('set "%s" to %o',e,a),this.settings[e]=a,e){case"etag":this.set("etag fn",u(a));break;case"query parser":this.set("query parser fn",d(a));break;case"trust proxy":this.set("trust proxy fn",f(a)),Object.defineProperty(this.settings,E,{configurable:!0,value:!1})}return this}for(var n=this.settings;n&&n!==Object.prototype;){if(w.call(n,e))return n[e];n=Object.getPrototypeOf(n)}},j.path=function(){return this.parent?this.parent.path()+this.mountpath:""},j.enabled=function(e){return Boolean(this.set(e))},j.disabled=function(e){return!this.set(e)},j.enable=function(e){return this.set(e,!0)},j.disable=function(e){return this.set(e,!1)},o.forEach((function(e){j[e]=function(a){if("get"===e&&1===arguments.length)return this.set(a);this.lazyrouter();var n=this._router.route(a);return n[e].apply(n,k.call(arguments,1)),this}})),j.all=function(e){this.lazyrouter();for(var a=this._router.route(e),n=k.call(arguments,1),i=0;i<o.length;i++)a[o[i]].apply(a,n);return this},j.del=v.function(j.delete,"app.del: Use app.delete instead"),j.render=function(e,a,n){var i,t=this.cache,o=n,s=this.engines,r=a,c={};if("function"==typeof a&&(o=a,r={}),h(c,this.locals),r._locals&&h(c,r._locals),h(c,r),null==c.cache&&(c.cache=this.enabled("view cache")),c.cache&&(i=t[e]),!i){if(!(i=new(this.get("view"))(e,{defaultEngine:this.get("view engine"),root:this.get("views"),engines:s})).path){var p=Array.isArray(i.root)&&i.root.length>1?'directories "'+i.root.slice(0,-1).join('", "')+'" or "'+i.root[i.root.length-1]+'"':'directory "'+i.root+'"',l=new Error('Failed to lookup view "'+e+'" in views '+p);return l.view=i,o(l)}c.cache&&(t[e]=i)}!function(e,a,n){try{e.render(a,n)}catch(e){n(e)}}(i,c,o)},j.listen=function(){var e=l.createServer(this);return e.listen.apply(e,arguments)}}(Nt);var wc=Nt.exports,kc={exports:{}},jc={exports:{}};jc.exports=Oc,jc.exports.preferredCharsets=Oc;var Ec=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function Sc(e,a){var n=Ec.exec(e);if(!n)return null;var i=n[1],t=1;if(n[2])for(var o=n[2].split(";"),s=0;s<o.length;s++){var r=o[s].trim().split("=");if("q"===r[0]){t=parseFloat(r[1]);break}}return{charset:i,q:t,i:a}}function Ac(e,a,n){var i=0;if(a.charset.toLowerCase()Line truncated
|
||||
/*!
|
||||
* negotiator
|
||||
* Copyright(c) 2012 Federico Romero
|
||||
* Copyright(c) 2012-2014 Isaac Z. Schlueter
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/function up(e){if(!(this instanceof up))return new up(e);this.request=e}kc.exports=up,kc.exports.Negotiator=up,up.prototype.charset=function(e){var a=this.charsets(e);return a&&a[0]},up.prototype.charsets=function(e){return rp(this.request.headers["accept-charset"],e)},up.prototype.encoding=function(e){var a=this.encodings(e);return a&&a[0]},up.prototype.encodings=function(e){return cp(this.request.headers["accept-encoding"],e)},up.prototype.language=function(e){var a=this.languages(e);return a&&a[0]},up.prototype.languages=function(e){return pp(this.request.headers["accept-language"],e)},up.prototype.mediaType=function(e){var a=this.mediaTypes(e);return a&&a[0]},up.prototype.mediaTypes=function(e){return lp(this.request.headers.accept,e)},up.prototype.preferredCharset=up.prototype.charset,up.prototype.preferredCharsets=up.prototype.charsets,up.prototype.preferredEncoding=up.prototype.encoding,up.prototype.preferredEncodings=up.prototype.encodings,up.prototype.preferredLanguage=up.prototype.language,up.prototype.preferredLanguages=up.prototype.languages,up.prototype.preferredMediaType=up.prototype.mediaType,up.prototype.preferredMediaTypes=up.prototype.mediaTypes;var dp=kc.exports,mp=Ra,fp=vp;
|
||||
/*!
|
||||
* accepts
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/function vp(e){if(!(this instanceof vp))return new vp(e);this.headers=e.headers,this.negotiator=new dp(e)}function xp(e){return-1===e.indexOf("/")?mp.lookup(e):e}function hp(e){return"string"==typeof e}
|
||||
/*!
|
||||
* express
|
||||
* Copyright(c) 2009-2013 TJ Holowaychuk
|
||||
* Copyright(c) 2013 Roman Shtylman
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/vp.prototype.type=vp.prototype.types=function(e){var a=e;if(a&&!Array.isArray(a)){a=new Array(arguments.length);for(var n=0;n<a.length;n++)a[n]=arguments[n]}if(!a||0===a.length)return this.negotiator.mediaTypes();if(!this.headers.accept)return a[0];var i=a.map(xp),t=this.negotiator.mediaTypes(i.filter(hp))[0];return!!t&&a[i.indexOf(t)]},vp.prototype.encoding=vp.prototype.encodings=function(e){var a=e;if(a&&!Array.isArray(a)){a=new Array(arguments.length);for(var n=0;n<a.length;n++)a[n]=arguments[n]}return a&&0!==a.length?this.negotiator.encodings(a)[0]||!1:this.negotiator.encodings()},vp.prototype.charset=vp.prototype.charsets=function(e){var a=e;if(a&&!Array.isArray(a)){a=new Array(arguments.length);for(var n=0;n<a.length;n++)a[n]=arguments[n]}return a&&0!==a.length?this.negotiator.charsets(a)[0]||!1:this.negotiator.charsets()},vp.prototype.lang=vp.prototype.langs=vp.prototype.language=vp.prototype.languages=function(e){var a=e;if(a&&!Array.isArray(a)){a=new Array(arguments.length);for(var n=0;n<a.length;n++)a[n]=arguments[n]}return a&&0!==a.length?this.negotiator.languages(a)[0]||!1:this.negotiator.languages()};var bp=fp,gp=y("express"),yp=o.isIP,wp=en,kp=m,jp=hr,Ep=jr,Sp=io,Ap=yc,Op=Object.create(kp.IncomingMessage.prototype),_p=Op;function Cp(e,a,n){Object.defineProperty(e,a,{configurable:!0,enumerable:!0,get:n})}Op.get=Op.header=function(e){if(!e)throw new TypeError("name argument is required to req.get");if("string"!=typeof e)throw new TypeError("name must be a string to req.get");var a=e.toLowerCase();switch(a){case"referer":case"referrer":return this.headers.referrer||this.headers.referer;default:return this.headers[a]}},Op.accepts=function(){var e=bp(this);return e.types.apply(e,arguments)},Op.acceptsEncodings=function(){var e=bp(this);return e.encodings.apply(e,arguments)},Op.acceptsEncoding=gp.function(Op.acceptsEncodings,"req.acceptsEncoding: Use acceptsEncodings instead"),Op.acceptsCharsets=function(){var e=bp(this);return e.charsets.apply(e,arguments)},Op.acceptsCharset=gp.function(Op.acceptsCharsets,"req.acceptsCharset: Use acceptsCharsets instead"),Op.acceptsLanguages=function(){var e=bp(this);return e.languages.apply(e,arguments)},Op.acceptsLanguage=gp.function(Op.acceptsLanguages,"req.acceptsLanguage: Use acceptsLanguages instead"),Op.range=function(e,a){var n=this.get("Range");if(n)return Ep(e,n,a)},Op.param=function(e,a){var n=this.params||{},i=this.body||{},t=this.query||{};return gp("req.param("+(1===arguments.length?"name":"name, default")+"): Use req.params, req.body, or req.query instead"),null!=n[e]&&n.hasOwnProperty(e)?n[e]:null!=i[e]?i[e]:null!=t[e]?t[e]:a},Op.is=function(e){var a=e;if(!Array.isArray(e)){a=new Array(arguments.length);for(var n=0;n<a.length;n++)a[n]=arguments[n]}return wp(this,a)},Cp(Op,"protocol",(function(){var e=this.connection.encrypted?"https":"http";if(!this.app.get("trust proxy fn")(this.connection.remoteAddress,0))return e;var a=this.get("X-Forwarded-Proto")||e,n=a.indexOf(",");return-1!==n?a.substring(0,n).trim():a.trim()})),Cp(Op,"secure",(function(){return"https"===this.protocol})),Cp(Op,"ip",(function(){var e=this.app.get("trust proxy fn");return Ap(this,e)})),Cp(Op,"ips",(function(){var e=this.app.get("trust proxy fn"),a=Ap.all(this,e);return a.reverse().pop(),a})),Cp(Op,"subdomains",(function(){var e=this.hostname;if(!e)return[];var a=this.app.get("subdomain offset");return(yp(e)?[e]:e.split(".").reverse()).slice(a)})),Cp(Op,"path",(function(){return Sp(this).pathname})),Cp(Op,"hostname",(function(){var e=this.app.get("trust proxy fn"),a=this.get("X-Forwarded-Host");if(a&&e(this.connection.remoteAddress,0)?-1!==a.indexOf(",")&&(a=a.substring(0,a.indexOf(",")).trimRight()):a=this.get("Host"),a){var n="["===a[0]?a.indexOf("]")+1:0,i=a.indexOf(":",n);return-1!==i?a.substring(0,i):a}})),Cp(Op,"host",gp.function((function(){return this.hostname}),"req.host: Use req.hostname instead")),Cp(Op,"fresh",(function(){var e=this.method,a=this.res,n=a.statusCode;return("GET"===e||"HEAD"===e)&&(n>=200&&n<300||304===n)&&jp(this.headers,{etag:a.get("ETag"),"last-modified":a.get("Last-Modified")})})),Cp(Op,"stale",(function(){return!this.fresh})),Cp(Op,"xhr",(function(){return"xmlhttprequest"===(this.get("X-Requested-With")||"").toLowerCase()}));var Tp={};!function(e){var a=v;function n(e){return a.createHash("sha1").update(e).digest("hex")}e.sign=function(e,n){if("string"!=typeof e)throw new TypeError("Cookie value must be provided as a string.");if("string"!=typeof n)throw new TypeError("Secret string must be provided.");return e+"."+a.createHmac("sha256",n).update(e).digest("base64").replace(/\=+$/,"")},e.unsign=function(a,i){if("string"!=typeof a)throw new TypeError("Signed cookie string must be provided.");if("string"!=typeof i)throw new TypeError("Secret string must be provided.");var t=a.slice(0,a.lastIndexOf("."));return n(e.sign(t,i))==n(a)&&t}}(Tp);var qp={
|
||||
/*!
|
||||
* cookie
|
||||
* Copyright(c) 2012-2014 Roman Shtylman
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
parse:function(e,a){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},i=(a||{}).decode||Ip,t=0;t<e.length;){var o=e.indexOf("=",t);if(-1===o)break;var s=e.indexOf(";",t);if(-1===s)s=e.length;else if(s<o){t=e.lastIndexOf(";",o-1)+1;continue}var r=e.slice(t,o).trim();if(void 0===n[r]){var c=e.slice(o+1,s).trim();34===c.charCodeAt(0)&&(c=c.slice(1,-1)),n[r]=Np(c,i)}t=s+1}return n},serialize:function(e,a,n){var i=n||{},t=i.encode||Bp;if("function"!=typeof t)throw new TypeError("option encode is invalid");if(!Pp.test(e))throw new TypeError("argument name is invalid");var o=t(a);if(o&&!Pp.test(o))throw new TypeError("argument val is invalid");var s=e+"="+o;if(null!=i.maxAge){var r=i.maxAge-0;if(isNaN(r)||!isFinite(r))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+Math.floor(r)}if(i.domain){if(!Pp.test(i.domain))throw new TypeError("option domain is invalid");s+="; Domain="+i.domain}if(i.path){if(!Pp.test(i.path))throw new TypeError("option path is invalid");s+="; Path="+i.path}if(i.expires){var c=i.expires;if(!function(e){return"[object Date]"===zp.call(e)||e instanceof Date}(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+c.toUTCString()}if(i.httpOnly&&(s+="; HttpOnly"),i.secure&&(s+="; Secure"),i.priority)switch("string"==typeof i.priority?i.priority.toLowerCase():i.priority){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(i.sameSite)switch("string"==typeof i.sameSite?i.sameSite.toLowerCase():i.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s}},zp=Object.prototype.toString,Pp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Ip(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function Bp(e){return encodeURIComponent(e)}function Np(e,a){try{return a(e)}catch(a){return e}}var Lp={exports:function(e,a){if(!e||!e.getHeader||!e.setHeader)throw new TypeError("res argument is required");var n=e.getHeader("Vary")||"",i=Array.isArray(n)?n.join(", "):String(n);(n=Fp(i,a))&&e.setHeader("Vary",n)}};
|
||||
/*!
|
||||
* vary
|
||||
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/Lp.exports.append=Fp;var Up=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Fp(e,a){if("string"!=typeof e)throw new TypeError("header argument is required");if(!a)throw new TypeError("field argument is required");for(var n=Array.isArray(a)?a:Rp(String(a)),i=0;i<n.length;i++)if(!Up.test(n[i]))throw new TypeError("field argument contains an invalid header name");if("*"===e)return e;var t=e,o=Rp(e.toLowerCase());if(-1!==n.indexOf("*")||-1!==o.indexOf("*"))return"*";for(var s=0;s<n.length;s++){var r=n[s].toLowerCase();-1===o.indexOf(r)&&(o.push(r),t=t?t+", "+n[s]:n[s])}return t}function Rp(e){for(var a=0,n=[],i=0,t=0,o=e.length;t<o;t++)switch(e.charCodeAt(t)){case 32:i===a&&(i=a=t+1);break;case 44:n.push(e.substring(i,a)),i=a=t+1;break;default:a=t+1}return n.push(e.substring(i,a)),n}var Dp=Lp.exports,Mp=qs.Buffer,Hp=ir,$p=pe,Gp=y("express"),Wp=$t,Zp=Jt,Vp=m,Jp=Cs.isAbsolute,Qp=Oa,Xp=a,Yp=Q,Kp=Qo,el=Tp.sign,al=Cs.normalizeType,nl=Cs.normalizeTypes,il=Cs.setCharset,tl=qp,ol=sc,sl=Xp.extname,rl=ol.mime,cl=Xp.resolve,pl=Dp,ll=Object.create(Vp.ServerResponse.prototype),ul=ll,dl=/;\s*charset\s*=/;
|
||||
/*!
|
||||
* express
|
||||
* Copyright(c) 2009-2013 TJ Holowaychuk
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/function ml(e,a,n,i){var t,o=!1;function s(){if(!o){o=!0;var e=new Error("Request aborted");e.code="ECONNABORTED",i(e)}}function r(e){o||(o=!0,i(e))}a.on("directory",(function(){if(!o){o=!0;var e=new Error("EISDIR, read");e.code="EISDIR",i(e)}})),a.on("end",(function(){o||(o=!0,i())})),a.on("error",r),a.on("file",(function(){t=!1})),a.on("stream",(function(){t=!0})),Qp(e,(function(e){return e&&"ECONNRESET"===e.code?s():e?r(e):void(o||setImmediate((function(){!1===t||o?o||(o=!0,i()):s()})))})),n.headers&&a.on("headers",(function(e){for(var a=n.headers,i=Object.keys(a),t=0;t<i.length;t++){var o=i[t];e.setHeader(o,a[o])}})),a.pipe(e)}function fl(e,a,n,i){var t=a||n?JSON.stringify(e,a,n):JSON.stringify(e);return i&&"string"==typeof t&&(t=t.replace(/[<>&]/g,(function(e){switch(e.charCodeAt(0)){case 60:return"\\u003c";case 62:return"\\u003e";case 38:return"\\u0026";default:return e}}))),t}ll.status=function(e){return("string"==typeof e||Math.floor(e)!==e)&&e>99&&e<1e3&&Gp("res.status("+JSON.stringify(e)+"): use res.status("+Math.floor(e)+") instead"),this.statusCode=e,this},ll.links=function(e){var a=this.get("Link")||"";return a&&(a+=", "),this.set("Link",a+Object.keys(e).map((function(a){return"<"+e[a]+'>; rel="'+a+'"'})).join(", "))},ll.send=function(e){var a,n,i=e,t=this.req,o=this.app;switch(2===arguments.length&&("number"!=typeof arguments[0]&&"number"==typeof arguments[1]?(Gp("res.send(body, status): Use res.status(status).send(body) instead"),this.statusCode=arguments[1]):(Gp("res.send(status, body): Use res.status(status).send(body) instead"),this.statusCode=arguments[0],i=arguments[1])),"number"==typeof i&&1===arguments.length&&(this.get("Content-Type")||this.type("txt"),Gp("res.send(status): Use res.sendStatus(status) instead"),this.statusCode=i,i=Yp.message[i]),typeof i){case"string":this.get("Content-Type")||this.type("html");break;case"boolean":case"number":case"object":if(null===i)i="";else{if(!Mp.isBuffer(i))return this.json(i);this.get("Content-Type")||this.type("bin")}}"string"==typeof i&&(a="utf8","string"==typeof(n=this.get("Content-Type"))&&this.set("Content-Type",il(n,"utf-8")));var s,r,c=o.get("etag fn"),p=!this.get("ETag")&&"function"==typeof c;return void 0!==i&&(Mp.isBuffer(i)?s=i.length:!p&&i.length<1e3?s=Mp.byteLength(i,a):(i=Mp.from(i,a),a=void 0,s=i.length),this.set("Content-Length",s)),p&&void 0!==s&&(r=c(i,a))&&this.set("ETag",r),t.fresh&&(this.statusCode=304),204!==this.statusCode&&304!==this.statusCode||(this.removeHeader("Content-Type"),this.removeHeader("Content-Length"),this.removeHeader("Transfer-Encoding"),i=""),205===this.statusCode&&(this.set("Content-Length","0"),this.removeHeader("Transfer-Encoding"),i=""),"HEAD"===t.method?this.end():this.end(i,a),this},ll.json=function(e){var a=e;2===arguments.length&&("number"==typeof arguments[1]?(Gp("res.json(obj, status): Use res.status(status).json(obj) instead"),this.statusCode=arguments[1]):(Gp("res.json(status, obj): Use res.status(status).json(obj) instead"),this.statusCode=arguments[0],a=arguments[1]));var n=this.app,i=n.get("json escape"),t=fl(a,n.get("json replacer"),n.get("json spaces"),i);return this.get("Content-Type")||this.set("Content-Type","application/json"),this.send(t)},ll.jsonp=function(e){var a=e;2===arguments.length&&("number"==typeof arguments[1]?(Gp("res.jsonp(obj, status): Use res.status(status).jsonp(obj) instead"),this.statusCode=arguments[1]):(Gp("res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead"),this.statusCode=arguments[0],a=arguments[1]));var n=this.app,i=n.get("json escape"),t=fl(a,n.get("json replacer"),n.get("json spaces"),i),o=this.req.query[n.get("jsonp callback name")];return this.get("Content-Type")||(this.set("X-Content-Type-Options","nosniff"),this.set("Content-Type","application/json")),Array.isArray(o)&&(o=o[0]),"string"==typeof o&&0!==o.length&&(this.set("X-Content-Type-Options","nosniff"),this.set("Content-Type","text/javascript"),o=o.replace(/[^\[\]\w$.]/g,""),void 0===t?t="":"string"==typeof t&&(t=t.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")),t="/**/ typeof "+o+" === 'function' && "+o+"("+t+");"),this.send(t)},ll.sendStatus=function(e){var a=Yp.message[e]||String(e);return this.statusCode=e,this.type("txt"),this.send(a)},ll.sendFile=function(e,a,n){var i=n,t=this.req,o=t.next,s=a||{};if(!e)throw new TypeError("path argument is required to res.sendFile");if("string"!=typeof e)throw new TypeError("path must be a string to res.sendFile");if("function"==typeof a&&(i=a,s={}),!s.root&&!Jp(e))throw new TypeError("path must be absolute or specify root to res.sendFile");var r=encodeURI(e);ml(this,ol(t,r,s),s,(function(e){return i?i(e):e&&"EISDIR"===e.code?o():void(e&&"ECONNABORTED"!==e.code&&"write"!==e.syscall&&o(e))}))},ll.sendfile=function(e,a,n){var i=n,t=this.req,o=t.next,s=a||{};"function"==typeof a&&(i=a,s={}),ml(this,ol(t,e,s),s,(function(e){return i?i(e):e&&"EISDIR"===e.code?o():void(e&&"ECONNABORTED"!==e.code&&"write"!==e.syscall&&o(e))}))},ll.sendfiLine truncated
|
||||
/*!
|
||||
* serve-static
|
||||
* Copyright(c) 2010 Sencha Inc.
|
||||
* Copyright(c) 2011 TJ Holowaychuk
|
||||
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
/*!
|
||||
* express
|
||||
* Copyright(c) 2009-2013 TJ Holowaychuk
|
||||
* Copyright(c) 2013 Roman Shtylman
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
!function(e,n){var i=Pt,t=s.EventEmitter,o=It,r=wc,c=Vo,p=fs,l=_p,u=ul;(n=e.exports=function(){var e=function(a,n,i){e.handle(a,n,i)};return o(e,t.prototype,!1),o(e,r,!1),e.request=Object.create(l,{app:{configurable:!0,enumerable:!0,writable:!0,value:e}}),e.response=Object.create(u,{app:{configurable:!0,enumerable:!0,writable:!0,value:e}}),e.init(),e}).application=r,n.request=l,n.response=u,n.Route=c,n.Router=p,n.json=i.json,n.query=hs(),n.raw=i.raw,n.static=function(){if(vl)return xl.exports;vl=1;var e=$t,n=Jt,i=io,t=a.resolve,o=sc,s=d;return xl.exports=function(a,r){if(!a)throw new TypeError("root path required");if("string"!=typeof a)throw new TypeError("root path must be a string");var c=Object.create(r||null),p=!1!==c.fallthrough,l=!1!==c.redirect,u=c.setHeaders;if(u&&"function"!=typeof u)throw new TypeError("option setHeaders must be function");c.maxage=c.maxage||c.maxAge||0,c.root=t(a);var d=l?function(a){if(this.hasTrailingSlash())this.error(404);else{var t=i.original(this.req);t.path=null,t.pathname=function(e){for(var a=0;a<e.length&&47===e.charCodeAt(a);a++);return a>1?"/"+e.substr(a):e}(t.pathname+"/");var o=e(s.format(t)),r='<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Redirecting</title>\n</head>\n<body>\n<pre>Redirecting to <a href="'+n(o)+'">'+n(o)+"</a></pre>\n</body>\n</html>\n";a.statusCode=301,a.setHeader("Content-Type","text/html; charset=UTF-8"),a.setHeader("Content-Length",Buffer.byteLength(r)),a.setHeader("Content-Security-Policy","default-src 'none'"),a.setHeader("X-Content-Type-Options","nosniff"),a.setHeader("Location",o),a.end(r)}}:function(){this.error(404)};return function(e,a,n){if("GET"!==e.method&&"HEAD"!==e.method)return p?n():(a.statusCode=405,a.setHeader("Allow","GET, HEAD"),a.setHeader("Content-Length","0"),void a.end());var t=!p,s=i.original(e),r=i(e).pathname;"/"===r&&"/"!==s.pathname.substr(-1)&&(r="");var l=o(e,r,c);l.on("directory",d),u&&l.on("headers",u),p&&l.on("file",(function(){t=!0})),l.on("error",(function(e){!t&&e.statusCode<500?n():n(e)})),l.pipe(a)}},xl.exports.mime=o.mime,xl.exports}(),n.text=i.text,n.urlencoded=i.urlencoded,["bodyParser","compress","cookieSession","session","logger","cookieParser","favicon","responseTime","errorHandler","timeout","methodOverride","vhost","csrf","directory","limit","multipart","staticCache"].forEach((function(e){Object.defineProperty(n,e,{get:function(){throw new Error("Most middleware (like "+e+") is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.")},configurable:!0})}))}(h,h.exports);var hl=h.exports,bl=x({__proto__:null,default:e.g(hl)},[hl]);
|
||||
/*!
|
||||
* express
|
||||
* Copyright(c) 2009-2013 TJ Holowaychuk
|
||||
* Copyright(c) 2013 Roman Shtylman
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/exports.i=bl;
|
||||
+1
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("./marp-cli-9fe562c5.js");require("process"),require("os"),require("tty"),require("yargs/yargs"),require("yargs"),require("fs"),require("path"),require("cosmiconfig"),require("util"),require("child_process"),require("url"),require("import-from"),require("stream"),require("events"),require("tmp"),require("@marp-team/marpit"),require("puppeteer-core"),require("net"),require("is-wsl"),require("crypto"),require("chokidar"),require("ws"),require("querystring"),require("serve-index"),require("@marp-team/marp-core/package.json");const e=r.a;exports.CLIError=r.C,Object.defineProperty(exports,"CLIErrorCode",{enumerable:!0,get:function(){return r.b}}),exports.default=r.a,exports.waitForObservation=r.w,exports.marpCli=e;
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"command": "npm run demo",
|
||||
"name": "Run npm demo",
|
||||
"request": "launch",
|
||||
"type": "node-terminal"
|
||||
},
|
||||
{
|
||||
"command": "npm run test",
|
||||
"name": "Run npm test",
|
||||
"request": "launch",
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"mocha.files.glob": "tests/**/*.test.js"
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
# CHANGELOG
|
||||
|
||||
## v1.3.2
|
||||
|
||||
* refactor url parser.
|
||||
* **remark**: throw error on calling `use()` with invalid option (invalid `entrypoint` parameter).
|
||||
|
||||
## v1.3.1
|
||||
|
||||
* update development packages
|
||||
* `@marp-team/marp-cli`, `jsdom`, `markdown-it`, `mocha`
|
||||
|
||||
## v1.3.0
|
||||
|
||||
* support `render` option see [this issue](https://github.com/kazumatu981/markdown-it-kroki/issues/4) and [this memo](memo/howToWriteRender.md)
|
||||
* *for developers* support coverage test script `test:coverage`.
|
||||
|
||||
## v1.2.3
|
||||
|
||||
* support `d2`, see [this issue](https://github.com/kazumatu981/markdown-it-kroki/issues/8)
|
||||
|
||||
## v1.2.2
|
||||
|
||||
* fix readme, see [this pull-request](https://github.com/kazumatu981/markdown-it-kroki/pull/6)
|
||||
* support `dbml`, see [this issue](https://github.com/kazumatu981/markdown-it-kroki/issues/5)
|
||||
|
||||
## v1.2.1
|
||||
|
||||
* Embed `<embed>` tag instead of `<img>` tag, see [this issue](https://github.com/kazumatu981/markdown-it-kroki/issues/2).
|
||||
* `<img>` will be used for **compatibility**, so set option `useImg` to `true` (default `false`).
|
||||
|
||||
## v1.1.1
|
||||
|
||||
* fix readme, see [this issue](https://github.com/kazumatu981/markdown-it-kroki/issues/1)
|
||||
|
||||
## v1.1.0
|
||||
|
||||
* Obsolated Option `marpAutoScaling` and detect automatically wether it is nessesury or not.
|
||||
|
||||
## v1.0.1
|
||||
|
||||
release on npm
|
||||
|
||||
## v1.0.0
|
||||
|
||||
create new
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 Kazuyoshi Matsumoto
|
||||
|
||||
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.
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
# markdown-it-kroki
|
||||
|
||||
> This library was designed to embed [Kroki.io](https://kroki.io/) diagram into [Marp](https://marp.app/) slide decks!!
|
||||
|
||||
|
||||
This library is a plugin for markdown-it to embed figure created by textual syntax.
|
||||
To use this package, you can embed **Software Diagram** (like UML) written by **code** in Marp slide decks.
|
||||
|
||||
See marp sample code.
|
||||
|
||||
## Sample
|
||||
|
||||
---
|
||||
marp: true
|
||||
---
|
||||
|
||||
|
||||
## plantuml
|
||||
|
||||
```plantuml[platuml image]
|
||||
@startuml
|
||||
left to right direction
|
||||
actor Guest as g
|
||||
package Professional {
|
||||
actor Chef as c
|
||||
actor "Food Critic" as fc
|
||||
}
|
||||
package Restaurant {
|
||||
usecase "Eat Food" as UC1
|
||||
usecase "Pay for Food" as UC2
|
||||
usecase "Drink" as UC3
|
||||
usecase "Review" as UC4
|
||||
}
|
||||
fc --> UC4
|
||||
g --> UC1
|
||||
g --> UC2
|
||||
g --> UC3
|
||||
@enduml
|
||||
```
|
||||
|
||||

|
||||
|
||||
If you want to write diagrams, you can use various syntaxes (such as [PlantUML](https://plantuml.com/) or [Mermaid](https://mermaid-js.github.io/mermaid/#/)) within fenced code blocks.
|
||||
|
||||
## How to install
|
||||
|
||||
You can install `npm install` command like below.
|
||||
|
||||
```bash
|
||||
npm install -D @kazumatu981/markdown-it-kroki
|
||||
```
|
||||
|
||||
## How to use
|
||||
|
||||
Here is the how to use `markdow-it-kroki`.
|
||||
This section introduces how to create Marp slides deck project,
|
||||
and introduces how to create Marp slides deck server.
|
||||
|
||||
You can find detail [here](https://marp.app/),
|
||||
and you can learn about marp plugin ecosystem [here](https://marpit.marp.app/usage?id=extend-marpit-by-plugins).
|
||||
|
||||
### **[1st step]** Create slides deck project
|
||||
|
||||
First, to create a slides deck, you have to create a **Marp Project** directory and initialize a npm project.
|
||||
|
||||
```bash
|
||||
mkdir myslides
|
||||
cd myslides
|
||||
npm init -y
|
||||
```
|
||||
|
||||
Then, build a Marp environment.
|
||||
Install [@marp-team/marp-cli](https://github.com/marp-team/marp-cli).
|
||||
|
||||
```bash
|
||||
npm install -D @marp-team/marp-cli
|
||||
```
|
||||
|
||||
> Off-course you can install as **global package** (like `npm install -g @marp-team/marp-cli`), or **run at-once** (like `npx`).
|
||||
|
||||
### **[2nd step]** Download this project and install
|
||||
|
||||
```bash
|
||||
git clone https://github.com/kazumatu981/markdown-it-kroki.git
|
||||
|
||||
cd myslides
|
||||
npm install -D path/to/markdown-it-kroki
|
||||
```
|
||||
|
||||
### **[3rd step]** Create `marp.config.js`.
|
||||
|
||||
Here is the configuration file for **Marp**.
|
||||
|
||||
```javascript
|
||||
module.exports = {
|
||||
inputDir: './slides',
|
||||
engine: ({ marp }) => marp.use(require('@kazumatu981/markdown-it-kroki'), {
|
||||
entrypoint: "https://kroki.io",
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
### **[4th step]** Create your slides
|
||||
|
||||
On `slies` directory. you create slides-deck. like this.
|
||||
|
||||
---
|
||||
marp: true
|
||||
---
|
||||
|
||||
|
||||
## mermaid
|
||||
|
||||
```mermaid[mermaid image]
|
||||
flowchart TD
|
||||
Start --> Stop
|
||||
```
|
||||
|
||||
### **[5th step]** run server
|
||||
|
||||
Run marp server.
|
||||
|
||||
```bash
|
||||
marp -s -c marp.config.js
|
||||
```
|
||||
|
||||
## Detail
|
||||
|
||||
### Syntax of Markdown
|
||||
|
||||
#### Diagram Language
|
||||
|
||||
You have to write diagram language by [fenced code block](https://spec.commonmark.org/0.30/#fenced-code-blocks) syntax, start with **triple back quot** and after that the language.
|
||||
|
||||
```plantuml
|
||||
|
||||
> [!NOTE]
|
||||
> This package depends on [Kroki.io](https://kroki.io).
|
||||
> If you want to know which **diagram languages are supported**,
|
||||
> please check the official website at [https://kroki.io/](https://kroki.io/).
|
||||
|
||||
#### Alt Text
|
||||
|
||||
You can write Alt-text attribute to IMG tag in HTML.
|
||||
Write in `square blacket` after **Diagram Language**.
|
||||
|
||||
```mermaid [check your network config..]
|
||||
|
||||
### Options of `constructor`
|
||||
|
||||
| property-name | type | mean | defaul value |
|
||||
| ---------------- | -------- | ------------------------------------------------------ | ------------------------- |
|
||||
| `entrypoint` | `string` | The entry point for Kroki server. | `'https://kroki.io'` |
|
||||
| `containerClass` | `string` | class name of container (`DIV`-tag `class` attribute). | `'kroki-image-container'` |
|
||||
| `imageFormat` | `string` | image format of diagram. see [here](https://kroki.io/) | `'svg'` |
|
||||
| `useImg` | `boolean` | use `<img>` tag for embed diagram. ( *for compatibility for past version* ) | `false` |
|
||||
| `render` | `function` | if you render `html` yourself use this option. see [How To Write `render()` call back](memo/howToWriteRender.md) | `undefined` |
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
|
||||
module.exports = {
|
||||
inputDir: './',
|
||||
engine: ({ marp }) => marp.use(require('../index'), {
|
||||
entrypoint: "https://kroki.io",
|
||||
marpAutoScaling: true
|
||||
})
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
---
|
||||
marp: true
|
||||
---
|
||||
|
||||
# @kazumatu981/markdown-it-kroki
|
||||
|
||||
## Marp Sample
|
||||
|
||||
---
|
||||
|
||||
## plantuml
|
||||
|
||||
```plantuml[platuml image]
|
||||
@startuml
|
||||
left to right direction
|
||||
actor Guest as g
|
||||
package Professional {
|
||||
actor Chef as c
|
||||
actor "Food Critic" as fc
|
||||
}
|
||||
package Restaurant {
|
||||
usecase "Eat Food" as UC1
|
||||
usecase "Pay for Food" as UC2
|
||||
usecase "Drink" as UC3
|
||||
usecase "Review" as UC4
|
||||
}
|
||||
fc --> UC4
|
||||
g --> UC1
|
||||
g --> UC2
|
||||
g --> UC3
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## plantuml with hyperlink
|
||||
|
||||
```plantuml
|
||||
@startuml
|
||||
left to right direction
|
||||
|
||||
object "[[https://github.com/markdown-it/markdown-it{markdown-it} markdown-it]]" as MarkdownIt
|
||||
|
||||
object "[[https://github.com/kazumatu981/markdown-it-kroki{markdown-it-krokii} markdown-it-krokii]]" as MarkdownItKrokii
|
||||
|
||||
MarkdownIt --> MarkdownItKrokii
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## dbml
|
||||
|
||||
```dbml
|
||||
Table users {
|
||||
id integer
|
||||
username varchar
|
||||
role varchar
|
||||
created_at timestamp
|
||||
}
|
||||
|
||||
Table posts {
|
||||
id integer [primary key]
|
||||
title varchar
|
||||
body text [note: 'Content of the post']
|
||||
user_id integer
|
||||
created_at timestamp
|
||||
}
|
||||
|
||||
Ref: posts.user_id > users.id
|
||||
```
|
||||
|
||||
|
||||
---
|
||||
|
||||
## mermaid
|
||||
|
||||
```mermaid[mermaid image]
|
||||
graph TD
|
||||
A[ Anyone ] -->|Can help | B( Go to github.com/yuzutech/kroki )
|
||||
B --> C{ How to contribute? }
|
||||
C --> D[ Reporting bugs ]
|
||||
C --> E[ Sharing ideas ]
|
||||
C --> F[ Advocating ]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## normal code
|
||||
|
||||
```JavaScript
|
||||
function testFunc(test) {
|
||||
let sum = 0;
|
||||
for(let x = 1; x<=test; x++) {
|
||||
sum += x;
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
```
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
+6
@@ -0,0 +1,6 @@
|
||||
const { MarkdownItKrokiCore } = require('./lib/plugin-core');
|
||||
|
||||
module.exports = (md, opt) => {
|
||||
const plugin = new MarkdownItKrokiCore(md);
|
||||
plugin.setOptions(opt).use();
|
||||
};
|
||||
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* contract `test` to be non-empty string.
|
||||
* @param {string} test test string
|
||||
* @param {string} msg message on exception
|
||||
*/
|
||||
toNonEmptyString: function (test, msg) {
|
||||
if (typeof test !== 'string') throw new Error(msg);
|
||||
if (test === ''
|
||||
|| test === null
|
||||
|| test === undefined) throw new Error(msg);
|
||||
},
|
||||
/**
|
||||
* contract `test` to be true.
|
||||
* @param {boolean} test test boolean.
|
||||
* @param {sting} msg massage on excetion.
|
||||
*/
|
||||
toTrue: function (test, msg) {
|
||||
if (typeof test !== 'boolean') throw new Error(msg);
|
||||
if (!test) throw new Error(msg);
|
||||
},
|
||||
toBeUrlString: function (test, msg) {
|
||||
this.toNonEmptyString(test, msg);
|
||||
try {
|
||||
new URL(test);
|
||||
} catch {
|
||||
throw new Error(msg);
|
||||
}
|
||||
},
|
||||
toBeClassName: function (test, msg) {
|
||||
if (!/^[A-Za-z0-9]+(-?[A-Za-z0-9]+)*$/.exec(test)) {
|
||||
throw new Error(msg);
|
||||
}
|
||||
}
|
||||
};
|
||||
.obsidian/plugins/marp-slides/lib3/markdown-it/@kazumatu981/markdown-it-kroki/lib/diagram-encoder.js
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
|
||||
const { deflateSync } = require('zlib');
|
||||
const contract = require('./contract');
|
||||
const support = require('./support');
|
||||
|
||||
function encode(diagram) {
|
||||
return deflateSync(diagram, { level: 9 }).toString('base64url');
|
||||
}
|
||||
function generateUrl(entrypoint, lang, imgType, diagram) {
|
||||
|
||||
contract.toNonEmptyString(entrypoint, '\'entrypoint\' must be non-empty string.');
|
||||
contract.toNonEmptyString(lang, '\'lang\' must be non-empty string.');
|
||||
contract.toNonEmptyString(imgType, '\'imgType\' must be non-empty string.');
|
||||
contract.toNonEmptyString(diagram, '\'diagram\' must be non-empty string.');
|
||||
contract.toTrue(support.languageSupports(lang), 'Not Supported Diagram Language.');
|
||||
contract.toTrue(support.imageFormatSupports(imgType), 'Not Supported Image Type.');
|
||||
|
||||
const api = `${lang}/${imgType}/${encode(diagram)}`;
|
||||
|
||||
return entrypoint.endsWith('/') ?
|
||||
`${entrypoint}${api}` : `${entrypoint}/${api}`;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
encode, generateUrl
|
||||
};
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
const { deflateSync } = require('zlib')
|
||||
|
||||
const krokiLangs = [
|
||||
'actdiag',
|
||||
'blockdiag',
|
||||
'bpmn',
|
||||
'bytefield',
|
||||
'c4plantuml',
|
||||
'ditaa',
|
||||
'dot',
|
||||
'erd',
|
||||
'excalidraw',
|
||||
'graphviz',
|
||||
'mermaid',
|
||||
'nomnoml',
|
||||
'nwdiag',
|
||||
'packetdiag',
|
||||
'pikchr',
|
||||
'plantuml',
|
||||
'rackdiag',
|
||||
'seqdiag',
|
||||
'svgbob',
|
||||
'umlet',
|
||||
'vega',
|
||||
'vegalite',
|
||||
'wavedrom',
|
||||
]
|
||||
|
||||
const entrypoint = 'https://kroki.io/'
|
||||
|
||||
const marpKrokiPlugin = (md) => {
|
||||
const { fence } = md.renderer.rules
|
||||
|
||||
md.renderer.rules.fence = (tokens, idx, options, env, self) => {
|
||||
const info = md.utils.unescapeAll(tokens[idx].info).trim()
|
||||
|
||||
if (info) {
|
||||
const [lang] = info.split(/(\s+)/g)
|
||||
|
||||
if (krokiLangs.includes(lang)) {
|
||||
const data = deflateSync(tokens[idx].content).toString('base64url')
|
||||
|
||||
// <marp-auto-scaling> is working only with Marp Core v3
|
||||
return `<p><marp-auto-scaling data-downscale-only><img src="${entrypoint}${lang}/svg/${data}"/></marp-auto-scaling></p>`
|
||||
}
|
||||
}
|
||||
|
||||
return fence.call(self, tokens, idx, options, env, self)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = marpKrokiPlugin
|
||||
Vendored
+85
@@ -0,0 +1,85 @@
|
||||
'use strict';
|
||||
|
||||
const support = require('./support');
|
||||
const contract = require('./contract');
|
||||
const { safeProperty, safeChoice } = require('./safe-property');
|
||||
const diagramEncoder = require('./diagram-encoder');
|
||||
|
||||
class MarkdownItKrokiCore {
|
||||
constructor(md) {
|
||||
this._md = md;
|
||||
}
|
||||
setOptions(opt) {
|
||||
this._entrypoint = safeProperty(opt, "entrypoint", "string", 'https://kroki.io');
|
||||
this._containerClass = safeProperty(opt, "containerClass", "string", "kroki-image-container");
|
||||
this._imageFormat = safeProperty(opt, "imageFormat", "string", "svg");
|
||||
this._useImg = safeProperty(opt, "useImg", "boolean", false);
|
||||
this._render = safeProperty(opt, "render", "function", undefined);
|
||||
|
||||
this._imageFormat = safeChoice(this._imageFormat, support.imageFormats, "svg");
|
||||
|
||||
contract.toBeUrlString(this._entrypoint, "entrypoint must be url string.");
|
||||
contract.toBeClassName(this._containerClass, "containerClass must be className.");
|
||||
|
||||
return this;
|
||||
}
|
||||
use() {
|
||||
// if _md has `marpit` property then use <marp-auto-scaling> tag
|
||||
this._marpAutoScaling = this._md['marpit'] !== undefined;
|
||||
|
||||
this._defaultFence = this._md.renderer.rules.fence;
|
||||
this._md.renderer.rules.fence
|
||||
= (tokens, idx, options, env, self) => this.krokiFencePlugin(tokens, idx, options, env, self);
|
||||
}
|
||||
static readLanguageAndAltText(info) {
|
||||
if (!info) return { language: '', alt: '' };
|
||||
|
||||
const trimed = info.trim();
|
||||
const langFound = /[\s|\[]/.exec(trimed);
|
||||
const altFound = /\[.*?\]/.exec(trimed);
|
||||
|
||||
return {
|
||||
language: langFound ?
|
||||
trimed.substring(0, langFound.index) : trimed,
|
||||
alt: altFound ?
|
||||
altFound[0].replace('[', '').replace(']', '') : ''
|
||||
};
|
||||
}
|
||||
buildEmbedHTML(langAndAlt, diagramCode) {
|
||||
// alt build url
|
||||
const url = diagramEncoder.generateUrl(
|
||||
this._entrypoint, langAndAlt.language, this._imageFormat, diagramCode);
|
||||
|
||||
// sanitize alt
|
||||
const alt = langAndAlt.alt ?
|
||||
this._md.utils.escapeHtml(langAndAlt.alt) : undefined;
|
||||
// build img tag
|
||||
let imgTag;
|
||||
if(this._render) {
|
||||
imgTag = this._render(url, alt);
|
||||
} else if (this._useImg) {
|
||||
imgTag = langAndAlt.alt ?
|
||||
`<img alt="${alt}" src="${url}" />` : `<img src="${url}" />`;
|
||||
} else {
|
||||
imgTag = langAndAlt.alt ?
|
||||
`<embed title="${alt}" src="${url}" />` : `<embed src="${url}" />`;
|
||||
}
|
||||
|
||||
// build container contents
|
||||
const containerContents = this._marpAutoScaling ?
|
||||
`<marp-auto-scaling data-downscale-only>${imgTag}</marp-auto-scaling>` : imgTag;
|
||||
// build embed HTML
|
||||
return `<p class="${this._containerClass}">${containerContents}</p>`;
|
||||
}
|
||||
krokiFencePlugin(tokens, idx, options, env, self) {
|
||||
const info = this._md.utils.unescapeAll(tokens[idx].info)
|
||||
const langAndAlt = MarkdownItKrokiCore.readLanguageAndAltText(info);
|
||||
|
||||
return support.languageSupports(langAndAlt.language) ?
|
||||
this.buildEmbedHTML(langAndAlt, tokens[idx].content) :
|
||||
this._defaultFence.call(self, tokens, idx, options, env, self);
|
||||
}
|
||||
}
|
||||
module.exports = {
|
||||
MarkdownItKrokiCore
|
||||
}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
function safeProperty(test, name, type, defaultValue) {
|
||||
if (test == null || test == undefined) return defaultValue;
|
||||
if (typeof test[name] !== type) return defaultValue;
|
||||
if (typeof test[name] === "string" && test[name] === '') return defaultValue;
|
||||
return test[name];
|
||||
}
|
||||
|
||||
function safeChoice(test, candidates, defaultValue) {
|
||||
return candidates.includes(test) ?
|
||||
test : defaultValue;
|
||||
}
|
||||
|
||||
module.exports = { safeProperty, safeChoice };
|
||||
Vendored
+56
@@ -0,0 +1,56 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Diagram Languages are supported by kroki.io
|
||||
*/
|
||||
const LANGUAGES = [
|
||||
'actdiag',
|
||||
'blockdiag',
|
||||
'bpmn',
|
||||
'bytefield',
|
||||
'c4plantuml',
|
||||
'dbml',
|
||||
'ditaa',
|
||||
'dot',
|
||||
'd2',
|
||||
'erd',
|
||||
'excalidraw',
|
||||
'graphviz',
|
||||
'mermaid',
|
||||
'nomnoml',
|
||||
'nwdiag',
|
||||
'packetdiag',
|
||||
'pikchr',
|
||||
'plantuml',
|
||||
'rackdiag',
|
||||
'seqdiag',
|
||||
'svgbob',
|
||||
'umlet',
|
||||
'vega',
|
||||
'vegalite',
|
||||
'wavedrom',
|
||||
];
|
||||
|
||||
/**
|
||||
* Image formats are supported by kroki.io
|
||||
*/
|
||||
const IMG_FORMATS = [
|
||||
'png', 'svg', 'jpeg', 'pdf', 'base64'
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
lnaguages: LANGUAGES,
|
||||
imageFormats: IMG_FORMATS,
|
||||
/**
|
||||
* test whether `lang` is supported diagram language by kroki.io
|
||||
* @param {string} lang target language
|
||||
* @returns is supported
|
||||
*/
|
||||
languageSupports: (lang) => LANGUAGES.includes(lang),
|
||||
/**
|
||||
* test whether `format` is supported image format by kroki.io
|
||||
* @param {string} format name of image format like 'png', 'svg', ... etc
|
||||
* @returns is supported
|
||||
*/
|
||||
imageFormatSupports: (format) => IMG_FORMATS.includes(format)
|
||||
};
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
# How To Write `render()` call back
|
||||
|
||||
If you need to write code to embed into your own `HTML`,
|
||||
We provide this option.
|
||||
|
||||
When you write call back function as `markdown-it`'s option argument object's `render` property,
|
||||
this plugin call the call-back funtion with argument (encoded url for kroki and alt-text).
|
||||
|
||||
## example
|
||||
|
||||
For example, if you write call-back and `markdown-it`'s `use()` method, like bellow.
|
||||
|
||||
```javascript
|
||||
const md = require('markdown-it');
|
||||
const markdownItKroki = require('kazumatu981/markdown-it-kroki');
|
||||
const urlMap = [];
|
||||
|
||||
function myRender(encodedUrl, altText) {
|
||||
console.log(`URL: ${encodedUrl}`);
|
||||
console.log(`param: ${altText}`);
|
||||
urlMap.push({id: altText, url:encodedUrl});
|
||||
return `<div id=${altText}></div>`
|
||||
}
|
||||
|
||||
md.use(markdownItKroki, {
|
||||
render: myRender
|
||||
});
|
||||
```
|
||||
|
||||
and, write markdown like this.
|
||||
|
||||
## This is test figure
|
||||
|
||||
```plantuml [figure-001]
|
||||
skinparam ranksep 20
|
||||
skinparam dpi 125
|
||||
skinparam packageTitleAlignment left
|
||||
|
||||
rectangle "Main" {
|
||||
(main.view)
|
||||
(singleton)
|
||||
}
|
||||
rectangle "Base" {
|
||||
(base.component)
|
||||
(component)
|
||||
(model)
|
||||
}
|
||||
rectangle "<b>main.ts</b>" as main_ts
|
||||
|
||||
(component) ..> (base.component)
|
||||
main_ts ==> (main.view)
|
||||
(main.view) --> (component)
|
||||
(main.view) ...> (singleton)
|
||||
(singleton) ---> (model)
|
||||
```
|
||||
|
||||
then console results are like this.
|
||||
|
||||
```text
|
||||
URL: https://kroki.io/plantuml/svg/eNpljzEPgjAQhff-iguTDFQlcYMmuru5mwNO0tCWhjY6GP-7LRJTdHvv7r67d26QxuKEGiY0gyML5Y65b7GzEvblIalYbAfs6SK9oqOSvdFkPCi6ecYmaj2aXhFkZ5QmgycD2Ogg-V3SI4_OyTjgR5OzVwqc0NECNEHydtR2NGH3TK2dHjtSP3zViPmQd9W2ERmgg-iv3jGW4MC5-L-wTEJdi1XeRENRiFWOtMfnrclriQ5gJD-Z3x9beAM=
|
||||
param: figure-001
|
||||
```
|
||||
|
||||
## api
|
||||
|
||||
```TypeScript
|
||||
function render(encodedUrl: string, altText: string): string;
|
||||
```
|
||||
|
||||
### arguments
|
||||
|
||||
| name | type| value |
|
||||
| ------------ | -------- | ----- |
|
||||
| `encodedUrl` | `string` | encoded url (include encoded and compressed textual diagram) for Kroki web service. |
|
||||
| `altText` | `string` | The text you have written in markdown as alt-text |
|
||||
|
||||
### return
|
||||
|
||||
The fragment of `html` you want to embed into render result as `string`.
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "@kazumatu981/markdown-it-kroki",
|
||||
"version": "1.3.2",
|
||||
"description": "markdown-it kroki plugin.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "mocha tests/**/*.test.js",
|
||||
"test:coverage": "nyc --reporter=lcov --reporter=html mocha tests/**/*.test.js",
|
||||
"demo": "marp -s -c demo/marp.config.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/kazumatu981/markdown-it-kroki.git"
|
||||
},
|
||||
"keywords": [
|
||||
"markdown-it",
|
||||
"markdown-it-plugin",
|
||||
"kroki",
|
||||
"marp",
|
||||
"markdown"
|
||||
],
|
||||
"author": "kazumatu981",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/kazumatu981/markdown-it-kroki/issues"
|
||||
},
|
||||
"homepage": "https://github.com/kazumatu981/markdown-it-kroki#readme",
|
||||
"devDependencies": {
|
||||
"@marp-team/marp-cli": "^3.4.0",
|
||||
"chai": "^4.4.1",
|
||||
"jsdom": "^24.0.0",
|
||||
"markdown-it": "^14.0.0",
|
||||
"mocha": "^10.3.0",
|
||||
"nyc": "^15.1.0",
|
||||
"sinon": "^17.0.1"
|
||||
}
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
const MarkdownIt = require('markdown-it');
|
||||
const { expect } = require('chai');
|
||||
const { JSDOM } = require('jsdom');
|
||||
const MarkdownItKroki = require('../../index');
|
||||
|
||||
describe('# [Security-test] anti-injecttion for syntax.', () => {
|
||||
describe("## for alt", () => {
|
||||
it('* escape double quote', () => {
|
||||
const expected = 'this is a "test comment" test';
|
||||
|
||||
const md = new MarkdownIt();
|
||||
md.use(MarkdownItKroki, {
|
||||
entrypoint: "https://kroki.io",
|
||||
marpAutoScaling: true,
|
||||
containerClass: "the-container"
|
||||
});
|
||||
|
||||
const result = md.render(
|
||||
'```graphviz [this is a "test comment" test]\r\n' +
|
||||
'digraph G {Hello->World}\r\n' +
|
||||
'```\r\n'
|
||||
);
|
||||
const dom = new JSDOM(result);
|
||||
const imgTag = dom.window.document.getElementsByTagName("embed")[0];
|
||||
const actual = imgTag.getAttribute('title');
|
||||
|
||||
expect(actual).to.be.equal(expected);
|
||||
})
|
||||
})
|
||||
});
|
||||
describe('# [Security-test] anti-injecttion for option.', () => {
|
||||
describe("## for entrypoint", () => {
|
||||
it('* deny invalid URL', () => {
|
||||
const testFunction = () => {
|
||||
const md = new MarkdownIt();
|
||||
md.use(MarkdownItKroki, {
|
||||
entrypoint: "https://kroki.io\"> <script src=\"xxxx.js",
|
||||
marpAutoScaling: true,
|
||||
containerClass: "the-container"
|
||||
});
|
||||
}
|
||||
expect(testFunction).to.throw();
|
||||
})
|
||||
})
|
||||
describe("## for containerClass", () => {
|
||||
|
||||
it('* throw when containerClass are not alpha, digit, or \"-\"', () => {
|
||||
const testFunction = () => {
|
||||
const md = new MarkdownIt();
|
||||
md.use(MarkdownItKroki, {
|
||||
entrypoint: "https://kroki.io",
|
||||
marpAutoScaling: true,
|
||||
containerClass: "<container>"
|
||||
});
|
||||
|
||||
const result = md.render(
|
||||
'```graphviz [this is a test]\r\n' +
|
||||
'digraph G {Hello->World}\r\n' +
|
||||
'```\r\n'
|
||||
);
|
||||
};
|
||||
expect(testFunction).to.throw();
|
||||
|
||||
})
|
||||
})
|
||||
describe("## for imageFormat", () => {
|
||||
it('* ignore invalid imageFormat', () => {
|
||||
const md = new MarkdownIt();
|
||||
md.use(MarkdownItKroki, {
|
||||
entrypoint: "https://kroki.io",
|
||||
marpAutoScaling: true,
|
||||
containerClass: "the-container",
|
||||
imageFormat: "<injected>"
|
||||
});
|
||||
|
||||
const html = md.render(
|
||||
'```graphviz [this is a test]\r\n' +
|
||||
'digraph G {Hello->World}\r\n' +
|
||||
'```\r\n'
|
||||
);
|
||||
const dom = new JSDOM(html);
|
||||
const imgTag = dom.window.document.getElementsByTagName("embed")[0];
|
||||
const actual = imgTag.getAttribute('src');
|
||||
|
||||
expect(actual).to.includes('/svg/');
|
||||
})
|
||||
})
|
||||
});
|
||||
+154
@@ -0,0 +1,154 @@
|
||||
const { expect } = require('chai');
|
||||
const sinon = require('sinon');
|
||||
|
||||
const MarkdownIt = require('markdown-it');
|
||||
const MarkdownItKroki = require('../../index');
|
||||
|
||||
const { JSDOM } = require('jsdom');
|
||||
|
||||
const testData = [
|
||||
// graphviz
|
||||
{
|
||||
langname: 'graphviz',
|
||||
data: '```graphviz svg\r\n' +
|
||||
'digraph G {Hello->World}\r\n' +
|
||||
'```\r\n'
|
||||
}
|
||||
];
|
||||
|
||||
describe('# [total test] Test pulugin can Render DOM', () => {
|
||||
for (const test of testData) {
|
||||
describe(`## Test for ${test.langname}`, () => {
|
||||
describe('### no option call test', () => {
|
||||
it('* Not to Throw on no options', () => {
|
||||
const testFunction = () => {
|
||||
// render !
|
||||
const md = new MarkdownIt();
|
||||
md.use(MarkdownItKroki);
|
||||
const _ = md.render(test.data);
|
||||
};
|
||||
expect(testFunction).to.not.throw();
|
||||
});
|
||||
it('* root DOM item is \'p\' on no option', () => {
|
||||
// render !
|
||||
const md = new MarkdownIt();
|
||||
md.use(MarkdownItKroki);
|
||||
const result = md.render(test.data);
|
||||
|
||||
// find p-tag
|
||||
const dom = new JSDOM(result);
|
||||
const document = dom.window.document;
|
||||
const ptags = document.getElementsByTagName("p");
|
||||
|
||||
// test p-tag is only one
|
||||
expect(ptags.length).to.be.equal(1);
|
||||
|
||||
// test root item is p
|
||||
const thePtag = ptags[0];
|
||||
expect(thePtag.isSameNode(document.body.firstChild)).to.true;
|
||||
|
||||
// test embeded default container class
|
||||
expect(thePtag.getAttribute('class')).to.be.equal('kroki-image-container');
|
||||
});
|
||||
it('* has embed tag and source is created by this library.', () => {
|
||||
// render !
|
||||
const md = new MarkdownIt();
|
||||
md.use(MarkdownItKroki);
|
||||
const result = md.render(test.data);
|
||||
|
||||
// find embed tag
|
||||
const dom = new JSDOM(result);
|
||||
const document = dom.window.document;
|
||||
const imgTags = document.getElementsByTagName("embed");
|
||||
|
||||
// test embed is only one
|
||||
expect(imgTags.length).to.be.equal(1);
|
||||
|
||||
const imgTag = imgTags[0];
|
||||
expect(imgTag.getAttribute('src')).not.to.empty;
|
||||
});
|
||||
});
|
||||
describe('### option call test', () => {
|
||||
it('* entrypoint is embeded in image tag.', () => {
|
||||
const entrypoint = 'https://127.0.0.1';
|
||||
// render !
|
||||
const md = new MarkdownIt();
|
||||
md.use(MarkdownItKroki, {entrypoint: entrypoint});
|
||||
const result = md.render(test.data);
|
||||
|
||||
// find embed tag
|
||||
const dom = new JSDOM(result);
|
||||
const document = dom.window.document;
|
||||
const imgTags = document.getElementsByTagName("embed");
|
||||
|
||||
const imgTag = imgTags[0];
|
||||
expect(imgTag.getAttribute('src')).includes(entrypoint);
|
||||
|
||||
});
|
||||
it('* containerClass is embeded.', () => {
|
||||
const containerClass = 'my-container';
|
||||
// render !
|
||||
const md = new MarkdownIt();
|
||||
md.use(MarkdownItKroki, {containerClass: containerClass});
|
||||
const result = md.render(test.data);
|
||||
|
||||
// find p-tag
|
||||
const dom = new JSDOM(result);
|
||||
const document = dom.window.document;
|
||||
const ptags = document.getElementsByTagName("p");
|
||||
|
||||
// test p-tag is only one
|
||||
expect(ptags.length).to.be.equal(1);
|
||||
|
||||
const thePtag = ptags[0];
|
||||
expect(thePtag.getAttribute('class')).to.be.equal(containerClass);
|
||||
});
|
||||
it('* imageFormat is embeded.', () => {
|
||||
const imageFormat = 'png';
|
||||
// render !
|
||||
const md = new MarkdownIt();
|
||||
md.use(MarkdownItKroki, {imageFormat: imageFormat});
|
||||
const result = md.render(test.data);
|
||||
|
||||
// find embed tag
|
||||
const dom = new JSDOM(result);
|
||||
const document = dom.window.document;
|
||||
const imgTags = document.getElementsByTagName("embed");
|
||||
|
||||
const imgTag = imgTags[0];
|
||||
expect(imgTag.getAttribute('src')).includes(imageFormat);
|
||||
});
|
||||
it('* useImg is enable.', () => {
|
||||
const useImg = true;
|
||||
// render !
|
||||
const md = new MarkdownIt();
|
||||
md.use(MarkdownItKroki, {useImg: useImg});
|
||||
const result = md.render(test.data);
|
||||
|
||||
// img embed tag
|
||||
const dom = new JSDOM(result);
|
||||
const document = dom.window.document;
|
||||
const imgTags = document.getElementsByTagName("img");
|
||||
|
||||
expect(imgTags.length).to.be.equal(1);
|
||||
});
|
||||
it('* render is embeded.', () => {
|
||||
const fakeTag = 'testXXXXXXXXXXXXXXX';
|
||||
const render = sinon.fake.returns(fakeTag);
|
||||
// render !
|
||||
const md = new MarkdownIt();
|
||||
md.use(MarkdownItKroki, {render: render});
|
||||
const result = md.render(test.data);
|
||||
|
||||
// render must be called
|
||||
expect(render.called).to.be.true;
|
||||
|
||||
// render must be called with correct argument
|
||||
expect(render.getCall(0).args[0]).to.contains('https://kroki.io');
|
||||
// endered embeded fakeTag
|
||||
expect(result).to.contains(fakeTag);
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
const expect = require('chai').expect;
|
||||
const contract = require('../../lib/contract');
|
||||
|
||||
describe('# [unit test]: contract.js', () => {
|
||||
describe('## toNonEmptyString()', () => {
|
||||
['abc', ' ', ' abc '].forEach((test) => {
|
||||
it(`* normal cases. { testcase: ${test} }`, () => {
|
||||
expect(() => {
|
||||
contract.toNonEmptyString(test);
|
||||
}).not.to.throw();
|
||||
})
|
||||
});
|
||||
['', null, undefined, 123, 0.123, true, { test: 123 }].forEach((test) => {
|
||||
it(`* abnormal cases. { testcase: ${test} }`, () => {
|
||||
expect(() => {
|
||||
contract.toNonEmptyString(test);
|
||||
}).to.throw();
|
||||
})
|
||||
});
|
||||
});
|
||||
describe('## toTrue', () => {
|
||||
it('* normal case. {test case: true}', () => {
|
||||
expect(() => {
|
||||
contract.toTrue(true);
|
||||
}).not.to.throw();
|
||||
});
|
||||
['', null, undefined, 123, 0.123, false, { test: 123 }].forEach((test) => {
|
||||
it(`* abnormal cases. { testcase: ${test} }`, () => {
|
||||
expect(() => {
|
||||
contract.toTrue(test);
|
||||
}).to.throw();
|
||||
})
|
||||
});
|
||||
});
|
||||
})
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
const expect = require('chai').expect;
|
||||
const { inflateSync } = require('zlib');
|
||||
|
||||
const { encode, generateUrl } = require('../../lib/diagram-encoder');
|
||||
|
||||
describe('# [unit-test]: diagram-encoder.js', () => {
|
||||
describe('## [function]: encode()', () => {
|
||||
it('* encoded data is able to decode.', () => {
|
||||
const testFunc = () => {
|
||||
const expected = '@startuml\nBob -> Alice : hello\n@enduml';
|
||||
|
||||
const encoded = encode(expected);
|
||||
const deflated = Buffer.from(encoded, "base64url");
|
||||
const actual = inflateSync(deflated).toString();
|
||||
|
||||
expect(actual).to.be.equal(expected);
|
||||
}
|
||||
expect(testFunc).not.to.Throw();
|
||||
});
|
||||
});
|
||||
describe('## [function]: generateUrl()', () => {
|
||||
it('* must start format like <entry-point>/<lang>/<format>/', () => {
|
||||
const actual = generateUrl('https://kroki.io', 'graphviz', 'svg', 'digraph G {Hello->World}');
|
||||
const expected = 'https://kroki.io/graphviz/svg/';
|
||||
|
||||
expect(actual).to.be.a('string');
|
||||
expect(actual.startsWith(expected)).to.be.true;
|
||||
});
|
||||
it('* must endwith <encoded>', () => {
|
||||
const actual = generateUrl('https://kroki.io', 'graphviz', 'svg', 'digraph G {Hello->World}');
|
||||
const expected = encode('digraph G {Hello->World}');
|
||||
|
||||
expect(actual).to.be.a('string');
|
||||
expect(actual.endsWith(expected)).to.be.true;
|
||||
});
|
||||
[1, '', null, undefined].forEach(test => {
|
||||
it(`* [exception] throws when entry-point is, non-string object, empty string, null or undefined. Test: ${test}`, () => {
|
||||
const testFunction = () => {
|
||||
let _ = generateUrl(test, 'graphviz', 'svg', 'digraph G {Hello->World}');
|
||||
}
|
||||
expect(testFunction).throw();
|
||||
});
|
||||
it(`* [exception] throws when lang is, non-string object, empty string, null or undefined. Test: ${test}`, () => {
|
||||
const testFunction = () => {
|
||||
let _ = generateUrl('https://kroki.io', test, 'svg', 'digraph G {Hello->World}');
|
||||
}
|
||||
expect(testFunction).throw();
|
||||
});
|
||||
it(`* [exception] throws when imgType is, non-string object, empty string, null or undefined. Test: ${test}`, () => {
|
||||
const testFunction = () => {
|
||||
let _ = generateUrl('https://kroki.io', 'graphviz', test, 'digraph G {Hello->World}');
|
||||
}
|
||||
expect(testFunction).throw();
|
||||
});
|
||||
it(`* [exception] throws when diagram is, non-string object, empty string, null or undefined. Test: ${test}`, () => {
|
||||
const testFunction = () => {
|
||||
let _ = generateUrl('https://kroki.io', 'graphviz', 'svg', diagram);
|
||||
}
|
||||
expect(testFunction).throw();
|
||||
});
|
||||
});
|
||||
it('* [exception] throws when lang is unsupported lang', () => {
|
||||
const testFunction = () => {
|
||||
let _ = generateUrl('https://kroki.io', 'graphviz123', 'svg', 'digraph G {Hello->World}');
|
||||
}
|
||||
expect(testFunction).throw();
|
||||
});
|
||||
it('* [exception] throws when imgType is unsupported imgType', () => {
|
||||
const testFunction = () => {
|
||||
let _ = generateUrl('https://kroki.io', 'graphviz', 'svg123', 'digraph G {Hello->World}');
|
||||
}
|
||||
expect(testFunction).throw();
|
||||
});
|
||||
});
|
||||
});
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
const md = require('markdown-it');
|
||||
const expect = require('chai').expect;
|
||||
const { JSDOM } = require('jsdom');
|
||||
const { MarkdownItKrokiCore } = require('../../lib/plugin-core');
|
||||
const { encode } = require('../../lib/diagram-encoder');
|
||||
|
||||
describe('# [unit-test] plugin-core.js', () => {
|
||||
describe('## method: buuildEmbedHTML', () => {
|
||||
describe('### langAndAlt.language', () => {
|
||||
[null, undefined, ''].forEach((test) => {
|
||||
it(`* when langAndAlt.language is null or empty, throws error. testcase:${test}`, () => {
|
||||
const diagramCode = '@startuml\nBob -> Alice : hello\n @enduml';
|
||||
const plugin = new MarkdownItKrokiCore(new md()).setOptions();
|
||||
const testFunc = () => {
|
||||
plugin.use();
|
||||
const _ = plugin.buildEmbedHTML(
|
||||
{ language: test, alt: '' }, diagramCode);
|
||||
};
|
||||
expect(testFunc).to.throw();
|
||||
});
|
||||
});
|
||||
it('* language embeded in to url', () => {
|
||||
const test = 'plantuml';
|
||||
|
||||
const diagramCode = '@startuml\nBob -> Alice : hello\n @enduml';
|
||||
|
||||
// build embed HTML
|
||||
const plugin = new MarkdownItKrokiCore(new md()).setOptions();
|
||||
plugin.use();
|
||||
const html = plugin.buildEmbedHTML({ language: test, alt: '' }, diagramCode);
|
||||
|
||||
// parse dom
|
||||
const dom = new JSDOM(html);
|
||||
const imgTag = dom.window.document.getElementsByTagName("embed")[0];
|
||||
|
||||
// get url attribute
|
||||
const url = imgTag.getAttribute('src');
|
||||
|
||||
expect(/\/plantuml\//.test(url)).to.true;
|
||||
});
|
||||
});
|
||||
describe('### langAndAlt.alt', () => {
|
||||
[null, undefined, ''].forEach((test) => {
|
||||
it(`* when langAndAlt.alt is null or empty, no alt attribute. testcase:${test}`, () => {
|
||||
const diagramCode = '@startuml\nBob -> Alice : hello\n @enduml';
|
||||
|
||||
// prepair
|
||||
const plugin = new MarkdownItKrokiCore(new md()).setOptions();
|
||||
plugin.use();
|
||||
|
||||
// render
|
||||
const html = plugin.buildEmbedHTML(
|
||||
{ language: 'plantuml', alt: test }, diagramCode);
|
||||
// parse dom
|
||||
const dom = new JSDOM(html);
|
||||
const imgTag = dom.window.document.getElementsByTagName("embed")[0];
|
||||
|
||||
expect(imgTag.hasAttribute('alt')).to.false;
|
||||
});
|
||||
});
|
||||
it('* embeded altText', () => {
|
||||
const expected = "this is test Text";
|
||||
const diagramCode = '@startuml\nBob -> Alice : hello\n @enduml';
|
||||
|
||||
// prepair
|
||||
const plugin = new MarkdownItKrokiCore(new md()).setOptions();
|
||||
plugin.use();
|
||||
|
||||
// render
|
||||
const html = plugin.buildEmbedHTML(
|
||||
{ language: 'plantuml', alt: expected }, diagramCode);
|
||||
// parse dom
|
||||
const dom = new JSDOM(html);
|
||||
const imgTag = dom.window.document.getElementsByTagName("embed")[0];
|
||||
|
||||
expect(imgTag.getAttribute('title')).to.equal(expected);
|
||||
|
||||
});
|
||||
});
|
||||
describe('### diagramCode', () => {
|
||||
[null, undefined, ''].forEach((test) => {
|
||||
it(`* when diagramCode is null or empty, throws error. testcase:${test}`, () => {
|
||||
const plugin = new MarkdownItKrokiCore(new md()).setOptions();
|
||||
const testFunc = () => {
|
||||
plugin.use();
|
||||
const _ = plugin.buildEmbedHTML(
|
||||
{ language: 'plantuml', alt: '' }, test);
|
||||
};
|
||||
expect(testFunc).to.throw();
|
||||
});
|
||||
});
|
||||
it('* encoded diagram must be embed to url on <img src=\'....\' ', () => {
|
||||
const test = '@startuml\nBob -> Alice : hello\n @enduml';
|
||||
|
||||
const expected = encode(test);
|
||||
|
||||
// build embed HTML
|
||||
const plugin = new MarkdownItKrokiCore(new md()).setOptions();
|
||||
plugin.use();
|
||||
const html = plugin.buildEmbedHTML({ language: 'plantuml', alt: '' }, test);
|
||||
|
||||
// parse dom
|
||||
const dom = new JSDOM(html);
|
||||
const imgTag = dom.window.document.getElementsByTagName("embed")[0];
|
||||
|
||||
// get url attribute
|
||||
const url = imgTag.getAttribute('src');
|
||||
|
||||
expect(url.endsWith(expected)).to.true;
|
||||
});
|
||||
it('* <img> is surounded by <marp-auto-scaling> on to be used form marp-it', () => {
|
||||
const test = '@startuml\nBob -> Alice : hello\n @enduml';
|
||||
|
||||
const markdownIt = new md()
|
||||
markdownIt['marpit'] = { someObject: 'is implemented' };
|
||||
// build embed HTML
|
||||
const plugin = new MarkdownItKrokiCore(markdownIt).setOptions();
|
||||
plugin.use();
|
||||
const html = plugin.buildEmbedHTML({ language: 'plantuml', alt: '' }, test);
|
||||
|
||||
// parse dom
|
||||
const dom = new JSDOM(html);
|
||||
const imgTag = dom.window.document.getElementsByTagName("embed")[0];
|
||||
const marpAutoScaling = dom.window.document.getElementsByTagName("marp-auto-scaling")[0];
|
||||
|
||||
expect(imgTag.isSameNode(marpAutoScaling.firstChild)).to.be.true;
|
||||
});
|
||||
it('* <img> is surounded by <marp-auto-scaling> on not to be used form marp-it', () => {
|
||||
const test = '@startuml\nBob -> Alice : hello\n @enduml';
|
||||
|
||||
const markdownIt = new md()
|
||||
// build embed HTML
|
||||
const plugin = new MarkdownItKrokiCore(markdownIt).setOptions();
|
||||
plugin.use();
|
||||
const html = plugin.buildEmbedHTML({ language: 'plantuml', alt: '' }, test);
|
||||
|
||||
// parse dom
|
||||
const dom = new JSDOM(html);
|
||||
const marpAutoScaling = dom.window.document.getElementsByTagName("marp-auto-scaling");
|
||||
|
||||
expect(marpAutoScaling.length).to.equal(0);
|
||||
})
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
+272
@@ -0,0 +1,272 @@
|
||||
const md = require('markdown-it');
|
||||
const expect = require('chai').expect;
|
||||
const sinon = require('sinon');
|
||||
const { JSDOM } = require('jsdom');
|
||||
const { MarkdownItKrokiCore } = require('../../lib/plugin-core');
|
||||
|
||||
describe('# [unit-test] plugin-core.js', () => {
|
||||
describe('## method: setOptions() must be work', () => {
|
||||
function buildHtmlForTest(options) {
|
||||
const test = 'plantuml';
|
||||
const alt = 'test alt text';
|
||||
|
||||
const diagramCode = '@startuml\nBob -> Alice : hello\n @enduml';
|
||||
|
||||
// build embed HTML
|
||||
const plugin = new MarkdownItKrokiCore(new md()).setOptions(options);
|
||||
plugin.use();
|
||||
return plugin.buildEmbedHTML({ language: test, alt: alt }, diagramCode);
|
||||
}
|
||||
describe('### entrypoint', () => {
|
||||
function expectEntryPointToEmbed(htmlString, expected) {
|
||||
if (!expected) expected = 'https://kroki.io';
|
||||
// parse dom
|
||||
const dom = new JSDOM(htmlString);
|
||||
const imgTag = dom.window.document.getElementsByTagName("embed")[0];
|
||||
|
||||
// get url attribute
|
||||
const url = imgTag.getAttribute('src');
|
||||
|
||||
expect(url.startsWith(expected)).to.true;
|
||||
}
|
||||
it('* no options', () => {
|
||||
const html = buildHtmlForTest();
|
||||
expectEntryPointToEmbed(html);
|
||||
});
|
||||
it('* option is null', () => {
|
||||
const html = buildHtmlForTest({ entrypoint: null });
|
||||
expectEntryPointToEmbed(html);
|
||||
});
|
||||
it('* option is undefined', () => {
|
||||
const html = buildHtmlForTest({ entrypoint: undefined });
|
||||
expectEntryPointToEmbed(html);
|
||||
});
|
||||
it('* option is \'\'', () => {
|
||||
const html = buildHtmlForTest({ entrypoint: '' });
|
||||
expectEntryPointToEmbed(html);
|
||||
});
|
||||
it('* option is 1', () => {
|
||||
const html = buildHtmlForTest({ entrypoint: 1 });
|
||||
expectEntryPointToEmbed(html);
|
||||
});
|
||||
it('* option is true', () => {
|
||||
const html = buildHtmlForTest({ entrypoint: true });
|
||||
expectEntryPointToEmbed(html);
|
||||
});
|
||||
it('* option is \'https://localhost:8080\'', () => {
|
||||
const html = buildHtmlForTest({
|
||||
entrypoint: 'https://localhost:8080'
|
||||
});
|
||||
expectEntryPointToEmbed(html, 'https://localhost:8080');
|
||||
});
|
||||
});
|
||||
describe.skip('### marpAutoScaling', () => {
|
||||
function expectMarpAutoScalingToEmbed(htmlString, expected) {
|
||||
// parse dom
|
||||
const dom = new JSDOM(htmlString);
|
||||
const tags = dom.window.document.getElementsByTagName("marp-auto-scaling");
|
||||
if (expected) {
|
||||
expect(tags).not.to.empty;
|
||||
} else {
|
||||
expect(tags).to.empty;
|
||||
}
|
||||
|
||||
}
|
||||
it('* no options', () => {
|
||||
const html = buildHtmlForTest();
|
||||
expectMarpAutoScalingToEmbed(html, true);
|
||||
});
|
||||
it('* option is null', () => {
|
||||
const html = buildHtmlForTest({ marpAutoScaling: null });
|
||||
expectMarpAutoScalingToEmbed(html, true);
|
||||
});
|
||||
it('* option is undefined', () => {
|
||||
const html = buildHtmlForTest({ marpAutoScaling: undefined });
|
||||
expectMarpAutoScalingToEmbed(html, true);
|
||||
});
|
||||
it('* option is \'\'', () => {
|
||||
const html = buildHtmlForTest({ marpAutoScaling: '' });
|
||||
expectMarpAutoScalingToEmbed(html, true);
|
||||
});
|
||||
it('* option is 1', () => {
|
||||
const html = buildHtmlForTest({ marpAutoScaling: 1 });
|
||||
expectMarpAutoScalingToEmbed(html, true);
|
||||
});
|
||||
it('* option is \'test\'', () => {
|
||||
const html = buildHtmlForTest({ marpAutoScaling: 'test' });
|
||||
expectMarpAutoScalingToEmbed(html, true);
|
||||
});
|
||||
it('* option is false', () => {
|
||||
const html = buildHtmlForTest({ marpAutoScaling: false });
|
||||
expectMarpAutoScalingToEmbed(html, false);
|
||||
});
|
||||
})
|
||||
describe('### containerClass', () => {
|
||||
function expectContainerClassToEmbed(htmlString, className) {
|
||||
// parse dom
|
||||
const dom = new JSDOM(htmlString);
|
||||
const pTag = dom.window.document.getElementsByTagName("p")[0];
|
||||
|
||||
const actualClassName = pTag.getAttribute('class');
|
||||
expect(actualClassName).to.equal(className);
|
||||
}
|
||||
it('* no options', () => {
|
||||
const html = buildHtmlForTest();
|
||||
expectContainerClassToEmbed(html, 'kroki-image-container');
|
||||
});
|
||||
it('* option is null', () => {
|
||||
const html = buildHtmlForTest({ containerClass: null });
|
||||
expectContainerClassToEmbed(html, 'kroki-image-container');
|
||||
});
|
||||
it('* option is undefined', () => {
|
||||
const html = buildHtmlForTest({ containerClass: undefined });
|
||||
expectContainerClassToEmbed(html, 'kroki-image-container');
|
||||
});
|
||||
it('* option is \'\'', () => {
|
||||
const html = buildHtmlForTest({ containerClass: '' });
|
||||
expectContainerClassToEmbed(html, 'kroki-image-container');
|
||||
});
|
||||
it('* option is 1', () => {
|
||||
const html = buildHtmlForTest({ containerClass: 1 });
|
||||
expectContainerClassToEmbed(html, 'kroki-image-container');
|
||||
});
|
||||
it('* option is \'containerClass\'', () => {
|
||||
const html = buildHtmlForTest({ containerClass: 'containerClass' });
|
||||
expectContainerClassToEmbed(html, 'containerClass');
|
||||
});
|
||||
});
|
||||
describe('### imageFormat', () => {
|
||||
function expectImageFormatToEmbed(htmlString, expected) {
|
||||
// parse dom
|
||||
const dom = new JSDOM(htmlString);
|
||||
const imgTag = dom.window.document.getElementsByTagName("embed")[0];
|
||||
|
||||
// get url attribute
|
||||
const url = imgTag.getAttribute('src');
|
||||
|
||||
expect(url).to.includes('/' + expected + '/');
|
||||
}
|
||||
it('* no options', () => {
|
||||
const html = buildHtmlForTest();
|
||||
expectImageFormatToEmbed(html, 'svg');
|
||||
});
|
||||
it('* option is null', () => {
|
||||
const html = buildHtmlForTest({ imageFormat: null });
|
||||
expectImageFormatToEmbed(html, 'svg');
|
||||
});
|
||||
it('* option is undefined', () => {
|
||||
const html = buildHtmlForTest({ imageFormat: undefined });
|
||||
expectImageFormatToEmbed(html, 'svg');
|
||||
});
|
||||
it('* option is \'\'', () => {
|
||||
const html = buildHtmlForTest({ imageFormat: '' });
|
||||
expectImageFormatToEmbed(html, 'svg');
|
||||
});
|
||||
it('* option is 1', () => {
|
||||
const html = buildHtmlForTest({ imageFormat: 1 });
|
||||
expectImageFormatToEmbed(html, 'svg');
|
||||
|
||||
});
|
||||
it('* option is \'test\'', () => {
|
||||
const html = buildHtmlForTest({ imageFormat: 'test' });
|
||||
expectImageFormatToEmbed(html, 'svg');
|
||||
});
|
||||
it('* option is \'png\'', () => {
|
||||
const html = buildHtmlForTest({ imageFormat: 'png' });
|
||||
expectImageFormatToEmbed(html, 'png');
|
||||
});
|
||||
});
|
||||
describe('### useImg', () => {
|
||||
function expectUseImgTag(html, expectToUseImg) {
|
||||
// parse dom
|
||||
const dom = new JSDOM(html);
|
||||
const imgTag = dom.window.document.getElementsByTagName("img")[0];
|
||||
if(!expectToUseImg) {
|
||||
expect(imgTag).to.be.undefined;
|
||||
return;
|
||||
} else {
|
||||
expect(imgTag).not.to.be.undefined;
|
||||
}
|
||||
}
|
||||
|
||||
it('* no options', () => {
|
||||
const html = buildHtmlForTest();
|
||||
expectUseImgTag(html, false);
|
||||
});
|
||||
it('* option is true', () => {
|
||||
const html = buildHtmlForTest({ useImg: true });
|
||||
expectUseImgTag(html, true);
|
||||
});
|
||||
it('* option is null', () => {
|
||||
const html = buildHtmlForTest({ useImg: null });
|
||||
expectUseImgTag(html, false);
|
||||
});
|
||||
it('* option is undefined', () => {
|
||||
const html = buildHtmlForTest({ useImg: undefined });
|
||||
expectUseImgTag(html, false);
|
||||
});
|
||||
it('* option is \'\'', () => {
|
||||
const html = buildHtmlForTest({ useImg: '' });
|
||||
expectUseImgTag(html, false);
|
||||
});
|
||||
it('* option is 1', () => {
|
||||
const html = buildHtmlForTest({ useImg: 1 });
|
||||
expectUseImgTag(html, false);
|
||||
});
|
||||
});
|
||||
describe('### render', () => {
|
||||
|
||||
it('* render was called', ()=>{
|
||||
const renderCallback = sinon.fake();
|
||||
buildHtmlForTest({ render: renderCallback });
|
||||
expect(renderCallback.calledOnce).to.be.true;
|
||||
});
|
||||
it('* render was called with correct arg', ()=>{
|
||||
const renderCallback = sinon.fake();
|
||||
buildHtmlForTest({ render: renderCallback });
|
||||
expect(renderCallback.firstCall.args[0]).to.be.an('string');
|
||||
expect(renderCallback.firstCall.args[0]).to.includes('https://kroki.io');
|
||||
expect(renderCallback.firstCall.args[1]).to.be.an('string');
|
||||
expect(renderCallback.firstCall.args[1]).to.includes('test alt text');
|
||||
|
||||
});
|
||||
it('* render the return value', ()=>{
|
||||
const testReturnValue = '%%%%%test return value%%%%%';
|
||||
const renderCallback = sinon.fake.returns(testReturnValue);
|
||||
const html = buildHtmlForTest({ render: renderCallback });
|
||||
expect(html).to.includes(testReturnValue);
|
||||
})
|
||||
it('* no options', () => {
|
||||
expect(()=>{
|
||||
buildHtmlForTest();
|
||||
}).not.to.throw();
|
||||
});
|
||||
it('* option is true', () => {
|
||||
expect(()=>{
|
||||
buildHtmlForTest({ render: true });
|
||||
}).not.to.throw();
|
||||
});
|
||||
it('* option is null', () => {
|
||||
expect(()=>{
|
||||
buildHtmlForTest({ render: false });
|
||||
}).not.to.throw();
|
||||
});
|
||||
it('* option is undefined', () => {
|
||||
expect(()=>{
|
||||
buildHtmlForTest({ render: false });
|
||||
}).not.to.throw();
|
||||
});
|
||||
it('* option is \'\'', () => {
|
||||
expect(()=>{
|
||||
buildHtmlForTest({ useImg: '' });
|
||||
}).not.to.throw();
|
||||
});
|
||||
it('* option is 1', () => {
|
||||
expect(()=>{
|
||||
buildHtmlForTest({ useImg: 1 });
|
||||
}).not.to.throw();
|
||||
});
|
||||
|
||||
})
|
||||
});
|
||||
});
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
const expect = require('chai').expect;
|
||||
const { MarkdownItKrokiCore } = require('../../lib/plugin-core');
|
||||
|
||||
describe('# [unit-test] plugin-core.js', () => {
|
||||
describe('## static method: readLanguageAndAltText() - language', () => {
|
||||
[
|
||||
{ test: null, expected: '' },
|
||||
{ test: undefined, expected: '' },
|
||||
{ test: '', expected: '' },
|
||||
{ test: ' ', expected: '' },
|
||||
{ test: 'plantuml', expected: 'plantuml' },
|
||||
{ test: ' plantuml', expected: 'plantuml' },
|
||||
{ test: 'plantuml ', expected: 'plantuml' },
|
||||
{ test: 'plantuml +++', expected: 'plantuml' },
|
||||
{ test: 'html+md', expected: 'html+md' },
|
||||
{ test: 'graphviz[]', expected: 'graphviz' },
|
||||
{ test: 'graphviz[test]', expected: 'graphviz' },
|
||||
{ test: 'graphviz [test test]', expected: 'graphviz' },
|
||||
].forEach(testCase => {
|
||||
it(`### Can read diagramLanguage. in case \'${testCase.test}\'`, () => {
|
||||
const actual = MarkdownItKrokiCore.readLanguageAndAltText(testCase.test);
|
||||
const expected = testCase.expected;
|
||||
expect(actual.language).to.be.equal(expected);
|
||||
})
|
||||
});
|
||||
});
|
||||
describe('## static method: readLanguageAndAltText() - alt', () => {
|
||||
[
|
||||
{ test: null, expected: '' },
|
||||
{ test: undefined, expected: '' },
|
||||
{ test: '', expected: '' },
|
||||
{ test: ' ', expected: '' },
|
||||
{ test: 'plantuml', expected: '' },
|
||||
{ test: ' plantuml', expected: '' },
|
||||
{ test: 'plantuml ', expected: '' },
|
||||
{ test: 'plantuml +++', expected: '' },
|
||||
{ test: 'html+md', expected: '' },
|
||||
{ test: 'graphviz[]', expected: '' },
|
||||
{ test: 'graphviz[test]', expected: 'test' },
|
||||
{ test: 'graphviz [test test]', expected: 'test test' },
|
||||
].forEach(testCase => {
|
||||
it(`### Can read diagramLanguage. in case \'${testCase.test}\'`, () => {
|
||||
const actual = MarkdownItKrokiCore.readLanguageAndAltText(testCase.test);
|
||||
const expected = testCase.expected;
|
||||
expect(actual.alt).to.be.equal(expected);
|
||||
})
|
||||
});
|
||||
});
|
||||
});
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
const { expect } = require('chai');
|
||||
const { safeProperty } = require('../../lib/safe-property');
|
||||
|
||||
describe('# [unit-test]: safe-property.js', () => {
|
||||
[
|
||||
{
|
||||
testCaseDescription: "standard test - string",
|
||||
testCase: {
|
||||
test: {
|
||||
property1: "hello"
|
||||
},
|
||||
name: "property1",
|
||||
type: "string",
|
||||
defaultValue: undefined
|
||||
},
|
||||
expected: "hello"
|
||||
},
|
||||
{
|
||||
testCaseDescription: "standard test - boolean",
|
||||
testCase: {
|
||||
test: {
|
||||
property1: true
|
||||
},
|
||||
name: "property1",
|
||||
type: "boolean",
|
||||
defaultValue: undefined
|
||||
},
|
||||
expected: true
|
||||
},
|
||||
{
|
||||
testCaseDescription: "standard test - boolean on null",
|
||||
testCase: {
|
||||
test: {
|
||||
property1: null
|
||||
},
|
||||
name: "property1",
|
||||
type: "boolean",
|
||||
defaultValue: false
|
||||
},
|
||||
expected: false
|
||||
},
|
||||
{
|
||||
testCaseDescription: "on null",
|
||||
testCase: {
|
||||
test: {
|
||||
property1: null
|
||||
},
|
||||
name: "property1",
|
||||
type: "string",
|
||||
defaultValue: "hello"
|
||||
},
|
||||
expected: "hello"
|
||||
},
|
||||
{
|
||||
testCaseDescription: "on empty string",
|
||||
testCase: {
|
||||
test: {
|
||||
property1: ''
|
||||
},
|
||||
name: "property1",
|
||||
type: "string",
|
||||
defaultValue: "hello"
|
||||
},
|
||||
expected: "hello"
|
||||
},
|
||||
{
|
||||
testCaseDescription: "on undefined",
|
||||
testCase: {
|
||||
test: {
|
||||
property1: undefined
|
||||
},
|
||||
name: "property1",
|
||||
type: "string",
|
||||
defaultValue: "hello"
|
||||
},
|
||||
expected: "hello"
|
||||
},
|
||||
{
|
||||
testCaseDescription: "on not mutch type",
|
||||
testCase: {
|
||||
test: {
|
||||
property1: 1
|
||||
},
|
||||
name: "property1",
|
||||
type: "string",
|
||||
defaultValue: "hello"
|
||||
},
|
||||
expected: "hello"
|
||||
},
|
||||
{
|
||||
testCaseDescription: "on object is null",
|
||||
testCase: {
|
||||
test: null,
|
||||
name: "property1",
|
||||
type: "string",
|
||||
defaultValue: "hello"
|
||||
},
|
||||
expected: "hello"
|
||||
},
|
||||
{
|
||||
testCaseDescription: "on object is undefined",
|
||||
testCase: {
|
||||
test: undefined,
|
||||
name: "property1",
|
||||
type: "string",
|
||||
defaultValue: "hello"
|
||||
},
|
||||
expected: "hello"
|
||||
},
|
||||
].forEach((testItem) => {
|
||||
it(`* ${testItem.testCaseDescription}`, () => {
|
||||
const actual = safeProperty(
|
||||
testItem.testCase.test,
|
||||
testItem.testCase.name,
|
||||
testItem.testCase.type,
|
||||
testItem.testCase.defaultValue);
|
||||
expect(actual).to.equal(testItem.expected);
|
||||
});
|
||||
})
|
||||
})
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
/*! markdown-it-container 4.0.0 https://github.com/markdown-it/markdown-it-container @license MIT */
|
||||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).markdownitContainer=n()}(this,(function(){"use strict";return function(e,n,r){const t=(r=r||{}).marker||":",o=t.charCodeAt(0),i=t.length,c=r.validate||function(e){return e.trim().split(" ",2)[0]===n},s=r.render||function(e,r,t,o,i){return 1===e[r].nesting&&e[r].attrJoin("class",n),i.renderToken(e,r,t,o,i)};e.block.ruler.before("fence","container_"+n,(function(e,r,s,a){let l,f=!1,u=e.bMarks[r]+e.tShift[r],d=e.eMarks[r];if(o!==e.src.charCodeAt(u))return!1;for(l=u+1;l<=d&&t[(l-u)%i]===e.src[l];l++);const p=Math.floor((l-u)/i);if(p<3)return!1;l-=(l-u)%i;const k=e.src.slice(u,l),b=e.src.slice(l,d);if(!c(b,k))return!1;if(a)return!0;let h=r;for(;(h++,!(h>=s))&&(u=e.bMarks[h]+e.tShift[h],d=e.eMarks[h],!(u<d&&e.sCount[h]<e.blkIndent));)if(o===e.src.charCodeAt(u)&&!(e.sCount[h]-e.blkIndent>=4)){for(l=u+1;l<=d&&t[(l-u)%i]===e.src[l];l++);if(!(Math.floor((l-u)/i)<p||(l-=(l-u)%i,l=e.skipSpaces(l),l<d))){f=!0;break}}const m=e.parentType,M=e.lineMax;e.parentType="container",e.lineMax=h;const _=e.push("container_"+n+"_open","div",1);_.markup=k,_.block=!0,_.info=b,_.map=[r,h],e.md.block.tokenize(e,r+1,h);const y=e.push("container_"+n+"_close","div",-1);return y.markup=e.src.slice(u,l),y.block=!0,e.parentType=m,e.lineMax=M,e.line=h+(f?1:0),!0}),{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules["container_"+n+"_open"]=s,e.renderer.rules["container_"+n+"_close"]=s}}));
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
/*! markdown-it-mark 4.0.0 https://github.com/markdown-it/markdown-it-mark @license MIT */
|
||||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).markdownitMark=n()}(this,(function(){"use strict";return function(e){function n(e,n){const t=[],o=n.length;for(let s=0;s<o;s++){const o=n[s];if(61!==o.marker)continue;if(-1===o.end)continue;const r=n[o.end],i=e.tokens[o.token];i.type="mark_open",i.tag="mark",i.nesting=1,i.markup="==",i.content="";const c=e.tokens[r.token];c.type="mark_close",c.tag="mark",c.nesting=-1,c.markup="==",c.content="","text"===e.tokens[r.token-1].type&&"="===e.tokens[r.token-1].content&&t.push(r.token-1)}for(;t.length;){const n=t.pop();let o=n+1;for(;o<e.tokens.length&&"mark_close"===e.tokens[o].type;)o++;if(o--,n!==o){const t=e.tokens[o];e.tokens[o]=e.tokens[n],e.tokens[n]=t}}}e.inline.ruler.before("emphasis","mark",(function(e,n){const t=e.pos,o=e.src.charCodeAt(t);if(n)return!1;if(61!==o)return!1;const s=e.scanDelims(e.pos,!0);let r=s.length;const i=String.fromCharCode(o);if(r<2)return!1;if(r%2){e.push("text","",0).content=i,r--}for(let n=0;n<r;n+=2){e.push("text","",0).content=i+i,(s.can_open||s.can_close)&&e.delimiters.push({marker:o,length:0,jump:n/2,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close})}return e.pos+=s.length,!0})),e.inline.ruler2.before("emphasis","mark",(function(e){let t;const o=e.tokens_meta,s=(e.tokens_meta||[]).length;for(n(e,e.delimiters),t=0;t<s;t++)o[t]&&o[t].delimiters&&n(e,o[t].delimiters)}))}}));
|
||||
@@ -0,0 +1,44 @@
|
||||
"use strict";var e=require("process"),t=require("os"),n=require("tty"),r=require("yargs/yargs"),i=require("yargs"),o=require("fs"),s=require("path"),a=require("cosmiconfig"),u=require("util"),c=require("child_process"),l=require("url"),p=require("import-from"),A=require("stream"),f=require("events"),D=require("tmp"),d=require("@marp-team/marpit"),g=require("puppeteer-core"),h=require("net"),m=require("is-wsl"),v=require("crypto"),b=require("chokidar"),y=require("ws"),w=require("querystring"),C=require("serve-index"),E=require("@marp-team/marp-core/package.json");function F(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var k=F(l);const _=(e=0)=>t=>`[${t+e}m`,B=(e=0)=>t=>`[${38+e};5;${t}m`,P=(e=0)=>(t,n,r)=>`[${38+e};2;${t};${n};${r}m`,x={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(x.modifier),Object.keys(x.color),Object.keys(x.bgColor);const S=function(){const e=new Map;for(const[t,n]of Object.entries(x)){for(const[t,r]of Object.entries(n))x[t]={open:`[${r[0]}m`,close:`[${r[1]}m`},n[t]=x[t],e.set(r[0],r[1]);Object.defineProperty(x,t,{value:n,enumerable:!1})}return Object.defineProperty(x,"codes",{value:e,enumerable:!1}),x.color.close="[39m",x.bgColor.close="[49m",x.color.ansi=_(),x.color.ansi256=B(),x.color.ansi16m=P(),x.bgColor.ansi=_(10),x.bgColor.ansi256=B(10),x.bgColor.ansi16m=P(10),Object.defineProperties(x,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;3===n.length&&(n=[...n].map((e=>e+e)).join(""));const r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},enumerable:!1},hexToAnsi256:{value:e=>x.rgbToAnsi256(...x.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,n,r;if(e>=232)t=(10*(e-232)+8)/255,n=t,r=t;else{const i=(e-=16)%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}const i=2*Math.max(t,n,r);if(0===i)return 30;let o=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return 2===i&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>x.ansi256ToAnsi(x.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>x.ansi256ToAnsi(x.hexToAnsi256(e)),enumerable:!1}}),x}();function O(t,n=(globalThis.Deno?globalThis.Deno.args:e.argv)){const r=t.startsWith("-")?"":1===t.length?"-":"--",i=n.indexOf(r+t),o=n.indexOf("--");return-1!==i&&(-1===o||i<o)}const{env:T}=e;let M;function I(n,r={}){return 0!==(i=function(n,{streamIsTTY:r,sniffFlags:i=!0}={}){const o=function(){if("FORCE_COLOR"in T)return"true"===T.FORCE_COLOR?1:"false"===T.FORCE_COLOR?0:0===T.FORCE_COLOR.length?1:Math.min(Number.parseInt(T.FORCE_COLOR,10),3)}();void 0!==o&&(M=o);const s=i?M:o;if(0===s)return 0;if(i){if(O("color=16m")||O("color=full")||O("color=truecolor"))return 3;if(O("color=256"))return 2}if("TF_BUILD"in T&&"AGENT_NAME"in T)return 1;if(n&&!r&&void 0===s)return 0;const a=s||0;if("dumb"===T.TERM)return a;if("win32"===e.platform){const e=t.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in T)return"GITHUB_ACTIONS"in T?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((e=>e in T))||"codeship"===T.CI_NAME?1:a;if("TEAMCITY_VERSION"in T)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(T.TEAMCITY_VERSION)?1:0;if("truecolor"===T.COLORTERM)return 3;if("xterm-kitty"===T.TERM)return 3;if("TERM_PROGRAM"in T){const e=Number.parseInt((T.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(T.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(T.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(T.TERM)||"COLORTERM"in T?1:a}(n,{streamIsTTY:n&&n.isTTY,...r}))&&{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3};var i}O("no-color")||O("no-colors")||O("color=false")||O("color=never")?M=0:(O("color")||O("colors")||O("color=true")||O("color=always"))&&(M=1);const R={stdout:I({isTTY:n.Line truncated
|
||||
/*!
|
||||
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
||||
*
|
||||
* Copyright (c) 2014-2016, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/!function(e){e.isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),e.find=(e,t)=>e.nodes.find((e=>e.type===t)),e.exceedsLimit=(t,n,r=1,i)=>!1!==i&&!(!e.isInteger(t)||!e.isInteger(n))&&(Number(n)-Number(t))/Number(r)>=i,e.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},e.encloseBrace=e=>"brace"===e.type&&e.commas>>0+e.ranges>>0==0&&(e.invalid=!0,!0),e.isInvalidBrace=e=>!("brace"!==e.type||!0!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges>>0!=0&&!0===e.open&&!0===e.close||(e.invalid=!0,0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||!0===e.open||!0===e.close,e.reduce=e=>e.reduce(((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e)),[]),e.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r<e.length;r++){let i=e[r];Array.isArray(i)?n(i):void 0!==i&&t.push(i)}return t};return n(e),t}}(Rt);const Lt=Rt;var Nt=(e,t={})=>{let n=(e,r={})=>{let i=t.escapeInvalid&&Lt.isInvalidBrace(r),o=!0===e.invalid&&!0===t.escapeInvalid,s="";if(e.value)return(i||o)&&Lt.isOpenOrClose(e)?"\\"+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)s+=n(t);return s};return n(e)};
|
||||
/*!
|
||||
* is-number <https://github.com/jonschlinkert/is-number>
|
||||
*
|
||||
* Copyright (c) 2014-present, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
/*!
|
||||
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
||||
*
|
||||
* Copyright (c) 2015-present, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
const Ht=function(e){return"number"==typeof e?e-e==0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))},jt=(e,t,n)=>{if(!1===Ht(e))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===t||e===t)return String(e);if(!1===Ht(t))throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...n};"boolean"==typeof r.strictZeros&&(r.relaxZeros=!1===r.strictZeros);let i=e+":"+t+"="+String(r.relaxZeros)+String(r.shorthand)+String(r.capture)+String(r.wrap);if(jt.cache.hasOwnProperty(i))return jt.cache[i].result;let o=Math.min(e,t),s=Math.max(e,t);if(1===Math.abs(o-s)){let n=e+"|"+t;return r.capture?`(${n})`:!1===r.wrap?n:`(?:${n})`}let a=Jt(e)||Jt(t),u={min:e,max:t,a:o,b:s},c=[],l=[];return a&&(u.isPadded=a,u.maxLen=String(u.max).length),o<0&&(l=zt(s<0?Math.abs(s):1,Math.abs(o),u,r),o=u.a=0),s>=0&&(c=zt(o,s,u,r)),u.negatives=l,u.positives=c,u.result=function(e,t,n){let r=Ut(e,t,"-",!1)||[],i=Ut(t,e,"",!1)||[],o=Ut(e,t,"-?",!0)||[];return r.concat(o).concat(i).join("|")}(l,c),!0===r.capture?u.result=`(${u.result})`:!1!==r.wrap&&c.length+l.length>1&&(u.result=`(?:${u.result})`),jt.cache[i]=u,u.result};function Qt(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=function(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}(e,t),i=r.length,o="",s=0;for(let e=0;e<i;e++){let[t,n]=r[e];t===n?o+=t:"0"!==t||"9"!==n?o+=`[${a=t}${(u=n)-a==1?"":"-"}${u}]`:s++}var a,u;return s&&(o+=!0===n.shorthand?"\\d":"[0-9]"),{pattern:o,count:[s],digits:i}}function zt(e,t,n,r){let i,o=function(e,t){let n=1,r=1,i=Xt(e,n),o=new Set([t]);for(;e<=i&&i<=t;)o.add(i),n+=1,i=Xt(e,n);for(i=qt(t+1,r)-1;e<i&&i<=t;)o.add(i),r+=1,i=qt(t+1,r)-1;return o=[...o],o.sort(Gt),o}(e,t),s=[],a=e;for(let e=0;e<o.length;e++){let t=o[e],u=Qt(String(a),String(t),r),c="";n.isPadded||!i||i.pattern!==u.pattern?(n.isPadded&&(c=Wt(t,n,r)),u.string=c+u.pattern+Zt(u.count),s.push(u),a=t+1,i=u):(i.count.length>1&&i.count.pop(),i.count.push(u.count[0]),i.string=i.pattern+Zt(i.count),a=t+1)}return s}function Ut(e,t,n,r,i){let o=[];for(let i of e){let{string:e}=i;r||Yt(t,"string",e)||o.push(n+e),r&&Yt(t,"string",e)&&o.push(n+e)}return o}function Gt(e,t){return e>t?1:t>e?-1:0}function Yt(e,t,n){return e.some((e=>e[t]===n))}function Xt(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function qt(e,t){return e-e%Math.pow(10,t)}function Zt(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function Jt(e){return/^-?(0+)\d/.test(e)}function Wt(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=!1!==n.relaxZeros;switch(r){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${r}}`:`0{${r}}`}}jt.cache={},jt.clearCache=()=>jt.cache={};
|
||||
/*!
|
||||
* fill-range <https://github.com/jonschlinkert/fill-range>
|
||||
*
|
||||
* Copyright (c) 2014-present, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
const Vt=u,Kt=jt,$t=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),en=e=>"number"==typeof e||"string"==typeof e&&""!==e,tn=e=>Number.isInteger(+e),nn=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},rn=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},on=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},sn=(e,t,n,r)=>{if(n)return Kt(e,t,{wrap:!1,...r});let i=String.fromCharCode(e);return e===t?i:`[${i}-${String.fromCharCode(t)}]`},an=(e,t,n)=>{if(Array.isArray(e)){let t=!0===n.wrap,r=n.capture?"":"?:";return t?`(${r}${e.join("|")})`:e.join("|")}return Kt(e,t,n)},un=(...e)=>new RangeError("Invalid range arguments: "+Vt.inspect(...e)),cn=(e,t,n)=>{if(!0===n.strictRanges)throw un([e,t]);return[]},ln=(e,t,n,r={})=>{if(null==t&&en(e))return[e];if(!en(e)||!en(t))return cn(e,t,r);if("function"==typeof n)return ln(e,t,1,{transform:n});if($t(n))return ln(e,t,0,n);let i={...r};return!0===i.capture&&(i.wrap=!0),n=n||i.step||1,tn(n)?tn(e)&&tn(t)?((e,t,n=1,r={})=>{let i=Number(e),o=Number(t);if(!Number.isInteger(i)||!Number.isInteger(o)){if(!0===r.strictRanges)throw un([e,t]);return[]}0===i&&(i=0),0===o&&(o=0);let s=i>o,a=String(e),u=String(t),c=String(n);n=Math.max(Math.abs(n),1);let l=nn(a)||nn(u)||nn(c),p=l?Math.max(a.length,u.length,c.length):0,A=!1===l&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),f=r.transform||(e=>t=>!0===e?Number(t):String(t))(A);if(r.toRegex&&1===n)return sn(on(e,p),on(t,p),!0,r);let D={negatives:[],positives:[]},d=[],g=0;for(;s?i>=o:i<=o;)!0===r.toRegex&&n>1?D[(h=i)<0?"negatives":"positives"].push(Math.abs(h)):d.push(rn(f(i,g),p,A)),i=s?i-n:i+n,g++;var h;return!0===r.toRegex?n>1?((e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let n,r=t.capture?"":"?:",i="",o="";return e.positives.length&&(i=e.positives.join("|")),e.negatives.length&&(o=`-(${r}${e.negatives.join("|")})`),n=i&&o?`${i}|${o}`:i||o,t.wrap?`(${r}${n})`:n})(D,r):an(d,null,{wrap:!1,...r}):d})(e,t,n,i):((e,t,n=1,r={})=>{if(!tn(e)&&e.length>1||!tn(t)&&t.length>1)return cn(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),o=`${e}`.charCodeAt(0),s=`${t}`.charCodeAt(0),a=o>s,u=Math.min(o,s),c=Math.max(o,s);if(r.toRegex&&1===n)return sn(u,c,!1,r);let l=[],p=0;for(;a?o>=s:o<=s;)l.push(i(o,p)),o=a?o-n:o+n,p++;return!0===r.toRegex?an(l,null,{wrap:!1,options:r}):l})(e,t,Math.max(Math.abs(n),1),i):null==n||$t(n)?ln(e,t,1,n):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(n,i)},pn=ln,An=Rt;const fn=ln,Dn=Nt,dn=Rt,gn=(e="",t="",n=!1)=>{let r=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return n?dn.flatten(t).map((e=>`{${e}}`)):t;for(let i of e)if(Array.isArray(i))for(let e of i)r.push(gn(e,t,n));else for(let e of t)!0===n&&"string"==typeof e&&(e=`{${e}}`),r.push(Array.isArray(e)?gn(i,e,n):i+e);return dn.flatten(r)};const hn=Nt,{MAX_LENGTH:mn,CHAR_BACKSLASH:vn,CHAR_BACKTICK:bn,CHAR_COMMA:yn,CHAR_DOT:wn,CHAR_LEFT_PARENTHESES:Cn,CHAR_RIGHT_PARENTHESES:En,CHAR_LEFT_CURLY_BRACE:Fn,CHAR_RIGHT_CURLY_BRACE:kn,CHAR_LEFT_SQUARE_BRACKET:_n,CHAR_RIGHT_SQUARE_BRACKET:Bn,CHAR_DOUBLE_QUOTE:Pn,CHAR_SINGLE_QUOTE:xn,CHAR_NO_BREAK_SPACE:Sn,CHAR_ZERO_WIDTH_NOBREAK_SPACE:On}={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"};const Tn=Nt,Mn=(e,t={})=>{let n=(e,r={})=>{let i=An.isInvalidBrace(r),o=!0===e.invalid&&!0===t.escapeInvalid,s=!0===i||!0===o,a=!0===t.escapeInvalid?"\\":"",u="";if(!0===e.isOpen)return a+e.value;if(!0===e.isClose)return a+e.value;if("open"===e.type)return s?a+e.value:"(";if("close"===e.type)return s?a+e.value:")";if("comma"===e.type)return"comma"===e.prev.type?"":s?e.value:"|";if(e.value)return e.value;if(e.nodes&&e.ranges>0){let n=An.reduce(e.nodes),r=pn(...n,{...t,wrap:!1,toRegex:!0});if(0!==r.length)return n.length>1&&r.length>1?`(${r})`:r}if(e.nodes)for(let t of e.nodes)u+=n(t,e);return u};return n(e)},In=(e,t={})=>{let n=void 0===t.rangeLimit?1e3:t.Line truncated
|
||||
/**
|
||||
* @license Copyright 2016 The Lighthouse Authors. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
const nc=Uu,rc=ne(Object.freeze({__proto__:null,get clear(){return Vu},get getEntries(){return Wu},get mark(){return Zu},get stop(){return Ju}})),ic=f.EventEmitter,oc="win32"===process.platform,sc=process.browser,ac={red:sc?"crimson":1,yellow:sc?"gold":3,cyan:sc?"darkturquoise":6,green:sc?"forestgreen":2,blue:sc?"steelblue":4,magenta:sc?"palevioletred":5};nc.colors=[ac.cyan,ac.green,ac.blue,ac.magenta];const uc={};let cc;class lc{static _logToStdErr(e,t){lc.loggerfn(e)(...t)}static loggerfn(e){let t=uc[e=`LH:${e}`];return t||(t=nc(e),uc[e]=t,e.endsWith("error")?t.color=ac.red:e.endsWith("warn")&&(t.color=ac.yellow)),t}static setLevel(e){switch(cc=e,e){case"silent":nc.enable("-LH:*");break;case"verbose":nc.enable("LH:*");break;case"error":nc.enable("-LH:*, LH:*:error");break;default:nc.enable("LH:*, -LH:*:verbose")}}static formatProtocol(e,t,n){const r=!process||process.browser?1/0:process.stdout.columns,i=t.method||"?????",o=r-i.length-e.length-25,s=t.params&&"IO.read"!==i?JSON.stringify(t.params).substr(0,o):"";lc._logToStdErr(`${e}:${n||""}`,[i,s])}static isVerbose(){return"verbose"===cc}static time({msg:e,id:t,args:n=[]},r="log"){rc.mark(t),lc[r]("status",e,...n)}static timeEnd({msg:e,id:t,args:n=[]},r="verbose"){lc[r]("statusEnd",e,...n),rc.stop(t)}static log(e,...t){return lc.events.issueStatus(e,t),lc._logToStdErr(e,t)}static warn(e,...t){return lc.events.issueWarning(e,t),lc._logToStdErr(`${e}:warn`,t)}static error(e,...t){return lc._logToStdErr(`${e}:error`,t)}static verbose(e,...t){return lc.events.issueStatus(e,t),lc._logToStdErr(`${e}:verbose`,t)}static greenify(e){return`${lc.green}${e}${lc.reset}`}static redify(e){return`${lc.red}${e}${lc.reset}`}static get green(){return"[32m"}static get red(){return"[31m"}static get yellow(){return"[33m"}static get purple(){return"[95m"}static get reset(){return"[0m"}static get bold(){return"[1m"}static get dim(){return"[2m"}static get tick(){return oc?"√":"✓"}static get cross(){return oc?"×":"✘"}static get whiteSmallSquare(){return oc?"·":"▫"}static get heavyHorizontal(){return oc?"─":"━"}static get heavyVertical(){return oc?"│ ":"┃ "}static get heavyUpAndRight(){return oc?"└":"┗"}static get heavyVerticalAndRight(){return oc?"├":"┣"}static get heavyDownAndHorizontal(){return oc?"┬":"┳"}static get doubleLightHorizontal(){return"──"}}lc.events=new class extends ic{issueStatus(e,t){"status"!==e&&"statusEnd"!==e||this.emit(e,[e,...t])}issueWarning(e,t){this.emit("warning",[e,...t])}},lc.takeTimeEntries=()=>{const e=rc.getEntries();return rc.clear(),e},lc.getTimeEntries=()=>rc.getEntries();var pc=lc,Ac={};
|
||||
/**
|
||||
* @license Copyright 2017 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.getWSLLocalAppDataPath=Ac.toWSLPath=Ac.toWin32Path=Ac.makeTmpDir=Ac.getPlatform=Ac.ChromeNotInstalledError=Ac.UnsupportedPlatformError=Ac.InvalidUserDataDirectoryError=Ac.ChromePathNotSetError=Ac.LauncherError=Ac.delay=Ac.defaults=void 0;const fc=s,Dc=c,dc=o,gc=m;Ac.defaults=function(e,t){return void 0===e?t:e},Ac.delay=async function(e){return new Promise((t=>setTimeout(t,e)))};class hc extends Error{constructor(e="Unexpected error",t){return super(),this.message=e,this.code=t,this.stack=(new Error).stack,this}}Ac.LauncherError=hc,Ac.ChromePathNotSetError=class extends hc{constructor(){super(...arguments),this.message="The CHROME_PATH environment variable must be set to a Chrome/Chromium executable no older than Chrome stable.",this.code="ERR_LAUNCHER_PATH_NOT_SET"}},Ac.InvalidUserDataDirectoryError=class extends hc{constructor(){super(...arguments),this.message="userDataDir must be false or a path.",this.code="ERR_LAUNCHER_INVALID_USER_DATA_DIRECTORY"}};class mc extends hc{constructor(){super(...arguments),this.message=`Platform ${vc()} is not supported.`,this.code="ERR_LAUNCHER_UNSUPPORTED_PLATFORM"}}function vc(){return gc?"wsl":process.platform}function bc(e,t){try{return Dc.execFileSync("wslpath",["-u",e]).toString().trim()}catch{return t}}function yc(e){const t=/\/([a-z])\/Users\/([^\/:]+)\/AppData\//.exec(e)||[];return bc(`${t[1]}:\\Users\\${t[2]}\\AppData\\Local`,function(e){const t=/\/mnt\/([a-z])\/Users\/([^\/:]+)\/AppData\//.exec(e)||[];return`/mnt/${t[1]}/Users/${t[2]}/AppData/Local`}(e))}Ac.UnsupportedPlatformError=mc,Ac.ChromeNotInstalledError=class extends hc{constructor(){super(...arguments),this.message="No Chrome installations found.",this.code="ERR_LAUNCHER_NOT_INSTALLED"}},Ac.getPlatform=vc,Ac.makeTmpDir=function(){switch(vc()){case"darwin":case"linux":return Dc.execSync("mktemp -d -t lighthouse.XXXXXXX").toString().trim();case"wsl":process.env.TEMP=yc(`${process.env.PATH}`);case"win32":return function(){const e=process.env.TEMP||process.env.TMP||(process.env.SystemRoot||process.env.windir)+"\\temp",t=Math.floor(9e7*Math.random()+1e7),n=fc.join(e,"lighthouse."+t);return dc.mkdirSync(n,{recursive:!0}),n}
|
||||
/**
|
||||
* @license Copyright 2016 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/();default:throw new mc}},Ac.toWin32Path=function(e=""){if(/[a-z]:\\/iu.test(e))return e;try{return Dc.execFileSync("wslpath",["-w",e]).toString().trim()}catch{return function(e=""){const t=/\/mnt\/([a-z])\//.exec(e);if(!t)return e;const n=t[1];return e.replace(`/mnt/${n}/`,`${n.toUpperCase()}:\\`).replace(/\//g,"\\")}(e)}},Ac.toWSLPath=bc,Ac.getWSLLocalAppDataPath=yc,Object.defineProperty(Iu,"__esModule",{value:!0});var wc=Iu.win32=Ic=Iu.wsl=Mc=Iu.linux=Iu.darwin=Sc=Iu.darwinFast=void 0;const Cc=o,Ec=s,Fc=t,kc=c,_c=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")},Bc=pc,Pc=Ac,xc=/\r?\n/;var Sc=Iu.darwinFast=function(){const e=[process.env.CHROME_PATH,process.env.LIGHTHOUSE_CHROMIUM_PATH,"/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary","/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"];for(const t of e)if(t&&Nc(t))return t;return Oc()[0]};function Oc(){const e=["/Contents/MacOS/Google Chrome Canary","/Contents/MacOS/Google Chrome"],t=[],n=Tc();n&&t.push(n),kc.execSync("/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep -i 'google chrome\\( canary\\)\\?\\.app' | awk '{$1=\"\"; print $0}'").toString().split(xc).forEach((n=>{e.forEach((e=>{const r=Ec.join(n.substring(0,n.indexOf(".app")+4).trim(),e);Nc(r)&&-1===t.indexOf(r)&&t.push(r)}))}));const r=_c(process.env.HOME||Fc.homedir()),i=[{regex:new RegExp(`^${r}/Applications/.*Chrome\\.app`),weight:50},{regex:new RegExp(`^${r}/Applications/.*Chrome Canary\\.app`),weight:51},{regex:/^\/Applications\/.*Chrome.app/,weight:100},{regex:/^\/Applications\/.*Chrome Canary.app/,weight:101},{regex:/^\/Volumes\/.*Chrome.app/,weight:-2},{regex:/^\/Volumes\/.*Chrome Canary.app/,weight:-1}];return process.env.LIGHTHOUSE_CHROMIUM_PATH&&i.unshift({regex:new RegExp(_c(process.env.LIGHTHOUSE_CHROMIUM_PATH)),weight:150}),process.env.CHROME_PATH&&i.unshift({regex:new RegExp(_c(process.env.CHROME_PATH)),weight:151}),Lc(t,i)}function Tc(){return Nc(process.env.CHROME_PATH)?process.env.CHROME_PATH:Nc(process.env.LIGHTHOUSE_CHROMIUM_PATH)?(Bc.warn("ChromeLauncher","LIGHTHOUSE_CHROMIUM_PATH is deprecated, use CHROME_PATH env variable instead."),process.env.LIGHTHOUSE_CHROMIUM_PATH):void 0}Iu.darwin=Oc;var Mc=Iu.linux=function(){let e=[];const t=Tc();if(t&&e.push(t),[Ec.join(Fc.homedir(),".local/share/applications/"),"/usr/share/applications/"].forEach((t=>{e=e.concat(function(e){const t=/(^[^ ]+).*/,n="^Exec=/.*/(google-chrome|chrome|chromium)-.*";let r=[];if(Nc(e)){let i;try{i=kc.execSync(`grep -ER "${n}" ${e} | awk -F '=' '{print $2}'`,{stdio:"pipe"})}catch(t){i=kc.execSync(`grep -Er "${n}" ${e} | awk -F '=' '{print $2}'`,{stdio:"pipe"})}i=i.toString().split(xc).map((e=>e.replace(t,"$1"))),i.forEach((e=>Nc(e)&&r.push(e)))}return r}(t))})),["google-chrome-stable","google-chrome","chromium-browser","chromium"].forEach((t=>{try{const n=kc.execFileSync("which",[t],{stdio:"pipe"}).toString().split(xc)[0];Nc(n)&&e.push(n)}catch(e){}})),!e.length)throw new Pc.ChromePathNotSetError;const n=[{regex:/chrome-wrapper$/,weight:51},{regex:/google-chrome-stable$/,weight:50},{regex:/google-chrome$/,weight:49},{regex:/chromium-browser$/,weight:48},{regex:/chromium$/,weight:47}];return process.env.LIGHTHOUSE_CHROMIUM_PATH&&n.unshift({regex:new RegExp(_c(process.env.LIGHTHOUSE_CHROMIUM_PATH)),weight:100}),process.env.CHROME_PATH&&n.unshift({regex:new RegExp(_c(process.env.CHROME_PATH)),weight:101}),Lc((r=e.filter(Boolean),Array.from(new Set(r))),n);var r},Ic=Iu.wsl=function(){return process.env.LOCALAPPDATA=Pc.getWSLLocalAppDataPath(`${process.env.PATH}`),process.env.PROGRAMFILES=Pc.toWSLPath("C:/Program Files","/mnt/c/Program Files"),process.env["PROGRAMFILES(X86)"]=Pc.toWSLPath("C:/Program Files (x86)","/mnt/c/Program Files (x86)"),Rc()};function Rc(){const e=[],t=[`${Ec.sep}Google${Ec.sep}Chrome SxS${Ec.sep}Application${Ec.sep}chrome.exe`,`${Ec.sep}Google${Ec.sep}Chrome${Ec.sep}Application${Ec.sep}chrome.exe`],n=[process.env.LOCALAPPDATA,process.env.PROGRAMFILES,process.env["PROGRAMFILES(X86)"]].filter(Boolean),r=Tc();return r&&e.push(r),n.forEach((n=>t.forEach((t=>{const r=Ec.join(n,t);Nc(r)&&e.push(r)})))),e}function Lc(e,t){return e.map((e=>{for(const n of t)if(n.regex.test(e))return{path:e,weight:n.weight};return{path:e,weight:10}})).sort(((e,t)=>t.weight-e.weight)).map((e=>e.path))}function Nc(e){if(!e)return!1;try{return Cc.accessSync(e),!0}catch(e){return!1}}wc=Iu.win32=Rc;var Hc;let jc;Hc=function(e){return function(e,t,n){var r=e.length,i=0,o=1,s=0;function a(t){if(null===n)i+=t;else for(;t>0;)10===e.charCodeAt(i)?(i++,o++,s=0):(i++,s++),t--}function u(e){null===n?i=e:a(e-i)}function c(){for(;i<r;){var t=e.charCodeAt(i);if(32!==t&&9!==t&&13!==t&&10!==t)break;a(1)}}function l(t){return e.substr(i,t.length)===t&&(a(t.length),!0)}function p(t){var n=e.indexOf(t,i);u(-1!==n?n+t.Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./marp-cli-9fe562c5.js");require("yargs/yargs"),require("process"),require("os"),require("tty"),require("yargs"),require("fs"),require("path"),require("cosmiconfig"),require("util"),require("child_process"),require("url"),require("import-from"),require("stream"),require("events"),require("tmp"),require("@marp-team/marpit"),require("puppeteer-core"),require("net"),require("is-wsl"),require("crypto"),require("chokidar"),require("ws"),require("querystring"),require("serve-index"),require("@marp-team/marp-core/package.json"),exports.apiInterface=e.a,exports.cliInterface=e.e,exports.default=e.e,exports.marpCli=e.d,exports.waitForObservation=e.w;
|
||||
@@ -0,0 +1,4 @@
|
||||
module.exports = ({ marp }) =>
|
||||
marp.use(require("./markdown-it/@kazumatu981/markdown-it-kroki/index"))
|
||||
.use(require("./markdown-it/markdown-it-mark/dist/markdown-it-mark.min"))
|
||||
.use(require("./markdown-it/markdown-it-container/dist/markdown-it-container.min"), "container");
|
||||
@@ -0,0 +1,16 @@
|
||||
"use strict";var t=require("./marp-cli-9fe562c5.js");function e(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(n){if("default"!==n&&!(n in t)){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}))})),Object.freeze(t)}var n={};!function(e,n){t.c,function(t){
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,n)};function n(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function i(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))}function o(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function a(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}for(var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=new Uint8Array(256),h=0;h<s.length;h++)l[s.charCodeAt(h)]=h;var u,c=function(t){for(var e="",n=t.length,r=0;r<n;r+=3)e+=s[t[r]>>2],e+=s[(3&t[r])<<4|t[r+1]>>4],e+=s[(15&t[r+1])<<2|t[r+2]>>6],e+=s[63&t[r+2]];return n%3==2?e=e.substring(0,e.length-1)+"=":n%3==1&&(e=e.substring(0,e.length-2)+"=="),e},d=function(t){var e,n,r,i,o,a=.75*t.length,s=t.length,h=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var u=new Uint8Array(a);for(e=0;e<s;e+=4)n=l[t.charCodeAt(e)],r=l[t.charCodeAt(e+1)],i=l[t.charCodeAt(e+2)],o=l[t.charCodeAt(e+3)],u[h++]=n<<2|r>>4,u[h++]=(15&r)<<4|i>>2,u[h++]=(3&i)<<6|63&o;return u},f=/^(data)?:?([\w\/\+]+)?;?(charset=[\w-]+|base64)?.*,/i,p=function(t){var e=t.trim(),n=e.substring(0,100).match(f);if(!n)return d(e);var r=n[0],i=e.substring(r.length);return d(i)},g=function(t){return t.charCodeAt(0)},v=function(t){return t.codePointAt(0)},y=function(t,e){return x(t.toString(16),e,"0").toUpperCase()},m=function(t){return y(t,2)},b=function(t){return String.fromCharCode(t)},w=function(t){return b(parseInt(t,16))},x=function(t,e,n){for(var r="",i=0,o=e-t.length;i<o;i++)r+=n;return r+t},k=function(t,e,n){for(var r=t.length,i=0;i<r;i++)e[n++]=t.charCodeAt(i);return r},F=function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},S=function(t){return t.replace(/\t|\u0085|\u2028|\u2029/g," ").replace(/[\b\v]/g,"")},C=["\\n","\\f","\\r","\\u000B"],A=function(t){return/^[\n\f\r\u000B]$/.test(t)},T=function(t){return t.split(/[\n\f\r\u000B]/)},P=function(t){return t.replace(/[\n\f\r\u000B]/g," ")},z=function(t,e){var n,r=t.charCodeAt(e),i=e+1,o=1;return r>=55296&&r<=56319&&t.length>i&&(n=t.charCodeAt(i))>=56320&&n<=57343&&(o=2),[t.slice(e,e+o),o]},O=function(t){for(var e=[],n=0,r=t.length;n<r;){var i=z(t,n),o=i[0],a=i[1];e.push(o),n+=a}return e},R=function(t,e,n,r){for(var i=function(t){for(var e=C.join("|"),n=["$"],r=0,i=t.length;r<i;r++){var o=t[r];if(A(o))throw new TypeError("`wordBreak` must not include "+e);n.push(""===o?".":F(o))}var a=n.join("|");return new RegExp("("+e+")|((.*?)("+a+"))","gm")}(e),o=S(t).match(i),a="",s=0,l=[],h=function(){""!==a&&l.push(a),a="",s=0},u=0,c=o.length;u<c;u++){var d=o[u];if(A(d))h();else{var f=r(d);s+f>n&&h(),a+=d,s+=f}}return h(),l},D=/^D:(\d\d\d\d)(\d\d)?(\d\d)?(\d\d)?(\d\d)?(\d\d)?([+\-Z])?(\d\d)?'?(\d\d)?'?$/,B=function(t){var e=t.match(D);if(e){var n=e[1],r=e[2],i=void 0===r?"01":r,o=e[3],a=void 0===o?"01":o,s=e[4],l=void 0===s?"00":s,h=e[5],u=void 0===h?"00":h,c=e[6],d=void 0===c?"00":c,f=e[7],p=void 0===f?"Z":f,g=e[8],v=void 0===g?"00":g,y=e[9];return new Date(n+"-"+i+"-"+a+"T"+l+":"+u+":"+d+("Z"===p?"Z":""+p+v+":"+(void 0===y?"00":y)))}},N=function(t,e){for(var n,r,i=0;i<t.length;){var o=t.substring(i).match(e);if(!o)return{match:r,pos:i};r=o,i+=(null!==(n=o.index)&&void 0!==n?n:0)+o[0].length}return{match:r,pos:i}},E=function(t){return t[t.length-1]},j=fLine truncated
|
||||
@@ -0,0 +1,12 @@
|
||||
"use strict";var e=require("./marp-cli-9fe562c5.js"),t=require("./_commonjs-dynamic-modules-21d62193.js");require("process"),require("os"),require("tty"),require("yargs/yargs"),require("yargs"),require("fs"),require("path"),require("cosmiconfig"),require("util"),require("child_process"),require("url"),require("import-from"),require("stream"),require("events"),require("tmp"),require("@marp-team/marpit"),require("puppeteer-core"),require("net"),require("is-wsl"),require("crypto"),require("chokidar"),require("ws"),require("querystring"),require("serve-index"),require("@marp-team/marp-core/package.json");var a={exports:{}}.exports=function e(a,r,n){function o(i,s){if(!r[i]){if(!a[i]){var l="function"==typeof t.c&&t.c;if(!s&&l)return l(i,!0);if(A)return A(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var p=r[i]={exports:{}};a[i][0].call(p.exports,(function(e){return o(a[i][1][e]||e)}),p,p.exports,e,a,r,n)}return r[i].exports}for(var A="function"==typeof t.c&&t.c,i=0;i<n.length;i++)o(n[i]);return o}({1:[function(e,t,a){var r=e("./utils"),n=e("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";a.encode=function(e){for(var t,a,n,A,i,s,l,c=[],p=0,d=e.length,f=d,u="string"!==r.getTypeOf(e);p<e.length;)f=d-p,n=u?(t=e[p++],a=p<d?e[p++]:0,p<d?e[p++]:0):(t=e.charCodeAt(p++),a=p<d?e.charCodeAt(p++):0,p<d?e.charCodeAt(p++):0),A=t>>2,i=(3&t)<<4|a>>4,s=1<f?(15&a)<<2|n>>6:64,l=2<f?63&n:64,c.push(o.charAt(A)+o.charAt(i)+o.charAt(s)+o.charAt(l));return c.join("")},a.decode=function(e){var t,a,r,A,i,s,l=0,c=0,p="data:";if(e.substr(0,p.length)===p)throw new Error("Invalid base64 input, it looks like a data url.");var d,f=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===o.charAt(64)&&f--,e.charAt(e.length-2)===o.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=n.uint8array?new Uint8Array(0|f):new Array(0|f);l<e.length;)t=o.indexOf(e.charAt(l++))<<2|(A=o.indexOf(e.charAt(l++)))>>4,a=(15&A)<<4|(i=o.indexOf(e.charAt(l++)))>>2,r=(3&i)<<6|(s=o.indexOf(e.charAt(l++))),d[c++]=t,64!==i&&(d[c++]=a),64!==s&&(d[c++]=r);return d}},{"./support":30,"./utils":32}],2:[function(e,t,a){var r=e("./external"),n=e("./stream/DataWorker"),o=e("./stream/Crc32Probe"),A=e("./stream/DataLengthProbe");function i(e,t,a,r,n){this.compressedSize=e,this.uncompressedSize=t,this.crc32=a,this.compression=r,this.compressedContent=n}i.prototype={getContentWorker:function(){var e=new n(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new A("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new n(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},i.createWorkerFrom=function(e,t,a){return e.pipe(new o).pipe(new A("uncompressedSize")).pipe(t.compressWorker(a)).pipe(new A("compressedSize")).withStreamInfo("compression",t)},t.exports=i},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,a){var r=e("./stream/GenericWorker");a.STORE={magic:"\0\0",compressWorker:function(){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},a.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,a){var r=e("./utils"),n=function(){for(var e,t=[],a=0;a<256;a++){e=a;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[a]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==r.getTypeOf(e)?function(e,t,a,r){var o=n,A=0+a;e^=-1;for(var i=0;i<A;i++)e=e>>>8^o[255&(e^t[i])];return-1^e}(0|t,e,e.length):function(e,t,a,r){var o=n,A=0+a;e^=-1;for(var i=0;i<A;i++)e=e>>>8^o[255&(e^t.charCodeAt(i))];return-1^e}(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,a){a.base64=!1,a.binary=!1,a.dir=!1,a.createFolders=!0,a.date=null,a.compression=null,a.compressionOptions=null,a.comment=null,a.unixPermissions=null,a.dosPermissions=null},{}],6:[function(e,t,a){var r;r="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:r}},{lie:37}],7:[function(e,t,a){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,n=e("pako"),o=e("./utils"),A=e("./stream/GenericWorker"),i=r?"uint8array":"array";function s(e,t){A.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}a.magic="\b\0",o.inherits(s,A),s.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(i,e.data),!1)},s.prototype.flush=function(){A.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},s.protoLine truncated
|
||||
/*!
|
||||
|
||||
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
|
||||
<http://stuartk.com/jszip>
|
||||
|
||||
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
|
||||
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
|
||||
|
||||
JSZip uses the library pako released under the MIT license :
|
||||
https://github.com/nodeca/pako/blob/main/LICENSE
|
||||
*/function o(e,t,a,r){return new(a||(a=Promise))((function(n,o){function A(e){try{s(r.next(e))}catch(e){o(e)}}function i(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(A,i)}s((r=r.apply(e,t||[])).next())}))}function A(e,t){var a,r,n,o,A={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function i(i){return function(s){return function(i){if(a)throw new TypeError("Generator is already executing.");for(;o&&(o=0,i[0]&&(A=0)),A;)try{if(a=1,r&&(n=2&i[0]?r.return:i[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,i[1])).done)return n;switch(r=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return A.label++,{value:i[1],done:!1};case 5:A.label++,r=i[1],i=[0];continue;case 7:i=A.ops.pop(),A.trys.pop();continue;default:if(!((n=(n=A.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){A=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){A.label=i[1];break}if(6===i[0]&&A.label<n[1]){A.label=n[1],n=i;break}if(n&&A.label<n[2]){A.label=n[2],A.ops.push(i);break}n[2]&&A.ops.pop(),A.trys.pop();continue}i=t.call(e,A)}catch(e){i=[6,e],r=0}finally{a=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function i(e,t,a){if(a||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}var s,l,c=914400,p=12700,d="\r\n",f=/^[0-9a-fA-F]{6}$/,u=27,h="solid",m="666666",g=[.05,.1,.05,.1],v="363636",b=1,y={color:"888888",style:"solid",size:1,cap:"flat"},w="000000",x=12,C="LAYOUT_16x9",P="DEFAULT",L="333333",B={type:"outer",blur:3,offset:23e3/12700,angle:90,color:"000000",opacity:.35,rotateWithShape:!0},T=[.5,.5,.5,.5],S="000000",E={size:8,color:"FFFFFF",opacity:.75},D="2094734552",k="2094734553",N="2094734554",F="2094734555",_="2094734556",I="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),R=["C0504D","4F81BD","9BBB59","8064A2","4BACC6","F79646","628FC6","C86360","C0504D","4F81BD","9BBB59","8064A2","4BACC6","F79646","628FC6","C86360"],O=["5DA5DA","FAA43A","60BD68","F17CB0","B2912F","B276B2","DECF3F","F15854","A7A7A7","5DA5DA","FAA43A","60BD68","F17CB0","B2912F","B276B2","DECF3F","F15854","A7A7A7"];!function(e){e.left="left",e.center="center",e.right="right",e.justify="justify"}(s||(s={})),function(e){e.b="b",e.ctr="ctr",e.t="t"}(l||(l={}));var M,z,U,j,Q,G,Y,W,X,H,V,q,J,K="{F7021451-1387-4CA6-816F-3879F97B5CBC}";!function(e){e.arraybuffer="arraybuffer",e.base64="base64",e.binarystring="binarystring",e.blob="blob",e.nodebuffer="nodebuffer",e.uint8array="uint8array"}(M||(M={})),function(e){e.area="area",e.bar="bar",e.bar3d="bar3D",e.bubble="bubble",e.bubble3d="bubble3D",e.doughnut="doughnut",e.line="line",e.pie="pie",e.radar="radar",e.scatter="scatter"}(z||(z={})),function(e){e.accentBorderCallout1="accentBorderCallout1",e.accentBorderCallout2="accentBorderCallout2",e.accentBorderCallout3="accentBorderCallout3",e.accentCallout1="accentCallout1",e.accentCallout2="accentCallout2",e.accentCallout3="accentCallout3",e.actionButtonBackPrevious="actionButtonBackPrevious",e.actionButtonBeginning="actionButtonBeginning",e.actionButtonBlank="actionButtonBlank",e.actionButtonDocument="actionButtonDocument",e.actionButtonEnd="actionButtonEnd",e.actionButtonForwardNext="actionButtonForwardNext",e.actionButtonHelp="actionButtonHelp",e.actionButtonHome="actionButtonHome",e.actionButtonInformation="actionButtonInformation",e.actionButtonMovie="actionButtonMovie",e.actionButtonReturn="actionButtonReturn",e.actionButtonSound="actionButtonSound",e.arc="arc",e.bentArrow="bentArrow",e.bentUpArrow="bentUpArrow",e.bevel="bevel",e.blockArc="blockArc",e.borderCallout1="borderCallout1",e.borderCallout2="borderCallout2",e.borderCallout3="borderCallout3",e.bracePair="bracePair",e.bracketPair="bracketPair",e.callout1="callout1",e.callout2="callout2",e.callout3="callout3",e.can="can",e.chartPlus="chartPlus",e.chartStar="chartStar",e.chartX="chartX",e.chevron="chevron",e.chord="chord",e.circularArrow="circularArrow",e.cloud="cloud",e.cloudCallout="cloudCallout",e.corner="corner",e.cornerTabs="cornerTabs",e.cube="cube",e.curvedDownArrow="curvedDownArrow",e.curvedLeftArrow="curvedLeftArrow",e.curvedRightArrow="curvedRightArrow",e.curvedUpArrow="curvedUpArrow",e.custGeom="custGeom",e.decagon="decagon",e.diagStripe="diagStripe",e.diamond="diamond",e.dodecagon="dodecagon",e.donut="donut",e.doubleWave="doubleWave",e.downArrow="downArrow",e.downArrowCallout="downArrowCallout",e.ellipse="ellipse",e.ellipseRibbon="ellipseRibbon",e.ellipseRibbon2="ellipseRibbon2",e.flowChartAlternateProcess="flowChartAlternateProcess",e.flowChartCollate="flowChartCollate",e.flowChartConnector="flowChartConnector",e.flowChartDecision="flowChartDecision",e.flowChartDelay="flowChartDelay",e.flowChartDisplay="flowChartDisplay"Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
!function(){"use strict";const e="marp-cli-show-all";!function(){const t=document.getElementById("show-all"),s=document.getElementById("index"),c=c=>{t.checked=c,s.classList.toggle("show-all",c);try{sessionStorage.setItem(e,c?"1":"")}catch(e){console.error(e)}};c(!!sessionStorage.getItem(e)),t.addEventListener("change",(()=>c(t.checked)))}()}();
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(){"use strict";const e=(n,o=!1)=>{const t=new WebSocket(n);return t.addEventListener("open",(()=>{console.info("[Marp CLI] Observing the change of file..."),o&&location.reload()})),t.addEventListener("close",(()=>{console.warn("[Marp CLI] WebSocket for file watcher was disconnected. Try re-connecting in 5000ms..."),setTimeout((()=>e(n,!0)),5e3)})),t.addEventListener("message",(e=>{"reload"===e.data&&location.reload()})),t};(()=>{const n=window.__marpCliWatchWS;n&&e(n)})()}();
|
||||
Reference in new issue
Block a user