Files
StudyDiary/.obsidian/plugins/marp-slides/lib3/marp-cli-9fe562c5.js

44 lines
328 KiB
JavaScript
Raw Normal View History

2025-10-25 20:35:10 +08:00
"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="",x.bgColor.close="",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
/*!
* 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:"?
/**
* @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""}static get red(){return""}static get yellow(){return""}static get purple(){return""}static get reset(){return""}static get bold(){return""}static get dim(){return""}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