{"version":3,"file":"vite.mjs","names":["module","exports"],"sources":["../../node_modules/json5/dist/index.js","../src/embed-config.ts","../src/targets.ts","../src/prepare.ts","../src/windows-icon.ts","../src/app-icon.ts","../src/windows-resource.ts","../src/linux-desktop.ts","../src/build.ts","../src/capability.ts","../src/plugin-access.ts","../src/gitignore.ts","../src/vite-internals.ts","../src/vite-options.ts","../src/build-sequence.ts","../src/vite.ts"],"sourcesContent":["(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.JSON5 = factory());\n}(this, (function () { 'use strict';\n\n\tfunction createCommonjsModule(fn, module) {\n\t\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n\t}\n\n\tvar _global = createCommonjsModule(function (module) {\n\t// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\n\tvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n\t  ? window : typeof self != 'undefined' && self.Math == Math ? self\n\t  // eslint-disable-next-line no-new-func\n\t  : Function('return this')();\n\tif (typeof __g == 'number') { __g = global; } // eslint-disable-line no-undef\n\t});\n\n\tvar _core = createCommonjsModule(function (module) {\n\tvar core = module.exports = { version: '2.6.5' };\n\tif (typeof __e == 'number') { __e = core; } // eslint-disable-line no-undef\n\t});\n\tvar _core_1 = _core.version;\n\n\tvar _isObject = function (it) {\n\t  return typeof it === 'object' ? it !== null : typeof it === 'function';\n\t};\n\n\tvar _anObject = function (it) {\n\t  if (!_isObject(it)) { throw TypeError(it + ' is not an object!'); }\n\t  return it;\n\t};\n\n\tvar _fails = function (exec) {\n\t  try {\n\t    return !!exec();\n\t  } catch (e) {\n\t    return true;\n\t  }\n\t};\n\n\t// Thank's IE8 for his funny defineProperty\n\tvar _descriptors = !_fails(function () {\n\t  return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n\t});\n\n\tvar document = _global.document;\n\t// typeof document.createElement is 'object' in old IE\n\tvar is = _isObject(document) && _isObject(document.createElement);\n\tvar _domCreate = function (it) {\n\t  return is ? document.createElement(it) : {};\n\t};\n\n\tvar _ie8DomDefine = !_descriptors && !_fails(function () {\n\t  return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;\n\t});\n\n\t// 7.1.1 ToPrimitive(input [, PreferredType])\n\n\t// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n\t// and the second argument - flag - preferred type is a string\n\tvar _toPrimitive = function (it, S) {\n\t  if (!_isObject(it)) { return it; }\n\t  var fn, val;\n\t  if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; }\n\t  if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) { return val; }\n\t  if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; }\n\t  throw TypeError(\"Can't convert object to primitive value\");\n\t};\n\n\tvar dP = Object.defineProperty;\n\n\tvar f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n\t  _anObject(O);\n\t  P = _toPrimitive(P, true);\n\t  _anObject(Attributes);\n\t  if (_ie8DomDefine) { try {\n\t    return dP(O, P, Attributes);\n\t  } catch (e) { /* empty */ } }\n\t  if ('get' in Attributes || 'set' in Attributes) { throw TypeError('Accessors not supported!'); }\n\t  if ('value' in Attributes) { O[P] = Attributes.value; }\n\t  return O;\n\t};\n\n\tvar _objectDp = {\n\t\tf: f\n\t};\n\n\tvar _propertyDesc = function (bitmap, value) {\n\t  return {\n\t    enumerable: !(bitmap & 1),\n\t    configurable: !(bitmap & 2),\n\t    writable: !(bitmap & 4),\n\t    value: value\n\t  };\n\t};\n\n\tvar _hide = _descriptors ? function (object, key, value) {\n\t  return _objectDp.f(object, key, _propertyDesc(1, value));\n\t} : function (object, key, value) {\n\t  object[key] = value;\n\t  return object;\n\t};\n\n\tvar hasOwnProperty = {}.hasOwnProperty;\n\tvar _has = function (it, key) {\n\t  return hasOwnProperty.call(it, key);\n\t};\n\n\tvar id = 0;\n\tvar px = Math.random();\n\tvar _uid = function (key) {\n\t  return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n\t};\n\n\tvar _library = false;\n\n\tvar _shared = createCommonjsModule(function (module) {\n\tvar SHARED = '__core-js_shared__';\n\tvar store = _global[SHARED] || (_global[SHARED] = {});\n\n\t(module.exports = function (key, value) {\n\t  return store[key] || (store[key] = value !== undefined ? value : {});\n\t})('versions', []).push({\n\t  version: _core.version,\n\t  mode: _library ? 'pure' : 'global',\n\t  copyright: '© 2019 Denis Pushkarev (zloirock.ru)'\n\t});\n\t});\n\n\tvar _functionToString = _shared('native-function-to-string', Function.toString);\n\n\tvar _redefine = createCommonjsModule(function (module) {\n\tvar SRC = _uid('src');\n\n\tvar TO_STRING = 'toString';\n\tvar TPL = ('' + _functionToString).split(TO_STRING);\n\n\t_core.inspectSource = function (it) {\n\t  return _functionToString.call(it);\n\t};\n\n\t(module.exports = function (O, key, val, safe) {\n\t  var isFunction = typeof val == 'function';\n\t  if (isFunction) { _has(val, 'name') || _hide(val, 'name', key); }\n\t  if (O[key] === val) { return; }\n\t  if (isFunction) { _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); }\n\t  if (O === _global) {\n\t    O[key] = val;\n\t  } else if (!safe) {\n\t    delete O[key];\n\t    _hide(O, key, val);\n\t  } else if (O[key]) {\n\t    O[key] = val;\n\t  } else {\n\t    _hide(O, key, val);\n\t  }\n\t// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n\t})(Function.prototype, TO_STRING, function toString() {\n\t  return typeof this == 'function' && this[SRC] || _functionToString.call(this);\n\t});\n\t});\n\n\tvar _aFunction = function (it) {\n\t  if (typeof it != 'function') { throw TypeError(it + ' is not a function!'); }\n\t  return it;\n\t};\n\n\t// optional / simple context binding\n\n\tvar _ctx = function (fn, that, length) {\n\t  _aFunction(fn);\n\t  if (that === undefined) { return fn; }\n\t  switch (length) {\n\t    case 1: return function (a) {\n\t      return fn.call(that, a);\n\t    };\n\t    case 2: return function (a, b) {\n\t      return fn.call(that, a, b);\n\t    };\n\t    case 3: return function (a, b, c) {\n\t      return fn.call(that, a, b, c);\n\t    };\n\t  }\n\t  return function (/* ...args */) {\n\t    return fn.apply(that, arguments);\n\t  };\n\t};\n\n\tvar PROTOTYPE = 'prototype';\n\n\tvar $export = function (type, name, source) {\n\t  var IS_FORCED = type & $export.F;\n\t  var IS_GLOBAL = type & $export.G;\n\t  var IS_STATIC = type & $export.S;\n\t  var IS_PROTO = type & $export.P;\n\t  var IS_BIND = type & $export.B;\n\t  var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE];\n\t  var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});\n\t  var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n\t  var key, own, out, exp;\n\t  if (IS_GLOBAL) { source = name; }\n\t  for (key in source) {\n\t    // contains in native\n\t    own = !IS_FORCED && target && target[key] !== undefined;\n\t    // export native or passed\n\t    out = (own ? target : source)[key];\n\t    // bind timers to global for call from export context\n\t    exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;\n\t    // extend global\n\t    if (target) { _redefine(target, key, out, type & $export.U); }\n\t    // export\n\t    if (exports[key] != out) { _hide(exports, key, exp); }\n\t    if (IS_PROTO && expProto[key] != out) { expProto[key] = out; }\n\t  }\n\t};\n\t_global.core = _core;\n\t// type bitmap\n\t$export.F = 1;   // forced\n\t$export.G = 2;   // global\n\t$export.S = 4;   // static\n\t$export.P = 8;   // proto\n\t$export.B = 16;  // bind\n\t$export.W = 32;  // wrap\n\t$export.U = 64;  // safe\n\t$export.R = 128; // real proto method for `library`\n\tvar _export = $export;\n\n\t// 7.1.4 ToInteger\n\tvar ceil = Math.ceil;\n\tvar floor = Math.floor;\n\tvar _toInteger = function (it) {\n\t  return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n\t};\n\n\t// 7.2.1 RequireObjectCoercible(argument)\n\tvar _defined = function (it) {\n\t  if (it == undefined) { throw TypeError(\"Can't call method on  \" + it); }\n\t  return it;\n\t};\n\n\t// true  -> String#at\n\t// false -> String#codePointAt\n\tvar _stringAt = function (TO_STRING) {\n\t  return function (that, pos) {\n\t    var s = String(_defined(that));\n\t    var i = _toInteger(pos);\n\t    var l = s.length;\n\t    var a, b;\n\t    if (i < 0 || i >= l) { return TO_STRING ? '' : undefined; }\n\t    a = s.charCodeAt(i);\n\t    return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n\t      ? TO_STRING ? s.charAt(i) : a\n\t      : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n\t  };\n\t};\n\n\tvar $at = _stringAt(false);\n\t_export(_export.P, 'String', {\n\t  // 21.1.3.3 String.prototype.codePointAt(pos)\n\t  codePointAt: function codePointAt(pos) {\n\t    return $at(this, pos);\n\t  }\n\t});\n\n\tvar codePointAt = _core.String.codePointAt;\n\n\tvar max = Math.max;\n\tvar min = Math.min;\n\tvar _toAbsoluteIndex = function (index, length) {\n\t  index = _toInteger(index);\n\t  return index < 0 ? max(index + length, 0) : min(index, length);\n\t};\n\n\tvar fromCharCode = String.fromCharCode;\n\tvar $fromCodePoint = String.fromCodePoint;\n\n\t// length should be 1, old FF problem\n\t_export(_export.S + _export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n\t  // 21.1.2.2 String.fromCodePoint(...codePoints)\n\t  fromCodePoint: function fromCodePoint(x) {\n\t    var arguments$1 = arguments;\n\t // eslint-disable-line no-unused-vars\n\t    var res = [];\n\t    var aLen = arguments.length;\n\t    var i = 0;\n\t    var code;\n\t    while (aLen > i) {\n\t      code = +arguments$1[i++];\n\t      if (_toAbsoluteIndex(code, 0x10ffff) !== code) { throw RangeError(code + ' is not a valid code point'); }\n\t      res.push(code < 0x10000\n\t        ? fromCharCode(code)\n\t        : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n\t      );\n\t    } return res.join('');\n\t  }\n\t});\n\n\tvar fromCodePoint = _core.String.fromCodePoint;\n\n\t// This is a generated file. Do not edit.\n\tvar Space_Separator = /[\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\n\tvar ID_Start = /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0A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u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312E\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\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DE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]/;\n\tvar ID_Continue = /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u08D4-\\u08E1\\u08E3-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09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8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1C80-\\u1C88\\u1CD0-\\u1CD2\\u1CD4-\\u1CF9\\u1D00-\\u1DF9\\u1DFB-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312E\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA8FD\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABEA\\uABEC\\uABED\\uABF0-\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\uDE86-\\uDE99\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC36\\uDC38-\\uDC40\\uDC50-\\uDC59\\uDC72-\\uDC8F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD50-\\uDD59]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE60-\\uDE69\\uDED0-\\uDEED\\uDEF0-\\uDEF4\\uDF00-\\uDF36\\uDF40-\\uDF43\\uDF50-\\uDF59\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50-\\uDF7E\\uDF8F-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\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uDD00-\\uDDEF]/;\n\n\tvar unicode = {\n\t\tSpace_Separator: Space_Separator,\n\t\tID_Start: ID_Start,\n\t\tID_Continue: ID_Continue\n\t};\n\n\tvar util = {\n\t    isSpaceSeparator: function isSpaceSeparator (c) {\n\t        return typeof c === 'string' && unicode.Space_Separator.test(c)\n\t    },\n\n\t    isIdStartChar: function isIdStartChar (c) {\n\t        return typeof c === 'string' && (\n\t            (c >= 'a' && c <= 'z') ||\n\t        (c >= 'A' && c <= 'Z') ||\n\t        (c === '$') || (c === '_') ||\n\t        unicode.ID_Start.test(c)\n\t        )\n\t    },\n\n\t    isIdContinueChar: function isIdContinueChar (c) {\n\t        return typeof c === 'string' && (\n\t            (c >= 'a' && c <= 'z') ||\n\t        (c >= 'A' && c <= 'Z') ||\n\t        (c >= '0' && c <= '9') ||\n\t        (c === '$') || (c === '_') ||\n\t        (c === '\\u200C') || (c === '\\u200D') ||\n\t        unicode.ID_Continue.test(c)\n\t        )\n\t    },\n\n\t    isDigit: function isDigit (c) {\n\t        return typeof c === 'string' && /[0-9]/.test(c)\n\t    },\n\n\t    isHexDigit: function isHexDigit (c) {\n\t        return typeof c === 'string' && /[0-9A-Fa-f]/.test(c)\n\t    },\n\t};\n\n\tvar source;\n\tvar parseState;\n\tvar stack;\n\tvar pos;\n\tvar line;\n\tvar column;\n\tvar token;\n\tvar key;\n\tvar root;\n\n\tvar parse = function parse (text, reviver) {\n\t    source = String(text);\n\t    parseState = 'start';\n\t    stack = [];\n\t    pos = 0;\n\t    line = 1;\n\t    column = 0;\n\t    token = undefined;\n\t    key = undefined;\n\t    root = undefined;\n\n\t    do {\n\t        token = lex();\n\n\t        // This code is unreachable.\n\t        // if (!parseStates[parseState]) {\n\t        //     throw invalidParseState()\n\t        // }\n\n\t        parseStates[parseState]();\n\t    } while (token.type !== 'eof')\n\n\t    if (typeof reviver === 'function') {\n\t        return internalize({'': root}, '', reviver)\n\t    }\n\n\t    return root\n\t};\n\n\tfunction internalize (holder, name, reviver) {\n\t    var value = holder[name];\n\t    if (value != null && typeof value === 'object') {\n\t        if (Array.isArray(value)) {\n\t            for (var i = 0; i < value.length; i++) {\n\t                var key = String(i);\n\t                var replacement = internalize(value, key, reviver);\n\t                if (replacement === undefined) {\n\t                    delete value[key];\n\t                } else {\n\t                    Object.defineProperty(value, key, {\n\t                        value: replacement,\n\t                        writable: true,\n\t                        enumerable: true,\n\t                        configurable: true,\n\t                    });\n\t                }\n\t            }\n\t        } else {\n\t            for (var key$1 in value) {\n\t                var replacement$1 = internalize(value, key$1, reviver);\n\t                if (replacement$1 === undefined) {\n\t                    delete value[key$1];\n\t                } else {\n\t                    Object.defineProperty(value, key$1, {\n\t                        value: replacement$1,\n\t                        writable: true,\n\t                        enumerable: true,\n\t                        configurable: true,\n\t                    });\n\t                }\n\t            }\n\t        }\n\t    }\n\n\t    return reviver.call(holder, name, value)\n\t}\n\n\tvar lexState;\n\tvar buffer;\n\tvar doubleQuote;\n\tvar sign;\n\tvar c;\n\n\tfunction lex () {\n\t    lexState = 'default';\n\t    buffer = '';\n\t    doubleQuote = false;\n\t    sign = 1;\n\n\t    for (;;) {\n\t        c = peek();\n\n\t        // This code is unreachable.\n\t        // if (!lexStates[lexState]) {\n\t        //     throw invalidLexState(lexState)\n\t        // }\n\n\t        var token = lexStates[lexState]();\n\t        if (token) {\n\t            return token\n\t        }\n\t    }\n\t}\n\n\tfunction peek () {\n\t    if (source[pos]) {\n\t        return String.fromCodePoint(source.codePointAt(pos))\n\t    }\n\t}\n\n\tfunction read () {\n\t    var c = peek();\n\n\t    if (c === '\\n') {\n\t        line++;\n\t        column = 0;\n\t    } else if (c) {\n\t        column += c.length;\n\t    } else {\n\t        column++;\n\t    }\n\n\t    if (c) {\n\t        pos += c.length;\n\t    }\n\n\t    return c\n\t}\n\n\tvar lexStates = {\n\t    default: function default$1 () {\n\t        switch (c) {\n\t        case '\\t':\n\t        case '\\v':\n\t        case '\\f':\n\t        case ' ':\n\t        case '\\u00A0':\n\t        case '\\uFEFF':\n\t        case '\\n':\n\t        case '\\r':\n\t        case '\\u2028':\n\t        case '\\u2029':\n\t            read();\n\t            return\n\n\t        case '/':\n\t            read();\n\t            lexState = 'comment';\n\t            return\n\n\t        case undefined:\n\t            read();\n\t            return newToken('eof')\n\t        }\n\n\t        if (util.isSpaceSeparator(c)) {\n\t            read();\n\t            return\n\t        }\n\n\t        // This code is unreachable.\n\t        // if (!lexStates[parseState]) {\n\t        //     throw invalidLexState(parseState)\n\t        // }\n\n\t        return lexStates[parseState]()\n\t    },\n\n\t    comment: function comment () {\n\t        switch (c) {\n\t        case '*':\n\t            read();\n\t            lexState = 'multiLineComment';\n\t            return\n\n\t        case '/':\n\t            read();\n\t            lexState = 'singleLineComment';\n\t            return\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    multiLineComment: function multiLineComment () {\n\t        switch (c) {\n\t        case '*':\n\t            read();\n\t            lexState = 'multiLineCommentAsterisk';\n\t            return\n\n\t        case undefined:\n\t            throw invalidChar(read())\n\t        }\n\n\t        read();\n\t    },\n\n\t    multiLineCommentAsterisk: function multiLineCommentAsterisk () {\n\t        switch (c) {\n\t        case '*':\n\t            read();\n\t            return\n\n\t        case '/':\n\t            read();\n\t            lexState = 'default';\n\t            return\n\n\t        case undefined:\n\t            throw invalidChar(read())\n\t        }\n\n\t        read();\n\t        lexState = 'multiLineComment';\n\t    },\n\n\t    singleLineComment: function singleLineComment () {\n\t        switch (c) {\n\t        case '\\n':\n\t        case '\\r':\n\t        case '\\u2028':\n\t        case '\\u2029':\n\t            read();\n\t            lexState = 'default';\n\t            return\n\n\t        case undefined:\n\t            read();\n\t            return newToken('eof')\n\t        }\n\n\t        read();\n\t    },\n\n\t    value: function value () {\n\t        switch (c) {\n\t        case '{':\n\t        case '[':\n\t            return newToken('punctuator', read())\n\n\t        case 'n':\n\t            read();\n\t            literal('ull');\n\t            return newToken('null', null)\n\n\t        case 't':\n\t            read();\n\t            literal('rue');\n\t            return newToken('boolean', true)\n\n\t        case 'f':\n\t            read();\n\t            literal('alse');\n\t            return newToken('boolean', false)\n\n\t        case '-':\n\t        case '+':\n\t            if (read() === '-') {\n\t                sign = -1;\n\t            }\n\n\t            lexState = 'sign';\n\t            return\n\n\t        case '.':\n\t            buffer = read();\n\t            lexState = 'decimalPointLeading';\n\t            return\n\n\t        case '0':\n\t            buffer = read();\n\t            lexState = 'zero';\n\t            return\n\n\t        case '1':\n\t        case '2':\n\t        case '3':\n\t        case '4':\n\t        case '5':\n\t        case '6':\n\t        case '7':\n\t        case '8':\n\t        case '9':\n\t            buffer = read();\n\t            lexState = 'decimalInteger';\n\t            return\n\n\t        case 'I':\n\t            read();\n\t            literal('nfinity');\n\t            return newToken('numeric', Infinity)\n\n\t        case 'N':\n\t            read();\n\t            literal('aN');\n\t            return newToken('numeric', NaN)\n\n\t        case '\"':\n\t        case \"'\":\n\t            doubleQuote = (read() === '\"');\n\t            buffer = '';\n\t            lexState = 'string';\n\t            return\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    identifierNameStartEscape: function identifierNameStartEscape () {\n\t        if (c !== 'u') {\n\t            throw invalidChar(read())\n\t        }\n\n\t        read();\n\t        var u = unicodeEscape();\n\t        switch (u) {\n\t        case '$':\n\t        case '_':\n\t            break\n\n\t        default:\n\t            if (!util.isIdStartChar(u)) {\n\t                throw invalidIdentifier()\n\t            }\n\n\t            break\n\t        }\n\n\t        buffer += u;\n\t        lexState = 'identifierName';\n\t    },\n\n\t    identifierName: function identifierName () {\n\t        switch (c) {\n\t        case '$':\n\t        case '_':\n\t        case '\\u200C':\n\t        case '\\u200D':\n\t            buffer += read();\n\t            return\n\n\t        case '\\\\':\n\t            read();\n\t            lexState = 'identifierNameEscape';\n\t            return\n\t        }\n\n\t        if (util.isIdContinueChar(c)) {\n\t            buffer += read();\n\t            return\n\t        }\n\n\t        return newToken('identifier', buffer)\n\t    },\n\n\t    identifierNameEscape: function identifierNameEscape () {\n\t        if (c !== 'u') {\n\t            throw invalidChar(read())\n\t        }\n\n\t        read();\n\t        var u = unicodeEscape();\n\t        switch (u) {\n\t        case '$':\n\t        case '_':\n\t        case '\\u200C':\n\t        case '\\u200D':\n\t            break\n\n\t        default:\n\t            if (!util.isIdContinueChar(u)) {\n\t                throw invalidIdentifier()\n\t            }\n\n\t            break\n\t        }\n\n\t        buffer += u;\n\t        lexState = 'identifierName';\n\t    },\n\n\t    sign: function sign$1 () {\n\t        switch (c) {\n\t        case '.':\n\t            buffer = read();\n\t            lexState = 'decimalPointLeading';\n\t            return\n\n\t        case '0':\n\t            buffer = read();\n\t            lexState = 'zero';\n\t            return\n\n\t        case '1':\n\t        case '2':\n\t        case '3':\n\t        case '4':\n\t        case '5':\n\t        case '6':\n\t        case '7':\n\t        case '8':\n\t        case '9':\n\t            buffer = read();\n\t            lexState = 'decimalInteger';\n\t            return\n\n\t        case 'I':\n\t            read();\n\t            literal('nfinity');\n\t            return newToken('numeric', sign * Infinity)\n\n\t        case 'N':\n\t            read();\n\t            literal('aN');\n\t            return newToken('numeric', NaN)\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    zero: function zero () {\n\t        switch (c) {\n\t        case '.':\n\t            buffer += read();\n\t            lexState = 'decimalPoint';\n\t            return\n\n\t        case 'e':\n\t        case 'E':\n\t            buffer += read();\n\t            lexState = 'decimalExponent';\n\t            return\n\n\t        case 'x':\n\t        case 'X':\n\t            buffer += read();\n\t            lexState = 'hexadecimal';\n\t            return\n\t        }\n\n\t        return newToken('numeric', sign * 0)\n\t    },\n\n\t    decimalInteger: function decimalInteger () {\n\t        switch (c) {\n\t        case '.':\n\t            buffer += read();\n\t            lexState = 'decimalPoint';\n\t            return\n\n\t        case 'e':\n\t        case 'E':\n\t            buffer += read();\n\t            lexState = 'decimalExponent';\n\t            return\n\t        }\n\n\t        if (util.isDigit(c)) {\n\t            buffer += read();\n\t            return\n\t        }\n\n\t        return newToken('numeric', sign * Number(buffer))\n\t    },\n\n\t    decimalPointLeading: function decimalPointLeading () {\n\t        if (util.isDigit(c)) {\n\t            buffer += read();\n\t            lexState = 'decimalFraction';\n\t            return\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    decimalPoint: function decimalPoint () {\n\t        switch (c) {\n\t        case 'e':\n\t        case 'E':\n\t            buffer += read();\n\t            lexState = 'decimalExponent';\n\t            return\n\t        }\n\n\t        if (util.isDigit(c)) {\n\t            buffer += read();\n\t            lexState = 'decimalFraction';\n\t            return\n\t        }\n\n\t        return newToken('numeric', sign * Number(buffer))\n\t    },\n\n\t    decimalFraction: function decimalFraction () {\n\t        switch (c) {\n\t        case 'e':\n\t        case 'E':\n\t            buffer += read();\n\t            lexState = 'decimalExponent';\n\t            return\n\t        }\n\n\t        if (util.isDigit(c)) {\n\t            buffer += read();\n\t            return\n\t        }\n\n\t        return newToken('numeric', sign * Number(buffer))\n\t    },\n\n\t    decimalExponent: function decimalExponent () {\n\t        switch (c) {\n\t        case '+':\n\t        case '-':\n\t            buffer += read();\n\t            lexState = 'decimalExponentSign';\n\t            return\n\t        }\n\n\t        if (util.isDigit(c)) {\n\t            buffer += read();\n\t            lexState = 'decimalExponentInteger';\n\t            return\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    decimalExponentSign: function decimalExponentSign () {\n\t        if (util.isDigit(c)) {\n\t            buffer += read();\n\t            lexState = 'decimalExponentInteger';\n\t            return\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    decimalExponentInteger: function decimalExponentInteger () {\n\t        if (util.isDigit(c)) {\n\t            buffer += read();\n\t            return\n\t        }\n\n\t        return newToken('numeric', sign * Number(buffer))\n\t    },\n\n\t    hexadecimal: function hexadecimal () {\n\t        if (util.isHexDigit(c)) {\n\t            buffer += read();\n\t            lexState = 'hexadecimalInteger';\n\t            return\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    hexadecimalInteger: function hexadecimalInteger () {\n\t        if (util.isHexDigit(c)) {\n\t            buffer += read();\n\t            return\n\t        }\n\n\t        return newToken('numeric', sign * Number(buffer))\n\t    },\n\n\t    string: function string () {\n\t        switch (c) {\n\t        case '\\\\':\n\t            read();\n\t            buffer += escape();\n\t            return\n\n\t        case '\"':\n\t            if (doubleQuote) {\n\t                read();\n\t                return newToken('string', buffer)\n\t            }\n\n\t            buffer += read();\n\t            return\n\n\t        case \"'\":\n\t            if (!doubleQuote) {\n\t                read();\n\t                return newToken('string', buffer)\n\t            }\n\n\t            buffer += read();\n\t            return\n\n\t        case '\\n':\n\t        case '\\r':\n\t            throw invalidChar(read())\n\n\t        case '\\u2028':\n\t        case '\\u2029':\n\t            separatorChar(c);\n\t            break\n\n\t        case undefined:\n\t            throw invalidChar(read())\n\t        }\n\n\t        buffer += read();\n\t    },\n\n\t    start: function start () {\n\t        switch (c) {\n\t        case '{':\n\t        case '[':\n\t            return newToken('punctuator', read())\n\n\t        // This code is unreachable since the default lexState handles eof.\n\t        // case undefined:\n\t        //     return newToken('eof')\n\t        }\n\n\t        lexState = 'value';\n\t    },\n\n\t    beforePropertyName: function beforePropertyName () {\n\t        switch (c) {\n\t        case '$':\n\t        case '_':\n\t            buffer = read();\n\t            lexState = 'identifierName';\n\t            return\n\n\t        case '\\\\':\n\t            read();\n\t            lexState = 'identifierNameStartEscape';\n\t            return\n\n\t        case '}':\n\t            return newToken('punctuator', read())\n\n\t        case '\"':\n\t        case \"'\":\n\t            doubleQuote = (read() === '\"');\n\t            lexState = 'string';\n\t            return\n\t        }\n\n\t        if (util.isIdStartChar(c)) {\n\t            buffer += read();\n\t            lexState = 'identifierName';\n\t            return\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    afterPropertyName: function afterPropertyName () {\n\t        if (c === ':') {\n\t            return newToken('punctuator', read())\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    beforePropertyValue: function beforePropertyValue () {\n\t        lexState = 'value';\n\t    },\n\n\t    afterPropertyValue: function afterPropertyValue () {\n\t        switch (c) {\n\t        case ',':\n\t        case '}':\n\t            return newToken('punctuator', read())\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    beforeArrayValue: function beforeArrayValue () {\n\t        if (c === ']') {\n\t            return newToken('punctuator', read())\n\t        }\n\n\t        lexState = 'value';\n\t    },\n\n\t    afterArrayValue: function afterArrayValue () {\n\t        switch (c) {\n\t        case ',':\n\t        case ']':\n\t            return newToken('punctuator', read())\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    end: function end () {\n\t        // This code is unreachable since it's handled by the default lexState.\n\t        // if (c === undefined) {\n\t        //     read()\n\t        //     return newToken('eof')\n\t        // }\n\n\t        throw invalidChar(read())\n\t    },\n\t};\n\n\tfunction newToken (type, value) {\n\t    return {\n\t        type: type,\n\t        value: value,\n\t        line: line,\n\t        column: column,\n\t    }\n\t}\n\n\tfunction literal (s) {\n\t    for (var i = 0, list = s; i < list.length; i += 1) {\n\t        var c = list[i];\n\n\t        var p = peek();\n\n\t        if (p !== c) {\n\t            throw invalidChar(read())\n\t        }\n\n\t        read();\n\t    }\n\t}\n\n\tfunction escape () {\n\t    var c = peek();\n\t    switch (c) {\n\t    case 'b':\n\t        read();\n\t        return '\\b'\n\n\t    case 'f':\n\t        read();\n\t        return '\\f'\n\n\t    case 'n':\n\t        read();\n\t        return '\\n'\n\n\t    case 'r':\n\t        read();\n\t        return '\\r'\n\n\t    case 't':\n\t        read();\n\t        return '\\t'\n\n\t    case 'v':\n\t        read();\n\t        return '\\v'\n\n\t    case '0':\n\t        read();\n\t        if (util.isDigit(peek())) {\n\t            throw invalidChar(read())\n\t        }\n\n\t        return '\\0'\n\n\t    case 'x':\n\t        read();\n\t        return hexEscape()\n\n\t    case 'u':\n\t        read();\n\t        return unicodeEscape()\n\n\t    case '\\n':\n\t    case '\\u2028':\n\t    case '\\u2029':\n\t        read();\n\t        return ''\n\n\t    case '\\r':\n\t        read();\n\t        if (peek() === '\\n') {\n\t            read();\n\t        }\n\n\t        return ''\n\n\t    case '1':\n\t    case '2':\n\t    case '3':\n\t    case '4':\n\t    case '5':\n\t    case '6':\n\t    case '7':\n\t    case '8':\n\t    case '9':\n\t        throw invalidChar(read())\n\n\t    case undefined:\n\t        throw invalidChar(read())\n\t    }\n\n\t    return read()\n\t}\n\n\tfunction hexEscape () {\n\t    var buffer = '';\n\t    var c = peek();\n\n\t    if (!util.isHexDigit(c)) {\n\t        throw invalidChar(read())\n\t    }\n\n\t    buffer += read();\n\n\t    c = peek();\n\t    if (!util.isHexDigit(c)) {\n\t        throw invalidChar(read())\n\t    }\n\n\t    buffer += read();\n\n\t    return String.fromCodePoint(parseInt(buffer, 16))\n\t}\n\n\tfunction unicodeEscape () {\n\t    var buffer = '';\n\t    var count = 4;\n\n\t    while (count-- > 0) {\n\t        var c = peek();\n\t        if (!util.isHexDigit(c)) {\n\t            throw invalidChar(read())\n\t        }\n\n\t        buffer += read();\n\t    }\n\n\t    return String.fromCodePoint(parseInt(buffer, 16))\n\t}\n\n\tvar parseStates = {\n\t    start: function start () {\n\t        if (token.type === 'eof') {\n\t            throw invalidEOF()\n\t        }\n\n\t        push();\n\t    },\n\n\t    beforePropertyName: function beforePropertyName () {\n\t        switch (token.type) {\n\t        case 'identifier':\n\t        case 'string':\n\t            key = token.value;\n\t            parseState = 'afterPropertyName';\n\t            return\n\n\t        case 'punctuator':\n\t            // This code is unreachable since it's handled by the lexState.\n\t            // if (token.value !== '}') {\n\t            //     throw invalidToken()\n\t            // }\n\n\t            pop();\n\t            return\n\n\t        case 'eof':\n\t            throw invalidEOF()\n\t        }\n\n\t        // This code is unreachable since it's handled by the lexState.\n\t        // throw invalidToken()\n\t    },\n\n\t    afterPropertyName: function afterPropertyName () {\n\t        // This code is unreachable since it's handled by the lexState.\n\t        // if (token.type !== 'punctuator' || token.value !== ':') {\n\t        //     throw invalidToken()\n\t        // }\n\n\t        if (token.type === 'eof') {\n\t            throw invalidEOF()\n\t        }\n\n\t        parseState = 'beforePropertyValue';\n\t    },\n\n\t    beforePropertyValue: function beforePropertyValue () {\n\t        if (token.type === 'eof') {\n\t            throw invalidEOF()\n\t        }\n\n\t        push();\n\t    },\n\n\t    beforeArrayValue: function beforeArrayValue () {\n\t        if (token.type === 'eof') {\n\t            throw invalidEOF()\n\t        }\n\n\t        if (token.type === 'punctuator' && token.value === ']') {\n\t            pop();\n\t            return\n\t        }\n\n\t        push();\n\t    },\n\n\t    afterPropertyValue: function afterPropertyValue () {\n\t        // This code is unreachable since it's handled by the lexState.\n\t        // if (token.type !== 'punctuator') {\n\t        //     throw invalidToken()\n\t        // }\n\n\t        if (token.type === 'eof') {\n\t            throw invalidEOF()\n\t        }\n\n\t        switch (token.value) {\n\t        case ',':\n\t            parseState = 'beforePropertyName';\n\t            return\n\n\t        case '}':\n\t            pop();\n\t        }\n\n\t        // This code is unreachable since it's handled by the lexState.\n\t        // throw invalidToken()\n\t    },\n\n\t    afterArrayValue: function afterArrayValue () {\n\t        // This code is unreachable since it's handled by the lexState.\n\t        // if (token.type !== 'punctuator') {\n\t        //     throw invalidToken()\n\t        // }\n\n\t        if (token.type === 'eof') {\n\t            throw invalidEOF()\n\t        }\n\n\t        switch (token.value) {\n\t        case ',':\n\t            parseState = 'beforeArrayValue';\n\t            return\n\n\t        case ']':\n\t            pop();\n\t        }\n\n\t        // This code is unreachable since it's handled by the lexState.\n\t        // throw invalidToken()\n\t    },\n\n\t    end: function end () {\n\t        // This code is unreachable since it's handled by the lexState.\n\t        // if (token.type !== 'eof') {\n\t        //     throw invalidToken()\n\t        // }\n\t    },\n\t};\n\n\tfunction push () {\n\t    var value;\n\n\t    switch (token.type) {\n\t    case 'punctuator':\n\t        switch (token.value) {\n\t        case '{':\n\t            value = {};\n\t            break\n\n\t        case '[':\n\t            value = [];\n\t            break\n\t        }\n\n\t        break\n\n\t    case 'null':\n\t    case 'boolean':\n\t    case 'numeric':\n\t    case 'string':\n\t        value = token.value;\n\t        break\n\n\t    // This code is unreachable.\n\t    // default:\n\t    //     throw invalidToken()\n\t    }\n\n\t    if (root === undefined) {\n\t        root = value;\n\t    } else {\n\t        var parent = stack[stack.length - 1];\n\t        if (Array.isArray(parent)) {\n\t            parent.push(value);\n\t        } else {\n\t            Object.defineProperty(parent, key, {\n\t                value: value,\n\t                writable: true,\n\t                enumerable: true,\n\t                configurable: true,\n\t            });\n\t        }\n\t    }\n\n\t    if (value !== null && typeof value === 'object') {\n\t        stack.push(value);\n\n\t        if (Array.isArray(value)) {\n\t            parseState = 'beforeArrayValue';\n\t        } else {\n\t            parseState = 'beforePropertyName';\n\t        }\n\t    } else {\n\t        var current = stack[stack.length - 1];\n\t        if (current == null) {\n\t            parseState = 'end';\n\t        } else if (Array.isArray(current)) {\n\t            parseState = 'afterArrayValue';\n\t        } else {\n\t            parseState = 'afterPropertyValue';\n\t        }\n\t    }\n\t}\n\n\tfunction pop () {\n\t    stack.pop();\n\n\t    var current = stack[stack.length - 1];\n\t    if (current == null) {\n\t        parseState = 'end';\n\t    } else if (Array.isArray(current)) {\n\t        parseState = 'afterArrayValue';\n\t    } else {\n\t        parseState = 'afterPropertyValue';\n\t    }\n\t}\n\n\t// This code is unreachable.\n\t// function invalidParseState () {\n\t//     return new Error(`JSON5: invalid parse state '${parseState}'`)\n\t// }\n\n\t// This code is unreachable.\n\t// function invalidLexState (state) {\n\t//     return new Error(`JSON5: invalid lex state '${state}'`)\n\t// }\n\n\tfunction invalidChar (c) {\n\t    if (c === undefined) {\n\t        return syntaxError((\"JSON5: invalid end of input at \" + line + \":\" + column))\n\t    }\n\n\t    return syntaxError((\"JSON5: invalid character '\" + (formatChar(c)) + \"' at \" + line + \":\" + column))\n\t}\n\n\tfunction invalidEOF () {\n\t    return syntaxError((\"JSON5: invalid end of input at \" + line + \":\" + column))\n\t}\n\n\t// This code is unreachable.\n\t// function invalidToken () {\n\t//     if (token.type === 'eof') {\n\t//         return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)\n\t//     }\n\n\t//     const c = String.fromCodePoint(token.value.codePointAt(0))\n\t//     return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`)\n\t// }\n\n\tfunction invalidIdentifier () {\n\t    column -= 5;\n\t    return syntaxError((\"JSON5: invalid identifier character at \" + line + \":\" + column))\n\t}\n\n\tfunction separatorChar (c) {\n\t    console.warn((\"JSON5: '\" + (formatChar(c)) + \"' in strings is not valid ECMAScript; consider escaping\"));\n\t}\n\n\tfunction formatChar (c) {\n\t    var replacements = {\n\t        \"'\": \"\\\\'\",\n\t        '\"': '\\\\\"',\n\t        '\\\\': '\\\\\\\\',\n\t        '\\b': '\\\\b',\n\t        '\\f': '\\\\f',\n\t        '\\n': '\\\\n',\n\t        '\\r': '\\\\r',\n\t        '\\t': '\\\\t',\n\t        '\\v': '\\\\v',\n\t        '\\0': '\\\\0',\n\t        '\\u2028': '\\\\u2028',\n\t        '\\u2029': '\\\\u2029',\n\t    };\n\n\t    if (replacements[c]) {\n\t        return replacements[c]\n\t    }\n\n\t    if (c < ' ') {\n\t        var hexString = c.charCodeAt(0).toString(16);\n\t        return '\\\\x' + ('00' + hexString).substring(hexString.length)\n\t    }\n\n\t    return c\n\t}\n\n\tfunction syntaxError (message) {\n\t    var err = new SyntaxError(message);\n\t    err.lineNumber = line;\n\t    err.columnNumber = column;\n\t    return err\n\t}\n\n\tvar stringify = function stringify (value, replacer, space) {\n\t    var stack = [];\n\t    var indent = '';\n\t    var propertyList;\n\t    var replacerFunc;\n\t    var gap = '';\n\t    var quote;\n\n\t    if (\n\t        replacer != null &&\n\t        typeof replacer === 'object' &&\n\t        !Array.isArray(replacer)\n\t    ) {\n\t        space = replacer.space;\n\t        quote = replacer.quote;\n\t        replacer = replacer.replacer;\n\t    }\n\n\t    if (typeof replacer === 'function') {\n\t        replacerFunc = replacer;\n\t    } else if (Array.isArray(replacer)) {\n\t        propertyList = [];\n\t        for (var i = 0, list = replacer; i < list.length; i += 1) {\n\t            var v = list[i];\n\n\t            var item = (void 0);\n\n\t            if (typeof v === 'string') {\n\t                item = v;\n\t            } else if (\n\t                typeof v === 'number' ||\n\t                v instanceof String ||\n\t                v instanceof Number\n\t            ) {\n\t                item = String(v);\n\t            }\n\n\t            if (item !== undefined && propertyList.indexOf(item) < 0) {\n\t                propertyList.push(item);\n\t            }\n\t        }\n\t    }\n\n\t    if (space instanceof Number) {\n\t        space = Number(space);\n\t    } else if (space instanceof String) {\n\t        space = String(space);\n\t    }\n\n\t    if (typeof space === 'number') {\n\t        if (space > 0) {\n\t            space = Math.min(10, Math.floor(space));\n\t            gap = '          '.substr(0, space);\n\t        }\n\t    } else if (typeof space === 'string') {\n\t        gap = space.substr(0, 10);\n\t    }\n\n\t    return serializeProperty('', {'': value})\n\n\t    function serializeProperty (key, holder) {\n\t        var value = holder[key];\n\t        if (value != null) {\n\t            if (typeof value.toJSON5 === 'function') {\n\t                value = value.toJSON5(key);\n\t            } else if (typeof value.toJSON === 'function') {\n\t                value = value.toJSON(key);\n\t            }\n\t        }\n\n\t        if (replacerFunc) {\n\t            value = replacerFunc.call(holder, key, value);\n\t        }\n\n\t        if (value instanceof Number) {\n\t            value = Number(value);\n\t        } else if (value instanceof String) {\n\t            value = String(value);\n\t        } else if (value instanceof Boolean) {\n\t            value = value.valueOf();\n\t        }\n\n\t        switch (value) {\n\t        case null: return 'null'\n\t        case true: return 'true'\n\t        case false: return 'false'\n\t        }\n\n\t        if (typeof value === 'string') {\n\t            return quoteString(value, false)\n\t        }\n\n\t        if (typeof value === 'number') {\n\t            return String(value)\n\t        }\n\n\t        if (typeof value === 'object') {\n\t            return Array.isArray(value) ? serializeArray(value) : serializeObject(value)\n\t        }\n\n\t        return undefined\n\t    }\n\n\t    function quoteString (value) {\n\t        var quotes = {\n\t            \"'\": 0.1,\n\t            '\"': 0.2,\n\t        };\n\n\t        var replacements = {\n\t            \"'\": \"\\\\'\",\n\t            '\"': '\\\\\"',\n\t            '\\\\': '\\\\\\\\',\n\t            '\\b': '\\\\b',\n\t            '\\f': '\\\\f',\n\t            '\\n': '\\\\n',\n\t            '\\r': '\\\\r',\n\t            '\\t': '\\\\t',\n\t            '\\v': '\\\\v',\n\t            '\\0': '\\\\0',\n\t            '\\u2028': '\\\\u2028',\n\t            '\\u2029': '\\\\u2029',\n\t        };\n\n\t        var product = '';\n\n\t        for (var i = 0; i < value.length; i++) {\n\t            var c = value[i];\n\t            switch (c) {\n\t            case \"'\":\n\t            case '\"':\n\t                quotes[c]++;\n\t                product += c;\n\t                continue\n\n\t            case '\\0':\n\t                if (util.isDigit(value[i + 1])) {\n\t                    product += '\\\\x00';\n\t                    continue\n\t                }\n\t            }\n\n\t            if (replacements[c]) {\n\t                product += replacements[c];\n\t                continue\n\t            }\n\n\t            if (c < ' ') {\n\t                var hexString = c.charCodeAt(0).toString(16);\n\t                product += '\\\\x' + ('00' + hexString).substring(hexString.length);\n\t                continue\n\t            }\n\n\t            product += c;\n\t        }\n\n\t        var quoteChar = quote || Object.keys(quotes).reduce(function (a, b) { return (quotes[a] < quotes[b]) ? a : b; });\n\n\t        product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]);\n\n\t        return quoteChar + product + quoteChar\n\t    }\n\n\t    function serializeObject (value) {\n\t        if (stack.indexOf(value) >= 0) {\n\t            throw TypeError('Converting circular structure to JSON5')\n\t        }\n\n\t        stack.push(value);\n\n\t        var stepback = indent;\n\t        indent = indent + gap;\n\n\t        var keys = propertyList || Object.keys(value);\n\t        var partial = [];\n\t        for (var i = 0, list = keys; i < list.length; i += 1) {\n\t            var key = list[i];\n\n\t            var propertyString = serializeProperty(key, value);\n\t            if (propertyString !== undefined) {\n\t                var member = serializeKey(key) + ':';\n\t                if (gap !== '') {\n\t                    member += ' ';\n\t                }\n\t                member += propertyString;\n\t                partial.push(member);\n\t            }\n\t        }\n\n\t        var final;\n\t        if (partial.length === 0) {\n\t            final = '{}';\n\t        } else {\n\t            var properties;\n\t            if (gap === '') {\n\t                properties = partial.join(',');\n\t                final = '{' + properties + '}';\n\t            } else {\n\t                var separator = ',\\n' + indent;\n\t                properties = partial.join(separator);\n\t                final = '{\\n' + indent + properties + ',\\n' + stepback + '}';\n\t            }\n\t        }\n\n\t        stack.pop();\n\t        indent = stepback;\n\t        return final\n\t    }\n\n\t    function serializeKey (key) {\n\t        if (key.length === 0) {\n\t            return quoteString(key, true)\n\t        }\n\n\t        var firstChar = String.fromCodePoint(key.codePointAt(0));\n\t        if (!util.isIdStartChar(firstChar)) {\n\t            return quoteString(key, true)\n\t        }\n\n\t        for (var i = firstChar.length; i < key.length; i++) {\n\t            if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {\n\t                return quoteString(key, true)\n\t            }\n\t        }\n\n\t        return key\n\t    }\n\n\t    function serializeArray (value) {\n\t        if (stack.indexOf(value) >= 0) {\n\t            throw TypeError('Converting circular structure to JSON5')\n\t        }\n\n\t        stack.push(value);\n\n\t        var stepback = indent;\n\t        indent = indent + gap;\n\n\t        var partial = [];\n\t        for (var i = 0; i < value.length; i++) {\n\t            var propertyString = serializeProperty(String(i), value);\n\t            partial.push((propertyString !== undefined) ? propertyString : 'null');\n\t        }\n\n\t        var final;\n\t        if (partial.length === 0) {\n\t            final = '[]';\n\t        } else {\n\t            if (gap === '') {\n\t                var properties = partial.join(',');\n\t                final = '[' + properties + ']';\n\t            } else {\n\t                var separator = ',\\n' + indent;\n\t                var properties$1 = partial.join(separator);\n\t                final = '[\\n' + indent + properties$1 + ',\\n' + stepback + ']';\n\t            }\n\t        }\n\n\t        stack.pop();\n\t        indent = stepback;\n\t        return final\n\t    }\n\t};\n\n\tvar JSON5 = {\n\t    parse: parse,\n\t    stringify: stringify,\n\t};\n\n\tvar lib = JSON5;\n\n\tvar es5 = lib;\n\n\treturn es5;\n\n})));\n","// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { access, cp, readFile, stat, writeFile } from \"node:fs/promises\";\nimport { randomBytes } from \"node:crypto\";\nimport { basename, dirname, join } from \"node:path\";\n\nimport { parse } from \"json5\";\n\n/**\n * Fixed byte size reserved in muon-core for an embedded muon.json payload.\n */\nexport const muonEmbeddedConfigSlotSize = 64 * 1024;\n\n/**\n * Fixed byte sequence used to locate an unembedded config slot.\n */\nconst muonEmbeddedConfigEmptySlotMarker = Buffer.from([\n  0x6d, 0x75, 0x6f, 0x6e, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x3a, 0x65, 0x6d, 0x62,\n  0x65, 0x64, 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3a, 0x73, 0x6c, 0x6f,\n  0x74, 0x3a, 0x76, 0x31, 0x00, 0x5d,\n]);\n\nconst muonEmbeddedConfigPayloadCapacity = muonEmbeddedConfigSlotSize;\nconst muonBootstrapEmbeddedConfigSlotSize = 64 * 1024;\nconst muonBootstrapEmbeddedConfigEmptySlotMarker = Buffer.from([\n  0x6d, 0x75, 0x6f, 0x6e, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61,\n  0x70, 0x3a, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x69,\n  0x67, 0x3a, 0x76, 0x31, 0x00, 0x5d,\n]);\nconst muonBootstrapEmbeddedConfigPayloadCapacity =\n  muonBootstrapEmbeddedConfigSlotSize;\n\nconst tlvNullTag = 0;\nconst tlvFalseTag = 1;\nconst tlvTrueTag = 2;\nconst tlvUintTag = 3;\nconst tlvStringTag = 4;\nconst tlvBinaryTag = 5;\nconst tlvArrayTag = 6;\nconst tlvObjectTag = 7;\n\n/**\n * Result returned by a muon executable config embedding operation.\n */\nexport interface EmbedMuonConfigResult {\n  /** Input executable path. For bootstrap embedding this is the bootstrap path. */\n  readonly corePath: string;\n  /** Written executable path. */\n  readonly outputPath: string;\n  /** Byte offset of the fixed embedded config slot. */\n  readonly slotOffset: number;\n  /** Encoded TLV payload size in bytes. */\n  readonly payloadSize: number;\n  /** Whether an existing embedded payload was replaced. Always false. */\n  readonly replaced: boolean;\n}\n\n/**\n * Options for embedding a config into a single muon-core executable.\n */\nexport interface EmbedMuonConfigCoreOptions {\n  /** muon-core executable path to patch. */\n  readonly corePath: string;\n  /** muon.json, muon.json5, or muon.jsonc input path. */\n  readonly configPath: string;\n  /** Optional output executable path. When omitted, corePath is updated. */\n  readonly outputPath: string | undefined;\n}\n\n/**\n * Options for embedding a config into a single muon-bootstrap executable.\n */\nexport interface EmbedMuonConfigBootstrapOptions {\n  /** muon-bootstrap executable path to patch. */\n  readonly bootstrapPath: string;\n  /** muon.json, muon.json5, or muon.jsonc input path. */\n  readonly configPath: string;\n  /** Optional output executable path. When omitted, bootstrapPath is updated. */\n  readonly outputPath: string | undefined;\n}\n\n/**\n * Options for embedding a config into a runtime directory.\n */\nexport interface EmbedMuonConfigRuntimeOptions {\n  /** Runtime directory containing muon-core or muon-core.exe. */\n  readonly runtimePath: string;\n  /** muon.json, muon.json5, or muon.jsonc input path. */\n  readonly configPath: string;\n  /** Optional output runtime directory. When omitted, runtimePath is updated. */\n  readonly outputRuntimePath: string | undefined;\n}\n\n/**\n * Unembedded config slot found in a muon-core executable.\n */\nexport interface MuonEmbeddedConfigSlot {\n  /** Empty slot state. */\n  readonly state: \"empty\";\n  /** Byte offset of the slot. */\n  readonly offset: number;\n  /** Empty payload. */\n  readonly payload: Buffer;\n  /** Payload byte size. */\n  readonly payloadSize: 0;\n}\n\n/**\n * Unembedded bootstrap config slot found in a muon-bootstrap executable.\n */\nexport interface MuonBootstrapEmbeddedConfigSlot {\n  /** Empty slot state. */\n  readonly state: \"empty\";\n  /** Byte offset of the slot. */\n  readonly offset: number;\n  /** Empty payload. */\n  readonly payload: Buffer;\n  /** Payload byte size. */\n  readonly payloadSize: 0;\n}\n\nconst getEmbeddedConfigEmptySlotByte = (index: number): number => {\n  if (index < muonEmbeddedConfigEmptySlotMarker.length) {\n    return muonEmbeddedConfigEmptySlotMarker[index] ?? 0;\n  }\n  const value =\n    0xa5 ^\n    Math.imul(index, 0x25) ^\n    Math.imul(index >>> 8, 0x6d) ^\n    Math.imul(index >>> 16, 0x3b) ^\n    (Math.imul(index, 0x9e3779b1) >>> 24);\n  return value & 0xff;\n};\n\nconst createEmptySlot = (): Buffer => {\n  const slot = Buffer.allocUnsafe(muonEmbeddedConfigSlotSize);\n  for (let index = 0; index < slot.length; index += 1) {\n    slot[index] = getEmbeddedConfigEmptySlotByte(index);\n  }\n  return slot;\n};\n\nconst encodeVarUint = (value: bigint): Buffer => {\n  const bytes: number[] = [];\n  let remaining = value;\n  do {\n    let byte = Number(remaining & 0x7fn);\n    remaining >>= 7n;\n    if (remaining !== 0n) {\n      byte |= 0x80;\n    }\n    bytes.push(byte);\n  } while (remaining !== 0n);\n  return Buffer.from(bytes);\n};\n\nconst encodeRawString = (value: string): Buffer => {\n  const bytes = Buffer.from(value, \"utf8\");\n  return Buffer.concat([encodeVarUint(BigInt(bytes.length)), bytes]);\n};\n\nconst encodeTaggedBytes = (tag: number, bytes: Uint8Array): Buffer =>\n  Buffer.concat([\n    Buffer.from([tag]),\n    encodeVarUint(BigInt(bytes.length)),\n    Buffer.from(bytes),\n  ]);\n\nconst isJsonObject = (value: unknown): value is Record<string, unknown> =>\n  typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst isPath = (\n  path: readonly string[],\n  first: string,\n  second: string,\n): boolean => path.length === 2 && path[0] === first && path[1] === second;\n\nconst isPluginSignaturePath = (path: readonly string[]): boolean =>\n  path.length === 3 &&\n  path[0] === \"plugin\" &&\n  path[1] === \"plugins\" &&\n  path[2] === \"signature\";\n\nconst isPluginSaltPath = (path: readonly string[]): boolean =>\n  path.length === 3 &&\n  path[0] === \"plugin\" &&\n  path[1] === \"plugins\" &&\n  path[2] === \"salt\";\n\nconst isHexString = (value: string): boolean =>\n  value.length % 2 === 0 && /^[0-9a-fA-F]*$/.test(value);\n\nconst decodeHexString = (value: string): Buffer => {\n  const bytes = Buffer.alloc(value.length / 2);\n  for (let index = 0; index < value.length; index += 2) {\n    bytes[index / 2] = Number.parseInt(value.slice(index, index + 2), 16);\n  }\n  return bytes;\n};\n\nconst encodeKnownBinaryString = (\n  path: readonly string[],\n  value: string,\n): Buffer | undefined => {\n  if (isPath(path, \"asset\", \"signature\")) {\n    return value.length === 40 && isHexString(value)\n      ? decodeHexString(value)\n      : undefined;\n  }\n  if (isPath(path, \"asset\", \"salt\")) {\n    return isHexString(value) ? decodeHexString(value) : undefined;\n  }\n  if (isPluginSignaturePath(path)) {\n    return value.length === 40 && isHexString(value)\n      ? decodeHexString(value)\n      : undefined;\n  }\n  if (isPluginSaltPath(path)) {\n    return isHexString(value) ? decodeHexString(value) : undefined;\n  }\n  if (isPath(path, \"browser\", \"backgroundColor\")) {\n    const hex = value.startsWith(\"#\") ? value.slice(1) : value;\n    return hex.length === 6 && isHexString(hex)\n      ? decodeHexString(hex)\n      : undefined;\n  }\n  return undefined;\n};\n\nconst encodeTlvValue = (value: unknown, path: readonly string[]): Buffer => {\n  if (value === null) {\n    return Buffer.from([tlvNullTag]);\n  }\n  if (typeof value === \"boolean\") {\n    return Buffer.from([value ? tlvTrueTag : tlvFalseTag]);\n  }\n  if (typeof value === \"number\") {\n    if (!Number.isSafeInteger(value) || value < 0) {\n      throw new Error(\"muon embedded config supports only unsigned integers.\");\n    }\n    return Buffer.concat([\n      Buffer.from([tlvUintTag]),\n      encodeVarUint(BigInt(value)),\n    ]);\n  }\n  if (typeof value === \"string\") {\n    const binaryValue = encodeKnownBinaryString(path, value);\n    if (binaryValue !== undefined) {\n      return encodeTaggedBytes(tlvBinaryTag, binaryValue);\n    }\n    return encodeTaggedBytes(tlvStringTag, Buffer.from(value, \"utf8\"));\n  }\n  if (Array.isArray(value)) {\n    return Buffer.concat([\n      Buffer.from([tlvArrayTag]),\n      encodeVarUint(BigInt(value.length)),\n      ...value.map((entry) => encodeTlvValue(entry, path)),\n    ]);\n  }\n  if (isJsonObject(value)) {\n    const entries = Object.entries(value);\n    return Buffer.concat([\n      Buffer.from([tlvObjectTag]),\n      encodeVarUint(BigInt(entries.length)),\n      ...entries.flatMap(([key, entry]) => [\n        encodeRawString(key),\n        encodeTlvValue(entry, [...path, key]),\n      ]),\n    ]);\n  }\n  throw new Error(\"muon embedded config contains an unsupported value.\");\n};\n\n/**\n * Encodes a parsed muon config object as the embedded TLV payload.\n *\n * @param config Parsed muon config value.\n * @returns Encoded TLV payload bytes.\n */\nexport const encodeMuonConfigTlv = (config: unknown): Buffer =>\n  encodeTlvValue(config, []);\n\n/**\n * Creates an empty or payload-filled fixed embedded config slot.\n *\n * @param payload Optional encoded TLV payload bytes.\n * @returns Fixed-size slot image.\n */\nexport const createMuonEmbeddedConfigSlot = (\n  payload: Uint8Array | undefined = undefined,\n): Buffer => {\n  if (\n    payload !== undefined &&\n    payload.length > muonEmbeddedConfigPayloadCapacity\n  ) {\n    throw new Error(\n      `Encoded muon config exceeds the embedded slot capacity: ${payload.length} > ${muonEmbeddedConfigPayloadCapacity}`,\n    );\n  }\n\n  if (payload === undefined) {\n    return createEmptySlot();\n  }\n\n  const slot = randomBytes(muonEmbeddedConfigSlotSize);\n  Buffer.from(payload).copy(slot, 0);\n  return slot;\n};\n\n/**\n * Creates an empty or payload-filled fixed muon-bootstrap embedded config slot.\n *\n * @param payload Optional encoded TLV payload bytes.\n * @returns Fixed-size slot image.\n */\nexport const createMuonBootstrapEmbeddedConfigSlot = (\n  payload: Uint8Array | undefined = undefined,\n): Buffer => {\n  if (\n    payload !== undefined &&\n    payload.length > muonBootstrapEmbeddedConfigPayloadCapacity\n  ) {\n    throw new Error(\n      `Encoded muon config exceeds the embedded bootstrap slot capacity: ${payload.length} > ${muonBootstrapEmbeddedConfigPayloadCapacity}`,\n    );\n  }\n\n  if (payload === undefined) {\n    const slot = Buffer.alloc(muonBootstrapEmbeddedConfigSlotSize, 0);\n    muonBootstrapEmbeddedConfigEmptySlotMarker.copy(slot, 0);\n    return slot;\n  }\n\n  const slot = randomBytes(muonBootstrapEmbeddedConfigSlotSize);\n  Buffer.from(payload).copy(slot, 0);\n  return slot;\n};\n\nconst isEmptySlotAt = (content: Buffer, offset: number): boolean => {\n  for (let index = 0; index < muonEmbeddedConfigSlotSize; index += 1) {\n    if (content[offset + index] !== getEmbeddedConfigEmptySlotByte(index)) {\n      return false;\n    }\n  }\n  return true;\n};\n\nconst inspectUnembeddedSlotAt = (\n  content: Buffer,\n  offset: number,\n): MuonEmbeddedConfigSlot | undefined => {\n  if (offset < 0 || offset + muonEmbeddedConfigSlotSize > content.length) {\n    return undefined;\n  }\n  if (isEmptySlotAt(content, offset)) {\n    return {\n      state: \"empty\",\n      offset,\n      payload: Buffer.alloc(0),\n      payloadSize: 0,\n    };\n  }\n  return undefined;\n};\n\nconst collectSlotCandidates = (content: Buffer): MuonEmbeddedConfigSlot[] => {\n  const candidates = new Map<number, MuonEmbeddedConfigSlot>();\n  for (\n    let offset = content.indexOf(muonEmbeddedConfigEmptySlotMarker);\n    offset >= 0;\n    offset = content.indexOf(muonEmbeddedConfigEmptySlotMarker, offset + 1)\n  ) {\n    const slot = inspectUnembeddedSlotAt(content, offset);\n    if (slot !== undefined) {\n      candidates.set(slot.offset, slot);\n    }\n  }\n  return [...candidates.values()].sort(\n    (left, right) => left.offset - right.offset,\n  );\n};\n\nconst isEmptyBootstrapSlotAt = (content: Buffer, offset: number): boolean => {\n  if (\n    offset < 0 ||\n    offset + muonBootstrapEmbeddedConfigSlotSize > content.length\n  ) {\n    return false;\n  }\n  if (\n    !content\n      .subarray(\n        offset,\n        offset + muonBootstrapEmbeddedConfigEmptySlotMarker.length,\n      )\n      .equals(muonBootstrapEmbeddedConfigEmptySlotMarker)\n  ) {\n    return false;\n  }\n  for (\n    let index = muonBootstrapEmbeddedConfigEmptySlotMarker.length;\n    index < muonBootstrapEmbeddedConfigSlotSize;\n    index += 1\n  ) {\n    if (content[offset + index] !== 0) {\n      return false;\n    }\n  }\n  return true;\n};\n\nconst inspectUnembeddedBootstrapSlotAt = (\n  content: Buffer,\n  offset: number,\n): MuonBootstrapEmbeddedConfigSlot | undefined => {\n  if (!isEmptyBootstrapSlotAt(content, offset)) {\n    return undefined;\n  }\n  return {\n    state: \"empty\",\n    offset,\n    payload: Buffer.alloc(0),\n    payloadSize: 0,\n  };\n};\n\nconst collectBootstrapSlotCandidates = (\n  content: Buffer,\n): MuonBootstrapEmbeddedConfigSlot[] => {\n  const candidates = new Map<number, MuonBootstrapEmbeddedConfigSlot>();\n  for (\n    let offset = content.indexOf(muonBootstrapEmbeddedConfigEmptySlotMarker);\n    offset >= 0;\n    offset = content.indexOf(\n      muonBootstrapEmbeddedConfigEmptySlotMarker,\n      offset + 1,\n    )\n  ) {\n    const slot = inspectUnembeddedBootstrapSlotAt(content, offset);\n    if (slot !== undefined) {\n      candidates.set(slot.offset, slot);\n    }\n  }\n  return [...candidates.values()].sort(\n    (left, right) => left.offset - right.offset,\n  );\n};\n\n/**\n * Finds the fixed unembedded config slot in a muon-core executable image.\n *\n * @param content muon-core executable bytes.\n * @returns The single detected unembedded config slot.\n */\nexport const findMuonEmbeddedConfigSlot = (\n  content: Uint8Array,\n): MuonEmbeddedConfigSlot => {\n  const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content);\n  const candidates = collectSlotCandidates(buffer);\n  if (candidates.length !== 1) {\n    throw new Error(\n      `Expected exactly one unembedded muon config slot, found ${candidates.length}.`,\n    );\n  }\n  const [candidate] = candidates;\n  if (candidate === undefined) {\n    throw new Error(\"Embedded muon config slot was not found.\");\n  }\n  return candidate;\n};\n\n/**\n * Finds the fixed unembedded config slot in a muon-bootstrap executable image.\n *\n * @param content muon-bootstrap executable bytes.\n * @returns The single detected unembedded bootstrap config slot.\n */\nexport const findMuonBootstrapEmbeddedConfigSlot = (\n  content: Uint8Array,\n): MuonBootstrapEmbeddedConfigSlot => {\n  const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content);\n  const candidates = collectBootstrapSlotCandidates(buffer);\n  if (candidates.length !== 1) {\n    throw new Error(\n      `Expected exactly one unembedded muon-bootstrap config slot, found ${candidates.length}.`,\n    );\n  }\n  const [candidate] = candidates;\n  if (candidate === undefined) {\n    throw new Error(\"Embedded muon-bootstrap config slot was not found.\");\n  }\n  return candidate;\n};\n\nconst fileExists = async (path: string): Promise<boolean> => {\n  try {\n    const stats = await stat(path);\n    return stats.isFile();\n  } catch {\n    return false;\n  }\n};\n\nconst resolveMuonConfigInputPath = async (\n  configPath: string,\n): Promise<string> => {\n  if (basename(configPath) === \"muon.json\") {\n    const directory = dirname(configPath);\n    for (const fileName of [\"muon.json5\", \"muon.jsonc\", \"muon.json\"]) {\n      const candidate = join(directory, fileName);\n      if (await fileExists(candidate)) {\n        return candidate;\n      }\n    }\n  }\n  if (!(await fileExists(configPath))) {\n    throw new Error(`muon config does not exist: ${configPath}`);\n  }\n  return configPath;\n};\n\nconst readMuonConfigInput = async (configPath: string): Promise<unknown> => {\n  const resolvedPath = await resolveMuonConfigInputPath(configPath);\n  return parse(await readFile(resolvedPath, \"utf8\"));\n};\n\nconst isSignedPeExecutable = (content: Buffer): boolean => {\n  if (content.length < 0x40 || content[0] !== 0x4d || content[1] !== 0x5a) {\n    return false;\n  }\n  const peOffset = content.readUInt32LE(0x3c);\n  if (\n    peOffset + 0x18 >= content.length ||\n    content.toString(\"ascii\", peOffset, peOffset + 4) !== \"PE\\u0000\\u0000\"\n  ) {\n    return false;\n  }\n\n  const optionalHeaderOffset = peOffset + 0x18;\n  const optionalHeaderSize = content.readUInt16LE(peOffset + 0x14);\n  const optionalHeaderEnd = optionalHeaderOffset + optionalHeaderSize;\n  if (optionalHeaderEnd > content.length) {\n    return false;\n  }\n\n  const magic = content.readUInt16LE(optionalHeaderOffset);\n  const dataDirectoryOffset =\n    magic === 0x20b ? optionalHeaderOffset + 112 : optionalHeaderOffset + 96;\n  const certificateEntryOffset = dataDirectoryOffset + 4 * 8;\n  if (certificateEntryOffset + 8 > optionalHeaderEnd) {\n    return false;\n  }\n  const certificateSize = content.readUInt32LE(certificateEntryOffset + 4);\n  return certificateSize !== 0;\n};\n\n/**\n * Embeds a muon config into a single muon-core executable.\n *\n * @param options Core executable embedding options.\n * @returns Embedding result metadata.\n */\nexport const embedMuonConfigInCoreFile = async ({\n  corePath,\n  configPath,\n  outputPath,\n}: EmbedMuonConfigCoreOptions): Promise<EmbedMuonConfigResult> => {\n  const config = await readMuonConfigInput(configPath);\n  const payload = encodeMuonConfigTlv(config);\n  const embeddedSlot = createMuonEmbeddedConfigSlot(payload);\n  const coreContent = await readFile(corePath);\n  if (isSignedPeExecutable(coreContent)) {\n    throw new Error(\"Cannot embed muon config into a signed PE executable.\");\n  }\n\n  const slot = findMuonEmbeddedConfigSlot(coreContent);\n  const patchedContent = Buffer.from(coreContent);\n  embeddedSlot.copy(patchedContent, slot.offset);\n  const resolvedOutputPath = outputPath ?? corePath;\n  await writeFile(resolvedOutputPath, patchedContent);\n\n  return {\n    corePath,\n    outputPath: resolvedOutputPath,\n    slotOffset: slot.offset,\n    payloadSize: payload.length,\n    replaced: false,\n  };\n};\n\n/**\n * Embeds a muon config into a single muon-bootstrap executable.\n *\n * @param options Bootstrap executable embedding options.\n * @returns Embedding result metadata.\n */\nexport const embedMuonConfigInBootstrapFile = async ({\n  bootstrapPath,\n  configPath,\n  outputPath,\n}: EmbedMuonConfigBootstrapOptions): Promise<EmbedMuonConfigResult> => {\n  const config = await readMuonConfigInput(configPath);\n  const payload = encodeMuonConfigTlv(config);\n  const embeddedSlot = createMuonBootstrapEmbeddedConfigSlot(payload);\n  const bootstrapContent = await readFile(bootstrapPath);\n  if (isSignedPeExecutable(bootstrapContent)) {\n    throw new Error(\n      \"Cannot embed muon config into a signed muon-bootstrap PE executable.\",\n    );\n  }\n\n  const slot = findMuonBootstrapEmbeddedConfigSlot(bootstrapContent);\n  const patchedContent = Buffer.from(bootstrapContent);\n  embeddedSlot.copy(patchedContent, slot.offset);\n  const resolvedOutputPath = outputPath ?? bootstrapPath;\n  await writeFile(resolvedOutputPath, patchedContent);\n\n  return {\n    corePath: bootstrapPath,\n    outputPath: resolvedOutputPath,\n    slotOffset: slot.offset,\n    payloadSize: payload.length,\n    replaced: false,\n  };\n};\n\nconst resolveRuntimeCorePath = async (runtimePath: string): Promise<string> => {\n  const candidates = [\n    join(runtimePath, \"muon-core\"),\n    join(runtimePath, \"muon-core.exe\"),\n  ];\n  const existing: string[] = [];\n  for (const candidate of candidates) {\n    try {\n      await access(candidate);\n      existing.push(candidate);\n    } catch {\n      // Missing candidates are ignored until the final count check.\n    }\n  }\n  if (existing.length !== 1) {\n    throw new Error(\n      `Expected exactly one muon-core executable in runtime path, found ${existing.length}.`,\n    );\n  }\n  const [corePath] = existing;\n  if (corePath === undefined) {\n    throw new Error(\"muon-core executable was not found.\");\n  }\n  return corePath;\n};\n\n/**\n * Embeds a muon config into a runtime directory containing muon-core.\n *\n * @param options Runtime directory embedding options.\n * @returns Embedding result metadata.\n */\nexport const embedMuonConfigInRuntime = async ({\n  runtimePath,\n  configPath,\n  outputRuntimePath,\n}: EmbedMuonConfigRuntimeOptions): Promise<EmbedMuonConfigResult> => {\n  const targetRuntimePath = outputRuntimePath ?? runtimePath;\n  if (outputRuntimePath !== undefined) {\n    await cp(runtimePath, outputRuntimePath, {\n      recursive: true,\n      force: true,\n    });\n  }\n  return embedMuonConfigInCoreFile({\n    corePath: await resolveRuntimeCorePath(targetRuntimePath),\n    configPath,\n    outputPath: undefined,\n  });\n};\n","// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\n/**\n * Public Muon target platform identifier.\n */\nexport type MuonTarget =\n  | \"linux-amd64\"\n  | \"linux-armhf\"\n  | \"linux-arm64\"\n  | \"windows-i686\"\n  | \"windows-amd64\";\n\n/**\n * Internal CEF target platform identifier.\n */\nexport type MuonCefTarget =\n  | \"linux64\"\n  | \"linuxarm\"\n  | \"linuxarm64\"\n  | \"windows32\"\n  | \"windows64\";\n\n/**\n * Muon target operating system family.\n */\nexport type MuonTargetOperatingSystem = \"linux\" | \"windows\";\n\n/**\n * Metadata for one supported Muon target.\n */\nexport interface MuonTargetDescriptor {\n  /**\n   * Public target identifier accepted by Muon CLI and Vite options.\n   */\n  id: MuonTarget;\n  /**\n   * Internal CEF target identifier used for CEF catalog and native builds.\n   */\n  cefTarget: MuonCefTarget;\n  /**\n   * Operating system family.\n   */\n  os: MuonTargetOperatingSystem;\n  /**\n   * Public architecture name used in package artifact names.\n   */\n  arch: \"amd64\" | \"armhf\" | \"arm64\" | \"i686\";\n  /**\n   * Fixed dist directory path for generated app distributions.\n   */\n  distributionDirectoryName: string;\n  /**\n   * muon-core executable file name for this target.\n   */\n  runtimeExecutableName: string;\n  /**\n   * muon-bootstrap executable file name for this target.\n   */\n  bootstrapExecutableName: string;\n  /**\n   * Launcher file suffix for app bootstrap executables.\n   */\n  launcherExtension: string;\n  /**\n   * Required runtime files copied into generated app distributions.\n   */\n  runtimeFiles: readonly string[];\n  /**\n   * Optional runtime files copied when they exist.\n   */\n  optionalRuntimeFilePatterns?: readonly RegExp[];\n}\n\n/**\n * Supported public Muon targets in deterministic build order.\n */\nexport const allMuonTargets = [\n  \"linux-amd64\",\n  \"linux-armhf\",\n  \"linux-arm64\",\n  \"windows-i686\",\n  \"windows-amd64\",\n] as const satisfies readonly MuonTarget[];\n\nconst targetDescriptors = {\n  \"linux-amd64\": {\n    id: \"linux-amd64\",\n    cefTarget: \"linux64\",\n    os: \"linux\",\n    arch: \"amd64\",\n    distributionDirectoryName: \"dist-muon/linux-amd64\",\n    runtimeExecutableName: \"muon-core\",\n    bootstrapExecutableName: \"muon-bootstrap\",\n    launcherExtension: \"\",\n    runtimeFiles: [\"muon-core\", \"libmuon-ui.so\", \"libcardio.so\"],\n  },\n  \"linux-armhf\": {\n    id: \"linux-armhf\",\n    cefTarget: \"linuxarm\",\n    os: \"linux\",\n    arch: \"armhf\",\n    distributionDirectoryName: \"dist-muon/linux-armhf\",\n    runtimeExecutableName: \"muon-core\",\n    bootstrapExecutableName: \"muon-bootstrap\",\n    launcherExtension: \"\",\n    runtimeFiles: [\"muon-core\", \"libmuon-ui.so\", \"libcardio.so\"],\n  },\n  \"linux-arm64\": {\n    id: \"linux-arm64\",\n    cefTarget: \"linuxarm64\",\n    os: \"linux\",\n    arch: \"arm64\",\n    distributionDirectoryName: \"dist-muon/linux-arm64\",\n    runtimeExecutableName: \"muon-core\",\n    bootstrapExecutableName: \"muon-bootstrap\",\n    launcherExtension: \"\",\n    runtimeFiles: [\"muon-core\", \"libmuon-ui.so\", \"libcardio.so\"],\n  },\n  \"windows-i686\": {\n    id: \"windows-i686\",\n    cefTarget: \"windows32\",\n    os: \"windows\",\n    arch: \"i686\",\n    distributionDirectoryName: \"dist-muon/windows-i686\",\n    runtimeExecutableName: \"muon-core.exe\",\n    bootstrapExecutableName: \"muon-bootstrap.exe\",\n    launcherExtension: \".exe\",\n    runtimeFiles: [\"muon-core.exe\", \"libmuon-ui.dll\", \"libcardio.dll\"],\n    optionalRuntimeFilePatterns: [\n      /^libgcc_s_.*-1\\.dll$/,\n      /^libstdc\\+\\+-6\\.dll$/,\n      /^libwinpthread-1\\.dll$/,\n    ],\n  },\n  \"windows-amd64\": {\n    id: \"windows-amd64\",\n    cefTarget: \"windows64\",\n    os: \"windows\",\n    arch: \"amd64\",\n    distributionDirectoryName: \"dist-muon/windows-amd64\",\n    runtimeExecutableName: \"muon-core.exe\",\n    bootstrapExecutableName: \"muon-bootstrap.exe\",\n    launcherExtension: \".exe\",\n    runtimeFiles: [\"muon-core.exe\", \"libmuon-ui.dll\", \"libcardio.dll\"],\n    optionalRuntimeFilePatterns: [\n      /^libgcc_s_.*-1\\.dll$/,\n      /^libstdc\\+\\+-6\\.dll$/,\n      /^libwinpthread-1\\.dll$/,\n    ],\n  },\n} as const satisfies Record<MuonTarget, MuonTargetDescriptor>;\n\nconst targetByCefTarget = Object.fromEntries(\n  allMuonTargets.map((target) => [targetDescriptors[target].cefTarget, target]),\n) as Record<MuonCefTarget, MuonTarget>;\n\n/**\n * Returns metadata for a public Muon target.\n *\n * @param target Public Muon target.\n * @returns Target descriptor.\n */\nexport const getMuonTargetDescriptor = (\n  target: MuonTarget,\n): MuonTargetDescriptor => targetDescriptors[target];\n\n/**\n * Returns the runtime app identifier embedded for one target distribution.\n *\n * @param appId Base sanitized application identifier.\n * @param target Public Muon target.\n * @returns Target runtime application identifier.\n *\n * @remarks Windows targets append their public architecture name so 32-bit and\n * 64-bit packages do not share runtime state or installer identities.\n */\nexport const getMuonTargetRuntimeAppId = (\n  appId: string,\n  target: MuonTarget,\n): string => {\n  const descriptor = getMuonTargetDescriptor(target);\n  return descriptor.os === \"windows\" ? `${appId}.${descriptor.arch}` : appId;\n};\n\n/**\n * Normalizes a user supplied public Muon target.\n *\n * @param target Target value supplied by the user.\n * @param label Error label used in diagnostics.\n * @returns Public Muon target.\n */\nexport const normalizeMuonTarget = (\n  target: string,\n  label = \"Muon target\",\n): MuonTarget => {\n  const normalized = target.trim().toLowerCase();\n  if (allMuonTargets.includes(normalized as MuonTarget)) {\n    return normalized as MuonTarget;\n  }\n  throw new Error(`Unsupported ${label}: ${target}`);\n};\n\n/**\n * Resolves a Node platform and architecture pair to a public Muon target.\n *\n * @param platform Node platform.\n * @param architecture Node architecture.\n * @returns Public Muon target.\n */\nexport const getDefaultMuonTarget = (\n  platform: NodeJS.Platform,\n  architecture: NodeJS.Architecture,\n): MuonTarget => {\n  if (platform === \"win32\") {\n    if (architecture === \"ia32\") {\n      return \"windows-i686\";\n    }\n    if (architecture === \"x64\") {\n      return \"windows-amd64\";\n    }\n  }\n  if (platform === \"linux\") {\n    if (architecture === \"x64\") {\n      return \"linux-amd64\";\n    }\n    if (architecture === \"arm\") {\n      return \"linux-armhf\";\n    }\n    if (architecture === \"arm64\") {\n      return \"linux-arm64\";\n    }\n  }\n  throw new Error(\n    `Unsupported Muon target: platform=${platform}, arch=${architecture}`,\n  );\n};\n\n/**\n * Resolves an internal CEF target to a public Muon target.\n *\n * @param cefTarget Internal CEF target.\n * @returns Public Muon target.\n */\nexport const getMuonTargetForCefTarget = (\n  cefTarget: MuonCefTarget,\n): MuonTarget => targetByCefTarget[cefTarget];\n","// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { spawn } from \"node:child_process\";\nimport { constants } from \"node:fs\";\nimport { access } from \"node:fs/promises\";\nimport { fileURLToPath } from \"node:url\";\nimport { dirname, join } from \"node:path\";\nimport {\n  getDefaultMuonTarget,\n  normalizeMuonTarget,\n  type MuonTarget,\n} from \"./targets.js\";\n\n/**\n * Options used to invoke the native Muon builder helper.\n */\nexport interface MuonPrepareOptions {\n  /**\n   * Directory containing muon-core runtime files.\n   */\n  muonPath: string;\n\n  /**\n   * Directory containing CEF files, or a CEF archive root with Release/Resources.\n   */\n  cefPath: string | undefined;\n\n  /**\n   * Directory where the executable runtime is staged.\n   */\n  stageDir: string | undefined;\n\n  /**\n   * Public target runtime platform such as linux-amd64 or windows-amd64.\n   */\n  target: string | undefined;\n\n  /**\n   * Cache directory passed to muon-builder.\n   */\n  cacheDir: string | undefined;\n\n  /**\n   * Rebuild an existing prepared runtime.\n   */\n  force: boolean;\n\n  /**\n   * Suppress progress messages from the native builder process.\n   */\n  quiet: boolean;\n\n  /**\n   * Explicit native muon-builder executable path.\n   */\n  prepareExecutablePath: string | undefined;\n\n  /**\n   * Environment used for the child process.\n   */\n  environment: NodeJS.ProcessEnv;\n\n  /**\n   * Working directory used for the child process.\n   */\n  cwd: string | undefined;\n}\n\n/**\n * Options used to update Windows PE resources through the native Muon helper.\n */\nexport interface MuonPrepareResourceUpdateOptions {\n  /**\n   * Input PE executable path.\n   */\n  inputPath: string;\n\n  /**\n   * Engraver update JSON path.\n   */\n  updatesJsonPath: string;\n\n  /**\n   * Output PE executable path.\n   *\n   * @remarks This must be different from `inputPath`.\n   */\n  outputPath: string;\n\n  /**\n   * Suppress progress messages from the native builder process.\n   */\n  quiet: boolean;\n\n  /**\n   * Explicit native muon-builder executable path.\n   */\n  prepareExecutablePath: string | undefined;\n\n  /**\n   * Environment used for the child process.\n   */\n  environment: NodeJS.ProcessEnv;\n\n  /**\n   * Working directory used for the child process.\n   */\n  cwd: string | undefined;\n}\n\n/**\n * Result returned by native muon-builder.\n */\nexport interface MuonPrepareResult {\n  /**\n   * Directory containing the staged Muon runtime.\n   */\n  stagePath?: string;\n\n  /**\n   * Directory containing muon-core files used as the staging source.\n   */\n  muonPath: string;\n\n  /**\n   * Directory or cached archive containing CEF files used as the staging source.\n   */\n  cefPath: string;\n\n  /**\n   * True when an existing prepared runtime was reused.\n   */\n  cacheHit: boolean;\n}\n\n/**\n * Returns the default Muon prepare target for a Node platform and architecture.\n *\n * @param platform Node platform.\n * @param architecture Node architecture.\n * @returns Muon prepare target name.\n */\nexport const getDefaultMuonPrepareTarget = (\n  platform: NodeJS.Platform,\n  architecture: NodeJS.Architecture,\n): MuonTarget => {\n  try {\n    return getDefaultMuonTarget(platform, architecture);\n  } catch {\n    throw new Error(\n      `Unsupported Muon prepare target: platform=${platform}, arch=${architecture}`,\n    );\n  }\n};\n\nconst getBuilderExecutableName = (platform: NodeJS.Platform): string =>\n  platform === \"win32\" ? \"muon-builder.exe\" : \"muon-builder\";\n\nconst moduleDirectory =\n  typeof __dirname === \"string\"\n    ? __dirname\n    : dirname(fileURLToPath(import.meta.url));\n\nconst canExecute = async (path: string): Promise<boolean> => {\n  try {\n    await access(path, constants.X_OK);\n    return true;\n  } catch {\n    return false;\n  }\n};\n\nconst resolveMuonBuilderExecutable = async (\n  options: Pick<MuonPrepareOptions, \"prepareExecutablePath\" | \"environment\">,\n): Promise<string> => {\n  const explicit =\n    options.prepareExecutablePath ?? options.environment.MUON_BUILDER_PATH;\n  if (explicit !== undefined && explicit !== \"\") {\n    return explicit;\n  }\n  const executableName = getBuilderExecutableName(process.platform);\n  const target = getDefaultMuonPrepareTarget(process.platform, process.arch);\n  const candidates = [\n    join(moduleDirectory, \"native\", target, executableName),\n    join(moduleDirectory, \"..\", \"dist\", \"native\", target, executableName),\n  ];\n  for (const candidate of candidates) {\n    if (await canExecute(candidate)) {\n      return candidate;\n    }\n  }\n  return candidates[0] ?? executableName;\n};\n\nconst createMuonPrepareArguments = (options: MuonPrepareOptions): string[] => {\n  const args = [\"runtime\", \"--muon-path\", options.muonPath, \"--json\"];\n  if (options.cefPath !== undefined) {\n    args.push(\"--cef-path\", options.cefPath);\n  }\n  if (options.stageDir !== undefined) {\n    args.push(\"--stage-dir\", options.stageDir);\n  }\n  if (options.target !== undefined) {\n    args.push(\n      \"--target\",\n      normalizeMuonTarget(options.target, \"Muon prepare target\"),\n    );\n  }\n  if (options.cacheDir !== undefined) {\n    args.push(\"--cache-dir\", options.cacheDir);\n  }\n  if (options.force) {\n    args.push(\"--force\");\n  }\n  if (options.quiet) {\n    args.push(\"--quiet\");\n  }\n  return args;\n};\n\ninterface MuonPrepareStderrForwarder {\n  write(chunk: string): void;\n  flush(): void;\n}\n\nconst spinnerFrames = [\"-\", \"\\\\\", \"|\", \"/\"] as const;\nconst spinnerIntervalMilliseconds = 100;\nconst terminalLineStart = \"\\r\";\nconst terminalClearLine = \"\\x1b[K\";\n\nconst isMuonPrepareStatusLine = (line: string): boolean => {\n  const trimmed = line.trimEnd();\n  return (\n    trimmed.endsWith(\"...\") ||\n    trimmed === \"Failed to prepare CEF.\" ||\n    trimmed.startsWith(\"Downloading CEF binary:\")\n  );\n};\n\nconst shouldKeepMuonPrepareStatusAfterLine = (line: string): boolean =>\n  line.startsWith(\"Muon files copied to staging:\");\n\nconst createPlainStderrForwarder = (): MuonPrepareStderrForwarder => ({\n  write: (chunk): void => {\n    process.stderr.write(chunk);\n  },\n  flush: (): void => {},\n});\n\nconst createSpinnerStderrForwarder = (): MuonPrepareStderrForwarder => {\n  let pending = \"\";\n  let activeStatus: string | undefined = undefined;\n  let frameIndex = 0;\n  let timer: NodeJS.Timeout | undefined = undefined;\n\n  const writeRaw = (chunk: string): void => {\n    process.stderr.write(chunk);\n  };\n\n  const stopTimer = (): void => {\n    if (timer !== undefined) {\n      clearInterval(timer);\n      timer = undefined;\n    }\n  };\n\n  const renderStatus = (): void => {\n    if (activeStatus === undefined) {\n      return;\n    }\n    const frame = spinnerFrames[frameIndex] ?? spinnerFrames[0];\n    writeRaw(\n      `${terminalLineStart}${frame} ${activeStatus}${terminalClearLine}`,\n    );\n    frameIndex = (frameIndex + 1) % spinnerFrames.length;\n  };\n\n  const ensureTimer = (): void => {\n    if (timer === undefined) {\n      timer = setInterval(renderStatus, spinnerIntervalMilliseconds);\n    }\n  };\n\n  const finishStatus = (): void => {\n    if (activeStatus === undefined) {\n      return;\n    }\n    const status = activeStatus;\n    activeStatus = undefined;\n    stopTimer();\n    frameIndex = 0;\n    writeRaw(`${terminalLineStart}${status}${terminalClearLine}\\n`);\n  };\n\n  const startStatus = (status: string): void => {\n    if (activeStatus !== undefined && activeStatus !== status) {\n      finishStatus();\n    }\n    activeStatus = status;\n    renderStatus();\n    ensureTimer();\n  };\n\n  const writeLine = (line: string): void => {\n    const text = line.replace(/\\r?\\n$/, \"\");\n    if (isMuonPrepareStatusLine(text)) {\n      startStatus(text.trimEnd());\n      return;\n    }\n    if (\n      activeStatus !== undefined &&\n      shouldKeepMuonPrepareStatusAfterLine(text)\n    ) {\n      writeRaw(\n        `${terminalLineStart}${terminalClearLine}${\n          line.endsWith(\"\\n\") ? line : `${line}\\n`\n        }`,\n      );\n      renderStatus();\n      return;\n    }\n    finishStatus();\n    writeRaw(line);\n  };\n\n  return {\n    write: (chunk): void => {\n      pending += chunk;\n      for (;;) {\n        const newlineIndex = pending.indexOf(\"\\n\");\n        if (newlineIndex < 0) {\n          break;\n        }\n        const line = pending.slice(0, newlineIndex + 1);\n        pending = pending.slice(newlineIndex + 1);\n        writeLine(line);\n      }\n    },\n    flush: (): void => {\n      if (pending.length > 0) {\n        const line = pending;\n        pending = \"\";\n        writeLine(line);\n      }\n      finishStatus();\n    },\n  };\n};\n\nconst createMuonPrepareStderrForwarder = (): MuonPrepareStderrForwarder =>\n  process.stderr.isTTY === true\n    ? createSpinnerStderrForwarder()\n    : createPlainStderrForwarder();\n\nconst runMuonPrepareCommand = async (\n  options: Pick<MuonPrepareOptions, \"prepareExecutablePath\" | \"environment\"> & {\n    args: readonly string[];\n    cwd: string | undefined;\n    quiet: boolean;\n  },\n): Promise<string> => {\n  const executable = await resolveMuonBuilderExecutable(options);\n  const child = spawn(executable, [...options.args], {\n    cwd: options.cwd,\n    env: options.environment,\n    stdio: [\"ignore\", \"pipe\", \"pipe\"],\n  });\n  let stdout = \"\";\n  let stderr = \"\";\n  child.stdout.setEncoding(\"utf8\");\n  child.stderr.setEncoding(\"utf8\");\n  const stderrForwarder = options.quiet\n    ? undefined\n    : createMuonPrepareStderrForwarder();\n  child.stdout.on(\"data\", (chunk: string) => {\n    stdout += chunk;\n  });\n  child.stderr.on(\"data\", (chunk: string) => {\n    stderr += chunk;\n    stderrForwarder?.write(chunk);\n  });\n  const exitCode = await (async (): Promise<number> => {\n    try {\n      return await new Promise<number>((resolvePromise, reject) => {\n        child.on(\"error\", reject);\n        child.on(\"close\", (code) => {\n          resolvePromise(code ?? 1);\n        });\n      });\n    } finally {\n      stderrForwarder?.flush();\n    }\n  })();\n  if (exitCode !== 0) {\n    throw new Error(\n      `muon-builder failed with exit code ${exitCode}.\\n${stderr.trim()}`,\n    );\n  }\n  return stdout;\n};\n\n/**\n * Invokes the native muon-builder executable and returns the prepared runtime.\n *\n * @param options Native prepare invocation options.\n * @returns Prepared runtime location.\n */\nexport const runMuonPrepare = async (\n  options: MuonPrepareOptions,\n): Promise<MuonPrepareResult> => {\n  const args = createMuonPrepareArguments(options);\n  const stdout = await runMuonPrepareCommand({\n    prepareExecutablePath: options.prepareExecutablePath,\n    environment: options.environment,\n    cwd: options.cwd,\n    quiet: options.quiet,\n    args,\n  });\n  const result = JSON.parse(stdout) as Partial<MuonPrepareResult>;\n  if (\n    (result.stagePath !== undefined && typeof result.stagePath !== \"string\") ||\n    typeof result.muonPath !== \"string\" ||\n    typeof result.cefPath !== \"string\" ||\n    typeof result.cacheHit !== \"boolean\"\n  ) {\n    throw new Error(`muon-builder returned invalid JSON: ${stdout}`);\n  }\n  return {\n    ...(result.stagePath === undefined ? {} : { stagePath: result.stagePath }),\n    muonPath: result.muonPath,\n    cefPath: result.cefPath,\n    cacheHit: result.cacheHit,\n  };\n};\n\n/**\n * Invokes the native muon-builder executable to write Windows PE resources.\n *\n * @param options Resource update invocation options.\n */\nexport const runMuonPrepareResourceUpdate = async (\n  options: MuonPrepareResourceUpdateOptions,\n): Promise<void> => {\n  await runMuonPrepareCommand({\n    prepareExecutablePath: options.prepareExecutablePath,\n    environment: options.environment,\n    cwd: options.cwd,\n    quiet: options.quiet,\n    args: [\n      \"resource\",\n      \"--input\",\n      options.inputPath,\n      \"--updates-json\",\n      options.updatesJsonPath,\n      \"--output\",\n      options.outputPath,\n      ...(options.quiet ? [\"--quiet\"] : []),\n    ],\n  });\n};\n","// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\n\nimport sharp from \"sharp\";\n\nconst normalizedIconSize = 256;\nconst windowsIconDibSizes = [16, 24, 32, 48, 64, 128] as const;\nconst pngSignature = Buffer.from([\n  0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a,\n]);\n\ninterface RawIconImage {\n  data: Buffer;\n  width: number;\n  height: number;\n}\n\ninterface WindowsIconImage {\n  data: Buffer;\n  size: number;\n  bitCount: number;\n}\n\n/**\n * Creates a normalized square PNG icon image.\n *\n * @param pngData Source PNG bytes.\n * @param source Diagnostic source label used in errors.\n * @param label User-facing diagnostic label.\n * @returns PNG bytes normalized to the Muon base icon size.\n * @remarks Non-square images are fitted into transparent padding without\n * stretching. The normalized PNG is the source for all platform-specific icon\n * derivatives.\n */\nexport const createNormalizedIconPngData = async (\n  pngData: Buffer,\n  source: string,\n  label: string,\n): Promise<Buffer> => {\n  await assertPngData(pngData, source, label);\n  try {\n    return await sharp(pngData)\n      .resize(normalizedIconSize, normalizedIconSize, {\n        fit: \"contain\",\n        background: { r: 0, g: 0, b: 0, alpha: 0 },\n      })\n      .ensureAlpha()\n      .png()\n      .toBuffer();\n  } catch {\n    throw new Error(`${label} must be a valid PNG: ${source}`);\n  }\n};\n\n/**\n * Creates a normalized square PNG icon image for Windows resources.\n *\n * @param pngData Source PNG bytes.\n * @param source Diagnostic source label used in errors.\n * @returns PNG bytes normalized to the Muon base icon size.\n */\nexport const createNormalizedMuonIconPngData = async (\n  pngData: Buffer,\n  source: string,\n): Promise<Buffer> =>\n  await createNormalizedIconPngData(pngData, source, \"Windows resource icon\");\n\n/**\n * Creates a Windows ICO file from PNG bytes.\n *\n * @param pngData Source PNG bytes.\n * @param source Diagnostic source label used in errors.\n * @returns ICO file bytes containing 16, 24, 32, 48, 64, 128, and 256 pixel images.\n * @remarks The 256px entry is PNG-compressed. Smaller entries are 32-bit DIB\n * images, matching the common Windows ICO layout recommended by Microsoft.\n */\nexport const createWindowsIconBufferFromPngData = async (\n  pngData: Buffer,\n  source: string,\n): Promise<Buffer> => {\n  const normalizedPng = await createNormalizedMuonIconPngData(pngData, source);\n  const images: WindowsIconImage[] = [];\n  for (const size of windowsIconDibSizes) {\n    const rawImage = await resizePngToRawRgba(normalizedPng, size, source);\n    images.push({\n      data: createDibIconImage(rawImage),\n      size,\n      bitCount: 32,\n    });\n  }\n  images.push({\n    data: normalizedPng,\n    size: normalizedIconSize,\n    bitCount: 32,\n  });\n  return createIco(images);\n};\n\n/**\n * Creates a Windows ICO file from a PNG file.\n *\n * @param sourcePath Source PNG file path.\n * @param outputPath Output ICO file path.\n * @returns Promise resolved when the ICO file has been written.\n */\nexport const createWindowsIconFromPngFile = async (\n  sourcePath: string,\n  outputPath: string,\n): Promise<void> => {\n  const icon = await createWindowsIconBufferFromPngData(\n    await readFile(sourcePath),\n    sourcePath,\n  );\n  await mkdir(dirname(outputPath), { recursive: true });\n  await writeFile(outputPath, icon);\n};\n\nconst assertPngData = async (\n  data: Buffer,\n  source: string,\n  label: string,\n): Promise<void> => {\n  if (data.length === 0) {\n    throw new Error(`${label} PNG must not be empty: ${source}`);\n  }\n  if (!data.subarray(0, pngSignature.length).equals(pngSignature)) {\n    throw new Error(`${label} must be a valid PNG: ${source}`);\n  }\n  try {\n    const metadata = await sharp(data).metadata();\n    if (metadata.format !== \"png\") {\n      throw new Error();\n    }\n  } catch {\n    throw new Error(`${label} must be a valid PNG: ${source}`);\n  }\n};\n\nconst resizePngToRawRgba = async (\n  pngData: Buffer,\n  size: number,\n  source: string,\n): Promise<RawIconImage> => {\n  try {\n    const { data, info } = await sharp(pngData)\n      .resize(size, size, {\n        fit: \"fill\",\n        kernel: \"lanczos3\",\n      })\n      .ensureAlpha()\n      .raw()\n      .toBuffer({ resolveWithObject: true });\n    if (info.width !== size || info.height !== size || info.channels !== 4) {\n      throw new Error();\n    }\n    return {\n      data,\n      width: info.width,\n      height: info.height,\n    };\n  } catch {\n    throw new Error(`Failed to resize Windows resource icon PNG: ${source}`);\n  }\n};\n\nconst createDibIconImage = (image: RawIconImage): Buffer => {\n  const pixelBytes = image.width * image.height * 4;\n  const maskStride = Math.ceil(image.width / 32) * 4;\n  const maskBytes = maskStride * image.height;\n  const output = Buffer.alloc(40 + pixelBytes + maskBytes);\n  output.writeUInt32LE(40, 0);\n  output.writeInt32LE(image.width, 4);\n  output.writeInt32LE(image.height * 2, 8);\n  output.writeUInt16LE(1, 12);\n  output.writeUInt16LE(32, 14);\n  output.writeUInt32LE(0, 16);\n  output.writeUInt32LE(pixelBytes + maskBytes, 20);\n  output.writeInt32LE(0, 24);\n  output.writeInt32LE(0, 28);\n  output.writeUInt32LE(0, 32);\n  output.writeUInt32LE(0, 36);\n\n  for (let y = 0; y < image.height; y += 1) {\n    const sourceY = image.height - 1 - y;\n    for (let x = 0; x < image.width; x += 1) {\n      const sourceOffset = (sourceY * image.width + x) * 4;\n      const outputOffset = 40 + (y * image.width + x) * 4;\n      output[outputOffset] = image.data[sourceOffset + 2]!;\n      output[outputOffset + 1] = image.data[sourceOffset + 1]!;\n      output[outputOffset + 2] = image.data[sourceOffset]!;\n      output[outputOffset + 3] = image.data[sourceOffset + 3]!;\n    }\n  }\n  return output;\n};\n\nconst createIco = (images: readonly WindowsIconImage[]): Buffer => {\n  const directorySize = 6 + images.length * 16;\n  let imageOffset = directorySize;\n  const header = Buffer.alloc(directorySize);\n  header.writeUInt16LE(0, 0);\n  header.writeUInt16LE(1, 2);\n  header.writeUInt16LE(images.length, 4);\n\n  const imageData: Buffer[] = [];\n  images.forEach((image, index) => {\n    const entryOffset = 6 + index * 16;\n    header[entryOffset] = image.size === 256 ? 0 : image.size;\n    header[entryOffset + 1] = image.size === 256 ? 0 : image.size;\n    header[entryOffset + 2] = 0;\n    header[entryOffset + 3] = 0;\n    header.writeUInt16LE(1, entryOffset + 4);\n    header.writeUInt16LE(image.bitCount, entryOffset + 6);\n    header.writeUInt32LE(image.data.length, entryOffset + 8);\n    header.writeUInt32LE(imageOffset, entryOffset + 12);\n    imageOffset += image.data.length;\n    imageData.push(image.data);\n  });\n\n  return Buffer.concat([header, ...imageData]);\n};\n","// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { constants } from \"node:fs\";\nimport { access, readFile } from \"node:fs/promises\";\nimport { extname, isAbsolute, resolve } from \"node:path\";\n\nimport { createNormalizedIconPngData } from \"./windows-icon.js\";\n\ntype JsonObject = Record<string, unknown>;\n\n/**\n * ZIP entry used for the generated static application icon asset.\n */\nexport const appIconAssetEntryName = \"main/.muon/app-icon.png\";\n\n/**\n * Runtime asset URL injected as the generated initial title bar icon.\n */\nexport const appIconAssetUrl = \"asset://main/.muon/app-icon.png\";\n\n/**\n * Source for a unified static application icon path.\n */\nexport interface MuonAppIconSource {\n  /** Raw icon path as supplied by the source. */\n  iconPath: string;\n  /** Directory that relative icon paths are resolved from. */\n  directory: string;\n}\n\n/**\n * Creates a static application icon source from API or CLI options.\n */\nexport const createAppIconOptionsSource = (\n  iconPath: unknown,\n  directory: string,\n  label: string = \"iconPath\",\n): MuonAppIconSource | undefined => {\n  if (iconPath === undefined) {\n    return undefined;\n  }\n  if (typeof iconPath !== \"string\") {\n    throw new Error(`${label} must be a string when present.`);\n  }\n  if (iconPath.trim() === \"\") {\n    return undefined;\n  }\n  return {\n    iconPath: iconPath.trim(),\n    directory,\n  };\n};\n\n/**\n * Reads the top-level `iconPath` from a Muon config object.\n */\nexport const readConfigAppIconSource = (\n  config: JsonObject,\n  directory: string,\n  label: string,\n): MuonAppIconSource | undefined => {\n  const value = config.iconPath;\n  if (value === undefined) {\n    return undefined;\n  }\n  if (typeof value !== \"string\") {\n    throw new Error(`${label} iconPath must be a string when present.`);\n  }\n  return createAppIconOptionsSource(value, directory);\n};\n\n/**\n * Reads the top-level `iconPath` from project metadata.\n */\nexport const readProjectAppIconSource = (\n  projectJson: JsonObject,\n  directory: string,\n): MuonAppIconSource | undefined => {\n  const value = projectJson.iconPath;\n  return typeof value === \"string\"\n    ? createAppIconOptionsSource(value, directory)\n    : undefined;\n};\n\n/**\n * Resolves and validates the first available static application icon source.\n */\nexport const resolveMuonAppIconPath = async (\n  sources: readonly MuonAppIconSource[],\n): Promise<string | undefined> => {\n  for (const source of sources) {\n    const iconPath = resolveResourcePath(source.directory, source.iconPath);\n    await assertMuonAppIconPath(iconPath);\n    return iconPath;\n  }\n  return undefined;\n};\n\nconst assertMuonAppIconPath = async (iconPath: string): Promise<void> => {\n  if (extname(iconPath).toLowerCase() !== \".png\") {\n    throw new Error(`Muon app icon must be a .png file: ${iconPath}`);\n  }\n  if (!(await fileExists(iconPath))) {\n    throw new Error(`Muon app icon does not exist: ${iconPath}`);\n  }\n  await createNormalizedIconPngData(\n    await readFile(iconPath),\n    iconPath,\n    \"Muon app icon\",\n  );\n};\n\nconst resolveResourcePath = (directory: string, value: string): string =>\n  isAbsolute(value) ? value : resolve(directory, value);\n\nconst fileExists = async (path: string): Promise<boolean> => {\n  try {\n    await access(path, constants.F_OK);\n    return true;\n  } catch {\n    return false;\n  }\n};\n","// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { constants } from \"node:fs\";\nimport {\n  access,\n  chmod,\n  copyFile,\n  mkdtemp,\n  readFile,\n  rm,\n  stat,\n  writeFile,\n} from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { dirname, extname, isAbsolute, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { parse } from \"json5\";\n\nimport { runMuonPrepareResourceUpdate } from \"./prepare.js\";\nimport type { MuonWindowsResourceOptions } from \"./vite.js\";\nimport {\n  createNormalizedMuonIconPngData,\n  createWindowsIconFromPngFile,\n} from \"./windows-icon.js\";\nimport {\n  createAppIconOptionsSource,\n  readConfigAppIconSource,\n  readProjectAppIconSource,\n  resolveMuonAppIconPath,\n  type MuonAppIconSource,\n} from \"./app-icon.js\";\n\nexport type { MuonWindowsResourceOptions } from \"./vite.js\";\n\nconst defaultConfigFileNames = [\"muon.json5\", \"muon.jsonc\", \"muon.json\"];\nconst defaultLanguage = 1033;\nconst defaultCodePage = 1200;\nconst moduleDirectory =\n  typeof __dirname === \"string\"\n    ? __dirname\n    : dirname(fileURLToPath(import.meta.url));\n\ntype JsonObject = Record<string, unknown>;\n\ninterface WindowsResourceSource {\n  options: MuonWindowsResourceOptions;\n  directory: string;\n}\n\ninterface WindowsResourceDefaults {\n  productName: string;\n  fileDescription: string;\n  companyName: string;\n  version: string;\n  copyright: string | undefined;\n}\n\ninterface ResolveWindowsResourceInput {\n  root: string;\n  packageDirectory: string;\n  packageJson: JsonObject;\n  muonConfig: JsonObject;\n  muonConfigDirectory: string;\n  options: MuonWindowsResourceOptions | undefined;\n  appIconPath: string | undefined;\n  defaults: WindowsResourceDefaults;\n}\n\n/**\n * Resolved Windows resource metadata used by build and pack outputs.\n */\nexport interface ResolvedMuonWindowsResource {\n  /** Resolved `.png` icon file path. */\n  iconPath: string;\n  /** Product name. */\n  productName: string;\n  /** File description. */\n  fileDescription: string;\n  /** Company name. */\n  companyName: string;\n  /** Original version string. */\n  version: string;\n  /** Four-part fixed version string. */\n  fixedVersion: string;\n  /** Legal copyright, if supplied. */\n  copyright: string | undefined;\n  /** Windows resource language identifier. */\n  language: number;\n  /** Windows version resource code page. */\n  codePage: number;\n}\n\n/**\n * Muon config file content and directory used for resource option resolution.\n */\nexport interface MuonWindowsResourceConfigSource {\n  /** Parsed Muon config object. */\n  config: JsonObject;\n  /** Directory that relative config paths are resolved from. */\n  directory: string;\n}\n\n/**\n * Reads the Muon config file using the same default file names as muon build.\n */\nexport const readMuonConfigForWindowsResource = async (\n  root: string,\n  configPath: string | undefined,\n): Promise<MuonWindowsResourceConfigSource> => {\n  const resolvedConfigPath = await resolveConfigPath(root, configPath);\n  if (resolvedConfigPath === undefined) {\n    return {\n      config: {},\n      directory: root,\n    };\n  }\n  return {\n    config: await readJsonObjectFile(resolvedConfigPath, \"Muon config file\"),\n    directory: dirname(resolvedConfigPath),\n  };\n};\n\n/**\n * Merges Windows resource options while preserving field-level fallback.\n */\nexport const mergeMuonWindowsResourceOptions = (\n  primary: MuonWindowsResourceOptions | undefined,\n  fallback: MuonWindowsResourceOptions | undefined,\n): MuonWindowsResourceOptions | undefined => {\n  if (primary === undefined) {\n    return fallback;\n  }\n  if (fallback === undefined) {\n    return primary;\n  }\n\n  const merged: MuonWindowsResourceOptions = { ...fallback };\n  if (primary.iconPath !== undefined) {\n    merged.iconPath = primary.iconPath;\n  }\n  if (primary.productName !== undefined) {\n    merged.productName = primary.productName;\n  }\n  if (primary.fileDescription !== undefined) {\n    merged.fileDescription = primary.fileDescription;\n  }\n  if (primary.companyName !== undefined) {\n    merged.companyName = primary.companyName;\n  }\n  if (primary.version !== undefined) {\n    merged.version = primary.version;\n  }\n  if (primary.copyright !== undefined) {\n    merged.copyright = primary.copyright;\n  }\n  if (primary.language !== undefined) {\n    merged.language = primary.language;\n  }\n  if (primary.codePage !== undefined) {\n    merged.codePage = primary.codePage;\n  }\n  return merged;\n};\n\n/**\n * Resolves Windows resource metadata from options, config files, and package metadata.\n */\nexport const resolveMuonWindowsResource = async (\n  input: ResolveWindowsResourceInput,\n): Promise<ResolvedMuonWindowsResource> => {\n  const projectJson = await readProjectJson(input.root);\n  const windowsSources = [\n    createOptionsSource(input.options, input.root, \"windowsResource\"),\n    readConfigWindowsResourceSource(\n      input.muonConfig,\n      input.muonConfigDirectory,\n      \"muon.json\",\n    ),\n    readConfigWindowsResourceSource(projectJson, input.root, \"project.json\"),\n  ].filter((source): source is WindowsResourceSource => source !== undefined);\n  const sources = [\n    ...windowsSources,\n    createProjectSource(projectJson, input.root),\n    createPackageSource(input.packageJson, input.root),\n  ].filter((source): source is WindowsResourceSource => source !== undefined);\n  const appIconSources = [\n    createAppIconOptionsSource(input.appIconPath, input.root),\n    readConfigAppIconSource(\n      input.muonConfig,\n      input.muonConfigDirectory,\n      \"muon.json\",\n    ),\n    readProjectAppIconSource(projectJson, input.root),\n  ].filter((source): source is MuonAppIconSource => source !== undefined);\n\n  const productName = resolveStringField(\n    sources,\n    \"productName\",\n    input.defaults.productName,\n  );\n  const fileDescription = resolveStringField(\n    sources,\n    \"fileDescription\",\n    input.defaults.fileDescription,\n  );\n  const companyName = resolveStringField(\n    sources,\n    \"companyName\",\n    input.defaults.companyName,\n  );\n  const version = resolveStringField(\n    sources,\n    \"version\",\n    input.defaults.version,\n  );\n  const copyright = resolveOptionalStringField(\n    sources,\n    \"copyright\",\n    input.defaults.copyright,\n  );\n  const language = resolveNumericField(sources, \"language\", defaultLanguage);\n  const codePage = resolveNumericField(sources, \"codePage\", defaultCodePage);\n  const fixedVersion = normalizeWindowsVersion(version);\n  const iconPath = await resolveWindowsIconPath(\n    windowsSources,\n    appIconSources,\n    await resolveDefaultWindowsIcon(input.packageDirectory),\n  );\n\n  return {\n    iconPath,\n    productName,\n    fileDescription,\n    companyName,\n    version,\n    fixedVersion,\n    copyright,\n    language,\n    codePage,\n  };\n};\n\n/**\n * Removes build-only Windows resource settings from runtime config.\n */\nexport const stripBuildOnlyWindowsResourceConfig = (\n  sourceConfig: JsonObject,\n): JsonObject => {\n  const sourceWindows = sourceConfig.windows;\n  if (!isJsonObject(sourceWindows)) {\n    return sourceConfig;\n  }\n\n  const windowsConfig: JsonObject = {};\n  for (const [key, value] of Object.entries(sourceWindows)) {\n    if (key !== \"resource\") {\n      windowsConfig[key] = value;\n    }\n  }\n\n  const output: JsonObject = {};\n  for (const [key, value] of Object.entries(sourceConfig)) {\n    if (key !== \"windows\") {\n      output[key] = value;\n    }\n  }\n  if (Object.keys(windowsConfig).length > 0) {\n    output.windows = windowsConfig;\n  }\n  return output;\n};\n\n/**\n * Returns true when the file has a Windows PE header.\n */\nexport const isWindowsPeExecutable = async (path: string): Promise<boolean> => {\n  const content = await readFile(path);\n  if (content.length < 0x40 || content.toString(\"ascii\", 0, 2) !== \"MZ\") {\n    return false;\n  }\n  const peOffset = content.readUInt32LE(0x3c);\n  return (\n    peOffset + 4 <= content.length &&\n    content.toString(\"ascii\", peOffset, peOffset + 4) === \"PE\\0\\0\"\n  );\n};\n\n/**\n * Applies resolved resource metadata to a Windows PE executable in place.\n */\nexport const updateWindowsPeResources = async (input: {\n  executablePath: string;\n  resource: ResolvedMuonWindowsResource;\n  environment: NodeJS.ProcessEnv;\n  cwd: string;\n}): Promise<boolean> => {\n  return await updateWindowsPeResourceFile(input, createEngraverUpdate);\n};\n\n/**\n * Applies only resolved icon metadata to a Windows PE executable in place.\n */\nexport const updateWindowsPeIconResource = async (input: {\n  executablePath: string;\n  resource: ResolvedMuonWindowsResource;\n  environment: NodeJS.ProcessEnv;\n  cwd: string;\n}): Promise<boolean> => {\n  return await updateWindowsPeResourceFile(input, createEngraverIconUpdate);\n};\n\nconst updateWindowsPeResourceFile = async (\n  input: {\n    executablePath: string;\n    resource: ResolvedMuonWindowsResource;\n    environment: NodeJS.ProcessEnv;\n    cwd: string;\n  },\n  createUpdate: (\n    resource: ResolvedMuonWindowsResource,\n    iconPath: string,\n  ) => JsonObject,\n): Promise<boolean> => {\n  if (!(await isWindowsPeExecutable(input.executablePath))) {\n    return false;\n  }\n\n  const mode = (await stat(input.executablePath)).mode & 0o777;\n  const tempDirectory = await mkdtemp(join(tmpdir(), \"muon-windows-resource-\"));\n  const updatesJsonPath = join(tempDirectory, \"updates.json\");\n  const outputPath = join(tempDirectory, \"output.exe\");\n  const iconPath = join(tempDirectory, \"icon.ico\");\n  try {\n    await createWindowsIconFromPngFile(input.resource.iconPath, iconPath);\n    await writeFile(\n      updatesJsonPath,\n      `${JSON.stringify(createUpdate(input.resource, iconPath), null, 2)}\\n`,\n    );\n    await runMuonPrepareResourceUpdate({\n      inputPath: input.executablePath,\n      updatesJsonPath,\n      outputPath,\n      quiet: true,\n      prepareExecutablePath: undefined,\n      environment: input.environment,\n      cwd: input.cwd,\n    });\n    await copyFile(outputPath, input.executablePath);\n    await chmod(input.executablePath, mode === 0 ? 0o755 : mode);\n    return true;\n  } finally {\n    await rm(tempDirectory, { recursive: true, force: true });\n  }\n};\n\nconst createEngraverUpdate = (\n  resource: ResolvedMuonWindowsResource,\n  iconPath: string,\n): JsonObject => {\n  const strings: JsonObject = {\n    CompanyName: resource.companyName,\n    FileDescription: resource.fileDescription,\n    FileVersion: resource.version,\n    ProductName: resource.productName,\n    ProductVersion: resource.version,\n  };\n  if (resource.copyright !== undefined) {\n    strings.LegalCopyright = resource.copyright;\n  }\n\n  return {\n    version: {\n      language: resource.language,\n      codePage: resource.codePage,\n      fixed: {\n        fileVersion: resource.fixedVersion,\n        productVersion: resource.fixedVersion,\n        fileOS: \"windows32\",\n        fileType: \"app\",\n      },\n      strings,\n    },\n    icons: createEngraverIcons(resource, iconPath),\n  };\n};\n\nconst createEngraverIconUpdate = (\n  resource: ResolvedMuonWindowsResource,\n  iconPath: string,\n): JsonObject => ({\n  icons: createEngraverIcons(resource, iconPath),\n});\n\nconst createEngraverIcons = (\n  resource: ResolvedMuonWindowsResource,\n  iconPath: string,\n): JsonObject[] => [\n  {\n    id: 1,\n    language: resource.language,\n    path: iconPath,\n  },\n];\n\nconst resolveConfigPath = async (\n  root: string,\n  configPath: string | undefined,\n): Promise<string | undefined> => {\n  if (configPath !== undefined) {\n    const resolvedPath = resolve(root, configPath);\n    if (await fileExists(resolvedPath)) {\n      return resolvedPath;\n    }\n    throw new Error(`Muon config file does not exist: ${resolvedPath}`);\n  }\n\n  for (const fileName of defaultConfigFileNames) {\n    const candidatePath = join(root, fileName);\n    if (await fileExists(candidatePath)) {\n      return candidatePath;\n    }\n  }\n  return undefined;\n};\n\nconst readProjectJson = async (root: string): Promise<JsonObject> => {\n  const projectJsonPath = join(root, \"project.json\");\n  if (!(await fileExists(projectJsonPath))) {\n    return {};\n  }\n  return await readJsonObjectFile(projectJsonPath, \"project.json\");\n};\n\nconst readJsonObjectFile = async (\n  filePath: string,\n  label: string,\n): Promise<JsonObject> => {\n  const parsed = parse(await readFile(filePath, \"utf8\"));\n  if (!isJsonObject(parsed)) {\n    throw new Error(`${label} must contain a JSON object: ${filePath}`);\n  }\n  return parsed;\n};\n\nconst createOptionsSource = (\n  options: MuonWindowsResourceOptions | undefined,\n  directory: string,\n  label: string,\n): WindowsResourceSource | undefined => {\n  if (options === undefined) {\n    return undefined;\n  }\n  return {\n    options: validateWindowsResourceOptions(options, label),\n    directory,\n  };\n};\n\nconst readConfigWindowsResourceSource = (\n  config: JsonObject,\n  directory: string,\n  label: string,\n): WindowsResourceSource | undefined => {\n  const windows = config.windows;\n  if (windows === undefined) {\n    return undefined;\n  }\n  if (!isJsonObject(windows)) {\n    throw new Error(`${label} windows must be an object when present.`);\n  }\n  const resource = windows.resource;\n  if (resource === undefined) {\n    return undefined;\n  }\n  return createOptionsSource(\n    validateWindowsResourceOptions(resource, `${label} windows.resource`),\n    directory,\n    `${label} windows.resource`,\n  );\n};\n\nconst createProjectSource = (\n  projectJson: JsonObject,\n  directory: string,\n): WindowsResourceSource | undefined => {\n  const topLevel: MuonWindowsResourceOptions = {};\n  copyStringField(projectJson, \"productName\", topLevel, \"productName\");\n  copyStringField(projectJson, \"name\", topLevel, \"productName\");\n  copyStringField(projectJson, \"fileDescription\", topLevel, \"fileDescription\");\n  copyStringField(projectJson, \"description\", topLevel, \"fileDescription\");\n  copyStringField(projectJson, \"companyName\", topLevel, \"companyName\");\n  copyStringField(projectJson, \"version\", topLevel, \"version\");\n  copyStringField(projectJson, \"copyright\", topLevel, \"copyright\");\n  const author = stringifyAuthor(projectJson.author);\n  if (author !== undefined && topLevel.companyName === undefined) {\n    topLevel.companyName = author;\n  }\n\n  const configSource = readConfigWindowsResourceSource(\n    projectJson,\n    directory,\n    \"project.json\",\n  );\n  const options = mergeMuonWindowsResourceOptions(\n    configSource?.options,\n    topLevel,\n  );\n  if (options === undefined || Object.keys(options).length === 0) {\n    return undefined;\n  }\n  return {\n    options,\n    directory,\n  };\n};\n\nconst createPackageSource = (\n  packageJson: JsonObject,\n  directory: string,\n): WindowsResourceSource | undefined => {\n  const options: MuonWindowsResourceOptions = {};\n  copyStringField(packageJson, \"name\", options, \"productName\");\n  copyStringField(packageJson, \"description\", options, \"fileDescription\");\n  copyStringField(packageJson, \"version\", options, \"version\");\n  copyStringField(packageJson, \"copyright\", options, \"copyright\");\n  const author = stringifyAuthor(packageJson.author);\n  if (author !== undefined) {\n    options.companyName = author;\n  }\n  return Object.keys(options).length === 0\n    ? undefined\n    : {\n        options,\n        directory,\n      };\n};\n\nconst copyStringField = (\n  source: JsonObject,\n  sourceKey: string,\n  target: MuonWindowsResourceOptions,\n  targetKey: keyof Pick<\n    MuonWindowsResourceOptions,\n    \"productName\" | \"fileDescription\" | \"companyName\" | \"version\" | \"copyright\"\n  >,\n): void => {\n  const value = source[sourceKey];\n  if (typeof value === \"string\" && value.trim() !== \"\") {\n    target[targetKey] = value.trim();\n  }\n};\n\nconst validateWindowsResourceOptions = (\n  value: unknown,\n  label: string,\n): MuonWindowsResourceOptions => {\n  if (!isJsonObject(value)) {\n    throw new Error(`${label} must be an object.`);\n  }\n\n  const output: MuonWindowsResourceOptions = {};\n  copyOptionalStringResourceField(value, \"iconPath\", output);\n  copyOptionalStringResourceField(value, \"productName\", output);\n  copyOptionalStringResourceField(value, \"fileDescription\", output);\n  copyOptionalStringResourceField(value, \"companyName\", output);\n  copyOptionalStringResourceField(value, \"version\", output);\n  copyOptionalStringResourceField(value, \"copyright\", output);\n  copyOptionalNumberResourceField(value, \"language\", output, label);\n  copyOptionalNumberResourceField(value, \"codePage\", output, label);\n  return output;\n};\n\nconst copyOptionalStringResourceField = (\n  source: JsonObject,\n  key: keyof Pick<\n    MuonWindowsResourceOptions,\n    | \"iconPath\"\n    | \"productName\"\n    | \"fileDescription\"\n    | \"companyName\"\n    | \"version\"\n    | \"copyright\"\n  >,\n  target: MuonWindowsResourceOptions,\n): void => {\n  const value = source[key];\n  if (value === undefined) {\n    return;\n  }\n  if (typeof value !== \"string\") {\n    throw new Error(`${key} must be a string when present.`);\n  }\n  if (value.trim() !== \"\") {\n    target[key] = value.trim();\n  }\n};\n\nconst copyOptionalNumberResourceField = (\n  source: JsonObject,\n  key: keyof Pick<MuonWindowsResourceOptions, \"language\" | \"codePage\">,\n  target: MuonWindowsResourceOptions,\n  label: string,\n): void => {\n  const value = source[key];\n  if (value === undefined) {\n    return;\n  }\n  if (\n    typeof value !== \"number\" ||\n    !Number.isInteger(value) ||\n    value < 0 ||\n    value > 0xffff\n  ) {\n    throw new Error(`${label} ${key} must be an integer from 0 to 65535.`);\n  }\n  target[key] = value;\n};\n\nconst resolveStringField = (\n  sources: readonly WindowsResourceSource[],\n  field: keyof Pick<\n    MuonWindowsResourceOptions,\n    \"productName\" | \"fileDescription\" | \"companyName\" | \"version\"\n  >,\n  fallback: string,\n): string => {\n  return resolveOptionalStringField(sources, field, fallback) ?? fallback;\n};\n\nconst resolveOptionalStringField = (\n  sources: readonly WindowsResourceSource[],\n  field: keyof Pick<\n    MuonWindowsResourceOptions,\n    \"productName\" | \"fileDescription\" | \"companyName\" | \"version\" | \"copyright\"\n  >,\n  fallback: string | undefined,\n): string | undefined => {\n  for (const source of sources) {\n    const value = source.options[field];\n    if (value !== undefined && value.trim() !== \"\") {\n      return value.trim();\n    }\n  }\n  return fallback;\n};\n\nconst resolveNumericField = (\n  sources: readonly WindowsResourceSource[],\n  field: keyof Pick<MuonWindowsResourceOptions, \"language\" | \"codePage\">,\n  fallback: number,\n): number => {\n  for (const source of sources) {\n    const value = source.options[field];\n    if (value !== undefined) {\n      return value;\n    }\n  }\n  return fallback;\n};\n\nconst resolveWindowsIconPath = async (\n  windowsSources: readonly WindowsResourceSource[],\n  appIconSources: readonly MuonAppIconSource[],\n  defaultIconPath: string,\n): Promise<string> => {\n  for (const source of windowsSources) {\n    const value = source.options.iconPath;\n    if (value !== undefined && value.trim() !== \"\") {\n      const iconPath = resolveResourcePath(source.directory, value);\n      await assertIconPath(iconPath);\n      return iconPath;\n    }\n  }\n  const appIconPath = await resolveMuonAppIconPath(appIconSources);\n  if (appIconPath !== undefined) {\n    return appIconPath;\n  }\n  await assertIconPath(defaultIconPath);\n  return defaultIconPath;\n};\n\nconst assertIconPath = async (iconPath: string): Promise<void> => {\n  if (extname(iconPath).toLowerCase() !== \".png\") {\n    throw new Error(`Windows resource icon must be a .png file: ${iconPath}`);\n  }\n  if (!(await fileExists(iconPath))) {\n    throw new Error(`Windows resource icon does not exist: ${iconPath}`);\n  }\n  await createNormalizedMuonIconPngData(await readFile(iconPath), iconPath);\n};\n\nconst resolveDefaultWindowsIcon = async (\n  packageDirectory: string,\n): Promise<string> => {\n  const sourceIconPath = join(\n    moduleDirectory,\n    \"..\",\n    \"..\",\n    \"images\",\n    \"muon-256.png\",\n  );\n  const candidates = [\n    join(resolve(packageDirectory), \"native\", \"muon-256.png\"),\n    join(moduleDirectory, \"native\", \"muon-256.png\"),\n    join(moduleDirectory, \"..\", \"dist\", \"native\", \"muon-256.png\"),\n    sourceIconPath,\n  ];\n  for (const candidate of candidates) {\n    if (await fileExists(candidate)) {\n      return candidate;\n    }\n  }\n  return sourceIconPath;\n};\n\nconst resolveResourcePath = (directory: string, path: string): string => {\n  return isAbsolute(path) ? path : resolve(directory, path);\n};\n\nconst normalizeWindowsVersion = (version: string): string => {\n  const normalized = version.trim();\n  const match = /^(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?(?:\\.(\\d+))?(?:$|[-+])/.exec(\n    normalized,\n  );\n  if (match === null) {\n    throw new Error(\n      `Windows resource version must start with numeric parts: ${version}`,\n    );\n  }\n  const values = [match[1], match[2], match[3], match[4]].map((value) =>\n    value === undefined ? 0 : Number.parseInt(value, 10),\n  );\n  for (const value of values) {\n    if (!Number.isInteger(value) || value < 0 || value > 0xffff) {\n      throw new Error(\n        `Windows resource version part must be from 0 to 65535: ${version}`,\n      );\n    }\n  }\n  return values.join(\".\");\n};\n\nconst stringifyAuthor = (value: unknown): string | undefined => {\n  if (typeof value === \"string\" && value.trim() !== \"\") {\n    return value.trim();\n  }\n  if (!isJsonObject(value) || typeof value.name !== \"string\") {\n    return undefined;\n  }\n  const name = value.name.trim();\n  if (name === \"\") {\n    return undefined;\n  }\n  return value.email === undefined || typeof value.email !== \"string\"\n    ? name\n    : `${name} <${value.email}>`;\n};\n\nconst fileExists = async (path: string): Promise<boolean> => {\n  try {\n    await access(path, constants.F_OK);\n    return true;\n  } catch {\n    return false;\n  }\n};\n\nconst isJsonObject = (value: unknown): value is JsonObject =>\n  typeof value === \"object\" && value !== null && !Array.isArray(value);\n","// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { constants } from \"node:fs\";\nimport { access, readFile, writeFile } from \"node:fs/promises\";\nimport { dirname, extname, isAbsolute, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { parse } from \"json5\";\n\nimport type { MuonLinuxDesktopOptions } from \"./vite.js\";\nimport { createNormalizedIconPngData } from \"./windows-icon.js\";\nimport {\n  createAppIconOptionsSource,\n  readConfigAppIconSource,\n  readProjectAppIconSource,\n  resolveMuonAppIconPath,\n  type MuonAppIconSource,\n} from \"./app-icon.js\";\n\nexport type { MuonLinuxDesktopOptions } from \"./vite.js\";\n\nconst defaultConfigFileNames = [\"muon.json5\", \"muon.jsonc\", \"muon.json\"];\nconst defaultIconFileName = \"muon-desktop-icon.png\";\nconst defaultDesktopConfigFileName = \"muon-desktop.json\";\nconst moduleDirectory =\n  typeof __dirname === \"string\"\n    ? __dirname\n    : dirname(fileURLToPath(import.meta.url));\n\ntype JsonObject = Record<string, unknown>;\n\ninterface LinuxDesktopSource {\n  options: MuonLinuxDesktopOptions;\n  directory: string;\n}\n\ninterface LinuxDesktopDefaults {\n  desktopId: string;\n  name: string;\n  comment: string;\n  categories: readonly string[];\n  startupNotify: boolean;\n}\n\ninterface ResolveLinuxDesktopInput {\n  root: string;\n  packageDirectory: string;\n  muonConfig: JsonObject;\n  muonConfigDirectory: string;\n  options: MuonLinuxDesktopOptions | undefined;\n  appIconPath: string | undefined;\n  defaults: LinuxDesktopDefaults;\n}\n\n/**\n * Resolved Linux desktop integration metadata used by build and pack outputs.\n */\nexport interface ResolvedMuonLinuxDesktop {\n  /** Desktop file identifier without the `.desktop` suffix. */\n  desktopId: string;\n  /** Application display name. */\n  name: string;\n  /** Application description used as a desktop entry comment. */\n  comment: string;\n  /** Desktop menu categories. */\n  categories: readonly string[];\n  /** Whether desktop startup notification is requested. */\n  startupNotify: boolean;\n  /** Resolved PNG icon file path. */\n  iconPath: string;\n  /** File name written into target distributions for the normalized icon. */\n  iconFileName: string;\n  /** File name written into target distributions for bootstrap desktop metadata. */\n  configFileName: string;\n}\n\n/**\n * Muon config file content and directory used for Linux desktop option\n * resolution.\n */\nexport interface MuonLinuxDesktopConfigSource {\n  /** Parsed Muon config object. */\n  config: JsonObject;\n  /** Directory that relative config paths are resolved from. */\n  directory: string;\n}\n\n/**\n * Reads the Muon config file using the same default file names as muon build.\n */\nexport const readMuonConfigForLinuxDesktop = async (\n  root: string,\n  configPath: string | undefined,\n): Promise<MuonLinuxDesktopConfigSource> => {\n  const resolvedConfigPath = await resolveConfigPath(root, configPath);\n  if (resolvedConfigPath === undefined) {\n    return {\n      config: {},\n      directory: root,\n    };\n  }\n  return {\n    config: await readJsonObjectFile(resolvedConfigPath, \"Muon config file\"),\n    directory: dirname(resolvedConfigPath),\n  };\n};\n\n/**\n * Merges Linux desktop options while preserving field-level fallback.\n */\nexport const mergeMuonLinuxDesktopOptions = (\n  primary: MuonLinuxDesktopOptions | undefined,\n  fallback: MuonLinuxDesktopOptions | undefined,\n): MuonLinuxDesktopOptions | undefined => {\n  if (primary === undefined) {\n    return fallback;\n  }\n  if (fallback === undefined) {\n    return primary;\n  }\n\n  const merged: MuonLinuxDesktopOptions = { ...fallback };\n  if (primary.desktopId !== undefined) {\n    merged.desktopId = primary.desktopId;\n  }\n  if (primary.name !== undefined) {\n    merged.name = primary.name;\n  }\n  if (primary.comment !== undefined) {\n    merged.comment = primary.comment;\n  }\n  if (primary.iconPath !== undefined) {\n    merged.iconPath = primary.iconPath;\n  }\n  if (primary.categories !== undefined) {\n    merged.categories = primary.categories;\n  }\n  if (primary.startupNotify !== undefined) {\n    merged.startupNotify = primary.startupNotify;\n  }\n  return merged;\n};\n\n/**\n * Resolves Linux desktop integration metadata from options, config files, and\n * package metadata.\n */\nexport const resolveMuonLinuxDesktop = async (\n  input: ResolveLinuxDesktopInput,\n): Promise<ResolvedMuonLinuxDesktop> => {\n  const projectJson = await readProjectJson(input.root);\n  const sources = [\n    createOptionsSource(input.options, input.root, \"linuxDesktop\"),\n    readConfigLinuxDesktopSource(\n      input.muonConfig,\n      input.muonConfigDirectory,\n      \"muon.json\",\n    ),\n  ].filter((source): source is LinuxDesktopSource => source !== undefined);\n  const appIconSources = [\n    createAppIconOptionsSource(input.appIconPath, input.root),\n    readConfigAppIconSource(\n      input.muonConfig,\n      input.muonConfigDirectory,\n      \"muon.json\",\n    ),\n    readProjectAppIconSource(projectJson, input.root),\n  ].filter((source): source is MuonAppIconSource => source !== undefined);\n\n  const desktopId = sanitizeDesktopId(\n    resolveStringField(sources, \"desktopId\", input.defaults.desktopId),\n  );\n  const name = resolveStringField(sources, \"name\", input.defaults.name);\n  const comment = resolveStringField(\n    sources,\n    \"comment\",\n    input.defaults.comment,\n  );\n  const categories = resolveCategories(sources, input.defaults.categories);\n  const startupNotify = resolveBooleanField(\n    sources,\n    \"startupNotify\",\n    input.defaults.startupNotify,\n  );\n  const iconPath = await resolveLinuxIconPath(\n    sources,\n    appIconSources,\n    await resolveDefaultLinuxDesktopIcon(input.packageDirectory),\n  );\n\n  return {\n    desktopId,\n    name,\n    comment,\n    categories,\n    startupNotify,\n    iconPath,\n    iconFileName: defaultIconFileName,\n    configFileName: defaultDesktopConfigFileName,\n  };\n};\n\n/**\n * Removes build-only Linux desktop settings from runtime config.\n */\nexport const stripBuildOnlyLinuxDesktopConfig = (\n  sourceConfig: JsonObject,\n): JsonObject => {\n  const sourceLinux = sourceConfig.linux;\n  if (!isJsonObject(sourceLinux)) {\n    return sourceConfig;\n  }\n\n  const linuxConfig: JsonObject = {};\n  for (const [key, value] of Object.entries(sourceLinux)) {\n    if (key !== \"desktop\") {\n      linuxConfig[key] = value;\n    }\n  }\n\n  const output: JsonObject = {};\n  for (const [key, value] of Object.entries(sourceConfig)) {\n    if (key !== \"linux\") {\n      output[key] = value;\n    }\n  }\n  if (Object.keys(linuxConfig).length > 0) {\n    output.linux = linuxConfig;\n  }\n  return output;\n};\n\n/**\n * Writes normalized Linux desktop sidecar files into a target distribution.\n */\nexport const writeLinuxDesktopDistributionFiles = async (\n  outputPath: string,\n  desktop: ResolvedMuonLinuxDesktop,\n): Promise<void> => {\n  const iconData = await createNormalizedIconPngData(\n    await readFile(desktop.iconPath),\n    desktop.iconPath,\n    \"Linux desktop icon\",\n  );\n  await writeFile(join(outputPath, desktop.iconFileName), iconData);\n  await writeFile(\n    join(outputPath, desktop.configFileName),\n    `${JSON.stringify(\n      {\n        desktopId: desktop.desktopId,\n        name: desktop.name,\n        comment: desktop.comment,\n        categories: desktop.categories,\n        startupNotify: desktop.startupNotify,\n        iconFileName: desktop.iconFileName,\n      },\n      undefined,\n      2,\n    )}\\n`,\n  );\n};\n\n/**\n * Creates a Desktop Entry file.\n */\nexport const createLinuxDesktopEntry = (input: {\n  desktop: ResolvedMuonLinuxDesktop;\n  exec: string;\n  tryExec: string;\n  icon: string;\n}): string => {\n  const lines = [\n    \"[Desktop Entry]\",\n    \"Type=Application\",\n    `Name=${escapeDesktopString(input.desktop.name)}`,\n  ];\n  if (input.desktop.comment.length > 0) {\n    lines.push(`Comment=${escapeDesktopString(input.desktop.comment)}`);\n  }\n  lines.push(`Exec=${input.exec}`);\n  lines.push(`TryExec=${input.tryExec}`);\n  lines.push(`Icon=${escapeDesktopString(input.icon)}`);\n  lines.push(`Terminal=false`);\n  if (input.desktop.categories.length > 0) {\n    lines.push(`Categories=${input.desktop.categories.join(\";\")};`);\n  }\n  lines.push(`StartupNotify=${input.desktop.startupNotify ? \"true\" : \"false\"}`);\n  lines.push(`StartupWMClass=${escapeDesktopString(input.desktop.desktopId)}`);\n  lines.push(\"X-Muon-Managed=true\");\n  lines.push(\"\");\n  return lines.join(\"\\n\");\n};\n\n/**\n * Quotes one Desktop Entry Exec argument.\n */\nexport const quoteDesktopExecArgument = (value: string): string => {\n  let escaped = '\"';\n  for (const character of value) {\n    if (\n      character === '\"' ||\n      character === \"\\\\\" ||\n      character === \"$\" ||\n      character === \"`\"\n    ) {\n      escaped += \"\\\\\";\n    }\n    escaped += character;\n  }\n  return `${escaped}\"`;\n};\n\nconst resolveConfigPath = async (\n  root: string,\n  configPath: string | undefined,\n): Promise<string | undefined> => {\n  if (configPath !== undefined) {\n    const resolvedPath = resolve(root, configPath);\n    if (await fileExists(resolvedPath)) {\n      return resolvedPath;\n    }\n    throw new Error(`Muon config file does not exist: ${resolvedPath}`);\n  }\n\n  for (const fileName of defaultConfigFileNames) {\n    const candidatePath = join(root, fileName);\n    if (await fileExists(candidatePath)) {\n      return candidatePath;\n    }\n  }\n  return undefined;\n};\n\nconst readJsonObjectFile = async (\n  filePath: string,\n  label: string,\n): Promise<JsonObject> => {\n  const parsed = parse(await readFile(filePath, \"utf8\"));\n  if (!isJsonObject(parsed)) {\n    throw new Error(`${label} must contain a JSON object: ${filePath}`);\n  }\n  return parsed;\n};\n\nconst readProjectJson = async (root: string): Promise<JsonObject> => {\n  const projectJsonPath = join(root, \"project.json\");\n  if (!(await fileExists(projectJsonPath))) {\n    return {};\n  }\n  return await readJsonObjectFile(projectJsonPath, \"project.json\");\n};\n\nconst createOptionsSource = (\n  options: MuonLinuxDesktopOptions | undefined,\n  directory: string,\n  label: string,\n): LinuxDesktopSource | undefined => {\n  if (options === undefined) {\n    return undefined;\n  }\n  return {\n    options: validateLinuxDesktopOptions(options, label),\n    directory,\n  };\n};\n\nconst readConfigLinuxDesktopSource = (\n  config: JsonObject,\n  directory: string,\n  label: string,\n): LinuxDesktopSource | undefined => {\n  const linux = config.linux;\n  if (linux === undefined) {\n    return undefined;\n  }\n  if (!isJsonObject(linux)) {\n    throw new Error(`${label} linux must be an object when present.`);\n  }\n  const desktop = linux.desktop;\n  if (desktop === undefined) {\n    return undefined;\n  }\n  return createOptionsSource(\n    validateLinuxDesktopOptions(desktop, `${label} linux.desktop`),\n    directory,\n    `${label} linux.desktop`,\n  );\n};\n\nconst validateLinuxDesktopOptions = (\n  value: unknown,\n  label: string,\n): MuonLinuxDesktopOptions => {\n  if (!isJsonObject(value)) {\n    throw new Error(`${label} must be an object.`);\n  }\n\n  const output: MuonLinuxDesktopOptions = {};\n  copyOptionalStringDesktopField(value, \"desktopId\", output);\n  copyOptionalStringDesktopField(value, \"name\", output);\n  copyOptionalStringDesktopField(value, \"comment\", output);\n  copyOptionalStringDesktopField(value, \"iconPath\", output);\n  copyOptionalCategoriesField(value, output, label);\n  copyOptionalBooleanDesktopField(value, \"startupNotify\", output, label);\n  return output;\n};\n\nconst copyOptionalStringDesktopField = (\n  source: JsonObject,\n  key: keyof Pick<\n    MuonLinuxDesktopOptions,\n    \"desktopId\" | \"name\" | \"comment\" | \"iconPath\"\n  >,\n  target: MuonLinuxDesktopOptions,\n): void => {\n  const value = source[key];\n  if (value === undefined) {\n    return;\n  }\n  if (typeof value !== \"string\") {\n    throw new Error(`${key} must be a string when present.`);\n  }\n  if (value.trim() !== \"\") {\n    target[key] = value.trim();\n  }\n};\n\nconst copyOptionalCategoriesField = (\n  source: JsonObject,\n  target: MuonLinuxDesktopOptions,\n  label: string,\n): void => {\n  const value = source.categories;\n  if (value === undefined) {\n    return;\n  }\n  if (\n    !Array.isArray(value) ||\n    !value.every(\n      (entry) =>\n        typeof entry === \"string\" &&\n        entry.trim() !== \"\" &&\n        !entry.includes(\";\") &&\n        !entry.includes(\"\\n\") &&\n        !entry.includes(\"\\r\"),\n    )\n  ) {\n    throw new Error(\n      `${label} categories must be a string array without semicolons when present.`,\n    );\n  }\n  target.categories = value.map((entry) => entry.trim());\n};\n\nconst copyOptionalBooleanDesktopField = (\n  source: JsonObject,\n  key: keyof Pick<MuonLinuxDesktopOptions, \"startupNotify\">,\n  target: MuonLinuxDesktopOptions,\n  label: string,\n): void => {\n  const value = source[key];\n  if (value === undefined) {\n    return;\n  }\n  if (typeof value !== \"boolean\") {\n    throw new Error(`${label} ${key} must be a boolean when present.`);\n  }\n  target[key] = value;\n};\n\nconst resolveStringField = (\n  sources: readonly LinuxDesktopSource[],\n  field: keyof Pick<MuonLinuxDesktopOptions, \"desktopId\" | \"name\" | \"comment\">,\n  fallback: string,\n): string => {\n  for (const source of sources) {\n    const value = source.options[field];\n    if (value !== undefined && value.trim() !== \"\") {\n      return value.trim();\n    }\n  }\n  return fallback;\n};\n\nconst resolveCategories = (\n  sources: readonly LinuxDesktopSource[],\n  fallback: readonly string[],\n): readonly string[] => {\n  for (const source of sources) {\n    if (source.options.categories !== undefined) {\n      return source.options.categories;\n    }\n  }\n  return fallback;\n};\n\nconst resolveBooleanField = (\n  sources: readonly LinuxDesktopSource[],\n  field: keyof Pick<MuonLinuxDesktopOptions, \"startupNotify\">,\n  fallback: boolean,\n): boolean => {\n  for (const source of sources) {\n    const value = source.options[field];\n    if (value !== undefined) {\n      return value;\n    }\n  }\n  return fallback;\n};\n\nconst resolveLinuxIconPath = async (\n  sources: readonly LinuxDesktopSource[],\n  appIconSources: readonly MuonAppIconSource[],\n  defaultIconPath: string | undefined,\n): Promise<string> => {\n  for (const source of sources) {\n    const value = source.options.iconPath;\n    if (value !== undefined && value.trim() !== \"\") {\n      const iconPath = resolveResourcePath(source.directory, value);\n      await assertIconPath(iconPath, true);\n      return iconPath;\n    }\n  }\n  const appIconPath = await resolveMuonAppIconPath(appIconSources);\n  if (appIconPath !== undefined) {\n    return appIconPath;\n  }\n  if (defaultIconPath !== undefined && (await fileExists(defaultIconPath))) {\n    await assertIconPath(defaultIconPath, false);\n    return defaultIconPath;\n  }\n  throw new Error(\"Linux desktop icon does not exist.\");\n};\n\nconst assertIconPath = async (\n  iconPath: string,\n  required: boolean,\n): Promise<void> => {\n  if (extname(iconPath).toLowerCase() !== \".png\") {\n    throw new Error(`Linux desktop icon must be a .png file: ${iconPath}`);\n  }\n  if (required && !(await fileExists(iconPath))) {\n    throw new Error(`Linux desktop icon does not exist: ${iconPath}`);\n  }\n  if (await fileExists(iconPath)) {\n    await createNormalizedIconPngData(\n      await readFile(iconPath),\n      iconPath,\n      \"Linux desktop icon\",\n    );\n  }\n};\n\nconst resolveDefaultLinuxDesktopIcon = async (\n  packageDirectory: string,\n): Promise<string | undefined> => {\n  const candidates = [\n    join(resolve(packageDirectory), \"native\", \"muon-256.png\"),\n    join(moduleDirectory, \"native\", \"muon-256.png\"),\n    join(moduleDirectory, \"..\", \"dist\", \"native\", \"muon-256.png\"),\n    join(moduleDirectory, \"..\", \"..\", \"images\", \"muon-256.png\"),\n  ];\n  for (const candidate of candidates) {\n    if (await fileExists(candidate)) {\n      return candidate;\n    }\n  }\n  return undefined;\n};\n\nconst sanitizeDesktopId = (value: string): string => {\n  const sanitized = value\n    .trim()\n    .toLowerCase()\n    .replace(/[^a-z0-9._-]+/g, \"-\")\n    .replace(/^[.-]+/g, \"\")\n    .replace(/[.-]+$/g, \"\");\n  return sanitized.length > 0 ? sanitized : \"muon-app\";\n};\n\nconst escapeDesktopString = (value: string): string =>\n  value\n    .replaceAll(\"\\\\\", \"\\\\\\\\\")\n    .replaceAll(\"\\n\", \"\\\\n\")\n    .replaceAll(\"\\r\", \"\\\\r\")\n    .replaceAll(\"\\t\", \"\\\\t\");\n\nconst resolveResourcePath = (directory: string, path: string): string => {\n  return isAbsolute(path) ? path : resolve(directory, path);\n};\n\nconst fileExists = async (path: string): Promise<boolean> => {\n  try {\n    await access(path, constants.F_OK);\n    return true;\n  } catch {\n    return false;\n  }\n};\n\nconst isJsonObject = (value: unknown): value is JsonObject =>\n  typeof value === \"object\" && value !== null && !Array.isArray(value);\n","// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { constants, type Stats } from \"node:fs\";\nimport {\n  access,\n  chmod,\n  copyFile,\n  mkdir,\n  mkdtemp,\n  readFile,\n  readdir,\n  rm,\n  stat,\n  writeFile,\n} from \"node:fs/promises\";\nimport { createHash, randomBytes } from \"node:crypto\";\nimport { dirname, join, relative, resolve, sep } from \"node:path\";\nimport { tmpdir } from \"node:os\";\nimport { fileURLToPath } from \"node:url\";\nimport AdmZip from \"adm-zip\";\nimport { parse } from \"json5\";\nimport {\n  embedMuonConfigInBootstrapFile,\n  embedMuonConfigInRuntime,\n} from \"./embed-config.js\";\nimport { getDefaultMuonPrepareTarget } from \"./prepare.js\";\nimport {\n  allMuonTargets,\n  getMuonTargetDescriptor,\n  getMuonTargetRuntimeAppId,\n  normalizeMuonTarget,\n  type MuonTarget,\n  type MuonTargetDescriptor,\n} from \"./targets.js\";\nimport {\n  resolveMuonWindowsResource,\n  stripBuildOnlyWindowsResourceConfig,\n  updateWindowsPeIconResource,\n  updateWindowsPeResources,\n  type MuonWindowsResourceOptions,\n  type ResolvedMuonWindowsResource,\n} from \"./windows-resource.js\";\nimport {\n  resolveMuonLinuxDesktop,\n  stripBuildOnlyLinuxDesktopConfig,\n  writeLinuxDesktopDistributionFiles,\n  type MuonLinuxDesktopOptions,\n  type ResolvedMuonLinuxDesktop,\n} from \"./linux-desktop.js\";\nimport { appIconAssetEntryName, appIconAssetUrl } from \"./app-icon.js\";\nimport type { MuonRuntimePluginConfig } from \"./capability.js\";\n\nconst defaultConfigFileNames = [\"muon.json5\", \"muon.jsonc\", \"muon.json\"];\nconst appConfigSourcePath = \"./assets.zip\";\nconst defaultAppName = \"muon-app\";\nconst defaultAppId = \"muon-app\";\nconst muonLicenseFileName = \"CREDITS.md\";\nconst directoryMode = 0o755;\nconst executableMode = 0o755;\nconst assetSaltByteLength = 16;\nconst moduleDirectory =\n  typeof __dirname === \"string\"\n    ? __dirname\n    : dirname(fileURLToPath(import.meta.url));\n\ntype JsonObject = Record<string, unknown>;\n\ntype AssetInput = {\n  sourcePath: string;\n  prefix: string;\n};\n\ntype BuildConfig = {\n  config: JsonObject;\n  directory: string;\n};\n\ntype ZipEntry = {\n  name: string;\n  data: Buffer;\n};\n\n/**\n * Public Muon runtime target used by CLI, Vite options, and package layout.\n */\nexport type MuonBuildTarget = MuonTarget;\n\n/**\n * Options for creating redistributable Muon app directories.\n */\nexport interface MuonBuildOptions {\n  /**\n   * Project root containing package.json, muon.json, and app assets.\n   */\n  root?: string;\n  /**\n   * Directory containing package runtime/ and native/ folders.\n   *\n   * @remarks This defaults to the installed muon package dist directory.\n   */\n  packageDirectory?: string;\n  /**\n   * Public target identifiers to build.\n   */\n  targets?: readonly string[];\n  /**\n   * Build every supported target from the installed package.\n   *\n   * @remarks Defaults to true when targets is omitted. Set false to build only\n   * the host target.\n   */\n  allTargets?: boolean;\n  /**\n   * File name used for the app launcher.\n   *\n   * @remarks The .exe suffix is added automatically for Windows targets.\n   */\n  appName?: string;\n  /**\n   * Stable base application identifier used for portable runtime state.\n   *\n   * @remarks Windows target distributions embed `<appId>.<arch>` as their\n   * runtime app identifier. Linux targets embed this value unchanged.\n   */\n  appId?: string;\n  /**\n   * Parent directory that receives dist-muon/linux-amd64/ style outputs.\n   */\n  outputRoot?: string;\n  /**\n   * Directory or ZIP file used as app assets.\n   */\n  assetSourcePath?: string;\n  /**\n   * Optional ZIP entry prefix used for the asset source.\n   */\n  assetPrefix?: string;\n  /**\n   * Muon config path to embed.\n   */\n  configPath?: string;\n  /**\n   * Static application icon PNG file path.\n   *\n   * @remarks This icon is used as the shared source for Windows PE/NSIS,\n   * Linux desktop entries, and the generated initial title bar icon asset.\n   * Platform-specific icon paths override it for their target.\n   */\n  iconPath?: string;\n  /**\n   * Windows PE and NSIS resource metadata.\n   *\n   * @defaultValue Uses `muon.json` `windows.resource`, `project.json`,\n   * `package.json`, then Muon defaults.\n   */\n  windowsResource?: MuonWindowsResourceOptions;\n  /**\n   * Linux desktop entry metadata.\n   *\n   * @defaultValue Uses `muon.json` `linux.desktop`, package metadata, then\n   * Muon defaults.\n   */\n  linuxDesktop?: MuonLinuxDesktopOptions;\n  /**\n   * Asset salt override for deterministic tests.\n   *\n   * @remarks Production builds should omit this option.\n   */\n  assetSalt?: Uint8Array;\n  /**\n   * Runtime plugin configuration supplied by a bundler integration.\n   *\n   * @internal\n   */\n  runtimePluginConfig?: MuonRuntimePluginConfig;\n}\n\n/**\n * Asset metadata generated for a target distribution.\n */\nexport interface MuonBuildAssetResult {\n  /**\n   * Path of the generated assets.zip.\n   */\n  path: string;\n  /**\n   * SHA-1 signature for the generated asset archive and salt.\n   */\n  signature: string;\n  /**\n   * Hex encoded salt embedded into muon.json.\n   */\n  salt: string;\n  /**\n   * Number of files written to the ZIP archive.\n   */\n  entryCount: number;\n}\n\n/**\n * Result for one generated target distribution.\n */\nexport interface MuonBuildTargetResult {\n  /**\n   * Public target identifier used by the muon npm package.\n   */\n  target: MuonBuildTarget;\n  /**\n   * Fixed output directory path for the target.\n   */\n  distributionDirectoryName: string;\n  /**\n   * Absolute path of the generated target directory.\n   */\n  outputPath: string;\n  /**\n   * Absolute path of the app launcher copied from muon-bootstrap.\n   */\n  launcherPath: string;\n  /**\n   * Generated asset archive metadata.\n   */\n  asset: MuonBuildAssetResult;\n  /**\n   * Application identifier embedded into this target distribution.\n   *\n   * @remarks Windows targets append the target architecture to the base\n   * `appId`; Linux targets use the base `appId` unchanged.\n   */\n  runtimeAppId: string;\n  /**\n   * Config object embedded into muon-core and the app launcher.\n   */\n  embeddedConfig: JsonObject;\n  /**\n   * Linux desktop integration metadata when the target is Linux.\n   */\n  linuxDesktop?: ResolvedMuonLinuxDesktop;\n}\n\n/**\n * Result of a Muon app build.\n */\nexport interface MuonBuildResult {\n  /**\n   * Absolute project root used for the build.\n   */\n  root: string;\n  /**\n   * Sanitized app launcher base name.\n   */\n  appName: string;\n  /**\n   * Stable base application identifier used to derive target runtime state.\n   *\n   * @remarks See each target's `runtimeAppId` for the identifier embedded into\n   * that target distribution.\n   */\n  appId: string;\n  /**\n   * Generated target distributions.\n   */\n  targets: MuonBuildTargetResult[];\n}\n\n/**\n * Returns the host target used by muon build when no explicit target is passed.\n */\nexport const getDefaultMuonBuildTarget = (): MuonBuildTarget => {\n  return getDefaultMuonPrepareTarget(process.platform, process.arch);\n};\n\n/**\n * Normalizes a user-facing public target identifier.\n */\nexport const normalizeMuonBuildTarget = (target: string): MuonBuildTarget => {\n  return normalizeMuonTarget(target, \"muon build target\");\n};\n\n/**\n * Builds CEF-free Muon app distribution directories for one or more targets.\n */\nexport const buildMuonApp = async (\n  options: MuonBuildOptions = {},\n): Promise<MuonBuildResult> => {\n  const root = resolve(options.root ?? process.cwd());\n  const packageDirectory = resolvePackageDirectory(options.packageDirectory);\n  const targets = resolveBuildTargets(options);\n  const outputRoot = resolve(root, options.outputRoot ?? \".\");\n  const packageJson = await readPackageJson(root);\n  const appName = resolveAppName(packageJson, options.appName);\n  const appId = resolveAppId(packageJson, options.appId);\n  const buildConfig = await readBuildConfig(root, options.configPath);\n  const sourceConfig = applyRuntimePluginConfig(\n    buildConfig.config,\n    options.runtimePluginConfig ?? { mode: \"simple\" },\n  );\n  assertNoUserInitialTitleBarIcon(sourceConfig);\n  const resolvedBuildConfig: BuildConfig = {\n    ...buildConfig,\n    config: sourceConfig,\n  };\n  const assetInput = resolveAssetInput(\n    root,\n    options.assetSourcePath,\n    options.assetPrefix,\n    resolvedBuildConfig,\n  );\n  const windowsResource = await resolveMuonWindowsResource({\n    root,\n    packageDirectory,\n    packageJson,\n    muonConfig: sourceConfig,\n    muonConfigDirectory: buildConfig.directory,\n    options: options.windowsResource,\n    appIconPath: options.iconPath,\n    defaults: {\n      productName: appName,\n      fileDescription: appName,\n      companyName: \"Unknown\",\n      version: \"0.0.0\",\n      copyright: undefined,\n    },\n  });\n  const linuxDesktop = await resolveMuonLinuxDesktop({\n    root,\n    packageDirectory,\n    muonConfig: sourceConfig,\n    muonConfigDirectory: buildConfig.directory,\n    options: options.linuxDesktop,\n    appIconPath: options.iconPath,\n    defaults: {\n      desktopId: appId,\n      name: resolveLinuxDesktopDefaultName(packageJson, appName),\n      comment: resolvePackageDescription(packageJson),\n      categories: [\"Utility\"],\n      startupNotify: true,\n    },\n  });\n  const salt = Buffer.from(\n    options.assetSalt ?? randomBytes(assetSaltByteLength),\n  );\n\n  const results: MuonBuildTargetResult[] = [];\n\n  for (const target of targets) {\n    const result = await buildMuonTarget({\n      packageDirectory,\n      root,\n      outputRoot,\n      appName,\n      appId,\n      target,\n      assetInput,\n      sourceConfig,\n      windowsResource,\n      linuxDesktop,\n      salt,\n    });\n    results.push(result);\n  }\n\n  return {\n    root,\n    appName,\n    appId,\n    targets: results,\n  };\n};\n\nconst resolvePackageDirectory = (\n  packageDirectory: string | undefined,\n): string => {\n  if (packageDirectory !== undefined) {\n    return resolve(packageDirectory);\n  }\n\n  return moduleDirectory;\n};\n\nconst resolveBuildTargets = (options: MuonBuildOptions): MuonBuildTarget[] => {\n  if (options.allTargets === true) {\n    return [...allMuonTargets];\n  }\n\n  if (options.targets !== undefined && options.targets.length > 0) {\n    return [\n      ...new Set(\n        options.targets.map((target) => normalizeMuonBuildTarget(target)),\n      ),\n    ];\n  }\n\n  if (options.allTargets !== false) {\n    return [...allMuonTargets];\n  }\n\n  return [getDefaultMuonBuildTarget()];\n};\n\nconst resolveAssetInput = (\n  root: string,\n  assetSourcePath: string | undefined,\n  assetPrefix: string | undefined,\n  buildConfig: BuildConfig,\n): AssetInput => {\n  const configuredAssetSourcePath =\n    assetSourcePath === undefined\n      ? readConfigAssetSourcePath(buildConfig.config)\n      : undefined;\n  const sourcePath =\n    assetSourcePath !== undefined\n      ? resolve(root, assetSourcePath)\n      : configuredAssetSourcePath !== undefined\n        ? resolve(buildConfig.directory, configuredAssetSourcePath)\n        : resolve(root, \"assets\");\n  return {\n    sourcePath,\n    prefix: normalizeZipPrefix(assetPrefix ?? \"\"),\n  };\n};\n\nconst normalizeZipPrefix = (prefix: string): string => {\n  const normalized = prefix\n    .replaceAll(\"\\\\\", \"/\")\n    .split(\"/\")\n    .filter((part) => part.length > 0)\n    .join(\"/\");\n\n  return normalized.length > 0 ? `${normalized}/` : \"\";\n};\n\nconst readPackageJson = async (root: string): Promise<JsonObject> => {\n  const packageJsonPath = join(root, \"package.json\");\n  if (!(await fileExists(packageJsonPath))) {\n    return {};\n  }\n  return await readJsonObjectFile(packageJsonPath, \"package.json\");\n};\n\nconst resolvePackageName = (packageJson: JsonObject): string => {\n  return typeof packageJson.name === \"string\"\n    ? packageJson.name\n    : defaultAppName;\n};\n\nconst resolveAppName = (\n  packageJson: JsonObject,\n  appName: string | undefined,\n): string => {\n  if (appName !== undefined) {\n    return sanitizeAppName(appName);\n  }\n\n  const packageName = resolvePackageName(packageJson);\n  const unscopedName = packageName.startsWith(\"@\")\n    ? packageName.slice(packageName.indexOf(\"/\") + 1)\n    : packageName;\n\n  return sanitizeAppName(unscopedName);\n};\n\nconst sanitizeAppName = (name: string): string => {\n  const sanitized = name\n    .trim()\n    .toLowerCase()\n    .replace(/[^a-z0-9._-]+/g, \"-\")\n    .replace(/^[.-]+/g, \"\")\n    .replace(/[.-]+$/g, \"\");\n\n  return sanitized.length > 0 ? sanitized : defaultAppName;\n};\n\nconst resolveAppId = (\n  packageJson: JsonObject,\n  appId: string | undefined,\n): string => {\n  if (appId !== undefined) {\n    return sanitizeAppId(appId);\n  }\n  return sanitizeAppId(resolvePackageName(packageJson));\n};\n\nconst sanitizeAppId = (value: string): string => {\n  const unscoped = value.startsWith(\"@\") ? value.slice(1) : value;\n  const sanitized = unscoped\n    .trim()\n    .toLowerCase()\n    .replace(\"/\", \".\")\n    .replace(/[^a-z0-9._-]+/g, \".\")\n    .replace(/^[.]+/g, \"\")\n    .replace(/[.]+$/g, \"\");\n  return sanitized.length > 0 ? sanitized : defaultAppId;\n};\n\nconst resolveLinuxDesktopDefaultName = (\n  packageJson: JsonObject,\n  appName: string,\n): string =>\n  typeof packageJson.name === \"string\" && packageJson.name.trim() !== \"\"\n    ? packageJson.name.trim()\n    : appName;\n\nconst resolvePackageDescription = (packageJson: JsonObject): string =>\n  typeof packageJson.description === \"string\"\n    ? packageJson.description.trim()\n    : \"\";\n\nconst readBuildConfig = async (\n  root: string,\n  configPath: string | undefined,\n): Promise<BuildConfig> => {\n  const resolvedConfigPath = await resolveConfigPath(root, configPath);\n  if (resolvedConfigPath === undefined) {\n    return {\n      config: {},\n      directory: root,\n    };\n  }\n\n  return {\n    config: await readJsonObjectFile(resolvedConfigPath, \"Muon config file\"),\n    directory: dirname(resolvedConfigPath),\n  };\n};\n\nconst applyRuntimePluginConfig = (\n  sourceConfig: JsonObject,\n  runtimePluginConfig: MuonRuntimePluginConfig | undefined,\n): JsonObject => {\n  if (runtimePluginConfig === undefined) {\n    return sourceConfig;\n  }\n\n  const sourcePlugin = sourceConfig.plugin;\n  if (sourcePlugin !== undefined && !isJsonObject(sourcePlugin)) {\n    throw new Error(\n      \"muon.json plugin must be an object when runtime plugin config is applied.\",\n    );\n  }\n  const plugin: JsonObject = sourcePlugin ?? {};\n\n  return {\n    ...sourceConfig,\n    plugin: {\n      ...plugin,\n      ...runtimePluginConfig,\n    },\n  };\n};\n\nconst readConfigAssetSourcePath = (\n  sourceConfig: JsonObject,\n): string | undefined => {\n  const sourceAsset = sourceConfig.asset;\n  if (sourceAsset === undefined) {\n    return undefined;\n  }\n  if (!isJsonObject(sourceAsset)) {\n    throw new Error(\"muon.json asset must be an object when present.\");\n  }\n\n  const sourceAssetPath = sourceAsset.sourcePath;\n  if (sourceAssetPath === undefined) {\n    return undefined;\n  }\n  if (typeof sourceAssetPath !== \"string\") {\n    throw new Error(\n      \"muon.json asset.sourcePath must be a string when present.\",\n    );\n  }\n\n  return sourceAssetPath;\n};\n\nconst resolveConfigPath = async (\n  root: string,\n  configPath: string | undefined,\n): Promise<string | undefined> => {\n  if (configPath !== undefined) {\n    const resolvedPath = resolve(root, configPath);\n    if (await fileExists(resolvedPath)) {\n      return resolvedPath;\n    }\n\n    throw new Error(`Muon config file does not exist: ${resolvedPath}`);\n  }\n\n  for (const fileName of defaultConfigFileNames) {\n    const candidatePath = join(root, fileName);\n    if (await fileExists(candidatePath)) {\n      return candidatePath;\n    }\n  }\n\n  return undefined;\n};\n\nconst readJsonObjectFile = async (\n  filePath: string,\n  label: string,\n): Promise<JsonObject> => {\n  let content: string;\n  try {\n    content = await readFile(filePath, \"utf8\");\n  } catch (error) {\n    throw new Error(\n      `${label} could not be read: ${filePath}: ${getErrorMessage(error)}`,\n    );\n  }\n\n  let parsed: unknown;\n  try {\n    parsed = parse(content);\n  } catch (error) {\n    throw new Error(\n      `${label} could not be parsed: ${filePath}: ${getErrorMessage(error)}`,\n    );\n  }\n\n  if (!isJsonObject(parsed)) {\n    throw new Error(`${label} must contain a JSON object: ${filePath}`);\n  }\n\n  return parsed;\n};\n\nconst buildMuonTarget = async (input: {\n  packageDirectory: string;\n  root: string;\n  outputRoot: string;\n  appName: string;\n  appId: string;\n  target: MuonBuildTarget;\n  assetInput: AssetInput;\n  sourceConfig: JsonObject;\n  windowsResource: ResolvedMuonWindowsResource;\n  linuxDesktop: ResolvedMuonLinuxDesktop;\n  salt: Buffer;\n}): Promise<MuonBuildTargetResult> => {\n  const descriptor = getMuonTargetDescriptor(input.target);\n  const sourceRuntimePath = join(\n    input.packageDirectory,\n    \"runtime\",\n    input.target,\n  );\n  const sourceBootstrapPath = join(\n    input.packageDirectory,\n    \"native\",\n    input.target,\n    descriptor.bootstrapExecutableName,\n  );\n  const outputPath = join(\n    input.outputRoot,\n    descriptor.distributionDirectoryName,\n  );\n  const launcherPath = join(\n    outputPath,\n    getLauncherFileName(input.appName, descriptor),\n  );\n  const assetZipPath = join(outputPath, \"assets.zip\");\n  const runtimeAppId = getMuonTargetRuntimeAppId(input.appId, input.target);\n  const appIconPath =\n    descriptor.os === \"windows\"\n      ? input.windowsResource.iconPath\n      : input.linuxDesktop.iconPath;\n\n  await verifyTargetInputs({\n    sourceRuntimePath,\n    sourceBootstrapPath,\n    descriptor,\n    target: input.target,\n  });\n\n  await rm(outputPath, { recursive: true, force: true });\n  await mkdir(outputPath, { recursive: true, mode: directoryMode });\n  await copyRuntimeFiles(sourceRuntimePath, outputPath, descriptor);\n  await chmod(\n    join(outputPath, descriptor.runtimeExecutableName),\n    executableMode,\n  );\n  await copyFile(sourceBootstrapPath, launcherPath);\n  await chmod(launcherPath, executableMode);\n\n  const asset = await writeAssetArchive(\n    input.assetInput,\n    assetZipPath,\n    input.salt,\n    [{ name: appIconAssetEntryName, data: await readFile(appIconPath) }],\n  );\n  const embeddedConfig = createEmbeddedConfig(\n    input.sourceConfig,\n    asset,\n    runtimeAppId,\n    input.linuxDesktop.desktopId,\n    appIconAssetUrl,\n  );\n\n  await withTemporaryConfig(embeddedConfig, async (configPath) => {\n    await embedMuonConfigInRuntime({\n      runtimePath: outputPath,\n      configPath,\n      outputRuntimePath: undefined,\n    });\n    await embedMuonConfigInBootstrapFile({\n      bootstrapPath: launcherPath,\n      configPath,\n      outputPath: undefined,\n    });\n  });\n\n  if (descriptor.os === \"windows\") {\n    await updateWindowsPeIconResource({\n      executablePath: join(outputPath, descriptor.runtimeExecutableName),\n      resource: input.windowsResource,\n      environment: process.env,\n      cwd: input.root,\n    });\n    await updateWindowsPeResources({\n      executablePath: launcherPath,\n      resource: input.windowsResource,\n      environment: process.env,\n      cwd: input.root,\n    });\n  } else if (descriptor.os === \"linux\") {\n    await writeLinuxDesktopDistributionFiles(outputPath, input.linuxDesktop);\n  }\n\n  return {\n    target: input.target,\n    distributionDirectoryName: descriptor.distributionDirectoryName,\n    outputPath,\n    launcherPath,\n    asset,\n    runtimeAppId,\n    embeddedConfig,\n    ...(descriptor.os === \"linux\" ? { linuxDesktop: input.linuxDesktop } : {}),\n  };\n};\n\nconst verifyTargetInputs = async (input: {\n  sourceRuntimePath: string;\n  sourceBootstrapPath: string;\n  descriptor: MuonTargetDescriptor;\n  target: MuonBuildTarget;\n}): Promise<void> => {\n  await assertDirectory(\n    input.sourceRuntimePath,\n    `Muon runtime for ${input.target}`,\n  );\n  await assertFile(\n    input.sourceBootstrapPath,\n    `Muon bootstrap for ${input.target}`,\n  );\n  for (const fileName of input.descriptor.runtimeFiles) {\n    await assertFile(\n      join(input.sourceRuntimePath, fileName),\n      `Muon runtime file ${fileName} for ${input.target}`,\n    );\n  }\n  await assertFile(\n    join(input.sourceRuntimePath, muonLicenseFileName),\n    `Muon license file for ${input.target}`,\n  );\n};\n\nconst getLauncherFileName = (\n  appName: string,\n  descriptor: MuonTargetDescriptor,\n): string => {\n  if (\n    descriptor.launcherExtension.length > 0 &&\n    !appName.endsWith(descriptor.launcherExtension)\n  ) {\n    return `${appName}${descriptor.launcherExtension}`;\n  }\n\n  return appName;\n};\n\nconst copyRuntimeFiles = async (\n  sourceRuntimePath: string,\n  outputPath: string,\n  descriptor: MuonTargetDescriptor,\n): Promise<void> => {\n  for (const fileName of descriptor.runtimeFiles) {\n    await copyFile(\n      join(sourceRuntimePath, fileName),\n      join(outputPath, fileName),\n    );\n  }\n  if (descriptor.optionalRuntimeFilePatterns !== undefined) {\n    const fileNames = await readdir(sourceRuntimePath);\n    for (const fileName of fileNames) {\n      if (\n        descriptor.optionalRuntimeFilePatterns.some((pattern) =>\n          pattern.test(fileName),\n        )\n      ) {\n        await copyFile(\n          join(sourceRuntimePath, fileName),\n          join(outputPath, fileName),\n        );\n      }\n    }\n  }\n  await copyFile(\n    join(sourceRuntimePath, muonLicenseFileName),\n    join(outputPath, muonLicenseFileName),\n  );\n};\n\nconst writeAssetArchive = async (\n  input: AssetInput,\n  outputPath: string,\n  salt: Buffer,\n  extraEntries: readonly ZipEntry[],\n): Promise<MuonBuildAssetResult> => {\n  const sourceStats = await statOrUndefined(input.sourcePath);\n  if (sourceStats === undefined) {\n    throw new Error(`Muon asset source does not exist: ${input.sourcePath}`);\n  }\n\n  const archive = sourceStats.isDirectory()\n    ? await createAssetArchiveFromDirectory(input, extraEntries)\n    : sourceStats.isFile()\n      ? await createAssetArchiveFromZipFile(input.sourcePath, extraEntries)\n      : undefined;\n  if (archive === undefined) {\n    throw new Error(\n      `Muon asset source is not a directory or file: ${input.sourcePath}`,\n    );\n  }\n  await writeFile(outputPath, archive);\n\n  const signature = createHash(\"sha1\")\n    .update(archive)\n    .update(salt)\n    .digest(\"hex\");\n  return {\n    path: outputPath,\n    signature,\n    salt: salt.toString(\"hex\"),\n    entryCount: sourceStats.isDirectory()\n      ? readZipEntryCount(archive, outputPath)\n      : readZipEntryCount(archive, input.sourcePath),\n  };\n};\n\nconst createAssetArchiveFromDirectory = async (\n  input: AssetInput,\n  extraEntries: readonly ZipEntry[],\n): Promise<Buffer> => {\n  const entries = await collectZipEntries(input.sourcePath, input.prefix);\n  if (entries.length === 0) {\n    throw new Error(`Muon asset source has no files: ${input.sourcePath}`);\n  }\n\n  return createZipArchive(appendZipEntries(entries, extraEntries));\n};\n\nconst createAssetArchiveFromZipFile = async (\n  sourcePath: string,\n  extraEntries: readonly ZipEntry[],\n): Promise<Buffer> => {\n  const zip = new AdmZip(await readFile(sourcePath));\n  for (const entry of extraEntries) {\n    assertSafeZipEntryName(entry.name);\n    if (zip.getEntry(entry.name) !== null) {\n      throw new Error(\n        `Muon app icon asset entry already exists: ${entry.name}`,\n      );\n    }\n    zip.addFile(entry.name, entry.data);\n  }\n  return zip.toBuffer();\n};\n\nconst appendZipEntries = (\n  entries: readonly ZipEntry[],\n  extraEntries: readonly ZipEntry[],\n): ZipEntry[] => {\n  const output = [...entries];\n  const names = new Set(entries.map((entry) => entry.name));\n  for (const entry of extraEntries) {\n    assertSafeZipEntryName(entry.name);\n    if (names.has(entry.name)) {\n      throw new Error(\n        `Muon app icon asset entry already exists: ${entry.name}`,\n      );\n    }\n    names.add(entry.name);\n    output.push(entry);\n  }\n  return output;\n};\n\nconst readZipEntryCount = (archive: Buffer, sourcePath: string): number => {\n  const endSignature = 0x06054b50;\n  const lastPossibleOffset = archive.length - 22;\n  const firstPossibleOffset = Math.max(0, lastPossibleOffset - 0xffff);\n\n  for (\n    let offset = lastPossibleOffset;\n    offset >= firstPossibleOffset;\n    offset -= 1\n  ) {\n    if (archive.readUInt32LE(offset) === endSignature) {\n      return archive.readUInt16LE(offset + 10);\n    }\n  }\n\n  throw new Error(`Muon asset ZIP could not be read: ${sourcePath}`);\n};\n\nconst collectZipEntries = async (\n  sourcePath: string,\n  prefix: string,\n): Promise<ZipEntry[]> => {\n  const entries: ZipEntry[] = [];\n\n  const walk = async (directoryPath: string): Promise<void> => {\n    const dirents = await readdir(directoryPath, { withFileTypes: true });\n    dirents.sort((a, b) => a.name.localeCompare(b.name));\n\n    for (const dirent of dirents) {\n      const childPath = join(directoryPath, dirent.name);\n      if (dirent.isDirectory()) {\n        await walk(childPath);\n      } else if (dirent.isFile()) {\n        const relativePath = relative(sourcePath, childPath)\n          .split(sep)\n          .join(\"/\");\n        const name = `${prefix}${relativePath}`;\n        assertSafeZipEntryName(name);\n        entries.push({\n          name,\n          data: await readFile(childPath),\n        });\n      }\n    }\n  };\n\n  await walk(sourcePath);\n  return entries;\n};\n\nconst assertSafeZipEntryName = (name: string): void => {\n  if (\n    name.length === 0 ||\n    name.startsWith(\"/\") ||\n    name.includes(\"..\") ||\n    name.includes(\"\\\\\")\n  ) {\n    throw new Error(`Unsafe ZIP entry name: ${name}`);\n  }\n};\n\nconst createZipArchive = (entries: readonly ZipEntry[]): Buffer => {\n  const zip = new AdmZip();\n  for (const entry of entries) {\n    zip.addFile(entry.name, entry.data);\n  }\n\n  return zip.toBuffer();\n};\n\nconst createEmbeddedConfig = (\n  sourceConfig: JsonObject,\n  asset: MuonBuildAssetResult,\n  appId: string,\n  desktopId: string,\n  initialTitleBarIcon: string,\n): JsonObject => {\n  const sourceAsset = sourceConfig.asset;\n  if (sourceAsset !== undefined && !isJsonObject(sourceAsset)) {\n    throw new Error(\"muon.json asset must be an object when present.\");\n  }\n  const sourceBootstrap = sourceConfig.bootstrap;\n  if (sourceBootstrap !== undefined && !isJsonObject(sourceBootstrap)) {\n    throw new Error(\"muon.json bootstrap must be an object when present.\");\n  }\n\n  const runtimeConfig = stripBuildOnlyAppIconConfig(\n    stripBuildOnlyLinuxDesktopConfig(\n      stripBuildOnlyWindowsResourceConfig(sourceConfig),\n    ),\n  );\n  const sourceBrowser = runtimeConfig.browser;\n  if (sourceBrowser !== undefined && !isJsonObject(sourceBrowser)) {\n    throw new Error(\"muon.json browser must be an object when present.\");\n  }\n\n  return {\n    ...runtimeConfig,\n    browser: {\n      ...(sourceBrowser ?? {}),\n      initialTitleBarIcon,\n    },\n    asset: {\n      ...(sourceAsset ?? {}),\n      sourcePath: appConfigSourcePath,\n      signature: asset.signature,\n      salt: asset.salt,\n    },\n    bootstrap: {\n      ...(sourceBootstrap ?? {}),\n      appId,\n      desktopId,\n    },\n  };\n};\n\nconst assertNoUserInitialTitleBarIcon = (sourceConfig: JsonObject): void => {\n  const sourceBrowser = sourceConfig.browser;\n  if (sourceBrowser === undefined) {\n    return;\n  }\n  if (!isJsonObject(sourceBrowser)) {\n    throw new Error(\"muon.json browser must be an object when present.\");\n  }\n  if (sourceBrowser.initialTitleBarIcon !== undefined) {\n    throw new Error(\n      \"muon.json browser.initialTitleBarIcon is generated by muon build; use top-level iconPath instead.\",\n    );\n  }\n};\n\nconst stripBuildOnlyAppIconConfig = (sourceConfig: JsonObject): JsonObject => {\n  const output: JsonObject = {};\n  for (const [key, value] of Object.entries(sourceConfig)) {\n    if (key !== \"iconPath\") {\n      output[key] = value;\n    }\n  }\n  return output;\n};\n\nconst withTemporaryConfig = async (\n  config: JsonObject,\n  callback: (configPath: string) => Promise<void>,\n): Promise<void> => {\n  const tempDirectory = await mkdtemp(join(tmpdir(), \"muon-build-config-\"));\n  const configPath = join(tempDirectory, \"muon.json\");\n  try {\n    await writeFile(configPath, `${JSON.stringify(config, undefined, 2)}\\n`);\n    await callback(configPath);\n  } finally {\n    await rm(tempDirectory, { recursive: true, force: true });\n  }\n};\n\nconst assertDirectory = async (path: string, label: string): Promise<void> => {\n  const stats = await statOrUndefined(path);\n  if (stats === undefined || !stats.isDirectory()) {\n    throw new Error(`${label} directory does not exist: ${path}`);\n  }\n};\n\nconst assertFile = async (path: string, label: string): Promise<void> => {\n  const stats = await statOrUndefined(path);\n  if (stats === undefined || !stats.isFile()) {\n    throw new Error(`${label} file does not exist: ${path}`);\n  }\n};\n\nconst statOrUndefined = async (path: string): Promise<Stats | undefined> => {\n  try {\n    return await stat(path);\n  } catch {\n    return undefined;\n  }\n};\n\nconst fileExists = async (path: string): Promise<boolean> => {\n  try {\n    await access(path, constants.F_OK);\n    return true;\n  } catch {\n    return false;\n  }\n};\n\nconst isJsonObject = (value: unknown): value is JsonObject => {\n  return typeof value === \"object\" && value !== null && !Array.isArray(value);\n};\n\nconst getErrorMessage = (error: unknown): string =>\n  error instanceof Error ? error.message : String(error);\n","// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { createHash } from \"node:crypto\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, join, relative } from \"node:path\";\n\n/**\n * Import-side capability rule for Muon plugin virtual modules.\n */\nexport interface MuonCapabilityImportOptions {\n  /**\n   * Importer path globs relative to the bundler project root.\n   */\n  sources?: readonly string[];\n  /**\n   * NPM package names allowed to import the virtual module.\n   */\n  packages?: readonly string[];\n  /**\n   * Plugin function path globs allowed for matching importers.\n   */\n  allow: readonly string[];\n  /**\n   * Plugin entry name that supplied this rule.\n   *\n   * @internal\n   */\n  pluginName?: string;\n}\n\n/**\n * Capability import configuration shared by bundler integrations.\n */\nexport interface MuonCapabilityOptions {\n  /**\n   * Capability imports allowed by importer path.\n   */\n  imports?: readonly MuonCapabilityImportOptions[];\n}\n\n/**\n * Runtime capability policy generated for muon-core.\n */\nexport interface MuonCapabilityRuntimeEntry {\n  /**\n   * Opaque capability id embedded into generated virtual modules.\n   */\n  id: string;\n  /**\n   * Plugin function path globs allowed for this capability.\n   */\n  allow: readonly string[];\n}\n\n/**\n * Runtime plugin entry generated for muon-core config overlays.\n */\nexport interface MuonRuntimePluginEntryConfig {\n  /**\n   * Plugin entry name.\n   */\n  name: string;\n  /**\n   * Optional expected SHA-1 signature for the external plugin library.\n   */\n  signature?: string;\n  /**\n   * Optional hexadecimal salt appended before checking the plugin signature.\n   */\n  salt?: string;\n  /**\n   * Plugin function path globs allowed for this plugin entry.\n   */\n  allow: readonly string[];\n}\n\n/**\n * Runtime plugin configuration generated for validate mode.\n */\nexport interface MuonCapabilityRuntimePluginConfig {\n  /**\n   * Plugin exposure mode.\n   */\n  mode: \"validate\";\n  /**\n   * Plugin bridge page URL allowlist.\n   */\n  pages?: readonly string[];\n  /**\n   * External plugin path override.\n   */\n  path?: string;\n  /**\n   * Plugin loading allowlist override.\n   */\n  plugins?: readonly MuonRuntimePluginEntryConfig[];\n  /**\n   * Capability policies consumed by muon-core.\n   */\n  capabilities: readonly MuonCapabilityRuntimeEntry[];\n}\n\n/**\n * Runtime plugin configuration for simple window-global exposure.\n */\nexport interface MuonSimpleRuntimePluginConfig {\n  /**\n   * Plugin exposure mode.\n   */\n  mode: \"simple\";\n  /**\n   * Plugin bridge page URL allowlist.\n   */\n  pages?: readonly string[];\n  /**\n   * External plugin path override.\n   */\n  path?: string;\n  /**\n   * Plugin loading allowlist override.\n   */\n  plugins?: readonly MuonRuntimePluginEntryConfig[];\n}\n\n/**\n * Runtime plugin configuration generated by a build integration.\n */\nexport type MuonRuntimePluginConfig =\n  | MuonCapabilityRuntimePluginConfig\n  | MuonSimpleRuntimePluginConfig;\n\n/**\n * Resolved virtual module.\n */\nexport interface MuonResolvedCapabilityModule {\n  /**\n   * Bundler-internal virtual id.\n   */\n  id: string;\n}\n\n/**\n * Bundler-independent virtual module resolver.\n */\nexport interface MuonCapabilityModuleResolver {\n  /**\n   * Resolves a Muon virtual module specifier for one importer.\n   */\n  resolveId: (\n    source: string,\n    importer: string | undefined,\n  ) => MuonResolvedCapabilityModule | undefined;\n  /**\n   * Loads the generated source for a resolved virtual module id.\n   */\n  load: (id: string) => string | undefined;\n  /**\n   * Returns runtime plugin config generated from all capability rules.\n   */\n  getRuntimePluginConfig: () => MuonCapabilityRuntimePluginConfig;\n}\n\ninterface ParsedCapabilitySpecifier {\n  moduleName: string;\n  namespace: string;\n}\n\ninterface ResolvedRule {\n  index: number;\n  id: string;\n  rule: MuonCapabilityImportOptions;\n  namespace: string;\n  moduleName: string;\n}\n\nconst virtualModulePrefix = \"\\0muon-capability:\";\nconst moduleNamePattern =\n  /^[A-Za-z_$][A-Za-z0-9_$]*:[A-Za-z_$][A-Za-z0-9_$]*(?:\\.[A-Za-z_$][A-Za-z0-9_$]*)*$/u;\nconst jsIdentifierPattern = /^[A-Za-z_$][A-Za-z0-9_$]*$/u;\n\nconst normalizePath = (path: string): string =>\n  (path.split(\"?\")[0] ?? \"\").replaceAll(\"\\\\\", \"/\");\n\nconst hashCapabilityRule = (\n  index: number,\n  rule: MuonCapabilityImportOptions,\n): string =>\n  `cap-${createHash(\"sha1\")\n    .update(\n      JSON.stringify({\n        index,\n        pluginName: rule.pluginName,\n        sources: [...(rule.sources ?? [])],\n        packages: [...(rule.packages ?? [])],\n        allow: [...rule.allow],\n      }),\n    )\n    .digest(\"hex\")\n    .slice(0, 16)}`;\n\nconst parseCapabilitySpecifier = (\n  source: string,\n): ParsedCapabilitySpecifier | undefined => {\n  if (!moduleNamePattern.test(source)) {\n    return undefined;\n  }\n  const separator = source.indexOf(\":\");\n  const namespace = `${source.slice(0, separator)}.${source.slice(separator + 1)}`;\n  return {\n    moduleName: source,\n    namespace,\n  };\n};\n\nconst escapeRegExp = (source: string): string =>\n  source.replace(/[\\\\^$+?.()|[\\]{}]/gu, \"\\\\$&\");\n\nconst globToRegExp = (glob: string, separator: string): RegExp => {\n  let source = \"^\";\n  for (let index = 0; index < glob.length; index += 1) {\n    const current = glob[index] ?? \"\";\n    const next = glob[index + 1];\n    if (current === \"*\" && next === \"*\") {\n      source += \".*\";\n      index += 1;\n      continue;\n    }\n    if (current === \"*\") {\n      source += `[^${escapeRegExp(separator)}]*`;\n      continue;\n    }\n    source += escapeRegExp(current);\n  }\n  source += \"$\";\n  return new RegExp(source, \"u\");\n};\n\nconst isGlobMatch = (glob: string, value: string, separator: string): boolean =>\n  globToRegExp(glob, separator).test(value);\n\nconst toRootRelativeImporter = (root: string, importer: string): string =>\n  normalizePath(relative(root, importer));\n\nconst readPackageName = (packageJsonPath: string): string | undefined => {\n  try {\n    const parsed = JSON.parse(readFileSync(packageJsonPath, \"utf8\")) as unknown;\n    return typeof parsed === \"object\" &&\n      parsed !== null &&\n      !Array.isArray(parsed) &&\n      typeof (parsed as { name?: unknown }).name === \"string\"\n      ? (parsed as { name: string }).name\n      : undefined;\n  } catch {\n    return undefined;\n  }\n};\n\nconst getImporterPackageName = (\n  root: string,\n  importer: string,\n): string | undefined => {\n  const normalizedRoot = normalizePath(root);\n  const rootPackageJsonPath = join(root, \"package.json\");\n  let directory = dirname(normalizePath(importer));\n  for (;;) {\n    const packageJsonPath = join(directory, \"package.json\");\n    if (\n      packageJsonPath !== rootPackageJsonPath &&\n      existsSync(packageJsonPath)\n    ) {\n      return readPackageName(packageJsonPath);\n    }\n    if (normalizePath(directory) === normalizedRoot) {\n      return undefined;\n    }\n    const parent = dirname(directory);\n    if (parent === directory) {\n      return undefined;\n    }\n    directory = parent;\n  }\n};\n\nconst matchesCapabilityRuleImporter = (\n  rule: MuonCapabilityImportOptions,\n  root: string,\n  importer: string,\n): boolean => {\n  const relativeImporter = toRootRelativeImporter(root, importer);\n  const sourceMatched =\n    rule.sources?.some((pattern) =>\n      isGlobMatch(normalizePath(pattern), relativeImporter, \"/\"),\n    ) ?? false;\n  if (sourceMatched) {\n    return true;\n  }\n\n  const packageName = getImporterPackageName(root, importer);\n  return packageName === undefined\n    ? false\n    : (rule.packages?.includes(packageName) ?? false);\n};\n\nconst hasNamespaceFunctionAllow = (\n  namespace: string,\n  allow: readonly string[],\n): boolean =>\n  allow.some((entry) => {\n    if (entry.startsWith(`${namespace}.`)) {\n      return true;\n    }\n    return isGlobMatch(entry, `${namespace}.placeholder`, \".\");\n  });\n\nconst getExactExportName = (\n  namespace: string,\n  functionPath: string,\n): string | undefined => {\n  const prefix = `${namespace}.`;\n  if (!functionPath.startsWith(prefix)) {\n    return undefined;\n  }\n  const name = functionPath.slice(prefix.length);\n  if (!jsIdentifierPattern.test(name)) {\n    return undefined;\n  }\n  return name;\n};\n\nconst getExportedFunctions = (\n  namespace: string,\n  allow: readonly string[],\n): [string, string][] =>\n  allow.flatMap((functionPath) => {\n    const exportName = getExactExportName(namespace, functionPath);\n    return exportName === undefined ? [] : [[exportName, functionPath]];\n  });\n\nconst createRuleRuntimeEntry = (\n  rule: MuonCapabilityImportOptions,\n  index: number,\n): MuonCapabilityRuntimeEntry => ({\n  id: hashCapabilityRule(index, rule),\n  allow: [...rule.allow],\n});\n\nconst validateCapabilityRule = (rule: MuonCapabilityImportOptions): void => {\n  if (\n    (rule.sources === undefined || rule.sources.length === 0) &&\n    (rule.packages === undefined || rule.packages.length === 0)\n  ) {\n    throw new Error(\n      \"Muon capability import rule requires sources or packages.\",\n    );\n  }\n};\n\nconst createModuleVirtualId = (rule: ResolvedRule): string =>\n  `${virtualModulePrefix}${rule.index}:${rule.moduleName}`;\n\nconst parseModuleVirtualId = (\n  id: string,\n): { index: number; moduleName: string } | undefined => {\n  if (!id.startsWith(virtualModulePrefix)) {\n    return undefined;\n  }\n  const payload = id.slice(virtualModulePrefix.length);\n  const separator = payload.indexOf(\":\");\n  if (separator <= 0) {\n    return undefined;\n  }\n  const index = Number.parseInt(payload.slice(0, separator), 10);\n  if (!Number.isInteger(index) || index < 0) {\n    return undefined;\n  }\n  return {\n    index,\n    moduleName: payload.slice(separator + 1),\n  };\n};\n\nconst createExecutorSpawnExport = (\n  capabilityId: string,\n  functionPath: string,\n): string => `export const spawn = async (options = {}) => {\n  const source = await __muonCall(${JSON.stringify(capabilityId)}, ${JSON.stringify(functionPath)}, [JSON.stringify(options ?? {})]);\n  return JSON.parse(source);\n};`;\n\nconst createGenericFunctionExport = (\n  exportName: string,\n  capabilityId: string,\n  functionPath: string,\n): string => `export const ${exportName} = async (...args) =>\n  await __muonCall(${JSON.stringify(capabilityId)}, ${JSON.stringify(functionPath)}, args);`;\n\nconst createModuleSource = (rule: ResolvedRule): string => {\n  const exportedFunctions = getExportedFunctions(\n    rule.namespace,\n    rule.rule.allow,\n  );\n  if (exportedFunctions.length === 0) {\n    throw new Error(\n      `Muon capability import has no exact function exports: ${rule.moduleName}`,\n    );\n  }\n\n  const exports = exportedFunctions.map(([exportName, functionPath]) =>\n    rule.namespace === \"muon.executor\" && exportName === \"spawn\"\n      ? createExecutorSpawnExport(rule.id, functionPath)\n      : createGenericFunctionExport(exportName, rule.id, functionPath),\n  );\n  return `const __muonCall = globalThis.__muon_plugin_call;\nif (typeof __muonCall !== \"function\") {\n  throw new Error(\"Muon plugin capability bridge is not available.\");\n}\n\n${exports.join(\"\\n\\n\")}\n`;\n};\n\n/**\n * Creates a capability virtual module resolver for a bundler adapter.\n *\n * @param root Bundler project root.\n * @param options Capability import options.\n */\nexport const createMuonCapabilityModuleResolver = (\n  root: string,\n  options: MuonCapabilityOptions | undefined,\n): MuonCapabilityModuleResolver => {\n  const rules = [...(options?.imports ?? [])];\n  for (const rule of rules) {\n    validateCapabilityRule(rule);\n  }\n  const runtimeEntries = rules.map((rule, index) =>\n    createRuleRuntimeEntry(rule, index),\n  );\n\n  const resolveRule = (\n    source: string,\n    importer: string | undefined,\n  ): ResolvedRule | undefined => {\n    const parsed = parseCapabilitySpecifier(source);\n    if (parsed === undefined) {\n      return undefined;\n    }\n    const namespaceConfigured = rules.some((rule) =>\n      hasNamespaceFunctionAllow(parsed.namespace, rule.allow),\n    );\n    if (!namespaceConfigured) {\n      return undefined;\n    }\n    if (importer === undefined) {\n      throw new Error(\n        `Muon capability import is not allowed without an importer: ${source}`,\n      );\n    }\n\n    const relativeImporter = toRootRelativeImporter(root, importer);\n    for (let index = 0; index < rules.length; index += 1) {\n      const rule = rules[index];\n      if (\n        rule === undefined ||\n        !matchesCapabilityRuleImporter(rule, root, importer) ||\n        !hasNamespaceFunctionAllow(parsed.namespace, rule.allow)\n      ) {\n        continue;\n      }\n      return {\n        index,\n        id: runtimeEntries[index]?.id ?? hashCapabilityRule(index, rule),\n        rule,\n        namespace: parsed.namespace,\n        moduleName: parsed.moduleName,\n      };\n    }\n\n    throw new Error(\n      `Muon capability import is not allowed: ${source} from ${relativeImporter}`,\n    );\n  };\n\n  return {\n    resolveId: (source, importer) => {\n      const rule = resolveRule(source, importer);\n      return rule === undefined\n        ? undefined\n        : {\n            id: createModuleVirtualId(rule),\n          };\n    },\n    load: (id) => {\n      const parsed = parseModuleVirtualId(id);\n      if (parsed === undefined) {\n        return undefined;\n      }\n      const source = parseCapabilitySpecifier(parsed.moduleName);\n      const rule = rules[parsed.index];\n      const runtimeEntry = runtimeEntries[parsed.index];\n      if (\n        source === undefined ||\n        rule === undefined ||\n        runtimeEntry === undefined\n      ) {\n        return undefined;\n      }\n      return createModuleSource({\n        index: parsed.index,\n        id: runtimeEntry.id,\n        rule,\n        namespace: source.namespace,\n        moduleName: source.moduleName,\n      });\n    },\n    getRuntimePluginConfig: () => ({\n      mode: \"validate\",\n      capabilities: runtimeEntries,\n    }),\n  };\n};\n","// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { constants } from \"node:fs\";\nimport { access, readFile } from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\n\nimport { parse } from \"json5\";\n\nimport type {\n  MuonCapabilityImportOptions,\n  MuonCapabilityOptions,\n  MuonRuntimePluginEntryConfig,\n} from \"./capability.js\";\n\n/**\n * Plugin JavaScript exposure mode.\n */\nexport type MuonPluginAccessMode = \"simple\" | \"validate\";\n\n/**\n * Import-side capability rule from public Muon plugin access config.\n */\nexport interface MuonPluginAccessImportOptions {\n  /**\n   * Importer source globs relative to the bundler project root.\n   */\n  sources?: readonly string[];\n  /**\n   * NPM package names allowed to import the virtual module.\n   */\n  packages?: readonly string[];\n  /**\n   * Plugin function paths allowed for this import rule.\n   *\n   * @remarks Required in validate mode. Simple mode does not use import rules.\n   */\n  allow?: readonly string[];\n}\n\n/**\n * Plugin entry from public Muon plugin access config.\n */\nexport interface MuonPluginAccessEntryOptions {\n  /**\n   * Plugin entry name.\n   */\n  name: string;\n  /**\n   * Optional expected SHA-1 signature for the external plugin library.\n   */\n  signature?: string;\n  /**\n   * Optional hexadecimal salt appended before checking the plugin signature.\n   */\n  salt?: string;\n  /**\n   * Plugin function path globs allowed by the runtime plugin policy.\n   *\n   * @remarks Required in simple mode. Validate mode derives the runtime\n   * allowlist from `imports[].allow` and rejects this field in public config.\n   */\n  allow?: readonly string[];\n  /**\n   * Validate-mode import rules for this plugin entry.\n   */\n  imports?: readonly MuonPluginAccessImportOptions[];\n}\n\n/**\n * Public plugin access config shared by muon.json and the Vite option.\n */\nexport interface MuonPluginAccessOptions {\n  /**\n   * External plugin directory override.\n   */\n  path?: string;\n  /**\n   * Plugin exposure mode.\n   */\n  mode?: MuonPluginAccessMode;\n  /**\n   * Page URL patterns where the plugin bridge is exposed.\n   */\n  pages?: readonly string[];\n  /**\n   * Runtime plugin entries and validate-mode import rules.\n   */\n  plugins?: readonly MuonPluginAccessEntryOptions[];\n}\n\n/**\n * Resolved plugin access config used by bundler integrations.\n */\nexport interface MuonResolvedPluginAccessOptions {\n  /**\n   * Effective plugin exposure mode.\n   */\n  mode: MuonPluginAccessMode;\n  /**\n   * Effective page URL allowlist.\n   */\n  pages: readonly string[];\n  /**\n   * Capability resolver inputs generated from plugin imports.\n   */\n  capabilityOptions: MuonCapabilityOptions;\n  /**\n   * Runtime config fields added around generated capability policies.\n   */\n  runtimeOverlay: MuonPluginAccessRuntimeOverlay;\n}\n\n/**\n * Runtime plugin config fields that are not derived from capability IDs.\n */\nexport interface MuonPluginAccessRuntimeOverlay {\n  /**\n   * Page URL allowlist to write into generated runtime config.\n   */\n  pages?: readonly string[];\n  /**\n   * External plugin path override.\n   */\n  path?: string;\n  /**\n   * Plugin loading allowlist override.\n   */\n  plugins?: readonly MuonRuntimePluginEntryConfig[];\n}\n\nexport interface ResolveMuonPluginAccessOptionsInput {\n  /**\n   * Bundler project root.\n   */\n  root: string;\n  /**\n   * Optional muon.json path relative to root.\n   */\n  configPath: string | undefined;\n  /**\n   * Vite plugin access override.\n   */\n  pluginAccess: false | MuonPluginAccessOptions | undefined;\n  /**\n   * Handles project config read failures. When omitted, read failures are\n   * reported as errors.\n   */\n  onConfigReadError?: (error: unknown) => void;\n}\n\ntype JsonObject = Record<string, unknown>;\n\nconst defaultConfigFileNames = [\"muon.json5\", \"muon.jsonc\", \"muon.json\"];\nconst defaultPluginPages = [\"asset://main/**\"];\n\nconst isJsonObject = (value: unknown): value is JsonObject =>\n  typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst isStringArray = (value: unknown): value is readonly string[] =>\n  Array.isArray(value) && value.every((entry) => typeof entry === \"string\");\n\nconst isSha1HexString = (value: string): boolean =>\n  value.length === 40 && /^[0-9a-fA-F]+$/.test(value);\n\nconst isHexByteString = (value: string): boolean =>\n  value.length % 2 === 0 && /^[0-9a-fA-F]*$/.test(value);\n\nconst getErrorMessage = (error: unknown): string =>\n  error instanceof Error ? error.message : String(error);\n\nconst fileExists = async (path: string): Promise<boolean> => {\n  try {\n    await access(path, constants.F_OK);\n    return true;\n  } catch {\n    return false;\n  }\n};\n\nconst resolveMuonConfigPath = async (\n  root: string,\n  configPath: string | undefined,\n): Promise<string | undefined> => {\n  if (configPath !== undefined) {\n    const resolvedPath = resolve(root, configPath);\n    if (await fileExists(resolvedPath)) {\n      return resolvedPath;\n    }\n    throw new Error(`Muon config file does not exist: ${resolvedPath}`);\n  }\n\n  for (const fileName of defaultConfigFileNames) {\n    const candidatePath = join(root, fileName);\n    if (await fileExists(candidatePath)) {\n      return candidatePath;\n    }\n  }\n  return undefined;\n};\n\nconst readJsonObjectFile = async (\n  path: string,\n  label: string,\n): Promise<JsonObject> => {\n  let content: string;\n  try {\n    content = await readFile(path, \"utf8\");\n  } catch (error) {\n    throw new Error(\n      `${label} could not be read: ${path}: ${getErrorMessage(error)}`,\n    );\n  }\n\n  let parsed: unknown;\n  try {\n    parsed = parse(content);\n  } catch (error) {\n    throw new Error(\n      `${label} could not be parsed: ${path}: ${getErrorMessage(error)}`,\n    );\n  }\n\n  if (!isJsonObject(parsed)) {\n    throw new Error(`${label} must contain a JSON object: ${path}`);\n  }\n  return parsed;\n};\n\nconst readOptionalStringArray = (\n  object: JsonObject,\n  key: string,\n  configPath: string,\n): readonly string[] | undefined => {\n  const value = object[key];\n  if (value === undefined) {\n    return undefined;\n  }\n  if (!isStringArray(value)) {\n    throw new Error(`muon.json ${configPath} must be an array of strings.`);\n  }\n  return value;\n};\n\nconst readPluginAccessImportOptions = (\n  value: unknown,\n  configPath: string,\n): MuonPluginAccessImportOptions => {\n  if (!isJsonObject(value)) {\n    throw new Error(`muon.json ${configPath} must be an object.`);\n  }\n\n  const sources = readOptionalStringArray(\n    value,\n    \"sources\",\n    `${configPath}.sources`,\n  );\n  const packages = readOptionalStringArray(\n    value,\n    \"packages\",\n    `${configPath}.packages`,\n  );\n  const allow = readOptionalStringArray(value, \"allow\", `${configPath}.allow`);\n  const options: MuonPluginAccessImportOptions = {};\n  if (sources !== undefined) {\n    options.sources = sources;\n  }\n  if (packages !== undefined) {\n    options.packages = packages;\n  }\n  if (allow !== undefined) {\n    options.allow = allow;\n  }\n  return options;\n};\n\nconst readPluginAccessEntryOptions = (\n  value: unknown,\n  index: number,\n): MuonPluginAccessEntryOptions => {\n  const configPath = `plugin.plugins[${index}]`;\n  if (!isJsonObject(value)) {\n    throw new Error(`muon.json ${configPath} must be an object.`);\n  }\n  if (typeof value.name !== \"string\") {\n    throw new Error(`muon.json ${configPath}.name must be a string.`);\n  }\n  if (value.signature !== undefined) {\n    if (typeof value.signature !== \"string\") {\n      throw new Error(`muon.json ${configPath}.signature must be a string.`);\n    }\n    if (!isSha1HexString(value.signature)) {\n      throw new Error(\n        `muon.json ${configPath}.signature must be a 40-character SHA-1 hex string.`,\n      );\n    }\n  }\n  if (value.salt !== undefined) {\n    if (typeof value.salt !== \"string\") {\n      throw new Error(`muon.json ${configPath}.salt must be a string.`);\n    }\n    if (!isHexByteString(value.salt)) {\n      throw new Error(\n        `muon.json ${configPath}.salt must be a hexadecimal byte string.`,\n      );\n    }\n  }\n  const allow = readOptionalStringArray(value, \"allow\", `${configPath}.allow`);\n\n  const rawImports = value.imports;\n  if (rawImports !== undefined && !Array.isArray(rawImports)) {\n    throw new Error(`muon.json ${configPath}.imports must be an array.`);\n  }\n  const imports =\n    rawImports === undefined\n      ? undefined\n      : rawImports.map((entry, importIndex) =>\n          readPluginAccessImportOptions(\n            entry,\n            `${configPath}.imports[${importIndex}]`,\n          ),\n        );\n  const options: MuonPluginAccessEntryOptions = {\n    name: value.name,\n  };\n  if (value.signature !== undefined) {\n    options.signature = value.signature;\n  }\n  if (value.salt !== undefined) {\n    options.salt = value.salt;\n  }\n  if (allow !== undefined) {\n    options.allow = allow;\n  }\n  if (imports !== undefined) {\n    options.imports = imports;\n  }\n  return options;\n};\n\nconst readPluginAccessOptions = (\n  config: JsonObject,\n): MuonPluginAccessOptions => {\n  const browser = config.browser;\n  if (isJsonObject(browser) && browser.plugin !== undefined) {\n    throw new Error(\n      \"muon.json browser.plugin is no longer supported; use plugin.mode and plugin.pages instead.\",\n    );\n  }\n\n  const plugin = config.plugin;\n  if (plugin === undefined) {\n    return {};\n  }\n  if (!isJsonObject(plugin)) {\n    throw new Error(\"muon.json plugin must be an object.\");\n  }\n\n  const options: MuonPluginAccessOptions = {};\n  if (plugin.path !== undefined) {\n    if (typeof plugin.path !== \"string\") {\n      throw new Error(\"muon.json plugin.path must be a string.\");\n    }\n    if (plugin.path.length === 0) {\n      throw new Error(\"muon.json plugin.path must not be empty.\");\n    }\n    options.path = plugin.path;\n  }\n  if (plugin.mode !== undefined) {\n    if (typeof plugin.mode !== \"string\") {\n      throw new Error(\"muon.json plugin.mode must be a string.\");\n    }\n    if (plugin.mode.length === 0) {\n      throw new Error(\"muon.json plugin.mode must not be empty.\");\n    }\n    if (plugin.mode !== \"simple\" && plugin.mode !== \"validate\") {\n      throw new Error(\"muon.json plugin.mode has unknown value.\");\n    }\n    options.mode = plugin.mode;\n  }\n  const pages = readOptionalStringArray(plugin, \"pages\", \"plugin.pages\");\n  if (pages !== undefined) {\n    options.pages = pages;\n  }\n\n  const rawPlugins = plugin.plugins;\n  if (rawPlugins !== undefined) {\n    if (!Array.isArray(rawPlugins)) {\n      throw new Error(\"muon.json plugin.plugins must be an array.\");\n    }\n    options.plugins = rawPlugins.map((entry, index) =>\n      readPluginAccessEntryOptions(entry, index),\n    );\n  }\n  return options;\n};\n\ntype EffectivePluginAccessOptions = Required<\n  Pick<MuonPluginAccessOptions, \"mode\" | \"pages\" | \"plugins\">\n> &\n  Pick<MuonPluginAccessOptions, \"path\">;\n\nconst hasImportSourceSelector = (\n  entry: MuonPluginAccessImportOptions,\n): boolean =>\n  (entry.sources !== undefined && entry.sources.length > 0) ||\n  (entry.packages !== undefined && entry.packages.length > 0);\n\nconst validatePluginAccessOptions = (\n  resolved: EffectivePluginAccessOptions,\n): EffectivePluginAccessOptions => {\n  for (const [pluginIndex, plugin] of resolved.plugins.entries()) {\n    const pluginPath = `plugin.plugins[${pluginIndex}]`;\n    if (plugin.name === \"internal\" && plugin.signature !== undefined) {\n      throw new Error(\n        `muon.json ${pluginPath}.signature is not supported for internal plugins.`,\n      );\n    }\n    if (plugin.name === \"internal\" && plugin.salt !== undefined) {\n      throw new Error(\n        `muon.json ${pluginPath}.salt is not supported for internal plugins.`,\n      );\n    }\n    if (plugin.signature !== undefined && plugin.salt === undefined) {\n      throw new Error(\n        `muon.json ${pluginPath}.signature requires ${pluginPath}.salt.`,\n      );\n    }\n    if (resolved.mode === \"validate\") {\n      if (plugin.allow !== undefined) {\n        throw new Error(\n          `muon.json ${pluginPath}.allow is only supported in simple mode; use ${pluginPath}.imports[].allow in validate mode.`,\n        );\n      }\n      if (plugin.imports === undefined) {\n        throw new Error(\n          `muon.json ${pluginPath}.imports is required in validate mode.`,\n        );\n      }\n      if (plugin.imports.length === 0) {\n        throw new Error(\n          `muon.json ${pluginPath}.imports must not be empty in validate mode.`,\n        );\n      }\n\n      for (const [importIndex, entry] of plugin.imports.entries()) {\n        const importPath = `${pluginPath}.imports[${importIndex}]`;\n        if (!hasImportSourceSelector(entry)) {\n          throw new Error(\n            `muon.json ${importPath} requires sources or packages.`,\n          );\n        }\n        if (entry.allow === undefined) {\n          throw new Error(\n            `muon.json ${importPath}.allow is required in validate mode.`,\n          );\n        }\n        if (entry.allow.length === 0) {\n          throw new Error(\n            `muon.json ${importPath}.allow must not be empty in validate mode.`,\n          );\n        }\n      }\n      continue;\n    }\n\n    if (plugin.allow === undefined) {\n      throw new Error(\n        `muon.json ${pluginPath}.allow is required in simple mode.`,\n      );\n    }\n    if (plugin.imports !== undefined) {\n      throw new Error(\n        `muon.json ${pluginPath}.imports is only supported in validate mode.`,\n      );\n    }\n  }\n  return resolved;\n};\n\nconst getValidateImportAllow = (\n  entry: MuonPluginAccessImportOptions,\n  pluginIndex: number,\n  importIndex: number,\n): readonly string[] => {\n  if (entry.allow === undefined || entry.allow.length === 0) {\n    throw new Error(\n      `muon.json plugin.plugins[${pluginIndex}].imports[${importIndex}].allow is required in validate mode.`,\n    );\n  }\n  return entry.allow;\n};\n\nconst getSimplePluginAllow = (\n  plugin: MuonPluginAccessEntryOptions,\n  pluginIndex: number,\n): readonly string[] => {\n  if (plugin.allow === undefined) {\n    throw new Error(\n      `muon.json plugin.plugins[${pluginIndex}].allow is required in simple mode.`,\n    );\n  }\n  return plugin.allow;\n};\n\nconst toCapabilityImports = (\n  plugins: readonly MuonPluginAccessEntryOptions[],\n): readonly MuonCapabilityImportOptions[] =>\n  plugins.flatMap((plugin, pluginIndex) =>\n    (plugin.imports ?? []).map((entry, importIndex) => {\n      if (!hasImportSourceSelector(entry)) {\n        throw new Error(\n          `muon.json plugin.plugins[${pluginIndex}].imports[${importIndex}] requires sources or packages.`,\n        );\n      }\n\n      const rule: MuonCapabilityImportOptions = {\n        allow: getValidateImportAllow(entry, pluginIndex, importIndex),\n        pluginName: plugin.name,\n      };\n      if (entry.sources !== undefined) {\n        rule.sources = entry.sources;\n      }\n      if (entry.packages !== undefined) {\n        rule.packages = entry.packages;\n      }\n      return rule;\n    }),\n  );\n\nconst toValidateRuntimePluginEntries = (\n  plugins: readonly MuonPluginAccessEntryOptions[],\n): readonly MuonRuntimePluginEntryConfig[] =>\n  plugins.map((plugin, pluginIndex) => {\n    const allow: string[] = [];\n    const seenAllow = new Set<string>();\n    for (const [importIndex, entry] of (plugin.imports ?? []).entries()) {\n      for (const functionPath of getValidateImportAllow(\n        entry,\n        pluginIndex,\n        importIndex,\n      )) {\n        if (!seenAllow.has(functionPath)) {\n          seenAllow.add(functionPath);\n          allow.push(functionPath);\n        }\n      }\n    }\n    return {\n      name: plugin.name,\n      ...(plugin.signature === undefined\n        ? {}\n        : { signature: plugin.signature }),\n      ...(plugin.salt === undefined ? {} : { salt: plugin.salt }),\n      allow,\n    };\n  });\n\nconst toSimpleRuntimePluginEntries = (\n  plugins: readonly MuonPluginAccessEntryOptions[],\n): readonly MuonRuntimePluginEntryConfig[] =>\n  plugins.map((plugin, pluginIndex) => ({\n    name: plugin.name,\n    ...(plugin.signature === undefined ? {} : { signature: plugin.signature }),\n    ...(plugin.salt === undefined ? {} : { salt: plugin.salt }),\n    allow: [...getSimplePluginAllow(plugin, pluginIndex)],\n  }));\n\nconst shouldOverlayRuntimePlugins = (\n  resolved: EffectivePluginAccessOptions,\n  override: false | MuonPluginAccessOptions | undefined,\n): boolean =>\n  override !== false &&\n  (override?.plugins !== undefined ||\n    (resolved.mode === \"validate\" && resolved.plugins.length > 0));\n\nconst toRuntimePluginEntries = (\n  resolved: EffectivePluginAccessOptions,\n): readonly MuonRuntimePluginEntryConfig[] =>\n  resolved.mode === \"validate\"\n    ? toValidateRuntimePluginEntries(resolved.plugins)\n    : toSimpleRuntimePluginEntries(resolved.plugins);\n\nconst mergePluginAccessOptions = (\n  base: MuonPluginAccessOptions,\n  override: MuonPluginAccessOptions | undefined,\n): EffectivePluginAccessOptions => ({\n  ...(override?.path === undefined ? {} : { path: override.path }),\n  mode: override?.mode ?? base.mode ?? \"validate\",\n  pages: override?.pages ?? base.pages ?? defaultPluginPages,\n  plugins: override?.plugins ?? base.plugins ?? [],\n});\n\nconst createRuntimeOverlay = (\n  root: string,\n  resolved: EffectivePluginAccessOptions,\n  override: false | MuonPluginAccessOptions | undefined,\n): MuonPluginAccessRuntimeOverlay => {\n  if (override === false) {\n    return {};\n  }\n\n  const path =\n    override?.path !== undefined ? resolve(root, override.path) : undefined;\n  const plugins = shouldOverlayRuntimePlugins(resolved, override)\n    ? toRuntimePluginEntries(resolved)\n    : undefined;\n\n  return {\n    pages: resolved.pages,\n    ...(path === undefined ? {} : { path }),\n    ...(plugins === undefined ? {} : { plugins }),\n  };\n};\n\n/**\n * Resolves public plugin access config from muon.json and Vite overrides.\n *\n * @param input Resolution inputs.\n * @returns Effective plugin access config for bundler integrations.\n */\nexport const resolveMuonPluginAccessOptions = async ({\n  root,\n  configPath,\n  pluginAccess,\n  onConfigReadError,\n}: ResolveMuonPluginAccessOptionsInput): Promise<MuonResolvedPluginAccessOptions> => {\n  const resolvedConfigPath = await resolveMuonConfigPath(root, configPath);\n  let base: MuonPluginAccessOptions = {};\n  if (resolvedConfigPath !== undefined) {\n    try {\n      base = readPluginAccessOptions(\n        await readJsonObjectFile(resolvedConfigPath, \"Muon config file\"),\n      );\n    } catch (error) {\n      if (onConfigReadError === undefined) {\n        throw error;\n      }\n      onConfigReadError(error);\n    }\n  }\n\n  if (pluginAccess === false) {\n    const resolved = validatePluginAccessOptions(\n      mergePluginAccessOptions(base, { mode: \"simple\" }),\n    );\n    return {\n      mode: \"simple\",\n      pages: resolved.pages,\n      capabilityOptions: { imports: [] },\n      runtimeOverlay: createRuntimeOverlay(root, resolved, pluginAccess),\n    };\n  }\n\n  const resolved = validatePluginAccessOptions(\n    mergePluginAccessOptions(base, pluginAccess),\n  );\n  const capabilityOptions: MuonCapabilityOptions = {\n    imports:\n      resolved.mode === \"validate\" ? toCapabilityImports(resolved.plugins) : [],\n  };\n  return {\n    mode: resolved.mode,\n    pages: resolved.pages,\n    capabilityOptions,\n    runtimeOverlay: createRuntimeOverlay(root, resolved, pluginAccess),\n  };\n};\n","// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nconst muonGitignoreEntries = [\".muon/\", \"dist-muon/\", \"artifacts/\"] as const;\n\ntype MuonGitignoreEntry = (typeof muonGitignoreEntries)[number];\n\nconst muonGitignoreEntryAliases: Record<MuonGitignoreEntry, readonly string[]> =\n  {\n    \".muon/\": [\".muon/\", \"/.muon/\", \".muon\", \"/.muon\"],\n    \"dist-muon/\": [\n      \"dist-muon/\",\n      \"/dist-muon/\",\n      \"dist-muon\",\n      \"/dist-muon\",\n      \"dist-muon/*\",\n      \"/dist-muon/*\",\n    ],\n    \"artifacts/\": [\"artifacts/\", \"/artifacts/\", \"artifacts\", \"/artifacts\"],\n  };\n\n/**\n * Result of ensuring Muon generated directories are ignored by Git.\n */\nexport interface MuonGitignoreResult {\n  /**\n   * Path of the .gitignore file that was checked or updated.\n   */\n  gitignorePath: string;\n\n  /**\n   * True when the file was created or appended.\n   */\n  changed: boolean;\n}\n\nconst isMissingFileError = (error: unknown): boolean =>\n  error instanceof Error && (error as NodeJS.ErrnoException).code === \"ENOENT\";\n\nconst hasMuonGitignoreEntry = (\n  content: string,\n  entry: MuonGitignoreEntry,\n): boolean =>\n  content\n    .split(/\\r?\\n/)\n    .map((line) => line.trim())\n    .some((line) => muonGitignoreEntryAliases[entry].includes(line));\n\n/**\n * Adds Muon generated directories to a project .gitignore file.\n *\n * @param root Project root containing the .gitignore file.\n * @returns Gitignore update result.\n */\nexport const ensureMuonGitignoreEntry = async (\n  root: string,\n): Promise<MuonGitignoreResult> => {\n  const gitignorePath = join(root, \".gitignore\");\n  let content = \"\";\n  try {\n    content = await readFile(gitignorePath, \"utf8\");\n  } catch (error) {\n    if (!isMissingFileError(error)) {\n      throw error;\n    }\n  }\n\n  const missingEntries = muonGitignoreEntries.filter(\n    (entry) => !hasMuonGitignoreEntry(content, entry),\n  );\n  if (missingEntries.length === 0) {\n    return {\n      gitignorePath,\n      changed: false,\n    };\n  }\n\n  const separator = content.length > 0 && !content.endsWith(\"\\n\") ? \"\\n\" : \"\";\n  await writeFile(\n    gitignorePath,\n    `${content}${separator}${missingEntries.join(\"\\n\")}\\n`,\n  );\n  return {\n    gitignorePath,\n    changed: true,\n  };\n};\n","// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { spawn } from \"node:child_process\";\nimport { constants, writeFileSync } from \"node:fs\";\nimport {\n  access,\n  chmod,\n  mkdtemp,\n  readFile,\n  rm,\n  writeFile,\n} from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { dirname, isAbsolute, join, resolve, win32 } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { parse } from \"json5\";\nimport type { ViteDevServer } from \"vite\";\n\nimport { ensureMuonGitignoreEntry } from \"./gitignore.js\";\nimport { getDefaultMuonPrepareTarget, runMuonPrepare } from \"./prepare.js\";\nimport type { MuonRuntimePluginConfig } from \"./capability.js\";\nimport type { MuonVitePluginOptions } from \"./vite.js\";\n\nexport interface MuonLaunchScriptOptions {\n  muonExecutablePath: string;\n  projectConfigPath: string | undefined;\n  overrideConfigPath: string;\n  platform: NodeJS.Platform;\n}\n\ninterface MuonViteSessionOptions {\n  server: ViteDevServer;\n  pluginOptions: MuonVitePluginOptions;\n  getRuntimePluginConfig: () => MuonRuntimePluginConfig;\n  platform: NodeJS.Platform;\n  architecture: NodeJS.Architecture;\n  environment: NodeJS.ProcessEnv;\n}\n\ninterface MuonRuntimePaths {\n  temporaryDirectory: string;\n  launchScriptPath: string;\n  overrideConfigPath: string;\n  projectConfigPath: string | undefined;\n  muonExecutablePath: string;\n}\n\ninterface MuonOverrideConfig {\n  cdp?: {\n    enable: true;\n  };\n  browser: {\n    startPage: string;\n    titleBarType?: \"native\" | \"muon\";\n    initialTitleBarVisibility?: boolean;\n    keybind?: {\n      devtools: \"f12\";\n      recycle: \"ctrl+f12\";\n    };\n  };\n  plugin: MuonRuntimePluginConfig & {\n    pages: string[];\n  };\n  network: {\n    allow: string[];\n  };\n}\n\n/**\n * Options for resolving a Muon runtime directory used by the Vite plugin.\n */\nexport interface MuonRuntimePathOptions {\n  /**\n   * Vite project root used to resolve explicit relative paths.\n   */\n  root: string;\n\n  /**\n   * Public Muon runtime target such as linux-amd64 or windows-amd64.\n   */\n  target: string;\n\n  /**\n   * Explicit custom muon-core runtime path.\n   */\n  muonPath: string | undefined;\n\n  /**\n   * Directory containing the packaged Muon JavaScript files.\n   *\n   * @remarks This is injectable for tests. Production code uses the module directory.\n   */\n  packageDirectory?: string;\n}\n\nconst resolveFromRoot = (root: string, path: string): string =>\n  isAbsolute(path) ? path : resolve(root, path);\n\nconst moduleDirectory =\n  typeof __dirname === \"string\"\n    ? __dirname\n    : dirname(fileURLToPath(import.meta.url));\nconst defaultProjectConfigFileNames = [\"muon.json5\", \"muon.jsonc\", \"muon.json\"];\nconst muonRecycleExitCode = 88;\n\n/**\n * Resolves the muon-core runtime directory used by the Vite plugin.\n *\n * @param options Runtime path resolution inputs.\n * @returns Absolute or package-relative runtime directory path.\n */\nexport const resolveMuonRuntimePath = ({\n  root,\n  target,\n  muonPath,\n  packageDirectory = moduleDirectory,\n}: MuonRuntimePathOptions): string =>\n  muonPath === undefined\n    ? join(packageDirectory, \"runtime\", target)\n    : resolveFromRoot(root, muonPath);\n\nexport const getMuonExecutablePath = (\n  runtimePath: string,\n  platform: NodeJS.Platform,\n): string =>\n  join(runtimePath, platform === \"win32\" ? \"muon-core.exe\" : \"muon-core\");\n\nconst getLaunchScriptFileName = (platform: NodeJS.Platform): string =>\n  platform === \"win32\" ? \"open-muon.cmd\" : \"open-muon.sh\";\n\nconst quotePosix = (value: string): string =>\n  `'${value.replaceAll(\"'\", \"'\\\\''\")}'`;\n\nconst getPlatformDirectoryName = (\n  path: string,\n  platform: NodeJS.Platform,\n): string => (platform === \"win32\" ? win32.dirname(path) : dirname(path));\n\nconst getOptionalPosixValue = (value: string | undefined): string =>\n  value === undefined ? \"''\" : quotePosix(value);\n\nconst createPosixMuonLaunchScript = ({\n  muonExecutablePath,\n  projectConfigPath,\n  overrideConfigPath,\n}: MuonLaunchScriptOptions): string => `#!/usr/bin/env bash\nset -euo pipefail\nMUON_RECYCLE_EXIT_CODE=${muonRecycleExitCode}\nMUON_EXECUTABLE=${quotePosix(muonExecutablePath)}\nMUON_EXECUTABLE_DIRECTORY=${quotePosix(getPlatformDirectoryName(muonExecutablePath, \"linux\"))}\nMUON_PROJECT_CONFIG=${getOptionalPosixValue(projectConfigPath)}\nMUON_OVERRIDE_CONFIG=${quotePosix(overrideConfigPath)}\n\nMUON_CONFIG_ARGS=()\nif [[ -n \"$MUON_PROJECT_CONFIG\" ]]; then\n  if [[ ! -f \"$MUON_PROJECT_CONFIG\" ]]; then\n    echo \"Muon startup failed: project config does not exist: $MUON_PROJECT_CONFIG\" >&2\n    exit 1\n  fi\n  MUON_CONFIG_ARGS+=(\"-c\" \"$MUON_PROJECT_CONFIG\")\nfi\n\nif [[ ! -x \"$MUON_EXECUTABLE\" ]]; then\n  echo \"Muon startup failed: executable does not exist or is not executable: $MUON_EXECUTABLE\" >&2\n  exit 1\nfi\n\nif [[ ! -f \"$MUON_OVERRIDE_CONFIG\" ]]; then\n  echo \"Muon startup failed: generated override config does not exist: $MUON_OVERRIDE_CONFIG\" >&2\n  exit 1\nfi\nMUON_CONFIG_ARGS+=(\"-c\" \"$MUON_OVERRIDE_CONFIG\")\n\ncd \"$MUON_EXECUTABLE_DIRECTORY\"\nwhile true; do\n  set +e\n  \"$MUON_EXECUTABLE\" \"\\${MUON_CONFIG_ARGS[@]}\"\n  MUON_EXIT_CODE=$?\n  set -e\n  if [[ \"$MUON_EXIT_CODE\" -ne \"$MUON_RECYCLE_EXIT_CODE\" ]]; then\n    exit \"$MUON_EXIT_CODE\"\n  fi\ndone\n`;\n\nconst escapeWindowsCmdValue = (value: string): string =>\n  value.replaceAll(\"%\", \"%%\").replaceAll(\"\\r\", \"\").replaceAll(\"\\n\", \"\");\n\nconst getOptionalWindowsCmdValue = (value: string | undefined): string =>\n  value === undefined ? \"\" : escapeWindowsCmdValue(value);\n\nconst createWindowsMuonLaunchScript = ({\n  muonExecutablePath,\n  projectConfigPath,\n  overrideConfigPath,\n}: MuonLaunchScriptOptions): string => `@echo off\nsetlocal\nset \"MUON_RECYCLE_EXIT_CODE=${muonRecycleExitCode}\"\nset \"MUON_EXECUTABLE=${escapeWindowsCmdValue(muonExecutablePath)}\"\nset \"MUON_EXECUTABLE_DIRECTORY=${escapeWindowsCmdValue(getPlatformDirectoryName(muonExecutablePath, \"win32\"))}\"\nset \"MUON_PROJECT_CONFIG=${getOptionalWindowsCmdValue(projectConfigPath)}\"\nset \"MUON_OVERRIDE_CONFIG=${escapeWindowsCmdValue(overrideConfigPath)}\"\n\nif not exist \"%MUON_EXECUTABLE%\" (\n  echo Muon startup failed: executable does not exist: %MUON_EXECUTABLE% 1>&2\n  exit /b 1\n)\n\nif not exist \"%MUON_OVERRIDE_CONFIG%\" (\n  echo Muon startup failed: generated override config does not exist: %MUON_OVERRIDE_CONFIG% 1>&2\n  exit /b 1\n)\n\npushd \"%MUON_EXECUTABLE_DIRECTORY%\"\n:muon_recycle_loop\nif defined MUON_PROJECT_CONFIG (\n  if not exist \"%MUON_PROJECT_CONFIG%\" (\n    echo Muon startup failed: project config does not exist: %MUON_PROJECT_CONFIG% 1>&2\n    popd\n    exit /b 1\n  )\n  \"%MUON_EXECUTABLE%\" -c \"%MUON_PROJECT_CONFIG%\" -c \"%MUON_OVERRIDE_CONFIG%\"\n) else (\n  \"%MUON_EXECUTABLE%\" -c \"%MUON_OVERRIDE_CONFIG%\"\n)\nset \"MUON_EXIT_CODE=%ERRORLEVEL%\"\nif \"%MUON_EXIT_CODE%\"==\"%MUON_RECYCLE_EXIT_CODE%\" goto muon_recycle_loop\npopd\nexit /b %MUON_EXIT_CODE%\n`;\n\nexport const createMuonLaunchScript = (\n  options: MuonLaunchScriptOptions,\n): string =>\n  options.platform === \"win32\"\n    ? createWindowsMuonLaunchScript(options)\n    : createPosixMuonLaunchScript(options);\n\nconst getBaseUrl = (server: ViteDevServer): string | undefined =>\n  server.resolvedUrls?.local[0] ?? server.resolvedUrls?.network[0];\n\nconst getWebSocketOrigin = (startUrl: string): string => {\n  const url = new URL(startUrl);\n  if (url.protocol === \"https:\") {\n    url.protocol = \"wss:\";\n  } else if (url.protocol === \"http:\") {\n    url.protocol = \"ws:\";\n  }\n  return url.origin;\n};\n\nconst createMuonOverrideConfig = (\n  startUrl: string,\n  enableDebugger: boolean,\n  runtimePluginConfig: MuonRuntimePluginConfig,\n): MuonOverrideConfig => {\n  const origin = new URL(startUrl).origin;\n  return {\n    ...(enableDebugger\n      ? {\n          cdp: {\n            enable: true,\n          },\n        }\n      : {}),\n    browser: {\n      startPage: startUrl,\n      ...(enableDebugger\n        ? {\n            keybind: {\n              devtools: \"f12\",\n              recycle: \"ctrl+f12\",\n            },\n          }\n        : {}),\n    },\n    plugin: {\n      ...runtimePluginConfig,\n      pages: [`${origin}/**`],\n    },\n    network: {\n      allow: [`${origin}/**`, `${getWebSocketOrigin(startUrl)}/**`],\n    },\n  };\n};\n\nconst writeMuonOverrideConfig = (\n  server: ViteDevServer,\n  overrideConfigPath: string,\n  pluginOptions: MuonVitePluginOptions,\n  getRuntimePluginConfig: () => MuonRuntimePluginConfig,\n): boolean => {\n  const startUrl = getBaseUrl(server);\n  if (startUrl === undefined) {\n    server.config.logger.warn(\"Muon Vite plugin could not resolve a Vite URL.\");\n    return false;\n  }\n  writeFileSync(\n    overrideConfigPath,\n    `${JSON.stringify(\n      createMuonOverrideConfig(\n        startUrl,\n        pluginOptions.enableDebugger !== false,\n        getRuntimePluginConfig(),\n      ),\n      null,\n      2,\n    )}\\n`,\n  );\n  return true;\n};\n\nconst createRuntimePaths = async (\n  server: ViteDevServer,\n  stagePath: string,\n  platform: NodeJS.Platform,\n  projectConfigPath: string | undefined,\n): Promise<MuonRuntimePaths> => {\n  const temporaryDirectory = await mkdtemp(join(tmpdir(), \"muon-vite-\"));\n  return {\n    temporaryDirectory,\n    launchScriptPath: join(\n      temporaryDirectory,\n      getLaunchScriptFileName(platform),\n    ),\n    overrideConfigPath: join(temporaryDirectory, \"muon.vite.json\"),\n    projectConfigPath,\n    muonExecutablePath: getMuonExecutablePath(stagePath, platform),\n  };\n};\n\nconst fileExists = async (path: string): Promise<boolean> => {\n  try {\n    await access(path, constants.F_OK);\n    return true;\n  } catch {\n    return false;\n  }\n};\n\nconst isJsonObject = (value: unknown): value is Record<string, unknown> =>\n  typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst getErrorMessage = (error: unknown): string =>\n  error instanceof Error ? error.message : String(error);\n\nconst resolveProjectConfigPath = async (\n  server: ViteDevServer,\n): Promise<string | undefined> => {\n  for (const fileName of defaultProjectConfigFileNames) {\n    const candidatePath = join(server.config.root, fileName);\n    if (!(await fileExists(candidatePath))) {\n      continue;\n    }\n\n    try {\n      const parsed = parse(await readFile(candidatePath, \"utf8\"));\n      if (!isJsonObject(parsed)) {\n        throw new Error(\"muon config root must be an object\");\n      }\n      return candidatePath;\n    } catch (error) {\n      server.config.logger.warn(\n        `Muon project config will be ignored because it could not be read or parsed: ${candidatePath}: ${getErrorMessage(error)}`,\n      );\n      return undefined;\n    }\n  }\n\n  server.config.logger.warn(\n    `Muon project config was not found in ${server.config.root}; launching with generated Vite config only.`,\n  );\n  return undefined;\n};\n\nconst writeLaunchScript = async (\n  paths: MuonRuntimePaths,\n  platform: NodeJS.Platform,\n): Promise<void> => {\n  await writeFile(\n    paths.launchScriptPath,\n    createMuonLaunchScript({\n      muonExecutablePath: paths.muonExecutablePath,\n      projectConfigPath: paths.projectConfigPath,\n      overrideConfigPath: paths.overrideConfigPath,\n      platform,\n    }),\n  );\n  if (platform !== \"win32\") {\n    await chmod(paths.launchScriptPath, 0o700);\n  }\n};\n\nconst quoteWindowsCommandArgument = (value: string): string =>\n  `\"${value.replaceAll('\"', '\\\\\"')}\"`;\n\nconst launchMuon = (\n  paths: MuonRuntimePaths,\n  platform: NodeJS.Platform,\n  server: ViteDevServer,\n): void => {\n  const command = platform === \"win32\" ? \"cmd.exe\" : paths.launchScriptPath;\n  const args =\n    platform === \"win32\"\n      ? [\"/d\", \"/s\", \"/c\", quoteWindowsCommandArgument(paths.launchScriptPath)]\n      : [];\n  const child = spawn(command, args, {\n    detached: true,\n    stdio: \"ignore\",\n    windowsHide: false,\n  });\n  child.once(\"error\", (error) => {\n    server.config.logger.warn(`Muon startup failed: ${getErrorMessage(error)}`);\n  });\n  child.unref();\n};\n\nexport const startMuonViteBrowserBridge = async ({\n  server,\n  pluginOptions,\n  getRuntimePluginConfig,\n  platform,\n  architecture,\n  environment,\n}: MuonViteSessionOptions): Promise<void> => {\n  await ensureMuonGitignoreEntry(server.config.root);\n\n  if (pluginOptions.open === false || server.httpServer === null) {\n    return;\n  }\n\n  const target = getDefaultMuonPrepareTarget(platform, architecture);\n  const muonPath = resolveMuonRuntimePath({\n    root: server.config.root,\n    target,\n    muonPath: pluginOptions.muonPath,\n  });\n  const cefPath =\n    pluginOptions.cefPath === undefined\n      ? undefined\n      : resolveFromRoot(server.config.root, pluginOptions.cefPath);\n  const stagePath =\n    pluginOptions.stagePath === undefined\n      ? resolve(server.config.root, \".muon\", target)\n      : resolveFromRoot(server.config.root, pluginOptions.stagePath);\n  const preparedRuntime = await runMuonPrepare({\n    muonPath,\n    cefPath,\n    stageDir: stagePath,\n    target,\n    cacheDir: environment.MUON_CACHE_DIR,\n    force: false,\n    quiet: false,\n    prepareExecutablePath: undefined,\n    environment,\n    cwd: server.config.root,\n  });\n  if (preparedRuntime.stagePath === undefined) {\n    throw new Error(\"muon-builder did not return a staged runtime path.\");\n  }\n  const paths = await createRuntimePaths(\n    server,\n    preparedRuntime.stagePath,\n    platform,\n    await resolveProjectConfigPath(server),\n  );\n  await writeLaunchScript(paths, platform);\n\n  let cleanupPromise: Promise<void> | undefined = undefined;\n  const cleanup = async (): Promise<void> => {\n    if (cleanupPromise !== undefined) {\n      return cleanupPromise;\n    }\n    cleanupPromise = (async () => {\n      await rm(paths.temporaryDirectory, { recursive: true, force: true });\n    })();\n    return cleanupPromise;\n  };\n\n  const originalClose = server.close.bind(server);\n  server.close = async (): Promise<void> => {\n    try {\n      await originalClose();\n    } finally {\n      await cleanup();\n    }\n  };\n  server.httpServer.once(\"close\", () => {\n    void cleanup();\n  });\n  server.httpServer.once(\"listening\", () => {\n    const configWritten = writeMuonOverrideConfig(\n      server,\n      paths.overrideConfigPath,\n      pluginOptions,\n      getRuntimePluginConfig,\n    );\n    if (configWritten) {\n      launchMuon(paths, platform, server);\n    }\n  });\n};\n","// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport type { MuonVitePluginOptions } from \"./vite.js\";\n\n/**\n * Metadata symbol used to recover `muon()` plugin options from `vite.config.*`.\n */\nexport const muonVitePluginOptionsSymbol = Symbol.for(\n  \"muon.vite.plugin.options\",\n);\n\ninterface MuonVitePluginWithOptions {\n  [muonVitePluginOptionsSymbol]: MuonVitePluginOptions;\n}\n\nconst isRecord = (value: unknown): value is Record<string | symbol, unknown> =>\n  typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst isStringArray = (value: unknown): value is readonly string[] =>\n  Array.isArray(value) && value.every((entry) => typeof entry === \"string\");\n\nconst isWindowsResourceOptions = (value: unknown): boolean => {\n  if (!isRecord(value)) {\n    return false;\n  }\n\n  return (\n    (value.iconPath === undefined || typeof value.iconPath === \"string\") &&\n    (value.productName === undefined ||\n      typeof value.productName === \"string\") &&\n    (value.fileDescription === undefined ||\n      typeof value.fileDescription === \"string\") &&\n    (value.companyName === undefined ||\n      typeof value.companyName === \"string\") &&\n    (value.version === undefined || typeof value.version === \"string\") &&\n    (value.copyright === undefined || typeof value.copyright === \"string\") &&\n    (value.language === undefined ||\n      (typeof value.language === \"number\" &&\n        Number.isInteger(value.language))) &&\n    (value.codePage === undefined ||\n      (typeof value.codePage === \"number\" && Number.isInteger(value.codePage)))\n  );\n};\n\nconst isLinuxDesktopOptions = (value: unknown): boolean => {\n  if (!isRecord(value)) {\n    return false;\n  }\n\n  return (\n    (value.desktopId === undefined || typeof value.desktopId === \"string\") &&\n    (value.name === undefined || typeof value.name === \"string\") &&\n    (value.comment === undefined || typeof value.comment === \"string\") &&\n    (value.iconPath === undefined || typeof value.iconPath === \"string\") &&\n    (value.categories === undefined || isStringArray(value.categories)) &&\n    (value.startupNotify === undefined ||\n      typeof value.startupNotify === \"boolean\")\n  );\n};\n\nconst isMuonViteBuildOptions = (value: unknown): boolean => {\n  if (!isRecord(value)) {\n    return false;\n  }\n\n  return (\n    (value.targets === undefined || isStringArray(value.targets)) &&\n    (value.allTargets === undefined || typeof value.allTargets === \"boolean\") &&\n    (value.appName === undefined || typeof value.appName === \"string\") &&\n    (value.appId === undefined || typeof value.appId === \"string\") &&\n    (value.outputRoot === undefined || typeof value.outputRoot === \"string\") &&\n    (value.configPath === undefined || typeof value.configPath === \"string\") &&\n    (value.iconPath === undefined || typeof value.iconPath === \"string\") &&\n    (value.windowsResource === undefined ||\n      isWindowsResourceOptions(value.windowsResource)) &&\n    (value.linuxDesktop === undefined ||\n      isLinuxDesktopOptions(value.linuxDesktop)) &&\n    (value.packageDirectory === undefined ||\n      typeof value.packageDirectory === \"string\") &&\n    (value.assetSalt === undefined || value.assetSalt instanceof Uint8Array)\n  );\n};\n\nconst isMuonVitePluginAccessImportOptions = (value: unknown): boolean => {\n  if (!isRecord(value)) {\n    return false;\n  }\n\n  return (\n    (value.sources === undefined || isStringArray(value.sources)) &&\n    (value.packages === undefined || isStringArray(value.packages)) &&\n    (value.allow === undefined || isStringArray(value.allow))\n  );\n};\n\nconst isMuonVitePluginAccessEntryOptions = (value: unknown): boolean => {\n  if (!isRecord(value)) {\n    return false;\n  }\n\n  return (\n    typeof value.name === \"string\" &&\n    (value.signature === undefined || typeof value.signature === \"string\") &&\n    (value.salt === undefined || typeof value.salt === \"string\") &&\n    (value.allow === undefined || isStringArray(value.allow)) &&\n    (value.imports === undefined ||\n      (Array.isArray(value.imports) &&\n        value.imports.every(isMuonVitePluginAccessImportOptions)))\n  );\n};\n\nconst isMuonVitePluginAccessOptions = (value: unknown): boolean => {\n  if (!isRecord(value)) {\n    return false;\n  }\n\n  return (\n    (value.path === undefined || typeof value.path === \"string\") &&\n    (value.mode === undefined ||\n      value.mode === \"simple\" ||\n      value.mode === \"validate\") &&\n    (value.pages === undefined || isStringArray(value.pages)) &&\n    (value.plugins === undefined ||\n      (Array.isArray(value.plugins) &&\n        value.plugins.every(isMuonVitePluginAccessEntryOptions)))\n  );\n};\n\nconst isMuonVitePluginOptions = (\n  value: unknown,\n): value is MuonVitePluginOptions => {\n  if (!isRecord(value)) {\n    return false;\n  }\n\n  return (\n    (value.muonPath === undefined || typeof value.muonPath === \"string\") &&\n    (value.cefPath === undefined || typeof value.cefPath === \"string\") &&\n    (value.stagePath === undefined || typeof value.stagePath === \"string\") &&\n    (value.open === undefined || typeof value.open === \"boolean\") &&\n    (value.enableDebugger === undefined ||\n      typeof value.enableDebugger === \"boolean\") &&\n    (value.pluginAccess === undefined ||\n      value.pluginAccess === false ||\n      isMuonVitePluginAccessOptions(value.pluginAccess)) &&\n    (value.build === undefined ||\n      typeof value.build === \"boolean\" ||\n      isMuonViteBuildOptions(value.build))\n  );\n};\n\n/**\n * Attaches raw Muon Vite plugin options to a plugin instance.\n *\n * @param plugin Plugin object.\n * @param options Raw plugin options.\n * @returns Plugin object with internal Muon metadata.\n */\nexport const attachMuonVitePluginOptions = <TPlugin extends object>(\n  plugin: TPlugin,\n  options: MuonVitePluginOptions,\n): TPlugin & MuonVitePluginWithOptions => {\n  Object.defineProperty(plugin, muonVitePluginOptionsSymbol, {\n    configurable: false,\n    enumerable: false,\n    value: { ...options },\n    writable: false,\n  });\n\n  return plugin as TPlugin & MuonVitePluginWithOptions;\n};\n\n/**\n * Reads raw Muon Vite plugin options from a plugin instance.\n *\n * @param plugin Candidate plugin object.\n * @returns Attached Muon options, if present.\n */\nexport const getMuonVitePluginOptions = (\n  plugin: unknown,\n): MuonVitePluginOptions | undefined => {\n  if (!isRecord(plugin)) {\n    return undefined;\n  }\n\n  const options = plugin[muonVitePluginOptionsSymbol];\n  return isMuonVitePluginOptions(options) ? options : undefined;\n};\n\n/**\n * Resolves nested Vite plugin option values into a flat list.\n *\n * @param pluginOptions Raw `plugins` field from a Vite config.\n * @returns Flat plugin object list.\n */\nexport const flattenVitePluginOptions = async (\n  pluginOptions: unknown,\n): Promise<unknown[]> => {\n  const resolvedValue = await pluginOptions;\n  if (resolvedValue === null || resolvedValue === undefined || !resolvedValue) {\n    return [];\n  }\n\n  if (Array.isArray(resolvedValue)) {\n    const nested = await Promise.all(\n      resolvedValue.map((entry) => flattenVitePluginOptions(entry)),\n    );\n    return nested.flat();\n  }\n\n  return [resolvedValue];\n};\n","// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { isAbsolute, resolve } from \"node:path\";\n\nimport type { InlineConfig, ResolvedConfig } from \"vite\";\n\nimport {\n  buildMuonApp,\n  type MuonBuildOptions,\n  type MuonBuildResult,\n} from \"./build.js\";\nimport {\n  flattenVitePluginOptions,\n  getMuonVitePluginOptions,\n} from \"./vite-options.js\";\nimport type { MuonViteBuildOptions, MuonVitePluginOptions } from \"./vite.js\";\nimport { mergeMuonWindowsResourceOptions } from \"./windows-resource.js\";\nimport { mergeMuonLinuxDesktopOptions } from \"./linux-desktop.js\";\n\n/**\n * Environment variable used to prevent the Vite plugin build hook from running\n * when a CLI command owns the Muon build sequence.\n */\nexport const muonBuildSequenceSuppressViteBuildEnvironmentKey =\n  \"MUON_SUPPRESS_VITE_MUON_BUILD\";\n\n/**\n * Resolved project metadata used by the CLI build sequence.\n */\nexport interface MuonBuildSequenceProject {\n  /** Project root used for Muon config and package metadata. */\n  root: string;\n  /** Root passed to Vite when the sequence must run `vite build`. */\n  viteBuildRoot: string;\n  /** Absolute Vite output directory used as Muon app assets. */\n  viteOutputDirectory: string | undefined;\n  /** Muon Vite plugin options if the project config contains the plugin. */\n  pluginOptions: MuonVitePluginOptions | undefined;\n}\n\n/**\n * Options for running the CLI-oriented Muon build sequence.\n */\nexport interface MuonBuildSequenceOptions extends MuonBuildOptions {\n  /** Target default used only when no Muon Vite plugin defines build options. */\n  defaultAllTargets?: boolean;\n}\n\nconst isMissingVitePackageError = (error: unknown): boolean => {\n  const candidate = error as { code?: unknown; message?: unknown };\n  return (\n    candidate.code === \"ERR_MODULE_NOT_FOUND\" &&\n    typeof candidate.message === \"string\" &&\n    candidate.message.includes(\"vite\")\n  );\n};\n\nconst resolveViteOutputDirectory = (config: ResolvedConfig): string => {\n  return isAbsolute(config.build.outDir)\n    ? config.build.outDir\n    : resolve(config.root, config.build.outDir);\n};\n\nconst findMuonVitePluginOptions = async (\n  plugins: unknown,\n): Promise<MuonVitePluginOptions | undefined> => {\n  const flattenedPlugins = await flattenVitePluginOptions(plugins);\n  const muonPlugins = flattenedPlugins\n    .map((plugin) => getMuonVitePluginOptions(plugin))\n    .filter(\n      (pluginOptions): pluginOptions is MuonVitePluginOptions =>\n        pluginOptions !== undefined,\n    );\n\n  if (muonPlugins.length > 1) {\n    throw new Error(\n      \"Multiple muon() plugin definitions were found in vite.config.*.\",\n    );\n  }\n\n  return muonPlugins[0];\n};\n\n/**\n * Loads Vite configuration only far enough to discover whether a Muon plugin\n * controls the build sequence.\n */\nexport const loadMuonBuildSequenceProject = async (\n  cwd: string,\n): Promise<MuonBuildSequenceProject> => {\n  const resolvedCwd = resolve(cwd);\n  let vite: typeof import(\"vite\");\n  try {\n    vite = await import(\"vite\");\n  } catch (error) {\n    if (isMissingVitePackageError(error)) {\n      return {\n        root: resolvedCwd,\n        viteBuildRoot: resolvedCwd,\n        viteOutputDirectory: undefined,\n        pluginOptions: undefined,\n      };\n    }\n    throw error;\n  }\n\n  const resolvedConfig = await vite.resolveConfig(\n    { root: resolvedCwd, logLevel: \"silent\" } satisfies InlineConfig,\n    \"build\",\n    \"production\",\n    \"production\",\n  );\n  const pluginOptions = await findMuonVitePluginOptions(resolvedConfig.plugins);\n  if (pluginOptions === undefined) {\n    return {\n      root: resolvedCwd,\n      viteBuildRoot: resolvedCwd,\n      viteOutputDirectory: undefined,\n      pluginOptions: undefined,\n    };\n  }\n\n  return {\n    root: resolvedConfig.root,\n    viteBuildRoot: resolvedCwd,\n    viteOutputDirectory: resolveViteOutputDirectory(resolvedConfig),\n    pluginOptions,\n  };\n};\n\n/**\n * Returns Muon build options from a Muon Vite plugin declaration.\n */\nexport const resolveMuonViteBuildOptions = (\n  pluginOptions: MuonVitePluginOptions | undefined,\n): MuonViteBuildOptions => {\n  if (pluginOptions?.build === false) {\n    throw new Error(\"Muon build is disabled by muon({ build: false }).\");\n  }\n  return typeof pluginOptions?.build === \"object\" ? pluginOptions.build : {};\n};\n\nconst runViteBuild = async (root: string): Promise<void> => {\n  const vite = await import(\"vite\");\n  const previous =\n    process.env[muonBuildSequenceSuppressViteBuildEnvironmentKey];\n  process.env[muonBuildSequenceSuppressViteBuildEnvironmentKey] = \"1\";\n  try {\n    await vite.build({ root, logLevel: \"silent\" } satisfies InlineConfig);\n  } finally {\n    if (previous === undefined) {\n      delete process.env[muonBuildSequenceSuppressViteBuildEnvironmentKey];\n    } else {\n      process.env[muonBuildSequenceSuppressViteBuildEnvironmentKey] = previous;\n    }\n  }\n};\n\nconst hasExplicitTargets = (options: MuonBuildSequenceOptions): boolean =>\n  options.targets !== undefined && options.targets.length > 0;\n\nconst copyDefinedBuildOptions = (\n  output: MuonBuildOptions,\n  input: MuonBuildSequenceOptions,\n  usesViteAssets: boolean,\n): void => {\n  if (input.assetSourcePath !== undefined) {\n    if (usesViteAssets) {\n      throw new Error(\n        \"--assets cannot be used when a muon() Vite plugin provides the build sequence.\",\n      );\n    }\n    output.assetSourcePath = input.assetSourcePath;\n  }\n  if (input.assetPrefix !== undefined) {\n    output.assetPrefix = input.assetPrefix;\n  }\n  if (input.targets !== undefined && input.targets.length > 0) {\n    output.targets = input.targets;\n    if (input.allTargets === undefined) {\n      output.allTargets = false;\n    }\n  }\n  if (input.allTargets !== undefined) {\n    output.allTargets = input.allTargets;\n  }\n  if (input.appName !== undefined) {\n    output.appName = input.appName;\n  }\n  if (input.appId !== undefined) {\n    output.appId = input.appId;\n  }\n  if (input.outputRoot !== undefined) {\n    output.outputRoot = input.outputRoot;\n  }\n  if (input.configPath !== undefined) {\n    output.configPath = input.configPath;\n  }\n  if (input.iconPath !== undefined) {\n    output.iconPath = input.iconPath;\n  }\n  if (input.windowsResource !== undefined) {\n    const windowsResource = mergeMuonWindowsResourceOptions(\n      input.windowsResource,\n      output.windowsResource,\n    );\n    if (windowsResource !== undefined) {\n      output.windowsResource = windowsResource;\n    }\n  }\n  if (input.linuxDesktop !== undefined) {\n    const linuxDesktop = mergeMuonLinuxDesktopOptions(\n      input.linuxDesktop,\n      output.linuxDesktop,\n    );\n    if (linuxDesktop !== undefined) {\n      output.linuxDesktop = linuxDesktop;\n    }\n  }\n  if (input.packageDirectory !== undefined) {\n    output.packageDirectory = input.packageDirectory;\n  }\n  if (input.assetSalt !== undefined) {\n    output.assetSalt = input.assetSalt;\n  }\n};\n\n/**\n * Runs the project build sequence used by `muon build` and `muon pack`.\n */\nexport const runMuonBuildSequence = async (\n  options: MuonBuildSequenceOptions = {},\n  loadedProject?: MuonBuildSequenceProject,\n): Promise<MuonBuildResult> => {\n  const project =\n    loadedProject ??\n    (await loadMuonBuildSequenceProject(options.root ?? process.cwd()));\n  const pluginBuildOptions = resolveMuonViteBuildOptions(project.pluginOptions);\n  const usesViteAssets = project.pluginOptions !== undefined;\n  const buildOptions: MuonBuildOptions = {\n    root: project.root,\n  };\n\n  if (usesViteAssets) {\n    if (project.viteOutputDirectory === undefined) {\n      throw new Error(\"Vite output directory could not be resolved.\");\n    }\n    Object.assign(buildOptions, pluginBuildOptions);\n    buildOptions.assetSourcePath = project.viteOutputDirectory;\n    buildOptions.assetPrefix = \"main\";\n    await runViteBuild(project.viteBuildRoot);\n  } else if (\n    options.defaultAllTargets !== undefined &&\n    options.allTargets === undefined &&\n    !hasExplicitTargets(options)\n  ) {\n    buildOptions.allTargets = options.defaultAllTargets;\n  }\n\n  copyDefinedBuildOptions(buildOptions, options, usesViteAssets);\n  return await buildMuonApp(buildOptions);\n};\n","// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport type { Plugin, ResolvedConfig, UserConfig, WatchOptions } from \"vite\";\nimport { isAbsolute, resolve } from \"node:path\";\n\nimport { buildMuonApp, type MuonBuildOptions } from \"./build.js\";\nimport {\n  createMuonCapabilityModuleResolver,\n  type MuonCapabilityModuleResolver,\n  type MuonRuntimePluginConfig,\n} from \"./capability.js\";\nimport {\n  resolveMuonPluginAccessOptions,\n  type MuonPluginAccessEntryOptions,\n  type MuonPluginAccessImportOptions,\n  type MuonPluginAccessOptions,\n  type MuonResolvedPluginAccessOptions,\n} from \"./plugin-access.js\";\nimport { startMuonViteBrowserBridge } from \"./vite-internals.js\";\nimport { attachMuonVitePluginOptions } from \"./vite-options.js\";\nimport { muonBuildSequenceSuppressViteBuildEnvironmentKey } from \"./build-sequence.js\";\n\ntype MuonWatchIgnored = NonNullable<WatchOptions[\"ignored\"]>;\n\nconst getErrorMessage = (error: unknown): string =>\n  error instanceof Error ? error.message : String(error);\n\n/**\n * Windows PE and NSIS resource metadata options.\n */\nexport interface MuonWindowsResourceOptions {\n  /**\n   * Windows-specific icon PNG file path override.\n   *\n   * @remarks Only `.png` files are accepted as app inputs. Muon generates the\n   * required Windows `.ico` file automatically when updating PE resources or\n   * creating NSIS installers. Use top-level `iconPath` for a shared static\n   * application icon. Relative paths are resolved from the source that supplied\n   * the option.\n   * @defaultValue Uses top-level `iconPath`, then the packaged `muon-256.png`\n   * icon.\n   */\n  iconPath?: string;\n\n  /**\n   * Product name written to the Windows version resource.\n   *\n   * @defaultValue Uses `windows.resource.productName`, `project.json`,\n   * `package.json`, then the Muon launcher name.\n   */\n  productName?: string;\n\n  /**\n   * File description written to the Windows version resource.\n   *\n   * @defaultValue Uses `windows.resource.fileDescription`, `project.json`,\n   * `package.json.description`, then the product name.\n   */\n  fileDescription?: string;\n\n  /**\n   * Company name written to the Windows version resource.\n   *\n   * @defaultValue Uses `windows.resource.companyName`, `project.json`,\n   * `package.json.author`, then `\"Unknown\"`.\n   */\n  companyName?: string;\n\n  /**\n   * Product and file version string.\n   *\n   * @remarks PE fixed version fields are normalized to four numeric parts, so\n   * `1.2.3` becomes `1.2.3.0`. String fields keep the original value.\n   * @defaultValue Uses `windows.resource.version`, `project.json.version`,\n   * `package.json.version`, then `\"0.0.0\"`.\n   */\n  version?: string;\n\n  /**\n   * Legal copyright written to the Windows version resource.\n   *\n   * @defaultValue Uses `windows.resource.copyright`, `project.json`, then\n   * `package.json.copyright` when available.\n   */\n  copyright?: string;\n\n  /**\n   * Windows resource language identifier.\n   *\n   * @defaultValue `1033` (`en-US`).\n   */\n  language?: number;\n\n  /**\n   * Windows version resource code page.\n   *\n   * @defaultValue `1200` (`UTF-16LE`).\n   */\n  codePage?: number;\n}\n\n/**\n * Linux desktop entry metadata options.\n */\nexport interface MuonLinuxDesktopOptions {\n  /**\n   * Desktop entry identifier without the `.desktop` suffix.\n   *\n   * @defaultValue Uses the resolved Muon `appId`.\n   */\n  desktopId?: string;\n\n  /**\n   * Application display name.\n   *\n   * @defaultValue Uses `linux.desktop.name`, then `package.json` name.\n   */\n  name?: string;\n\n  /**\n   * Desktop entry comment.\n   *\n   * @defaultValue Uses `linux.desktop.comment`, then `package.json`\n   * description.\n   */\n  comment?: string;\n\n  /**\n   * Linux-specific desktop icon PNG file path override.\n   *\n   * @remarks Only `.png` files are accepted as app inputs. Relative paths are\n   * resolved from the source that supplied the option. Use top-level\n   * `iconPath` for a shared static application icon.\n   * @defaultValue Uses top-level `iconPath`, then the packaged `muon-256.png`\n   * icon when available.\n   */\n  iconPath?: string;\n\n  /**\n   * Desktop menu categories.\n   *\n   * @defaultValue `[\"Utility\"]`.\n   */\n  categories?: readonly string[];\n\n  /**\n   * Whether desktop startup notification is requested.\n   *\n   * @defaultValue `true`.\n   */\n  startupNotify?: boolean;\n}\n\n/**\n * Options for generating Muon app distributions after Vite build.\n */\nexport interface MuonViteBuildOptions {\n  /**\n   * Public target identifiers to build.\n   *\n   * @defaultValue Uses every supported target unless `allTargets` is `false`,\n   * then the host target is used.\n   */\n  targets?: readonly string[];\n\n  /**\n   * Build every supported target from the installed package.\n   *\n   * @remarks Set false to build only the host target when `targets` is omitted.\n   * @defaultValue `true` when `targets` is omitted.\n   */\n  allTargets?: boolean;\n\n  /**\n   * File name used for the app launcher.\n   *\n   * @remarks The .exe suffix is added automatically for Windows targets.\n   * @defaultValue The sanitized package name, or `\"muon-app\"` when unavailable.\n   */\n  appName?: string;\n\n  /**\n   * Stable base application identifier used for portable runtime state.\n   *\n   * @remarks Windows target distributions embed `<appId>.<arch>` as their\n   * runtime app identifier. Linux targets embed this value unchanged.\n   *\n   * @defaultValue The sanitized package name, or `\"muon-app\"` when unavailable.\n   */\n  appId?: string;\n\n  /**\n   * Parent directory that receives dist-muon/linux-amd64/ style outputs.\n   *\n   * @defaultValue The Vite project root.\n   */\n  outputRoot?: string;\n\n  /**\n   * Muon config path to embed.\n   *\n   * @defaultValue Auto-detects `muon.json5`, `muon.jsonc`, then `muon.json`;\n   * uses an empty config when none exists.\n   */\n  configPath?: string;\n\n  /**\n   * Static application icon PNG file path.\n   *\n   * @remarks The icon is used for Windows PE/NSIS resources, Linux desktop\n   * entries, and the generated initial title bar icon asset. Target-specific\n   * icon paths in `windowsResource` or `linuxDesktop` override this value for\n   * that target.\n   * @defaultValue Uses top-level `muon.json` `iconPath`, `project.json`, then\n   * the packaged `muon-256.png` icon.\n   */\n  iconPath?: string;\n\n  /**\n   * Windows PE and NSIS resource metadata.\n   *\n   * @defaultValue Uses CLI options, `muon.json` `windows.resource`,\n   * `project.json`, `package.json`, then Muon defaults.\n   */\n  windowsResource?: MuonWindowsResourceOptions;\n\n  /**\n   * Linux desktop entry metadata.\n   *\n   * @defaultValue Uses CLI options, `muon.json` `linux.desktop`, package\n   * metadata, then Muon defaults.\n   */\n  linuxDesktop?: MuonLinuxDesktopOptions;\n\n  /**\n   * Directory containing package runtime/ and native/ folders.\n   *\n   * @defaultValue The installed muon package dist directory.\n   */\n  packageDirectory?: string;\n\n  /**\n   * Asset salt override for deterministic tests.\n   *\n   * @remarks Production builds should omit this option.\n   * @defaultValue A random 16-byte salt.\n   */\n  assetSalt?: Uint8Array;\n}\n\n/**\n * Import-side capability rule for Muon plugin virtual modules.\n */\nexport interface MuonVitePluginAccessImportOptions extends MuonPluginAccessImportOptions {}\n\n/**\n * Plugin entry and capability import configuration for Muon virtual modules.\n */\nexport interface MuonVitePluginAccessEntryOptions extends MuonPluginAccessEntryOptions {}\n\n/**\n * Plugin access configuration for Muon plugin virtual modules.\n */\nexport interface MuonVitePluginAccessOptions extends MuonPluginAccessOptions {\n  /**\n   * Runtime plugin entries and validate-mode import rules.\n   */\n  plugins?: readonly MuonVitePluginAccessEntryOptions[];\n}\n\n/**\n * Options for the Muon Vite development plugin.\n */\nexport interface MuonVitePluginOptions {\n  /**\n   * Directory containing muon-core runtime files such as muon-core and plugins.\n   *\n   * @remarks Relative paths are resolved from the Vite project root. When omitted,\n   * the packaged runtime at dist/runtime/<public-target> is used.\n   * @defaultValue The packaged runtime at `dist/runtime/<public-target>`.\n   */\n  muonPath?: string;\n\n  /**\n   * Directory containing CEF files, or a CEF archive root with Release/Resources.\n   *\n   * @remarks Relative paths are resolved from the Vite project root. When omitted,\n   * muon-builder downloads and caches the tested CEF artifact from muonPath.\n   * @defaultValue The tested CEF artifact downloaded and cached by muon-builder.\n   */\n  cefPath?: string;\n\n  /**\n   * Runtime staging directory used for development startup.\n   *\n   * @remarks Relative paths are resolved from the Vite project root.\n   * @defaultValue `.muon/<public-target>`.\n   */\n  stagePath?: string;\n\n  /**\n   * Launch Muon automatically during Vite dev startup.\n   *\n   * @remarks This is independent from Vite's server.open browser startup\n   * option. Vite build ignores this option.\n   * @defaultValue `true`\n   */\n  open?: boolean;\n\n  /**\n   * Enable the Muon debugger defaults during Vite dev startup.\n   *\n   * @remarks When enabled, the generated development config enables CDP and\n   * binds DevTools to F12. Vite build ignores this option.\n   * @defaultValue `true`\n   */\n  enableDebugger?: boolean;\n\n  /**\n   * Plugin access mode and virtual module capability imports.\n   *\n   * @remarks Omit this option to use the `plugin` section from `muon.json`.\n   * Pass plugin entries with import rules to override `muon.json` and allow\n   * virtual modules such as `muon:executor`. Pass `false` to use simple\n   * window-global exposure.\n   * @defaultValue `muon.json` plugin config, or validate mode with no\n   * capability imports.\n   */\n  pluginAccess?: false | MuonVitePluginAccessOptions;\n\n  /**\n   * Build app distributions from Vite output.\n   *\n   * @remarks Set false to disable the build hook while keeping the development\n   * bridge enabled.\n   * @defaultValue `true` during Vite build.\n   */\n  build?: boolean | MuonViteBuildOptions;\n}\n\n/**\n * Creates a Vite plugin that launches Muon during Vite dev startup.\n *\n * @param options Muon plugin options used for development startup and build.\n * @returns Vite plugin instance.\n * @defaultValue `options` defaults to `{}`.\n */\nconst muon = (options: MuonVitePluginOptions = {}): Plugin => {\n  let resolvedConfig: ResolvedConfig | undefined = undefined;\n  let capabilityResolver: MuonCapabilityModuleResolver | undefined = undefined;\n  let resolvedPluginAccess: MuonResolvedPluginAccessOptions | undefined =\n    undefined;\n\n  const plugin: Plugin = {\n    name: \"muon\",\n    config: (config): Omit<UserConfig, \"plugins\"> | null => {\n      if (config.server?.watch === null) {\n        return null;\n      }\n\n      return {\n        server: {\n          watch: createMuonWatchOptions(config.server?.watch),\n        },\n      };\n    },\n    configResolved: async (config): Promise<void> => {\n      resolvedConfig = config;\n      resolvedPluginAccess = await resolveMuonPluginAccessOptions({\n        root: config.root,\n        configPath: resolveMuonConfigPathForViteCommand(config, options),\n        pluginAccess: options.pluginAccess,\n        ...(config.command === \"serve\"\n          ? {\n              onConfigReadError: (error: unknown): void => {\n                config.logger.warn(\n                  `Muon project config will be ignored because it could not be read or parsed: ${getErrorMessage(error)}`,\n                );\n              },\n            }\n          : {}),\n      });\n      capabilityResolver =\n        resolvedPluginAccess.mode === \"validate\"\n          ? createMuonCapabilityModuleResolver(\n              config.root,\n              resolvedPluginAccess.capabilityOptions,\n            )\n          : undefined;\n    },\n    resolveId: (source, importer) =>\n      capabilityResolver?.resolveId(source, importer)?.id,\n    load: (id) => capabilityResolver?.load(id),\n    configureServer: async (server) => {\n      await startMuonViteBrowserBridge({\n        server,\n        pluginOptions: options,\n        getRuntimePluginConfig: () =>\n          resolveMuonRuntimePluginConfig(\n            capabilityResolver,\n            resolvedPluginAccess,\n          ),\n        platform: process.platform,\n        architecture: process.arch,\n        environment: process.env,\n      });\n    },\n    closeBundle: async () => {\n      if (resolvedConfig === undefined || resolvedConfig.command !== \"build\") {\n        return;\n      }\n      if (\n        process.env[muonBuildSequenceSuppressViteBuildEnvironmentKey] === \"1\"\n      ) {\n        return;\n      }\n      if (options.build === false) {\n        return;\n      }\n\n      const buildOptions =\n        typeof options.build === \"object\" ? options.build : {};\n      await buildMuonApp(\n        createMuonBuildOptions(\n          resolvedConfig,\n          buildOptions,\n          resolveMuonRuntimePluginConfig(\n            capabilityResolver,\n            resolvedPluginAccess,\n          ),\n        ),\n      );\n    },\n  };\n\n  return attachMuonVitePluginOptions(plugin, options);\n};\n\nconst isMuonStagingWatchPath = (path: string): boolean => {\n  const normalized = path.replaceAll(\"\\\\\", \"/\");\n  return (\n    normalized === \".muon\" ||\n    normalized.startsWith(\".muon/\") ||\n    normalized.endsWith(\"/.muon\") ||\n    normalized.includes(\"/.muon/\")\n  );\n};\n\nconst mergeMuonWatchIgnored = (\n  ignored: WatchOptions[\"ignored\"] | undefined,\n): MuonWatchIgnored => {\n  const muonIgnored = (path: string): boolean => isMuonStagingWatchPath(path);\n  if (ignored === undefined) {\n    return muonIgnored;\n  }\n  return Array.isArray(ignored)\n    ? [...ignored, muonIgnored]\n    : [ignored, muonIgnored];\n};\n\nconst createMuonWatchOptions = (\n  watch: WatchOptions | undefined,\n): WatchOptions => ({\n  ...(watch ?? {}),\n  ignored: mergeMuonWatchIgnored(watch?.ignored),\n});\n\nconst createMuonBuildOptions = (\n  config: ResolvedConfig,\n  buildOptions: MuonViteBuildOptions,\n  runtimePluginConfig: MuonRuntimePluginConfig,\n): MuonBuildOptions => {\n  const outDir = isAbsolute(config.build.outDir)\n    ? config.build.outDir\n    : resolve(config.root, config.build.outDir);\n  const options: MuonBuildOptions = {\n    root: config.root,\n    assetSourcePath: outDir,\n    assetPrefix: \"main\",\n  };\n\n  if (buildOptions.allTargets !== undefined) {\n    options.allTargets = buildOptions.allTargets;\n  }\n  if (buildOptions.targets !== undefined) {\n    options.targets = buildOptions.targets;\n  }\n  if (buildOptions.appName !== undefined) {\n    options.appName = buildOptions.appName;\n  }\n  if (buildOptions.appId !== undefined) {\n    options.appId = buildOptions.appId;\n  }\n  if (buildOptions.outputRoot !== undefined) {\n    options.outputRoot = buildOptions.outputRoot;\n  }\n  if (buildOptions.configPath !== undefined) {\n    options.configPath = buildOptions.configPath;\n  }\n  if (buildOptions.iconPath !== undefined) {\n    options.iconPath = buildOptions.iconPath;\n  }\n  if (buildOptions.windowsResource !== undefined) {\n    options.windowsResource = buildOptions.windowsResource;\n  }\n  if (buildOptions.linuxDesktop !== undefined) {\n    options.linuxDesktop = buildOptions.linuxDesktop;\n  }\n  if (buildOptions.packageDirectory !== undefined) {\n    options.packageDirectory = buildOptions.packageDirectory;\n  }\n  if (buildOptions.assetSalt !== undefined) {\n    options.assetSalt = buildOptions.assetSalt;\n  }\n  options.runtimePluginConfig = runtimePluginConfig;\n\n  return options;\n};\n\nconst resolveMuonConfigPathForViteCommand = (\n  config: ResolvedConfig,\n  options: MuonVitePluginOptions,\n): string | undefined => {\n  if (config.command !== \"build\" || typeof options.build !== \"object\") {\n    return undefined;\n  }\n  return options.build.configPath;\n};\n\nconst resolveMuonRuntimePluginConfig = (\n  capabilityResolver: MuonCapabilityModuleResolver | undefined,\n  pluginAccess: MuonResolvedPluginAccessOptions | undefined,\n): MuonRuntimePluginConfig =>\n  pluginAccess?.mode === \"simple\"\n    ? { mode: \"simple\", ...pluginAccess.runtimeOverlay }\n    : {\n        ...(capabilityResolver?.getRuntimePluginConfig() ?? {\n          mode: \"validate\",\n          capabilities: [],\n        }),\n        ...(pluginAccess?.runtimeOverlay ?? {}),\n      };\n\nexport default muon;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;CAAA,CAAC,SAAU,QAAQ,SAAS;EAC3B,OAAO,YAAY,YAAY,OAAO,WAAW,cAAc,OAAO,UAAU,QAAQ,IACxF,OAAO,WAAW,cAAc,OAAO,MAAM,OAAO,OAAO,IAC1D,OAAO,QAAQ,QAAQ;CACzB,GAAA,UAAS,WAAY;EAAE;EAEtB,SAAS,qBAAqB,IAAI,UAAQ;GACzC,OAAO,WAAS,EAAE,SAAS,CAAC,EAAE,GAAG,GAAGA,UAAQA,SAAO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