@likec4/mcp 1.55.1 → 1.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/README.md +2 -2
  2. package/bin/likec4-mcp.mjs +3 -0
  3. package/dist/chunks/libs/@chevrotain/gast.mjs +1 -0
  4. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +9 -0
  5. package/dist/chunks/libs/@chevrotain/utils.mjs +1 -0
  6. package/dist/chunks/libs/@hono/mcp.mjs +45 -0
  7. package/dist/chunks/libs/@hono/node-server.mjs +1 -0
  8. package/dist/chunks/libs/@logtape/logtape.mjs +4 -0
  9. package/dist/chunks/libs/@lume/kiwi.mjs +1 -0
  10. package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +12 -0
  11. package/dist/chunks/libs/@radix-ui/colors.mjs +1 -0
  12. package/dist/chunks/libs/@ungap/structured-clone.mjs +1 -0
  13. package/dist/chunks/libs/bail.mjs +1 -0
  14. package/dist/chunks/libs/ccount.mjs +1 -0
  15. package/dist/chunks/libs/chevrotain-allstar.mjs +2 -0
  16. package/dist/chunks/libs/chevrotain.mjs +58 -0
  17. package/dist/chunks/libs/chokidar.mjs +3 -0
  18. package/dist/chunks/libs/chroma-js.mjs +15 -0
  19. package/dist/chunks/libs/citty.mjs +5 -0
  20. package/dist/chunks/libs/comma-separated-tokens.mjs +1 -0
  21. package/dist/chunks/libs/decode-named-character-reference.mjs +1 -0
  22. package/dist/chunks/libs/defu.mjs +1 -0
  23. package/dist/chunks/libs/destr.mjs +1 -0
  24. package/dist/chunks/libs/devlop.mjs +1 -0
  25. package/dist/chunks/libs/escape-string-regexp.mjs +1 -0
  26. package/dist/chunks/libs/eventemitter3.mjs +1 -0
  27. package/dist/chunks/libs/extend.mjs +1 -0
  28. package/dist/chunks/libs/fdir.mjs +1 -0
  29. package/dist/chunks/libs/graphology-dag.mjs +1 -0
  30. package/dist/chunks/libs/graphology.mjs +1 -0
  31. package/dist/chunks/libs/hast-util-sanitize.mjs +1 -0
  32. package/dist/chunks/libs/hast-util-to-html.mjs +9 -0
  33. package/dist/chunks/libs/hono.mjs +1 -0
  34. package/dist/chunks/libs/immer.mjs +1 -0
  35. package/dist/chunks/libs/is-error-instance.mjs +1 -0
  36. package/dist/chunks/libs/is-plain-obj.mjs +1 -0
  37. package/dist/chunks/libs/isexe.mjs +1 -0
  38. package/dist/chunks/libs/json5.mjs +14 -0
  39. package/dist/chunks/libs/khroma.mjs +1 -0
  40. package/dist/chunks/libs/langium.mjs +29 -0
  41. package/dist/chunks/libs/longest-streak.mjs +1 -0
  42. package/dist/chunks/libs/markdown-table.mjs +2 -0
  43. package/dist/chunks/libs/mdast-util-find-and-replace.mjs +1 -0
  44. package/dist/chunks/libs/mdast-util-from-markdown.mjs +3 -0
  45. package/dist/chunks/libs/mdast-util-gfm.mjs +15 -0
  46. package/dist/chunks/libs/mdast-util-to-hast.mjs +11 -0
  47. package/dist/chunks/libs/merge-error-cause.mjs +2 -0
  48. package/dist/chunks/libs/micromark-extension-gfm.mjs +1 -0
  49. package/dist/chunks/libs/mnemonist.mjs +1 -0
  50. package/dist/chunks/libs/nano-spawn.mjs +3 -0
  51. package/dist/chunks/libs/natural-compare-lite.mjs +9 -0
  52. package/dist/chunks/libs/ohash.mjs +1 -0
  53. package/dist/chunks/libs/p-limit.mjs +1 -0
  54. package/dist/chunks/libs/p-queue.mjs +1 -0
  55. package/dist/chunks/libs/p-timeout.mjs +1 -0
  56. package/dist/chunks/libs/parse-ms.mjs +1 -0
  57. package/dist/chunks/libs/pathe.mjs +1 -0
  58. package/dist/chunks/libs/pretty-ms.mjs +1 -0
  59. package/dist/chunks/libs/rehype-sanitize.mjs +1 -0
  60. package/dist/chunks/libs/rehype-stringify.mjs +1 -0
  61. package/dist/chunks/libs/remark-gfm.mjs +1 -0
  62. package/dist/chunks/libs/remark-github-blockquote-alert.mjs +3 -0
  63. package/dist/chunks/libs/remark-parse.mjs +1 -0
  64. package/dist/chunks/libs/remark-rehype.mjs +1 -0
  65. package/dist/chunks/libs/remeda.mjs +1 -0
  66. package/dist/chunks/libs/safe-stringify.mjs +1 -0
  67. package/dist/chunks/libs/strip-indent.mjs +1 -0
  68. package/dist/chunks/libs/tinyrainbow.mjs +1 -0
  69. package/dist/chunks/libs/trough.mjs +1 -0
  70. package/dist/chunks/libs/ts-graphviz.mjs +4 -0
  71. package/dist/chunks/libs/ufo.mjs +1 -0
  72. package/dist/chunks/libs/unified.mjs +1 -0
  73. package/dist/chunks/libs/unstorage.mjs +1 -0
  74. package/dist/chunks/libs/which.mjs +1 -0
  75. package/dist/chunks/libs/word-wrap.mjs +12 -0
  76. package/dist/chunks/rolldown-runtime.mjs +1 -0
  77. package/dist/chunks/src.mjs +1228 -0
  78. package/dist/cli.mjs +1 -1
  79. package/dist/index.mjs +1 -1
  80. package/package.json +21 -17
  81. package/dist/THIRD-PARTY-LICENSES.md +0 -2318
  82. package/dist/_chunks/libs/@chevrotain/cst-dts-gen.mjs +0 -30
  83. package/dist/_chunks/libs/@chevrotain/regexp-to-ast.mjs +0 -9
  84. package/dist/_chunks/libs/@chevrotain/utils.mjs +0 -1
  85. package/dist/_chunks/libs/@hono/mcp.mjs +0 -45
  86. package/dist/_chunks/libs/@hono/node-server.mjs +0 -1
  87. package/dist/_chunks/libs/@logtape/logtape.mjs +0 -4
  88. package/dist/_chunks/libs/@lume/kiwi.mjs +0 -1
  89. package/dist/_chunks/libs/@mantine/colors-generator.mjs +0 -15
  90. package/dist/_chunks/libs/@modelcontextprotocol/sdk.mjs +0 -12
  91. package/dist/_chunks/libs/@radix-ui/colors.mjs +0 -1
  92. package/dist/_chunks/libs/@ungap/structured-clone.mjs +0 -1
  93. package/dist/_chunks/libs/bail.mjs +0 -1
  94. package/dist/_chunks/libs/ccount.mjs +0 -1
  95. package/dist/_chunks/libs/chevrotain-allstar.mjs +0 -2
  96. package/dist/_chunks/libs/chevrotain.mjs +0 -58
  97. package/dist/_chunks/libs/chokidar.mjs +0 -3
  98. package/dist/_chunks/libs/citty.mjs +0 -5
  99. package/dist/_chunks/libs/comma-separated-tokens.mjs +0 -1
  100. package/dist/_chunks/libs/decode-named-character-reference.mjs +0 -1
  101. package/dist/_chunks/libs/defu.mjs +0 -1
  102. package/dist/_chunks/libs/destr.mjs +0 -1
  103. package/dist/_chunks/libs/devlop.mjs +0 -1
  104. package/dist/_chunks/libs/escape-string-regexp.mjs +0 -1
  105. package/dist/_chunks/libs/eventemitter3.mjs +0 -1
  106. package/dist/_chunks/libs/extend.mjs +0 -1
  107. package/dist/_chunks/libs/fast-equals.mjs +0 -1
  108. package/dist/_chunks/libs/fdir.mjs +0 -1
  109. package/dist/_chunks/libs/graphology-dag.mjs +0 -1
  110. package/dist/_chunks/libs/graphology.mjs +0 -1
  111. package/dist/_chunks/libs/hast-util-sanitize.mjs +0 -1
  112. package/dist/_chunks/libs/hast-util-to-html.mjs +0 -9
  113. package/dist/_chunks/libs/immer.mjs +0 -1
  114. package/dist/_chunks/libs/is-error-instance.mjs +0 -1
  115. package/dist/_chunks/libs/is-plain-obj.mjs +0 -1
  116. package/dist/_chunks/libs/isexe.mjs +0 -1
  117. package/dist/_chunks/libs/json5.mjs +0 -14
  118. package/dist/_chunks/libs/khroma.mjs +0 -1
  119. package/dist/_chunks/libs/langium.mjs +0 -30
  120. package/dist/_chunks/libs/longest-streak.mjs +0 -1
  121. package/dist/_chunks/libs/markdown-table.mjs +0 -2
  122. package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +0 -1
  123. package/dist/_chunks/libs/mdast-util-from-markdown.mjs +0 -3
  124. package/dist/_chunks/libs/mdast-util-gfm.mjs +0 -15
  125. package/dist/_chunks/libs/mdast-util-to-hast.mjs +0 -11
  126. package/dist/_chunks/libs/merge-error-cause.mjs +0 -2
  127. package/dist/_chunks/libs/micromark-extension-gfm.mjs +0 -1
  128. package/dist/_chunks/libs/mnemonist.mjs +0 -1
  129. package/dist/_chunks/libs/nano-spawn.mjs +0 -3
  130. package/dist/_chunks/libs/natural-compare-lite.mjs +0 -9
  131. package/dist/_chunks/libs/ohash.mjs +0 -1
  132. package/dist/_chunks/libs/p-limit.mjs +0 -1
  133. package/dist/_chunks/libs/p-queue.mjs +0 -1
  134. package/dist/_chunks/libs/p-timeout.mjs +0 -1
  135. package/dist/_chunks/libs/parse-ms.mjs +0 -1
  136. package/dist/_chunks/libs/pathe.mjs +0 -1
  137. package/dist/_chunks/libs/pretty-ms.mjs +0 -1
  138. package/dist/_chunks/libs/rehype-sanitize.mjs +0 -1
  139. package/dist/_chunks/libs/rehype-stringify.mjs +0 -1
  140. package/dist/_chunks/libs/remark-gfm.mjs +0 -1
  141. package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +0 -3
  142. package/dist/_chunks/libs/remark-parse.mjs +0 -1
  143. package/dist/_chunks/libs/remark-rehype.mjs +0 -1
  144. package/dist/_chunks/libs/remeda.mjs +0 -2
  145. package/dist/_chunks/libs/safe-stringify.mjs +0 -1
  146. package/dist/_chunks/libs/strip-indent.mjs +0 -1
  147. package/dist/_chunks/libs/tinyrainbow.mjs +0 -1
  148. package/dist/_chunks/libs/trough.mjs +0 -1
  149. package/dist/_chunks/libs/ts-graphviz.mjs +0 -4
  150. package/dist/_chunks/libs/ufo.mjs +0 -1
  151. package/dist/_chunks/libs/unified.mjs +0 -1
  152. package/dist/_chunks/libs/unstorage.mjs +0 -1
  153. package/dist/_chunks/libs/which.mjs +0 -1
  154. package/dist/_chunks/libs/word-wrap.mjs +0 -12
  155. package/dist/_chunks/rolldown-runtime.mjs +0 -1
  156. package/dist/_chunks/src.mjs +0 -1228
  157. /package/dist/{_chunks → chunks}/libs/character-entities-html4.mjs +0 -0
  158. /package/dist/{_chunks → chunks}/libs/character-entities-legacy.mjs +0 -0
  159. /package/dist/{_chunks → chunks}/libs/character-entities.mjs +0 -0
@@ -0,0 +1 @@
1
+ import"../rolldown-runtime.mjs";const e=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,t=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,n=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function jsonParseTransform(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){warnKeyDropped(e);return}return t}function warnKeyDropped(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function destr(r,i={}){if(typeof r!=`string`)return r;if(r[0]===`"`&&r[r.length-1]===`"`&&r.indexOf(`\\`)===-1)return r.slice(1,-1);let a=r.trim();if(a.length<=9)switch(a.toLowerCase()){case`true`:return!0;case`false`:return!1;case`undefined`:return;case`null`:return null;case`nan`:return NaN;case`infinity`:return 1/0;case`-infinity`:return-1/0}if(!n.test(r)){if(i.strict)throw SyntaxError(`[destr] Invalid JSON`);return r}try{if(e.test(r)||t.test(r)){if(i.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(r,jsonParseTransform)}return JSON.parse(r)}catch(e){if(i.strict)throw e;return r}}export{destr as t};
@@ -0,0 +1 @@
1
+ import"../rolldown-runtime.mjs";function ok(){}export{ok as t};
@@ -0,0 +1 @@
1
+ import"../rolldown-runtime.mjs";function escapeStringRegexp(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}export{escapeStringRegexp as t};
@@ -0,0 +1 @@
1
+ import{c as e,t}from"../rolldown-runtime.mjs";var n=e(t(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function Events(){}Object.create&&(Events.prototype=Object.create(null),new Events().__proto__||(r=!1));function EE(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function addListener(e,t,n,i,a){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var o=new EE(n,i||e,a),s=r?r+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],o]:e._events[s].push(o):(e._events[s]=o,e._eventsCount++),e}function clearEvent(e,t){--e._eventsCount===0?e._events=new Events:delete e._events[t]}function EventEmitter(){this._events=new Events,this._eventsCount=0}EventEmitter.prototype.eventNames=function eventNames(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},EventEmitter.prototype.listeners=function listeners(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},EventEmitter.prototype.listenerCount=function listenerCount(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},EventEmitter.prototype.emit=function emit(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},EventEmitter.prototype.on=function on(e,t,n){return addListener(this,e,t,n,!1)},EventEmitter.prototype.once=function once(e,t,n){return addListener(this,e,t,n,!0)},EventEmitter.prototype.removeListener=function removeListener(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return clearEvent(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&clearEvent(this,a);else{for(var s=0,c=[],l=o.length;s<l;s++)(o[s].fn!==t||i&&!o[s].once||n&&o[s].context!==n)&&c.push(o[s]);c.length?this._events[a]=c.length===1?c[0]:c:clearEvent(this,a)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(e){var t;return e?(t=r?r+e:e,this._events[t]&&clearEvent(this,t)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=r,EventEmitter.EventEmitter=EventEmitter,t!==void 0&&(t.exports=EventEmitter)}))(),1);export{n as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"../rolldown-runtime.mjs";var t=e(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function isArray(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function isPlainObject(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function setProperty(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function getProperty(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function extend(){var e,t,n,r,i,a,u=arguments[0],d=1,f=arguments.length,p=!1;for(typeof u==`boolean`&&(p=u,u=arguments[1]||{},d=2),(u==null||typeof u!=`object`&&typeof u!=`function`)&&(u={});d<f;++d)if(e=arguments[d],e!=null)for(t in e)n=l(u,t),r=l(e,t),u!==r&&(p&&r&&(s(r)||(i=o(r)))?(i?(i=!1,a=n&&o(n)?n:[]):a=n&&s(n)?n:{},c(u,{name:t,newValue:extend(p,a,r)})):r!==void 0&&c(u,{name:t,newValue:r}));return u}}));export{t};
@@ -0,0 +1 @@
1
+ import{o as e,t}from"../rolldown-runtime.mjs";var n=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.normalizePath=t.convertSlashes=t.cleanPath=void 0;let n=e(`node:path`);function cleanPath(e){let t=(0,n.normalize)(e);return t.length>1&&t[t.length-1]===n.sep&&(t=t.substring(0,t.length-1)),t}t.cleanPath=cleanPath;let r=/[\\/]/g;function convertSlashes(e,t){return e.replace(r,t)}t.convertSlashes=convertSlashes;function normalizePath(e,t){let{resolvePaths:r,normalizePath:i,pathSeparator:a}=t,o=process.platform===`win32`&&e.includes(`/`)||e.startsWith(`.`);return r&&(e=(0,n.resolve)(e)),(i||o)&&(e=cleanPath(e)),e===`.`?``:convertSlashes(e[e.length-1]===a?e:e+a,a)}t.normalizePath=normalizePath})),r=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.build=t.joinDirectoryPath=t.joinPathWithBasePath=void 0;let r=e(`node:path`),i=n();function joinPathWithBasePath(e,t){return t+e}t.joinPathWithBasePath=joinPathWithBasePath;function joinPathWithRelativePath(e,t){return function(n,a){return a.startsWith(e)?a.replace(e,``)+n:(0,i.convertSlashes)((0,r.relative)(e,a),t.pathSeparator)+t.pathSeparator+n}}function joinPath(e){return e}function joinDirectoryPath(e,t,n){return t+e+n}t.joinDirectoryPath=joinDirectoryPath;function build(e,t){let{relativePaths:n,includeBasePath:r}=t;return n&&e?joinPathWithRelativePath(e,t):r?joinPathWithBasePath:joinPath}t.build=build})),i=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.build=void 0;function pushDirectoryWithRelativePath(e){return function(t,n){n.push(t.substring(e.length)||`.`)}}function pushDirectoryFilterWithRelativePath(e){return function(t,n,r){let i=t.substring(e.length)||`.`;r.every(e=>e(i,!0))&&n.push(i)}}let pushDirectory=(e,t)=>{t.push(e||`.`)},pushDirectoryFilter=(e,t,n)=>{let r=e||`.`;n.every(e=>e(r,!0))&&t.push(r)},empty=()=>{};function build(e,t){let{includeDirs:n,filters:r,relativePaths:i}=t;return n?i?r&&r.length?pushDirectoryFilterWithRelativePath(e):pushDirectoryWithRelativePath(e):r&&r.length?pushDirectoryFilter:pushDirectory:empty}e.build=build})),a=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.build=void 0;let pushFileFilterAndCount=(e,t,n,r)=>{r.every(t=>t(e,!1))&&n.files++},pushFileFilter=(e,t,n,r)=>{r.every(t=>t(e,!1))&&t.push(e)},pushFileCount=(e,t,n,r)=>{n.files++},pushFile=(e,t)=>{t.push(e)},empty=()=>{};function build(e){let{excludeFiles:t,filters:n,onlyCounts:r}=e;return t?empty:n&&n.length?r?pushFileFilterAndCount:pushFileFilter:r?pushFileCount:pushFile}e.build=build})),o=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.build=void 0;let getArray=e=>e,getArrayGroup=()=>[``].slice(0,0);function build(e){return e.group?getArrayGroup:getArray}e.build=build})),s=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.build=void 0;let groupFiles=(e,t,n)=>{e.push({directory:t,files:n,dir:t})},empty=()=>{};function build(e){return e.group?groupFiles:empty}e.build=build})),c=t((t=>{var n=t&&t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,`__esModule`,{value:!0}),t.build=void 0;let r=n(e(`node:fs`)),resolveSymlinksAsync=function(e,t,n){let{queue:i,options:{suppressErrors:a}}=t;i.enqueue(),r.default.stat(e,(r,o)=>{if(r){i.dequeue(a?null:r,t);return}n(o,e),i.dequeue(null,t)})},resolveSymlinksWithRealPathsAsync=function(e,t,n){let{queue:i,options:{suppressErrors:a}}=t;i.enqueue(),r.default.realpath(e,(e,o)=>{if(e){i.dequeue(a?null:e,t);return}r.default.lstat(o,(e,r)=>{n(r,o),i.dequeue(null,t)})})},resolveSymlinksSync=function(e,t,n){try{n(r.default.statSync(e),e)}catch(e){if(!t.options.suppressErrors)throw e}},resolveSymlinksWithRealPathsSync=function(e,t,n){try{let t=r.default.realpathSync(e);n(r.default.lstatSync(t),t)}catch(e){if(!t.options.suppressErrors)throw e}};function build(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:e.useRealPaths?t?resolveSymlinksWithRealPathsSync:resolveSymlinksWithRealPathsAsync:t?resolveSymlinksSync:resolveSymlinksAsync}t.build=build})),l=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.build=void 0;let onlyCountsSync=e=>e.counts,groupsSync=e=>e.groups,defaultSync=e=>e.paths,limitFilesSync=e=>e.paths.slice(0,e.options.maxFiles),onlyCountsAsync=(e,t,n)=>(report(t,n,e.counts,e.options.suppressErrors),null),defaultAsync=(e,t,n)=>(report(t,n,e.paths,e.options.suppressErrors),null),limitFilesAsync=(e,t,n)=>(report(t,n,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),groupsAsync=(e,t,n)=>(report(t,n,e.groups,e.options.suppressErrors),null);function report(e,t,n,r){t(e&&!r?e:null,n)}function build(e,t){let{onlyCounts:n,group:r,maxFiles:i}=e;return n?t?onlyCountsSync:onlyCountsAsync:r?t?groupsSync:groupsAsync:i?t?limitFilesSync:limitFilesAsync:t?defaultSync:defaultAsync}e.build=build})),u=t((t=>{var n=t&&t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,`__esModule`,{value:!0}),t.build=void 0;let r=n(e(`node:fs`)),i={withFileTypes:!0},walkAsync=(e,t,n,a)=>{if(e.queue.enqueue(),n<0){e.queue.dequeue(null,e);return}e.counts.directories++,r.default.readdir(t||`.`,i,function process(r,i=[]){a(i,t,n),e.queue.dequeue(e.options.suppressErrors?null:r,e)})},walkSync=(e,t,n,a)=>{if(n<0)return;e.counts.directories++;let o=[];try{o=r.default.readdirSync(t||`.`,i)}catch(t){if(!e.options.suppressErrors)throw t}a(o,t,n)};function build(e){return e?walkSync:walkAsync}t.build=build})),d=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Queue=void 0;var Queue=class{onQueueEmpty;count=0;constructor(e){this.onQueueEmpty=e}enqueue(){this.count++}dequeue(e,t){(--this.count===0||e)&&this.onQueueEmpty(e,t)}};e.Queue=Queue})),f=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Counter=void 0;var Counter=class{_files=0;_directories=0;set files(e){this._files=e}get files(){return this._files}set directories(e){this._directories=e}get directories(){return this._directories}get dirs(){return this._directories}};e.Counter=Counter})),p=t((t=>{var p=t&&t.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),m=t&&t.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),h=t&&t.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!==`default`&&Object.prototype.hasOwnProperty.call(e,n)&&p(t,e,n);return m(t,e),t};Object.defineProperty(t,`__esModule`,{value:!0}),t.Walker=void 0;let g=e(`node:path`),_=n(),v=h(r()),y=h(i()),b=h(a()),x=h(o()),S=h(s()),C=h(c()),w=h(l()),T=h(u()),E=d(),D=f();var Walker=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,t,n){this.isSynchronous=!n,this.callbackInvoker=w.build(t,this.isSynchronous),this.state={paths:[``].slice(0,0),groups:[],counts:new D.Counter,options:t,queue:new E.Queue((e,t)=>this.callbackInvoker(t,e,n))},this.root=(0,_.normalizePath)(e,this.state.options),this.joinPath=v.build(this.root,t),this.pushDirectory=y.build(this.root,t),this.pushFile=b.build(t),this.getArray=x.build(t),this.groupFiles=S.build(t),this.resolveSymlink=C.build(t,this.isSynchronous),this.walkDirectory=T.build(this.isSynchronous)}start(){return this.walkDirectory(this.state,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(e,t,n)=>{let{paths:r,options:{filters:i,resolveSymlinks:a,excludeSymlinks:o,exclude:s,maxFiles:c,signal:l}}=this.state;if(l&&l.aborted||c&&r.length>c)return;this.pushDirectory(t,r,i);let u=this.getArray(this.state.paths);for(let r=0;r<e.length;++r){let c=e[r];if(c.isFile()||c.isSymbolicLink()&&!a&&!o){let e=this.joinPath(c.name,t);this.pushFile(e,u,this.state.counts,i)}else if(c.isDirectory()){let e=v.joinDirectoryPath(c.name,t,this.state.options.pathSeparator);if(s&&s(c.name,e))continue;this.walkDirectory(this.state,e,n-1,this.walk)}else if(c.isSymbolicLink()&&this.resolveSymlink){let e=v.joinPathWithBasePath(c.name,t);this.resolveSymlink(e,this.state,(e,t)=>{if(e.isDirectory()){if(t=(0,_.normalizePath)(t,this.state.options),s&&s(c.name,t))return;this.walkDirectory(this.state,t,n-1,this.walk)}else{let e=(0,g.basename)(t),n=(0,_.normalizePath)((0,g.dirname)(t),this.state.options);t=this.joinPath(e,n),this.pushFile(t,u,this.state.counts,i)}})}}this.groupFiles(this.state.groups,t,u)}};t.Walker=Walker})),m=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.callback=e.promise=void 0;let t=p();function promise(e,t){return new Promise((n,r)=>{callback(e,t,(e,t)=>{if(e)return r(e);n(t)})})}e.promise=promise;function callback(e,n,r){new t.Walker(e,n,r).start()}e.callback=callback})),h=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.sync=void 0;let t=p();function sync(e,n){return new t.Walker(e,n).start()}e.sync=sync})),g=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.APIBuilder=void 0;let t=m(),n=h();var APIBuilder=class{root;options;constructor(e,t){this.root=e,this.options=t}withPromise(){return(0,t.promise)(this.root,this.options)}withCallback(e){(0,t.callback)(this.root,this.options,e)}sync(){return(0,n.sync)(this.root,this.options)}};e.APIBuilder=APIBuilder})),_=t(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),v=t((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=_();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),y=t(((e,t)=>{let n=v(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:y}=_(),isPathSeparator=e=>e===l||e===a,depth=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},scan=(e,t)=>{let _=t||{},v=e.length-1,b=_.parts===!0||_.scanToEnd===!0,x=[],S=[],C=[],w=e,T=-1,E=0,D=0,O=!1,k=!1,A=!1,j=!1,M=!1,N=!1,P=!1,F=!1,I=!1,L=!1,R=0,z,B,V={value:``,depth:0,isGlob:!1},eos=()=>T>=v,peek=()=>w.charCodeAt(T+1),advance=()=>(z=B,w.charCodeAt(++T));for(;T<v;){B=advance();let e;if(B===a){P=V.backslashes=!0,B=advance(),B===u&&(N=!0);continue}if(N===!0||B===u){for(R++;eos()!==!0&&(B=advance());){if(B===a){P=V.backslashes=!0,advance();continue}if(B===u){R++;continue}if(N!==!0&&B===s&&(B=advance())===s){if(O=V.isBrace=!0,A=V.isGlob=!0,L=!0,b===!0)continue;break}if(N!==!0&&B===o){if(O=V.isBrace=!0,A=V.isGlob=!0,L=!0,b===!0)continue;break}if(B===h&&(R--,R===0)){N=!1,O=V.isBrace=!0,L=!0;break}}if(b===!0)continue;break}if(B===l){if(x.push(T),S.push(V),V={value:``,depth:0,isGlob:!1},L===!0)continue;if(z===s&&T===E+1){E+=2;continue}D=T+1;continue}if(_.noext!==!0&&(B===p||B===i||B===r||B===m||B===c)&&peek()===d){if(A=V.isGlob=!0,j=V.isExtglob=!0,L=!0,B===c&&T===E&&(I=!0),b===!0){for(;eos()!==!0&&(B=advance());){if(B===a){P=V.backslashes=!0,B=advance();continue}if(B===g){A=V.isGlob=!0,L=!0;break}}continue}break}if(B===r){if(z===r&&(M=V.isGlobstar=!0),A=V.isGlob=!0,L=!0,b===!0)continue;break}if(B===m){if(A=V.isGlob=!0,L=!0,b===!0)continue;break}if(B===f){for(;eos()!==!0&&(e=advance());){if(e===a){P=V.backslashes=!0,advance();continue}if(e===y){k=V.isBracket=!0,A=V.isGlob=!0,L=!0;break}}if(b===!0)continue;break}if(_.nonegate!==!0&&B===c&&T===E){F=V.negated=!0,E++;continue}if(_.noparen!==!0&&B===d){if(A=V.isGlob=!0,b===!0){for(;eos()!==!0&&(B=advance());){if(B===d){P=V.backslashes=!0,B=advance();continue}if(B===g){L=!0;break}}continue}break}if(A===!0){if(L=!0,b===!0)continue;break}}_.noext===!0&&(j=!1,A=!1);let H=w,U=``,W=``;E>0&&(U=w.slice(0,E),w=w.slice(E),D-=E),H&&A===!0&&D>0?(H=w.slice(0,D),W=w.slice(D)):A===!0?(H=``,W=w):H=w,H&&H!==``&&H!==`/`&&H!==w&&isPathSeparator(H.charCodeAt(H.length-1))&&(H=H.slice(0,-1)),_.unescape===!0&&(W&&=n.removeBackslashes(W),H&&P===!0&&(H=n.removeBackslashes(H)));let G={prefix:U,input:e,start:E,base:H,glob:W,isBrace:O,isBracket:k,isGlob:A,isExtglob:j,isGlobstar:M,negated:F,negatedExtglob:I};if(_.tokens===!0&&(G.maxDepth=0,isPathSeparator(B)||S.push(V),G.tokens=S),_.parts===!0||_.tokens===!0){let t;for(let n=0;n<x.length;n++){let r=t?t+1:E,i=x[n],a=e.slice(r,i);_.tokens&&(n===0&&E!==0?(S[n].isPrefix=!0,S[n].value=U):S[n].value=a,depth(S[n]),G.maxDepth+=S[n].depth),(n!==0||a!==``)&&C.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);C.push(n),_.tokens&&(S[S.length-1].value=n,depth(S[S.length-1]),G.maxDepth+=S[S.length-1].depth)}G.slashes=x,G.parts=C}return G};t.exports=scan})),b=t(((e,t)=>{let n=_(),r=v(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,expandRange=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},syntaxError=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,splitTopLevel=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},isPlainBranch=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},normalizeSimpleBranch=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(isPlainBranch(t))return t.replace(/\\(.)/g,`$1`)},hasRepeatedCharPrefixOverlap=e=>{let t=e.map(normalizeSimpleBranch).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},parseRepeatedExtglob=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},getStarExtglobSequenceOutput=e=>{let t=0,n=[];for(;t<e.length;){let r=parseRepeatedExtglob(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=splitTopLevel(r.body).map(e=>e.trim());if(i.length!==1)return;let a=normalizeSimpleBranch(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return`${n.length===1?r.escapeRegex(n[0]):`[${n.map(e=>r.escapeRegex(e)).join(``)}]`}*`},repeatedExtglobRecursion=e=>{let t=0,n=e.trim(),r=parseRepeatedExtglob(n);for(;r;)t++,n=r.body.trim(),r=parseRepeatedExtglob(n);return t},analyzeRepeatedExtglob=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=splitTopLevel(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||hasRepeatedCharPrefixOverlap(i)))return{risky:!0};for(let e of i){let t=getStarExtglobSequenceOutput(e);if(t)return{risky:!0,safeOutput:t};if(repeatedExtglobRecursion(e)>r)return{risky:!0}}return{risky:!1}},parse=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let l={...t},u=typeof l.maxLength==`number`?Math.min(i,l.maxLength):i,d=e.length;if(d>u)throw SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${u}`);let f={type:`bos`,value:``,output:l.prepend||``},p=[f],m=l.capture?``:`?:`,h=n.globChars(l.windows),g=n.extglobChars(h),{DOT_LITERAL:_,PLUS_LITERAL:v,SLASH_LITERAL:y,ONE_CHAR:b,DOTS_SLASH:x,NO_DOT:S,NO_DOT_SLASH:C,NO_DOTS_SLASH:w,QMARK:T,QMARK_NO_DOT:E,STAR:D,START_ANCHOR:O}=h,globstar=e=>`(${m}(?:(?!${O}${e.dot?x:_}).)*?)`,k=l.dot?``:S,A=l.dot?T:E,j=l.bash===!0?globstar(l):D;l.capture&&(j=`(${j})`),typeof l.noext==`boolean`&&(l.noextglob=l.noext);let M={input:e,index:-1,start:0,dot:l.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:p};e=r.removePrefix(e,M),d=e.length;let N=[],P=[],F=[],I=f,L,eos=()=>M.index===d-1,R=M.peek=(t=1)=>e[M.index+t],z=M.advance=()=>e[++M.index]||``,remaining=()=>e.slice(M.index+1),consume=(e=``,t=0)=>{M.consumed+=e,M.index+=t},append=e=>{M.output+=e.output==null?e.value:e.output,consume(e.value)},negate=()=>{let e=1;for(;R()===`!`&&(R(2)!==`(`||R(3)===`?`);)z(),M.start++,e++;return e%2==0?!1:(M.negated=!0,M.start++,!0)},increment=e=>{M[e]++,F.push(e)},decrement=e=>{M[e]--,F.pop()},push=e=>{if(I.type===`globstar`){let t=M.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||N.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(M.output=M.output.slice(0,-I.output.length),I.type=`star`,I.value=`*`,I.output=j,M.output+=I.output)}if(N.length&&e.type!==`paren`&&(N[N.length-1].inner+=e.value),(e.value||e.output)&&append(e),I&&I.type===`text`&&e.type===`text`){I.output=(I.output||I.value)+e.value,I.value+=e.value;return}e.prev=I,p.push(e),I=e},extglobOpen=(e,t)=>{let n={...g[t],conditions:1,inner:``};n.prev=I,n.parens=M.parens,n.output=M.output,n.startIndex=M.index,n.tokensIndex=p.length;let r=(l.capture?`(`:``)+n.open;increment(`parens`),push({type:e,value:t,output:M.output?``:b}),push({type:`paren`,extglob:!0,value:z(),output:r}),N.push(n)},extglobClose=n=>{let i=e.slice(n.startIndex,M.index+1),a=analyzeRepeatedExtglob(e.slice(n.startIndex+2,M.index),l);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:b)+(l.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=p[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<p.length;e++)p[e].value=``,p[e].output=``,delete p[e].suffix;M.output=n.output+t.output,M.backtrack=!0,push({type:`paren`,extglob:!0,value:L,output:``}),decrement(`parens`);return}let o=n.close+(l.capture?`)`:``),s;if(n.type===`negate`){let e=j;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=globstar(l)),(e!==j||eos()||/^\)+$/.test(remaining()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=remaining())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${parse(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(M.negatedExtglob=!0)}push({type:`paren`,extglob:!0,value:L,output:o}),decrement(`parens`)};if(l.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?T.repeat(a.length):``):o===0?A+(a?T.repeat(a.length):``):T.repeat(r.length):i===`.`?_.repeat(r.length):i===`*`?t?t+i+(a?j:``):j:t?e:`\\${e}`);return n===!0&&(i=l.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&l.contains===!0?(M.output=e,M):(M.output=r.wrapOutput(i,M,t),M)}for(;!eos();){if(L=z(),L===`\0`)continue;if(L===`\\`){let e=R();if(e===`/`&&l.bash!==!0||e===`.`||e===`;`)continue;if(!e){L+=`\\`,push({type:`text`,value:L});continue}let t=/^\\+/.exec(remaining()),n=0;if(t&&t[0].length>2&&(n=t[0].length,M.index+=n,n%2!=0&&(L+=`\\`)),l.unescape===!0?L=z():L+=z(),M.brackets===0){push({type:`text`,value:L});continue}}if(M.brackets>0&&(L!==`]`||I.value===`[`||I.value===`[^`)){if(l.posix!==!1&&L===`:`){let e=I.value.slice(1);if(e.includes(`[`)&&(I.posix=!0,e.includes(`:`))){let e=I.value.lastIndexOf(`[`),t=I.value.slice(0,e),n=a[I.value.slice(e+2)];if(n){I.value=t+n,M.backtrack=!0,z(),!f.output&&p.indexOf(I)===1&&(f.output=b);continue}}}(L===`[`&&R()!==`:`||L===`-`&&R()===`]`)&&(L=`\\${L}`),L===`]`&&(I.value===`[`||I.value===`[^`)&&(L=`\\${L}`),l.posix===!0&&L===`!`&&I.value===`[`&&(L=`^`),I.value+=L,append({value:L});continue}if(M.quotes===1&&L!==`"`){L=r.escapeRegex(L),I.value+=L,append({value:L});continue}if(L===`"`){M.quotes=M.quotes===1?0:1,l.keepQuotes===!0&&push({type:`text`,value:L});continue}if(L===`(`){increment(`parens`),push({type:`paren`,value:L});continue}if(L===`)`){if(M.parens===0&&l.strictBrackets===!0)throw SyntaxError(syntaxError(`opening`,`(`));let e=N[N.length-1];if(e&&M.parens===e.parens+1){extglobClose(N.pop());continue}push({type:`paren`,value:L,output:M.parens?`)`:`\\)`}),decrement(`parens`);continue}if(L===`[`){if(l.nobracket===!0||!remaining().includes(`]`)){if(l.nobracket!==!0&&l.strictBrackets===!0)throw SyntaxError(syntaxError(`closing`,`]`));L=`\\${L}`}else increment(`brackets`);push({type:`bracket`,value:L});continue}if(L===`]`){if(l.nobracket===!0||I&&I.type===`bracket`&&I.value.length===1){push({type:`text`,value:L,output:`\\${L}`});continue}if(M.brackets===0){if(l.strictBrackets===!0)throw SyntaxError(syntaxError(`opening`,`[`));push({type:`text`,value:L,output:`\\${L}`});continue}decrement(`brackets`);let e=I.value.slice(1);if(I.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(L=`/${L}`),I.value+=L,append({value:L}),l.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(I.value);if(M.output=M.output.slice(0,-I.value.length),l.literalBrackets===!0){M.output+=t,I.value=t;continue}I.value=`(${m}${t}|${I.value})`,M.output+=I.value;continue}if(L===`{`&&l.nobrace!==!0){increment(`braces`);let e={type:`brace`,value:L,output:`(`,outputIndex:M.output.length,tokensIndex:M.tokens.length};P.push(e),push(e);continue}if(L===`}`){let e=P[P.length-1];if(l.nobrace===!0||!e){push({type:`text`,value:L,output:L});continue}let t=`)`;if(e.dots===!0){let e=p.slice(),n=[];for(let t=e.length-1;t>=0&&(p.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=expandRange(n,l),M.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=M.output.slice(0,e.outputIndex),r=M.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,L=t=`\\}`,M.output=n;for(let e of r)M.output+=e.output||e.value}push({type:`brace`,value:L,output:t}),decrement(`braces`),P.pop();continue}if(L===`|`){N.length>0&&N[N.length-1].conditions++,push({type:`text`,value:L});continue}if(L===`,`){let e=L,t=P[P.length-1];t&&F[F.length-1]===`braces`&&(t.comma=!0,e=`|`),push({type:`comma`,value:L,output:e});continue}if(L===`/`){if(I.type===`dot`&&M.index===M.start+1){M.start=M.index+1,M.consumed=``,M.output=``,p.pop(),I=f;continue}push({type:`slash`,value:L,output:y});continue}if(L===`.`){if(M.braces>0&&I.type===`dot`){I.value===`.`&&(I.output=_);let e=P[P.length-1];I.type=`dots`,I.output+=L,I.value+=L,e.dots=!0;continue}if(M.braces+M.parens===0&&I.type!==`bos`&&I.type!==`slash`){push({type:`text`,value:L,output:_});continue}push({type:`dot`,value:L,output:_});continue}if(L===`?`){if(!(I&&I.value===`(`)&&l.noextglob!==!0&&R()===`(`&&R(2)!==`?`){extglobOpen(`qmark`,L);continue}if(I&&I.type===`paren`){let e=R(),t=L;(I.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(remaining()))&&(t=`\\${L}`),push({type:`text`,value:L,output:t});continue}if(l.dot!==!0&&(I.type===`slash`||I.type===`bos`)){push({type:`qmark`,value:L,output:E});continue}push({type:`qmark`,value:L,output:T});continue}if(L===`!`){if(l.noextglob!==!0&&R()===`(`&&(R(2)!==`?`||!/[!=<:]/.test(R(3)))){extglobOpen(`negate`,L);continue}if(l.nonegate!==!0&&M.index===0){negate();continue}}if(L===`+`){if(l.noextglob!==!0&&R()===`(`&&R(2)!==`?`){extglobOpen(`plus`,L);continue}if(I&&I.value===`(`||l.regex===!1){push({type:`plus`,value:L,output:v});continue}if(I&&(I.type===`bracket`||I.type===`paren`||I.type===`brace`)||M.parens>0){push({type:`plus`,value:L});continue}push({type:`plus`,value:v});continue}if(L===`@`){if(l.noextglob!==!0&&R()===`(`&&R(2)!==`?`){push({type:`at`,extglob:!0,value:L,output:``});continue}push({type:`text`,value:L});continue}if(L!==`*`){(L===`$`||L===`^`)&&(L=`\\${L}`);let e=o.exec(remaining());e&&(L+=e[0],M.index+=e[0].length),push({type:`text`,value:L});continue}if(I&&(I.type===`globstar`||I.star===!0)){I.type=`star`,I.star=!0,I.value+=L,I.output=j,M.backtrack=!0,M.globstar=!0,consume(L);continue}let t=remaining();if(l.noextglob!==!0&&/^\([^?]/.test(t)){extglobOpen(`star`,L);continue}if(I.type===`star`){if(l.noglobstar===!0){consume(L);continue}let n=I.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(l.bash===!0&&(!i||t[0]&&t[0]!==`/`)){push({type:`star`,value:L,output:``});continue}let o=M.braces>0&&(n.type===`comma`||n.type===`brace`),s=N.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){push({type:`star`,value:L,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[M.index+4];if(n&&n!==`/`)break;t=t.slice(3),consume(`/**`,3)}if(n.type===`bos`&&eos()){I.type=`globstar`,I.value+=L,I.output=globstar(l),M.output=I.output,M.globstar=!0,consume(L);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&eos()){M.output=M.output.slice(0,-(n.output+I.output).length),n.output=`(?:${n.output}`,I.type=`globstar`,I.output=globstar(l)+(l.strictSlashes?`)`:`|$)`),I.value+=L,M.globstar=!0,M.output+=n.output+I.output,consume(L);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;M.output=M.output.slice(0,-(n.output+I.output).length),n.output=`(?:${n.output}`,I.type=`globstar`,I.output=`${globstar(l)}${y}|${y}${e})`,I.value+=L,M.output+=n.output+I.output,M.globstar=!0,consume(L+z()),push({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){I.type=`globstar`,I.value+=L,I.output=`(?:^|${y}|${globstar(l)}${y})`,M.output=I.output,M.globstar=!0,consume(L+z()),push({type:`slash`,value:`/`,output:``});continue}M.output=M.output.slice(0,-I.output.length),I.type=`globstar`,I.output=globstar(l),I.value+=L,M.output+=I.output,M.globstar=!0,consume(L);continue}let n={type:`star`,value:L,output:j};if(l.bash===!0){n.output=`.*?`,(I.type===`bos`||I.type===`slash`)&&(n.output=k+n.output),push(n);continue}if(I&&(I.type===`bracket`||I.type===`paren`)&&l.regex===!0){n.output=L,push(n);continue}(M.index===M.start||I.type===`slash`||I.type===`dot`)&&(I.type===`dot`?(M.output+=C,I.output+=C):l.dot===!0?(M.output+=w,I.output+=w):(M.output+=k,I.output+=k),R()!==`*`&&(M.output+=b,I.output+=b)),push(n)}for(;M.brackets>0;){if(l.strictBrackets===!0)throw SyntaxError(syntaxError(`closing`,`]`));M.output=r.escapeLast(M.output,`[`),decrement(`brackets`)}for(;M.parens>0;){if(l.strictBrackets===!0)throw SyntaxError(syntaxError(`closing`,`)`));M.output=r.escapeLast(M.output,`(`),decrement(`parens`)}for(;M.braces>0;){if(l.strictBrackets===!0)throw SyntaxError(syntaxError(`closing`,`}`));M.output=r.escapeLast(M.output,`{`),decrement(`braces`)}if(l.strictSlashes!==!0&&(I.type===`star`||I.type===`bracket`)&&push({type:`maybe_slash`,value:``,output:`${y}?`}),M.backtrack===!0){M.output=``;for(let e of M.tokens)M.output+=e.output==null?e.value:e.output,e.suffix&&(M.output+=e.suffix)}return M};parse.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let globstar=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,create=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+globstar(a);case`**/*`:return`(?:${v}${globstar(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${globstar(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${globstar(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=create(t[1]);return n?n+l+t[2]:void 0}}},C=create(r.removePrefix(e,x));return C&&a.strictSlashes!==!0&&(C+=`${u}?`),C},t.exports=parse})),x=t(((e,t)=>{let n=y(),r=b(),i=v(),a=_(),isObject=e=>e&&typeof e==`object`&&!Array.isArray(e),picomatch=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>picomatch(e,t,n)),arrayMatcher=e=>{for(let t of r){let n=t(e);if(n)return n}return!1};return arrayMatcher}let r=isObject(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,o=r?picomatch.compileRe(e,t):picomatch.makeRe(e,t,!1,!0),s=o.state;delete o.state;let isIgnored=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};isIgnored=picomatch(i.ignore,e,n)}let matcher=(n,r=!1)=>{let{isMatch:c,match:l,output:u}=picomatch.test(n,o,t,{glob:e,posix:a}),d={glob:e,state:s,regex:o,posix:a,input:n,output:u,match:l,isMatch:c};return typeof i.onResult==`function`&&i.onResult(d),c===!1?(d.isMatch=!1,r?d:!1):isIgnored(n)?(typeof i.onIgnore==`function`&&i.onIgnore(d),d.isMatch=!1,r?d:!1):(typeof i.onMatch==`function`&&i.onMatch(d),r?d:!0)};return n&&(matcher.state=s),matcher};picomatch.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},s=o.format||(a?i.toPosixSlashes:null),c=e===r,l=c&&s?s(e):e;return c===!1&&(l=s?s(e):e,c=l===r),(c===!1||o.capture===!0)&&(c=o.matchBase===!0||o.basename===!0?picomatch.matchBase(e,t,n,a):t.exec(l)),{isMatch:!!c,match:c,output:l}},picomatch.matchBase=(e,t,n)=>(t instanceof RegExp?t:picomatch.makeRe(t,n)).test(i.basename(e)),picomatch.isMatch=(e,t,n)=>picomatch(t,n)(e),picomatch.parse=(e,t)=>Array.isArray(e)?e.map(e=>picomatch.parse(e,t)):r(e,{...t,fastpaths:!1}),picomatch.scan=(e,t)=>n(e,t),picomatch.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,s=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(s=`^(?!${s}).*$`);let c=picomatch.toRegex(s,t);return r===!0&&(c.state=e),c},picomatch.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),picomatch.compileRe(a,t,n,i)},picomatch.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},picomatch.constants=a,t.exports=picomatch})),S=t(((e,t)=>{let n=x(),r=v();function picomatch(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(picomatch,n),t.exports=picomatch})),C=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Builder=void 0;let n=e(`node:path`),r=g();var i=null;try{e.resolve(`picomatch`),i=S()}catch{}var Builder=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:n.sep,filters:[]};globFunction;constructor(e){this.options={...this.options,...e},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(e){return this.options.pathSeparator=e,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(e){return this.options.maxDepth=e,this}withMaxFiles(e){return this.options.maxFiles=e,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:e=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=e,this.withFullPaths()}withAbortSignal(e){return this.options.signal=e,this}normalize(){return this.options.normalizePath=!0,this}filter(e){return this.options.filters.push(e),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(e){return this.options.exclude=e,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(e){return new r.APIBuilder(e||`.`,this.options)}withGlobFunction(e){return this.globFunction=e,this}crawlWithOptions(e,t){return this.options={...this.options,...t},new r.APIBuilder(e||`.`,this.options)}glob(...e){return this.globFunction?this.globWithOptions(e):this.globWithOptions(e,{dot:!0})}globWithOptions(e,...t){let n=this.globFunction||i;if(!n)throw Error(`Please specify a glob function to use glob matching.`);var r=this.globCache[e.join(`\0`)];return r||(r=n(e,...t),this.globCache[e.join(`\0`)]=r),this.options.filters.push(e=>r(e)),this}};t.Builder=Builder})),w=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),T=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.fdir=void 0;let r=C();Object.defineProperty(e,`fdir`,{enumerable:!0,get:function(){return r.Builder}}),n(w(),e)}));export{S as n,T as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"../rolldown-runtime.mjs";var t=e((e=>{e.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<`u`,e.SYMBOL_SUPPORT=typeof Symbol<`u`})),n=e(((e,n)=>{var r=t(),i=r.ARRAY_BUFFER_SUPPORT,a=r.SYMBOL_SUPPORT;n.exports=function forEach(e,t){var n,r,o,s,c;if(!e)throw Error(`obliterator/forEach: invalid iterable.`);if(typeof t!=`function`)throw Error(`obliterator/forEach: expecting a callback.`);if(Array.isArray(e)||i&&ArrayBuffer.isView(e)||typeof e==`string`||e.toString()===`[object Arguments]`){for(o=0,s=e.length;o<s;o++)t(e[o],o);return}if(typeof e.forEach==`function`){e.forEach(t);return}if(a&&Symbol.iterator in e&&typeof e.next!=`function`&&(e=e[Symbol.iterator]()),typeof e.next==`function`){for(n=e,o=0;c=n.next(),c.done!==!0;)t(c.value,o),o++;return}for(r in e)e.hasOwnProperty(r)&&t(e[r],r)}})),r=e(((e,t)=>{function Iterator(e){if(typeof e!=`function`)throw Error(`obliterator/iterator: expecting a function!`);this.next=e}typeof Symbol<`u`&&(Iterator.prototype[Symbol.iterator]=function(){return this}),Iterator.of=function(){var e=arguments,t=e.length,n=0;return new Iterator(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},Iterator.empty=function(){return new Iterator(function(){return{done:!0}})},Iterator.fromSequence=function(e){var t=0,n=e.length;return new Iterator(function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}})},Iterator.is=function(e){return e instanceof Iterator?!0:typeof e==`object`&&!!e&&typeof e.next==`function`},t.exports=Iterator})),i=e((e=>{var t=2**8-1,n=2**16-1,r=2**32-1,i=2**7-1,a=2**15-1,o=2**31-1;e.getPointerArray=function(e){var i=e-1;if(i<=t)return Uint8Array;if(i<=n)return Uint16Array;if(i<=r)return Uint32Array;throw Error(`mnemonist: Pointer Array of size > 4294967295 is not supported.`)},e.getSignedPointerArray=function(e){var t=e-1;return t<=i?Int8Array:t<=a?Int16Array:t<=o?Int32Array:Float64Array},e.getNumberType=function(e){return e===(e|0)?Math.sign(e)===-1?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var s={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(t,n){var r=null,i=0,a,o,c,l,u;for(l=0,u=t.length;l<u;l++)c=n?n(t[l]):t[l],o=e.getNumberType(c),a=s[o.name],a>i&&(i=a,r=o);return r},e.isTypedArray=function(e){return typeof ArrayBuffer<`u`&&ArrayBuffer.isView(e)},e.concat=function(){var e=0,t,n,r;for(t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=new arguments[0].constructor(e);for(t=0,n=0;t<r;t++)i.set(arguments[t],n),n+=arguments[t].length;return i},e.indices=function(t){for(var n=new(e.getPointerArray(t))(t),r=0;r<t;r++)n[r]=r;return n}})),a=e((e=>{var t=n(),r=i();function isArrayLike(e){return Array.isArray(e)||r.isTypedArray(e)}function guessLength(e){if(typeof e.length==`number`)return e.length;if(typeof e.size==`number`)return e.size}function toArray(e){var n=guessLength(e),r=typeof n==`number`?Array(n):[],i=0;return t(e,function(e){r[i++]=e}),r}function toArrayWithIndices(e){var n=guessLength(e),i=typeof n==`number`?r.getPointerArray(n):Array,a=typeof n==`number`?Array(n):[],o=typeof n==`number`?new i(n):[],s=0;return t(e,function(e){a[s]=e,o[s]=s++}),[a,o]}e.isArrayLike=isArrayLike,e.guessLength=guessLength,e.toArray=toArray,e.toArrayWithIndices=toArrayWithIndices})),o=e(((e,t)=>{t.exports=function isGraph(e){return typeof e==`object`&&!!e&&typeof e.addUndirectedEdgeWithKey==`function`&&typeof e.dropNode==`function`&&typeof e.multi==`boolean`}})),s=e(((e,t)=>{var n=a(),i=r();function FixedDeque(e,t){if(arguments.length<2)throw Error(`mnemonist/fixed-deque: expecting an Array class and a capacity.`);if(typeof t!=`number`||t<=0)throw Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=e,this.capacity=t,this.items=new e(this.capacity),this.clear()}FixedDeque.prototype.clear=function(){this.start=0,this.size=0},FixedDeque.prototype.push=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.push: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start+this.size;return t>=this.capacity&&(t-=this.capacity),this.items[t]=e,++this.size},FixedDeque.prototype.unshift=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.unshift: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start-1;return this.start===0&&(t=this.capacity-1),this.items[t]=e,this.start=t,++this.size},FixedDeque.prototype.pop=function(){if(this.size!==0){this.size--;var e=this.start+this.size;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},FixedDeque.prototype.shift=function(){if(this.size!==0){var e=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[e]}},FixedDeque.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]},FixedDeque.prototype.peekLast=function(){if(this.size!==0){var e=this.start+this.size-1;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},FixedDeque.prototype.get=function(e){if(!(this.size===0||e>=this.capacity))return e=this.start+e,e>=this.capacity&&(e-=this.capacity),this.items[e]},FixedDeque.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.capacity,r=this.size,i=this.start,a=0;a<r;)e.call(t,this.items[i],a,this),i++,a++,i===n&&(i=0)},FixedDeque.prototype.toArray=function(){var e=this.start+this.size;if(e<this.capacity)return this.items.slice(this.start,e);for(var t=new this.ArrayClass(this.size),n=this.capacity,r=this.size,i=this.start,a=0;a<r;)t[a]=this.items[i],i++,a++,i===n&&(i=0);return t},FixedDeque.prototype.values=function(){var e=this.items,t=this.capacity,n=this.size,r=this.start,a=0;return new i(function(){if(a>=n)return{done:!0};var i=e[r];return r++,a++,r===t&&(r=0),{value:i,done:!1}})},FixedDeque.prototype.entries=function(){var e=this.items,t=this.capacity,n=this.size,r=this.start,a=0;return new i(function(){if(a>=n)return{done:!0};var i=e[r];return r++,r===t&&(r=0),{value:[a++,i],done:!1}})},typeof Symbol<`u`&&(FixedDeque.prototype[Symbol.iterator]=FixedDeque.prototype.values),FixedDeque.prototype.inspect=function(){var e=this.toArray();return e.type=this.ArrayClass.name,e.capacity=this.capacity,Object.defineProperty(e,`constructor`,{value:FixedDeque,enumerable:!1}),e},typeof Symbol<`u`&&(FixedDeque.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=FixedDeque.prototype.inspect),FixedDeque.from=function(e,t,r){if(arguments.length<3&&(r=n.guessLength(e),typeof r!=`number`))throw Error(`mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.`);var i=new FixedDeque(t,r);if(n.isArrayLike(e)){var a,o;for(a=0,o=e.length;a<o;a++)i.items[a]=e[a];return i.size=o,i}return n.forEach(e,function(e){i.push(e)}),i},t.exports=FixedDeque})),c=e((e=>{let t=o(),n=s();function simpleInDegree(e,t){let n=0;return e.forEachInNeighbor(t,()=>{n++}),n}function forEachNodeInTopologicalOrder(e,r){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);if(e.type===`undirected`||e.undirectedSize!==0)throw Error(`graphology-dag/topological-sort: cannot work if graph is not directed.`);if(e.order===0)return;let i=new n(Array,e.order),a={},o=0;e.forEachNode((t,n)=>{let r=e.multi?simpleInDegree(e,t):e.inDegree(t);r===0?i.push([t,n,0]):(a[t]=r,o+=r)});let s=0;function neighborCallback(e,t){let n=--a[e];o--,n===0&&i.push([e,t,s+1]),a[e]=n}for(;i.size!==0;){let[t,n,a]=i.shift();s=a,r(t,n,a),e.forEachOutNeighbor(t,neighborCallback)}if(o!==0)throw Error(`graphology-dag/topological-sort: given graph is not acyclic.`)}function topologicalSort(e){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);let n=Array(e.order),r=0;return forEachNodeInTopologicalOrder(e,e=>{n[r++]=e}),n}e.topologicalSort=topologicalSort})),l=e(((e,t)=>{let n=o();t.exports=function willCreateCycle(e,t,r){if(!n(e))throw Error(`graphology-dag/will-create-cycle: the given graph is not a valid graphology instance.`);if(t=``+t,r=``+r,t===r)return!0;if(!e.hasNode(t)||!e.hasNode(r)||e.hasDirectedEdge(t,r))return!1;if(e.hasDirectedEdge(r,t))return!0;let i=e.outNeighbors(r);function push(e){i.push(e)}for(;i.length!==0;){let n=i.pop();if(n===t)return!0;e.forEachOutNeighbor(n,push)}return!1}}));export{r as a,i,c as n,n as o,a as r,l as t};
@@ -0,0 +1 @@
1
+ import"../rolldown-runtime.mjs";import{EventEmitter as e}from"node:events";function assignPolyfill(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++)if(arguments[t])for(let n in arguments[t])e[n]=arguments[t][n];return e}let t=assignPolyfill;typeof Object.assign==`function`&&(t=Object.assign);function getMatchingEdge(e,t,n,r){let i=e._nodes.get(t),a=null;return i&&(a=r===`mixed`?i.out&&i.out[n]||i.undirected&&i.undirected[n]:r===`directed`?i.out&&i.out[n]:i.undirected&&i.undirected[n]),a}function isPlainObject(e){return typeof e==`object`&&!!e}function isEmpty(e){let t;for(t in e)return!1;return!0}function privateProperty(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function readOnlyProperty(e,t,n){let r={enumerable:!0,configurable:!0};typeof n==`function`?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function validateHints(e){return!(!isPlainObject(e)||e.attributes&&!Array.isArray(e.attributes))}function incrementalIdStartingFromRandomByte(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function chain(){let e=arguments,t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function emptyIterator(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}var GraphError=class extends Error{constructor(e){super(),this.name=`GraphError`,this.message=e}},n=class InvalidArgumentsGraphError extends GraphError{constructor(e){super(e),this.name=`InvalidArgumentsGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,InvalidArgumentsGraphError.prototype.constructor)}},r=class NotFoundGraphError extends GraphError{constructor(e){super(e),this.name=`NotFoundGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,NotFoundGraphError.prototype.constructor)}},i=class UsageGraphError extends GraphError{constructor(e){super(e),this.name=`UsageGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,UsageGraphError.prototype.constructor)}};function MixedNodeData(e,t){this.key=e,this.attributes=t,this.clear()}MixedNodeData.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function DirectedNodeData(e,t){this.key=e,this.attributes=t,this.clear()}DirectedNodeData.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function UndirectedNodeData(e,t){this.key=e,this.attributes=t,this.clear()}UndirectedNodeData.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function EdgeData(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}EdgeData.prototype.attach=function(){let e=`out`,t=`in`;this.undirected&&(e=t=`undirected`);let n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)},EdgeData.prototype.attachMulti=function(){let e=`out`,t=`in`,n=this.source.key,r=this.target.key;this.undirected&&(e=t=`undirected`);let i=this.source[e],a=i[r];if(a===void 0){i[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}a.previous=this,this.next=a,i[r]=this,this.target[t][n]=this},EdgeData.prototype.detach=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),delete this.source[n][t],delete this.target[r][e]},EdgeData.prototype.detachMulti=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};function findRelevantNodeData(e,t,n,i,a,o,s){let c,l,u,d;if(i=``+i,n===0){if(c=e._nodes.get(i),!c)throw new r(`Graph.${t}: could not find the "${i}" node in the graph.`);u=a,d=o}else if(n===3){if(a=``+a,l=e._edges.get(a),!l)throw new r(`Graph.${t}: could not find the "${a}" edge in the graph.`);let n=l.source.key,f=l.target.key;if(i===n)c=l.target;else if(i===f)c=l.source;else throw new r(`Graph.${t}: the "${i}" node is not attached to the "${a}" edge (${n}, ${f}).`);u=o,d=s}else{if(l=e._edges.get(i),!l)throw new r(`Graph.${t}: could not find the "${i}" edge in the graph.`);c=n===1?l.source:l.target,u=a,d=o}return[c,u,d]}function attachNodeAttributeGetter(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=findRelevantNodeData(this,t,n,e,r,i);return a.attributes[o]}}function attachNodeAttributesGetter(e,t,n){e.prototype[t]=function(e,r){let[i]=findRelevantNodeData(this,t,n,e,r);return i.attributes}}function attachNodeAttributeChecker(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=findRelevantNodeData(this,t,n,e,r,i);return a.attributes.hasOwnProperty(o)}}function attachNodeAttributeSetter(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=findRelevantNodeData(this,t,n,e,r,i,a);return o.attributes[s]=c,this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function attachNodeAttributeUpdater(e,t,r){e.prototype[t]=function(e,i,a,o){let[s,c,l]=findRelevantNodeData(this,t,r,e,i,a,o);if(typeof l!=`function`)throw new n(`Graph.${t}: updater should be a function.`);let u=s.attributes;return u[c]=l(u[c]),this.emit(`nodeAttributesUpdated`,{key:s.key,type:`set`,attributes:s.attributes,name:c}),this}}function attachNodeAttributeRemover(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=findRelevantNodeData(this,t,n,e,r,i);return delete a.attributes[o],this.emit(`nodeAttributesUpdated`,{key:a.key,type:`remove`,attributes:a.attributes,name:o}),this}}function attachNodeAttributesReplacer(e,t,r){e.prototype[t]=function(e,i,a){let[o,s]=findRelevantNodeData(this,t,r,e,i,a);if(!isPlainObject(s))throw new n(`Graph.${t}: provided attributes are not a plain object.`);return o.attributes=s,this.emit(`nodeAttributesUpdated`,{key:o.key,type:`replace`,attributes:o.attributes}),this}}function attachNodeAttributesMerger(e,r,i){e.prototype[r]=function(e,a,o){let[s,c]=findRelevantNodeData(this,r,i,e,a,o);if(!isPlainObject(c))throw new n(`Graph.${r}: provided attributes are not a plain object.`);return t(s.attributes,c),this.emit(`nodeAttributesUpdated`,{key:s.key,type:`merge`,attributes:s.attributes,data:c}),this}}function attachNodeAttributesUpdater(e,t,r){e.prototype[t]=function(e,i,a){let[o,s]=findRelevantNodeData(this,t,r,e,i,a);if(typeof s!=`function`)throw new n(`Graph.${t}: provided updater is not a function.`);return o.attributes=s(o.attributes),this.emit(`nodeAttributesUpdated`,{key:o.key,type:`update`,attributes:o.attributes}),this}}const a=[{name:e=>`get${e}Attribute`,attacher:attachNodeAttributeGetter},{name:e=>`get${e}Attributes`,attacher:attachNodeAttributesGetter},{name:e=>`has${e}Attribute`,attacher:attachNodeAttributeChecker},{name:e=>`set${e}Attribute`,attacher:attachNodeAttributeSetter},{name:e=>`update${e}Attribute`,attacher:attachNodeAttributeUpdater},{name:e=>`remove${e}Attribute`,attacher:attachNodeAttributeRemover},{name:e=>`replace${e}Attributes`,attacher:attachNodeAttributesReplacer},{name:e=>`merge${e}Attributes`,attacher:attachNodeAttributesMerger},{name:e=>`update${e}Attributes`,attacher:attachNodeAttributesUpdater}];function attachNodeAttributesMethods(e){a.forEach(function({name:t,attacher:n}){n(e,t(`Node`),0),n(e,t(`Source`),1),n(e,t(`Target`),2),n(e,t(`Opposite`),3)})}function attachEdgeAttributeGetter(e,t,n){e.prototype[t]=function(e,a){let o;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new i(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new i(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let s=``+e,c=``+a;if(a=arguments[2],o=getMatchingEdge(this,s,c,n),!o)throw new r(`Graph.${t}: could not find an edge for the given path ("${s}" - "${c}").`)}else{if(n!==`mixed`)throw new i(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,o=this._edges.get(e),!o)throw new r(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return o.attributes[a]}}function attachEdgeAttributesGetter(e,t,n){e.prototype[t]=function(e){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new i(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new i(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+arguments[1];if(a=getMatchingEdge(this,o,s,n),!a)throw new r(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new i(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new r(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return a.attributes}}function attachEdgeAttributeChecker(e,t,n){e.prototype[t]=function(e,a){let o;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new i(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new i(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let s=``+e,c=``+a;if(a=arguments[2],o=getMatchingEdge(this,s,c,n),!o)throw new r(`Graph.${t}: could not find an edge for the given path ("${s}" - "${c}").`)}else{if(n!==`mixed`)throw new i(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,o=this._edges.get(e),!o)throw new r(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return o.attributes.hasOwnProperty(a)}}function attachEdgeAttributeSetter(e,t,n){e.prototype[t]=function(e,a,o){let s;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new i(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new i(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let c=``+e,l=``+a;if(a=arguments[2],o=arguments[3],s=getMatchingEdge(this,c,l,n),!s)throw new r(`Graph.${t}: could not find an edge for the given path ("${c}" - "${l}").`)}else{if(n!==`mixed`)throw new i(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,s=this._edges.get(e),!s)throw new r(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return s.attributes[a]=o,this.emit(`edgeAttributesUpdated`,{key:s.key,type:`set`,attributes:s.attributes,name:a}),this}}function attachEdgeAttributeUpdater(e,t,a){e.prototype[t]=function(e,o,s){let c;if(this.type!==`mixed`&&a!==`mixed`&&a!==this.type)throw new i(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new i(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let n=``+e,l=``+o;if(o=arguments[2],s=arguments[3],c=getMatchingEdge(this,n,l,a),!c)throw new r(`Graph.${t}: could not find an edge for the given path ("${n}" - "${l}").`)}else{if(a!==`mixed`)throw new i(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,c=this._edges.get(e),!c)throw new r(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof s!=`function`)throw new n(`Graph.${t}: updater should be a function.`);return c.attributes[o]=s(c.attributes[o]),this.emit(`edgeAttributesUpdated`,{key:c.key,type:`set`,attributes:c.attributes,name:o}),this}}function attachEdgeAttributeRemover(e,t,n){e.prototype[t]=function(e,a){let o;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new i(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new i(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let s=``+e,c=``+a;if(a=arguments[2],o=getMatchingEdge(this,s,c,n),!o)throw new r(`Graph.${t}: could not find an edge for the given path ("${s}" - "${c}").`)}else{if(n!==`mixed`)throw new i(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,o=this._edges.get(e),!o)throw new r(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return delete o.attributes[a],this.emit(`edgeAttributesUpdated`,{key:o.key,type:`remove`,attributes:o.attributes,name:a}),this}}function attachEdgeAttributesReplacer(e,t,a){e.prototype[t]=function(e,o){let s;if(this.type!==`mixed`&&a!==`mixed`&&a!==this.type)throw new i(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new i(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let n=``+e,c=``+o;if(o=arguments[2],s=getMatchingEdge(this,n,c,a),!s)throw new r(`Graph.${t}: could not find an edge for the given path ("${n}" - "${c}").`)}else{if(a!==`mixed`)throw new i(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,s=this._edges.get(e),!s)throw new r(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!isPlainObject(o))throw new n(`Graph.${t}: provided attributes are not a plain object.`);return s.attributes=o,this.emit(`edgeAttributesUpdated`,{key:s.key,type:`replace`,attributes:s.attributes}),this}}function attachEdgeAttributesMerger(e,a,o){e.prototype[a]=function(e,s){let c;if(this.type!==`mixed`&&o!==`mixed`&&o!==this.type)throw new i(`Graph.${a}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new i(`Graph.${a}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let t=``+e,n=``+s;if(s=arguments[2],c=getMatchingEdge(this,t,n,o),!c)throw new r(`Graph.${a}: could not find an edge for the given path ("${t}" - "${n}").`)}else{if(o!==`mixed`)throw new i(`Graph.${a}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,c=this._edges.get(e),!c)throw new r(`Graph.${a}: could not find the "${e}" edge in the graph.`)}if(!isPlainObject(s))throw new n(`Graph.${a}: provided attributes are not a plain object.`);return t(c.attributes,s),this.emit(`edgeAttributesUpdated`,{key:c.key,type:`merge`,attributes:c.attributes,data:s}),this}}function attachEdgeAttributesUpdater(e,t,a){e.prototype[t]=function(e,o){let s;if(this.type!==`mixed`&&a!==`mixed`&&a!==this.type)throw new i(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new i(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let n=``+e,c=``+o;if(o=arguments[2],s=getMatchingEdge(this,n,c,a),!s)throw new r(`Graph.${t}: could not find an edge for the given path ("${n}" - "${c}").`)}else{if(a!==`mixed`)throw new i(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,s=this._edges.get(e),!s)throw new r(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof o!=`function`)throw new n(`Graph.${t}: provided updater is not a function.`);return s.attributes=o(s.attributes),this.emit(`edgeAttributesUpdated`,{key:s.key,type:`update`,attributes:s.attributes}),this}}const o=[{name:e=>`get${e}Attribute`,attacher:attachEdgeAttributeGetter},{name:e=>`get${e}Attributes`,attacher:attachEdgeAttributesGetter},{name:e=>`has${e}Attribute`,attacher:attachEdgeAttributeChecker},{name:e=>`set${e}Attribute`,attacher:attachEdgeAttributeSetter},{name:e=>`update${e}Attribute`,attacher:attachEdgeAttributeUpdater},{name:e=>`remove${e}Attribute`,attacher:attachEdgeAttributeRemover},{name:e=>`replace${e}Attributes`,attacher:attachEdgeAttributesReplacer},{name:e=>`merge${e}Attributes`,attacher:attachEdgeAttributesMerger},{name:e=>`update${e}Attributes`,attacher:attachEdgeAttributesUpdater}];function attachEdgeAttributesMethods(e){o.forEach(function({name:t,attacher:n}){n(e,t(`Edge`),`mixed`),n(e,t(`DirectedEdge`),`directed`),n(e,t(`UndirectedEdge`),`undirected`)})}const s=[{name:`edges`,type:`mixed`},{name:`inEdges`,type:`directed`,direction:`in`},{name:`outEdges`,type:`directed`,direction:`out`},{name:`inboundEdges`,type:`mixed`,direction:`in`},{name:`outboundEdges`,type:`mixed`,direction:`out`},{name:`directedEdges`,type:`directed`},{name:`undirectedEdges`,type:`undirected`}];function forEachSimple(e,t,n,r){let i=!1;for(let a in t){if(a===r)continue;let o=t[a];if(i=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&i)return o.key}}function forEachMulti(e,t,n,r){let i,a,o,s=!1;for(let c in t)if(c!==r){i=t[c];do{if(a=i.source,o=i.target,s=n(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected),e&&s)return i.key;i=i.next}while(i!==void 0)}}function createIterator(e,t){let n=Object.keys(e),r=n.length,i,a=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(a>=r)return{done:!0};let o=n[a++];if(o===t){i=void 0;continue}i=e[o]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function forEachForKeySimple(e,t,n,r){let i=t[n];if(!i)return;let a=i.source,o=i.target;if(r(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected)&&e)return i.key}function forEachForKeyMulti(e,t,n,r){let i=t[n];if(!i)return;let a=!1;do{if(a=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&a)return i.key;i=i.next}while(i!==void 0)}function createIteratorForKey(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};let e={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:e}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function createEdgeArray(e,t){if(e.size===0)return[];if(t===`mixed`||t===e.type)return Array.from(e._edges.keys());let n=t===`undirected`?e.undirectedSize:e.directedSize,r=Array(n),i=t===`undirected`,a=e._edges.values(),o=0,s,c;for(;s=a.next(),s.done!==!0;)c=s.value,c.undirected===i&&(r[o++]=c.key);return r}function forEachEdge(e,t,n,r){if(t.size===0)return;let i=n!==`mixed`&&n!==t.type,a=n===`undirected`,o,s,c=!1,l=t._edges.values();for(;o=l.next(),o.done!==!0;){if(s=o.value,i&&s.undirected!==a)continue;let{key:t,attributes:n,source:l,target:u}=s;if(c=r(t,n,l.key,u.key,l.attributes,u.attributes,s.undirected),e&&c)return t}}function createEdgeIterator(e,t){if(e.size===0)return emptyIterator();let n=t!==`mixed`&&t!==e.type,r=t===`undirected`,i=e._edges.values();return{[Symbol.iterator](){return this},next(){let e,t;for(;;){if(e=i.next(),e.done)return e;if(t=e.value,!(n&&t.undirected!==r))break}return{value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected},done:!1}}}}function forEachEdgeForNode(e,t,n,r,i,a){let o=t?forEachMulti:forEachSimple,s;if(n!==`undirected`&&(r!==`out`&&(s=o(e,i.in,a),e&&s)||r!==`in`&&(s=o(e,i.out,a,r?void 0:i.key),e&&s))||n!==`directed`&&(s=o(e,i.undirected,a),e&&s))return s}function createEdgeArrayForNode(e,t,n,r){let i=[];return forEachEdgeForNode(!1,e,t,n,r,function(e){i.push(e)}),i}function createEdgeIteratorForNode(e,t,n){let r=emptyIterator();return e!==`undirected`&&(t!==`out`&&n.in!==void 0&&(r=chain(r,createIterator(n.in))),t!==`in`&&n.out!==void 0&&(r=chain(r,createIterator(n.out,t?void 0:n.key)))),e!==`directed`&&n.undirected!==void 0&&(r=chain(r,createIterator(n.undirected))),r}function forEachEdgeForPath(e,t,n,r,i,a,o){let s=n?forEachForKeyMulti:forEachForKeySimple,c;if(t!==`undirected`&&(i.in!==void 0&&r!==`out`&&(c=s(e,i.in,a,o),e&&c)||i.out!==void 0&&r!==`in`&&(r||i.key!==a)&&(c=s(e,i.out,a,o),e&&c))||t!==`directed`&&i.undirected!==void 0&&(c=s(e,i.undirected,a,o),e&&c))return c}function createEdgeArrayForPath(e,t,n,r,i){let a=[];return forEachEdgeForPath(!1,e,t,n,r,i,function(e){a.push(e)}),a}function createEdgeIteratorForPath(e,t,n,r){let i=emptyIterator();return e!==`undirected`&&(n.in!==void 0&&t!==`out`&&r in n.in&&(i=chain(i,createIteratorForKey(n.in,r))),n.out!==void 0&&t!==`in`&&r in n.out&&(t||n.key!==r)&&(i=chain(i,createIteratorForKey(n.out,r)))),e!==`directed`&&n.undirected!==void 0&&r in n.undirected&&(i=chain(i,createIteratorForKey(n.undirected,r))),i}function attachEdgeArrayCreator(e,t){let{name:i,type:a,direction:o}=t;e.prototype[i]=function(e,t){if(a!==`mixed`&&this.type!==`mixed`&&a!==this.type)return[];if(!arguments.length)return createEdgeArray(this,a);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new r(`Graph.${i}: could not find the "${e}" node in the graph.`);return createEdgeArrayForNode(this.multi,a===`mixed`?this.type:a,o,t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new r(`Graph.${i}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new r(`Graph.${i}: could not find the "${t}" target node in the graph.`);return createEdgeArrayForPath(a,this.multi,o,n,t)}throw new n(`Graph.${i}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function attachForEachEdge(e,t){let{name:i,type:a,direction:o}=t,s=`forEach`+i[0].toUpperCase()+i.slice(1,-1);e.prototype[s]=function(e,t,i){if(!(a!==`mixed`&&this.type!==`mixed`&&a!==this.type)){if(arguments.length===1)return i=e,forEachEdge(!1,this,a,i);if(arguments.length===2){e=``+e,i=t;let n=this._nodes.get(e);if(n===void 0)throw new r(`Graph.${s}: could not find the "${e}" node in the graph.`);return forEachEdgeForNode(!1,this.multi,a===`mixed`?this.type:a,o,n,i)}if(arguments.length===3){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new r(`Graph.${s}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new r(`Graph.${s}: could not find the "${t}" target node in the graph.`);return forEachEdgeForPath(!1,a,this.multi,o,n,t,i)}throw new n(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};let c=`map`+i[0].toUpperCase()+i.slice(1);e.prototype[c]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n;if(e.length===0){let r=0;a!==`directed`&&(r+=this.undirectedSize),a!==`undirected`&&(r+=this.directedSize),n=Array(r);let i=0;e.push((e,r,a,o,s,c,l)=>{n[i++]=t(e,r,a,o,s,c,l)})}else n=[],e.push((e,r,i,a,o,s,c)=>{n.push(t(e,r,i,a,o,s,c))});return this[s].apply(this,e),n};let l=`filter`+i[0].toUpperCase()+i.slice(1);e.prototype[l]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n=[];return e.push((e,r,i,a,o,s,c)=>{t(e,r,i,a,o,s,c)&&n.push(e)}),this[s].apply(this,e),n};let u=`reduce`+i[0].toUpperCase()+i.slice(1);e.prototype[u]=function(){let e=Array.prototype.slice.call(arguments);if(e.length<2||e.length>4)throw new n(`Graph.${u}: invalid number of arguments (expecting 2, 3 or 4 and got ${e.length}).`);if(typeof e[e.length-1]==`function`&&typeof e[e.length-2]!=`function`)throw new n(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let t,r;e.length===2?(t=e[0],r=e[1],e=[]):e.length===3?(t=e[1],r=e[2],e=[e[0]]):e.length===4&&(t=e[2],r=e[3],e=[e[0],e[1]]);let i=r;return e.push((e,n,r,a,o,s,c)=>{i=t(i,e,n,r,a,o,s,c)}),this[s].apply(this,e),i}}function attachFindEdge(e,t){let{name:i,type:a,direction:o}=t,s=`find`+i[0].toUpperCase()+i.slice(1,-1);e.prototype[s]=function(e,t,i){if(a!==`mixed`&&this.type!==`mixed`&&a!==this.type)return!1;if(arguments.length===1)return i=e,forEachEdge(!0,this,a,i);if(arguments.length===2){e=``+e,i=t;let n=this._nodes.get(e);if(n===void 0)throw new r(`Graph.${s}: could not find the "${e}" node in the graph.`);return forEachEdgeForNode(!0,this.multi,a===`mixed`?this.type:a,o,n,i)}if(arguments.length===3){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new r(`Graph.${s}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new r(`Graph.${s}: could not find the "${t}" target node in the graph.`);return forEachEdgeForPath(!0,a,this.multi,o,n,t,i)}throw new n(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};let c=`some`+i[0].toUpperCase()+i.slice(1,-1);e.prototype[c]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>t(e,n,r,i,a,o,s)),!!this[s].apply(this,e)};let l=`every`+i[0].toUpperCase()+i.slice(1,-1);e.prototype[l]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>!t(e,n,r,i,a,o,s)),!this[s].apply(this,e)}}function attachEdgeIteratorCreator(e,t){let{name:i,type:a,direction:o}=t,s=i.slice(0,-1)+`Entries`;e.prototype[s]=function(e,t){if(a!==`mixed`&&this.type!==`mixed`&&a!==this.type)return emptyIterator();if(!arguments.length)return createEdgeIterator(this,a);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.${s}: could not find the "${e}" node in the graph.`);return createEdgeIteratorForNode(a,o,t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new r(`Graph.${s}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new r(`Graph.${s}: could not find the "${t}" target node in the graph.`);return createEdgeIteratorForPath(a,o,n,t)}throw new n(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function attachEdgeIterationMethods(e){s.forEach(t=>{attachEdgeArrayCreator(e,t),attachForEachEdge(e,t),attachFindEdge(e,t),attachEdgeIteratorCreator(e,t)})}const c=[{name:`neighbors`,type:`mixed`},{name:`inNeighbors`,type:`directed`,direction:`in`},{name:`outNeighbors`,type:`directed`,direction:`out`},{name:`inboundNeighbors`,type:`mixed`,direction:`in`},{name:`outboundNeighbors`,type:`mixed`,direction:`out`},{name:`directedNeighbors`,type:`directed`},{name:`undirectedNeighbors`,type:`undirected`}];function CompositeSetWrapper(){this.A=null,this.B=null}CompositeSetWrapper.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)},CompositeSetWrapper.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function forEachInObjectOnce(e,t,n,r,i){for(let a in r){let o=r[a],s=o.source,c=o.target,l=s===n?c:s;if(t&&t.has(l.key))continue;let u=i(l.key,l.attributes);if(e&&u)return l.key}}function forEachNeighbor(e,t,n,r,i){if(t!==`mixed`){if(t===`undirected`)return forEachInObjectOnce(e,null,r,r.undirected,i);if(typeof n==`string`)return forEachInObjectOnce(e,null,r,r[n],i)}let a=new CompositeSetWrapper,o;if(t!==`undirected`){if(n!==`out`){if(o=forEachInObjectOnce(e,null,r,r.in,i),e&&o)return o;a.wrap(r.in)}if(n!==`in`){if(o=forEachInObjectOnce(e,a,r,r.out,i),e&&o)return o;a.wrap(r.out)}}if(t!==`directed`&&(o=forEachInObjectOnce(e,a,r,r.undirected,i),e&&o))return o}function createNeighborArrayForNode(e,t,n){if(e!==`mixed`){if(e===`undirected`)return Object.keys(n.undirected);if(typeof t==`string`)return Object.keys(n[t])}let r=[];return forEachNeighbor(!1,e,t,n,function(e){r.push(e)}),r}function createDedupedObjectIterator(e,t,n){let r=Object.keys(n),i=r.length,a=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(a>=i)return e&&e.wrap(n),{done:!0};let s=n[r[a++]],c=s.source,l=s.target;if(o=c===t?l:c,e&&e.has(o.key)){o=null;continue}}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function createNeighborIterator(e,t,n){if(e!==`mixed`){if(e===`undirected`)return createDedupedObjectIterator(null,n,n.undirected);if(typeof t==`string`)return createDedupedObjectIterator(null,n,n[t])}let r=emptyIterator(),i=new CompositeSetWrapper;return e!==`undirected`&&(t!==`out`&&(r=chain(r,createDedupedObjectIterator(i,n,n.in))),t!==`in`&&(r=chain(r,createDedupedObjectIterator(i,n,n.out)))),e!==`directed`&&(r=chain(r,createDedupedObjectIterator(i,n,n.undirected))),r}function attachNeighborArrayCreator(e,t){let{name:n,type:i,direction:a}=t;e.prototype[n]=function(e){if(i!==`mixed`&&this.type!==`mixed`&&i!==this.type)return[];e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new r(`Graph.${n}: could not find the "${e}" node in the graph.`);return createNeighborArrayForNode(i===`mixed`?this.type:i,a,t)}}function attachForEachNeighbor(e,t){let{name:i,type:a,direction:o}=t,s=`forEach`+i[0].toUpperCase()+i.slice(1,-1);e.prototype[s]=function(e,t){if(a!==`mixed`&&this.type!==`mixed`&&a!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new r(`Graph.${s}: could not find the "${e}" node in the graph.`);forEachNeighbor(!1,a===`mixed`?this.type:a,o,n,t)};let c=`map`+i[0].toUpperCase()+i.slice(1);e.prototype[c]=function(e,t){let n=[];return this[s](e,(e,r)=>{n.push(t(e,r))}),n};let l=`filter`+i[0].toUpperCase()+i.slice(1);e.prototype[l]=function(e,t){let n=[];return this[s](e,(e,r)=>{t(e,r)&&n.push(e)}),n};let u=`reduce`+i[0].toUpperCase()+i.slice(1);e.prototype[u]=function(e,t,r){if(arguments.length<3)throw new n(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let i=r;return this[s](e,(e,n)=>{i=t(i,e,n)}),i}}function attachFindNeighbor(e,t){let{name:n,type:i,direction:a}=t,o=n[0].toUpperCase()+n.slice(1,-1),s=`find`+o;e.prototype[s]=function(e,t){if(i!==`mixed`&&this.type!==`mixed`&&i!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new r(`Graph.${s}: could not find the "${e}" node in the graph.`);return forEachNeighbor(!0,i===`mixed`?this.type:i,a,n,t)};let c=`some`+o;e.prototype[c]=function(e,t){return!!this[s](e,t)};let l=`every`+o;e.prototype[l]=function(e,t){return!this[s](e,(e,n)=>!t(e,n))}}function attachNeighborIteratorCreator(e,t){let{name:n,type:i,direction:a}=t,o=n.slice(0,-1)+`Entries`;e.prototype[o]=function(e){if(i!==`mixed`&&this.type!==`mixed`&&i!==this.type)return emptyIterator();e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new r(`Graph.${o}: could not find the "${e}" node in the graph.`);return createNeighborIterator(i===`mixed`?this.type:i,a,t)}}function attachNeighborIterationMethods(e){c.forEach(t=>{attachNeighborArrayCreator(e,t),attachForEachNeighbor(e,t),attachFindNeighbor(e,t),attachNeighborIteratorCreator(e,t)})}function forEachAdjacency(e,t,n,r,i){let a=r._nodes.values(),o=r.type,s,c,l,u,d,f,p;for(;s=a.next(),s.done!==!0;){let r=!1;if(c=s.value,o!==`undirected`)for(l in u=c.out,u){d=u[l];do{if(f=d.target,r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}if(o!==`directed`){for(l in u=c.undirected,u)if(!(t&&c.key>l)){d=u[l];do{if(f=d.target,f.key!==l&&(f=d.source),r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}}if(n&&!r&&(p=i(c.key,null,c.attributes,null,null,null,null),e&&p))return null}}function serializeNode(e,n){let r={key:e};return isEmpty(n.attributes)||(r.attributes=t({},n.attributes)),r}function serializeEdge(e,n,r){let i={key:n,source:r.source.key,target:r.target.key};return isEmpty(r.attributes)||(i.attributes=t({},r.attributes)),e===`mixed`&&r.undirected&&(i.undirected=!0),i}function validateSerializedNode(e){if(!isPlainObject(e))throw new n(`Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.`);if(!(`key`in e))throw new n(`Graph.import: serialized node is missing its key.`);if(`attributes`in e&&(!isPlainObject(e.attributes)||e.attributes===null))throw new n(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`)}function validateSerializedEdge(e){if(!isPlainObject(e))throw new n(`Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.`);if(!(`source`in e))throw new n(`Graph.import: serialized edge is missing its source.`);if(!(`target`in e))throw new n(`Graph.import: serialized edge is missing its target.`);if(`attributes`in e&&(!isPlainObject(e.attributes)||e.attributes===null))throw new n(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`);if(`undirected`in e&&typeof e.undirected!=`boolean`)throw new n(`Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.`)}const l=incrementalIdStartingFromRandomByte(),u=new Set([`directed`,`undirected`,`mixed`]),d=new Set([`domain`,`_events`,`_eventsCount`,`_maxListeners`]),f=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:`directed`},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:`undirected`},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:`directed`},{name:e=>`${e}UndirectedEdgeWithKey`,type:`undirected`}],p={allowSelfLoops:!0,multi:!1,type:`mixed`};function addNode(e,t,r){if(r&&!isPlainObject(r))throw new n(`Graph.addNode: invalid attributes. Expecting an object but got "${r}"`);if(t=``+t,r||={},e._nodes.has(t))throw new i(`Graph.addNode: the "${t}" node already exist in the graph.`);let a=new e.NodeDataClass(t,r);return e._nodes.set(t,a),e.emit(`nodeAdded`,{key:t,attributes:r}),a}function unsafeAddNode(e,t,n){let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function addEdge(e,t,a,o,s,c,l,u){if(!o&&e.type===`undirected`)throw new i(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(o&&e.type===`directed`)throw new i(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(u&&!isPlainObject(u))throw new n(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`);if(c=``+c,l=``+l,u||={},!e.allowSelfLoops&&c===l)throw new i(`Graph.${t}: source & target are the same ("${c}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let d=e._nodes.get(c),f=e._nodes.get(l);if(!d)throw new r(`Graph.${t}: source node "${c}" not found.`);if(!f)throw new r(`Graph.${t}: target node "${l}" not found.`);let p={key:null,undirected:o,source:c,target:l,attributes:u};if(a)s=e._edgeKeyGenerator();else if(s=``+s,e._edges.has(s))throw new i(`Graph.${t}: the "${s}" edge already exists in the graph.`);if(!e.multi&&(o?d.undirected[l]!==void 0:d.out[l]!==void 0))throw new i(`Graph.${t}: an edge linking "${c}" to "${l}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);let m=new EdgeData(o,s,d,f,u);e._edges.set(s,m);let h=c===l;return o?(d.undirectedDegree++,f.undirectedDegree++,h&&(d.undirectedLoops++,e._undirectedSelfLoopCount++)):(d.outDegree++,f.inDegree++,h&&(d.directedLoops++,e._directedSelfLoopCount++)),e.multi?m.attachMulti():m.attach(),o?e._undirectedSize++:e._directedSize++,p.key=s,e.emit(`edgeAdded`,p),s}function mergeEdge(e,r,a,o,s,c,l,u,d){if(!o&&e.type===`undirected`)throw new i(`Graph.${r}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(o&&e.type===`directed`)throw new i(`Graph.${r}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(u){if(d){if(typeof u!=`function`)throw new n(`Graph.${r}: invalid updater function. Expecting a function but got "${u}"`)}else if(!isPlainObject(u))throw new n(`Graph.${r}: invalid attributes. Expecting an object but got "${u}"`)}c=``+c,l=``+l;let f;if(d&&(f=u,u=void 0),!e.allowSelfLoops&&c===l)throw new i(`Graph.${r}: source & target are the same ("${c}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let p=e._nodes.get(c),m=e._nodes.get(l),h,g;if(!a&&(h=e._edges.get(s),h)){if((h.source.key!==c||h.target.key!==l)&&(!o||h.source.key!==l||h.target.key!==c))throw new i(`Graph.${r}: inconsistency detected when attempting to merge the "${s}" edge with "${c}" source & "${l}" target vs. ("${h.source.key}", "${h.target.key}").`);g=h}if(!g&&!e.multi&&p&&(g=o?p.undirected[l]:p.out[l]),g){let n=[g.key,!1,!1,!1];if(d?!f:!u)return n;if(d){let t=g.attributes;g.attributes=f(t),e.emit(`edgeAttributesUpdated`,{type:`replace`,key:g.key,attributes:g.attributes})}else t(g.attributes,u),e.emit(`edgeAttributesUpdated`,{type:`merge`,key:g.key,attributes:g.attributes,data:u});return n}u||={},d&&f&&(u=f(u));let _={key:null,undirected:o,source:c,target:l,attributes:u};if(a)s=e._edgeKeyGenerator();else if(s=``+s,e._edges.has(s))throw new i(`Graph.${r}: the "${s}" edge already exists in the graph.`);let v=!1,y=!1;p||(p=unsafeAddNode(e,c,{}),v=!0,c===l&&(m=p,y=!0)),m||(m=unsafeAddNode(e,l,{}),y=!0),h=new EdgeData(o,s,p,m,u),e._edges.set(s,h);let b=c===l;return o?(p.undirectedDegree++,m.undirectedDegree++,b&&(p.undirectedLoops++,e._undirectedSelfLoopCount++)):(p.outDegree++,m.inDegree++,b&&(p.directedLoops++,e._directedSelfLoopCount++)),e.multi?h.attachMulti():h.attach(),o?e._undirectedSize++:e._directedSize++,_.key=s,e.emit(`edgeAdded`,_),[s,!0,v,y]}function dropEdgeFromData(e,t){e._edges.delete(t.key);let{source:n,target:r,attributes:i}=t,a=t.undirected,o=n===r;a?(n.undirectedDegree--,r.undirectedDegree--,o&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,o&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),a?e._undirectedSize--:e._directedSize--,e.emit(`edgeDropped`,{key:t.key,attributes:i,source:n.key,target:r.key,undirected:a})}var m=class Graph extends e{constructor(e){if(super(),e=t({},p,e),typeof e.multi!=`boolean`)throw new n(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!u.has(e.type))throw new n(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!=`boolean`)throw new n(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);let r=e.type===`mixed`?MixedNodeData:e.type===`directed`?DirectedNodeData:UndirectedNodeData;privateProperty(this,`NodeDataClass`,r);let i=`geid_`+l()+`_`,a=0,edgeKeyGenerator=()=>{let e;do e=i+ a++;while(this._edges.has(e));return e};privateProperty(this,`_attributes`,{}),privateProperty(this,`_nodes`,new Map),privateProperty(this,`_edges`,new Map),privateProperty(this,`_directedSize`,0),privateProperty(this,`_undirectedSize`,0),privateProperty(this,`_directedSelfLoopCount`,0),privateProperty(this,`_undirectedSelfLoopCount`,0),privateProperty(this,`_edgeKeyGenerator`,edgeKeyGenerator),privateProperty(this,`_options`,e),d.forEach(e=>privateProperty(this,e,this[e])),readOnlyProperty(this,`order`,()=>this._nodes.size),readOnlyProperty(this,`size`,()=>this._edges.size),readOnlyProperty(this,`directedSize`,()=>this._directedSize),readOnlyProperty(this,`undirectedSize`,()=>this._undirectedSize),readOnlyProperty(this,`selfLoopCount`,()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),readOnlyProperty(this,`directedSelfLoopCount`,()=>this._directedSelfLoopCount),readOnlyProperty(this,`undirectedSelfLoopCount`,()=>this._undirectedSelfLoopCount),readOnlyProperty(this,`multi`,this._options.multi),readOnlyProperty(this,`type`,this._options.type),readOnlyProperty(this,`allowSelfLoops`,this._options.allowSelfLoops),readOnlyProperty(this,`implementation`,()=>`graphology`)}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(``+e)}hasDirectedEdge(e,t){if(this.type===`undirected`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&!n.undirected}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new n(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type===`directed`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&n.undirected}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new n(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){let t=``+e;return this._edges.has(t)}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out!==void 0&&n.out.hasOwnProperty(t)||n.undirected!==void 0&&n.undirected.hasOwnProperty(t):!1}throw new n(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type===`undirected`)return;if(e=``+e,t=``+t,this.multi)throw new i(`Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new r(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new r(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);let a=n.out&&n.out[t]||void 0;if(a)return a.key}undirectedEdge(e,t){if(this.type===`directed`)return;if(e=``+e,t=``+t,this.multi)throw new i(`Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new r(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new r(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);let a=n.undirected&&n.undirected[t]||void 0;if(a)return a.key}edge(e,t){if(this.multi)throw new i(`Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.`);e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new r(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new r(`Graph.edge: could not find the "${t}" target node in the graph.`);let a=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(a)return a.key}areDirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new r(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new r(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.out}areInNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new r(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in}areUndirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new r(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`directed`?!1:t in n.undirected}areNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new r(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&(t in n.in||t in n.out)||this.type!==`directed`&&t in n.undirected}areInboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new r(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in||this.type!==`directed`&&t in n.undirected}areOutboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new r(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out||this.type!==`directed`&&t in n.undirected}inDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree}outDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree}directedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree}undirectedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree}inboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree),n}outboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.outDegree),n}degree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,i=0;return this.type!==`directed`&&(n+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree,i+=t.directedLoops),n-i}outboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,i=0;return this.type!==`directed`&&(n+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.outDegree,i+=t.directedLoops),n-i}degreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,i=0;return this.type!==`directed`&&(n+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree,i+=t.directedLoops*2),n-i}source(e){e=``+e;let t=this._edges.get(e);if(!t)throw new r(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=``+e;let t=this._edges.get(e);if(!t)throw new r(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=``+e;let t=this._edges.get(e);if(!t)throw new r(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=``+e,t=``+t;let n=this._edges.get(t);if(!n)throw new r(`Graph.opposite: could not find the "${t}" edge in the graph.`);let i=n.source.key,a=n.target.key;if(e===i)return a;if(e===a)return i;throw new r(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${i}, ${a}).`)}hasExtremity(e,t){e=``+e,t=``+t;let n=this._edges.get(e);if(!n)throw new r(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new r(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new r(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=``+e;let t=this._edges.get(e);if(!t)throw new r(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return addNode(this,e,t).key}mergeNode(e,r){if(r&&!isPlainObject(r))throw new n(`Graph.mergeNode: invalid attributes. Expecting an object but got "${r}"`);e=``+e,r||={};let i=this._nodes.get(e);return i?(r&&(t(i.attributes,r),this.emit(`nodeAttributesUpdated`,{type:`merge`,key:e,attributes:i.attributes,data:r})),[e,!1]):(i=new this.NodeDataClass(e,r),this._nodes.set(e,i),this.emit(`nodeAdded`,{key:e,attributes:r}),[e,!0])}updateNode(e,t){if(t&&typeof t!=`function`)throw new n(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=``+e;let r=this._nodes.get(e);if(r){if(t){let n=r.attributes;r.attributes=t(n),this.emit(`nodeAttributesUpdated`,{type:`replace`,key:e,attributes:r.attributes})}return[e,!1]}let i=t?t({}):{};return r=new this.NodeDataClass(e,i),this._nodes.set(e,r),this.emit(`nodeAdded`,{key:e,attributes:i}),[e,!0]}dropNode(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new r(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!==`undirected`){for(let e in t.out){n=t.out[e];do dropEdgeFromData(this,n),n=n.next;while(n)}for(let e in t.in){n=t.in[e];do dropEdgeFromData(this,n),n=n.next;while(n)}}if(this.type!==`directed`)for(let e in t.undirected){n=t.undirected[e];do dropEdgeFromData(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit(`nodeDropped`,{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){let e=``+arguments[0],n=``+arguments[1];if(t=getMatchingEdge(this,e,n,this.type),!t)throw new r(`Graph.dropEdge: could not find the "${e}" -> "${n}" edge in the graph.`)}else if(e=``+e,t=this._edges.get(e),!t)throw new r(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return dropEdgeFromData(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new i(`Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new i(`Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);e=``+e,t=``+t;let n=getMatchingEdge(this,e,t,`directed`);if(!n)throw new r(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return dropEdgeFromData(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new i(`Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new i(`Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);let n=getMatchingEdge(this,e,t,`undirected`);if(!n)throw new r(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return dropEdgeFromData(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit(`cleared`)}clearEdges(){let e=this._nodes.values(),t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit(`edgesCleared`)}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!=`function`)throw new n(`Graph.updateAttribute: updater should be a function.`);let r=this._attributes[e];return this._attributes[e]=t(r),this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit(`attributesUpdated`,{type:`remove`,attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!isPlainObject(e))throw new n(`Graph.replaceAttributes: provided attributes are not a plain object.`);return this._attributes=e,this.emit(`attributesUpdated`,{type:`replace`,attributes:this._attributes}),this}mergeAttributes(e){if(!isPlainObject(e))throw new n(`Graph.mergeAttributes: provided attributes are not a plain object.`);return t(this._attributes,e),this.emit(`attributesUpdated`,{type:`merge`,attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!=`function`)throw new n(`Graph.updateAttributes: provided updater is not a function.`);return this._attributes=e(this._attributes),this.emit(`attributesUpdated`,{type:`update`,attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!=`function`)throw new n(`Graph.updateEachNodeAttributes: expecting an updater function.`);if(t&&!validateHints(t))throw new n(`Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let r=this._nodes.values(),i,a;for(;i=r.next(),i.done!==!0;)a=i.value,a.attributes=e(a.key,a.attributes);this.emit(`eachNodeAttributesUpdated`,{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!=`function`)throw new n(`Graph.updateEachEdgeAttributes: expecting an updater function.`);if(t&&!validateHints(t))throw new n(`Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let r=this._edges.values(),i,a,o,s;for(;i=r.next(),i.done!==!0;)a=i.value,o=a.source,s=a.target,a.attributes=e(a.key,a.attributes,o.key,s.key,o.attributes,s.attributes,a.undirected);this.emit(`eachEdgeAttributesUpdated`,{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!=`function`)throw new n(`Graph.forEachAdjacencyEntry: expecting a callback.`);forEachAdjacency(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new n(`Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.`);forEachAdjacency(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!=`function`)throw new n(`Graph.forEachAssymetricAdjacencyEntry: expecting a callback.`);forEachAdjacency(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new n(`Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.`);forEachAdjacency(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!=`function`)throw new n(`Graph.forEachNode: expecting a callback.`);let t=this._nodes.values(),r,i;for(;r=t.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)}findNode(e){if(typeof e!=`function`)throw new n(`Graph.findNode: expecting a callback.`);let t=this._nodes.values(),r,i;for(;r=t.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return i.key}mapNodes(e){if(typeof e!=`function`)throw new n(`Graph.mapNode: expecting a callback.`);let t=this._nodes.values(),r,i,a=Array(this.order),o=0;for(;r=t.next(),r.done!==!0;)i=r.value,a[o++]=e(i.key,i.attributes);return a}someNode(e){if(typeof e!=`function`)throw new n(`Graph.someNode: expecting a callback.`);let t=this._nodes.values(),r,i;for(;r=t.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return!0;return!1}everyNode(e){if(typeof e!=`function`)throw new n(`Graph.everyNode: expecting a callback.`);let t=this._nodes.values(),r,i;for(;r=t.next(),r.done!==!0;)if(i=r.value,!e(i.key,i.attributes))return!1;return!0}filterNodes(e){if(typeof e!=`function`)throw new n(`Graph.filterNodes: expecting a callback.`);let t=this._nodes.values(),r,i,a=[];for(;r=t.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)&&a.push(i.key);return a}reduceNodes(e,t){if(typeof e!=`function`)throw new n(`Graph.reduceNodes: expecting a callback.`);if(arguments.length<2)throw new n(`Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let r=t,i=this._nodes.values(),a,o;for(;a=i.next(),a.done!==!0;)o=a.value,r=e(r,o.key,o.attributes);return r}nodeEntries(){let e=this._nodes.values();return{[Symbol.iterator](){return this},next(){let t=e.next();if(t.done)return t;let n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){let e=Array(this._nodes.size),t=0;this._nodes.forEach((n,r)=>{e[t++]=serializeNode(r,n)});let n=Array(this._edges.size);return t=0,this._edges.forEach((e,r)=>{n[t++]=serializeEdge(this.type,r,e)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(e,t=!1){if(e instanceof Graph)return e.forEachNode((e,n)=>{t?this.mergeNode(e,n):this.addNode(e,n)}),e.forEachEdge((e,n,r,i,a,o,s)=>{t?s?this.mergeUndirectedEdgeWithKey(e,r,i,n):this.mergeDirectedEdgeWithKey(e,r,i,n):s?this.addUndirectedEdgeWithKey(e,r,i,n):this.addDirectedEdgeWithKey(e,r,i,n)}),this;if(!isPlainObject(e))throw new n(`Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.`);if(e.attributes){if(!isPlainObject(e.attributes))throw new n(`Graph.import: invalid attributes. Expecting a plain object.`);t?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let r,i,a,o,s;if(e.nodes){if(a=e.nodes,!Array.isArray(a))throw new n(`Graph.import: invalid nodes. Expecting an array.`);for(r=0,i=a.length;r<i;r++){o=a[r],validateSerializedNode(o);let{key:e,attributes:n}=o;t?this.mergeNode(e,n):this.addNode(e,n)}}if(e.edges){let o=!1;if(this.type===`undirected`&&(o=!0),a=e.edges,!Array.isArray(a))throw new n(`Graph.import: invalid edges. Expecting an array.`);for(r=0,i=a.length;r<i;r++){s=a[r],validateSerializedEdge(s);let{source:e,target:n,attributes:i,undirected:c=o}=s,l;`key`in s?(l=t?c?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:c?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,l.call(this,s.key,e,n,i)):(l=t?c?this.mergeUndirectedEdge:this.mergeDirectedEdge:c?this.addUndirectedEdge:this.addDirectedEdge,l.call(this,e,n,i))}}return this}nullCopy(e){let n=new Graph(t({},this._options,e));return n.replaceAttributes(t({},this.getAttributes())),n}emptyCopy(e){let n=this.nullCopy(e);return this._nodes.forEach((e,r)=>{let i=t({},e.attributes);e=new n.NodeDataClass(r,i),n._nodes.set(r,e)}),n}copy(e){if(e||={},typeof e.type==`string`&&e.type!==this.type&&e.type!==`mixed`)throw new i(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi==`boolean`&&e.multi!==this.multi&&e.multi!==!0)throw new i(`Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.`);if(typeof e.allowSelfLoops==`boolean`&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new i(`Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.`);let n=this.emptyCopy(e),r=this._edges.values(),a,o;for(;a=r.next(),a.done!==!0;)o=a.value,addEdge(n,`copy`,!1,o.undirected,o.key,o.source.key,o.target.key,t({},o.attributes));return n}toJSON(){return this.export()}toString(){return`[object Graph]`}inspect(){let e={};this._nodes.forEach((t,n)=>{e[n]=t.attributes});let t={},n={};this._edges.forEach((e,r)=>{let i=e.undirected?`--`:`->`,a=``,o=e.source.key,s=e.target.key,c;e.undirected&&o>s&&(c=o,o=s,s=c);let l=`(${o})${i}(${s})`;r.startsWith(`geid_`)?this.multi&&(n[l]===void 0?n[l]=0:n[l]++,a+=`${n[l]}. `):a+=`[${r}]: `,a+=l,t[a]=e.attributes});let r={};for(let e in this)this.hasOwnProperty(e)&&!d.has(e)&&typeof this[e]!=`function`&&typeof e!=`symbol`&&(r[e]=this[e]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,privateProperty(r,`constructor`,this.constructor),r}};typeof Symbol<`u`&&(m.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=m.prototype.inspect),f.forEach(e=>{[`add`,`merge`,`update`].forEach(t=>{let n=e.name(t),r=t===`add`?addEdge:mergeEdge;e.generateKey?m.prototype[n]=function(i,a,o){return r(this,n,!0,(e.type||this.type)===`undirected`,null,i,a,o,t===`update`)}:m.prototype[n]=function(i,a,o,s){return r(this,n,!1,(e.type||this.type)===`undirected`,i,a,o,s,t===`update`)}})}),attachNodeAttributesMethods(m),attachEdgeAttributesMethods(m),attachEdgeIterationMethods(m),attachNeighborIterationMethods(m);var DirectedGraph=class extends m{constructor(e){let r=t({type:`directed`},e);if(`multi`in r&&r.multi!==!1)throw new n(`DirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(r.type!==`directed`)throw new n(`DirectedGraph.from: inconsistent "`+r.type+`" type in given options!`);super(r)}},UndirectedGraph=class extends m{constructor(e){let r=t({type:`undirected`},e);if(`multi`in r&&r.multi!==!1)throw new n(`UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(r.type!==`undirected`)throw new n(`UndirectedGraph.from: inconsistent "`+r.type+`" type in given options!`);super(r)}},MultiGraph=class extends m{constructor(e){let r=t({multi:!0},e);if(`multi`in r&&r.multi!==!0)throw new n(`MultiGraph.from: inconsistent indication that the graph should be simple in given options!`);super(r)}},MultiDirectedGraph=class extends m{constructor(e){let r=t({type:`directed`,multi:!0},e);if(`multi`in r&&r.multi!==!0)throw new n(`MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(r.type!==`directed`)throw new n(`MultiDirectedGraph.from: inconsistent "`+r.type+`" type in given options!`);super(r)}},MultiUndirectedGraph=class extends m{constructor(e){let r=t({type:`undirected`,multi:!0},e);if(`multi`in r&&r.multi!==!0)throw new n(`MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(r.type!==`undirected`)throw new n(`MultiUndirectedGraph.from: inconsistent "`+r.type+`" type in given options!`);super(r)}};function attachStaticFromMethod(e){e.from=function(n,r){let i=new e(t({},n.options,r));return i.import(n),i}}attachStaticFromMethod(m),attachStaticFromMethod(DirectedGraph),attachStaticFromMethod(UndirectedGraph),attachStaticFromMethod(MultiGraph),attachStaticFromMethod(MultiDirectedGraph),attachStaticFromMethod(MultiUndirectedGraph),m.Graph=m,m.DirectedGraph=DirectedGraph,m.UndirectedGraph=UndirectedGraph,m.MultiGraph=MultiGraph,m.MultiDirectedGraph=MultiDirectedGraph,m.MultiUndirectedGraph=MultiUndirectedGraph,m.InvalidArgumentsGraphError=n,m.NotFoundGraphError=r,m.UsageGraphError=i;export{m as t};
@@ -0,0 +1 @@
1
+ import"../rolldown-runtime.mjs";import{t as e}from"./@ungap/structured-clone.mjs";const t=point(`end`),n=point(`start`);function point(e){return point;function point(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function position(e){let r=n(e),i=t(e);if(r&&i)return{start:r,end:i}}const r=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],i={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...r,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...r],h2:[[`className`,`sr-only`]],img:[...r,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...r,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...r],table:[...r],ul:[...r,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},a={}.hasOwnProperty;function sanitize(e,t){let n={type:`root`,children:[]},r=transform({schema:t?{...i,...t}:i,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function transform(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return comment(e,n);case`doctype`:return doctype(e,n);case`element`:return element(e,n);case`root`:return root(e,n);case`text`:return text(e,n);default:}}}function comment(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return patch(r,t),r}}function doctype(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return patch(e,t),e}}function element(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=children(e,t.children),i=properties(e,t.properties);e.stack.pop();let o=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(o=!0,e.schema.ancestors&&a.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(o=!1;++r<t.length;)e.stack.includes(t[r])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let s={type:`element`,tagName:n,properties:i,children:r};return patch(s,t),s}function root(e,t){let n={type:`root`,children:children(e,t.children)};return patch(n,t),n}function text(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return patch(n,t),n}function children(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=transform(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function properties(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,o=r&&a.call(r,n)?r[n]:void 0,s=r&&a.call(r,`*`)?r[`*`]:void 0,c=t&&typeof t==`object`?t:{},l={},u;for(u in c)if(a.call(c,u)){let t=c[u],n=propertyValue(e,findDefinition(o,u),u,t);n??=propertyValue(e,findDefinition(s,u),u,t),n!=null&&(l[u]=n)}if(i&&a.call(i,n)){let e=i[n];for(u in e)a.call(e,u)&&!a.call(l,u)&&(l[u]=e[u])}return l}function propertyValue(e,t,n,r){return t?Array.isArray(r)?propertyValueMany(e,t,n,r):propertyValuePrimitive(e,t,n,r):void 0}function propertyValueMany(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=propertyValuePrimitive(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function propertyValuePrimitive(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&safeProtocol(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function safeProtocol(e,t,n){let r=e.schema.protocols&&a.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),o=i.indexOf(`:`),s=i.indexOf(`?`),c=i.indexOf(`#`),l=i.indexOf(`/`);if(o<0||l>-1&&o>l||s>-1&&o>s||c>-1&&o>c)return!0;let u=-1;for(;++u<r.length;){let e=r[u];if(o===e.length&&i.slice(0,e.length)===e)return!0}return!1}function patch(t,n){let r=position(n);n.data&&(t.data=e(n.data)),r&&(t.position=r)}function findDefinition(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}export{position as a,n as i,i as n,t as r,sanitize as t};
@@ -0,0 +1,9 @@
1
+ import{i as e,r as t}from"../rolldown-runtime.mjs";import{t as n}from"./character-entities-legacy.mjs";import{t as r}from"./character-entities-html4.mjs";import{t as i}from"./ccount.mjs";import{t as a}from"./comma-separated-tokens.mjs";const o=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`];var Schema=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Schema.prototype.normal={},Schema.prototype.property={},Schema.prototype.space=void 0;function merge(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Schema(n,r,t)}function normalize(e){return e.toLowerCase()}var Info=class{constructor(e,t){this.attribute=t,this.property=e}};Info.prototype.attribute=``,Info.prototype.booleanish=!1,Info.prototype.boolean=!1,Info.prototype.commaOrSpaceSeparated=!1,Info.prototype.commaSeparated=!1,Info.prototype.defined=!1,Info.prototype.mustUseProperty=!1,Info.prototype.number=!1,Info.prototype.overloadedBoolean=!1,Info.prototype.property=``,Info.prototype.spaceSeparated=!1,Info.prototype.space=void 0;var s=t({boolean:()=>l,booleanish:()=>u,commaOrSpaceSeparated:()=>g,commaSeparated:()=>h,number:()=>f,overloadedBoolean:()=>d,spaceSeparated:()=>m});let c=0;const l=increment(),u=increment(),d=increment(),f=increment(),m=increment(),h=increment(),g=increment();function increment(){return 2**++c}const _=Object.keys(s);var DefinedInfo=class extends Info{constructor(e,t,n,r){let i=-1;if(super(e,t),mark(this,`space`,r),typeof n==`number`)for(;++i<_.length;){let e=_[i];mark(this,_[i],(n&s[e])===s[e])}}};DefinedInfo.prototype.defined=!0;function mark(e,t,n){n&&(e[t]=n)}function create(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new DefinedInfo(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[normalize(r)]=r,n[normalize(a.attribute)]=r}return new Schema(t,n,e.space)}const v=create({properties:{ariaActiveDescendant:null,ariaAtomic:u,ariaAutoComplete:null,ariaBusy:u,ariaChecked:u,ariaColCount:f,ariaColIndex:f,ariaColSpan:f,ariaControls:m,ariaCurrent:null,ariaDescribedBy:m,ariaDetails:null,ariaDisabled:u,ariaDropEffect:m,ariaErrorMessage:null,ariaExpanded:u,ariaFlowTo:m,ariaGrabbed:u,ariaHasPopup:null,ariaHidden:u,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:m,ariaLevel:f,ariaLive:null,ariaModal:u,ariaMultiLine:u,ariaMultiSelectable:u,ariaOrientation:null,ariaOwns:m,ariaPlaceholder:null,ariaPosInSet:f,ariaPressed:u,ariaReadOnly:u,ariaRelevant:null,ariaRequired:u,ariaRoleDescription:m,ariaRowCount:f,ariaRowIndex:f,ariaRowSpan:f,ariaSelected:u,ariaSetSize:f,ariaSort:null,ariaValueMax:f,ariaValueMin:f,ariaValueNow:f,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function caseSensitiveTransform(e,t){return t in e?e[t]:t}function caseInsensitiveTransform(e,t){return caseSensitiveTransform(e,t.toLowerCase())}const y=create({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:h,acceptCharset:m,accessKey:m,action:null,allow:null,allowFullScreen:l,allowPaymentRequest:l,allowUserMedia:l,alt:null,as:null,async:l,autoCapitalize:null,autoComplete:m,autoFocus:l,autoPlay:l,blocking:m,capture:null,charSet:null,checked:l,cite:null,className:m,cols:f,colSpan:null,content:null,contentEditable:u,controls:l,controlsList:m,coords:f|h,crossOrigin:null,data:null,dateTime:null,decoding:null,default:l,defer:l,dir:null,dirName:null,disabled:l,download:d,draggable:u,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:l,formTarget:null,headers:m,height:f,hidden:l,high:f,href:null,hrefLang:null,htmlFor:m,httpEquiv:m,id:null,imageSizes:null,imageSrcSet:null,inert:l,inputMode:null,integrity:null,is:null,isMap:l,itemId:null,itemProp:m,itemRef:m,itemScope:l,itemType:m,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:l,low:f,manifest:null,max:null,maxLength:f,media:null,method:null,min:null,minLength:f,multiple:l,muted:l,name:null,nonce:null,noModule:l,noValidate:l,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:l,optimum:f,pattern:null,ping:m,placeholder:null,playsInline:l,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:l,referrerPolicy:null,rel:m,required:l,reversed:l,rows:f,rowSpan:f,sandbox:m,scope:null,scoped:l,seamless:l,selected:l,shadowRootClonable:l,shadowRootDelegatesFocus:l,shadowRootMode:null,shape:null,size:f,sizes:null,slot:null,span:f,spellCheck:u,src:null,srcDoc:null,srcLang:null,srcSet:null,start:f,step:null,style:null,tabIndex:f,target:null,title:null,translate:null,type:null,typeMustMatch:l,useMap:null,value:u,width:f,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:m,axis:null,background:null,bgColor:null,border:f,borderColor:null,bottomMargin:f,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:l,declare:l,event:null,face:null,frame:null,frameBorder:null,hSpace:f,leftMargin:f,link:null,longDesc:null,lowSrc:null,marginHeight:f,marginWidth:f,noResize:l,noHref:l,noShade:l,noWrap:l,object:null,profile:null,prompt:null,rev:null,rightMargin:f,rules:null,scheme:null,scrolling:u,standby:null,summary:null,text:null,topMargin:f,valueType:null,version:null,vAlign:null,vLink:null,vSpace:f,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:l,disableRemotePlayback:l,prefix:null,property:null,results:f,security:null,unselectable:null},space:`html`,transform:caseInsensitiveTransform}),b=create({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:g,accentHeight:f,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:f,amplitude:f,arabicForm:null,ascent:f,attributeName:null,attributeType:null,azimuth:f,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:f,by:null,calcMode:null,capHeight:f,className:m,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:f,diffuseConstant:f,direction:null,display:null,dur:null,divisor:f,dominantBaseline:null,download:l,dx:null,dy:null,edgeMode:null,editable:null,elevation:f,enableBackground:null,end:null,event:null,exponent:f,externalResourcesRequired:null,fill:null,fillOpacity:f,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:h,g2:h,glyphName:h,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:f,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:f,horizOriginX:f,horizOriginY:f,id:null,ideographic:f,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:f,k:f,k1:f,k2:f,k3:f,k4:f,kernelMatrix:g,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:f,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:f,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:f,overlineThickness:f,paintOrder:null,panose1:null,path:null,pathLength:f,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:m,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:f,pointsAtY:f,pointsAtZ:f,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:g,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:g,rev:g,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:g,requiredFeatures:g,requiredFonts:g,requiredFormats:g,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:f,specularExponent:f,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:f,strikethroughThickness:f,string:null,stroke:null,strokeDashArray:g,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:f,strokeOpacity:f,strokeWidth:null,style:null,surfaceScale:f,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:g,tabIndex:f,tableValues:null,target:null,targetX:f,targetY:f,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:g,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:f,underlineThickness:f,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:f,values:null,vAlphabetic:f,vMathematical:f,vectorEffect:null,vHanging:f,vIdeographic:f,version:null,vertAdvY:f,vertOriginX:f,vertOriginY:f,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:f,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:caseSensitiveTransform}),x=create({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),S=create({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:caseInsensitiveTransform}),C=create({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),w=/[A-Z]/g,T=/-[a-z]/g,E=/^data[-\w.:]+$/i;function find(e,t){let n=normalize(t),r=t,i=Info;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&E.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(T,camelcase);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!T.test(e)){let n=e.replace(w,kebab);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=DefinedInfo}return new i(r,t)}function kebab(e){return`-`+e.toLowerCase()}function camelcase(e){return e.charAt(1).toUpperCase()}const D=merge([v,y,x,S,C],`html`),O=merge([v,b,x,S,C],`svg`),k={}.hasOwnProperty;function zwitch(e,t){let n=t||{};function one(t,...n){let r=one.invalid,i=one.handlers;if(t&&k.call(t,e)){let n=String(t[e]);r=k.call(i,n)?i[n]:one.unknown}if(r)return r.call(this,t,...n)}return one.handlers=n.handlers||{},one.invalid=n.invalid,one.unknown=n.unknown,one}const A=/["&'<>`]/g,j=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,M=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,N=/[|\\{}()[\]^$+*?.]/g,P=new WeakMap;function core(e,t){if(e=e.replace(t.subset?charactersToExpressionCached(t.subset):A,basic),t.subset||t.escapeOnly)return e;return e.replace(j,surrogate).replace(M,basic);function surrogate(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function basic(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function charactersToExpressionCached(e){let t=P.get(e);return t||(t=charactersToExpression(e),P.set(e,t)),t}function charactersToExpression(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(N,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}const F=/[\dA-Fa-f]/;function toHexadecimal(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!F.test(String.fromCharCode(t))?r:r+`;`}const I=/\d/;function toDecimal(e,t,n){let r=`&#`+String(e);return n&&t&&!I.test(String.fromCharCode(t))?r:r+`;`}const L=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],R={}.hasOwnProperty,z={};let B;for(B in r)R.call(r,B)&&(z[r[B]]=B);const V=/[^\dA-Za-z]/;function toNamed(e,t,r,i){let a=String.fromCharCode(e);if(R.call(z,a)){let e=z[a],o=`&`+e;return r&&n.includes(e)&&!L.includes(e)&&(!i||t&&t!==61&&V.test(String.fromCharCode(t)))?o:o+`;`}return``}function formatSmart(e,t,n){let r=toHexadecimal(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=toNamed(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=toDecimal(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function stringifyEntities(e,t){return core(e,Object.assign({format:formatSmart},t))}const H=/^>|^->|<!--|-->|--!>|<!-$/g,U=[`>`],W=[`<`,`>`];function comment(e,t,n,r){return r.settings.bogusComments?`<?`+stringifyEntities(e.value,Object.assign({},r.settings.characterReferences,{subset:U}))+`>`:`<!--`+e.value.replace(H,encode)+`-->`;function encode(e){return stringifyEntities(e,Object.assign({},r.settings.characterReferences,{subset:W}))}}function doctype(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function stringify(e){return e.join(` `).trim()}const G=/[ \t\n\f\r]/g;function whitespace(e){return typeof e==`object`?e.type===`text`?empty(e.value):!1:empty(e)}function empty(e){return e.replace(G,``)===``}const K=siblings(1),q=siblings(-1),J=[];function siblings(e){return sibling;function sibling(t,n,r){let i=t?t.children:J,a=(n||0)+e,o=i[a];if(!r)for(;o&&whitespace(o);)a+=e,o=i[a];return o}}const Y={}.hasOwnProperty;function omission(e){return omit;function omit(t,n,r){return Y.call(e,t.tagName)&&e[t.tagName](t,n,r)}}const X=omission({body:body$1,caption:headOrColgroupOrCaption,colgroup:headOrColgroupOrCaption,dd,dt,head:headOrColgroupOrCaption,html:html$1,li,optgroup,option,p,rp:rubyElement,rt:rubyElement,tbody:tbody$1,td:cells,tfoot,th:cells,thead,tr});function headOrColgroupOrCaption(e,t,n){let r=K(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&whitespace(r.value.charAt(0)))}function html$1(e,t,n){let r=K(n,t);return!r||r.type!==`comment`}e(html$1,`html`);function body$1(e,t,n){let r=K(n,t);return!r||r.type!==`comment`}e(body$1,`body`);function p(e,t,n){let r=K(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function li(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`li`}function dt(e,t,n){let r=K(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function dd(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function rubyElement(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function optgroup(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function option(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function thead(e,t,n){let r=K(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function tbody$1(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}e(tbody$1,`tbody`);function tfoot(e,t,n){return!K(n,t)}function tr(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function cells(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}const Z=omission({body,colgroup,head,html,tbody});function html(e){let t=K(e,-1);return!t||t.type!==`comment`}function head(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function body(e){let t=K(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&whitespace(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function colgroup(e,t,n){let r=q(n,t),i=K(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&X(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function tbody(e,t,n){let r=q(n,t),i=K(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&X(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}const Q={name:[[`
2
+ \f\r &/=>`.split(``),`
3
+ \f\r "&'/=>\``.split(``)],[`\0
4
+ \f\r "&'/<=>`.split(``),`\0
5
+ \f\r "&'/<=>\``.split(``)]],unquoted:[[`
6
+ \f\r &>`.split(``),`\0
7
+ \f\r "&'<=>\``.split(``)],[`\0
8
+ \f\r "&'<=>\``.split(``),`\0
9
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function element(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=O);let l=serializeAttributes(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Z(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!X(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function serializeAttributes(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=serializeAttribute(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function serializeAttribute(e,t,n){let r=find(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,s=+!e.settings.allowDangerousCharacters,c=e.quote,l;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let u=stringifyEntities(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Q.name[o][s]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?a:stringify)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?u:(e.settings.preferUnquoted&&(l=stringifyEntities(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Q.unquoted[o][s]}))),l!==n&&(e.settings.quoteSmart&&i(n,c)>i(n,e.alternative)&&(c=e.alternative),l=c+stringifyEntities(n,Object.assign({},e.settings.characterReferences,{subset:(c===`'`?Q.single:Q.double)[o][s],attribute:!0}))+c),u+(l&&`=`+l))}const $=[`<`,`&`];function text(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:stringifyEntities(e.value,Object.assign({},r.settings.characterReferences,{subset:$}))}function raw(e,t,n,r){return r.settings.allowDangerousHtml?e.value:text(e,t,n,r)}function root(e,t,n,r){return r.all(e)}const ee=zwitch(`type`,{invalid,unknown,handlers:{comment,doctype,element,raw,root,text}});function invalid(e){throw Error("Expected node, not `"+e+"`")}function unknown(e){throw Error("Cannot compile unknown node `"+e.type+"`")}const te={},ne={},re=[];function toHtml(e,t){let n=t||te,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one,all,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||o,characterReferences:n.characterReferences||ne,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?O:D,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function one(e,t,n){return ee(e,t,n,this)}function all(e){let t=[],n=e&&e.children||re,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}export{toHtml as t};
@@ -0,0 +1 @@
1
+ import"../rolldown-runtime.mjs";import{a as e,i as t}from"./@hono/mcp.mjs";var compose=(e,t,n)=>(r,i)=>{let a=-1;return dispatch(0);async function dispatch(o){if(o<=a)throw Error(`next() called multiple times`);a=o;let s,c=!1,l;if(e[o]?(l=e[o][0][0],r.req.routeIndex=o):l=o===e.length&&i||void 0,l)try{s=await l(r,()=>dispatch(o+1))}catch(e){if(e instanceof Error&&t)r.error=e,s=await t(e,r),c=!0;else throw e}else r.finalized===!1&&n&&(s=await n(r));return s&&(r.finalized===!1||c)&&(r.res=s),r}},n=Symbol(),parseBody=async(e,t=Object.create(null))=>{let{all:n=!1,dot:r=!1}=t,i=(e instanceof HonoRequest?e.raw.headers:e.headers).get(`Content-Type`);return i?.startsWith(`multipart/form-data`)||i?.startsWith(`application/x-www-form-urlencoded`)?parseFormData(e,{all:n,dot:r}):{}};async function parseFormData(e,t){let n=await e.formData();return n?convertFormDataToBodyData(n,t):{}}function convertFormDataToBodyData(e,t){let n=Object.create(null);return e.forEach((e,r)=>{t.all||r.endsWith(`[]`)?handleParsingAllValues(n,r,e):n[r]=e}),t.dot&&Object.entries(n).forEach(([e,t])=>{e.includes(`.`)&&(handleParsingNestedValues(n,e,t),delete n[e])}),n}var handleParsingAllValues=(e,t,n)=>{e[t]===void 0?t.endsWith(`[]`)?e[t]=[n]:e[t]=n:Array.isArray(e[t])?e[t].push(n):e[t]=[e[t],n]},handleParsingNestedValues=(e,t,n)=>{if(/(?:^|\.)__proto__\./.test(t))return;let r=e,i=t.split(`.`);i.forEach((e,t)=>{t===i.length-1?r[e]=n:((!r[e]||typeof r[e]!=`object`||Array.isArray(r[e])||r[e]instanceof File)&&(r[e]=Object.create(null)),r=r[e])})},splitPath=e=>{let t=e.split(`/`);return t[0]===``&&t.shift(),t},splitRoutingPath=e=>{let{groups:t,path:n}=extractGroupsFromPath(e);return replaceGroupMarks(splitPath(n),t)},extractGroupsFromPath=e=>{let t=[];return e=e.replace(/\{[^}]+\}/g,(e,n)=>{let r=`@${n}`;return t.push([r,e]),r}),{groups:t,path:e}},replaceGroupMarks=(e,t)=>{for(let n=t.length-1;n>=0;n--){let[r]=t[n];for(let i=e.length-1;i>=0;i--)if(e[i].includes(r)){e[i]=e[i].replace(r,t[n][1]);break}}return e},r={},getPattern=(e,t)=>{if(e===`*`)return`*`;let n=e.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(n){let i=`${e}#${t}`;return r[i]||(n[2]?r[i]=t&&t[0]!==`:`&&t[0]!==`*`?[i,n[1],RegExp(`^${n[2]}(?=/${t})`)]:[e,n[1],RegExp(`^${n[2]}$`)]:r[i]=[e,n[1],!0]),r[i]}return null},tryDecode=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,e=>{try{return t(e)}catch{return e}})}},tryDecodeURI=e=>tryDecode(e,decodeURI),getPath=e=>{let t=e.url,n=t.indexOf(`/`,t.indexOf(`:`)+4),r=n;for(;r<t.length;r++){let e=t.charCodeAt(r);if(e===37){let e=t.indexOf(`?`,r),i=t.indexOf(`#`,r),a=e===-1?i===-1?void 0:i:i===-1?e:Math.min(e,i),o=t.slice(n,a);return tryDecodeURI(o.includes(`%25`)?o.replace(/%25/g,`%2525`):o)}else if(e===63||e===35)break}return t.slice(n,r)},getPathNoStrict=e=>{let t=getPath(e);return t.length>1&&t.at(-1)===`/`?t.slice(0,-1):t},mergePath=(e,t,...n)=>(n.length&&(t=mergePath(t,...n)),`${e?.[0]===`/`?``:`/`}${e}${t===`/`?``:`${e?.at(-1)===`/`?``:`/`}${t?.[0]===`/`?t.slice(1):t}`}`),checkOptionalParameter=e=>{if(e.charCodeAt(e.length-1)!==63||!e.includes(`:`))return null;let t=e.split(`/`),n=[],r=``;return t.forEach(e=>{if(e!==``&&!/\:/.test(e))r+=`/`+e;else if(/\:/.test(e))if(/\?/.test(e)){n.length===0&&r===``?n.push(`/`):n.push(r);let t=e.replace(`?`,``);r+=`/`+t,n.push(r)}else r+=`/`+e}),n.filter((e,t,n)=>n.indexOf(e)===t)},_decodeURI=e=>/[%+]/.test(e)?(e.indexOf(`+`)!==-1&&(e=e.replace(/\+/g,` `)),e.indexOf(`%`)===-1?e:tryDecode(e,a)):e,_getQueryParam=(e,t,n)=>{let r;if(!n&&t&&!/[%+]/.test(t)){let n=e.indexOf(`?`,8);if(n===-1)return;for(e.startsWith(t,n+1)||(n=e.indexOf(`&${t}`,n+1));n!==-1;){let r=e.charCodeAt(n+t.length+1);if(r===61){let r=n+t.length+2,i=e.indexOf(`&`,r);return _decodeURI(e.slice(r,i===-1?void 0:i))}else if(r==38||isNaN(r))return``;n=e.indexOf(`&${t}`,n+1)}if(r=/[%+]/.test(e),!r)return}let i={};r??=/[%+]/.test(e);let a=e.indexOf(`?`,8);for(;a!==-1;){let t=e.indexOf(`&`,a+1),o=e.indexOf(`=`,a);o>t&&t!==-1&&(o=-1);let s=e.slice(a+1,o===-1?t===-1?void 0:t:o);if(r&&(s=_decodeURI(s)),a=t,s===``)continue;let c;o===-1?c=``:(c=e.slice(o+1,t===-1?void 0:t),r&&(c=_decodeURI(c))),n?(i[s]&&Array.isArray(i[s])||(i[s]=[]),i[s].push(c)):i[s]??=c}return t?i[t]:i},i=_getQueryParam,getQueryParams=(e,t)=>_getQueryParam(e,t,!0),a=decodeURIComponent,tryDecodeURIComponent=e=>tryDecode(e,a),HonoRequest=class{raw;#e;#t;routeIndex=0;path;bodyCache={};constructor(e,t=`/`,n=[[]]){this.raw=e,this.path=t,this.#t=n,this.#e={}}param(e){return e?this.#n(e):this.#r()}#n(e){let t=this.#t[0][this.routeIndex][1][e],n=this.#i(t);return n&&/\%/.test(n)?tryDecodeURIComponent(n):n}#r(){let e={},t=Object.keys(this.#t[0][this.routeIndex][1]);for(let n of t){let t=this.#i(this.#t[0][this.routeIndex][1][n]);t!==void 0&&(e[n]=/\%/.test(t)?tryDecodeURIComponent(t):t)}return e}#i(e){return this.#t[1]?this.#t[1][e]:e}query(e){return i(this.url,e)}queries(e){return getQueryParams(this.url,e)}header(e){if(e)return this.raw.headers.get(e)??void 0;let t={};return this.raw.headers.forEach((e,n)=>{t[n]=e}),t}async parseBody(e){return parseBody(this,e)}#a=e=>{let{bodyCache:t,raw:n}=this,r=t[e];if(r)return r;let i=Object.keys(t)[0];return i?t[i].then(t=>(i===`json`&&(t=JSON.stringify(t)),new Response(t)[e]())):t[e]=n[e]()};json(){return this.#a(`text`).then(e=>JSON.parse(e))}text(){return this.#a(`text`)}arrayBuffer(){return this.#a(`arrayBuffer`)}blob(){return this.#a(`blob`)}formData(){return this.#a(`formData`)}addValidatedData(e,t){this.#e[e]=t}valid(e){return this.#e[e]}get url(){return this.raw.url}get method(){return this.raw.method}get[n](){return this.#t}get matchedRoutes(){return this.#t[0].map(([[,e]])=>e)}get routePath(){return this.#t[0].map(([[,e]])=>e)[this.routeIndex].path}},o=`text/plain; charset=UTF-8`,setDefaultContentType=(e,t)=>({"Content-Type":e,...t}),createResponseInstance=(e,t)=>new Response(e,t),Context=class{#e;#t;env={};#n;finalized=!1;error;#r;#i;#a;#o;#s;#c;#l;#u;#d;constructor(e,t){this.#e=e,t&&(this.#i=t.executionCtx,this.env=t.env,this.#c=t.notFoundHandler,this.#d=t.path,this.#u=t.matchResult)}get req(){return this.#t??=new HonoRequest(this.#e,this.#d,this.#u),this.#t}get event(){if(this.#i&&`respondWith`in this.#i)return this.#i;throw Error(`This context has no FetchEvent`)}get executionCtx(){if(this.#i)return this.#i;throw Error(`This context has no ExecutionContext`)}get res(){return this.#a||=createResponseInstance(null,{headers:this.#l??=new Headers})}set res(e){if(this.#a&&e){e=createResponseInstance(e.body,e);for(let[t,n]of this.#a.headers.entries())if(t!==`content-type`)if(t===`set-cookie`){let t=this.#a.headers.getSetCookie();e.headers.delete(`set-cookie`);for(let n of t)e.headers.append(`set-cookie`,n)}else e.headers.set(t,n)}this.#a=e,this.finalized=!0}render=(...e)=>(this.#s??=e=>this.html(e),this.#s(...e));setLayout=e=>this.#o=e;getLayout=()=>this.#o;setRenderer=e=>{this.#s=e};header=(e,t,n)=>{this.finalized&&(this.#a=createResponseInstance(this.#a.body,this.#a));let r=this.#a?this.#a.headers:this.#l??=new Headers;t===void 0?r.delete(e):n?.append?r.append(e,t):r.set(e,t)};status=e=>{this.#r=e};set=(e,t)=>{this.#n??=new Map,this.#n.set(e,t)};get=e=>this.#n?this.#n.get(e):void 0;get var(){return this.#n?Object.fromEntries(this.#n):{}}#f(e,t,n){let r=this.#a?new Headers(this.#a.headers):this.#l??new Headers;if(typeof t==`object`&&`headers`in t){let e=t.headers instanceof Headers?t.headers:new Headers(t.headers);for(let[t,n]of e)t.toLowerCase()===`set-cookie`?r.append(t,n):r.set(t,n)}if(n)for(let[e,t]of Object.entries(n))if(typeof t==`string`)r.set(e,t);else{r.delete(e);for(let n of t)r.append(e,n)}return createResponseInstance(e,{status:typeof t==`number`?t:t?.status??this.#r,headers:r})}newResponse=(...e)=>this.#f(...e);body=(e,t,n)=>this.#f(e,t,n);text=(e,t,n)=>!this.#l&&!this.#r&&!t&&!n&&!this.finalized?new Response(e):this.#f(e,t,setDefaultContentType(o,n));json=(e,t,n)=>this.#f(JSON.stringify(e),t,setDefaultContentType(`application/json`,n));html=(n,r,i)=>{let res=e=>this.#f(e,r,setDefaultContentType(`text/html; charset=UTF-8`,i));return typeof n==`object`?e(n,t.Stringify,!1,{}).then(res):res(n)};redirect=(e,t)=>{let n=String(e);return this.header(`Location`,/[^\x00-\xFF]/.test(n)?encodeURI(n):n),this.newResponse(null,t??302)};notFound=()=>(this.#c??=()=>createResponseInstance(),this.#c(this))},s=[`get`,`post`,`put`,`delete`,`options`,`patch`],c=`Can not add a route since the matcher is already built.`,UnsupportedPathError=class extends Error{},l=`__COMPOSED_HANDLER`,notFoundHandler=e=>e.text(`404 Not Found`,404),errorHandler=(e,t)=>{if(`getResponse`in e){let n=e.getResponse();return t.newResponse(n.body,n)}return console.error(e),t.text(`Internal Server Error`,500)},u=class _Hono{get;post;put;delete;options;patch;all;on;use;router;getPath;_basePath=`/`;#e=`/`;routes=[];constructor(e={}){[...s,`all`].forEach(e=>{this[e]=(t,...n)=>(typeof t==`string`?this.#e=t:this.#r(e,this.#e,t),n.forEach(t=>{this.#r(e,this.#e,t)}),this)}),this.on=(e,t,...n)=>{for(let r of[t].flat()){this.#e=r;for(let t of[e].flat())n.map(e=>{this.#r(t.toUpperCase(),this.#e,e)})}return this},this.use=(e,...t)=>(typeof e==`string`?this.#e=e:(this.#e=`*`,t.unshift(e)),t.forEach(e=>{this.#r(`ALL`,this.#e,e)}),this);let{strict:t,...n}=e;Object.assign(this,n),this.getPath=t??!0?e.getPath??getPath:getPathNoStrict}#t(){let e=new _Hono({router:this.router,getPath:this.getPath});return e.errorHandler=this.errorHandler,e.#n=this.#n,e.routes=this.routes,e}#n=notFoundHandler;errorHandler=errorHandler;route(e,t){let n=this.basePath(e);return t.routes.map(e=>{let handler;t.errorHandler===errorHandler?handler=e.handler:(handler=async(n,r)=>(await compose([],t.errorHandler)(n,()=>e.handler(n,r))).res,handler[l]=e.handler),n.#r(e.method,e.path,handler)}),this}basePath(e){let t=this.#t();return t._basePath=mergePath(this._basePath,e),t}onError=e=>(this.errorHandler=e,this);notFound=e=>(this.#n=e,this);mount(e,t,n){let r,i;n&&(typeof n==`function`?i=n:(i=n.optionHandler,r=n.replaceRequest===!1?e=>e:n.replaceRequest));let a=i?e=>{let t=i(e);return Array.isArray(t)?t:[t]}:e=>{let t;try{t=e.executionCtx}catch{}return[e.env,t]};r||=(()=>{let t=mergePath(this._basePath,e),n=t===`/`?0:t.length;return e=>{let t=new URL(e.url);return t.pathname=t.pathname.slice(n)||`/`,new Request(t,e)}})();let handler=async(e,n)=>{let i=await t(r(e.req.raw),...a(e));if(i)return i;await n()};return this.#r(`ALL`,mergePath(e,`*`),handler),this}#r(e,t,n){e=e.toUpperCase(),t=mergePath(this._basePath,t);let r={basePath:this._basePath,path:t,method:e,handler:n};this.router.add(e,t,[n,r]),this.routes.push(r)}#i(e,t){if(e instanceof Error)return this.errorHandler(e,t);throw e}#a(e,t,n,r){if(r===`HEAD`)return(async()=>new Response(null,await this.#a(e,t,n,`GET`)))();let i=this.getPath(e,{env:n}),a=this.router.match(r,i),o=new Context(e,{path:i,matchResult:a,env:n,executionCtx:t,notFoundHandler:this.#n});if(a[0].length===1){let e;try{e=a[0][0][0][0](o,async()=>{o.res=await this.#n(o)})}catch(e){return this.#i(e,o)}return e instanceof Promise?e.then(e=>e||(o.finalized?o.res:this.#n(o))).catch(e=>this.#i(e,o)):e??this.#n(o)}let s=compose(a[0],this.errorHandler,this.#n);return(async()=>{try{let e=await s(o);if(!e.finalized)throw Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return e.res}catch(e){return this.#i(e,o)}})()}fetch=(e,...t)=>this.#a(e,t[1],t[0],e.method);request=(e,t,n,r)=>e instanceof Request?this.fetch(t?new Request(e,t):e,n,r):(e=e.toString(),this.fetch(new Request(/^https?:\/\//.test(e)?e:`http://localhost${mergePath(`/`,e)}`,t),n,r));fire=()=>{addEventListener(`fetch`,e=>{e.respondWith(this.#a(e.request,e,void 0,e.request.method))})}},d=[];function match(e,t){let n=this.buildAllMatchers(),match2=((e,t)=>{let r=n[e]||n.ALL,i=r[2][t];if(i)return i;let a=t.match(r[0]);if(!a)return[[],d];let o=a.indexOf(``,1);return[r[1][o],a]});return this.match=match2,match2(e,t)}var f=`[^/]+`,p=`.*`,m=`(?:|/.*)`,h=Symbol(),g=new Set(`.\\+*[^]$()`);function compareKey(e,t){return e.length===1?t.length===1?e<t?-1:1:-1:t.length===1||e===p||e===m?1:t===p||t===m?-1:e===f?1:t===f?-1:e.length===t.length?e<t?-1:1:t.length-e.length}var _=class _Node{#e;#t;#n=Object.create(null);insert(e,t,n,r,i){if(e.length===0){if(this.#e!==void 0)throw h;if(i)return;this.#e=t;return}let[a,...o]=e,s=a===`*`?o.length===0?[``,``,p]:[``,``,f]:a===`/*`?[``,``,m]:a.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/),c;if(s){let e=s[1],t=s[2]||f;if(e&&s[2]&&(t===`.*`||(t=t.replace(/^\((?!\?:)(?=[^)]+\)$)/,`(?:`),/\((?!\?:)/.test(t))))throw h;if(c=this.#n[t],!c){if(Object.keys(this.#n).some(e=>e!==p&&e!==m))throw h;if(i)return;c=this.#n[t]=new _Node,e!==``&&(c.#t=r.varIndex++)}!i&&e!==``&&n.push([e,c.#t])}else if(c=this.#n[a],!c){if(Object.keys(this.#n).some(e=>e.length>1&&e!==p&&e!==m))throw h;if(i)return;c=this.#n[a]=new _Node}c.insert(o,t,n,r,i)}buildRegExpStr(){let e=Object.keys(this.#n).sort(compareKey).map(e=>{let t=this.#n[e];return(typeof t.#t==`number`?`(${e})@${t.#t}`:g.has(e)?`\\${e}`:e)+t.buildRegExpStr()});return typeof this.#e==`number`&&e.unshift(`#${this.#e}`),e.length===0?``:e.length===1?e[0]:`(?:`+e.join(`|`)+`)`}},Trie=class{#e={varIndex:0};#t=new _;insert(e,t,n){let r=[],i=[];for(let t=0;;){let n=!1;if(e=e.replace(/\{[^}]+\}/g,e=>{let r=`@\\${t}`;return i[t]=[r,e],t++,n=!0,r}),!n)break}let a=e.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let e=i.length-1;e>=0;e--){let[t]=i[e];for(let n=a.length-1;n>=0;n--)if(a[n].indexOf(t)!==-1){a[n]=a[n].replace(t,i[e][1]);break}}return this.#t.insert(a,t,r,this.#e,n),r}buildRegExp(){let e=this.#t.buildRegExpStr();if(e===``)return[/^$/,[],[]];let t=0,n=[],r=[];return e=e.replace(/#(\d+)|@(\d+)|\.\*\$/g,(e,i,a)=>i===void 0?(a===void 0||(r[Number(a)]=++t),``):(n[++t]=Number(i),`$()`)),[RegExp(`^${e}`),n,r]}},v=[/^$/,[],Object.create(null)],y=Object.create(null);function buildWildcardRegExp(e){return y[e]??=RegExp(e===`*`?``:`^${e.replace(/\/\*$|([.\\+*[^\]$()])/g,(e,t)=>t?`\\${t}`:`(?:|/.*)`)}$`)}function clearWildcardRegExpCache(){y=Object.create(null)}function buildMatcherFromPreprocessedRoutes(e){let t=new Trie,n=[];if(e.length===0)return v;let r=e.map(e=>[!/\*|\/:/.test(e[0]),...e]).sort(([e,t],[n,r])=>e?1:n?-1:t.length-r.length),i=Object.create(null);for(let e=0,a=-1,o=r.length;e<o;e++){let[o,s,c]=r[e];o?i[s]=[c.map(([e])=>[e,Object.create(null)]),d]:a++;let l;try{l=t.insert(s,a,o)}catch(e){throw e===h?new UnsupportedPathError(s):e}o||(n[a]=c.map(([e,t])=>{let n=Object.create(null);for(--t;t>=0;t--){let[e,r]=l[t];n[e]=r}return[e,n]}))}let[a,o,s]=t.buildRegExp();for(let e=0,t=n.length;e<t;e++)for(let t=0,r=n[e].length;t<r;t++){let r=n[e][t]?.[1];if(!r)continue;let i=Object.keys(r);for(let e=0,t=i.length;e<t;e++)r[i[e]]=s[r[i[e]]]}let c=[];for(let e in o)c[e]=n[o[e]];return[a,c,i]}function findMiddleware(e,t){if(e){for(let n of Object.keys(e).sort((e,t)=>t.length-e.length))if(buildWildcardRegExp(n).test(t))return[...e[n]]}}var RegExpRouter=class{name=`RegExpRouter`;#e;#t;constructor(){this.#e={ALL:Object.create(null)},this.#t={ALL:Object.create(null)}}add(e,t,n){let r=this.#e,i=this.#t;if(!r||!i)throw Error(c);r[e]||[r,i].forEach(t=>{t[e]=Object.create(null),Object.keys(t.ALL).forEach(n=>{t[e][n]=[...t.ALL[n]]})}),t===`/*`&&(t=`*`);let a=(t.match(/\/:/g)||[]).length;if(/\*$/.test(t)){let o=buildWildcardRegExp(t);e===`ALL`?Object.keys(r).forEach(e=>{r[e][t]||=findMiddleware(r[e],t)||findMiddleware(r.ALL,t)||[]}):r[e][t]||=findMiddleware(r[e],t)||findMiddleware(r.ALL,t)||[],Object.keys(r).forEach(t=>{(e===`ALL`||e===t)&&Object.keys(r[t]).forEach(e=>{o.test(e)&&r[t][e].push([n,a])})}),Object.keys(i).forEach(t=>{(e===`ALL`||e===t)&&Object.keys(i[t]).forEach(e=>o.test(e)&&i[t][e].push([n,a]))});return}let o=checkOptionalParameter(t)||[t];for(let t=0,s=o.length;t<s;t++){let c=o[t];Object.keys(i).forEach(o=>{(e===`ALL`||e===o)&&(i[o][c]||=[...findMiddleware(r[o],c)||findMiddleware(r.ALL,c)||[]],i[o][c].push([n,a-s+t+1]))})}}match=match;buildAllMatchers(){let e=Object.create(null);return Object.keys(this.#t).concat(Object.keys(this.#e)).forEach(t=>{e[t]||=this.#n(t)}),this.#e=this.#t=void 0,clearWildcardRegExpCache(),e}#n(e){let t=[],n=e===`ALL`;return[this.#e,this.#t].forEach(r=>{let i=r[e]?Object.keys(r[e]).map(t=>[t,r[e][t]]):[];i.length===0?e!==`ALL`&&t.push(...Object.keys(r.ALL).map(e=>[e,r.ALL[e]])):(n||=!0,t.push(...i))}),n?buildMatcherFromPreprocessedRoutes(t):null}},SmartRouter=class{name=`SmartRouter`;#e=[];#t=[];constructor(e){this.#e=e.routers}add(e,t,n){if(!this.#t)throw Error(c);this.#t.push([e,t,n])}match(e,t){if(!this.#t)throw Error(`Fatal error`);let n=this.#e,r=this.#t,i=n.length,a=0,o;for(;a<i;a++){let i=n[a];try{for(let e=0,t=r.length;e<t;e++)i.add(...r[e]);o=i.match(e,t)}catch(e){if(e instanceof UnsupportedPathError)continue;throw e}this.match=i.match.bind(i),this.#e=[i],this.#t=void 0;break}if(a===i)throw Error(`Fatal error`);return this.name=`SmartRouter + ${this.activeRouter.name}`,o}get activeRouter(){if(this.#t||this.#e.length!==1)throw Error(`No active router has been determined yet.`);return this.#e[0]}},b=Object.create(null),hasChildren=e=>{for(let t in e)return!0;return!1},x=class _Node{#e;#t;#n;#r=0;#i=b;constructor(e,t,n){if(this.#t=n||Object.create(null),this.#e=[],e&&t){let n=Object.create(null);n[e]={handler:t,possibleKeys:[],score:0},this.#e=[n]}this.#n=[]}insert(e,t,n){this.#r=++this.#r;let r=this,i=splitRoutingPath(t),a=[];for(let e=0,t=i.length;e<t;e++){let t=i[e],n=i[e+1],o=getPattern(t,n),s=Array.isArray(o)?o[0]:t;if(s in r.#t){r=r.#t[s],o&&a.push(o[1]);continue}r.#t[s]=new _Node,o&&(r.#n.push(o),a.push(o[1])),r=r.#t[s]}return r.#e.push({[e]:{handler:n,possibleKeys:a.filter((e,t,n)=>n.indexOf(e)===t),score:this.#r}}),r}#a(e,t,n,r,i){for(let a=0,o=t.#e.length;a<o;a++){let o=t.#e[a],s=o[n]||o.ALL,c={};if(s!==void 0&&(s.params=Object.create(null),e.push(s),r!==b||i&&i!==b))for(let e=0,t=s.possibleKeys.length;e<t;e++){let t=s.possibleKeys[e],n=c[s.score];s.params[t]=i?.[t]&&!n?i[t]:r[t]??i?.[t],c[s.score]=!0}}}search(e,t){let n=[];this.#i=b;let r=[this],i=splitPath(t),a=[],o=i.length,s=null;for(let c=0;c<o;c++){let l=i[c],u=c===o-1,d=[];for(let f=0,p=r.length;f<p;f++){let p=r[f],m=p.#t[l];m&&(m.#i=p.#i,u?(m.#t[`*`]&&this.#a(n,m.#t[`*`],e,p.#i),this.#a(n,m,e,p.#i)):d.push(m));for(let r=0,f=p.#n.length;r<f;r++){let f=p.#n[r],m=p.#i===b?{}:{...p.#i};if(f===`*`){let t=p.#t[`*`];t&&(this.#a(n,t,e,p.#i),t.#i=m,d.push(t));continue}let[h,g,_]=f;if(!l&&!(_ instanceof RegExp))continue;let v=p.#t[h];if(_ instanceof RegExp){if(s===null){s=Array(o);let e=+(t[0]===`/`);for(let t=0;t<o;t++)s[t]=e,e+=i[t].length+1}let r=t.substring(s[c]),l=_.exec(r);if(l){if(m[g]=l[0],this.#a(n,v,e,p.#i,m),hasChildren(v.#t)){v.#i=m;let e=l[0].match(/\//)?.length??0;(a[e]||=[]).push(v)}continue}}(_===!0||_.test(l))&&(m[g]=l,u?(this.#a(n,v,e,m,p.#i),v.#t[`*`]&&this.#a(n,v.#t[`*`],e,m,p.#i)):(v.#i=m,d.push(v)))}}let f=a.shift();r=f?d.concat(f):d}return n.length>1&&n.sort((e,t)=>e.score-t.score),[n.map(({handler:e,params:t})=>[e,t])]}},TrieRouter=class{name=`TrieRouter`;#e;constructor(){this.#e=new x}add(e,t,n){let r=checkOptionalParameter(t);if(r){for(let t=0,i=r.length;t<i;t++)this.#e.insert(e,r[t],n);return}this.#e.insert(e,t,n)}match(e,t){return this.#e.search(e,t)}},Hono=class extends u{constructor(e={}){super(e),this.router=e.router??new SmartRouter({routers:[new RegExpRouter,new TrieRouter]})}};export{Hono as t};
@@ -0,0 +1 @@
1
+ import"../rolldown-runtime.mjs";var e=Symbol.for(`immer-nothing`),t=Symbol.for(`immer-draftable`),n=Symbol.for(`immer-state`);function die(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var r=Object,i=r.getPrototypeOf,a=`constructor`,o=`prototype`,s=`configurable`,c=`enumerable`,l=`writable`,u=`value`,isDraft=e=>!!e&&!!e[n];function isDraftable(e){return e?isPlainObject(e)||p(e)||!!e[t]||!!e[a]?.[t]||isMap(e)||isSet(e):!1}var d=r[o][a].toString(),f=new WeakMap;function isPlainObject(e){if(!e||!isObjectish(e))return!1;let t=i(e);if(t===null||t===r[o])return!0;let n=r.hasOwnProperty.call(t,a)&&t[a];if(n===Object)return!0;if(!isFunction(n))return!1;let s=f.get(n);return s===void 0&&(s=Function.toString.call(n),f.set(n,s)),s===d}function each(e,t,n=!0){getArchtype(e)===0?(n?Reflect.ownKeys(e):r.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function getArchtype(e){let t=e[n];return t?t.type_:p(e)?1:isMap(e)?2:isSet(e)?3:0}var has=(e,t,n=getArchtype(e))=>n===2?e.has(t):r[o].hasOwnProperty.call(e,t),get=(e,t,n=getArchtype(e))=>n===2?e.get(t):e[t],set=(e,t,n,r=getArchtype(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function is(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var p=Array.isArray,isMap=e=>e instanceof Map,isSet=e=>e instanceof Set,isObjectish=e=>typeof e==`object`,isFunction=e=>typeof e==`function`,isBoolean=e=>typeof e==`boolean`;function isArrayIndex(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var latest=e=>e.copy_||e.base_,getFinalValue=e=>e.modified_?e.copy_:e.base_;function shallowCopy(e,t){if(isMap(e))return new Map(e);if(isSet(e))return new Set(e);if(p(e))return Array[o].slice.call(e);let a=isPlainObject(e);if(t===!0||t===`class_only`&&!a){let t=r.getOwnPropertyDescriptors(e);delete t[n];let a=Reflect.ownKeys(t);for(let n=0;n<a.length;n++){let r=a[n],i=t[r];i[l]===!1&&(i[l]=!0,i[s]=!0),(i.get||i.set)&&(t[r]={[s]:!0,[l]:!0,[c]:i[c],[u]:e[r]})}return r.create(i(e),t)}else{let t=i(e);if(t!==null&&a)return{...e};let n=r.create(t);return r.assign(n,e)}}function freeze(e,t=!1){return isFrozen(e)||isDraft(e)||!isDraftable(e)?e:(getArchtype(e)>1&&r.defineProperties(e,{set:m,add:m,clear:m,delete:m}),r.freeze(e),t&&each(e,(e,t)=>{freeze(t,!0)},!1),e)}function dontMutateFrozenCollections(){die(2)}var m={[u]:dontMutateFrozenCollections};function isFrozen(e){return e===null||!isObjectish(e)?!0:r.isFrozen(e)}var h=`MapSet`,g=`Patches`,_=`ArrayMethods`,v={};function getPlugin(e){let t=v[e];return t||die(0,e),t}var isPluginLoaded=e=>!!v[e],y,getCurrentScope=()=>y,createScope=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:isPluginLoaded(h)?getPlugin(h):void 0,arrayMethodsPlugin_:isPluginLoaded(_)?getPlugin(_):void 0});function usePatchesInScope(e,t){t&&(e.patchPlugin_=getPlugin(g),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function revokeScope(e){leaveScope(e),e.drafts_.forEach(revokeDraft),e.drafts_=null}function leaveScope(e){e===y&&(y=e.parent_)}var enterScope=e=>y=createScope(y,e);function revokeDraft(e){let t=e[n];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function processResult(t,r){r.unfinalizedDrafts_=r.drafts_.length;let i=r.drafts_[0];if(t!==void 0&&t!==i){i[n].modified_&&(revokeScope(r),die(4)),isDraftable(t)&&(t=finalize(r,t));let{patchPlugin_:e}=r;e&&e.generateReplacementPatches_(i[n].base_,t,r)}else t=finalize(r,i);return maybeFreeze(r,t,!0),revokeScope(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),t===e?void 0:t}function finalize(e,t){if(isFrozen(t))return t;let r=t[n];if(!r)return handleValue(t,e.handledSet_,e);if(!isSameScope(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:t}=r;if(t)for(;t.length>0;)t.pop()(e);generatePatchesAndFinalize(r,e)}return r.copy_}function maybeFreeze(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&freeze(t,n)}function markStateFinalized(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var isSameScope=(e,t)=>e.scope_===t,b=[];function updateDraftInParent(e,t,n,r){let i=latest(e),a=e.type_;if(r!==void 0&&get(i,r,a)===t){set(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;each(i,(e,n)=>{if(isDraft(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??b;for(let e of o)set(i,e,n,a)}function registerChildFinalizationCallback(e,t,n){e.callbacks_.push(function childCleanup(r){let i=t;if(!i||!isSameScope(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=getFinalValue(i);updateDraftInParent(e,i.draft_??i,a,n),generatePatchesAndFinalize(i,r)})}function generatePatchesAndFinalize(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}markStateFinalized(e)}}function handleCrossReference(e,t,r){let{scope_:i}=e;if(isDraft(r)){let a=r[n];isSameScope(a,i)&&a.callbacks_.push(function crossReferenceCleanup(){prepareCopy(e),updateDraftInParent(e,r,getFinalValue(a),t)})}else isDraftable(r)&&e.callbacks_.push(function nestedDraftCleanup(){let n=latest(e);e.type_===3?n.has(r)&&handleValue(r,i.handledSet_,i):get(n,t,e.type_)===r&&i.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&handleValue(get(e.copy_,t,e.type_),i.handledSet_,i)})}function handleValue(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||isDraft(e)||t.has(e)||!isDraftable(e)||isFrozen(e)?e:(t.add(e),each(e,(i,a)=>{if(isDraft(a)){let t=a[n];isSameScope(t,r)&&(set(e,i,getFinalValue(t),e.type_),markStateFinalized(t))}else isDraftable(a)&&handleValue(a,t,r)}),e)}function createProxyProxy(e,t){let n=p(e),r={type_:+!!n,scope_:t?t.scope_:getCurrentScope(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=x;n&&(i=[r],a=S);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var x={get(e,t){if(t===n)return e;let r=e.scope_.arrayMethodsPlugin_,i=e.type_===1&&typeof t==`string`;if(i&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let a=latest(e);if(!has(a,t,e.type_))return readPropFromProto(e,a,t);let o=a[t];if(e.finalized_||!isDraftable(o)||i&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&isArrayIndex(t))return o;if(o===peek(e.base_,t)){prepareCopy(e);let n=e.type_===1?+t:t,r=createProxy(e.scope_,o,e,n);return e.copy_[n]=r}return o},has(e,t){return t in latest(e)},ownKeys(e){return Reflect.ownKeys(latest(e))},set(e,t,r){let i=getDescriptorFromProto(latest(e),t);if(i?.set)return i.set.call(e.draft_,r),!0;if(!e.modified_){let i=peek(latest(e),t),a=i?.[n];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(is(r,i)&&(r!==void 0||has(e.base_,t,e.type_)))return!0;prepareCopy(e),markChanged(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=r,e.assigned_.set(t,!0),handleCrossReference(e,t,r),!0)},deleteProperty(e,t){return prepareCopy(e),peek(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),markChanged(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=latest(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[l]:!0,[s]:e.type_!==1||t!==`length`,[c]:r[c],[u]:n[t]}},defineProperty(){die(11)},getPrototypeOf(e){return i(e.base_)},setPrototypeOf(){die(12)}},S={};for(let e in x){let t=x[e];S[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}S.deleteProperty=function(e,t){return S.set.call(this,e,t,void 0)},S.set=function(e,t,n){return x.set.call(this,e[0],t,n,e[0])};function peek(e,t){let r=e[n];return(r?latest(r):e)[t]}function readPropFromProto(e,t,n){let r=getDescriptorFromProto(t,n);return r?u in r?r[u]:r.get?.call(e.draft_):void 0}function getDescriptorFromProto(e,t){if(!(t in e))return;let n=i(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=i(n)}}function markChanged(e){e.modified_||(e.modified_=!0,e.parent_&&markChanged(e.parent_))}function prepareCopy(e){e.copy_||=(e.assigned_=new Map,shallowCopy(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Immer2=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(isFunction(t)&&!isFunction(n)){let e=n;n=t;let r=this;return function curriedProduce(t=e,...i){return r.produce(t,e=>n.call(this,e,...i))}}isFunction(n)||die(6),r!==void 0&&!isFunction(r)&&die(7);let i;if(isDraftable(t)){let e=enterScope(this),a=createProxy(e,t,void 0),o=!0;try{i=n(a),o=!1}finally{o?revokeScope(e):leaveScope(e)}return usePatchesInScope(e,r),processResult(i,e)}else if(!t||!isObjectish(t)){if(i=n(t),i===void 0&&(i=t),i===e&&(i=void 0),this.autoFreeze_&&freeze(i,!0),r){let e=[],n=[];getPlugin(g).generateReplacementPatches_(t,i,{patches_:e,inversePatches_:n}),r(e,n)}return i}else die(1,t)},this.produceWithPatches=(e,t)=>{if(isFunction(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},isBoolean(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),isBoolean(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),isBoolean(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(e){isDraftable(e)||die(8),isDraft(e)&&(e=current(e));let t=enterScope(this),r=createProxy(t,e,void 0);return r[n].isManual_=!0,leaveScope(t),r}finishDraft(e,t){let r=e&&e[n];(!r||!r.isManual_)&&die(9);let{scope_:i}=r;return usePatchesInScope(i,t),processResult(void 0,i)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=getPlugin(g).applyPatches_;return isDraft(e)?r(e,t):this.produce(e,e=>r(e,t))}};function createProxy(e,t,n,r){let[i,a]=isMap(t)?getPlugin(h).proxyMap_(t,n):isSet(t)?getPlugin(h).proxySet_(t,n):createProxyProxy(t,n);return(n?.scope_??getCurrentScope()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?registerChildFinalizationCallback(n,a,r):a.callbacks_.push(function rootDraftCleanup(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function current(e){return isDraft(e)||die(10,e),currentImpl(e)}function currentImpl(e){if(!isDraftable(e)||isFrozen(e))return e;let t=e[n],r,i=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=shallowCopy(e,t.scope_.immer_.useStrictShallowCopy_),i=t.scope_.immer_.shouldUseStrictIteration()}else r=shallowCopy(e,!0);return each(r,(e,t)=>{set(r,e,currentImpl(t))},i),t&&(t.finalized_=!1),r}var C=new Immer2().produce,castDraft=e=>e;export{C as n,castDraft as t};
@@ -0,0 +1 @@
1
+ import"../rolldown-runtime.mjs";const isErrorInstance=e=>isInstanceOfError(e)||hasErrorTag(e),isInstanceOfError=e=>{try{return e instanceof Error}catch{return!1}},hasErrorTag=t=>{try{return e.has(Object.prototype.toString.call(t))}catch{return!1}},e=new Set([`[object Error]`,`[object DOMException]`,`[object DOMError]`,`[object Exception]`]);export{isErrorInstance as t};
@@ -0,0 +1 @@
1
+ import"../rolldown-runtime.mjs";function isPlainObject(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}export{isPlainObject as t};
@@ -0,0 +1 @@
1
+ import{i as e,n as t,r as n}from"../rolldown-runtime.mjs";import{stat as r}from"node:fs/promises";import{statSync as i}from"node:fs";var a=n({isexe:()=>o,sync:()=>s}),o,s,c,checkMode,l=t((()=>{o=e(async(e,t={})=>{let{ignoreErrors:n=!1}=t;try{return c(await r(e),t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}},`isexe`),s=e((e,t={})=>{let{ignoreErrors:n=!1}=t;try{return c(i(e),t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}},`sync`),c=e((e,t)=>e.isFile()&&checkMode(e,t),`checkStat`),checkMode=(e,t)=>{let n=t.uid??process.getuid?.(),r=t.groups??process.getgroups?.()??[],i=t.gid??process.getgid?.()??r[0];if(n===void 0||i===void 0)throw Error(`cannot get uid or gid`);let a=new Set([i,...r]),o=e.mode,s=e.uid,c=e.gid;return!!(o&1||o&8&&a.has(c)||o&64&&s===n||o&72&&n===0)}})),u=n({isexe:()=>d,sync:()=>f}),d,f,checkPathExt,checkStat,p=t((()=>{d=e(async(e,t={})=>{let{ignoreErrors:n=!1}=t;try{return checkStat(await r(e),e,t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}},`isexe`),f=e((e,t={})=>{let{ignoreErrors:n=!1}=t;try{return checkStat(i(e),e,t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}},`sync`),checkPathExt=(e,t)=>{let{pathExt:n=process.env.PATHEXT||``}=t,r=n.split(`;`);if(r.indexOf(``)!==-1)return!0;for(let t=0;t<r.length;t++){let n=r[t].toLowerCase(),i=e.substring(e.length-n.length).toLowerCase();if(n&&i===n)return!0}return!1},checkStat=(e,t,n)=>e.isFile()&&checkPathExt(t,n)})),m=t((()=>{})),h=n({isexe:()=>_,posix:()=>a,sync:()=>v,win32:()=>u}),g,_,v,y=t((()=>{l(),p(),m(),g=(process.env._ISEXE_TEST_PLATFORM_||process.platform)===`win32`?u:a,_=g.isexe,v=g.sync}));export{h as n,y as t};
@@ -0,0 +1,14 @@
1
+ import{t as e}from"../rolldown-runtime.mjs";var t=e(((e,t)=>{t.exports.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,t.exports.ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\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\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\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]/,t.exports.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\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\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-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\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\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\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]|\uDB40[\uDD00-\uDDEF]/})),n=e(((e,n)=>{let r=t();n.exports={isSpaceSeparator(e){return typeof e==`string`&&r.Space_Separator.test(e)},isIdStartChar(e){return typeof e==`string`&&(e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e===`$`||e===`_`||r.ID_Start.test(e))},isIdContinueChar(e){return typeof e==`string`&&(e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`$`||e===`_`||e===`‌`||e===`‍`||r.ID_Continue.test(e))},isDigit(e){return typeof e==`string`&&/[0-9]/.test(e)},isHexDigit(e){return typeof e==`string`&&/[0-9A-Fa-f]/.test(e)}}})),r=e(((e,t)=>{let r=n(),i,a,o,s,c,l,u,d,f;t.exports=function parse(e,t){i=String(e),a=`start`,o=[],s=0,c=1,l=0,u=void 0,d=void 0,f=void 0;do u=lex(),y[a]();while(u.type!==`eof`);return typeof t==`function`?internalize({"":f},``,t):f};function internalize(e,t,n){let r=e[t];if(typeof r==`object`&&r)if(Array.isArray(r))for(let e=0;e<r.length;e++){let t=String(e),i=internalize(r,t,n);i===void 0?delete r[t]:Object.defineProperty(r,t,{value:i,writable:!0,enumerable:!0,configurable:!0})}else for(let e in r){let t=internalize(r,e,n);t===void 0?delete r[e]:Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}return n.call(e,t,r)}let p,m,h,g,_;function lex(){for(p=`default`,m=``,h=!1,g=1;;){_=peek();let e=v[p]();if(e)return e}}function peek(){if(i[s])return String.fromCodePoint(i.codePointAt(s))}function read(){let e=peek();return e===`
2
+ `?(c++,l=0):e?l+=e.length:l++,e&&(s+=e.length),e}let v={default(){switch(_){case` `:case`\v`:case`\f`:case` `:case`\xA0`:case``:case`
3
+ `:case`\r`:case`\u2028`:case`\u2029`:read();return;case`/`:read(),p=`comment`;return;case void 0:return read(),newToken(`eof`)}if(r.isSpaceSeparator(_)){read();return}return v[a]()},comment(){switch(_){case`*`:read(),p=`multiLineComment`;return;case`/`:read(),p=`singleLineComment`;return}throw invalidChar(read())},multiLineComment(){switch(_){case`*`:read(),p=`multiLineCommentAsterisk`;return;case void 0:throw invalidChar(read())}read()},multiLineCommentAsterisk(){switch(_){case`*`:read();return;case`/`:read(),p=`default`;return;case void 0:throw invalidChar(read())}read(),p=`multiLineComment`},singleLineComment(){switch(_){case`
4
+ `:case`\r`:case`\u2028`:case`\u2029`:read(),p=`default`;return;case void 0:return read(),newToken(`eof`)}read()},value(){switch(_){case`{`:case`[`:return newToken(`punctuator`,read());case`n`:return read(),literal(`ull`),newToken(`null`,null);case`t`:return read(),literal(`rue`),newToken(`boolean`,!0);case`f`:return read(),literal(`alse`),newToken(`boolean`,!1);case`-`:case`+`:read()===`-`&&(g=-1),p=`sign`;return;case`.`:m=read(),p=`decimalPointLeading`;return;case`0`:m=read(),p=`zero`;return;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:m=read(),p=`decimalInteger`;return;case`I`:return read(),literal(`nfinity`),newToken(`numeric`,1/0);case`N`:return read(),literal(`aN`),newToken(`numeric`,NaN);case`"`:case`'`:h=read()===`"`,m=``,p=`string`;return}throw invalidChar(read())},identifierNameStartEscape(){if(_!==`u`)throw invalidChar(read());read();let e=unicodeEscape();switch(e){case`$`:case`_`:break;default:if(!r.isIdStartChar(e))throw invalidIdentifier();break}m+=e,p=`identifierName`},identifierName(){switch(_){case`$`:case`_`:case`‌`:case`‍`:m+=read();return;case`\\`:read(),p=`identifierNameEscape`;return}if(r.isIdContinueChar(_)){m+=read();return}return newToken(`identifier`,m)},identifierNameEscape(){if(_!==`u`)throw invalidChar(read());read();let e=unicodeEscape();switch(e){case`$`:case`_`:case`‌`:case`‍`:break;default:if(!r.isIdContinueChar(e))throw invalidIdentifier();break}m+=e,p=`identifierName`},sign(){switch(_){case`.`:m=read(),p=`decimalPointLeading`;return;case`0`:m=read(),p=`zero`;return;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:m=read(),p=`decimalInteger`;return;case`I`:return read(),literal(`nfinity`),newToken(`numeric`,g*(1/0));case`N`:return read(),literal(`aN`),newToken(`numeric`,NaN)}throw invalidChar(read())},zero(){switch(_){case`.`:m+=read(),p=`decimalPoint`;return;case`e`:case`E`:m+=read(),p=`decimalExponent`;return;case`x`:case`X`:m+=read(),p=`hexadecimal`;return}return newToken(`numeric`,g*0)},decimalInteger(){switch(_){case`.`:m+=read(),p=`decimalPoint`;return;case`e`:case`E`:m+=read(),p=`decimalExponent`;return}if(r.isDigit(_)){m+=read();return}return newToken(`numeric`,g*Number(m))},decimalPointLeading(){if(r.isDigit(_)){m+=read(),p=`decimalFraction`;return}throw invalidChar(read())},decimalPoint(){switch(_){case`e`:case`E`:m+=read(),p=`decimalExponent`;return}if(r.isDigit(_)){m+=read(),p=`decimalFraction`;return}return newToken(`numeric`,g*Number(m))},decimalFraction(){switch(_){case`e`:case`E`:m+=read(),p=`decimalExponent`;return}if(r.isDigit(_)){m+=read();return}return newToken(`numeric`,g*Number(m))},decimalExponent(){switch(_){case`+`:case`-`:m+=read(),p=`decimalExponentSign`;return}if(r.isDigit(_)){m+=read(),p=`decimalExponentInteger`;return}throw invalidChar(read())},decimalExponentSign(){if(r.isDigit(_)){m+=read(),p=`decimalExponentInteger`;return}throw invalidChar(read())},decimalExponentInteger(){if(r.isDigit(_)){m+=read();return}return newToken(`numeric`,g*Number(m))},hexadecimal(){if(r.isHexDigit(_)){m+=read(),p=`hexadecimalInteger`;return}throw invalidChar(read())},hexadecimalInteger(){if(r.isHexDigit(_)){m+=read();return}return newToken(`numeric`,g*Number(m))},string(){switch(_){case`\\`:read(),m+=escape();return;case`"`:if(h)return read(),newToken(`string`,m);m+=read();return;case`'`:if(!h)return read(),newToken(`string`,m);m+=read();return;case`
5
+ `:case`\r`:throw invalidChar(read());case`\u2028`:case`\u2029`:separatorChar(_);break;case void 0:throw invalidChar(read())}m+=read()},start(){switch(_){case`{`:case`[`:return newToken(`punctuator`,read())}p=`value`},beforePropertyName(){switch(_){case`$`:case`_`:m=read(),p=`identifierName`;return;case`\\`:read(),p=`identifierNameStartEscape`;return;case`}`:return newToken(`punctuator`,read());case`"`:case`'`:h=read()===`"`,p=`string`;return}if(r.isIdStartChar(_)){m+=read(),p=`identifierName`;return}throw invalidChar(read())},afterPropertyName(){if(_===`:`)return newToken(`punctuator`,read());throw invalidChar(read())},beforePropertyValue(){p=`value`},afterPropertyValue(){switch(_){case`,`:case`}`:return newToken(`punctuator`,read())}throw invalidChar(read())},beforeArrayValue(){if(_===`]`)return newToken(`punctuator`,read());p=`value`},afterArrayValue(){switch(_){case`,`:case`]`:return newToken(`punctuator`,read())}throw invalidChar(read())},end(){throw invalidChar(read())}};function newToken(e,t){return{type:e,value:t,line:c,column:l}}function literal(e){for(let t of e){if(peek()!==t)throw invalidChar(read());read()}}function escape(){switch(peek()){case`b`:return read(),`\b`;case`f`:return read(),`\f`;case`n`:return read(),`
6
+ `;case`r`:return read(),`\r`;case`t`:return read(),` `;case`v`:return read(),`\v`;case`0`:if(read(),r.isDigit(peek()))throw invalidChar(read());return`\0`;case`x`:return read(),hexEscape();case`u`:return read(),unicodeEscape();case`
7
+ `:case`\u2028`:case`\u2029`:return read(),``;case`\r`:return read(),peek()===`
8
+ `&&read(),``;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:throw invalidChar(read());case void 0:throw invalidChar(read())}return read()}function hexEscape(){let e=``,t=peek();if(!r.isHexDigit(t)||(e+=read(),t=peek(),!r.isHexDigit(t)))throw invalidChar(read());return e+=read(),String.fromCodePoint(parseInt(e,16))}function unicodeEscape(){let e=``,t=4;for(;t-- >0;){let t=peek();if(!r.isHexDigit(t))throw invalidChar(read());e+=read()}return String.fromCodePoint(parseInt(e,16))}let y={start(){if(u.type===`eof`)throw invalidEOF();push()},beforePropertyName(){switch(u.type){case`identifier`:case`string`:d=u.value,a=`afterPropertyName`;return;case`punctuator`:pop();return;case`eof`:throw invalidEOF()}},afterPropertyName(){if(u.type===`eof`)throw invalidEOF();a=`beforePropertyValue`},beforePropertyValue(){if(u.type===`eof`)throw invalidEOF();push()},beforeArrayValue(){if(u.type===`eof`)throw invalidEOF();if(u.type===`punctuator`&&u.value===`]`){pop();return}push()},afterPropertyValue(){if(u.type===`eof`)throw invalidEOF();switch(u.value){case`,`:a=`beforePropertyName`;return;case`}`:pop()}},afterArrayValue(){if(u.type===`eof`)throw invalidEOF();switch(u.value){case`,`:a=`beforeArrayValue`;return;case`]`:pop()}},end(){}};function push(){let e;switch(u.type){case`punctuator`:switch(u.value){case`{`:e={};break;case`[`:e=[];break}break;case`null`:case`boolean`:case`numeric`:case`string`:e=u.value;break}if(f===void 0)f=e;else{let t=o[o.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,d,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(typeof e==`object`&&e)o.push(e),a=Array.isArray(e)?`beforeArrayValue`:`beforePropertyName`;else{let e=o[o.length-1];a=e==null?`end`:Array.isArray(e)?`afterArrayValue`:`afterPropertyValue`}}function pop(){o.pop();let e=o[o.length-1];a=e==null?`end`:Array.isArray(e)?`afterArrayValue`:`afterPropertyValue`}function invalidChar(e){return syntaxError(e===void 0?`JSON5: invalid end of input at ${c}:${l}`:`JSON5: invalid character '${formatChar(e)}' at ${c}:${l}`)}function invalidEOF(){return syntaxError(`JSON5: invalid end of input at ${c}:${l}`)}function invalidIdentifier(){return l-=5,syntaxError(`JSON5: invalid identifier character at ${c}:${l}`)}function separatorChar(e){console.warn(`JSON5: '${formatChar(e)}' in strings is not valid ECMAScript; consider escaping`)}function formatChar(e){let t={"'":`\\'`,'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`,"\v":`\\v`,"\0":`\\0`,"\u2028":`\\u2028`,"\u2029":`\\u2029`};if(t[e])return t[e];if(e<` `){let t=e.charCodeAt(0).toString(16);return`\\x`+(`00`+t).substring(t.length)}return e}function syntaxError(e){let t=SyntaxError(e);return t.lineNumber=c,t.columnNumber=l,t}})),i=e(((e,t)=>{let r=n();t.exports=function stringify(e,t,n){let i=[],a=``,o,s,c=``,l;if(typeof t==`object`&&t&&!Array.isArray(t)&&(n=t.space,l=t.quote,t=t.replacer),typeof t==`function`)s=t;else if(Array.isArray(t)){o=[];for(let e of t){let t;typeof e==`string`?t=e:(typeof e==`number`||e instanceof String||e instanceof Number)&&(t=String(e)),t!==void 0&&o.indexOf(t)<0&&o.push(t)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n==`number`?n>0&&(n=Math.min(10,Math.floor(n)),c=` `.substr(0,n)):typeof n==`string`&&(c=n.substr(0,10)),serializeProperty(``,{"":e});function serializeProperty(e,t){let n=t[e];switch(n!=null&&(typeof n.toJSON5==`function`?n=n.toJSON5(e):typeof n.toJSON==`function`&&(n=n.toJSON(e))),s&&(n=s.call(t,e,n)),n instanceof Number?n=Number(n):n instanceof String?n=String(n):n instanceof Boolean&&(n=n.valueOf()),n){case null:return`null`;case!0:return`true`;case!1:return`false`}if(typeof n==`string`)return quoteString(n,!1);if(typeof n==`number`)return String(n);if(typeof n==`object`)return Array.isArray(n)?serializeArray(n):serializeObject(n)}function quoteString(e){let t={"'":.1,'"':.2},n={"'":`\\'`,'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`,"\v":`\\v`,"\0":`\\0`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},i=``;for(let a=0;a<e.length;a++){let o=e[a];switch(o){case`'`:case`"`:t[o]++,i+=o;continue;case`\0`:if(r.isDigit(e[a+1])){i+=`\\x00`;continue}}if(n[o]){i+=n[o];continue}if(o<` `){let e=o.charCodeAt(0).toString(16);i+=`\\x`+(`00`+e).substring(e.length);continue}i+=o}let a=l||Object.keys(t).reduce((e,n)=>t[e]<t[n]?e:n);return i=i.replace(new RegExp(a,`g`),n[a]),a+i+a}function serializeObject(e){if(i.indexOf(e)>=0)throw TypeError(`Converting circular structure to JSON5`);i.push(e);let t=a;a+=c;let n=o||Object.keys(e),r=[];for(let t of n){let n=serializeProperty(t,e);if(n!==void 0){let e=serializeKey(t)+`:`;c!==``&&(e+=` `),e+=n,r.push(e)}}let s;if(r.length===0)s=`{}`;else{let e;if(c===``)e=r.join(`,`),s=`{`+e+`}`;else{let n=`,
9
+ `+a;e=r.join(n),s=`{
10
+ `+a+e+`,
11
+ `+t+`}`}}return i.pop(),a=t,s}function serializeKey(e){if(e.length===0)return quoteString(e,!0);let t=String.fromCodePoint(e.codePointAt(0));if(!r.isIdStartChar(t))return quoteString(e,!0);for(let n=t.length;n<e.length;n++)if(!r.isIdContinueChar(String.fromCodePoint(e.codePointAt(n))))return quoteString(e,!0);return e}function serializeArray(e){if(i.indexOf(e)>=0)throw TypeError(`Converting circular structure to JSON5`);i.push(e);let t=a;a+=c;let n=[];for(let t=0;t<e.length;t++){let r=serializeProperty(String(t),e);n.push(r===void 0?`null`:r)}let r;if(n.length===0)r=`[]`;else if(c===``)r=`[`+n.join(`,`)+`]`;else{let e=`,
12
+ `+a,i=n.join(e);r=`[
13
+ `+a+i+`,
14
+ `+t+`]`}return i.pop(),a=t,r}}})),a=e(((e,t)=>{t.exports={parse:r(),stringify:i()}}));export{a as t};