@visulima/vis 1.0.0-alpha.43 → 1.0.0-alpha.45

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 (156) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/LICENSE.md +256 -0
  3. package/bin/resolve-binary.mjs +85 -0
  4. package/bin/vis.mjs +76 -0
  5. package/dist/bin.d.ts +1 -0
  6. package/dist/bin.js +1 -2
  7. package/dist/binx.js +1 -1
  8. package/dist/packem_chunks/CONFIG_FILES.js +1 -1
  9. package/dist/packem_chunks/bloom-status.js +1 -1
  10. package/dist/packem_chunks/bloom-sync.js +1 -1
  11. package/dist/packem_chunks/catalog.js +63 -62
  12. package/dist/packem_chunks/cli-exec.js +1 -1
  13. package/dist/packem_chunks/cli-main.js +173 -973
  14. package/dist/packem_chunks/detect.js +1 -1
  15. package/dist/packem_chunks/dispatch.js +1 -1
  16. package/dist/packem_chunks/fix.js +1 -1
  17. package/dist/packem_chunks/handler.js +1 -1
  18. package/dist/packem_chunks/handler10.js +1 -1
  19. package/dist/packem_chunks/handler11.js +1 -1
  20. package/dist/packem_chunks/handler12.js +2 -2
  21. package/dist/packem_chunks/handler13.js +1 -1
  22. package/dist/packem_chunks/handler14.js +1 -1
  23. package/dist/packem_chunks/handler15.js +1 -1
  24. package/dist/packem_chunks/handler16.js +1 -1
  25. package/dist/packem_chunks/handler17.js +1 -1
  26. package/dist/packem_chunks/handler18.js +1 -1
  27. package/dist/packem_chunks/handler19.js +1 -1
  28. package/dist/packem_chunks/handler2.js +1 -1
  29. package/dist/packem_chunks/handler20.js +1 -1
  30. package/dist/packem_chunks/handler21.js +1 -1
  31. package/dist/packem_chunks/handler22.js +13 -4
  32. package/dist/packem_chunks/handler23.js +1 -1
  33. package/dist/packem_chunks/handler24.js +1 -1
  34. package/dist/packem_chunks/handler26.js +1 -1
  35. package/dist/packem_chunks/handler27.js +1 -1
  36. package/dist/packem_chunks/handler28.js +1 -1
  37. package/dist/packem_chunks/handler29.js +1 -1
  38. package/dist/packem_chunks/handler3.js +1 -1
  39. package/dist/packem_chunks/handler30.js +1 -1
  40. package/dist/packem_chunks/handler4.js +1 -1
  41. package/dist/packem_chunks/handler5.js +3 -3
  42. package/dist/packem_chunks/handler50.js +4 -4
  43. package/dist/packem_chunks/handler51.js +3 -3
  44. package/dist/packem_chunks/handler53.js +1 -1
  45. package/dist/packem_chunks/handler54.js +2 -2
  46. package/dist/packem_chunks/handler55.js +1 -1
  47. package/dist/packem_chunks/handler57.js +4 -4
  48. package/dist/packem_chunks/handler58.js +1 -1
  49. package/dist/packem_chunks/handler59.js +2 -2
  50. package/dist/packem_chunks/handler6.js +6 -6
  51. package/dist/packem_chunks/handler60.js +18 -18
  52. package/dist/packem_chunks/handler61.js +1 -1
  53. package/dist/packem_chunks/handler62.js +3 -3
  54. package/dist/packem_chunks/handler63.js +4 -4
  55. package/dist/packem_chunks/handler65.js +2 -2
  56. package/dist/packem_chunks/handler66.js +15 -15
  57. package/dist/packem_chunks/handler67.js +5 -5
  58. package/dist/packem_chunks/handler68.js +16 -16
  59. package/dist/packem_chunks/handler69.js +5 -5
  60. package/dist/packem_chunks/handler7.js +1 -1
  61. package/dist/packem_chunks/handler70.js +16 -17
  62. package/dist/packem_chunks/handler71.js +2 -2
  63. package/dist/packem_chunks/handler72.js +2 -2
  64. package/dist/packem_chunks/handler73.js +13 -13
  65. package/dist/packem_chunks/handler74.js +3 -3
  66. package/dist/packem_chunks/handler75.js +3 -3
  67. package/dist/packem_chunks/handler76.js +63 -63
  68. package/dist/packem_chunks/handler77.js +1 -1
  69. package/dist/packem_chunks/handler8.js +1 -1
  70. package/dist/packem_chunks/handler9.js +1 -1
  71. package/dist/packem_chunks/heal-accept.js +1 -1
  72. package/dist/packem_chunks/heal.js +1 -1
  73. package/dist/packem_chunks/help-command.js +1 -1
  74. package/dist/packem_chunks/index2.js +802 -7
  75. package/dist/packem_chunks/index3.js +7 -135
  76. package/dist/packem_chunks/index4.js +134 -73
  77. package/dist/packem_chunks/index5.js +74 -0
  78. package/dist/packem_chunks/keys-refresh.js +1 -1
  79. package/dist/packem_chunks/lean.js +3 -3
  80. package/dist/packem_chunks/list.js +1 -1
  81. package/dist/packem_chunks/loader.js +1 -1
  82. package/dist/packem_chunks/loader2.js +1 -1
  83. package/dist/packem_chunks/print-config.js +1 -1
  84. package/dist/packem_chunks/registry.js +2 -2
  85. package/dist/packem_chunks/shell-runner.js +1 -1
  86. package/dist/packem_chunks/sync.js +1 -1
  87. package/dist/packem_chunks/sync2.js +1 -1
  88. package/dist/packem_chunks/tripwire.js +2 -2
  89. package/dist/packem_chunks/ts-loader.js +22 -2
  90. package/dist/packem_chunks/verify-lockfile.js +1 -1
  91. package/dist/packem_chunks/version-resolver.js +2 -2
  92. package/dist/packem_shared/{Table-CcVkyULl-DLWu6XHL.js → Table-BGIHvenQ-D2oJtNQj.js} +1 -1
  93. package/dist/packem_shared/affected-shas-CCxG4tvm.js +1 -0
  94. package/dist/packem_shared/{ai-analysis-Co-b15d_.js → ai-analysis-rC48NLfB.js} +5 -5
  95. package/dist/packem_shared/{ai-fix-DnJDgPN-.js → ai-fix-D_ijV3Rn.js} +3 -3
  96. package/dist/packem_shared/augment-DaSS2Lgs.js +4 -0
  97. package/dist/packem_shared/bin-CPMo34SM.js +1 -0
  98. package/dist/packem_shared/{build-scripts-Doxce2VM.js → build-scripts-MTSK6TNr.js} +1 -1
  99. package/dist/packem_shared/{command-runtime-RiCMa2C8.js → command-runtime-3FTGuUsK.js} +1 -1
  100. package/dist/packem_shared/{cyclonedx-BTBzGCBW.js → cyclonedx-BeUmPgfO.js} +1 -1
  101. package/dist/packem_shared/{dependency-scan-DEv-scN6.js → dependency-scan-DpOFiZuI.js} +1 -1
  102. package/dist/packem_shared/{docker-DKlF-gk3.js → docker-CViFYtmM.js} +1 -1
  103. package/dist/packem_shared/{env-XJzocuUP.js → env-Ct3hMEYB.js} +2 -2
  104. package/dist/packem_shared/{failure-log-Sp1j-5qo.js → failure-log-Dy2G-rKi.js} +1 -1
  105. package/dist/packem_shared/glob-fqg4KepW-1S3z30c8.js +1 -0
  106. package/dist/packem_shared/index-CE6MsgcV.js +22 -0
  107. package/dist/packem_shared/{index-CkZnT2Fe.js → index-Cntyu-w8.js} +1 -1
  108. package/dist/packem_shared/{index-DJAnbLEh.js → index-XAb0QGqA.js} +1 -1
  109. package/dist/packem_shared/{lifecycle-C4nRsXxc.js → lifecycle-CHcFuWf_.js} +1 -1
  110. package/dist/packem_shared/{lockfile-DIGyLfmF.js → lockfile-C1qCKGH6.js} +1 -1
  111. package/dist/packem_shared/{manifests-pLwnVmCN.js → manifests-WBnsV_Eb.js} +1 -1
  112. package/dist/packem_shared/{min-release-age-B23Mr7NO.js → min-release-age-C71MO72F.js} +1 -1
  113. package/dist/packem_shared/{missing-package-json-DdMNbe_j.js → missing-package-json-CTF71tE5.js} +1 -1
  114. package/dist/packem_shared/{native-config-sync-4K9wWTj5.js → native-config-sync-BFDVK9LH.js} +4 -4
  115. package/dist/packem_shared/{osv-bloom-BsQ-aFiM.js → osv-bloom-DVMlkcAO.js} +2 -2
  116. package/dist/packem_shared/{packument-QjOLAMSk.js → packument-C-A3Uhhx.js} +1 -1
  117. package/dist/packem_shared/pm-runner-CQcraCcu.js +1 -0
  118. package/dist/packem_shared/{provenance-CilBg0Ee.js → provenance-R2csDSNg.js} +1 -1
  119. package/dist/packem_shared/readJsonSync-CvkZyKmL-ihoybKvs.js +1 -0
  120. package/dist/packem_shared/{registry-keys-BEavOCPz.js → registry-keys-CMnS_Qt_.js} +1 -1
  121. package/dist/packem_shared/{resolve-explicit-C4o8_-SE.js → resolve-explicit-C4oQMyoB.js} +1 -1
  122. package/dist/packem_shared/resolve-runtime-QRaQucfL.js +1 -0
  123. package/dist/packem_shared/run-file-DD7Ne23Z.js +1 -0
  124. package/dist/packem_shared/{runtime-check-0lUJvgKt.js → runtime-check-BXehSP06.js} +1 -1
  125. package/dist/packem_shared/{s1ngularity-DuG-LLaX.js → s1ngularity-BCDt28u0.js} +1 -1
  126. package/dist/packem_shared/scan-progress-YRpDs90j.js +2 -0
  127. package/dist/packem_shared/{selectors-UmnAuc26.js → selectors-D4iCvITE.js} +1 -1
  128. package/dist/packem_shared/{signatures-CYheSqd3.js → signatures-B3srzCEv.js} +1 -1
  129. package/dist/packem_shared/target-options-CR0OuYJr.js +1 -0
  130. package/dist/packem_shared/toolchain-C44mPKPu.js +5 -0
  131. package/dist/packem_shared/{typosquats-hCtH-23t.js → typosquats-CQz-1Y6K.js} +1 -1
  132. package/dist/packem_shared/use-measured-height-DHi0xOPO.js +1 -0
  133. package/dist/packem_shared/utils-CRueU43T.js +1 -0
  134. package/dist/packem_shared/verify-DStfg3nb.js +1 -0
  135. package/dist/packem_shared/{vis-update-app-K-qATSeh.js → vis-update-app-B3I14Vfy.js} +1 -1
  136. package/dist/packem_shared/{watch-Bkp_AAbc.js → watch-BXNI7dC6.js} +1 -1
  137. package/dist/packem_shared/{watch-loop-WE7nWIEt.js → watch-loop-JfGKIgKB.js} +1 -1
  138. package/dist/runtime/preload.js +1 -1
  139. package/index.js +52 -52
  140. package/package.json +18 -14
  141. package/dist/packem_shared/affected-shas-C1XuRlvo.js +0 -1
  142. package/dist/packem_shared/augment-8fIWWGSc.js +0 -3
  143. package/dist/packem_shared/bin-DDq2oszw.js +0 -1
  144. package/dist/packem_shared/glob-fqg4KepW-7Bs2kZuM.js +0 -1
  145. package/dist/packem_shared/index-OQZQyN5R.js +0 -19
  146. package/dist/packem_shared/pm-runner-CIH0wPh-.js +0 -1
  147. package/dist/packem_shared/readJsonSync-CvkZyKmL-CY7PZob_.js +0 -4
  148. package/dist/packem_shared/resolve-runtime-CJSWV-K8.js +0 -1
  149. package/dist/packem_shared/run-file-B4TqKa0X.js +0 -1
  150. package/dist/packem_shared/scan-progress-RTMsE3Z4.js +0 -2
  151. package/dist/packem_shared/target-options-ChWcK60i.js +0 -1
  152. package/dist/packem_shared/toolchain-DyCKnGch.js +0 -5
  153. package/dist/packem_shared/use-measured-height-BKUjhm_3.js +0 -1
  154. package/dist/packem_shared/utils-Cxree603.js +0 -1
  155. package/dist/packem_shared/verify-CVPYlUrF.js +0 -1
  156. package/dist/packem_shared/window-ops-DDePlWLV.js +0 -2
@@ -1,4 +1,4 @@
1
- import{createRequire as Hg}from"node:module";const Bg=Hg(import.meta.url),Xo=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Tg=i=>{if(typeof Xo<"u"&&Xo.versions&&Xo.versions.node){const[o,e]=Xo.versions.node.split(".").map(Number);if(o>22||o===22&&e>=3||o===20&&e>=16)return Xo.getBuiltinModule(i)}return Bg(i)},{createRequire:Dg}=Tg("node:module"),Mg=Dg(import.meta.url),so=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,be=i=>{if(typeof so<"u"&&so.versions&&so.versions.node){const[o,e]=so.versions.node.split(".").map(Number);if(o>22||o===22&&e>=3||o===20&&e>=16)return so.getBuiltinModule(i)}return Mg(i)},{createRequire:Eu}=be("node:module"),Ui=so,{execFileSync:Qg}=be("node:child_process"),Mo=be("node:fs"),xg=be("node:tty"),Gg=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Wg=12288,Ng=65510,Pg=[12288,12288,65281,65376,65504,65510],Fg=8361,Rg=65518,Ag=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Kg=32,Og=10630,Eg=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],_g=4352,zg=262141,_u=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],Ro=(i,o)=>{let e=0,n=Math.floor(i.length/2)-1;for(;e<=n;){const a=Math.floor((e+n)/2),u=a*2;if(o<i[u])n=a-1;else if(o>i[u+1])e=a+1;else return!0}return!1},ja=19968,[Ig,qg]=Ug(_u);function Ug(i){let o=i[0],e=i[1];for(let n=0;n<i.length;n+=2){const a=i[n],u=i[n+1];if(ja>=a&&ja<=u)return[a,u];u-a>e-o&&(o=a,e=u)}return[o,e]}const Vg=i=>i<161||i>1114109?!1:Ro(Gg,i),$g=i=>i<Wg||i>Ng?!1:Ro(Pg,i),ih=i=>i<Fg||i>Rg?!1:Ro(Ag,i),oh=i=>i<Kg||i>Og?!1:Ro(Eg,i),eh=i=>i>=Ig&&i<=qg?!0:i<_g||i>zg?!1:Ro(_u,i);function nh(i){return Vg(i)?"ambiguous":$g(i)?"fullwidth":ih(i)?"halfwidth":oh(i)?"narrow":eh(i)?"wide":"neutral"}function ah(i){if(!Number.isSafeInteger(i))throw new TypeError(`Expected a code point, got \`${typeof i}\`.`)}function zu(i){return ah(i),nh(i)}const Iu=String.raw,fa=Iu`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,uh=()=>new RegExp(Iu`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${fa}(?:\u200D${fa})*`,"gu"),jo=new Set(["\x1B","›"]),pe="\x07",qu="[",Yn="m",xo="]8;;",th=39,dh=/[\u200B\uFEFF\u2060-\u2064]/g,gh=new RegExp(`(?:\\${qu}(?<code>\\d+)m|\\${xo}(?<uri>.*)${pe})`),hh=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),rh=/^[ \t]*(?:\r\n|\r|\n)/,sh=/(?:\r\n|\r|\n)[ \t]*$/,lh=/^(?:[\r\n]|$)/,vh=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,yh=/^[ \t]*[\r\n][ \t\r\n]*$/,ch=/\r\n|\n|\r/g,qi=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,ma=/\u001B\[(\d+(?:;\d+)*)?m[^\u001B]*(?:\u001B\[(?:\d+(?:;\d+)*)?m|$)/g,Ya=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)(.*?)\u001B\]8;;(?:\u0007|\u001B\\)/g,qo=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Ke=uh(),ka=new Map,bh=i=>[i.ambiguousIsNarrow?1:0,i.control,i.fullWidth,i.regular,i.wide].join("|"),ph=i=>{const o=bh(i.width);let e=ka.get(o);return e||(e=new Map,ka.set(o,e)),e},Uo=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Uu=i=>i>=32&&i<=126?"latin":i===8203||i===8204||i===8205||i===8288?"zero":i<=31||i>=127&&i<=159?"control":i>=160&&i<=255||i>=9472&&i<=9599?"latin":i>=4352&&i<=4607||i>=11904&&i<=40959||i>=44032&&i<=55215||i>=63744&&i<=64255||i>=65280&&i<=65519&&!(i>=65377&&i<=65439)||i>=12352&&i<=12543?"wide":i===8230?"latin":"other",wh=(i,o)=>{const e=ph(o),n=Math.floor(i/65536),a=i%65536;let u=e.get(n);if(u||(u=new Map,e.set(n,u)),u.has(a))return u.get(a);let t;switch(Uu(i)){case"control":{t=o.width.control;break}case"latin":{t=o.width.regular;break}case"wide":{t=o.width.wide;break}case"zero":{t=0;break}default:switch(zu(i)){case"ambiguous":{t=o.width.ambiguousIsNarrow?o.width.regular:o.width.wide;break}case"fullwidth":{t=o.width.fullWidth;break}case"wide":{t=o.width.wide;break}default:t=o.width.regular}}return u.set(a,t),t},jh=i=>i>=768&&i<=879||i>=6832&&i<=6911||i>=7616&&i<=7679||i>=8400&&i<=8447||i>=65056&&i<=65071||i>=917760&&i<=917999||i>=65024&&i<=65039||i>=3633&&i<=3642||i>=3655&&i<=3662||i>=3761&&i<=3769||i>=3771&&i<=3772||i>=3784&&i<=3789||i>=2304&&i<=2307||i>=2362&&i<=2383||i>=2385&&i<=2391||i>=2402&&i<=2403||i>=2433&&i<=2435||i>=2492&&i<=2500||i>=2509&&i<=2509||i>=2561&&i<=2563||i>=2620&&i<=2637||i>=1611&&i<=1631||i>=1648&&i<=1648||i>=1750&&i<=1773||i>=2276&&i<=2302||i>=1425&&i<=1469||i>=1471&&i<=1471||i>=1473&&i<=1474||i>=1476&&i<=1477||i>=1479&&i<=1479||i>=3893&&i<=3893||i>=3895&&i<=3895||i>=3897&&i<=3897||i>=3953&&i<=3966||i>=3968&&i<=3972||i>=3974&&i<=3975?!0:i>=768&&i<=777||i>=803&&i<=803,bo=(i,o={})=>{if(!i||i.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const e={truncation:{countAnsiEscapeCodes:o.countAnsiEscapeCodes??!1,ellipsis:o.ellipsis??"",ellipsisWidth:o.ellipsisWidth??(o.ellipsis?bo(o.ellipsis,{...o,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:o.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:o.ambiguousIsNarrow??!1,ansi:o.ansiWidth??0,control:o.controlWidth??0,emoji:o.emojiWidth??2,fullWidth:o.fullWidth??2,halfWidth:o.halfWidth??1,regular:o.regularWidth??1,tab:o.tabWidth??8,wide:o.wideWidth??2}},n=Math.max(0,e.truncation.limit-e.truncation.ellipsisWidth),{length:a}=i,u=a>1e4;let t=0,d=0,g=a,r=!1;const s=i.includes("\x1B")||i.includes("›");for(;t<a;){if(s&&(i[t]==="\x1B"||i[t]==="›")){if(i.startsWith("\x1B]8;;",t)){const w="\x1B]8;;\x07",p=w.length,j=i.indexOf("\x07",t+5);if(j!==-1){const f=i.indexOf(w,j+1);if(f!==-1){const m=f+p,k=i.slice(j+1,f).replace(qi,""),Z=bo(k,{ambiguousIsNarrow:e.width.ambiguousIsNarrow,ansiWidth:e.width.ansi,controlWidth:e.width.control,countAnsiEscapeCodes:!1,ellipsis:e.truncation.ellipsis,ellipsisWidth:e.truncation.ellipsisWidth,emojiWidth:e.width.emoji,fullWidth:e.width.fullWidth,halfWidth:e.width.halfWidth,limit:Math.max(0,n-d),regularWidth:e.width.regular,tabWidth:e.width.tab,wideWidth:e.width.wide}),D=Z.width;if(Z.truncated)r=!0,g=Math.min(g,t);else if(d+D>n&&(g=Math.min(g,t),r=!0,d+D>e.truncation.limit))break;if(d+=D,t=m,r&&d>=e.truncation.limit)break;continue}}}if(qi.lastIndex=t,qi.test(i)){const w=qi.lastIndex-t,p=e.truncation.countAnsiEscapeCodes?w:e.width.ansi;if(d+p>n&&(g=Math.min(g,t),d+p>e.truncation.limit)){r=!0;break}d+=p,t=qi.lastIndex;continue}}const c=i.codePointAt(t);if(c===8203||c===65279||c>=8288&&c<=8292){t+=1;continue}if(c===9){if(d+e.width.tab>n&&(g=Math.min(g,t),d+e.width.tab>e.truncation.limit)){r=!0;break}d+=e.width.tab,t+=1;continue}if(Uo.lastIndex=t,Uo.test(i)){const w=(Uo.lastIndex-t)*e.width.regular;if(d+w>n){const p=Math.floor((n-d)/e.width.regular);if(g=Math.min(g,t+p),d+w>e.truncation.limit){r=!0;break}}d+=w,t=Uo.lastIndex;continue}if((c<=31||c>=127&&c<=159)&&(qo.lastIndex=t,qo.test(i))){const w=(qo.lastIndex-t)*e.width.control;if(d+w>n&&(g=Math.min(g,t+Math.floor((n-d)/e.width.control)),d+w>e.truncation.limit)){r=!0;break}d+=w,t=qo.lastIndex;continue}if(Ke.lastIndex=t,Ke.test(i)){if(d+e.width.emoji>n&&(g=Math.min(g,t),d+e.width.emoji>e.truncation.limit)){r=!0;break}d+=e.width.emoji,t=Ke.lastIndex;continue}const y=i.codePointAt(t)??0;if(jh(y)){t+=y>65535?2:1;continue}let b;if(u)b=wh(y,e);else switch(Uu(y)){case"control":{b=e.width.control;break}case"latin":{b=e.width.regular;break}case"wide":{b=e.width.wide;break}case"zero":{b=0;break}default:switch(zu(y)){case"ambiguous":{b=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{b=e.width.fullWidth;break}case"wide":{b=e.width.wide;break}default:b=e.width.regular}}if(d+b>n&&(g=Math.min(g,t),d+b>e.truncation.limit)){r=!0;break}d+=b,t+=y>65535?2:1}let l=d,v=!1;return r&&e.truncation.limit>=e.truncation.ellipsisWidth&&(l=e.truncation.limit,v=!0),{ellipsed:v,index:r?g:a,truncated:r,width:l}},z=(i,o={})=>bo(i,{...o,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;let fh=class{capacity;cache;constructor(i){this.capacity=i,this.cache=new Map}get(i){if(!this.cache.has(i))return;const o=this.cache.get(i);return this.cache.delete(i),this.cache.set(i,o),o}has(i){return this.cache.has(i)}set(i,o){if(this.cache.has(i))this.cache.delete(i);else if(this.cache.size>=this.capacity){const e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}this.cache.set(i,o)}delete(i){this.cache.delete(i)}clear(){this.cache.clear()}size(){return this.cache.size}};const mh=Eu(import.meta.url),Ho=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Yh=i=>{if(typeof Ho<"u"&&Ho.versions&&Ho.versions.node){const[o,e]=Ho.versions.node.split(".").map(Number);if(o>22||o===22&&e>=3||o===20&&e>=16)return Ho.getBuiltinModule(i)}return mh(i)};Yh("node:util");const kh=new Uint8Array(128),Lh=new Uint8Array(128),Zh=new Uint8Array(128);for(let i=0;i<128;i++)kh[i]=i>=65&&i<=90?1:0,Lh[i]=i>=97&&i<=122?1:0,Zh[i]=i>=48&&i<=57?1:0;const Sh=Eu(import.meta.url),Bo=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Jh=i=>{if(typeof Bo<"u"&&Bo.versions&&Bo.versions.node){const[o,e]=Bo.versions.node.split(".").map(Number);if(o>22||o===22&&e>=3||o===20&&e>=16)return Bo.getBuiltinModule(i)}return Sh(i)};Jh("node:util");const La=new fh(100),Ch=new Intl.Segmenter("en",{granularity:"grapheme"}),Xh=/^[\u0000-\u007F]*$/,Hh=new Set(["0","22","23","24","27","28","29","39","49"]),Bh=new Set(["1","3","4","7","8","9"]),Za=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),Vo=i=>i>="30"&&i<="37"||i>="90"&&i<="97"||i.startsWith("38;"),$o=i=>i>="40"&&i<="47"||i>="100"&&i<="107"||i.startsWith("48;"),Th=[{close:"\x1B[22m",open:"\x1B[1m"},{close:"\x1B[23m",open:"\x1B[3m"},{close:"\x1B[24m",open:"\x1B[4m"},{close:"\x1B[27m",open:"\x1B[7m"},{close:"\x1B[28m",open:"\x1B[8m"},{close:"\x1B[29m",open:"\x1B[9m"}],Sa=(i,o)=>{let e=-1;for(const n of o){const a=i.indexOf(n);a!==-1&&(e===-1||a<e)&&(e=a)}return e},Dh=(i,o)=>{if(!i.includes("\x1B"))return[{after:"",before:"",content:i,visibleLength:z(i,o.width)}];const e=La.get(i);if(e)return e;const n=[],a=[];let u=0,t;for(qi.lastIndex=0;(t=qi.exec(i))!==null;){const s=t[0];n.push(i.slice(u,t.index)),a.push(s),u=t.index+s.length}u<i.length&&n.push(i.slice(u));const d=[];for(const s of a){if(s==="\x1B[0m"||s==="\x1B]8;;\x07"){d.push(s);continue}if(s.startsWith("\x1B[")&&s.endsWith("m")){const l=s.slice(2,-1);if(Hh.has(l)){d.push(s);continue}}}const g=new Set,r=[];for(const[s,l]of n.entries()){if(s>0&&a[s-1]){const y=a[s-1];if(y==="\x1B[0m")g.clear();else if(y==="\x1B]8;;\x07"){for(const b of g)if(b.startsWith("\x1B]8;;")&&!b.endsWith("\x1B]8;;\x07")){g.delete(b);break}}else if(y.startsWith("\x1B[")&&y.endsWith("m")){const b=y.slice(2,-1);if(b==="39"){for(const w of g)if(w.startsWith("\x1B[")&&w.endsWith("m")){const p=w.slice(2,-1);if(Vo(p)){g.delete(w);break}}}else if(b==="49"){for(const w of g)if(w.startsWith("\x1B[")&&w.endsWith("m")){const p=w.slice(2,-1);if($o(p)){g.delete(w);break}}}else if(Za.has(b)){const w=Za.get(b);for(const p of g)if(p===`\x1B[${w}m`){g.delete(p);break}}else{if(Vo(b)){for(const w of g)if(w.startsWith("\x1B[")&&w.endsWith("m")){const p=w.slice(2,-1);if(Vo(p)){g.delete(w);break}}}else if($o(b)){for(const w of g)if(w.startsWith("\x1B[")&&w.endsWith("m")){const p=w.slice(2,-1);if($o(p)){g.delete(w);break}}}else if(Bh.has(b)){const w=`\x1B[${b}m`;g.has(w)&&g.delete(w)}g.add(y)}}else if(y.startsWith("\x1B]8;;")&&!y.endsWith("\x1B]8;;\x07")){for(const b of g)if(b.startsWith("\x1B]8;;")&&!b.endsWith("\x1B]8;;\x07")){g.delete(b);break}g.add(y)}}if(l==="")continue;let v="";if(g.size>0)if(d.includes("\x1B[0m"))v="\x1B[0m";else{const y=[];let b=!1;for(const f of g)if(f.startsWith("\x1B]8;;")&&!f.endsWith("\x1B]8;;\x07")){b=!0;break}b&&d.includes("\x1B]8;;\x07")&&y.push("\x1B]8;;\x07");let w=!1,p=!1;for(const f of g)if(f.startsWith("\x1B[")&&f.endsWith("m")){const m=f.slice(2,-1);Vo(m)?w=!0:$o(m)&&(p=!0)}if(w&&p){const f=Sa(i,["\x1B[3","\x1B[9","\x1B[38;"]),m=Sa(i,["\x1B[4","\x1B[10","\x1B[48;"]);f>=0&&m>=0?f>m?y.push("\x1B[39m","\x1B[49m"):y.push("\x1B[49m","\x1B[39m"):y.push("\x1B[39m","\x1B[49m")}else w&&y.push("\x1B[39m"),p&&y.push("\x1B[49m");w&&p&&i.includes("\x1B[39m")&&i.includes("\x1B[49m")&&(i.indexOf("\x1B[39m")<i.indexOf("\x1B[49m")?(y.length-=2,y.push("\x1B[39m","\x1B[49m")):i.indexOf("\x1B[49m")<i.indexOf("\x1B[39m")&&(y.length-=2,y.push("\x1B[49m","\x1B[39m")));const j=Th.filter(f=>g.has(f.open)).map(f=>({position:i.indexOf(f.open),style:f})).filter(f=>f.position>=0).toSorted((f,m)=>m.position-f.position);for(const f of j){const m=f;d.includes(m.style.close)&&y.push(m.style.close)}v=y.join("")}const c=[...g].join("");r.push({after:v,before:c,content:l,visibleLength:z(l,{fullWidth:1,wideWidth:1})})}return La.set(i,r),r},Mh=(i,o,e,n)=>{const a=[...n.segmenter.segment(i)],u=[];let t=0,d=!1;for(const g of a){const r=z(g.segment,n.width),s=t,l=t+r;if(!d)if(s<o){t=l;continue}else d=!0;if(s>=e||l>e)break;u.push(g.segment),t=l}return u.join("")},Pi=(i,o=0,e=Number.MAX_SAFE_INTEGER,n={})=>{const a={segmenter:Ch,...n};if(o>=e||i==="")return"";const u=z(i,a.width);if(o===0&&e>=u)return i;if(o<0||e<0)throw new RangeError("Negative indices aren't supported");if(!i.includes("\x1B"))return Xh.test(i)?i.slice(o,e):Mh(i,o,e,a);if(ma.lastIndex=0,Ya.lastIndex=0,!ma.test(i)&&!Ya.test(i))return i;const t=Dh(i,a);if(t.length===0)return"";let d=0;const g=[];for(const[l,v]of t.entries()){const c=d,y=d+v.visibleLength;if(y>o&&c<e){const b=Math.max(0,o-c),w=Math.min(v.visibleLength,e-c);g.push({end:w,index:l,segment:v,start:b})}d=y}if(g.length===0)return"";const r=[],s=g[0].segment;r.push(s.before);for(let l=0;l<g.length;l++){const{end:v,segment:c,start:y}=g[l];if(y===0&&v===c.visibleLength)r.push(c.content);else{const b=[...a.segmenter.segment(c.content)];r.push(b.slice(y,v).map(w=>w.segment).join(""))}if(l<g.length-1){const b=g[l+1].segment,w=c.after,p=b.before;w!==p&&(w||p)&&r.push(w,p)}}return r.push(g.at(-1).segment.after),r.join("")},Ja="…",Qh=3,ie=(i,o,e=!1)=>{if(i.charAt(o)===" ")return o;const n=e?1:-1,a=Math.min(Qh,e?i.length-o:o);for(let u=1;u<=a;u++){const t=o+u*n;if(i.charAt(t)===" ")return t}return o},oe=(i,o,e)=>bo(i,{...e,ellipsis:"",ellipsisWidth:0,limit:o}).index,ee=(i,o,e)=>z(i.slice(0,o),e),Ca=(i,o,e={})=>{if(typeof i!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof i}`);if(typeof o!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof o}`);if(i===""||o<=0)return"";const n=i.normalize("NFC"),{ellipsis:a=Ja,position:u="end",preferTruncationOnSpace:t=!1}=e;let d=e.ellipsisWidth??(a===Ja?1:void 0);d??=bo(a,{...e.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:g}=bo(n,{...e.width,ellipsis:a,ellipsisWidth:d});if(g<=o)return n;switch(u){case"end":{if(t){const r=o-d,s=oe(n,r,e.width),l=ie(n,s),v=ee(n,l,e.width);return Pi(n,0,v,{width:e.width})+a}return Pi(n,0,o-d,{width:e.width})+a}case"middle":{const r=Math.floor(o/2),s=Math.max(0,o-d),l=Math.min(r,s),v=Math.max(0,s-l);if(t){const c=oe(n,l,e.width),y=ie(n,c),b=ee(n,y,e.width),w=g-v,p=oe(n,w,e.width),j=ie(n,p,!0),f=ee(n,j,e.width);return Pi(n,0,b,{width:e.width})+a+Pi(n,f,g,{width:e.width}).trim()}return Pi(n,0,l,{width:e.width})+a+Pi(n,g-v,g,{width:e.width})}case"start":{if(t){const r=g-o+d,s=oe(n,r,e.width),l=ie(n,s,!0),v=ee(n,l,e.width);return a+Pi(n,v,g,{width:e.width}).trim()}return a+Pi(n,g-o+d,g,{width:e.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${u}'`)}};function xh(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Oe,Xa;function Gh(){if(Xa)return Oe;Xa=1,Oe=o;function i(n){return n instanceof Buffer?Buffer.from(n):new n.constructor(n.buffer.slice(),n.byteOffset,n.length)}function o(n){if(n=n||{},n.circles)return e(n);const a=new Map;if(a.set(Date,r=>new Date(r)),a.set(Map,(r,s)=>new Map(t(Array.from(r),s))),a.set(Set,(r,s)=>new Set(t(Array.from(r),s))),n.constructorHandlers)for(const r of n.constructorHandlers)a.set(r[0],r[1]);let u=null;return n.proto?g:d;function t(r,s){const l=Object.keys(r),v=new Array(l.length);for(let c=0;c<l.length;c++){const y=l[c],b=r[y];typeof b!="object"||b===null?v[y]=b:b.constructor!==Object&&(u=a.get(b.constructor))?v[y]=u(b,s):ArrayBuffer.isView(b)?v[y]=i(b):v[y]=s(b)}return v}function d(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return t(r,d);if(r.constructor!==Object&&(u=a.get(r.constructor)))return u(r,d);const s={};for(const l in r){if(Object.hasOwnProperty.call(r,l)===!1)continue;const v=r[l];typeof v!="object"||v===null?s[l]=v:v.constructor!==Object&&(u=a.get(v.constructor))?s[l]=u(v,d):ArrayBuffer.isView(v)?s[l]=i(v):s[l]=d(v)}return s}function g(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return t(r,g);if(r.constructor!==Object&&(u=a.get(r.constructor)))return u(r,g);const s={};for(const l in r){const v=r[l];typeof v!="object"||v===null?s[l]=v:v.constructor!==Object&&(u=a.get(v.constructor))?s[l]=u(v,g):ArrayBuffer.isView(v)?s[l]=i(v):s[l]=g(v)}return s}}function e(n){const a=[],u=[],t=new Map;if(t.set(Date,l=>new Date(l)),t.set(Map,(l,v)=>new Map(g(Array.from(l),v))),t.set(Set,(l,v)=>new Set(g(Array.from(l),v))),n.constructorHandlers)for(const l of n.constructorHandlers)t.set(l[0],l[1]);let d=null;return n.proto?s:r;function g(l,v){const c=Object.keys(l),y=new Array(c.length);for(let b=0;b<c.length;b++){const w=c[b],p=l[w];if(typeof p!="object"||p===null)y[w]=p;else if(p.constructor!==Object&&(d=t.get(p.constructor)))y[w]=d(p,v);else if(ArrayBuffer.isView(p))y[w]=i(p);else{const j=a.indexOf(p);j!==-1?y[w]=u[j]:y[w]=v(p)}}return y}function r(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return g(l,r);if(l.constructor!==Object&&(d=t.get(l.constructor)))return d(l,r);const v={};a.push(l),u.push(v);for(const c in l){if(Object.hasOwnProperty.call(l,c)===!1)continue;const y=l[c];if(typeof y!="object"||y===null)v[c]=y;else if(y.constructor!==Object&&(d=t.get(y.constructor)))v[c]=d(y,r);else if(ArrayBuffer.isView(y))v[c]=i(y);else{const b=a.indexOf(y);b!==-1?v[c]=u[b]:v[c]=r(y)}}return a.pop(),u.pop(),v}function s(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return g(l,s);if(l.constructor!==Object&&(d=t.get(l.constructor)))return d(l,s);const v={};a.push(l),u.push(v);for(const c in l){const y=l[c];if(typeof y!="object"||y===null)v[c]=y;else if(y.constructor!==Object&&(d=t.get(y.constructor)))v[c]=d(y,s);else if(ArrayBuffer.isView(y))v[c]=i(y);else{const b=a.indexOf(y);b!==-1?v[c]=u[b]:v[c]=s(y)}}return a.pop(),u.pop(),v}}return Oe}var Wh=Gh();const Vu=xh(Wh);Vu();var $u=typeof global=="object"&&global&&global.Object===Object&&global,Nh=typeof self=="object"&&self&&self.Object===Object&&self,I=$u||Nh||Function("return this")(),$=I.Symbol,it=Object.prototype,Ph=it.hasOwnProperty,Fh=it.toString,To=$?$.toStringTag:void 0;function Rh(i){var o=Ph.call(i,To),e=i[To];try{i[To]=void 0;var n=!0}catch{}var a=Fh.call(i);return n&&(o?i[To]=e:delete i[To]),a}var Ah=Object.prototype,Kh=Ah.toString;function Oh(i){return Kh.call(i)}var Eh="[object Null]",_h="[object Undefined]",Ha=$?$.toStringTag:void 0;function oi(i){return i==null?i===void 0?_h:Eh:Ha&&Ha in Object(i)?Rh(i):Oh(i)}function O(i){return i!=null&&typeof i=="object"}var zh="[object Symbol]";function gi(i){return typeof i=="symbol"||O(i)&&oi(i)==zh}var Ih=NaN;function Ba(i){return typeof i=="number"?i:gi(i)?Ih:+i}function A(i,o){for(var e=-1,n=i==null?0:i.length,a=Array(n);++e<n;)a[e]=o(i[e],e,i);return a}var C=Array.isArray,Ta=$?$.prototype:void 0,Da=Ta?Ta.toString:void 0;function hi(i){if(typeof i=="string")return i;if(C(i))return A(i,hi)+"";if(gi(i))return Da?Da.call(i):"";var o=i+"";return o=="0"&&1/i==-1/0?"-0":o}function we(i,o){return function(e,n){var a;if(e===void 0&&n===void 0)return o;if(e!==void 0&&(a=e),n!==void 0){if(a===void 0)return n;typeof e=="string"||typeof n=="string"?(e=hi(e),n=hi(n)):(e=Ba(e),n=Ba(n)),a=i(e,n)}return a}}var qh=we(function(i,o){return i+o},0),Uh=/\s/;function ot(i){for(var o=i.length;o--&&Uh.test(i.charAt(o)););return o}var Vh=/^\s+/;function et(i){return i&&i.slice(0,ot(i)+1).replace(Vh,"")}function K(i){var o=typeof i;return i!=null&&(o=="object"||o=="function")}var Ma=NaN,$h=/^[-+]0x[0-9a-f]+$/i,ir=/^0b[01]+$/i,or=/^0o[0-7]+$/i,er=parseInt;function yi(i){if(typeof i=="number")return i;if(gi(i))return Ma;if(K(i)){var o=typeof i.valueOf=="function"?i.valueOf():i;i=K(o)?o+"":o}if(typeof i!="string")return i===0?i:+i;i=et(i);var e=ir.test(i);return e||or.test(i)?er(i.slice(2),e?2:8):$h.test(i)?Ma:+i}var Qa=1/0,nr=17976931348623157e292;function Di(i){if(!i)return i===0?i:0;if(i=yi(i),i===Qa||i===-Qa){var o=i<0?-1:1;return o*nr}return i===i?i:0}function H(i){var o=Di(i),e=o%1;return o===o?e?o-e:o:0}var ar="Expected a function";function ur(i,o){if(typeof o!="function")throw new TypeError(ar);return i=H(i),function(){if(--i<1)return o.apply(this,arguments)}}function ai(i){return i}var tr="[object AsyncFunction]",dr="[object Function]",gr="[object GeneratorFunction]",hr="[object Proxy]";function Mi(i){if(!K(i))return!1;var o=oi(i);return o==dr||o==gr||o==tr||o==hr}var te=I["__core-js_shared__"],xa=(function(){var i=/[^.]+$/.exec(te&&te.keys&&te.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""})();function rr(i){return!!xa&&xa in i}var sr=Function.prototype,lr=sr.toString;function eo(i){if(i!=null){try{return lr.call(i)}catch{}try{return i+""}catch{}}return""}var vr=/[\\^$.*+?()[\]{}|]/g,yr=/^\[object .+?Constructor\]$/,cr=Function.prototype,br=Object.prototype,pr=cr.toString,wr=br.hasOwnProperty,jr=RegExp("^"+pr.call(wr).replace(vr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nt(i){if(!K(i)||rr(i))return!1;var o=Mi(i)?jr:yr;return o.test(eo(i))}function fr(i,o){return i?.[o]}function no(i,o){var e=fr(i,o);return nt(e)?e:void 0}var Go=no(I,"WeakMap"),se=Go&&new Go,at=se?function(i,o){return se.set(i,o),i}:ai,Ga=Object.create,fo=(function(){function i(){}return function(o){if(!K(o))return{};if(Ga)return Ga(o);i.prototype=o;var e=new i;return i.prototype=void 0,e}})();function Wo(i){return function(){var o=arguments;switch(o.length){case 0:return new i;case 1:return new i(o[0]);case 2:return new i(o[0],o[1]);case 3:return new i(o[0],o[1],o[2]);case 4:return new i(o[0],o[1],o[2],o[3]);case 5:return new i(o[0],o[1],o[2],o[3],o[4]);case 6:return new i(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new i(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var e=fo(i.prototype),n=i.apply(e,o);return K(n)?n:e}}var mr=1;function Yr(i,o,e){var n=o&mr,a=Wo(i);function u(){var t=this&&this!==I&&this instanceof u?a:i;return t.apply(n?e:this,arguments)}return u}function ri(i,o,e){switch(e.length){case 0:return i.call(o);case 1:return i.call(o,e[0]);case 2:return i.call(o,e[0],e[1]);case 3:return i.call(o,e[0],e[1],e[2])}return i.apply(o,e)}var kr=Math.max;function ut(i,o,e,n){for(var a=-1,u=i.length,t=e.length,d=-1,g=o.length,r=kr(u-t,0),s=Array(g+r),l=!n;++d<g;)s[d]=o[d];for(;++a<t;)(l||a<u)&&(s[e[a]]=i[a]);for(;r--;)s[d++]=i[a++];return s}var Lr=Math.max;function tt(i,o,e,n){for(var a=-1,u=i.length,t=-1,d=e.length,g=-1,r=o.length,s=Lr(u-d,0),l=Array(s+r),v=!n;++a<s;)l[a]=i[a];for(var c=a;++g<r;)l[c+g]=o[g];for(;++t<d;)(v||a<u)&&(l[c+e[t]]=i[a++]);return l}function Zr(i,o){for(var e=i.length,n=0;e--;)i[e]===o&&++n;return n}function je(){}var Sr=4294967295;function M(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Sr,this.__views__=[]}M.prototype=fo(je.prototype);M.prototype.constructor=M;function kn(){}var Ln=se?function(i){return se.get(i)}:kn,yo={},Jr=Object.prototype,Cr=Jr.hasOwnProperty;function de(i){for(var o=i.name+"",e=yo[o],n=Cr.call(yo,o)?e.length:0;n--;){var a=e[n],u=a.func;if(u==null||u==i)return a.name}return o}function bi(i,o){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=void 0}bi.prototype=fo(je.prototype);bi.prototype.constructor=bi;function ni(i,o){var e=-1,n=i.length;for(o||(o=Array(n));++e<n;)o[e]=i[e];return o}function dt(i){if(i instanceof M)return i.clone();var o=new bi(i.__wrapped__,i.__chain__);return o.__actions__=ni(i.__actions__),o.__index__=i.__index__,o.__values__=i.__values__,o}var Xr=Object.prototype,Hr=Xr.hasOwnProperty;function h(i){if(O(i)&&!C(i)&&!(i instanceof M)){if(i instanceof bi)return i;if(Hr.call(i,"__wrapped__"))return dt(i)}return new bi(i)}h.prototype=je.prototype;h.prototype.constructor=h;function tn(i){var o=de(i),e=h[o];if(typeof e!="function"||!(o in M.prototype))return!1;if(i===e)return!0;var n=Ln(e);return!!n&&i===n[0]}var Br=800,Tr=16,Dr=Date.now;function gt(i){var o=0,e=0;return function(){var n=Dr(),a=Tr-(n-e);if(e=n,a>0){if(++o>=Br)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}var ht=gt(at),Mr=/\{\n\/\* \[wrapped with (.+)\] \*/,Qr=/,? & /;function xr(i){var o=i.match(Mr);return o?o[1].split(Qr):[]}var Gr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function Wr(i,o){var e=o.length;if(!e)return i;var n=e-1;return o[n]=(e>1?"& ":"")+o[n],o=o.join(e>2?", ":" "),i.replace(Gr,`{
1
+ import{createRequire as Hg}from"node:module";const Bg=Hg(import.meta.url),Xo=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Tg=i=>{if(typeof Xo<"u"&&Xo.versions&&Xo.versions.node){const[o,e]=Xo.versions.node.split(".").map(Number);if(o>22||o===22&&e>=3||o===20&&e>=16)return Xo.getBuiltinModule(i)}return Bg(i)},{createRequire:Dg}=Tg("node:module"),Mg=Dg(import.meta.url),so=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,be=i=>{if(typeof so<"u"&&so.versions&&so.versions.node){const[o,e]=so.versions.node.split(".").map(Number);if(o>22||o===22&&e>=3||o===20&&e>=16)return so.getBuiltinModule(i)}return Mg(i)},{createRequire:Eu}=be("node:module"),Ui=so,{execFileSync:Qg}=be("node:child_process"),Mo=be("node:fs"),xg=be("node:tty"),Gg=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Wg=12288,Ng=65510,Pg=[12288,12288,65281,65376,65504,65510],Fg=8361,Rg=65518,Ag=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Kg=32,Og=10630,Eg=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],_g=4352,zg=262141,_u=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],Ro=(i,o)=>{let e=0,n=Math.floor(i.length/2)-1;for(;e<=n;){const a=Math.floor((e+n)/2),u=a*2;if(o<i[u])n=a-1;else if(o>i[u+1])e=a+1;else return!0}return!1},ja=19968,[Ig,qg]=Ug(_u);function Ug(i){let o=i[0],e=i[1];for(let n=0;n<i.length;n+=2){const a=i[n],u=i[n+1];if(ja>=a&&ja<=u)return[a,u];u-a>e-o&&(o=a,e=u)}return[o,e]}const Vg=i=>i<161||i>1114109?!1:Ro(Gg,i),$g=i=>i<Wg||i>Ng?!1:Ro(Pg,i),ih=i=>i<Fg||i>Rg?!1:Ro(Ag,i),oh=i=>i<Kg||i>Og?!1:Ro(Eg,i),eh=i=>i>=Ig&&i<=qg?!0:i<_g||i>zg?!1:Ro(_u,i);function nh(i){return Vg(i)?"ambiguous":$g(i)?"fullwidth":ih(i)?"halfwidth":oh(i)?"narrow":eh(i)?"wide":"neutral"}function ah(i){if(!Number.isSafeInteger(i))throw new TypeError(`Expected a code point, got \`${typeof i}\`.`)}function zu(i){return ah(i),nh(i)}const Iu=String.raw,fa=Iu`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,uh=()=>new RegExp(Iu`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${fa}(?:\u200D${fa})*`,"gu"),jo=new Set(["\x1B","›"]),pe="\x07",qu="[",Yn="m",xo="]8;;",th=39,dh=/[\u200B\uFEFF\u2060-\u2064]/g,gh=new RegExp(`(?:\\${qu}(?<code>\\d+)m|\\${xo}(?<uri>.*)${pe})`),hh=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),rh=/^[ \t]*(?:\r\n|\r|\n)/,sh=/(?:\r\n|\r|\n)[ \t]*$/,lh=/^(?:[\r\n]|$)/,vh=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,yh=/^[ \t]*[\r\n][ \t\r\n]*$/,ch=/\r\n|\n|\r/g,qi=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,ma=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,Ya=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,qo=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Ke=uh(),ka=new Map,bh=i=>[i.ambiguousIsNarrow?1:0,i.control,i.fullWidth,i.regular,i.wide].join("|"),ph=i=>{const o=bh(i.width);let e=ka.get(o);return e||(e=new Map,ka.set(o,e)),e},Uo=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Uu=i=>i>=32&&i<=126?"latin":i===8203||i===8204||i===8205||i===8288?"zero":i<=31||i>=127&&i<=159?"control":i>=160&&i<=255||i>=9472&&i<=9599?"latin":i>=4352&&i<=4607||i>=11904&&i<=40959||i>=44032&&i<=55215||i>=63744&&i<=64255||i>=65280&&i<=65519&&!(i>=65377&&i<=65439)||i>=12352&&i<=12543?"wide":i===8230?"latin":"other",wh=(i,o)=>{const e=ph(o),n=Math.floor(i/65536),a=i%65536;let u=e.get(n);if(u||(u=new Map,e.set(n,u)),u.has(a))return u.get(a);let t;switch(Uu(i)){case"control":{t=o.width.control;break}case"latin":{t=o.width.regular;break}case"wide":{t=o.width.wide;break}case"zero":{t=0;break}default:switch(zu(i)){case"ambiguous":{t=o.width.ambiguousIsNarrow?o.width.regular:o.width.wide;break}case"fullwidth":{t=o.width.fullWidth;break}case"wide":{t=o.width.wide;break}default:t=o.width.regular}}return u.set(a,t),t},jh=i=>i>=768&&i<=879||i>=6832&&i<=6911||i>=7616&&i<=7679||i>=8400&&i<=8447||i>=65056&&i<=65071||i>=917760&&i<=917999||i>=65024&&i<=65039||i>=3633&&i<=3642||i>=3655&&i<=3662||i>=3761&&i<=3769||i>=3771&&i<=3772||i>=3784&&i<=3789||i>=2304&&i<=2307||i>=2362&&i<=2383||i>=2385&&i<=2391||i>=2402&&i<=2403||i>=2433&&i<=2435||i>=2492&&i<=2500||i>=2509&&i<=2509||i>=2561&&i<=2563||i>=2620&&i<=2637||i>=1611&&i<=1631||i>=1648&&i<=1648||i>=1750&&i<=1773||i>=2276&&i<=2302||i>=1425&&i<=1469||i>=1471&&i<=1471||i>=1473&&i<=1474||i>=1476&&i<=1477||i>=1479&&i<=1479||i>=3893&&i<=3893||i>=3895&&i<=3895||i>=3897&&i<=3897||i>=3953&&i<=3966||i>=3968&&i<=3972||i>=3974&&i<=3975?!0:i>=768&&i<=777||i>=803&&i<=803,bo=(i,o={})=>{if(!i||i.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const e={truncation:{countAnsiEscapeCodes:o.countAnsiEscapeCodes??!1,ellipsis:o.ellipsis??"",ellipsisWidth:o.ellipsisWidth??(o.ellipsis?bo(o.ellipsis,{...o,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:o.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:o.ambiguousIsNarrow??!1,ansi:o.ansiWidth??0,control:o.controlWidth??0,emoji:o.emojiWidth??2,fullWidth:o.fullWidth??2,halfWidth:o.halfWidth??1,regular:o.regularWidth??1,tab:o.tabWidth??8,wide:o.wideWidth??2}},n=Math.max(0,e.truncation.limit-e.truncation.ellipsisWidth),{length:a}=i,u=a>1e4;let t=0,d=0,g=a,r=!1;const s=i.includes("\x1B")||i.includes("›");for(;t<a;){if(s&&(i[t]==="\x1B"||i[t]==="›")){if(i.startsWith("\x1B]8;;",t)){const w="\x1B]8;;\x07",p=w.length,j=i.indexOf("\x07",t+5);if(j!==-1){const f=i.indexOf(w,j+1);if(f!==-1){const m=f+p,k=i.slice(j+1,f).replace(qi,""),Z=bo(k,{ambiguousIsNarrow:e.width.ambiguousIsNarrow,ansiWidth:e.width.ansi,controlWidth:e.width.control,countAnsiEscapeCodes:!1,ellipsis:e.truncation.ellipsis,ellipsisWidth:e.truncation.ellipsisWidth,emojiWidth:e.width.emoji,fullWidth:e.width.fullWidth,halfWidth:e.width.halfWidth,limit:Math.max(0,n-d),regularWidth:e.width.regular,tabWidth:e.width.tab,wideWidth:e.width.wide}),D=Z.width;if(Z.truncated)r=!0,g=Math.min(g,t);else if(d+D>n&&(g=Math.min(g,t),r=!0,d+D>e.truncation.limit))break;if(d+=D,t=m,r&&d>=e.truncation.limit)break;continue}}}if(qi.lastIndex=t,qi.test(i)){const w=qi.lastIndex-t,p=e.truncation.countAnsiEscapeCodes?w:e.width.ansi;if(d+p>n&&(g=Math.min(g,t),d+p>e.truncation.limit)){r=!0;break}d+=p,t=qi.lastIndex;continue}}const c=i.codePointAt(t);if(c===8203||c===65279||c>=8288&&c<=8292){t+=1;continue}if(c===9){if(d+e.width.tab>n&&(g=Math.min(g,t),d+e.width.tab>e.truncation.limit)){r=!0;break}d+=e.width.tab,t+=1;continue}if(Uo.lastIndex=t,Uo.test(i)){const w=(Uo.lastIndex-t)*e.width.regular;if(d+w>n){const p=Math.floor((n-d)/e.width.regular);if(g=Math.min(g,t+p),d+w>e.truncation.limit){r=!0;break}}d+=w,t=Uo.lastIndex;continue}if((c<=31||c>=127&&c<=159)&&(qo.lastIndex=t,qo.test(i))){const w=(qo.lastIndex-t)*e.width.control;if(d+w>n&&(g=Math.min(g,t+Math.floor((n-d)/e.width.control)),d+w>e.truncation.limit)){r=!0;break}d+=w,t=qo.lastIndex;continue}if(Ke.lastIndex=t,Ke.test(i)){if(d+e.width.emoji>n&&(g=Math.min(g,t),d+e.width.emoji>e.truncation.limit)){r=!0;break}d+=e.width.emoji,t=Ke.lastIndex;continue}const y=i.codePointAt(t)??0;if(jh(y)){t+=y>65535?2:1;continue}let b;if(u)b=wh(y,e);else switch(Uu(y)){case"control":{b=e.width.control;break}case"latin":{b=e.width.regular;break}case"wide":{b=e.width.wide;break}case"zero":{b=0;break}default:switch(zu(y)){case"ambiguous":{b=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{b=e.width.fullWidth;break}case"wide":{b=e.width.wide;break}default:b=e.width.regular}}if(d+b>n&&(g=Math.min(g,t),d+b>e.truncation.limit)){r=!0;break}d+=b,t+=y>65535?2:1}let l=d,v=!1;return r&&e.truncation.limit>=e.truncation.ellipsisWidth&&(l=e.truncation.limit,v=!0),{ellipsed:v,index:r?g:a,truncated:r,width:l}},z=(i,o={})=>bo(i,{...o,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;let fh=class{capacity;cache;constructor(i){this.capacity=i,this.cache=new Map}get(i){if(!this.cache.has(i))return;const o=this.cache.get(i);return this.cache.delete(i),this.cache.set(i,o),o}has(i){return this.cache.has(i)}set(i,o){if(this.cache.has(i))this.cache.delete(i);else if(this.cache.size>=this.capacity){const e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}this.cache.set(i,o)}delete(i){this.cache.delete(i)}clear(){this.cache.clear()}size(){return this.cache.size}};const mh=Eu(import.meta.url),Ho=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Yh=i=>{if(typeof Ho<"u"&&Ho.versions&&Ho.versions.node){const[o,e]=Ho.versions.node.split(".").map(Number);if(o>22||o===22&&e>=3||o===20&&e>=16)return Ho.getBuiltinModule(i)}return mh(i)};Yh("node:util");const kh=new Uint8Array(128),Lh=new Uint8Array(128),Zh=new Uint8Array(128);for(let i=0;i<128;i++)kh[i]=i>=65&&i<=90?1:0,Lh[i]=i>=97&&i<=122?1:0,Zh[i]=i>=48&&i<=57?1:0;const Sh=Eu(import.meta.url),Bo=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Jh=i=>{if(typeof Bo<"u"&&Bo.versions&&Bo.versions.node){const[o,e]=Bo.versions.node.split(".").map(Number);if(o>22||o===22&&e>=3||o===20&&e>=16)return Bo.getBuiltinModule(i)}return Sh(i)};Jh("node:util");const La=new fh(100),Ch=new Intl.Segmenter("en",{granularity:"grapheme"}),Xh=/^[\u0000-\u007F]*$/,Hh=new Set(["0","22","23","24","27","28","29","39","49"]),Bh=new Set(["1","3","4","7","8","9"]),Za=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),Vo=i=>i>="30"&&i<="37"||i>="90"&&i<="97"||i.startsWith("38;"),$o=i=>i>="40"&&i<="47"||i>="100"&&i<="107"||i.startsWith("48;"),Th=[{close:"\x1B[22m",open:"\x1B[1m"},{close:"\x1B[23m",open:"\x1B[3m"},{close:"\x1B[24m",open:"\x1B[4m"},{close:"\x1B[27m",open:"\x1B[7m"},{close:"\x1B[28m",open:"\x1B[8m"},{close:"\x1B[29m",open:"\x1B[9m"}],Sa=(i,o)=>{let e=-1;for(const n of o){const a=i.indexOf(n);a!==-1&&(e===-1||a<e)&&(e=a)}return e},Dh=(i,o)=>{if(!i.includes("\x1B"))return[{after:"",before:"",content:i,visibleLength:z(i,o.width)}];const e=La.get(i);if(e)return e;const n=[],a=[];let u=0,t;for(qi.lastIndex=0;(t=qi.exec(i))!==null;){const s=t[0];n.push(i.slice(u,t.index)),a.push(s),u=t.index+s.length}u<i.length&&n.push(i.slice(u));const d=[];for(const s of a){if(s==="\x1B[0m"||s==="\x1B]8;;\x07"){d.push(s);continue}if(s.startsWith("\x1B[")&&s.endsWith("m")){const l=s.slice(2,-1);if(Hh.has(l)){d.push(s);continue}}}const g=new Set,r=[];for(const[s,l]of n.entries()){if(s>0&&a[s-1]){const y=a[s-1];if(y==="\x1B[0m")g.clear();else if(y==="\x1B]8;;\x07"){for(const b of g)if(b.startsWith("\x1B]8;;")&&!b.endsWith("\x1B]8;;\x07")){g.delete(b);break}}else if(y.startsWith("\x1B[")&&y.endsWith("m")){const b=y.slice(2,-1);if(b==="39"){for(const w of g)if(w.startsWith("\x1B[")&&w.endsWith("m")){const p=w.slice(2,-1);if(Vo(p)){g.delete(w);break}}}else if(b==="49"){for(const w of g)if(w.startsWith("\x1B[")&&w.endsWith("m")){const p=w.slice(2,-1);if($o(p)){g.delete(w);break}}}else if(Za.has(b)){const w=Za.get(b);for(const p of g)if(p===`\x1B[${w}m`){g.delete(p);break}}else{if(Vo(b)){for(const w of g)if(w.startsWith("\x1B[")&&w.endsWith("m")){const p=w.slice(2,-1);if(Vo(p)){g.delete(w);break}}}else if($o(b)){for(const w of g)if(w.startsWith("\x1B[")&&w.endsWith("m")){const p=w.slice(2,-1);if($o(p)){g.delete(w);break}}}else if(Bh.has(b)){const w=`\x1B[${b}m`;g.has(w)&&g.delete(w)}g.add(y)}}else if(y.startsWith("\x1B]8;;")&&!y.endsWith("\x1B]8;;\x07")){for(const b of g)if(b.startsWith("\x1B]8;;")&&!b.endsWith("\x1B]8;;\x07")){g.delete(b);break}g.add(y)}}if(l==="")continue;let v="";if(g.size>0)if(d.includes("\x1B[0m"))v="\x1B[0m";else{const y=[];let b=!1;for(const f of g)if(f.startsWith("\x1B]8;;")&&!f.endsWith("\x1B]8;;\x07")){b=!0;break}b&&d.includes("\x1B]8;;\x07")&&y.push("\x1B]8;;\x07");let w=!1,p=!1;for(const f of g)if(f.startsWith("\x1B[")&&f.endsWith("m")){const m=f.slice(2,-1);Vo(m)?w=!0:$o(m)&&(p=!0)}if(w&&p){const f=Sa(i,["\x1B[3","\x1B[9","\x1B[38;"]),m=Sa(i,["\x1B[4","\x1B[10","\x1B[48;"]);f>=0&&m>=0?f>m?y.push("\x1B[39m","\x1B[49m"):y.push("\x1B[49m","\x1B[39m"):y.push("\x1B[39m","\x1B[49m")}else w&&y.push("\x1B[39m"),p&&y.push("\x1B[49m");w&&p&&i.includes("\x1B[39m")&&i.includes("\x1B[49m")&&(i.indexOf("\x1B[39m")<i.indexOf("\x1B[49m")?(y.length-=2,y.push("\x1B[39m","\x1B[49m")):i.indexOf("\x1B[49m")<i.indexOf("\x1B[39m")&&(y.length-=2,y.push("\x1B[49m","\x1B[39m")));const j=Th.filter(f=>g.has(f.open)).map(f=>({position:i.indexOf(f.open),style:f})).filter(f=>f.position>=0).toSorted((f,m)=>m.position-f.position);for(const f of j){const m=f;d.includes(m.style.close)&&y.push(m.style.close)}v=y.join("")}const c=[...g].join("");r.push({after:v,before:c,content:l,visibleLength:z(l,{fullWidth:1,wideWidth:1})})}return La.set(i,r),r},Mh=(i,o,e,n)=>{const a=[...n.segmenter.segment(i)],u=[];let t=0,d=!1;for(const g of a){const r=z(g.segment,n.width),s=t,l=t+r;if(!d)if(s<o){t=l;continue}else d=!0;if(s>=e||l>e)break;u.push(g.segment),t=l}return u.join("")},Pi=(i,o=0,e=Number.MAX_SAFE_INTEGER,n={})=>{const a={segmenter:Ch,...n};if(o>=e||i==="")return"";const u=z(i,a.width);if(o===0&&e>=u)return i;if(o<0||e<0)throw new RangeError("Negative indices aren't supported");if(!i.includes("\x1B"))return Xh.test(i)?i.slice(o,e):Mh(i,o,e,a);if(ma.lastIndex=0,Ya.lastIndex=0,!ma.test(i)&&!Ya.test(i))return i;const t=Dh(i,a);if(t.length===0)return"";let d=0;const g=[];for(const[l,v]of t.entries()){const c=d,y=d+v.visibleLength;if(y>o&&c<e){const b=Math.max(0,o-c),w=Math.min(v.visibleLength,e-c);g.push({end:w,index:l,segment:v,start:b})}d=y}if(g.length===0)return"";const r=[],s=g[0].segment;r.push(s.before);for(let l=0;l<g.length;l++){const{end:v,segment:c,start:y}=g[l];if(y===0&&v===c.visibleLength)r.push(c.content);else{const b=[...a.segmenter.segment(c.content)];r.push(b.slice(y,v).map(w=>w.segment).join(""))}if(l<g.length-1){const b=g[l+1].segment,w=c.after,p=b.before;w!==p&&(w||p)&&r.push(w,p)}}return r.push(g.at(-1).segment.after),r.join("")},Ja="…",Qh=3,ie=(i,o,e=!1)=>{if(i.charAt(o)===" ")return o;const n=e?1:-1,a=Math.min(Qh,e?i.length-o:o);for(let u=1;u<=a;u++){const t=o+u*n;if(i.charAt(t)===" ")return t}return o},oe=(i,o,e)=>bo(i,{...e,ellipsis:"",ellipsisWidth:0,limit:o}).index,ee=(i,o,e)=>z(i.slice(0,o),e),Ca=(i,o,e={})=>{if(typeof i!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof i}`);if(typeof o!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof o}`);if(i===""||o<=0)return"";const n=i.normalize("NFC"),{ellipsis:a=Ja,position:u="end",preferTruncationOnSpace:t=!1}=e;let d=e.ellipsisWidth??(a===Ja?1:void 0);d??=bo(a,{...e.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:g}=bo(n,{...e.width,ellipsis:a,ellipsisWidth:d});if(g<=o)return n;switch(u){case"end":{if(t){const r=o-d,s=oe(n,r,e.width),l=ie(n,s),v=ee(n,l,e.width);return Pi(n,0,v,{width:e.width})+a}return Pi(n,0,o-d,{width:e.width})+a}case"middle":{const r=Math.floor(o/2),s=Math.max(0,o-d),l=Math.min(r,s),v=Math.max(0,s-l);if(t){const c=oe(n,l,e.width),y=ie(n,c),b=ee(n,y,e.width),w=g-v,p=oe(n,w,e.width),j=ie(n,p,!0),f=ee(n,j,e.width);return Pi(n,0,b,{width:e.width})+a+Pi(n,f,g,{width:e.width}).trim()}return Pi(n,0,l,{width:e.width})+a+Pi(n,g-v,g,{width:e.width})}case"start":{if(t){const r=g-o+d,s=oe(n,r,e.width),l=ie(n,s,!0),v=ee(n,l,e.width);return a+Pi(n,v,g,{width:e.width}).trim()}return a+Pi(n,g-o+d,g,{width:e.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${u}'`)}};function xh(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Oe,Xa;function Gh(){if(Xa)return Oe;Xa=1,Oe=o;function i(n){return n instanceof Buffer?Buffer.from(n):new n.constructor(n.buffer.slice(),n.byteOffset,n.length)}function o(n){if(n=n||{},n.circles)return e(n);const a=new Map;if(a.set(Date,r=>new Date(r)),a.set(Map,(r,s)=>new Map(t(Array.from(r),s))),a.set(Set,(r,s)=>new Set(t(Array.from(r),s))),n.constructorHandlers)for(const r of n.constructorHandlers)a.set(r[0],r[1]);let u=null;return n.proto?g:d;function t(r,s){const l=Object.keys(r),v=new Array(l.length);for(let c=0;c<l.length;c++){const y=l[c],b=r[y];typeof b!="object"||b===null?v[y]=b:b.constructor!==Object&&(u=a.get(b.constructor))?v[y]=u(b,s):ArrayBuffer.isView(b)?v[y]=i(b):v[y]=s(b)}return v}function d(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return t(r,d);if(r.constructor!==Object&&(u=a.get(r.constructor)))return u(r,d);const s={};for(const l in r){if(Object.hasOwnProperty.call(r,l)===!1)continue;const v=r[l];typeof v!="object"||v===null?s[l]=v:v.constructor!==Object&&(u=a.get(v.constructor))?s[l]=u(v,d):ArrayBuffer.isView(v)?s[l]=i(v):s[l]=d(v)}return s}function g(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return t(r,g);if(r.constructor!==Object&&(u=a.get(r.constructor)))return u(r,g);const s={};for(const l in r){const v=r[l];typeof v!="object"||v===null?s[l]=v:v.constructor!==Object&&(u=a.get(v.constructor))?s[l]=u(v,g):ArrayBuffer.isView(v)?s[l]=i(v):s[l]=g(v)}return s}}function e(n){const a=[],u=[],t=new Map;if(t.set(Date,l=>new Date(l)),t.set(Map,(l,v)=>new Map(g(Array.from(l),v))),t.set(Set,(l,v)=>new Set(g(Array.from(l),v))),n.constructorHandlers)for(const l of n.constructorHandlers)t.set(l[0],l[1]);let d=null;return n.proto?s:r;function g(l,v){const c=Object.keys(l),y=new Array(c.length);for(let b=0;b<c.length;b++){const w=c[b],p=l[w];if(typeof p!="object"||p===null)y[w]=p;else if(p.constructor!==Object&&(d=t.get(p.constructor)))y[w]=d(p,v);else if(ArrayBuffer.isView(p))y[w]=i(p);else{const j=a.indexOf(p);j!==-1?y[w]=u[j]:y[w]=v(p)}}return y}function r(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return g(l,r);if(l.constructor!==Object&&(d=t.get(l.constructor)))return d(l,r);const v={};a.push(l),u.push(v);for(const c in l){if(Object.hasOwnProperty.call(l,c)===!1)continue;const y=l[c];if(typeof y!="object"||y===null)v[c]=y;else if(y.constructor!==Object&&(d=t.get(y.constructor)))v[c]=d(y,r);else if(ArrayBuffer.isView(y))v[c]=i(y);else{const b=a.indexOf(y);b!==-1?v[c]=u[b]:v[c]=r(y)}}return a.pop(),u.pop(),v}function s(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return g(l,s);if(l.constructor!==Object&&(d=t.get(l.constructor)))return d(l,s);const v={};a.push(l),u.push(v);for(const c in l){const y=l[c];if(typeof y!="object"||y===null)v[c]=y;else if(y.constructor!==Object&&(d=t.get(y.constructor)))v[c]=d(y,s);else if(ArrayBuffer.isView(y))v[c]=i(y);else{const b=a.indexOf(y);b!==-1?v[c]=u[b]:v[c]=s(y)}}return a.pop(),u.pop(),v}}return Oe}var Wh=Gh();const Vu=xh(Wh);Vu();var $u=typeof global=="object"&&global&&global.Object===Object&&global,Nh=typeof self=="object"&&self&&self.Object===Object&&self,I=$u||Nh||Function("return this")(),$=I.Symbol,it=Object.prototype,Ph=it.hasOwnProperty,Fh=it.toString,To=$?$.toStringTag:void 0;function Rh(i){var o=Ph.call(i,To),e=i[To];try{i[To]=void 0;var n=!0}catch{}var a=Fh.call(i);return n&&(o?i[To]=e:delete i[To]),a}var Ah=Object.prototype,Kh=Ah.toString;function Oh(i){return Kh.call(i)}var Eh="[object Null]",_h="[object Undefined]",Ha=$?$.toStringTag:void 0;function oi(i){return i==null?i===void 0?_h:Eh:Ha&&Ha in Object(i)?Rh(i):Oh(i)}function O(i){return i!=null&&typeof i=="object"}var zh="[object Symbol]";function gi(i){return typeof i=="symbol"||O(i)&&oi(i)==zh}var Ih=NaN;function Ba(i){return typeof i=="number"?i:gi(i)?Ih:+i}function A(i,o){for(var e=-1,n=i==null?0:i.length,a=Array(n);++e<n;)a[e]=o(i[e],e,i);return a}var C=Array.isArray,Ta=$?$.prototype:void 0,Da=Ta?Ta.toString:void 0;function hi(i){if(typeof i=="string")return i;if(C(i))return A(i,hi)+"";if(gi(i))return Da?Da.call(i):"";var o=i+"";return o=="0"&&1/i==-1/0?"-0":o}function we(i,o){return function(e,n){var a;if(e===void 0&&n===void 0)return o;if(e!==void 0&&(a=e),n!==void 0){if(a===void 0)return n;typeof e=="string"||typeof n=="string"?(e=hi(e),n=hi(n)):(e=Ba(e),n=Ba(n)),a=i(e,n)}return a}}var qh=we(function(i,o){return i+o},0),Uh=/\s/;function ot(i){for(var o=i.length;o--&&Uh.test(i.charAt(o)););return o}var Vh=/^\s+/;function et(i){return i&&i.slice(0,ot(i)+1).replace(Vh,"")}function K(i){var o=typeof i;return i!=null&&(o=="object"||o=="function")}var Ma=NaN,$h=/^[-+]0x[0-9a-f]+$/i,ir=/^0b[01]+$/i,or=/^0o[0-7]+$/i,er=parseInt;function yi(i){if(typeof i=="number")return i;if(gi(i))return Ma;if(K(i)){var o=typeof i.valueOf=="function"?i.valueOf():i;i=K(o)?o+"":o}if(typeof i!="string")return i===0?i:+i;i=et(i);var e=ir.test(i);return e||or.test(i)?er(i.slice(2),e?2:8):$h.test(i)?Ma:+i}var Qa=1/0,nr=17976931348623157e292;function Di(i){if(!i)return i===0?i:0;if(i=yi(i),i===Qa||i===-Qa){var o=i<0?-1:1;return o*nr}return i===i?i:0}function H(i){var o=Di(i),e=o%1;return o===o?e?o-e:o:0}var ar="Expected a function";function ur(i,o){if(typeof o!="function")throw new TypeError(ar);return i=H(i),function(){if(--i<1)return o.apply(this,arguments)}}function ai(i){return i}var tr="[object AsyncFunction]",dr="[object Function]",gr="[object GeneratorFunction]",hr="[object Proxy]";function Mi(i){if(!K(i))return!1;var o=oi(i);return o==dr||o==gr||o==tr||o==hr}var te=I["__core-js_shared__"],xa=(function(){var i=/[^.]+$/.exec(te&&te.keys&&te.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""})();function rr(i){return!!xa&&xa in i}var sr=Function.prototype,lr=sr.toString;function eo(i){if(i!=null){try{return lr.call(i)}catch{}try{return i+""}catch{}}return""}var vr=/[\\^$.*+?()[\]{}|]/g,yr=/^\[object .+?Constructor\]$/,cr=Function.prototype,br=Object.prototype,pr=cr.toString,wr=br.hasOwnProperty,jr=RegExp("^"+pr.call(wr).replace(vr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nt(i){if(!K(i)||rr(i))return!1;var o=Mi(i)?jr:yr;return o.test(eo(i))}function fr(i,o){return i?.[o]}function no(i,o){var e=fr(i,o);return nt(e)?e:void 0}var Go=no(I,"WeakMap"),se=Go&&new Go,at=se?function(i,o){return se.set(i,o),i}:ai,Ga=Object.create,fo=(function(){function i(){}return function(o){if(!K(o))return{};if(Ga)return Ga(o);i.prototype=o;var e=new i;return i.prototype=void 0,e}})();function Wo(i){return function(){var o=arguments;switch(o.length){case 0:return new i;case 1:return new i(o[0]);case 2:return new i(o[0],o[1]);case 3:return new i(o[0],o[1],o[2]);case 4:return new i(o[0],o[1],o[2],o[3]);case 5:return new i(o[0],o[1],o[2],o[3],o[4]);case 6:return new i(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new i(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var e=fo(i.prototype),n=i.apply(e,o);return K(n)?n:e}}var mr=1;function Yr(i,o,e){var n=o&mr,a=Wo(i);function u(){var t=this&&this!==I&&this instanceof u?a:i;return t.apply(n?e:this,arguments)}return u}function ri(i,o,e){switch(e.length){case 0:return i.call(o);case 1:return i.call(o,e[0]);case 2:return i.call(o,e[0],e[1]);case 3:return i.call(o,e[0],e[1],e[2])}return i.apply(o,e)}var kr=Math.max;function ut(i,o,e,n){for(var a=-1,u=i.length,t=e.length,d=-1,g=o.length,r=kr(u-t,0),s=Array(g+r),l=!n;++d<g;)s[d]=o[d];for(;++a<t;)(l||a<u)&&(s[e[a]]=i[a]);for(;r--;)s[d++]=i[a++];return s}var Lr=Math.max;function tt(i,o,e,n){for(var a=-1,u=i.length,t=-1,d=e.length,g=-1,r=o.length,s=Lr(u-d,0),l=Array(s+r),v=!n;++a<s;)l[a]=i[a];for(var c=a;++g<r;)l[c+g]=o[g];for(;++t<d;)(v||a<u)&&(l[c+e[t]]=i[a++]);return l}function Zr(i,o){for(var e=i.length,n=0;e--;)i[e]===o&&++n;return n}function je(){}var Sr=4294967295;function M(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Sr,this.__views__=[]}M.prototype=fo(je.prototype);M.prototype.constructor=M;function kn(){}var Ln=se?function(i){return se.get(i)}:kn,yo={},Jr=Object.prototype,Cr=Jr.hasOwnProperty;function de(i){for(var o=i.name+"",e=yo[o],n=Cr.call(yo,o)?e.length:0;n--;){var a=e[n],u=a.func;if(u==null||u==i)return a.name}return o}function bi(i,o){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=void 0}bi.prototype=fo(je.prototype);bi.prototype.constructor=bi;function ni(i,o){var e=-1,n=i.length;for(o||(o=Array(n));++e<n;)o[e]=i[e];return o}function dt(i){if(i instanceof M)return i.clone();var o=new bi(i.__wrapped__,i.__chain__);return o.__actions__=ni(i.__actions__),o.__index__=i.__index__,o.__values__=i.__values__,o}var Xr=Object.prototype,Hr=Xr.hasOwnProperty;function h(i){if(O(i)&&!C(i)&&!(i instanceof M)){if(i instanceof bi)return i;if(Hr.call(i,"__wrapped__"))return dt(i)}return new bi(i)}h.prototype=je.prototype;h.prototype.constructor=h;function tn(i){var o=de(i),e=h[o];if(typeof e!="function"||!(o in M.prototype))return!1;if(i===e)return!0;var n=Ln(e);return!!n&&i===n[0]}var Br=800,Tr=16,Dr=Date.now;function gt(i){var o=0,e=0;return function(){var n=Dr(),a=Tr-(n-e);if(e=n,a>0){if(++o>=Br)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}var ht=gt(at),Mr=/\{\n\/\* \[wrapped with (.+)\] \*/,Qr=/,? & /;function xr(i){var o=i.match(Mr);return o?o[1].split(Qr):[]}var Gr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function Wr(i,o){var e=o.length;if(!e)return i;var n=e-1;return o[n]=(e>1?"& ":"")+o[n],o=o.join(e>2?", ":" "),i.replace(Gr,`{
2
2
  /* [wrapped with `+o+`] */
3
3
  `)}function Zn(i){return function(){return i}}var le=(function(){try{var i=no(Object,"defineProperty");return i({},"",{}),i}catch{}})(),Nr=le?function(i,o){return le(i,"toString",{configurable:!0,enumerable:!1,value:Zn(o),writable:!0})}:ai,Sn=gt(Nr);function li(i,o){for(var e=-1,n=i==null?0:i.length;++e<n&&o(i[e],e,i)!==!1;);return i}function fe(i,o,e,n){for(var a=i.length,u=e+(n?1:-1);n?u--:++u<a;)if(o(i[u],u,i))return u;return-1}function rt(i){return i!==i}function Pr(i,o,e){for(var n=e-1,a=i.length;++n<a;)if(i[n]===o)return n;return-1}function mo(i,o,e){return o===o?Pr(i,o,e):fe(i,rt,e)}function me(i,o){var e=i==null?0:i.length;return!!e&&mo(i,o,0)>-1}var Fr=1,Rr=2,Ar=8,Kr=16,Or=32,Er=64,_r=128,zr=256,Ir=512,qr=[["ary",_r],["bind",Fr],["bindKey",Rr],["curry",Ar],["curryRight",Kr],["flip",Ir],["partial",Or],["partialRight",Er],["rearg",zr]];function Ur(i,o){return li(qr,function(e){var n="_."+e[0];o&e[1]&&!me(i,n)&&i.push(n)}),i.sort()}function st(i,o,e){var n=o+"";return Sn(i,Wr(n,Ur(xr(n),e)))}var Vr=4,$r=8,Wa=32,Na=64;function lt(i,o,e,n,a,u,t,d,g,r){var s=o&$r,l=s?t:void 0,v=s?void 0:t,c=s?u:void 0,y=s?void 0:u;o|=s?Wa:Na,o&=~(s?Na:Wa),o&Vr||(o&=-4);var b=[i,o,a,c,l,y,v,d,g,r],w=e.apply(void 0,b);return tn(i)&&ht(w,b),w.placeholder=n,st(w,i,o)}function Yo(i){var o=i;return o.placeholder}var is=9007199254740991,os=/^(?:0|[1-9]\d*)$/;function Qi(i,o){var e=typeof i;return o=o??is,!!o&&(e=="number"||e!="symbol"&&os.test(i))&&i>-1&&i%1==0&&i<o}var es=Math.min;function ns(i,o){for(var e=i.length,n=es(o.length,e),a=ni(i);n--;){var u=o[n];i[n]=Qi(u,e)?a[u]:void 0}return i}var Pa="__lodash_placeholder__";function Fi(i,o){for(var e=-1,n=i.length,a=0,u=[];++e<n;){var t=i[e];(t===o||t===Pa)&&(i[e]=Pa,u[a++]=e)}return u}var as=1,us=2,ts=8,ds=16,gs=128,hs=512;function Ye(i,o,e,n,a,u,t,d,g,r){var s=o&gs,l=o&as,v=o&us,c=o&(ts|ds),y=o&hs,b=v?void 0:Wo(i);function w(){for(var p=arguments.length,j=Array(p),f=p;f--;)j[f]=arguments[f];if(c)var m=Yo(w),k=Zr(j,m);if(n&&(j=ut(j,n,a,c)),u&&(j=tt(j,u,t,c)),p-=k,c&&p<r){var Z=Fi(j,m);return lt(i,o,Ye,w.placeholder,e,j,Z,d,g,r-p)}var D=l?e:this,B=v?D[i]:i;return p=j.length,d?j=ns(j,d):y&&p>1&&j.reverse(),s&&g<p&&(j.length=g),this&&this!==I&&this instanceof w&&(B=b||Wo(B)),B.apply(D,j)}return w}function rs(i,o,e){var n=Wo(i);function a(){for(var u=arguments.length,t=Array(u),d=u,g=Yo(a);d--;)t[d]=arguments[d];var r=u<3&&t[0]!==g&&t[u-1]!==g?[]:Fi(t,g);if(u-=r.length,u<e)return lt(i,o,Ye,a.placeholder,void 0,t,r,void 0,void 0,e-u);var s=this&&this!==I&&this instanceof a?n:i;return ri(s,this,t)}return a}var ss=1;function ls(i,o,e,n){var a=o&ss,u=Wo(i);function t(){for(var d=-1,g=arguments.length,r=-1,s=n.length,l=Array(s+g),v=this&&this!==I&&this instanceof t?u:i;++r<s;)l[r]=n[r];for(;g--;)l[r++]=arguments[++d];return ri(v,a?e:this,l)}return t}var Fa="__lodash_placeholder__",Ee=1,vs=2,ys=4,Ra=8,Do=128,Aa=256,cs=Math.min;function bs(i,o){var e=i[1],n=o[1],a=e|n,u=a<(Ee|vs|Do),t=n==Do&&e==Ra||n==Do&&e==Aa&&i[7].length<=o[8]||n==(Do|Aa)&&o[7].length<=o[8]&&e==Ra;if(!(u||t))return i;n&Ee&&(i[2]=o[2],a|=e&Ee?0:ys);var d=o[3];if(d){var g=i[3];i[3]=g?ut(g,d,o[4]):d,i[4]=g?Fi(i[3],Fa):o[4]}return d=o[5],d&&(g=i[5],i[5]=g?tt(g,d,o[6]):d,i[6]=g?Fi(i[5],Fa):o[6]),d=o[7],d&&(i[7]=d),n&Do&&(i[8]=i[8]==null?o[8]:cs(i[8],o[8])),i[9]==null&&(i[9]=o[9]),i[0]=o[0],i[1]=a,i}var ps="Expected a function",Ka=1,ws=2,Oa=8,Ea=16,_a=32,js=64,za=Math.max;function xi(i,o,e,n,a,u,t,d){var g=o&ws;if(!g&&typeof i!="function")throw new TypeError(ps);var r=n?n.length:0;if(r||(o&=-97,n=a=void 0),t=t===void 0?t:za(H(t),0),d=d===void 0?d:H(d),r-=a?a.length:0,o&js){var s=n,l=a;n=a=void 0}var v=g?void 0:Ln(i),c=[i,o,e,n,a,s,l,u,t,d];if(v&&bs(c,v),i=c[0],o=c[1],e=c[2],n=c[3],a=c[4],d=c[9]=c[9]===void 0?g?0:i.length:za(c[9]-r,0),!d&&o&(Oa|Ea)&&(o&=-25),!o||o==Ka)var y=Yr(i,o,e);else o==Oa||o==Ea?y=rs(i,o,d):(o==_a||o==(Ka|_a))&&!a.length?y=ls(i,o,e,n):y=Ye.apply(void 0,c);var b=v?at:ht;return st(b(y,c),i,o)}var fs=128;function vt(i,o,e){return o=e?void 0:o,o=i&&o==null?i.length:o,xi(i,fs,void 0,void 0,void 0,void 0,o)}function Ci(i,o,e){o=="__proto__"&&le?le(i,o,{configurable:!0,enumerable:!0,value:e,writable:!0}):i[o]=e}function Zi(i,o){return i===o||i!==i&&o!==o}var ms=Object.prototype,Ys=ms.hasOwnProperty;function Ao(i,o,e){var n=i[o];(!(Ys.call(i,o)&&Zi(n,e))||e===void 0&&!(o in i))&&Ci(i,o,e)}function Xi(i,o,e,n){var a=!e;e||(e={});for(var u=-1,t=o.length;++u<t;){var d=o[u],g=n?n(e[d],i[d],d,e,i):void 0;g===void 0&&(g=i[d]),a?Ci(e,d,g):Ao(e,d,g)}return e}var Ia=Math.max;function yt(i,o,e){return o=Ia(o===void 0?i.length-1:o,0),function(){for(var n=arguments,a=-1,u=Ia(n.length-o,0),t=Array(u);++a<u;)t[a]=n[o+a];a=-1;for(var d=Array(o+1);++a<o;)d[a]=n[a];return d[o]=e(t),ri(i,this,d)}}function T(i,o){return Sn(yt(i,o,ai),i+"")}var ks=9007199254740991;function ke(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=ks}function ui(i){return i!=null&&ke(i.length)&&!Mi(i)}function ii(i,o,e){if(!K(e))return!1;var n=typeof o;return(n=="number"?ui(e)&&Qi(o,e.length):n=="string"&&o in e)?Zi(e[o],i):!1}function ko(i){return T(function(o,e){var n=-1,a=e.length,u=a>1?e[a-1]:void 0,t=a>2?e[2]:void 0;for(u=i.length>3&&typeof u=="function"?(a--,u):void 0,t&&ii(e[0],e[1],t)&&(u=a<3?void 0:u,a=1),o=Object(o);++n<a;){var d=e[n];d&&i(o,d,n,u)}return o})}var Ls=Object.prototype;function Ko(i){var o=i&&i.constructor,e=typeof o=="function"&&o.prototype||Ls;return i===e}function Jn(i,o){for(var e=-1,n=Array(i);++e<i;)n[e]=o(e);return n}var Zs="[object Arguments]";function qa(i){return O(i)&&oi(i)==Zs}var ct=Object.prototype,Ss=ct.hasOwnProperty,Js=ct.propertyIsEnumerable,$i=qa((function(){return arguments})())?qa:function(i){return O(i)&&Ss.call(i,"callee")&&!Js.call(i,"callee")};function Cn(){return!1}var bt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ua=bt&&typeof module=="object"&&module&&!module.nodeType&&module,Cs=Ua&&Ua.exports===bt,Va=Cs?I.Buffer:void 0,Xs=Va?Va.isBuffer:void 0,Ri=Xs||Cn,Hs="[object Arguments]",Bs="[object Array]",Ts="[object Boolean]",Ds="[object Date]",Ms="[object Error]",Qs="[object Function]",xs="[object Map]",Gs="[object Number]",Ws="[object Object]",Ns="[object RegExp]",Ps="[object Set]",Fs="[object String]",Rs="[object WeakMap]",As="[object ArrayBuffer]",Ks="[object DataView]",Os="[object Float32Array]",Es="[object Float64Array]",_s="[object Int8Array]",zs="[object Int16Array]",Is="[object Int32Array]",qs="[object Uint8Array]",Us="[object Uint8ClampedArray]",Vs="[object Uint16Array]",$s="[object Uint32Array]",F={};F[Os]=F[Es]=F[_s]=F[zs]=F[Is]=F[qs]=F[Us]=F[Vs]=F[$s]=!0;F[Hs]=F[Bs]=F[As]=F[Ts]=F[Ks]=F[Ds]=F[Ms]=F[Qs]=F[xs]=F[Gs]=F[Ws]=F[Ns]=F[Ps]=F[Fs]=F[Rs]=!1;function il(i){return O(i)&&ke(i.length)&&!!F[oi(i)]}function si(i){return function(o){return i(o)}}var pt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qo=pt&&typeof module=="object"&&module&&!module.nodeType&&module,ol=Qo&&Qo.exports===pt,_e=ol&&$u.process,pi=(function(){try{var i=Qo&&Qo.require&&Qo.require("util").types;return i||_e&&_e.binding&&_e.binding("util")}catch{}})(),$a=pi&&pi.isTypedArray,Lo=$a?si($a):il,el=Object.prototype,nl=el.hasOwnProperty;function wt(i,o){var e=C(i),n=!e&&$i(i),a=!e&&!n&&Ri(i),u=!e&&!n&&!a&&Lo(i),t=e||n||a||u,d=t?Jn(i.length,String):[],g=d.length;for(var r in i)(o||nl.call(i,r))&&!(t&&(r=="length"||a&&(r=="offset"||r=="parent")||u&&(r=="buffer"||r=="byteLength"||r=="byteOffset")||Qi(r,g)))&&d.push(r);return d}function jt(i,o){return function(e){return i(o(e))}}var al=jt(Object.keys,Object),ul=Object.prototype,tl=ul.hasOwnProperty;function Xn(i){if(!Ko(i))return al(i);var o=[];for(var e in Object(i))tl.call(i,e)&&e!="constructor"&&o.push(e);return o}function q(i){return ui(i)?wt(i):Xn(i)}var dl=Object.prototype,gl=dl.hasOwnProperty,hl=ko(function(i,o){if(Ko(o)||ui(o)){Xi(o,q(o),i);return}for(var e in o)gl.call(o,e)&&Ao(i,e,o[e])});function rl(i){var o=[];if(i!=null)for(var e in Object(i))o.push(e);return o}var sl=Object.prototype,ll=sl.hasOwnProperty;function vl(i){if(!K(i))return rl(i);var o=Ko(i),e=[];for(var n in i)n=="constructor"&&(o||!ll.call(i,n))||e.push(n);return e}function ti(i){return ui(i)?wt(i,!0):vl(i)}var yl=ko(function(i,o){Xi(o,ti(o),i)}),cl=ko(function(i,o,e,n){Xi(o,ti(o),i,n)}),dn=ko(function(i,o,e,n){Xi(o,q(o),i,n)}),bl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pl=/^\w*$/;function Hn(i,o){if(C(i))return!1;var e=typeof i;return e=="number"||e=="symbol"||e=="boolean"||i==null||gi(i)?!0:pl.test(i)||!bl.test(i)||o!=null&&i in Object(o)}var No=no(Object,"create");function wl(){this.__data__=No?No(null):{},this.size=0}function jl(i){var o=this.has(i)&&delete this.__data__[i];return this.size-=o?1:0,o}var fl="__lodash_hash_undefined__",ml=Object.prototype,Yl=ml.hasOwnProperty;function kl(i){var o=this.__data__;if(No){var e=o[i];return e===fl?void 0:e}return Yl.call(o,i)?o[i]:void 0}var Ll=Object.prototype,Zl=Ll.hasOwnProperty;function Sl(i){var o=this.__data__;return No?o[i]!==void 0:Zl.call(o,i)}var Jl="__lodash_hash_undefined__";function Cl(i,o){var e=this.__data__;return this.size+=this.has(i)?0:1,e[i]=No&&o===void 0?Jl:o,this}function io(i){var o=-1,e=i==null?0:i.length;for(this.clear();++o<e;){var n=i[o];this.set(n[0],n[1])}}io.prototype.clear=wl;io.prototype.delete=jl;io.prototype.get=kl;io.prototype.has=Sl;io.prototype.set=Cl;function Xl(){this.__data__=[],this.size=0}function Le(i,o){for(var e=i.length;e--;)if(Zi(i[e][0],o))return e;return-1}var Hl=Array.prototype,Bl=Hl.splice;function Tl(i){var o=this.__data__,e=Le(o,i);if(e<0)return!1;var n=o.length-1;return e==n?o.pop():Bl.call(o,e,1),--this.size,!0}function Dl(i){var o=this.__data__,e=Le(o,i);return e<0?void 0:o[e][1]}function Ml(i){return Le(this.__data__,i)>-1}function Ql(i,o){var e=this.__data__,n=Le(e,i);return n<0?(++this.size,e.push([i,o])):e[n][1]=o,this}function Gi(i){var o=-1,e=i==null?0:i.length;for(this.clear();++o<e;){var n=i[o];this.set(n[0],n[1])}}Gi.prototype.clear=Xl;Gi.prototype.delete=Tl;Gi.prototype.get=Dl;Gi.prototype.has=Ml;Gi.prototype.set=Ql;var Po=no(I,"Map");function xl(){this.size=0,this.__data__={hash:new io,map:new(Po||Gi),string:new io}}function Gl(i){var o=typeof i;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?i!=="__proto__":i===null}function Ze(i,o){var e=i.__data__;return Gl(o)?e[typeof o=="string"?"string":"hash"]:e.map}function Wl(i){var o=Ze(this,i).delete(i);return this.size-=o?1:0,o}function Nl(i){return Ze(this,i).get(i)}function Pl(i){return Ze(this,i).has(i)}function Fl(i,o){var e=Ze(this,i),n=e.size;return e.set(i,o),this.size+=e.size==n?0:1,this}function Wi(i){var o=-1,e=i==null?0:i.length;for(this.clear();++o<e;){var n=i[o];this.set(n[0],n[1])}}Wi.prototype.clear=xl;Wi.prototype.delete=Wl;Wi.prototype.get=Nl;Wi.prototype.has=Pl;Wi.prototype.set=Fl;var Rl="Expected a function";function Se(i,o){if(typeof i!="function"||o!=null&&typeof o!="function")throw new TypeError(Rl);var e=function(){var n=arguments,a=o?o.apply(this,n):n[0],u=e.cache;if(u.has(a))return u.get(a);var t=i.apply(this,n);return e.cache=u.set(a,t)||u,t};return e.cache=new(Se.Cache||Wi),e}Se.Cache=Wi;var Al=500;function Kl(i){var o=Se(i,function(n){return e.size===Al&&e.clear(),n}),e=o.cache;return o}var Ol=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,El=/\\(\\)?/g,ft=Kl(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(Ol,function(e,n,a,u){o.push(a?u.replace(El,"$1"):n||e)}),o});function x(i){return i==null?"":hi(i)}function Ki(i,o){return C(i)?i:Hn(i,o)?[i]:ft(x(i))}function ki(i){if(typeof i=="string"||gi(i))return i;var o=i+"";return o=="0"&&1/i==-1/0?"-0":o}function ao(i,o){o=Ki(o,i);for(var e=0,n=o.length;i!=null&&e<n;)i=i[ki(o[e++])];return e&&e==n?i:void 0}function Bn(i,o,e){var n=i==null?void 0:ao(i,o);return n===void 0?e:n}function Tn(i,o){for(var e=-1,n=o.length,a=Array(n),u=i==null;++e<n;)a[e]=u?void 0:Bn(i,o[e]);return a}function Oi(i,o){for(var e=-1,n=o.length,a=i.length;++e<n;)i[a+e]=o[e];return i}var iu=$?$.isConcatSpreadable:void 0;function _l(i){return C(i)||$i(i)||!!(iu&&i&&i[iu])}function V(i,o,e,n,a){var u=-1,t=i.length;for(e||(e=_l),a||(a=[]);++u<t;){var d=i[u];o>0&&e(d)?o>1?V(d,o-1,e,n,a):Oi(a,d):n||(a[a.length]=d)}return a}function mt(i){var o=i==null?0:i.length;return o?V(i,1):[]}function Ni(i){return Sn(yt(i,void 0,mt),i+"")}var zl=Ni(Tn),Je=jt(Object.getPrototypeOf,Object),Il="[object Object]",ql=Function.prototype,Ul=Object.prototype,Yt=ql.toString,Vl=Ul.hasOwnProperty,$l=Yt.call(Object);function Oo(i){if(!O(i)||oi(i)!=Il)return!1;var o=Je(i);if(o===null)return!0;var e=Vl.call(o,"constructor")&&o.constructor;return typeof e=="function"&&e instanceof e&&Yt.call(e)==$l}var i0="[object DOMException]",o0="[object Error]";function Dn(i){if(!O(i))return!1;var o=oi(i);return o==o0||o==i0||typeof i.message=="string"&&typeof i.name=="string"&&!Oo(i)}var kt=T(function(i,o){try{return ri(i,void 0,o)}catch(e){return Dn(e)?e:new Error(e)}}),e0="Expected a function";function Lt(i,o){var e;if(typeof o!="function")throw new TypeError(e0);return i=H(i),function(){return--i>0&&(e=o.apply(this,arguments)),i<=1&&(o=void 0),e}}var n0=1,a0=32,Ce=T(function(i,o,e){var n=n0;if(e.length){var a=Fi(e,Yo(Ce));n|=a0}return xi(i,n,o,e,a)});Ce.placeholder={};var u0=Ni(function(i,o){return li(o,function(e){e=ki(e),Ci(i,e,Ce(i[e],i))}),i}),t0=1,d0=2,g0=32,Mn=T(function(i,o,e){var n=t0|d0;if(e.length){var a=Fi(e,Yo(Mn));n|=g0}return xi(o,n,i,e,a)});Mn.placeholder={};function wi(i,o,e){var n=-1,a=i.length;o<0&&(o=-o>a?0:a+o),e=e>a?a:e,e<0&&(e+=a),a=o>e?0:e-o>>>0,o>>>=0;for(var u=Array(a);++n<a;)u[n]=i[n+o];return u}function Ei(i,o,e){var n=i.length;return e=e===void 0?n:e,!o&&e>=n?i:wi(i,o,e)}var h0="\\ud800-\\udfff",r0="\\u0300-\\u036f",s0="\\ufe20-\\ufe2f",l0="\\u20d0-\\u20ff",v0=r0+s0+l0,y0="\\ufe0e\\ufe0f",c0="\\u200d",b0=RegExp("["+c0+h0+v0+y0+"]");function Zo(i){return b0.test(i)}function p0(i){return i.split("")}var Zt="\\ud800-\\udfff",w0="\\u0300-\\u036f",j0="\\ufe20-\\ufe2f",f0="\\u20d0-\\u20ff",m0=w0+j0+f0,Y0="\\ufe0e\\ufe0f",k0="["+Zt+"]",gn="["+m0+"]",hn="\\ud83c[\\udffb-\\udfff]",L0="(?:"+gn+"|"+hn+")",St="[^"+Zt+"]",Jt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ct="[\\ud800-\\udbff][\\udc00-\\udfff]",Z0="\\u200d",Xt=L0+"?",Ht="["+Y0+"]?",S0="(?:"+Z0+"(?:"+[St,Jt,Ct].join("|")+")"+Ht+Xt+")*",J0=Ht+Xt+S0,C0="(?:"+[St+gn+"?",gn,Jt,Ct,k0].join("|")+")",X0=RegExp(hn+"(?="+hn+")|"+C0+J0,"g");function H0(i){return i.match(X0)||[]}function Li(i){return Zo(i)?H0(i):p0(i)}function Bt(i){return function(o){o=x(o);var e=Zo(o)?Li(o):void 0,n=e?e[0]:o.charAt(0),a=e?Ei(e,1).join(""):o.slice(1);return n[i]()+a}}var Qn=Bt("toUpperCase");function Tt(i){return Qn(x(i).toLowerCase())}function xn(i,o,e,n){var a=-1,u=i==null?0:i.length;for(n&&u&&(e=i[++a]);++a<u;)e=o(e,i[a],a,i);return e}function Gn(i){return function(o){return i?.[o]}}var B0={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},T0=Gn(B0),D0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,M0="\\u0300-\\u036f",Q0="\\ufe20-\\ufe2f",x0="\\u20d0-\\u20ff",G0=M0+Q0+x0,W0="["+G0+"]",N0=RegExp(W0,"g");function Dt(i){return i=x(i),i&&i.replace(D0,T0).replace(N0,"")}var P0=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function F0(i){return i.match(P0)||[]}var R0=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function A0(i){return R0.test(i)}var Mt="\\ud800-\\udfff",K0="\\u0300-\\u036f",O0="\\ufe20-\\ufe2f",E0="\\u20d0-\\u20ff",_0=K0+O0+E0,Qt="\\u2700-\\u27bf",xt="a-z\\xdf-\\xf6\\xf8-\\xff",z0="\\xac\\xb1\\xd7\\xf7",I0="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",q0="\\u2000-\\u206f",U0=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Gt="A-Z\\xc0-\\xd6\\xd8-\\xde",V0="\\ufe0e\\ufe0f",Wt=z0+I0+q0+U0,Nt="['’]",ou="["+Wt+"]",$0="["+_0+"]",Pt="\\d+",iv="["+Qt+"]",Ft="["+xt+"]",Rt="[^"+Mt+Wt+Pt+Qt+xt+Gt+"]",ov="\\ud83c[\\udffb-\\udfff]",ev="(?:"+$0+"|"+ov+")",nv="[^"+Mt+"]",At="(?:\\ud83c[\\udde6-\\uddff]){2}",Kt="[\\ud800-\\udbff][\\udc00-\\udfff]",lo="["+Gt+"]",av="\\u200d",eu="(?:"+Ft+"|"+Rt+")",uv="(?:"+lo+"|"+Rt+")",nu="(?:"+Nt+"(?:d|ll|m|re|s|t|ve))?",au="(?:"+Nt+"(?:D|LL|M|RE|S|T|VE))?",Ot=ev+"?",Et="["+V0+"]?",tv="(?:"+av+"(?:"+[nv,At,Kt].join("|")+")"+Et+Ot+")*",dv="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gv="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",hv=Et+Ot+tv,rv="(?:"+[iv,At,Kt].join("|")+")"+hv,sv=RegExp([lo+"?"+Ft+"+"+nu+"(?="+[ou,lo,"$"].join("|")+")",uv+"+"+au+"(?="+[ou,lo+eu,"$"].join("|")+")",lo+"?"+eu+"+"+nu,lo+"+"+au,gv,dv,Pt,rv].join("|"),"g");function lv(i){return i.match(sv)||[]}function _t(i,o,e){return i=x(i),o=e?void 0:o,o===void 0?A0(i)?lv(i):F0(i):i.match(o)||[]}var vv="['’]",yv=RegExp(vv,"g");function So(i){return function(o){return xn(_t(Dt(o).replace(yv,"")),i,"")}}var cv=So(function(i,o,e){return o=o.toLowerCase(),i+(e?Tt(o):o)});function bv(){if(!arguments.length)return[];var i=arguments[0];return C(i)?i:[i]}var pv=I.isFinite,wv=Math.min;function Wn(i){var o=Math[i];return function(e,n){if(e=yi(e),n=n==null?0:wv(H(n),292),n&&pv(e)){var a=(x(e)+"e").split("e"),u=o(a[0]+"e"+(+a[1]+n));return a=(x(u)+"e").split("e"),+(a[0]+"e"+(+a[1]-n))}return o(e)}}var jv=Wn("ceil");function zt(i){var o=h(i);return o.__chain__=!0,o}var fv=Math.ceil,mv=Math.max;function Yv(i,o,e){(e?ii(i,o,e):o===void 0)?o=1:o=mv(H(o),0);var n=i==null?0:i.length;if(!n||o<1)return[];for(var a=0,u=0,t=Array(fv(n/o));a<n;)t[u++]=wi(i,a,a+=o);return t}function uo(i,o,e){return i===i&&(e!==void 0&&(i=i<=e?i:e),o!==void 0&&(i=i>=o?i:o)),i}function kv(i,o,e){return e===void 0&&(e=o,o=void 0),e!==void 0&&(e=yi(e),e=e===e?e:0),o!==void 0&&(o=yi(o),o=o===o?o:0),uo(yi(i),o,e)}function Lv(){this.__data__=new Gi,this.size=0}function Zv(i){var o=this.__data__,e=o.delete(i);return this.size=o.size,e}function Sv(i){return this.__data__.get(i)}function Jv(i){return this.__data__.has(i)}var Cv=200;function Xv(i,o){var e=this.__data__;if(e instanceof Gi){var n=e.__data__;if(!Po||n.length<Cv-1)return n.push([i,o]),this.size=++e.size,this;e=this.__data__=new Wi(n)}return e.set(i,o),this.size=e.size,this}function Yi(i){var o=this.__data__=new Gi(i);this.size=o.size}Yi.prototype.clear=Lv;Yi.prototype.delete=Zv;Yi.prototype.get=Sv;Yi.prototype.has=Jv;Yi.prototype.set=Xv;function It(i,o){return i&&Xi(o,q(o),i)}function Hv(i,o){return i&&Xi(o,ti(o),i)}var qt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,uu=qt&&typeof module=="object"&&module&&!module.nodeType&&module,Bv=uu&&uu.exports===qt,tu=Bv?I.Buffer:void 0,du=tu?tu.allocUnsafe:void 0;function Ut(i,o){if(o)return i.slice();var e=i.length,n=du?du(e):new i.constructor(e);return i.copy(n),n}function _i(i,o){for(var e=-1,n=i==null?0:i.length,a=0,u=[];++e<n;){var t=i[e];o(t,e,i)&&(u[a++]=t)}return u}function Nn(){return[]}var Tv=Object.prototype,Dv=Tv.propertyIsEnumerable,gu=Object.getOwnPropertySymbols,Pn=gu?function(i){return i==null?[]:(i=Object(i),_i(gu(i),function(o){return Dv.call(i,o)}))}:Nn;function Mv(i,o){return Xi(i,Pn(i),o)}var Qv=Object.getOwnPropertySymbols,Vt=Qv?function(i){for(var o=[];i;)Oi(o,Pn(i)),i=Je(i);return o}:Nn;function xv(i,o){return Xi(i,Vt(i),o)}function $t(i,o,e){var n=o(i);return C(i)?n:Oi(n,e(i))}function rn(i){return $t(i,q,Pn)}function Fn(i){return $t(i,ti,Vt)}var sn=no(I,"DataView"),ln=no(I,"Promise"),co=no(I,"Set"),hu="[object Map]",Gv="[object Object]",ru="[object Promise]",su="[object Set]",lu="[object WeakMap]",vu="[object DataView]",Wv=eo(sn),Nv=eo(Po),Pv=eo(ln),Fv=eo(co),Rv=eo(Go),Ii=oi;(sn&&Ii(new sn(new ArrayBuffer(1)))!=vu||Po&&Ii(new Po)!=hu||ln&&Ii(ln.resolve())!=ru||co&&Ii(new co)!=su||Go&&Ii(new Go)!=lu)&&(Ii=function(i){var o=oi(i),e=o==Gv?i.constructor:void 0,n=e?eo(e):"";if(n)switch(n){case Wv:return vu;case Nv:return hu;case Pv:return ru;case Fv:return su;case Rv:return lu}return o});const Ji=Ii;var Av=Object.prototype,Kv=Av.hasOwnProperty;function Ov(i){var o=i.length,e=new i.constructor(o);return o&&typeof i[0]=="string"&&Kv.call(i,"index")&&(e.index=i.index,e.input=i.input),e}var ve=I.Uint8Array;function Rn(i){var o=new i.constructor(i.byteLength);return new ve(o).set(new ve(i)),o}function Ev(i,o){var e=o?Rn(i.buffer):i.buffer;return new i.constructor(e,i.byteOffset,i.byteLength)}var _v=/\w*$/;function zv(i){var o=new i.constructor(i.source,_v.exec(i));return o.lastIndex=i.lastIndex,o}var yu=$?$.prototype:void 0,cu=yu?yu.valueOf:void 0;function Iv(i){return cu?Object(cu.call(i)):{}}function id(i,o){var e=o?Rn(i.buffer):i.buffer;return new i.constructor(e,i.byteOffset,i.length)}var qv="[object Boolean]",Uv="[object Date]",Vv="[object Map]",$v="[object Number]",iy="[object RegExp]",oy="[object Set]",ey="[object String]",ny="[object Symbol]",ay="[object ArrayBuffer]",uy="[object DataView]",ty="[object Float32Array]",dy="[object Float64Array]",gy="[object Int8Array]",hy="[object Int16Array]",ry="[object Int32Array]",sy="[object Uint8Array]",ly="[object Uint8ClampedArray]",vy="[object Uint16Array]",yy="[object Uint32Array]";function cy(i,o,e){var n=i.constructor;switch(o){case ay:return Rn(i);case qv:case Uv:return new n(+i);case uy:return Ev(i,e);case ty:case dy:case gy:case hy:case ry:case sy:case ly:case vy:case yy:return id(i,e);case Vv:return new n;case $v:case ey:return new n(i);case iy:return zv(i);case oy:return new n;case ny:return Iv(i)}}function od(i){return typeof i.constructor=="function"&&!Ko(i)?fo(Je(i)):{}}var by="[object Map]";function py(i){return O(i)&&Ji(i)==by}var bu=pi&&pi.isMap,ed=bu?si(bu):py,wy="[object Set]";function jy(i){return O(i)&&Ji(i)==wy}var pu=pi&&pi.isSet,nd=pu?si(pu):jy,fy=1,my=2,Yy=4,ad="[object Arguments]",ky="[object Array]",Ly="[object Boolean]",Zy="[object Date]",Sy="[object Error]",ud="[object Function]",Jy="[object GeneratorFunction]",Cy="[object Map]",Xy="[object Number]",td="[object Object]",Hy="[object RegExp]",By="[object Set]",Ty="[object String]",Dy="[object Symbol]",My="[object WeakMap]",Qy="[object ArrayBuffer]",xy="[object DataView]",Gy="[object Float32Array]",Wy="[object Float64Array]",Ny="[object Int8Array]",Py="[object Int16Array]",Fy="[object Int32Array]",Ry="[object Uint8Array]",Ay="[object Uint8ClampedArray]",Ky="[object Uint16Array]",Oy="[object Uint32Array]",P={};P[ad]=P[ky]=P[Qy]=P[xy]=P[Ly]=P[Zy]=P[Gy]=P[Wy]=P[Ny]=P[Py]=P[Fy]=P[Cy]=P[Xy]=P[td]=P[Hy]=P[By]=P[Ty]=P[Dy]=P[Ry]=P[Ay]=P[Ky]=P[Oy]=!0;P[Sy]=P[ud]=P[My]=!1;function ci(i,o,e,n,a,u){var t,d=o&fy,g=o&my,r=o&Yy;if(e&&(t=a?e(i,n,a,u):e(i)),t!==void 0)return t;if(!K(i))return i;var s=C(i);if(s){if(t=Ov(i),!d)return ni(i,t)}else{var l=Ji(i),v=l==ud||l==Jy;if(Ri(i))return Ut(i,d);if(l==td||l==ad||v&&!a){if(t=g||v?{}:od(i),!d)return g?xv(i,Hv(t,i)):Mv(i,It(t,i))}else{if(!P[l])return a?i:{};t=cy(i,l,d)}}u||(u=new Yi);var c=u.get(i);if(c)return c;u.set(i,t),nd(i)?i.forEach(function(w){t.add(ci(w,o,e,w,i,u))}):ed(i)&&i.forEach(function(w,p){t.set(p,ci(w,o,e,p,i,u))});var y=r?g?Fn:rn:g?ti:q,b=s?void 0:y(i);return li(b||i,function(w,p){b&&(p=w,w=i[p]),Ao(t,p,ci(w,o,e,p,i,u))}),t}var Ey=4;function _y(i){return ci(i,Ey)}var zy=1,Iy=4;function qy(i){return ci(i,zy|Iy)}var Uy=1,Vy=4;function $y(i,o){return o=typeof o=="function"?o:void 0,ci(i,Uy|Vy,o)}var ic=4;function oc(i,o){return o=typeof o=="function"?o:void 0,ci(i,ic,o)}function ec(){return new bi(this.value(),this.__chain__)}function nc(i){for(var o=-1,e=i==null?0:i.length,n=0,a=[];++o<e;){var u=i[o];u&&(a[n++]=u)}return a}function ac(){var i=arguments.length;if(!i)return[];for(var o=Array(i-1),e=arguments[0],n=i;n--;)o[n-1]=arguments[n];return Oi(C(e)?ni(e):[e],V(o,1))}var uc="__lodash_hash_undefined__";function tc(i){return this.__data__.set(i,uc),this}function dc(i){return this.__data__.has(i)}function oo(i){var o=-1,e=i==null?0:i.length;for(this.__data__=new Wi;++o<e;)this.add(i[o])}oo.prototype.add=oo.prototype.push=tc;oo.prototype.has=dc;function An(i,o){for(var e=-1,n=i==null?0:i.length;++e<n;)if(o(i[e],e,i))return!0;return!1}function Fo(i,o){return i.has(o)}var gc=1,hc=2;function dd(i,o,e,n,a,u){var t=e&gc,d=i.length,g=o.length;if(d!=g&&!(t&&g>d))return!1;var r=u.get(i),s=u.get(o);if(r&&s)return r==o&&s==i;var l=-1,v=!0,c=e&hc?new oo:void 0;for(u.set(i,o),u.set(o,i);++l<d;){var y=i[l],b=o[l];if(n)var w=t?n(b,y,l,o,i,u):n(y,b,l,i,o,u);if(w!==void 0){if(w)continue;v=!1;break}if(c){if(!An(o,function(p,j){if(!Fo(c,j)&&(y===p||a(y,p,e,n,u)))return c.push(j)})){v=!1;break}}else if(!(y===b||a(y,b,e,n,u))){v=!1;break}}return u.delete(i),u.delete(o),v}function Kn(i){var o=-1,e=Array(i.size);return i.forEach(function(n,a){e[++o]=[a,n]}),e}function Xe(i){var o=-1,e=Array(i.size);return i.forEach(function(n){e[++o]=n}),e}var rc=1,sc=2,lc="[object Boolean]",vc="[object Date]",yc="[object Error]",cc="[object Map]",bc="[object Number]",pc="[object RegExp]",wc="[object Set]",jc="[object String]",fc="[object Symbol]",mc="[object ArrayBuffer]",Yc="[object DataView]",wu=$?$.prototype:void 0,ze=wu?wu.valueOf:void 0;function kc(i,o,e,n,a,u,t){switch(e){case Yc:if(i.byteLength!=o.byteLength||i.byteOffset!=o.byteOffset)return!1;i=i.buffer,o=o.buffer;case mc:return!(i.byteLength!=o.byteLength||!u(new ve(i),new ve(o)));case lc:case vc:case bc:return Zi(+i,+o);case yc:return i.name==o.name&&i.message==o.message;case pc:case jc:return i==o+"";case cc:var d=Kn;case wc:var g=n&rc;if(d||(d=Xe),i.size!=o.size&&!g)return!1;var r=t.get(i);if(r)return r==o;n|=sc,t.set(i,o);var s=dd(d(i),d(o),n,a,u,t);return t.delete(i),s;case fc:if(ze)return ze.call(i)==ze.call(o)}return!1}var Lc=1,Zc=Object.prototype,Sc=Zc.hasOwnProperty;function Jc(i,o,e,n,a,u){var t=e&Lc,d=rn(i),g=d.length,r=rn(o),s=r.length;if(g!=s&&!t)return!1;for(var l=g;l--;){var v=d[l];if(!(t?v in o:Sc.call(o,v)))return!1}var c=u.get(i),y=u.get(o);if(c&&y)return c==o&&y==i;var b=!0;u.set(i,o),u.set(o,i);for(var w=t;++l<g;){v=d[l];var p=i[v],j=o[v];if(n)var f=t?n(j,p,v,o,i,u):n(p,j,v,i,o,u);if(!(f===void 0?p===j||a(p,j,e,n,u):f)){b=!1;break}w||(w=v=="constructor")}if(b&&!w){var m=i.constructor,k=o.constructor;m!=k&&"constructor"in i&&"constructor"in o&&!(typeof m=="function"&&m instanceof m&&typeof k=="function"&&k instanceof k)&&(b=!1)}return u.delete(i),u.delete(o),b}var Cc=1,ju="[object Arguments]",fu="[object Array]",ne="[object Object]",Xc=Object.prototype,mu=Xc.hasOwnProperty;function Hc(i,o,e,n,a,u){var t=C(i),d=C(o),g=t?fu:Ji(i),r=d?fu:Ji(o);g=g==ju?ne:g,r=r==ju?ne:r;var s=g==ne,l=r==ne,v=g==r;if(v&&Ri(i)){if(!Ri(o))return!1;t=!0,s=!1}if(v&&!s)return u||(u=new Yi),t||Lo(i)?dd(i,o,e,n,a,u):kc(i,o,g,e,n,a,u);if(!(e&Cc)){var c=s&&mu.call(i,"__wrapped__"),y=l&&mu.call(o,"__wrapped__");if(c||y){var b=c?i.value():i,w=y?o.value():o;return u||(u=new Yi),a(b,w,e,n,u)}}return v?(u||(u=new Yi),Jc(i,o,e,n,a,u)):!1}function Eo(i,o,e,n,a){return i===o?!0:i==null||o==null||!O(i)&&!O(o)?i!==i&&o!==o:Hc(i,o,e,n,Eo,a)}var Bc=1,Tc=2;function On(i,o,e,n){var a=e.length,u=a,t=!n;if(i==null)return!u;for(i=Object(i);a--;){var d=e[a];if(t&&d[2]?d[1]!==i[d[0]]:!(d[0]in i))return!1}for(;++a<u;){d=e[a];var g=d[0],r=i[g],s=d[1];if(t&&d[2]){if(r===void 0&&!(g in i))return!1}else{var l=new Yi;if(n)var v=n(r,s,g,i,o,l);if(!(v===void 0?Eo(s,r,Bc|Tc,n,l):v))return!1}}return!0}function gd(i){return i===i&&!K(i)}function En(i){for(var o=q(i),e=o.length;e--;){var n=o[e],a=i[n];o[e]=[n,a,gd(a)]}return o}function hd(i,o){return function(e){return e==null?!1:e[i]===o&&(o!==void 0||i in Object(e))}}function rd(i){var o=En(i);return o.length==1&&o[0][2]?hd(o[0][0],o[0][1]):function(e){return e===i||On(e,i,o)}}function Dc(i,o){return i!=null&&o in Object(i)}function sd(i,o,e){o=Ki(o,i);for(var n=-1,a=o.length,u=!1;++n<a;){var t=ki(o[n]);if(!(u=i!=null&&e(i,t)))break;i=i[t]}return u||++n!=a?u:(a=i==null?0:i.length,!!a&&ke(a)&&Qi(t,a)&&(C(i)||$i(i)))}function _n(i,o){return i!=null&&sd(i,o,Dc)}var Mc=1,Qc=2;function ld(i,o){return Hn(i)&&gd(o)?hd(ki(i),o):function(e){var n=Bn(e,i);return n===void 0&&n===o?_n(e,i):Eo(o,n,Mc|Qc)}}function zn(i){return function(o){return o?.[i]}}function xc(i){return function(o){return ao(o,i)}}function vd(i){return Hn(i)?zn(ki(i)):xc(i)}function J(i){return typeof i=="function"?i:i==null?ai:typeof i=="object"?C(i)?ld(i[0],i[1]):rd(i):vd(i)}var Gc="Expected a function";function Wc(i){var o=i==null?0:i.length,e=J;return i=o?A(i,function(n){if(typeof n[1]!="function")throw new TypeError(Gc);return[e(n[0]),n[1]]}):[],T(function(n){for(var a=-1;++a<o;){var u=i[a];if(ri(u[0],this,n))return ri(u[1],this,n)}})}function yd(i,o,e){var n=e.length;if(i==null)return!n;for(i=Object(i);n--;){var a=e[n],u=o[a],t=i[a];if(t===void 0&&!(a in i)||!u(t))return!1}return!0}function Nc(i){var o=q(i);return function(e){return yd(e,i,o)}}var Pc=1;function Fc(i){return Nc(ci(i,Pc))}function Rc(i,o){return o==null||yd(i,o,q(o))}function Ac(i,o,e,n){for(var a=-1,u=i==null?0:i.length;++a<u;){var t=i[a];o(n,t,e(t),i)}return n}function cd(i){return function(o,e,n){for(var a=-1,u=Object(o),t=n(o),d=t.length;d--;){var g=t[i?d:++a];if(e(u[g],g,u)===!1)break}return o}}var In=cd();function Hi(i,o){return i&&In(i,o,q)}function bd(i,o){return function(e,n){if(e==null)return e;if(!ui(e))return i(e,n);for(var a=e.length,u=o?a:-1,t=Object(e);(o?u--:++u<a)&&n(t[u],u,t)!==!1;);return e}}var zi=bd(Hi);function Kc(i,o,e,n){return zi(i,function(a,u,t){o(n,a,e(a),t)}),n}function He(i,o){return function(e,n){var a=C(e)?Ac:Kc,u=o?o():{};return a(e,i,J(n),u)}}var Oc=Object.prototype,Ec=Oc.hasOwnProperty,_c=He(function(i,o,e){Ec.call(i,e)?++i[e]:Ci(i,e,1)});function zc(i,o){var e=fo(i);return o==null?e:It(e,o)}var Ic=8;function qn(i,o,e){o=e?void 0:o;var n=xi(i,Ic,void 0,void 0,void 0,void 0,void 0,o);return n.placeholder=qn.placeholder,n}qn.placeholder={};var qc=16;function Un(i,o,e){o=e?void 0:o;var n=xi(i,qc,void 0,void 0,void 0,void 0,void 0,o);return n.placeholder=Un.placeholder,n}Un.placeholder={};var ge=function(){return I.Date.now()},Uc="Expected a function",Vc=Math.max,$c=Math.min;function pd(i,o,e){var n,a,u,t,d,g,r=0,s=!1,l=!1,v=!0;if(typeof i!="function")throw new TypeError(Uc);o=yi(o)||0,K(e)&&(s=!!e.leading,l="maxWait"in e,u=l?Vc(yi(e.maxWait)||0,o):u,v="trailing"in e?!!e.trailing:v);function c(Z){var D=n,B=a;return n=a=void 0,r=Z,t=i.apply(B,D),t}function y(Z){return r=Z,d=setTimeout(p,o),s?c(Z):t}function b(Z){var D=Z-g,B=Z-r,X=o-D;return l?$c(X,u-B):X}function w(Z){var D=Z-g,B=Z-r;return g===void 0||D>=o||D<0||l&&B>=u}function p(){var Z=ge();if(w(Z))return j(Z);d=setTimeout(p,b(Z))}function j(Z){return d=void 0,v&&n?c(Z):(n=a=void 0,t)}function f(){d!==void 0&&clearTimeout(d),r=0,n=g=a=d=void 0}function m(){return d===void 0?t:j(ge())}function k(){var Z=ge(),D=w(Z);if(n=arguments,a=this,g=Z,D){if(d===void 0)return y(g);if(l)return clearTimeout(d),d=setTimeout(p,o),c(g)}return d===void 0&&(d=setTimeout(p,o)),t}return k.cancel=f,k.flush=m,k}function ib(i,o){return i==null||i!==i?o:i}var wd=Object.prototype,ob=wd.hasOwnProperty,eb=T(function(i,o){i=Object(i);var e=-1,n=o.length,a=n>2?o[2]:void 0;for(a&&ii(o[0],o[1],a)&&(n=1);++e<n;)for(var u=o[e],t=ti(u),d=-1,g=t.length;++d<g;){var r=t[d],s=i[r];(s===void 0||Zi(s,wd[r])&&!ob.call(i,r))&&(i[r]=u[r])}return i});function vn(i,o,e){(e!==void 0&&!Zi(i[o],e)||e===void 0&&!(o in i))&&Ci(i,o,e)}function _(i){return O(i)&&ui(i)}function yn(i,o){if(!(o==="constructor"&&typeof i[o]=="function")&&o!="__proto__")return i[o]}function jd(i){return Xi(i,ti(i))}function nb(i,o,e,n,a,u,t){var d=yn(i,e),g=yn(o,e),r=t.get(g);if(r){vn(i,e,r);return}var s=u?u(d,g,e+"",i,o,t):void 0,l=s===void 0;if(l){var v=C(g),c=!v&&Ri(g),y=!v&&!c&&Lo(g);s=g,v||c||y?C(d)?s=d:_(d)?s=ni(d):c?(l=!1,s=Ut(g,!0)):y?(l=!1,s=id(g,!0)):s=[]:Oo(g)||$i(g)?(s=d,$i(d)?s=jd(d):(!K(d)||Mi(d))&&(s=od(g))):l=!1}l&&(t.set(g,s),a(s,g,n,u,t),t.delete(g)),vn(i,e,s)}function Be(i,o,e,n,a){i!==o&&In(o,function(u,t){if(a||(a=new Yi),K(u))nb(i,o,t,e,Be,n,a);else{var d=n?n(yn(i,t),u,t+"",i,o,a):void 0;d===void 0&&(d=u),vn(i,t,d)}},ti)}function fd(i,o,e,n,a,u){return K(i)&&K(o)&&(u.set(o,i),Be(i,o,void 0,fd,u),u.delete(o)),i}var md=ko(function(i,o,e,n){Be(i,o,e,n)}),ab=T(function(i){return i.push(void 0,fd),ri(md,void 0,i)}),ub="Expected a function";function Yd(i,o,e){if(typeof i!="function")throw new TypeError(ub);return setTimeout(function(){i.apply(void 0,e)},o)}var tb=T(function(i,o){return Yd(i,1,o)}),db=T(function(i,o,e){return Yd(i,yi(o)||0,e)});function Vn(i,o,e){for(var n=-1,a=i==null?0:i.length;++n<a;)if(e(o,i[n]))return!0;return!1}var gb=200;function _o(i,o,e,n){var a=-1,u=me,t=!0,d=i.length,g=[],r=o.length;if(!d)return g;e&&(o=A(o,si(e))),n?(u=Vn,t=!1):o.length>=gb&&(u=Fo,t=!1,o=new oo(o));i:for(;++a<d;){var s=i[a],l=e==null?s:e(s);if(s=n||s!==0?s:0,t&&l===l){for(var v=r;v--;)if(o[v]===l)continue i;g.push(s)}else u(o,l,n)||g.push(s)}return g}var hb=T(function(i,o){return _(i)?_o(i,V(o,1,_,!0)):[]});function ji(i){var o=i==null?0:i.length;return o?i[o-1]:void 0}var rb=T(function(i,o){var e=ji(o);return _(e)&&(e=void 0),_(i)?_o(i,V(o,1,_,!0),J(e)):[]}),sb=T(function(i,o){var e=ji(o);return _(e)&&(e=void 0),_(i)?_o(i,V(o,1,_,!0),void 0,e):[]}),lb=we(function(i,o){return i/o},1);function vb(i,o,e){var n=i==null?0:i.length;return n?(o=e||o===void 0?1:H(o),wi(i,o<0?0:o,n)):[]}function yb(i,o,e){var n=i==null?0:i.length;return n?(o=e||o===void 0?1:H(o),o=n-o,wi(i,0,o<0?0:o)):[]}function Te(i,o,e,n){for(var a=i.length,u=n?a:-1;(n?u--:++u<a)&&o(i[u],u,i););return e?wi(i,n?0:u,n?u+1:a):wi(i,n?u+1:0,n?a:u)}function cb(i,o){return i&&i.length?Te(i,J(o),!0,!0):[]}function bb(i,o){return i&&i.length?Te(i,J(o),!0):[]}function Bi(i){return typeof i=="function"?i:ai}function pb(i,o){var e=C(i)?li:zi;return e(i,Bi(o))}function wb(i,o){for(var e=i==null?0:i.length;e--&&o(i[e],e,i)!==!1;);return i}var kd=cd(!0);function $n(i,o){return i&&kd(i,o,q)}var Ld=bd($n,!0);function jb(i,o){var e=C(i)?wb:Ld;return e(i,Bi(o))}function fb(i,o,e){i=x(i),o=hi(o);var n=i.length;e=e===void 0?n:uo(H(e),0,n);var a=e;return e-=o.length,e>=0&&i.slice(e,a)==o}function mb(i,o){return A(o,function(e){return[e,i[e]]})}function Yb(i){var o=-1,e=Array(i.size);return i.forEach(function(n){e[++o]=[n,n]}),e}var kb="[object Map]",Lb="[object Set]";function Zd(i){return function(o){var e=Ji(o);return e==kb?Kn(o):e==Lb?Yb(o):mb(o,i(o))}}var Zb=Zd(q),Sb=Zd(ti),Jb={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Cb=Gn(Jb),Sd=/[&<>"']/g,Xb=RegExp(Sd.source);function Jd(i){return i=x(i),i&&Xb.test(i)?i.replace(Sd,Cb):i}var Cd=/[\\^$.*+?()[\]{}|]/g,Hb=RegExp(Cd.source);function Bb(i){return i=x(i),i&&Hb.test(i)?i.replace(Cd,"\\$&"):i}function Xd(i,o){for(var e=-1,n=i==null?0:i.length;++e<n;)if(!o(i[e],e,i))return!1;return!0}function Tb(i,o){var e=!0;return zi(i,function(n,a,u){return e=!!o(n,a,u),e}),e}function Db(i,o,e){var n=C(i)?Xd:Tb;return e&&ii(i,o,e)&&(o=void 0),n(i,J(o))}var Mb=4294967295;function Hd(i){return i?uo(H(i),0,Mb):0}function Qb(i,o,e,n){var a=i.length;for(e=H(e),e<0&&(e=-e>a?0:a+e),n=n===void 0||n>a?a:H(n),n<0&&(n+=a),n=e>n?0:Hd(n);e<n;)i[e++]=o;return i}function xb(i,o,e,n){var a=i==null?0:i.length;return a?(e&&typeof e!="number"&&ii(i,o,e)&&(e=0,n=a),Qb(i,o,e,n)):[]}function Bd(i,o){var e=[];return zi(i,function(n,a,u){o(n,a,u)&&e.push(n)}),e}function Gb(i,o){var e=C(i)?_i:Bd;return e(i,J(o))}function Td(i){return function(o,e,n){var a=Object(o);if(!ui(o)){var u=J(e);o=q(o),e=function(d){return u(a[d],d,a)}}var t=i(o,e,n);return t>-1?a[u?o[t]:t]:void 0}}var Wb=Math.max;function Dd(i,o,e){var n=i==null?0:i.length;if(!n)return-1;var a=e==null?0:H(e);return a<0&&(a=Wb(n+a,0)),fe(i,J(o),a)}var Nb=Td(Dd);function Md(i,o,e){var n;return e(i,function(a,u,t){if(o(a,u,t))return n=u,!1}),n}function Pb(i,o){return Md(i,J(o),Hi)}var Fb=Math.max,Rb=Math.min;function Qd(i,o,e){var n=i==null?0:i.length;if(!n)return-1;var a=n-1;return e!==void 0&&(a=H(e),a=e<0?Fb(n+a,0):Rb(a,n-1)),fe(i,J(o),a,!0)}var Ab=Td(Qd);function Kb(i,o){return Md(i,J(o),$n)}function Ob(i){return i&&i.length?i[0]:void 0}function xd(i,o){var e=-1,n=ui(i)?Array(i.length):[];return zi(i,function(a,u,t){n[++e]=o(a,u,t)}),n}function De(i,o){var e=C(i)?A:xd;return e(i,J(o))}function Eb(i,o){return V(De(i,o),1)}var _b=1/0;function zb(i,o){return V(De(i,o),_b)}function Ib(i,o,e){return e=e===void 0?1:H(e),V(De(i,o),e)}var qb=1/0;function Ub(i){var o=i==null?0:i.length;return o?V(i,qb):[]}function Vb(i,o){var e=i==null?0:i.length;return e?(o=o===void 0?1:H(o),V(i,o)):[]}var $b=512;function ip(i){return xi(i,$b)}var op=Wn("floor"),ep="Expected a function",np=8,ap=32,up=128,tp=256;function Gd(i){return Ni(function(o){var e=o.length,n=e,a=bi.prototype.thru;for(i&&o.reverse();n--;){var u=o[n];if(typeof u!="function")throw new TypeError(ep);if(a&&!t&&de(u)=="wrapper")var t=new bi([],!0)}for(n=t?n:e;++n<e;){u=o[n];var d=de(u),g=d=="wrapper"?Ln(u):void 0;g&&tn(g[0])&&g[1]==(up|np|ap|tp)&&!g[4].length&&g[9]==1?t=t[de(g[0])].apply(t,g[3]):t=u.length==1&&tn(u)?t[d]():t.thru(u)}return function(){var r=arguments,s=r[0];if(t&&r.length==1&&C(s))return t.plant(s).value();for(var l=0,v=e?o[l].apply(this,r):s;++l<e;)v=o[l].call(this,v);return v}})}var dp=Gd(),gp=Gd(!0);function hp(i,o){return i==null?i:In(i,Bi(o),ti)}function rp(i,o){return i==null?i:kd(i,Bi(o),ti)}function sp(i,o){return i&&Hi(i,Bi(o))}function lp(i,o){return i&&$n(i,Bi(o))}function vp(i){for(var o=-1,e=i==null?0:i.length,n={};++o<e;){var a=i[o];Ci(n,a[0],a[1])}return n}function Me(i,o){return _i(o,function(e){return Mi(i[e])})}function yp(i){return i==null?[]:Me(i,q(i))}function cp(i){return i==null?[]:Me(i,ti(i))}var bp=Object.prototype,pp=bp.hasOwnProperty,wp=He(function(i,o,e){pp.call(i,e)?i[e].push(o):Ci(i,e,[o])});function ia(i,o){return i>o}function Qe(i){return function(o,e){return typeof o=="string"&&typeof e=="string"||(o=yi(o),e=yi(e)),i(o,e)}}var jp=Qe(ia),fp=Qe(function(i,o){return i>=o}),mp=Object.prototype,Yp=mp.hasOwnProperty;function kp(i,o){return i!=null&&Yp.call(i,o)}function Lp(i,o){return i!=null&&sd(i,o,kp)}var Zp=Math.max,Sp=Math.min;function Jp(i,o,e){return i>=Sp(o,e)&&i<Zp(o,e)}function Cp(i,o,e){return o=Di(o),e===void 0?(e=o,o=0):e=Di(e),i=yi(i),Jp(i,o,e)}var Xp="[object String]";function xe(i){return typeof i=="string"||!C(i)&&O(i)&&oi(i)==Xp}function oa(i,o){return A(o,function(e){return i[e]})}function Jo(i){return i==null?[]:oa(i,q(i))}var Hp=Math.max;function Bp(i,o,e,n){i=ui(i)?i:Jo(i),e=e&&!n?H(e):0;var a=i.length;return e<0&&(e=Hp(a+e,0)),xe(i)?e<=a&&i.indexOf(o,e)>-1:!!a&&mo(i,o,e)>-1}var Tp=Math.max;function Dp(i,o,e){var n=i==null?0:i.length;if(!n)return-1;var a=e==null?0:H(e);return a<0&&(a=Tp(n+a,0)),mo(i,o,a)}function Mp(i){var o=i==null?0:i.length;return o?wi(i,0,-1):[]}var Qp=Math.min;function ea(i,o,e){for(var n=e?Vn:me,a=i[0].length,u=i.length,t=u,d=Array(u),g=1/0,r=[];t--;){var s=i[t];t&&o&&(s=A(s,si(o))),g=Qp(s.length,g),d[t]=!e&&(o||a>=120&&s.length>=120)?new oo(t&&s):void 0}s=i[0];var l=-1,v=d[0];i:for(;++l<a&&r.length<g;){var c=s[l],y=o?o(c):c;if(c=e||c!==0?c:0,!(v?Fo(v,y):n(r,y,e))){for(t=u;--t;){var b=d[t];if(!(b?Fo(b,y):n(i[t],y,e)))continue i}v&&v.push(y),r.push(c)}}return r}function na(i){return _(i)?i:[]}var xp=T(function(i){var o=A(i,na);return o.length&&o[0]===i[0]?ea(o):[]}),Gp=T(function(i){var o=ji(i),e=A(i,na);return o===ji(e)?o=void 0:e.pop(),e.length&&e[0]===i[0]?ea(e,J(o)):[]}),Wp=T(function(i){var o=ji(i),e=A(i,na);return o=typeof o=="function"?o:void 0,o&&e.pop(),e.length&&e[0]===i[0]?ea(e,void 0,o):[]});function Np(i,o,e,n){return Hi(i,function(a,u,t){o(n,e(a),u,t)}),n}function Wd(i,o){return function(e,n){return Np(e,i,o(n),{})}}var Pp=Object.prototype,Fp=Pp.toString,Rp=Wd(function(i,o,e){o!=null&&typeof o.toString!="function"&&(o=Fp.call(o)),i[o]=e},Zn(ai)),Nd=Object.prototype,Ap=Nd.hasOwnProperty,Kp=Nd.toString,Op=Wd(function(i,o,e){o!=null&&typeof o.toString!="function"&&(o=Kp.call(o)),Ap.call(i,o)?i[o].push(e):i[o]=[e]},J);function Pd(i,o){return o.length<2?i:ao(i,wi(o,0,-1))}function zo(i,o,e){o=Ki(o,i),i=Pd(i,o);var n=i==null?i:i[ki(ji(o))];return n==null?void 0:ri(n,i,e)}var Ep=T(zo),_p=T(function(i,o,e){var n=-1,a=typeof o=="function",u=ui(i)?Array(i.length):[];return zi(i,function(t){u[++n]=a?ri(o,t,e):zo(t,o,e)}),u}),zp="[object ArrayBuffer]";function Ip(i){return O(i)&&oi(i)==zp}var Yu=pi&&pi.isArrayBuffer,qp=Yu?si(Yu):Ip,Up="[object Boolean]";function Vp(i){return i===!0||i===!1||O(i)&&oi(i)==Up}var $p="[object Date]";function iw(i){return O(i)&&oi(i)==$p}var ku=pi&&pi.isDate,ow=ku?si(ku):iw;function ew(i){return O(i)&&i.nodeType===1&&!Oo(i)}var nw="[object Map]",aw="[object Set]",uw=Object.prototype,tw=uw.hasOwnProperty;function dw(i){if(i==null)return!0;if(ui(i)&&(C(i)||typeof i=="string"||typeof i.splice=="function"||Ri(i)||Lo(i)||$i(i)))return!i.length;var o=Ji(i);if(o==nw||o==aw)return!i.size;if(Ko(i))return!Xn(i).length;for(var e in i)if(tw.call(i,e))return!1;return!0}function gw(i,o){return Eo(i,o)}function hw(i,o,e){e=typeof e=="function"?e:void 0;var n=e?e(i,o):void 0;return n===void 0?Eo(i,o,void 0,e):!!n}var rw=I.isFinite;function sw(i){return typeof i=="number"&&rw(i)}function Fd(i){return typeof i=="number"&&i==H(i)}function lw(i,o){return i===o||On(i,o,En(o))}function vw(i,o,e){return e=typeof e=="function"?e:void 0,On(i,o,En(o),e)}var yw="[object Number]";function Rd(i){return typeof i=="number"||O(i)&&oi(i)==yw}function cw(i){return Rd(i)&&i!=+i}var bw=te?Mi:Cn,pw="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.";function ww(i){if(bw(i))throw new Error(pw);return nt(i)}function jw(i){return i==null}function fw(i){return i===null}var mw="[object RegExp]";function Yw(i){return O(i)&&oi(i)==mw}var Lu=pi&&pi.isRegExp,aa=Lu?si(Lu):Yw,Zu=9007199254740991;function kw(i){return Fd(i)&&i>=-Zu&&i<=Zu}function Lw(i){return i===void 0}var Zw="[object WeakMap]";function Sw(i){return O(i)&&Ji(i)==Zw}var Jw="[object WeakSet]";function Cw(i){return O(i)&&oi(i)==Jw}var Xw=1;function Hw(i){return J(typeof i=="function"?i:ci(i,Xw))}var Bw=Array.prototype,Tw=Bw.join;function Dw(i,o){return i==null?"":Tw.call(i,o)}var Mw=So(function(i,o,e){return i+(e?"-":"")+o.toLowerCase()}),Qw=He(function(i,o,e){Ci(i,e,o)});function xw(i,o,e){for(var n=e+1;n--;)if(i[n]===o)return n;return n}var Gw=Math.max,Ww=Math.min;function Nw(i,o,e){var n=i==null?0:i.length;if(!n)return-1;var a=n;return e!==void 0&&(a=H(e),a=a<0?Gw(n+a,0):Ww(a,n-1)),o===o?xw(i,o,a):fe(i,rt,a,!0)}var Pw=So(function(i,o,e){return i+(e?" ":"")+o.toLowerCase()}),Fw=Bt("toLowerCase");function ua(i,o){return i<o}var Rw=Qe(ua),Aw=Qe(function(i,o){return i<=o});function Kw(i,o){var e={};return o=J(o),Hi(i,function(n,a,u){Ci(e,o(n,a,u),n)}),e}function Ow(i,o){var e={};return o=J(o),Hi(i,function(n,a,u){Ci(e,a,o(n,a,u))}),e}var Ew=1;function _w(i){return rd(ci(i,Ew))}var zw=1;function Iw(i,o){return ld(i,ci(o,zw))}function Ge(i,o,e){for(var n=-1,a=i.length;++n<a;){var u=i[n],t=o(u);if(t!=null&&(d===void 0?t===t&&!gi(t):e(t,d)))var d=t,g=u}return g}function qw(i){return i&&i.length?Ge(i,ai,ia):void 0}function Uw(i,o){return i&&i.length?Ge(i,J(o),ia):void 0}function ta(i,o){for(var e,n=-1,a=i.length;++n<a;){var u=o(i[n]);u!==void 0&&(e=e===void 0?u:e+u)}return e}var Vw=NaN;function Ad(i,o){var e=i==null?0:i.length;return e?ta(i,o)/e:Vw}function $w(i){return Ad(i,ai)}function ij(i,o){return Ad(i,J(o))}var oj=ko(function(i,o,e){Be(i,o,e)}),ej=T(function(i,o){return function(e){return zo(e,i,o)}}),nj=T(function(i,o){return function(e){return zo(i,e,o)}});function aj(i){return i&&i.length?Ge(i,ai,ua):void 0}function uj(i,o){return i&&i.length?Ge(i,J(o),ua):void 0}function tj(i,o,e){var n=q(o),a=Me(o,n),u=!(K(e)&&"chain"in e)||!!e.chain,t=Mi(i);return li(a,function(d){var g=o[d];i[d]=g,t&&(i.prototype[d]=function(){var r=this.__chain__;if(u||r){var s=i(this.__wrapped__),l=s.__actions__=ni(this.__actions__);return l.push({func:g,args:arguments,thisArg:i}),s.__chain__=r,s}return g.apply(i,Oi([this.value()],arguments))})}),i}var dj=we(function(i,o){return i*o},1),gj="Expected a function";function We(i){if(typeof i!="function")throw new TypeError(gj);return function(){var o=arguments;switch(o.length){case 0:return!i.call(this);case 1:return!i.call(this,o[0]);case 2:return!i.call(this,o[0],o[1]);case 3:return!i.call(this,o[0],o[1],o[2])}return!i.apply(this,o)}}function hj(i){for(var o,e=[];!(o=i.next()).done;)e.push(o.value);return e}var rj="[object Map]",sj="[object Set]",Ie=$?$.iterator:void 0;function Kd(i){if(!i)return[];if(ui(i))return xe(i)?Li(i):ni(i);if(Ie&&i[Ie])return hj(i[Ie]());var o=Ji(i),e=o==rj?Kn:o==sj?Xe:Jo;return e(i)}function lj(){this.__values__===void 0&&(this.__values__=Kd(this.value()));var i=this.__index__>=this.__values__.length,o=i?void 0:this.__values__[this.__index__++];return{done:i,value:o}}function Od(i,o){var e=i.length;if(e)return o+=o<0?e:0,Qi(o,e)?i[o]:void 0}function vj(i,o){return i&&i.length?Od(i,H(o)):void 0}function yj(i){return i=H(i),T(function(o){return Od(o,i)})}var cj=Object.prototype,bj=cj.hasOwnProperty;function da(i,o){o=Ki(o,i);var e=-1,n=o.length;if(!n)return!0;for(;++e<n;){var a=ki(o[e]);if(a==="__proto__"&&!bj.call(i,"__proto__")||(a==="constructor"||a==="prototype")&&e<n-1)return!1}var u=Pd(i,o);return u==null||delete u[ki(ji(o))]}function pj(i){return Oo(i)?void 0:i}var wj=1,jj=2,fj=4,mj=Ni(function(i,o){var e={};if(i==null)return e;var n=!1;o=A(o,function(u){return u=Ki(u,i),n||(n=u.length>1),u}),Xi(i,Fn(i),e),n&&(e=ci(e,wj|jj|fj,pj));for(var a=o.length;a--;)da(e,o[a]);return e});function Io(i,o,e,n){if(!K(i))return i;o=Ki(o,i);for(var a=-1,u=o.length,t=u-1,d=i;d!=null&&++a<u;){var g=ki(o[a]),r=e;if(g==="__proto__"||g==="constructor"||g==="prototype")return i;if(a!=t){var s=d[g];r=n?n(s,g,d):void 0,r===void 0&&(r=K(s)?s:Qi(o[a+1])?[]:{})}Ao(d,g,r),d=d[g]}return i}function Ed(i,o,e){for(var n=-1,a=o.length,u={};++n<a;){var t=o[n],d=ao(i,t);e(d,t)&&Io(u,Ki(t,i),d)}return u}function _d(i,o){if(i==null)return{};var e=A(Fn(i),function(n){return[n]});return o=J(o),Ed(i,e,function(n,a){return o(n,a[0])})}function Yj(i,o){return _d(i,We(J(o)))}function kj(i){return Lt(2,i)}function Lj(i,o){var e=i.length;for(i.sort(o);e--;)i[e]=i[e].value;return i}function zd(i,o){if(i!==o){var e=i!==void 0,n=i===null,a=i===i,u=gi(i),t=o!==void 0,d=o===null,g=o===o,r=gi(o);if(!d&&!r&&!u&&i>o||u&&t&&g&&!d&&!r||n&&t&&g||!e&&g||!a)return 1;if(!n&&!u&&!r&&i<o||r&&e&&a&&!n&&!u||d&&e&&a||!t&&a||!g)return-1}return 0}function Zj(i,o,e){for(var n=-1,a=i.criteria,u=o.criteria,t=a.length,d=e.length;++n<t;){var g=zd(a[n],u[n]);if(g){if(n>=d)return g;var r=e[n];return g*(r=="desc"?-1:1)}}return i.index-o.index}function Id(i,o,e){o.length?o=A(o,function(u){return C(u)?function(t){return ao(t,u.length===1?u[0]:u)}:u}):o=[ai];var n=-1;o=A(o,si(J));var a=xd(i,function(u,t,d){var g=A(o,function(r){return r(u)});return{criteria:g,index:++n,value:u}});return Lj(a,function(u,t){return Zj(u,t,e)})}function Sj(i,o,e,n){return i==null?[]:(C(o)||(o=o==null?[]:[o]),e=n?void 0:e,C(e)||(e=e==null?[]:[e]),Id(i,o,e))}function ga(i){return Ni(function(o){return o=A(o,si(J)),T(function(e){var n=this;return i(o,function(a){return ri(a,n,e)})})})}var Jj=ga(A),Cj=T,Xj=Math.min,Hj=Cj(function(i,o){o=o.length==1&&C(o[0])?A(o[0],si(J)):A(V(o,1),si(J));var e=o.length;return T(function(n){for(var a=-1,u=Xj(n.length,e);++a<u;)n[a]=o[a].call(this,n[a]);return ri(i,this,n)})}),Bj=ga(Xd),Tj=ga(An),Dj=9007199254740991,Mj=Math.floor;function cn(i,o){var e="";if(!i||o<1||o>Dj)return e;do o%2&&(e+=i),o=Mj(o/2),o&&(i+=i);while(o);return e}var Qj=zn("length"),qd="\\ud800-\\udfff",xj="\\u0300-\\u036f",Gj="\\ufe20-\\ufe2f",Wj="\\u20d0-\\u20ff",Nj=xj+Gj+Wj,Pj="\\ufe0e\\ufe0f",Fj="["+qd+"]",bn="["+Nj+"]",pn="\\ud83c[\\udffb-\\udfff]",Rj="(?:"+bn+"|"+pn+")",Ud="[^"+qd+"]",Vd="(?:\\ud83c[\\udde6-\\uddff]){2}",$d="[\\ud800-\\udbff][\\udc00-\\udfff]",Aj="\\u200d",ig=Rj+"?",og="["+Pj+"]?",Kj="(?:"+Aj+"(?:"+[Ud,Vd,$d].join("|")+")"+og+ig+")*",Oj=og+ig+Kj,Ej="(?:"+[Ud+bn+"?",bn,Vd,$d,Fj].join("|")+")",Su=RegExp(pn+"(?="+pn+")|"+Ej+Oj,"g");function _j(i){for(var o=Su.lastIndex=0;Su.test(i);)++o;return o}function Co(i){return Zo(i)?_j(i):Qj(i)}var zj=Math.ceil;function ye(i,o){o=o===void 0?" ":hi(o);var e=o.length;if(e<2)return e?cn(o,i):o;var n=cn(o,zj(i/Co(o)));return Zo(o)?Ei(Li(n),0,i).join(""):n.slice(0,i)}var Ij=Math.ceil,qj=Math.floor;function Uj(i,o,e){i=x(i),o=H(o);var n=o?Co(i):0;if(!o||n>=o)return i;var a=(o-n)/2;return ye(qj(a),e)+i+ye(Ij(a),e)}function Vj(i,o,e){i=x(i),o=H(o);var n=o?Co(i):0;return o&&n<o?i+ye(o-n,e):i}function $j(i,o,e){i=x(i),o=H(o);var n=o?Co(i):0;return o&&n<o?ye(o-n,e)+i:i}var of=/^\s+/,ef=I.parseInt;function nf(i,o,e){return e||o==null?o=0:o&&(o=+o),ef(x(i).replace(of,""),o||0)}var af=32,Ne=T(function(i,o){var e=Fi(o,Yo(Ne));return xi(i,af,void 0,o,e)});Ne.placeholder={};var uf=64,ha=T(function(i,o){var e=Fi(o,Yo(ha));return xi(i,uf,void 0,o,e)});ha.placeholder={};var tf=He(function(i,o,e){i[e?0:1].push(o)},function(){return[[],[]]});function df(i,o){return Ed(i,o,function(e,n){return _n(i,n)})}var gf=Ni(function(i,o){return i==null?{}:df(i,o)});function hf(i){for(var o,e=this;e instanceof je;){var n=dt(e);n.__index__=0,n.__values__=void 0,o?a.__wrapped__=n:o=n;var a=n;e=e.__wrapped__}return a.__wrapped__=i,o}function rf(i){return function(o){return i==null?void 0:ao(i,o)}}function sf(i,o,e,n){for(var a=e-1,u=i.length;++a<u;)if(n(i[a],o))return a;return-1}var lf=Array.prototype,Ju=lf.splice;function ra(i,o,e,n){var a=n?sf:mo,u=-1,t=o.length,d=i;for(i===o&&(o=ni(o)),e&&(d=A(i,si(e)));++u<t;)for(var g=0,r=o[u],s=e?e(r):r;(g=a(d,s,g,n))>-1;)d!==i&&Ju.call(d,g,1),Ju.call(i,g,1);return i}function eg(i,o){return i&&i.length&&o&&o.length?ra(i,o):i}var vf=T(eg);function yf(i,o,e){return i&&i.length&&o&&o.length?ra(i,o,J(e)):i}function cf(i,o,e){return i&&i.length&&o&&o.length?ra(i,o,void 0,e):i}var bf=Array.prototype,pf=bf.splice;function ng(i,o){for(var e=i?o.length:0,n=e-1;e--;){var a=o[e];if(e==n||a!==u){var u=a;Qi(a)?pf.call(i,a,1):da(i,a)}}return i}var wf=Ni(function(i,o){var e=i==null?0:i.length,n=Tn(i,o);return ng(i,A(o,function(a){return Qi(a,e)?+a:a}).sort(zd)),n}),jf=Math.floor,ff=Math.random;function sa(i,o){return i+jf(ff()*(o-i+1))}var mf=parseFloat,Yf=Math.min,kf=Math.random;function Lf(i,o,e){if(e&&typeof e!="boolean"&&ii(i,o,e)&&(o=e=void 0),e===void 0&&(typeof o=="boolean"?(e=o,o=void 0):typeof i=="boolean"&&(e=i,i=void 0)),i===void 0&&o===void 0?(i=0,o=1):(i=Di(i),o===void 0?(o=i,i=0):o=Di(o)),i>o){var n=i;i=o,o=n}if(e||i%1||o%1){var a=kf();return Yf(i+a*(o-i+mf("1e-"+((a+"").length-1))),o)}return sa(i,o)}var Zf=Math.ceil,Sf=Math.max;function Jf(i,o,e,n){for(var a=-1,u=Sf(Zf((o-i)/(e||1)),0),t=Array(u);u--;)t[n?u:++a]=i,i+=e;return t}function ag(i){return function(o,e,n){return n&&typeof n!="number"&&ii(o,e,n)&&(e=n=void 0),o=Di(o),e===void 0?(e=o,o=0):e=Di(e),n=n===void 0?o<e?1:-1:Di(n),Jf(o,e,n,i)}}var Cf=ag(),Xf=ag(!0),Hf=256,Bf=Ni(function(i,o){return xi(i,Hf,void 0,void 0,void 0,o)});function ug(i,o,e,n,a){return a(i,function(u,t,d){e=n?(n=!1,u):o(e,u,t,d)}),e}function Tf(i,o,e){var n=C(i)?xn:ug,a=arguments.length<3;return n(i,J(o),e,a,zi)}function Df(i,o,e,n){var a=i==null?0:i.length;for(n&&a&&(e=i[--a]);a--;)e=o(e,i[a],a,i);return e}function Mf(i,o,e){var n=C(i)?Df:ug,a=arguments.length<3;return n(i,J(o),e,a,Ld)}function Qf(i,o){var e=C(i)?_i:Bd;return e(i,We(J(o)))}function xf(i,o){var e=[];if(!(i&&i.length))return e;var n=-1,a=[],u=i.length;for(o=J(o);++n<u;){var t=i[n];o(t,n,i)&&(e.push(t),a.push(n))}return ng(i,a),e}function Gf(i,o,e){return(e?ii(i,o,e):o===void 0)?o=1:o=H(o),cn(x(i),o)}function Wf(){var i=arguments,o=x(i[0]);return i.length<3?o:o.replace(i[1],i[2])}var Nf="Expected a function";function Pf(i,o){if(typeof i!="function")throw new TypeError(Nf);return o=o===void 0?o:H(o),T(i,o)}function Ff(i,o,e){o=Ki(o,i);var n=-1,a=o.length;for(a||(a=1,i=void 0);++n<a;){var u=i?.[ki(o[n])];u===void 0&&(n=a,u=e),i=Mi(u)?u.call(i):u}return i}var Rf=Array.prototype,Af=Rf.reverse;function wn(i){return i==null?i:Af.call(i)}var Kf=Wn("round");function tg(i){var o=i.length;return o?i[sa(0,o-1)]:void 0}function Of(i){return tg(Jo(i))}function Ef(i){var o=C(i)?tg:Of;return o(i)}function Pe(i,o){var e=-1,n=i.length,a=n-1;for(o=o===void 0?n:o;++e<o;){var u=sa(e,a),t=i[u];i[u]=i[e],i[e]=t}return i.length=o,i}function _f(i,o){return Pe(ni(i),uo(o,0,i.length))}function zf(i,o){var e=Jo(i);return Pe(e,uo(o,0,e.length))}function If(i,o,e){(e?ii(i,o,e):o===void 0)?o=1:o=H(o);var n=C(i)?_f:zf;return n(i,o)}function qf(i,o,e){return i==null?i:Io(i,o,e)}function Uf(i,o,e,n){return n=typeof n=="function"?n:void 0,i==null?i:Io(i,o,e,n)}function Vf(i){return Pe(ni(i))}function $f(i){return Pe(Jo(i))}function im(i){var o=C(i)?Vf:$f;return o(i)}var om="[object Map]",em="[object Set]";function nm(i){if(i==null)return 0;if(ui(i))return xe(i)?Co(i):i.length;var o=Ji(i);return o==om||o==em?i.size:Xn(i).length}function am(i,o,e){var n=i==null?0:i.length;return n?(e&&typeof e!="number"&&ii(i,o,e)?(o=0,e=n):(o=o==null?0:H(o),e=e===void 0?n:H(e)),wi(i,o,e)):[]}var um=So(function(i,o,e){return i+(e?"_":"")+o.toLowerCase()});function tm(i,o){var e;return zi(i,function(n,a,u){return e=o(n,a,u),!e}),!!e}function dm(i,o,e){var n=C(i)?An:tm;return e&&ii(i,o,e)&&(o=void 0),n(i,J(o))}var gm=T(function(i,o){if(i==null)return[];var e=o.length;return e>1&&ii(i,o[0],o[1])?o=[]:e>2&&ii(o[0],o[1],o[2])&&(o=[o[0]]),Id(i,V(o,1),[])}),hm=4294967295,rm=hm-1,sm=Math.floor,lm=Math.min;function la(i,o,e,n){var a=0,u=i==null?0:i.length;if(u===0)return 0;o=e(o);for(var t=o!==o,d=o===null,g=gi(o),r=o===void 0;a<u;){var s=sm((a+u)/2),l=e(i[s]),v=l!==void 0,c=l===null,y=l===l,b=gi(l);if(t)var w=n||y;else r?w=y&&(n||v):d?w=y&&v&&(n||!c):g?w=y&&v&&!c&&(n||!b):c||b?w=!1:w=n?l<=o:l<o;w?a=s+1:u=s}return lm(u,rm)}var vm=4294967295,ym=vm>>>1;function Fe(i,o,e){var n=0,a=i==null?n:i.length;if(typeof o=="number"&&o===o&&a<=ym){for(;n<a;){var u=n+a>>>1,t=i[u];t!==null&&!gi(t)&&(e?t<=o:t<o)?n=u+1:a=u}return a}return la(i,o,ai,e)}function cm(i,o){return Fe(i,o)}function bm(i,o,e){return la(i,o,J(e))}function pm(i,o){var e=i==null?0:i.length;if(e){var n=Fe(i,o);if(n<e&&Zi(i[n],o))return n}return-1}function wm(i,o){return Fe(i,o,!0)}function jm(i,o,e){return la(i,o,J(e),!0)}function fm(i,o){var e=i==null?0:i.length;if(e){var n=Fe(i,o,!0)-1;if(Zi(i[n],o))return n}return-1}function dg(i,o){for(var e=-1,n=i.length,a=0,u=[];++e<n;){var t=i[e],d=o?o(t):t;if(!e||!Zi(d,g)){var g=d;u[a++]=t===0?0:t}}return u}function mm(i){return i&&i.length?dg(i):[]}function Ym(i,o){return i&&i.length?dg(i,J(o)):[]}var km=4294967295;function Lm(i,o,e){return e&&typeof e!="number"&&ii(i,o,e)&&(o=e=void 0),e=e===void 0?km:e>>>0,e?(i=x(i),i&&(typeof o=="string"||o!=null&&!aa(o))&&(o=hi(o),!o&&Zo(i))?Ei(Li(i),0,e):i.split(o,e)):[]}var Zm="Expected a function",Sm=Math.max;function Jm(i,o){if(typeof i!="function")throw new TypeError(Zm);return o=o==null?0:Sm(H(o),0),T(function(e){var n=e[o],a=Ei(e,0,o);return n&&Oi(a,n),ri(i,this,a)})}var Cm=So(function(i,o,e){return i+(e?" ":"")+Qn(o)});function Xm(i,o,e){return i=x(i),e=e==null?0:uo(H(e),0,i.length),o=hi(o),i.slice(e,e+o.length)==o}function Hm(){return{}}function Bm(){return""}function Tm(){return!0}var Dm=we(function(i,o){return i-o},0);function Mm(i){return i&&i.length?ta(i,ai):0}function Qm(i,o){return i&&i.length?ta(i,J(o)):0}function xm(i){var o=i==null?0:i.length;return o?wi(i,1,o):[]}function Gm(i,o,e){return i&&i.length?(o=e||o===void 0?1:H(o),wi(i,0,o<0?0:o)):[]}function Wm(i,o,e){var n=i==null?0:i.length;return n?(o=e||o===void 0?1:H(o),o=n-o,wi(i,o<0?0:o,n)):[]}function Nm(i,o){return i&&i.length?Te(i,J(o),!1,!0):[]}function Pm(i,o){return i&&i.length?Te(i,J(o)):[]}function Fm(i,o){return o(i),i}var gg=Object.prototype,Rm=gg.hasOwnProperty;function Cu(i,o,e,n){return i===void 0||Zi(i,gg[e])&&!Rm.call(n,e)?o:i}var Am={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function Km(i){return"\\"+Am[i]}var hg=/<%=([\s\S]+?)%>/g,Om=/<%-([\s\S]+?)%>/g,Em=/<%([\s\S]+?)%>/g,jn={escape:Om,evaluate:Em,interpolate:hg,variable:"",imports:{_:{escape:Jd}}},_m="Invalid `variable` option passed into `_.template`",zm="Invalid `imports` option passed into `_.template`",Im=/\b__p \+= '';/g,qm=/\b(__p \+=) '' \+/g,Um=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Xu=/[()=,{}\[\]\/\s]/,Vm=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ae=/($^)/,$m=/['\n\r\u2028\u2029\\]/g,iY=Object.prototype,Hu=iY.hasOwnProperty;function oY(i,o,e){var n=jn.imports._.templateSettings||jn;e&&ii(i,o,e)&&(o=void 0),i=x(i),o=dn({},o,n,Cu);var a=dn({},o.imports,n.imports,Cu),u=q(a),t=oa(a,u);li(u,function(w){if(Xu.test(w))throw new Error(zm)});var d,g,r=0,s=o.interpolate||ae,l="__p += '",v=RegExp((o.escape||ae).source+"|"+s.source+"|"+(s===hg?Vm:ae).source+"|"+(o.evaluate||ae).source+"|$","g"),c=Hu.call(o,"sourceURL")?"//# sourceURL="+(o.sourceURL+"").replace(/\s/g," ")+`
4
4
  `:"";i.replace(v,function(w,p,j,f,m,k){return j||(j=f),l+=i.slice(r,k).replace($m,Km),p&&(d=!0,l+=`' +
@@ -0,0 +1 @@
1
+ import{createRequire as l}from"node:module";import{f as g,v as h}from"./index-CE6MsgcV.js";const E=l(import.meta.url),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[s,r]=_.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return _.getBuiltinModule(e)}return E(e)},{spawnSync:p}=d("node:child_process"),b="0000000000000000000000000000000000000000",A=e=>{if(g(e))try{const s=h(e);return JSON.parse(s)}catch{return}},f=(e,s)=>{const r=p("git",e,{cwd:s,encoding:"utf8"});if(!(r.error||typeof r.status!="number"||r.status!==0))return typeof r.stdout=="string"?r.stdout.trim():void 0},c=e=>typeof e=="string"&&e.length>0&&e!==b,I=(e,s,r)=>{const i=[],o=e.GITHUB_BASE_REF,t=e.GITHUB_SHA??"HEAD";if(o&&o.length>0)return i.push(`pull_request: $GITHUB_BASE_REF=${o}`),{base:`origin/${o}`,head:t,notes:i,provider:"github"};const a=e.GITHUB_EVENT_PATH,n=a?r(a):void 0;if(n){const u=typeof n.before=="string"?n.before:void 0;if(c(u))return i.push(`push: event.before=${u}`),{base:u,head:t,notes:i,provider:"github"}}return i.push(`fallback: origin/${s}`),{base:`origin/${s}`,head:t,notes:i,provider:"github"}},R=(e,s)=>{const r=[],i=e.CI_COMMIT_SHA??"HEAD";if(e.CI_PIPELINE_SOURCE==="merge_request_event"){const a=e.CI_MERGE_REQUEST_DIFF_BASE_SHA;if(c(a))return r.push(`merge_request: $CI_MERGE_REQUEST_DIFF_BASE_SHA=${a}`),{base:a,head:i,notes:r,provider:"gitlab"};const n=e.CI_MERGE_REQUEST_TARGET_BRANCH_NAME;if(n&&n.length>0)return r.push(`merge_request: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME=${n}`),{base:`origin/${n}`,head:i,notes:r,provider:"gitlab"}}const o=e.CI_COMMIT_BEFORE_SHA;if(c(o))return r.push(`push: $CI_COMMIT_BEFORE_SHA=${o}`),{base:o,head:i,notes:r,provider:"gitlab"};const t=e.CI_DEFAULT_BRANCH??s;return r.push(`fallback: origin/${t}`),{base:`origin/${t}`,head:i,notes:r,provider:"gitlab"}},C=(e,s)=>{const r=[],i=e.BUILDKITE_COMMIT??"HEAD",o=e.BUILDKITE_PULL_REQUEST_BASE_BRANCH;return o&&o.length>0?(r.push(`pull_request: $BUILDKITE_PULL_REQUEST_BASE_BRANCH=${o}`),{base:`origin/${o}`,head:i,notes:r,provider:"buildkite"}):(r.push(`fallback: origin/${s} (buildkite has no canonical previous-build SHA env)`),{base:`origin/${s}`,head:i,notes:r,provider:"buildkite"})},v=(e,s)=>{const r=[],i=e.CIRCLE_SHA1??"HEAD",o=e.CIRCLE_PR_BASE_BRANCH;return o&&o.length>0?(r.push(`pull_request: $CIRCLE_PR_BASE_BRANCH=${o}`),{base:`origin/${o}`,head:i,notes:r,provider:"circleci"}):(r.push(`fallback: origin/${s} (circleci has no canonical previous-build SHA env)`),{base:`origin/${s}`,head:i,notes:r,provider:"circleci"})},T=(e,s,r)=>{const i=[],o=s(["merge-base","HEAD",`origin/${e}`],r);return o&&o.length>0?(i.push(`local: git merge-base HEAD origin/${e}=${o}`),{base:o,head:"HEAD",notes:i,provider:"local"}):(i.push(`local fallback: origin/${e} (no merge-base available)`),{base:`origin/${e}`,head:"HEAD",notes:i,provider:"local"})},H=e=>{const s=e?.env??process.env,r=e?.defaultBase??"main",i=e?.readEventPayload??A,o=e?.runGit??f,t=e?.workspaceRoot??process.cwd();return s.GITHUB_ACTIONS==="true"?I(s,r,i):s.GITLAB_CI==="true"?R(s,r):s.BUILDKITE==="true"?C(s,r):s.CIRCLECI==="true"?v(s,r):T(r,o,t)};export{H as r};
@@ -1,4 +1,4 @@
1
- import{createRequire as K}from"node:module";import{h as ee,c as f,n as te,i as k,d as re}from"../packem_chunks/catalog.js";import"./env-XJzocuUP.js";import"./window-ops-DDePlWLV.js";import{K as ae,M as se,Q as oe,T as ne}from"../packem_chunks/cli-main.js";const G=K(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,S=e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[a,t]=M.versions.node.split(".").map(Number);if(a>22||a===22&&t>=3||a===20&&t>=16)return M.getBuiltinModule(e)}return G(e)},{spawn:Y,execFileSync:N,execFile:Q}=S("node:child_process"),{existsSync:_}=S("node:fs"),{platform:X,homedir:P}=S("node:os"),{join:h}=S("node:path"),{promisify:Z}=S("node:util"),ie=/v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/,ue=5e3,ce=1e4,de=3e5,le=4096,T=X()==="win32",q=["amp","claude","codex","copilot","crush","cursor","droid","gemini","kimi","opencode","qwen"];class w extends Error{exitCode;durationMs;provider;stderr;stdout;timedOut;aborted;constructor(a,t){super(a),this.name="AiRunError",this.provider=t.provider,this.exitCode=t.exitCode??null,this.durationMs=t.durationMs,this.stdout=t.stdout??"",this.stderr=t.stderr??"",this.timedOut=t.timedOut??!1,this.aborted=t.aborted??!1}}const pe={alternateCommands:[],buildArgs:(e,{dangerous:a})=>{const t=["-x",e];return a&&t.push("--dangerously-allow-all"),t},command:"amp",defaultModel:"",envVariable:"AMP_PATH",supportsMaxTokens:!1,supportsModel:!1},me={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=[];return a&&r.push("--dangerously-skip-permissions"),t&&r.push("--model",t),r.push("--output-format","text","-p",e),r},command:"claude",defaultModel:"",envVariable:"CLAUDE_PATH",supportsMaxTokens:!1,supportsModel:!0},ge={alternateCommands:["openai-codex"],buildArgs:(e,{dangerous:a,model:t})=>{const r=["exec"];return t&&r.push("--model",t),a&&r.push("--dangerously-bypass-approvals-and-sandbox"),r.push(e),r},command:"codex",defaultModel:"",envVariable:"CODEX_PATH",supportsMaxTokens:!1,supportsModel:!0},he={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=["-p",e];return a&&r.push("--allow-all-tools"),t&&r.push("--model",t),r},command:"copilot",defaultModel:"",envVariable:"COPILOT_PATH",supportsMaxTokens:!1,supportsModel:!0},fe={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=["run"];return a&&r.push("--yolo"),t&&r.push("-m",t),r.push(e),r},command:"crush",defaultModel:"",envVariable:"CRUSH_PATH",supportsMaxTokens:!1,supportsModel:!0},ye={alternateCommands:["cursor"],buildArgs:(e,{dangerous:a,model:t})=>{const r=["-p"];return a&&r.push("--force"),r.push("--output-format","text"),t&&r.push("--model",t),r.push(e),r},command:"agent",defaultModel:"",envVariable:"CURSOR_PATH",supportsMaxTokens:!1,supportsModel:!0},ve={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=[e];return a&&r.push("--skip-permissions-unsafe"),r.push("-o","text"),t&&r.push("-m",t),r},command:"droid",defaultModel:"",envVariable:"DROID_PATH",supportsMaxTokens:!1,supportsModel:!0},be={alternateCommands:["gemini-cli"],buildArgs:(e,{dangerous:a,maxTokens:t,model:r})=>{const s=[];return a||s.push("--sandbox"),r&&s.push("--model",r),s.push("--max-output-tokens",String(t),"-p",e),s},command:"gemini",defaultModel:"gemini-2.5-pro",envVariable:"GEMINI_PATH",supportsMaxTokens:!0,supportsModel:!0},ke={alternateCommands:[],buildArgs:(e,{model:a})=>{const t=["--quiet","-p",e];return a&&t.push("-m",a),t},command:"kimi",defaultModel:"",envVariable:"KIMI_PATH",supportsMaxTokens:!1,supportsModel:!0},we={alternateCommands:[],buildArgs:(e,{model:a})=>{const t=["run",e];return a&&t.push("-m",a),t},command:"opencode",defaultModel:"",envVariable:"OPENCODE_PATH",supportsMaxTokens:!1,supportsModel:!0},Me={alternateCommands:["qwen-code"],buildArgs:(e,{dangerous:a,model:t})=>{const r=["-p",e];return a&&r.push("--yolo"),r.push("-o","text"),t&&r.push("-m",t),r},command:"qwen",defaultModel:"",envVariable:"QWEN_PATH",supportsMaxTokens:!1,supportsModel:!0};Z(Q);const V={amp:pe,claude:me,codex:ge,copilot:he,crush:fe,cursor:ye,droid:ve,gemini:be,kimi:ke,opencode:we,qwen:Me},Se=/\.(?:bat|cmd)$/i,D=e=>T&&Se.test(e),L=e=>`"${e.replaceAll('"','""')}"`,O=e=>e==="~"||e.startsWith("~/")||T&&e.startsWith("~\\")?h(P(),e.slice(2)):e,Ae=e=>{try{const a=N(T?"where":"which",[e],{encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:ue}).trim().split(`
1
+ import{createRequire as K}from"node:module";import{h as ee,d as f,n as te,i as k,E as re}from"../packem_chunks/catalog.js";import"./env-Ct3hMEYB.js";import{I as ae,J as se,K as oe,M as ne}from"../packem_chunks/cli-main.js";const G=K(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,S=e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[a,t]=M.versions.node.split(".").map(Number);if(a>22||a===22&&t>=3||a===20&&t>=16)return M.getBuiltinModule(e)}return G(e)},{spawn:Y,execFileSync:N,execFile:X}=S("node:child_process"),{existsSync:_}=S("node:fs"),{platform:Z,homedir:P}=S("node:os"),{join:h}=S("node:path"),{promisify:Q}=S("node:util"),ie=/v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/,ue=5e3,ce=1e4,de=3e5,le=4096,T=Z()==="win32",q=["amp","claude","codex","copilot","crush","cursor","droid","gemini","kimi","opencode","qwen"];class w extends Error{exitCode;durationMs;provider;stderr;stdout;timedOut;aborted;constructor(a,t){super(a),this.name="AiRunError",this.provider=t.provider,this.exitCode=t.exitCode??null,this.durationMs=t.durationMs,this.stdout=t.stdout??"",this.stderr=t.stderr??"",this.timedOut=t.timedOut??!1,this.aborted=t.aborted??!1}}const pe={alternateCommands:[],buildArgs:(e,{dangerous:a})=>{const t=["-x",e];return a&&t.push("--dangerously-allow-all"),t},command:"amp",defaultModel:"",envVariable:"AMP_PATH",supportsMaxTokens:!1,supportsModel:!1},me={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=[];return a&&r.push("--dangerously-skip-permissions"),t&&r.push("--model",t),r.push("--output-format","text","-p",e),r},command:"claude",defaultModel:"",envVariable:"CLAUDE_PATH",supportsMaxTokens:!1,supportsModel:!0},ge={alternateCommands:["openai-codex"],buildArgs:(e,{dangerous:a,model:t})=>{const r=["exec"];return t&&r.push("--model",t),a&&r.push("--dangerously-bypass-approvals-and-sandbox"),r.push(e),r},command:"codex",defaultModel:"",envVariable:"CODEX_PATH",supportsMaxTokens:!1,supportsModel:!0},he={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=["-p",e];return a&&r.push("--allow-all-tools"),t&&r.push("--model",t),r},command:"copilot",defaultModel:"",envVariable:"COPILOT_PATH",supportsMaxTokens:!1,supportsModel:!0},fe={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=["run"];return a&&r.push("--yolo"),t&&r.push("-m",t),r.push(e),r},command:"crush",defaultModel:"",envVariable:"CRUSH_PATH",supportsMaxTokens:!1,supportsModel:!0},ye={alternateCommands:["cursor"],buildArgs:(e,{dangerous:a,model:t})=>{const r=["-p"];return a&&r.push("--force"),r.push("--output-format","text"),t&&r.push("--model",t),r.push(e),r},command:"agent",defaultModel:"",envVariable:"CURSOR_PATH",supportsMaxTokens:!1,supportsModel:!0},ve={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=[e];return a&&r.push("--skip-permissions-unsafe"),r.push("-o","text"),t&&r.push("-m",t),r},command:"droid",defaultModel:"",envVariable:"DROID_PATH",supportsMaxTokens:!1,supportsModel:!0},be={alternateCommands:["gemini-cli"],buildArgs:(e,{dangerous:a,maxTokens:t,model:r})=>{const s=[];return a||s.push("--sandbox"),r&&s.push("--model",r),s.push("--max-output-tokens",String(t),"-p",e),s},command:"gemini",defaultModel:"gemini-2.5-pro",envVariable:"GEMINI_PATH",supportsMaxTokens:!0,supportsModel:!0},ke={alternateCommands:[],buildArgs:(e,{model:a})=>{const t=["--quiet","-p",e];return a&&t.push("-m",a),t},command:"kimi",defaultModel:"",envVariable:"KIMI_PATH",supportsMaxTokens:!1,supportsModel:!0},we={alternateCommands:[],buildArgs:(e,{model:a})=>{const t=["run",e];return a&&t.push("-m",a),t},command:"opencode",defaultModel:"",envVariable:"OPENCODE_PATH",supportsMaxTokens:!1,supportsModel:!0},Me={alternateCommands:["qwen-code"],buildArgs:(e,{dangerous:a,model:t})=>{const r=["-p",e];return a&&r.push("--yolo"),r.push("-o","text"),t&&r.push("-m",t),r},command:"qwen",defaultModel:"",envVariable:"QWEN_PATH",supportsMaxTokens:!1,supportsModel:!0};Q(X);const V={amp:pe,claude:me,codex:ge,copilot:he,crush:fe,cursor:ye,droid:ve,gemini:be,kimi:ke,opencode:we,qwen:Me},Se=/\.(?:bat|cmd)$/i,D=e=>T&&Se.test(e),L=e=>`"${e.replaceAll('"','""')}"`,O=e=>e==="~"||e.startsWith("~/")||T&&e.startsWith("~\\")?h(P(),e.slice(2)):e,Ae=e=>{try{const a=N(T?"where":"which",[e],{encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:ue}).trim().split(`
2
2
  `)[0]?.trim();return a&&a.length>0?a:void 0}catch{return}},$e=e=>{const a=P();if(T){const t=process.env.APPDATA??"",r=process.env.LOCALAPPDATA??"",s=process.env.ProgramFiles??"";return[h(t,"npm",`${e}.cmd`),h(t,"npm",e),h(r,"Programs",e,`${e}.exe`),h(s,e,`${e}.exe`),h(a,".npm-global","bin",`${e}.cmd`)]}return[`/opt/homebrew/bin/${e}`,`/usr/local/bin/${e}`,h(a,".npm-global","bin",e),h(a,".local","bin",e),h(a,".cargo","bin",e)]},Te=e=>{try{const a=N(e,["--version"],{encoding:"utf8",shell:D(e),stdio:["pipe","pipe","pipe"],timeout:ce}),t=ie.exec(a);return t?t[1]:void 0}catch{return}},F=(e,a={})=>{const t=V[e],r={available:!1,name:e},s=a.version!==!1,o=i=>{if(s)return Te(i)},n=process.env[t.envVariable];if(n&&_(O(n))){const i=O(n);return{...r,available:!0,detectionMethod:"envvar",path:i,version:o(i)}}const c=[t.command,...t.alternateCommands];for(const i of c){const u=Ae(i);if(u)return{...r,available:!0,detectionMethod:"which",path:u,version:o(u)}}for(const i of c)for(const u of $e(i))if(_(u))return{...r,available:!0,detectionMethod:"known-path",path:u,version:o(u)};return r},xe=(e={})=>q.map(a=>F(a,e)),Ce=(e={})=>xe(e).filter(a=>a.available),Ee=(e,a,t={})=>{const r=V[e],s=t.model??r.defaultModel,o=t.maxTokens!==void 0&&Number.isFinite(t.maxTokens)?t.maxTokens:le;return r.buildArgs(a,{dangerous:t.dangerous===!0,maxTokens:o,model:s})},Re=async(e,a,t={})=>{if(!e.available||!e.path)throw new w(`AI provider "${e.name}" is not available.`,{durationMs:0,provider:e.name});const r=Ee(e.name,a,t),s=t.timeoutMs!==void 0&&Number.isFinite(t.timeoutMs)?t.timeoutMs:de,o=e.path,n=D(o),c=Date.now();if(t.signal?.aborted)throw new w(`${e.name} CLI run was aborted.`,{aborted:!0,durationMs:0,provider:e.name});return new Promise((i,u)=>{const m={cwd:t.cwd,env:{...process.env,...t.env,FORCE_COLOR:"0",NO_COLOR:"1"},shell:n,stdio:["pipe","pipe","pipe"]},l=n?r.map(d=>L(d)):r,g=Y(n?L(o):o,l,m);g.stdin?.end();let y="",v="",b=!1,E,R,A;const x=()=>{clearTimeout(R),clearTimeout(E),A&&t.signal?.removeEventListener("abort",A)},z=()=>{g.kill("SIGKILL")},I=d=>{if(b)return;b=!0,g.kill("SIGTERM"),E=setTimeout(z,5e3),x();const p=Date.now()-c,W=d?new w(`${e.name} CLI run was aborted.`,{aborted:!0,durationMs:p,provider:e.name,stderr:v,stdout:y}):new w(`${e.name} CLI timed out after ${String(s)}ms`,{durationMs:p,provider:e.name,stderr:v,stdout:y,timedOut:!0});u(W)};R=setTimeout(I,s,!1),A=()=>{I(!0)},t.signal?.addEventListener("abort",A,{once:!0}),g.stdout?.on("data",d=>{const p=d.toString("utf8");y+=p,t.onStdout?.(p)}),g.stderr?.on("data",d=>{const p=d.toString("utf8");v+=p,t.onStderr?.(p)}),g.on("close",d=>{if(b)return;b=!0,x();const p=Date.now()-c;d===0?i({durationMs:p,exitCode:d,provider:e.name,stderr:v,stdout:y}):u(new w(`${e.name} CLI exited with code ${String(d)}: ${v||y}`,{durationMs:p,exitCode:d,provider:e.name,stderr:v,stdout:y}))}),g.on("error",d=>{b||(b=!0,x(),u(new w(`Failed to spawn ${e.name} CLI: ${d.message}`,{durationMs:Date.now()-c,provider:e.name,stderr:v,stdout:y})))})})},Ie=12e4,_e=2,Le=1e3,Oe=e=>new Promise(a=>{setTimeout(a,e)}),H=async(e,a,t=_e)=>{let r;for(let s=0;s<=t;s+=1)try{return(await Re(e,a,{timeoutMs:Ie})).stdout}catch(o){if(r=o instanceof Error?o:new Error(String(o)),r.message.includes("timed out"))throw r;if(s<t){const n=Le*2**s;await Oe(n)}}throw r??new Error("AI request failed after retries")},je={amp:30,claude:80,codex:60,copilot:50,crush:35,cursor:40,droid:20,gemini:100,kimi:25,opencode:35,qwen:30},Ne=e=>{if(e?.provider){if(!q.includes(e.provider))return;const r=F(e.provider);return r.available?r:void 0}const a=Ce();if(a.length===0)return;const t={...je,...e?.priority};return a.toSorted((r,s)=>(t[s.name]??0)-(t[r.name]??0))[0]},Pe=new Set(["defer","review","skip","update"]),qe=new Set(["critical","high","low","medium"]),Ve=new Set(["high","low","medium"]),De=50,C=30,Fe=e=>e.map(a=>{const t=a.vulnerabilities&&a.vulnerabilities.length>0?` [VULNERABILITIES: ${a.vulnerabilities.map(s=>`${s.severity} ${s.id}`).join(", ")}]`:"";let r="";if(a.socketReport){const s=Math.round(a.socketReport.score.overall*100),o=[`score:${String(s)}%`];if(a.socketReport.alerts.length>0){const n={};for(const i of a.socketReport.alerts)n[i.severity]=(n[i.severity]??0)+1;const c=Object.entries(n).map(([i,u])=>`${String(u)} ${i}`).join(", ");o.push(`alerts: ${c}`)}o.push(`supply-chain:${String(Math.round(a.socketReport.score.supplyChain*100))}%`),o.push(`quality:${String(Math.round(a.socketReport.score.quality*100))}%`),r=` [SOCKET.DEV: ${o.join(", ")}]`}return`- ${a.packageName}: ${a.currentRange} → ${a.newRange} (${a.updateType})${t}${r}`}).join(`
3
3
  `),$=`Respond ONLY with valid JSON in this exact structure:
4
4
  {
@@ -60,9 +60,9 @@ For each package:
60
60
  5. Flag any packages where skipping the update poses security risk
61
61
  6. If Socket.dev scores are provided, factor in supply chain and quality scores — low scores indicate higher risk
62
62
 
63
- ${$}`},Be=new Set(["compatibility","impact","recommend","security"]),at=e=>Be.has(e)?e:"impact",B=(e,a="impact")=>{const t=Fe(e);return He[a](t)},Ue=/```(?:json)?\s*([\s\S]*?)```/,Je=/\{[\s\S]*\}/,ze=e=>{try{return JSON.parse(e)}catch{}const a=Ue.exec(e);if(a?.[1])try{return JSON.parse(a[1])}catch{}const t=Je.exec(e);if(t?.[0])try{return JSON.parse(t[0])}catch{}},We=e=>({action:Pe.has(e.action)?e.action:"review",breakingChanges:Array.isArray(e.breakingChanges)?e.breakingChanges:[],effort:Ve.has(e.effort)?e.effort:"medium",package:typeof e.package=="string"?e.package:"",reason:typeof e.reason=="string"?e.reason:"",riskLevel:qe.has(e.riskLevel)?e.riskLevel:"medium"}),U=(e,a,t)=>{const r=ze(e);if(!r||typeof r!="object")return{analysisType:t,provider:a,recommendations:[],summary:"Failed to parse AI response.",warnings:["AI response was not valid JSON."]};const s=r,o=Array.isArray(s.recommendations)?s.recommendations:[];return{analysisType:t,provider:a,recommendations:o.map(n=>We(n)),summary:typeof s.summary=="string"?s.summary:"",warnings:Array.isArray(s.warnings)?s.warnings:[]}},Ke={eslint:["ESLint 9.0: Flat config required","ESLint 8.0+: New rule formats"],next:["Next.js 13+: App router changes","Next.js 14+: Server components default"],react:["React 17 to 18: Concurrent features","React 18+: Strict mode changes"],typescript:["TypeScript 5.0: New decorators","TypeScript 4.7+: ESM changes"],vite:["Vite 5: Node.js 18+ required"],vue:["Vue 3: Composition API","Vue 3: Breaking template changes"],webpack:["Webpack 5: Node.js polyfills removed"]},Ge=new Set(["bcrypt","cors","crypto-js","express-session","helmet","jose","jsonwebtoken","node-forge","oauth","passport"]),j=(e,a)=>{const t=e.map(r=>{const s=r.vulnerabilities&&r.vulnerabilities.length>0,o=Ge.has(r.packageName),n=Ke[r.packageName]??[];let c="low",i="update",u="low",m="Patch/minor update, safe to apply.";return r.updateType==="major"?(c="high",i=n.length>0?"review":"update",u="medium",m=n.length>0?`Major update with known breaking changes: ${n[0]}`:"Major version update, review changelog before applying."):r.updateType==="minor"&&(c="medium",m="Minor update, generally safe."),s&&(c="high",i="update",m="Security update — current version has known vulnerabilities."),o&&r.updateType==="major"&&(i="review",m="Security-sensitive package with major update, careful review needed.",u="high"),{action:i,breakingChanges:n,effort:u,package:r.packageName,reason:m,riskLevel:c}});return{analysisType:a,provider:"rule-engine",recommendations:t,summary:`Rule-based ${a} analysis for ${String(e.length)} packages.`,warnings:["No AI provider available — using built-in rule engine."]}},Ye=async(e,a,t)=>{const r=B(a,t),s=await H(e,r);return U(s,e.name,t)},Qe=(e,a,t)=>{const r=[],s=[],o=[];for(const n of e)r.push(...n.recommendations),s.push(...n.warnings),n.summary&&o.push(n.summary);return{analysisType:t,provider:a,recommendations:r,summary:o.length===1?o[0]??"":`Analyzed ${String(r.length)} packages in ${String(e.length)} batches.`,warnings:[...new Set(s)]}},J={compatibility:"Compatibility",impact:"Impact",recommend:"Recommendations",security:"Security"},st=e=>{const a=`${J[e.analysisType]??e.analysisType} Analysis (${e.provider})`,t=e.recommendations.flatMap(s=>{const o=[{action:s.action,effort:s.effort,package:s.package,reason:s.reason,risk:s.riskLevel}];return s.breakingChanges.length>0&&o.push({action:"",effort:"",package:"",reason:`Breaking: ${s.breakingChanges.join("; ")}`,risk:""}),o}),r=process.stdout.columns||80;return ee(f.createElement(te,{borderStyle:"round",flexDirection:"column",paddingLeft:1,paddingRight:1},f.createElement(k,{bold:!0},a),f.createElement(k,null,""),f.createElement(k,null,e.summary),f.createElement(k,null,""),f.createElement(re,{borderStyle:"none",data:t}),...e.warnings.length>0?[f.createElement(k,null,""),...e.warnings.map((s,o)=>f.createElement(k,{dimColor:!0,key:String(o)},` ${s}`))]:[]),{columns:r})},ot=async(e,a,t,r="impact")=>{const s=Ne(t);if(!s)return a.info(`No AI CLI tool found, using rule-based analysis.
63
+ ${$}`},Be=new Set(["compatibility","impact","recommend","security"]),rt=e=>Be.has(e)?e:"impact",B=(e,a="impact")=>{const t=Fe(e);return He[a](t)},Je=/```(?:json)?\s*([\s\S]*?)```/,Ue=/\{[\s\S]*\}/,ze=e=>{try{return JSON.parse(e)}catch{}const a=Je.exec(e);if(a?.[1])try{return JSON.parse(a[1])}catch{}const t=Ue.exec(e);if(t?.[0])try{return JSON.parse(t[0])}catch{}},We=e=>({action:Pe.has(e.action)?e.action:"review",breakingChanges:Array.isArray(e.breakingChanges)?e.breakingChanges:[],effort:Ve.has(e.effort)?e.effort:"medium",package:typeof e.package=="string"?e.package:"",reason:typeof e.reason=="string"?e.reason:"",riskLevel:qe.has(e.riskLevel)?e.riskLevel:"medium"}),J=(e,a,t)=>{const r=ze(e);if(!r||typeof r!="object")return{analysisType:t,provider:a,recommendations:[],summary:"Failed to parse AI response.",warnings:["AI response was not valid JSON."]};const s=r,o=Array.isArray(s.recommendations)?s.recommendations:[];return{analysisType:t,provider:a,recommendations:o.map(n=>We(n)),summary:typeof s.summary=="string"?s.summary:"",warnings:Array.isArray(s.warnings)?s.warnings:[]}},Ke={eslint:["ESLint 9.0: Flat config required","ESLint 8.0+: New rule formats"],next:["Next.js 13+: App router changes","Next.js 14+: Server components default"],react:["React 17 to 18: Concurrent features","React 18+: Strict mode changes"],typescript:["TypeScript 5.0: New decorators","TypeScript 4.7+: ESM changes"],vite:["Vite 5: Node.js 18+ required"],vue:["Vue 3: Composition API","Vue 3: Breaking template changes"],webpack:["Webpack 5: Node.js polyfills removed"]},Ge=new Set(["bcrypt","cors","crypto-js","express-session","helmet","jose","jsonwebtoken","node-forge","oauth","passport"]),j=(e,a)=>{const t=e.map(r=>{const s=r.vulnerabilities&&r.vulnerabilities.length>0,o=Ge.has(r.packageName),n=Ke[r.packageName]??[];let c="low",i="update",u="low",m="Patch/minor update, safe to apply.";return r.updateType==="major"?(c="high",i=n.length>0?"review":"update",u="medium",m=n.length>0?`Major update with known breaking changes: ${n[0]}`:"Major version update, review changelog before applying."):r.updateType==="minor"&&(c="medium",m="Minor update, generally safe."),s&&(c="high",i="update",m="Security update — current version has known vulnerabilities."),o&&r.updateType==="major"&&(i="review",m="Security-sensitive package with major update, careful review needed.",u="high"),{action:i,breakingChanges:n,effort:u,package:r.packageName,reason:m,riskLevel:c}});return{analysisType:a,provider:"rule-engine",recommendations:t,summary:`Rule-based ${a} analysis for ${String(e.length)} packages.`,warnings:["No AI provider available — using built-in rule engine."]}},Ye=async(e,a,t)=>{const r=B(a,t),s=await H(e,r);return J(s,e.name,t)},Xe=(e,a,t)=>{const r=[],s=[],o=[];for(const n of e)r.push(...n.recommendations),s.push(...n.warnings),n.summary&&o.push(n.summary);return{analysisType:t,provider:a,recommendations:r,summary:o.length===1?o[0]??"":`Analyzed ${String(r.length)} packages in ${String(e.length)} batches.`,warnings:[...new Set(s)]}},U={compatibility:"Compatibility",impact:"Impact",recommend:"Recommendations",security:"Security"},at=e=>{const a=`${U[e.analysisType]??e.analysisType} Analysis (${e.provider})`,t=e.recommendations.flatMap(s=>{const o=[{action:s.action,effort:s.effort,package:s.package,reason:s.reason,risk:s.riskLevel}];return s.breakingChanges.length>0&&o.push({action:"",effort:"",package:"",reason:`Breaking: ${s.breakingChanges.join("; ")}`,risk:""}),o}),r=process.stdout.columns||80;return ee(f.createElement(te,{borderStyle:"round",flexDirection:"column",paddingLeft:1,paddingRight:1},f.createElement(k,{bold:!0},a),f.createElement(k,null,""),f.createElement(k,null,e.summary),f.createElement(k,null,""),f.createElement(re,{borderStyle:"none",data:t}),...e.warnings.length>0?[f.createElement(k,null,""),...e.warnings.map((s,o)=>f.createElement(k,{dimColor:!0,key:String(o)},` ${s}`))]:[]),{columns:r})},st=async(e,a,t,r="impact")=>{const s=Ne(t);if(!s)return a.info(`No AI CLI tool found, using rule-based analysis.
64
64
  `),j(e,r);const o=ae(s.name,r,e),n=se(o);if(n)return a.info(`Using cached ${r} analysis from ${n.provider}.
65
- `),n;const c=J[r]??r;a.info(`Running ${c.toLowerCase()} analysis with ${s.name}...
65
+ `),n;const c=U[r]??r;a.info(`Running ${c.toLowerCase()} analysis with ${s.name}...
66
66
  `);try{let i;if(e.length>De){a.info(`Splitting ${String(e.length)} packages into batches of ${String(C)}...
67
- `);const u=[];for(let l=0;l<e.length;l+=C)u.push(e.slice(l,l+C));const m=[];for(let l=0;l<u.length;l+=1){a.info(` Batch ${String(l+1)}/${String(u.length)}...`);const g=u[l];g&&m.push(await Ye(s,g,r))}i=Qe(m,s.name,r)}else{const u=await H(s,B(e,r));i=U(u,s.name,r)}return oe(o,i,ne(r,t?.cacheTtl)),i}catch(i){const u=i instanceof Error?i.message:String(i);return a.warn(`AI analysis failed (${u}), falling back to rule engine.
68
- `),j(e,r)}};export{at as K,xe as N,Ne as R,je as S,st as W,ot as Z,ze as b,Re as h,H as r};
67
+ `);const u=[];for(let l=0;l<e.length;l+=C)u.push(e.slice(l,l+C));const m=[];for(let l=0;l<u.length;l+=1){a.info(` Batch ${String(l+1)}/${String(u.length)}...`);const g=u[l];g&&m.push(await Ye(s,g,r))}i=Xe(m,s.name,r)}else{const u=await H(s,B(e,r));i=J(u,s.name,r)}return oe(o,i,ne(r,t?.cacheTtl)),i}catch(i){const u=i instanceof Error?i.message:String(i);return a.warn(`AI analysis failed (${u}), falling back to rule engine.
68
+ `),j(e,r)}};export{rt as K,xe as N,Ne as R,je as S,at as W,st as Z,ze as b,Re as h,H as r};
@@ -1,5 +1,5 @@
1
- import{createRequire as b}from"node:module";import{readLastRunSummary as O}from"@visulima/task-runner";import{a as T}from"./failure-log-Sp1j-5qo.js";import{c as w,d as j,e as k,r as C,O as D,B as P,N as F}from"../packem_chunks/cli-main.js";import{c as N}from"./env-XJzocuUP.js";import{A as y,B as v,m as R,y as A}from"./index-OQZQyN5R.js";import{R as E,r as M,b as q}from"./ai-analysis-Co-b15d_.js";const $=b(import.meta.url),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=t=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[e,a]=d.versions.node.split(".").map(Number);if(e>22||e===22&&a>=3||e===20&&a>=16)return d.getBuiltinModule(t)}return $(t)},{readFile:_,writeFile:B}=I("node:fs/promises"),H=32*1024,W=(t,e)=>{if(t.length<=e)return t;const a=t.slice(-e),o=t.length-a.length;return`[…${String(o)} bytes truncated from head…]
2
- ${a}`},L=async(t,e)=>e===void 0?O(t,{dataDirectory:N(t)}):C(t,e),ht=async(t,e,a={})=>{const o=a.terminalOutputLimit??H,[s,n]=await Promise.all([T(t,e),L(t,a.runId)]),i=n?w(n,e):void 0;if(!s&&!i)return;let r,c;if(n&&i){const h=await j(t,n.id),p=h?w(h,e):void 0;r=k(i.hashDetails,p?.hashDetails),c=h?.id}const u=s?.terminalOutput??"";return{command:s?.command??void 0,cwd:s?.cwd??void 0,dependencies:i?.dependencies??[],duration:i?.duration,exitCode:s?.exitCode??i?.exitCode,hash:i?.hash??s?.hash,hashDetails:i?.hashDetails,hashDiff:r,previousRunId:c,project:i?.target.project,runId:n?.id??s?.runId,status:s?.status??(i?Y(i):void 0),target:i?.target.target,taskId:e,terminalOutput:W(u,o),terminalOutputCaptured:!!s,timestamp:s?.timestamp??i?.endTime??i?.startTime}},Y=t=>{if(t.exitCode!==void 0&&t.exitCode!==0)return"failure";switch(t.cacheStatus){case"HIT":return"local-cache";case"REMOTE_HIT":return"remote-cache";case"SKIPPED":return"skipped";default:return t.exitCode===0?"success":void 0}},J=3600*1e3,x=80,K=new Set(["high","low","medium"]),U=()=>`You are an expert software engineer helping fix a failing build/test/lint task.
1
+ import{createRequire as b}from"node:module";import{readLastRunSummary as O}from"@visulima/task-runner";import{a as T}from"./failure-log-Dy2G-rKi.js";import{c as w,d as j,e as k,r as C,O as D,B as P,N as F}from"../packem_chunks/cli-main.js";import{c as N}from"./env-Ct3hMEYB.js";import{A as y,B as x,m as R,y as A}from"./index-CE6MsgcV.js";import{R as E,r as M,b as q}from"./ai-analysis-rC48NLfB.js";const $=b(import.meta.url),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=t=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[e,a]=d.versions.node.split(".").map(Number);if(e>22||e===22&&a>=3||e===20&&a>=16)return d.getBuiltinModule(t)}return $(t)},{readFile:_,writeFile:B}=I("node:fs/promises"),H=32*1024,W=(t,e)=>{if(t.length<=e)return t;const a=t.slice(-e),o=t.length-a.length;return`[…${String(o)} bytes truncated from head…]
2
+ ${a}`},L=async(t,e)=>e===void 0?O(t,{dataDirectory:N(t)}):C(t,e),ht=async(t,e,a={})=>{const o=a.terminalOutputLimit??H,[s,n]=await Promise.all([T(t,e),L(t,a.runId)]),i=n?w(n,e):void 0;if(!s&&!i)return;let r,c;if(n&&i){const h=await j(t,n.id),p=h?w(h,e):void 0;r=k(i.hashDetails,p?.hashDetails),c=h?.id}const u=s?.terminalOutput??"";return{command:s?.command??void 0,cwd:s?.cwd??void 0,dependencies:i?.dependencies??[],duration:i?.duration,exitCode:s?.exitCode??i?.exitCode,hash:i?.hash??s?.hash,hashDetails:i?.hashDetails,hashDiff:r,previousRunId:c,project:i?.target.project,runId:n?.id??s?.runId,status:s?.status??(i?Y(i):void 0),target:i?.target.target,taskId:e,terminalOutput:W(u,o),terminalOutputCaptured:!!s,timestamp:s?.timestamp??i?.endTime??i?.startTime}},Y=t=>{if(t.exitCode!==void 0&&t.exitCode!==0)return"failure";switch(t.cacheStatus){case"HIT":return"local-cache";case"REMOTE_HIT":return"remote-cache";case"SKIPPED":return"skipped";default:return t.exitCode===0?"success":void 0}},J=3600*1e3,v=80,K=new Set(["high","low","medium"]),U=()=>`You are an expert software engineer helping fix a failing build/test/lint task.
3
3
 
4
4
  You will be given:
5
5
  - The terminal output (stdout/stderr) from the failed task.
@@ -40,4 +40,4 @@ ${V(t)}`,Q=(t,e)=>{const a=Array.isArray(t.patches)?t.patches:[],o=[];for(const
40
40
  `);return}const s=a.cache!==!1,n=Z(o.name,t);if(s){const i=D(n);if(i)return e.info(`Using cached fix proposal from ${i.provider}.
41
41
  `),i}e.info(`Generating fix proposal with ${o.name}...
42
42
  `);try{const i=await M(o,z(t)),r=X(i,o.name);return s&&r.patches.length>0&&!r.cannotFix&&P(n,r,J),r}catch(i){const r=i instanceof Error?i.message:String(i);e.warn(`AI fix proposal failed (${r}).
43
- `);return}},tt=(t,e,a)=>y(a)?v(a):v(R(e??t,a)),et=(t,e)=>{const a=A(t,e);return a===""?!0:!a.startsWith("..")&&!y(a)},at=(t,e,a)=>{const o=t.indexOf(e),s=Math.max(0,o-x),n=Math.min(t.length,o+e.length+x),i=t.slice(s,n);return{previewAfter:`${t.slice(s,o)}${a}${t.slice(o+e.length,n)}`,previewBefore:i}},lt=async(t,e,a,o={})=>{const s=o.dryRun===!0,n=new Map,i=[];for(const r of a.patches){const c=tt(t,e,r.file);if(!et(t,c)){i.push({absolutePath:c,patch:r,status:"outside-workspace"});continue}let u=n.get(c);if(u===void 0){try{u=await _(c,"utf8")}catch(l){const g=l.code;i.push({absolutePath:c,error:g==="ENOENT"?void 0:l.message,patch:r,status:g==="ENOENT"?"missing-file":"error"});continue}n.set(c,u)}const h=u.indexOf(r.oldString);if(h===-1){i.push({absolutePath:c,patch:r,status:"no-match"});continue}if(u.indexOf(r.oldString,h+r.oldString.length)!==-1){i.push({absolutePath:c,patch:r,status:"ambiguous-match"});continue}const{previewAfter:p,previewBefore:S}=at(u,r.oldString,r.newString),m=`${u.slice(0,h)}${r.newString}${u.slice(h+r.oldString.length)}`;if(!s)try{await B(c,m,"utf8")}catch(l){n.delete(c),i.push({absolutePath:c,error:l.message,patch:r,status:"error"});continue}n.set(c,m),i.push({absolutePath:c,patch:r,previewAfter:p,previewBefore:S,status:"applied"})}return i};export{ht as a,lt as b,tt as c,dt as r};
43
+ `);return}},tt=(t,e,a)=>y(a)?x(a):x(R(e??t,a)),et=(t,e)=>{const a=A(t,e);return a===""?!0:!a.startsWith("..")&&!y(a)},at=(t,e,a)=>{const o=t.indexOf(e),s=Math.max(0,o-v),n=Math.min(t.length,o+e.length+v),i=t.slice(s,n);return{previewAfter:`${t.slice(s,o)}${a}${t.slice(o+e.length,n)}`,previewBefore:i}},lt=async(t,e,a,o={})=>{const s=o.dryRun===!0,n=new Map,i=[];for(const r of a.patches){const c=tt(t,e,r.file);if(!et(t,c)){i.push({absolutePath:c,patch:r,status:"outside-workspace"});continue}let u=n.get(c);if(u===void 0){try{u=await _(c,"utf8")}catch(l){const g=l.code;i.push({absolutePath:c,error:g==="ENOENT"?void 0:l.message,patch:r,status:g==="ENOENT"?"missing-file":"error"});continue}n.set(c,u)}const h=u.indexOf(r.oldString);if(h===-1){i.push({absolutePath:c,patch:r,status:"no-match"});continue}if(u.indexOf(r.oldString,h+r.oldString.length)!==-1){i.push({absolutePath:c,patch:r,status:"ambiguous-match"});continue}const{previewAfter:p,previewBefore:S}=at(u,r.oldString,r.newString),m=`${u.slice(0,h)}${r.newString}${u.slice(h+r.oldString.length)}`;if(!s)try{await B(c,m,"utf8")}catch(l){n.delete(c),i.push({absolutePath:c,error:l.message,patch:r,status:"error"});continue}n.set(c,m),i.push({absolutePath:c,patch:r,previewAfter:p,previewBefore:S,status:"applied"})}return i};export{ht as a,lt as b,tt as c,dt as r};
@@ -0,0 +1,4 @@
1
+ import{createRequire as T}from"node:module";import{l as P}from"./target-options-CR0OuYJr.js";import{m as R}from"./index-CE6MsgcV.js";const E=T(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=e=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[r,t]=m.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return m.getBuiltinModule(e)}return E(e)},{createRequire:j}=h("node:module"),{pathToFileURL:L}=h("node:url"),y=["temporal","urlpattern","reporterror","regexp-escape","promise-try","float16array","error-iserror","navigator-locks"],q=e=>{const r=e.trim().toLowerCase();return r===""||r==="all"||r==="1"||r==="true"?y:r.split(",").map(t=>t.trim()).filter(t=>y.includes(t))},v=async(e,r)=>{try{const t=j(R(r,"__vis_polyfill_resolver__.js")).resolve(e);return await import(L(t).href)}catch{return}},F=async e=>{if(globalThis.Temporal!==void 0)return;const r=await v("@js-temporal/polyfill",e);r?.Temporal===void 0?process.stderr.write(`vis: --polyfill temporal requested but @js-temporal/polyfill is not installed in this project.
2
+ `):globalThis.Temporal=r.Temporal},x=async e=>{if(globalThis.URLPattern!==void 0)return;const r=await v("urlpattern-polyfill",e);r?.URLPattern===void 0?process.stderr.write(`vis: --polyfill urlpattern requested but urlpattern-polyfill is not installed in this project.
3
+ `):globalThis.URLPattern=r.URLPattern},O=()=>{typeof globalThis.reportError!="function"&&(globalThis.reportError=e=>{const r=e instanceof Error?e.stack??`${e.name}: ${e.message}`:String(e);process.stderr.write(`${r}
4
+ `)})},k=()=>{if(typeof RegExp.escape=="function")return;const e=new Set(String.raw`^$\.*+?()[]{}|/`),r={"\f":String.raw`\f`,"\n":String.raw`\n`,"\r":String.raw`\r`," ":String.raw`\t`,"\v":String.raw`\v`},t=/\s/u,o=n=>n<=255?String.raw`\x${n.toString(16).padStart(2,"0")}`:String.raw`\u${n.toString(16).padStart(4,"0")}`;RegExp.escape=n=>{if(typeof n!="string")throw new TypeError("RegExp.escape requires a string argument");let a="",i=!0;for(const s of n){const c=s.codePointAt(0);i&&/[\dA-Za-z]/u.test(s)?a+=o(c):e.has(s)?a+=`\\${s}`:r[s]!==void 0?a+=r[s]:t.test(s)?a+=o(c):a+=s,i=!1}return a}},I=()=>{typeof Promise.try!="function"&&(Promise.try=function(e,...r){const t=typeof this=="function"?this:Promise;return new t((o,n)=>{try{o(e(...r))}catch(a){n(a)}})})},w=e=>{const r=new Float32Array(1),t=new Uint32Array(r.buffer);r[0]=e;const o=t[0],n=o>>>16&32768,a=o>>>23&255,i=o&8388607;if(a===255)return i===0?n|31744:n|32256;const s=a-127+15;if(s>=31)return n|31744;if(s<=0){if(s<-10)return n;const l=i|8388608,p=14-s;let d=l>>p;const g=l&(1<<p)-1,u=1<<p-1;return(g>u||g===u&&(d&1)===1)&&(d+=1),n|d}let c=s<<10|i>>13;const f=i&8191;return(f>4096||f===4096&&(c&1)===1)&&(c+=1),n|c},b=e=>{const r=e&32768?-1:1,t=e>>10&31,o=e&1023;return t===0?r*o*2**-24:t===31?o?Number.NaN:r*Number.POSITIVE_INFINITY:r*(1+o/1024)*2**(t-15)},A=()=>{const e=Math;typeof e.f16round!="function"&&(e.f16round=t=>b(w(t)));const r=DataView.prototype;typeof r.getFloat16!="function"&&(r.getFloat16=function(t,o){return b(this.getUint16(t,o))}),typeof r.setFloat16!="function"&&(r.setFloat16=function(t,o,n){this.setUint16(t,w(o),n)})},N=()=>{typeof Error.isError!="function"&&(Error.isError=e=>typeof e=="object"&&e!==null&&Object.prototype.toString.call(e)==="[object Error]")},U=()=>{const e=globalThis,r=e.navigator;if(r?.locks!==void 0)return;const t=new Map,o=new Set,n=i=>i.reason??(typeof DOMException=="function"?new DOMException("The lock request is aborted","AbortError"):Object.assign(new Error("The lock request is aborted"),{name:"AbortError"})),a={request:async(i,s,c)=>{const f=typeof s!="function",l=(f?s:{})??{},p=f?c:s,d=l.mode==="shared"?"shared":"exclusive";if(l.signal?.aborted)throw n(l.signal);if(l.ifAvailable===!0&&o.has(i))return p(null);const g=t.get(i)??Promise.resolve();let u;const _=new Promise(S=>{u=S});if(t.set(i,g.then(()=>_)),await g.catch(()=>{}),l.signal?.aborted)throw u(),n(l.signal);o.add(i);try{return await p({mode:d,name:i})}finally{o.delete(i),u()}}};r===void 0?Object.defineProperty(e,"navigator",{configurable:!0,enumerable:!0,value:{locks:a},writable:!0}):Object.defineProperty(r,"locks",{configurable:!0,enumerable:!0,value:a})},$={"error-iserror":N,float16array:A,"navigator-locks":U,"promise-try":I,"regexp-escape":k,reporterror:O},M=async(e,r=process.cwd())=>{const t=q(e);await Promise.all(t.map(async o=>{o==="temporal"?await F(r):o==="urlpattern"?await x(r):$[o]?.()}))},B=async e=>{for(const[r,t]of Object.entries(P(e,!0)))process.env[r]===void 0&&(process.env[r]=t);process.env.VIS_POLYFILL!==void 0&&await M(process.env.VIS_POLYFILL,e)};export{B as p};
@@ -0,0 +1 @@
1
+ import{createRequire as g}from"node:module";import{c as b}from"./compile-cache-B_Vf_WxT.js";import{i as T,h as y,t as R,p as m,c as w}from"./runtime-process-Dmz0vCJy-DUwTvH1J.js";import"./index-CE6MsgcV.js";import{I as O}from"./index-B0EsgdzO.js";import{a as $}from"./readJsonSync-CvkZyKmL-ihoybKvs.js";const _=g(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[s,o]=r.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return r.getBuiltinModule(e)}return _(e)},{createRequire:S}=x("node:module"),I=S(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=e=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[s,o]=t.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return t.getBuiltinModule(e)}return I(e)},{execFileSync:M}=f("node:child_process"),{totalmem:N}=f("node:os"),j=/--max-old-space-size=(\d+)/,V=/--max-semi-space-size=(\d+)/,E=e=>Math.floor(N()/1024/1024*e),q=e=>e<=512?4:e<=1024?8:e<=2048?16:e<=4096?32:e<=8192?64:Math.floor(Math.log2(e))*8,d=(e,s)=>{for(const o of s){const n=e.exec(o);if(n)return Number.parseInt(n[1],10)}},z=e=>{const o=[...w()],n=[...T()],a=d(j,o),p=d(V,o);if(a!==void 0&&p!==void 0)return;const l=a??E(.75),v=p??q(l),c=[];if(a===void 0&&c.push(`--max-old-space-size=${String(l)}`),p===void 0&&c.push(`--max-semi-space-size=${String(v)}`),c.length!==0)try{M(y(),[...c,...o,...n.slice(1)],{env:R(),stdio:"inherit"}),m(0)}catch(h){const u=h.status;m(typeof u=="number"?u:1)}},C=()=>{if(process.env.VIS_VERSION)return process.env.VIS_VERSION;try{const e=new URL("../../package.json",import.meta.url);return $(e).version}catch{return"0.0.0"}},B=()=>{process.env.VIS_VERSION=C()},A=e=>{!process.stdout.isTTY||O||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${e}\x07`)},L=new Set(["","--help","--version","-h","-v","completion","dlx","exec","x"]),i=process.argv[2]??"";!L.has(i)&&!process.argv.includes("--help")&&!process.argv.includes("-h")&&z();process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");B();b();(async()=>{if(i==="__pm-shim"){const{dispatchShim:s}=await import("../packem_chunks/dispatch.js");s(process.argv[3]??"",process.argv.slice(4));return}if(i==="x"){const{runLeanX:s}=await import("../packem_chunks/lean.js");await s(process.argv.slice(3));return}if(i==="exec"||i==="dlx"){const{runExecCli:s}=await import("../packem_chunks/cli-exec.js");await s();return}const{runCli:e}=await import("../packem_chunks/cli-main.js").then(s=>s.at);await e()})();export{A as s};
@@ -1 +1 @@
1
- import{createRequire as j}from"node:module";import{m as h,f as y}from"./index-OQZQyN5R.js";import{a as q}from"./readJsonSync-CvkZyKmL-CY7PZob_.js";const $=j(import.meta.url),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[s,n]=g.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return g.getBuiltinModule(e)}return $(e)},{readdirSync:_,statSync:M}=k("node:fs"),w=["preinstall","install","postinstall","prepare"],x=e=>{const s=h(e,"node_modules");if(!y(s))return[];const n=new Map,o=(l,p="")=>{let u;try{u=_(l)}catch{return}for(const r of u){const i=h(l,r);if(r.startsWith("@")){o(i,`${r}/`);continue}if(r===".pnpm"&&p===""){let f;try{f=_(i)}catch{continue}for(const a of f){const c=h(i,a,"node_modules");y(c)&&o(c)}continue}if(r.startsWith("."))continue;const m=p+r,t=h(i,"package.json");try{if(!M(i).isDirectory()||!y(t))continue;const f=q(t),a=f.scripts??{},c=w.filter(v=>a[v]);!a.preinstall&&!a.install&&!a.postinstall&&y(h(i,"binding.gyp"))&&c.push("install (binding.gyp)"),c.length>0&&!n.has(m)&&n.set(m,{directory:i,hooks:c,name:m,version:typeof f.version=="string"?f.version:void 0});const d=h(i,"node_modules");y(d)&&o(d)}catch{}}};return o(s),[...n.values()]},W=e=>{const s=e.startsWith("@"),n=e.indexOf("@",s?1:0);return n===-1?{name:e}:{name:e.slice(0,n),version:e.slice(n+1)}},B=(e,s,n)=>{for(const[o,l]of Object.entries(s)){if(!l)continue;if(o.endsWith("@*")){if(o.slice(0,-2)===e.name)return!0;continue}if(o.endsWith("*")){if(e.name.startsWith(o.slice(0,-1)))return!0;continue}const{name:p,version:u}=W(o);if(p===e.name&&(!n||u===void 0||e.version===u))return!0}return!1},O=(e,s,n={})=>{const o=n.pinVersions===!0,l=x(e),p=[],u=[],r=new Map(l.map(t=>[t.name,t]));for(const t of l)B(t,s,o)?u.push(t):p.push(t);const i=[],m=[];for(const[t,f]of Object.entries(s)){if(!f)continue;if(t.endsWith("@*")){const v=t.slice(0,-2);r.has(v)||i.push(t);continue}if(t.endsWith("*")){const v=t.slice(0,-1);[...r.keys()].some(b=>b.startsWith(v))||i.push(t);continue}const{name:a,version:c}=W(t),d=r.get(a);if(!d){i.push(t);continue}o&&c!==void 0&&c!=="*"&&d.version&&d.version!==c&&m.push({from:t,to:`${a}@${d.version}`})}return{excess:i,installed:u,unapproved:p,versionDrift:m}},S=(e,s)=>O(e,s).unapproved.map(n=>`${n.name} (${n.hooks.join(", ")})`);export{O as W,S as w};
1
+ import{createRequire as j}from"node:module";import{m as h,f as y}from"./index-CE6MsgcV.js";import{a as q}from"./readJsonSync-CvkZyKmL-ihoybKvs.js";const $=j(import.meta.url),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[s,n]=g.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return g.getBuiltinModule(e)}return $(e)},{readdirSync:_,statSync:M}=k("node:fs"),w=["preinstall","install","postinstall","prepare"],x=e=>{const s=h(e,"node_modules");if(!y(s))return[];const n=new Map,o=(l,p="")=>{let u;try{u=_(l)}catch{return}for(const r of u){const i=h(l,r);if(r.startsWith("@")){o(i,`${r}/`);continue}if(r===".pnpm"&&p===""){let f;try{f=_(i)}catch{continue}for(const a of f){const c=h(i,a,"node_modules");y(c)&&o(c)}continue}if(r.startsWith("."))continue;const m=p+r,t=h(i,"package.json");try{if(!M(i).isDirectory()||!y(t))continue;const f=q(t),a=f.scripts??{},c=w.filter(v=>a[v]);!a.preinstall&&!a.install&&!a.postinstall&&y(h(i,"binding.gyp"))&&c.push("install (binding.gyp)"),c.length>0&&!n.has(m)&&n.set(m,{directory:i,hooks:c,name:m,version:typeof f.version=="string"?f.version:void 0});const d=h(i,"node_modules");y(d)&&o(d)}catch{}}};return o(s),[...n.values()]},W=e=>{const s=e.startsWith("@"),n=e.indexOf("@",s?1:0);return n===-1?{name:e}:{name:e.slice(0,n),version:e.slice(n+1)}},B=(e,s,n)=>{for(const[o,l]of Object.entries(s)){if(!l)continue;if(o.endsWith("@*")){if(o.slice(0,-2)===e.name)return!0;continue}if(o.endsWith("*")){if(e.name.startsWith(o.slice(0,-1)))return!0;continue}const{name:p,version:u}=W(o);if(p===e.name&&(!n||u===void 0||e.version===u))return!0}return!1},O=(e,s,n={})=>{const o=n.pinVersions===!0,l=x(e),p=[],u=[],r=new Map(l.map(t=>[t.name,t]));for(const t of l)B(t,s,o)?u.push(t):p.push(t);const i=[],m=[];for(const[t,f]of Object.entries(s)){if(!f)continue;if(t.endsWith("@*")){const v=t.slice(0,-2);r.has(v)||i.push(t);continue}if(t.endsWith("*")){const v=t.slice(0,-1);[...r.keys()].some(b=>b.startsWith(v))||i.push(t);continue}const{name:a,version:c}=W(t),d=r.get(a);if(!d){i.push(t);continue}o&&c!==void 0&&c!=="*"&&d.version&&d.version!==c&&m.push({from:t,to:`${a}@${d.version}`})}return{excess:i,installed:u,unapproved:p,versionDrift:m}},S=(e,s)=>O(e,s).unapproved.map(n=>`${n.name} (${n.hooks.join(", ")})`);export{O as W,S as w};
@@ -1 +1 @@
1
- import{r as o}from"./resolve-runtime-CJSWV-K8.js";const i=e=>{if(e!==null&&typeof e=="object"&&"runtime"in e){const r=e.runtime;if(typeof r=="string")return r}},s=(e,r)=>{const t=o(r,{config:e.visConfig?.runtime,flag:i(e.options)});return t.deferredNotice!==void 0&&e.logger?.warn?.(t.deferredNotice),t},u=e=>e.runtime==="bun"?"bun":void 0;export{u as a,s as r};
1
+ import{r as o}from"./resolve-runtime-QRaQucfL.js";const i=e=>{if(e!==null&&typeof e=="object"&&"runtime"in e){const r=e.runtime;if(typeof r=="string")return r}},s=(e,r)=>{const t=o(r,{config:e.visConfig?.runtime,flag:i(e.options)});return t.deferredNotice!==void 0&&e.logger?.warn?.(t.deferredNotice),t},u=e=>e.runtime==="bun"?"bun":void 0;export{u as a,s as r};
@@ -1,4 +1,4 @@
1
- import{createRequire as ie}from"node:module";import{m as E,v as ue}from"./index-OQZQyN5R.js";import{r as le}from"./docker-DKlF-gk3.js";import{a as oe}from"./readJsonSync-CvkZyKmL-CY7PZob_.js";import{e as fe}from"./license-t5KnNX6v.js";import{D as de}from"../packem_chunks/cli-main.js";import"./public-api-WqUCiyIe.js";import{u as he}from"./index-Cg0IHaFI.js";const ae=ie(import.meta.url),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,se=e=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[n,t]=P.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return P.getBuiltinModule(e)}return ae(e)},{randomUUID:pe}=se("node:crypto"),{readdirSync:me}=se("node:fs"),X=e=>e.replaceAll(/[^\w.~-]/g,n=>`%${(n.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),C=(e,n)=>{const t=e.toLowerCase();if(t.startsWith("@")){const s=t.indexOf("/");if(s>0){const r=t.slice(0,s),p=t.slice(s+1);return`pkg:npm/${X(r)}/${X(p)}@${X(n)}`}}return`pkg:npm/${X(t)}@${X(n)}`},m={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},_e=[m.STRING,m.NUMBER,m.BOOLEAN],ge='<?xml version="1.0" encoding="UTF-8"?>',ee=["_selfCloseTag","_attrs"],ye=(e="",n=0)=>e.repeat(n),Y=e=>Array.isArray(e)&&m.ARRAY||typeof e===m.OBJECT&&e!==null&&e._name&&m.JSTOXML_OBJECT||e instanceof Date&&m.DATE||e===null&&m.NULL||typeof e,re=e=>e.startsWith("<![CDATA["),ce=(e="",n={},t)=>{let s=e;if(typeof e===m.STRING){if(re(e))return e;const r=new RegExp(`(${Object.keys(n).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(r,(p,h)=>n[h]||"")}return typeof t=="function"?t(s):s},be=(e={},n,t,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,p])=>({[r]:p}))).reduce((r,p)=>{const h=Object.keys(p)[0],_=p[h];if(typeof t===m.FUNCTION&&t(h,_))return r;const y=n?ce(_,n):_,$=!s&&y===!0?"":`="${y}"`;return r.push(`${h}${$}`),r},[]),$e=(e={},n,t,s)=>{const r=be(e,n,t,s);return r.length===0?"":` ${r.join(" ")}`},Oe=(e={})=>Object.keys(e).map(n=>({_name:n,_content:e[n]})),ve=e=>_e.includes(Y(e)),je=e=>!e.match("<"),ke=({header:e,isOutputStart:n})=>e&&n?typeof e===m.BOOLEAN?ge:e:"",ne={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;"},U=(e={},n={})=>{const{depth:t=0,indent:s,_isFirstItem:r,_isOutputStart:p=!0,header:h,attributeReplacements:_={},attributeFilter:y,attributeExplicitTrue:$=!1,contentReplacements:F={},contentMap:M,selfCloseTags:B=!0}=n,J=typeof _=="boolean"&&!_?{}:{...ne,..._},G=typeof F=="boolean"&&!F?{}:{...ne,...F},D=typeof s=="string",k=ye(s,t),W=Y(e),L=ke({header:h,isOutputStart:p}),N=p&&!L&&r&&t===0,R=D&&!N?`
1
+ import{createRequire as ie}from"node:module";import{m as E,v as ue}from"./index-CE6MsgcV.js";import{r as le}from"./docker-CViFYtmM.js";import{a as oe}from"./readJsonSync-CvkZyKmL-ihoybKvs.js";import{e as fe}from"./license-t5KnNX6v.js";import{D as de}from"../packem_chunks/cli-main.js";import"./public-api-WqUCiyIe.js";import{u as he}from"./index-Cg0IHaFI.js";const ae=ie(import.meta.url),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,se=e=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[n,t]=P.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return P.getBuiltinModule(e)}return ae(e)},{randomUUID:pe}=se("node:crypto"),{readdirSync:me}=se("node:fs"),X=e=>e.replaceAll(/[^\w.~-]/g,n=>`%${(n.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),C=(e,n)=>{const t=e.toLowerCase();if(t.startsWith("@")){const s=t.indexOf("/");if(s>0){const r=t.slice(0,s),p=t.slice(s+1);return`pkg:npm/${X(r)}/${X(p)}@${X(n)}`}}return`pkg:npm/${X(t)}@${X(n)}`},m={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},_e=[m.STRING,m.NUMBER,m.BOOLEAN],ge='<?xml version="1.0" encoding="UTF-8"?>',ee=["_selfCloseTag","_attrs"],ye=(e="",n=0)=>e.repeat(n),Y=e=>Array.isArray(e)&&m.ARRAY||typeof e===m.OBJECT&&e!==null&&e._name&&m.JSTOXML_OBJECT||e instanceof Date&&m.DATE||e===null&&m.NULL||typeof e,re=e=>e.startsWith("<![CDATA["),ce=(e="",n={},t)=>{let s=e;if(typeof e===m.STRING){if(re(e))return e;const r=new RegExp(`(${Object.keys(n).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(r,(p,h)=>n[h]||"")}return typeof t=="function"?t(s):s},be=(e={},n,t,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,p])=>({[r]:p}))).reduce((r,p)=>{const h=Object.keys(p)[0],_=p[h];if(typeof t===m.FUNCTION&&t(h,_))return r;const y=n?ce(_,n):_,$=!s&&y===!0?"":`="${y}"`;return r.push(`${h}${$}`),r},[]),$e=(e={},n,t,s)=>{const r=be(e,n,t,s);return r.length===0?"":` ${r.join(" ")}`},Oe=(e={})=>Object.keys(e).map(n=>({_name:n,_content:e[n]})),ve=e=>_e.includes(Y(e)),je=e=>!e.match("<"),ke=({header:e,isOutputStart:n})=>e&&n?typeof e===m.BOOLEAN?ge:e:"",ne={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;"},U=(e={},n={})=>{const{depth:t=0,indent:s,_isFirstItem:r,_isOutputStart:p=!0,header:h,attributeReplacements:_={},attributeFilter:y,attributeExplicitTrue:$=!1,contentReplacements:F={},contentMap:M,selfCloseTags:B=!0}=n,J=typeof _=="boolean"&&!_?{}:{...ne,..._},G=typeof F=="boolean"&&!F?{}:{...ne,...F},D=typeof s=="string",k=ye(s,t),W=Y(e),L=ke({header:h,isOutputStart:p}),N=p&&!L&&r&&t===0,R=D&&!N?`
2
2
  `:"";let b="";switch(W){case m.JSTOXML_OBJECT:{const{_name:f,_content:u}=e;if(u===null&&typeof M!="function"){b=`${R}${k}${f}`;break}if(Array.isArray(u)&&u.every(ve))return u.map(j=>U({_name:f,_content:j},{...n,depth:t,_isOutputStart:!1})).join("");if(ee.includes(f))break;const g=U(u,{...n,depth:t+1,_isOutputStart:N}),w=Y(g),O=je(g),v=re(g),x=`${R}${k}`;if(f==="_comment"){b+=`${x}<!-- ${u} -->`;break}const H=w==="undefined"||g==="",c=B,o=e._selfCloseTag,a=typeof o===m.BOOLEAN?H&&o:H&&c,i=a?"/":"",l=$e(e._attrs,J,y,$),d=`<${f}${l}${i}>`,T=D&&!O&&!v?`
3
3
  ${k}`:"",S=a?"":`${g}${T}</${f}>`;b+=`${x}${d}${S}`;break}case m.OBJECT:{const f=Object.keys(e);b=f.map((u,g)=>{const w={...n,_isFirstItem:g===0,_isLastItem:g+1===f.length,_isOutputStart:N},O={_name:u};if(Y(e[u])===m.OBJECT&&(ee.forEach(v=>{const x=e[u][v];typeof x<"u"&&(O[v]=x,delete e[u][v])}),typeof e[u]._content<"u"&&Object.keys(e[u]).length>1)){const v=Object.assign({},e[u]);delete v._content,O._content=[...Oe(v),e[u]._content]}return typeof O._content>"u"&&(O._content=e[u]),U(O,w)},n).join("");break}case m.FUNCTION:{const f=e(n);b=U(f,n);break}case m.ARRAY:{b=e.map((f,u)=>{const g={...n,_isFirstItem:u===0,_isLastItem:u+1===e.length,_isOutputStart:N};return U(f,g)}).join("");break}default:{b=ce(e,G,M);break}}return`${L}${b}`},Q=e=>{try{return oe(e)}catch{return}},Te=e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const n=e.indexOf("/");return n>1&&!e.includes("/",n+1)}return!e.includes("/")},Se=e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),Ae=(e,n,t)=>{const s=`${n.replaceAll("/","+")}@${t}`,r=E(e,"node_modules",".pnpm"),p=Q(E(r,s,"node_modules",n,"package.json"));if(p)return p;let h;try{h=me(r)}catch{return}const _=`${s}_`;for(const y of h){if(!y.startsWith(_))continue;const $=Q(E(r,y,"node_modules",n,"package.json"));if($)return $}},we=(e,n,t)=>{const s=Q(E(e,"node_modules",n,"package.json"));return s?.version===t?s:void 0},xe=(e,n,t)=>{if(!(!Te(n)||!Se(t)))return Ae(e,n,t)??we(e,n,t)},De={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Ne={sha256:64,sha384:96,sha512:128},Re=e=>{const n={name:e.name,version:e.version},{integrity:t}=e;return t&&t.hex.length===Ne[t.algorithm]&&(n.hash={alg:De[t.algorithm],content:t.hex}),e.dependencies&&(n.dependencies=e.dependencies),e.peerDependencies&&(n.peerDependencies=e.peerDependencies),e.optionalDependencies&&(n.optionalDependencies=e.optionalDependencies),n},Ce=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Ee=e=>{for(const{file:n,type:t}of Ce){let s;try{s=ue(E(e,n))}catch{continue}const r=new Map;for(const p of de(s,t))r.set(`${p.name}@${p.version}`,Re(p));return{packages:r,type:t}}},Me=e=>{const n=e.indexOf(":");return n<=0?e:e.slice(0,n)==="npm"?e.slice(n+1):e},V=(e,n,t)=>{const s=t.get(e);if(!s||s.size===0)return;if(s.has(n))return n;const r=Me(n);if(r!==n&&s.has(r))return r;const p=[...s];return he.maxSatisfying(p,r,{includePrerelease:!0})||p[0]},Be="1.7",Le="CycloneDX",Ie="http://cyclonedx.org/schema/bom-1.7.schema.json",Ue="@visulima/vis",te=e=>{try{return oe(e)}catch{return}},Fe=e=>{if(e){if(typeof e=="string")return e;if(typeof e=="object"&&e.name)return e.email?`${e.name} <${e.email}>`:e.name}},Je=e=>{if(e)return typeof e=="string"?e:e.url},qe=e=>{if(e)return typeof e=="string"?e:e.url},Pe=e=>{const n=[];e.homepage&&n.push({type:"website",url:e.homepage});const t=Je(e.repository);t&&n.push({type:"vcs",url:t});const s=qe(e.bugs);return s&&n.push({type:"issue-tracker",url:s}),n.length>0?n:void 0},Xe=e=>e==="application"||e==="service"||e==="tool"?"application":"library",K=(e,n)=>{if(!n)return;n.description&&(e.description=n.description);const t=Fe(n.author);t&&(e.author=t);const s=fe(n);s&&(e.licenses=s);const r=Pe(n);r&&(e.externalReferences=r)},tn=e=>{const{focus:n,generatorVersion:t,includeDev:s=!1,now:r=new Date,projectGraph:p,serialNumber:h,workspace:_,workspaceRoot:y}=e,$=n&&n.length>0?[...le(n,p)].sort():Object.keys(_.projects).sort(),F=new Set($),M=new Map;for(const c of $){const o=_.projects[c];o&&M.set(c,te(E(y,o.root,"package.json")))}const B=[],J=new Map;for(const c of $){const o=_.projects[c];if(!o)continue;const a=M.get(c),i=a?.version??"0.0.0",l=C(c,i);J.set(c,l);const d={"bom-ref":l,name:c,purl:l,type:Xe(o.projectType),version:i};K(d,a),B.push(d)}const G=Ee(y),D=new Map,k=new Map;if(G)for(const c of G.packages.values()){D.set(`${c.name}@${c.version}`,c);let o=k.get(c.name);o||(o=new Set,k.set(c.name,o)),o.add(c.version)}const W=[],L=[],N=new Map;for(const c of $){const o=M.get(c);if(!o)continue;const a=[o.dependencies,o.peerDependencies];s&&a.push(o.devDependencies);const i=new Set,l=(d,T)=>{if(T)for(const[S,j]of Object.entries(T)){if(F.has(S)){const I=J.get(S);I&&i.add(I);continue}const A=V(S,j,k);A&&(i.add(C(S,A)),d.push(`${S}@${A}`))}};for(const d of a)l(W,d);l(L,o.optionalDependencies),N.set(c,i)}const R=new Map,b=new Map,f=(c,o)=>{const a=[...c];for(;a.length>0;){const i=a.pop(),l=R.get(i);if(l==="required"||l==="optional"&&o==="optional")continue;R.set(i,o);const d=D.get(i);if(!d)continue;const T=b.get(i)??new Set,S=[d.dependencies,d.peerDependencies];for(const j of S)if(j)for(const[A,I]of Object.entries(j))for(const q of I){const z=V(A,q,k);z&&(T.add(C(A,z)),a.push(`${A}@${z}`))}if(d.optionalDependencies)for(const[j,A]of Object.entries(d.optionalDependencies))for(const I of A){const q=V(j,I,k);q&&(T.add(C(j,q)),L.push(`${j}@${q}`))}T.size>0&&b.set(i,T)}};f(W,"required"),f(L,"optional");const u=[],g=[...R.keys()].sort();for(const c of g){const o=D.get(c);if(!o)continue;const a=C(o.name,o.version),i={"bom-ref":a,name:o.name,purl:a,scope:R.get(c)??"required",type:"library",version:o.version};o.hash&&(i.hashes=[o.hash]),K(i,xe(y,o.name,o.version)),u.push(i)}const w=[];for(const[c,o]of N){const a=J.get(c);if(!a)continue;const i=[...o].sort();w.push(i.length>0?{dependsOn:i,ref:a}:{ref:a})}for(const c of g){const o=D.get(c);if(!o)continue;const a=C(o.name,o.version),i=b.get(c),l=i?[...i].sort():[];w.push(l.length>0?{dependsOn:l,ref:a}:{ref:a})}w.sort((c,o)=>c.ref.localeCompare(o.ref));const O=te(E(y,"package.json")),v=(()=>{if(n?.length===1){const l=B.find(d=>d.name===n[0]);if(l)return{"bom-ref":l["bom-ref"],name:l.name,purl:l.purl,type:l.type,version:l.version}}const c=O?.name??"workspace",o=O?.version??"0.0.0",a=C(c,o),i={"bom-ref":a,name:c,purl:a,type:"application",version:o};return K(i,O),i})(),x=v["bom-ref"],H=x?B.filter(c=>c["bom-ref"]!==x):B;return{$schema:Ie,bomFormat:Le,components:[...H,...u],dependencies:w,metadata:{component:v,lifecycles:[{phase:"build"}],timestamp:r.toISOString(),tools:{components:[{name:Ue,type:"application",...t?{version:t}:{}}]}},serialNumber:h??`urn:uuid:${pe()}`,specVersion:Be,version:1}},sn=e=>{const n={version:e.version??1,xmlns:"http://cyclonedx.org/schema/bom/1.7"};e.serialNumber&&(n.serialNumber=e.serialNumber);const t=[];return e.metadata&&t.push(Ge(e.metadata)),e.components&&e.components.length>0&&t.push({_content:e.components.map(s=>Z(s)),_name:"components"}),e.dependencies&&e.dependencies.length>0&&t.push({_content:e.dependencies.map(s=>He(s)),_name:"dependencies"}),`${U({_attrs:n,_content:t,_name:"bom"},{header:!0,indent:" ",selfCloseTags:!0})}
4
4
  `},Ge=e=>{const n=[];return e.timestamp&&n.push({timestamp:e.timestamp}),e.lifecycles&&e.lifecycles.length>0&&n.push({_content:e.lifecycles.map(t=>{const s=[];return t.phase&&s.push({phase:t.phase}),t.name&&s.push({name:t.name}),t.description&&s.push({description:t.description}),{_content:s,_name:"lifecycle"}}),_name:"lifecycles"}),e.tools?.components&&n.push({_content:[{_content:e.tools.components.map(t=>Z(t)),_name:"components"}],_name:"tools"}),e.component&&n.push(Z(e.component)),{_content:n,_name:"metadata"}},Z=e=>{const n={type:e.type};e["bom-ref"]&&(n["bom-ref"]=e["bom-ref"]);const t=[];e.group&&t.push({group:e.group}),t.push({name:e.name}),e.version&&t.push({version:e.version}),e.description&&t.push({description:e.description}),e.author&&t.push({author:e.author}),e.hashes&&e.hashes.length>0&&t.push({_content:e.hashes.map(r=>({_attrs:{alg:r.alg},_content:r.content,_name:"hash"})),_name:"hashes"});const s=We(e.licenses);return s&&t.push(s),e.purl&&t.push({purl:e.purl}),e.scope&&t.push({scope:e.scope}),e.externalReferences&&e.externalReferences.length>0&&t.push({_content:e.externalReferences.map(r=>({_attrs:{type:r.type},_content:[{url:r.url}],_name:"reference"})),_name:"externalReferences"}),{_attrs:n,_content:t,_name:"component"}},We=e=>{if(!e||e.length===0)return;const n=[];for(const t of e){if("expression"in t){n.push({expression:t.expression});continue}const s=[];"id"in t.license&&t.license.id?s.push({id:t.license.id}):"name"in t.license&&t.license.name&&s.push({name:t.license.name}),n.push({_content:s,_name:"license"})}return{_content:n,_name:"licenses"}},He=e=>e.dependsOn&&e.dependsOn.length>0?{_attrs:{ref:e.ref},_content:e.dependsOn.map(n=>({_attrs:{ref:n},_name:"dependency"})),_name:"dependency"}:{_attrs:{ref:e.ref},_name:"dependency"};export{tn as b,sn as s,C as t};
@@ -1 +1 @@
1
- import{v as u,m as l,f as g}from"./index-OQZQyN5R.js";import{D as d}from"../packem_chunks/cli-main.js";import"./public-api-WqUCiyIe.js";import{e as D,W as v}from"../packem_chunks/catalog.js";const w={bun:{file:"bun.lock",type:"bun"},npm:{aliases:["npm-shrinkwrap.json"],file:"package-lock.json",type:"npm"},pnpm:{file:"pnpm-lock.yaml",type:"pnpm"},yarn:{file:"yarn.lock",type:"yarn"}},j=o=>{const t=w[o];return t?[...t.aliases??[],t.file].map(e=>({file:e,type:t.type})):[]},m=(o,t)=>{const e=j(t);if(e.length!==0)return e.find(r=>g(l(o,r.file)))??e[e.length-1]},k=o=>{try{return JSON.parse(u(o))}catch{return}},y=o=>{const t=[],e=k(l(o,"package.json"));e&&t.push(e);const r=D(o);let c;if(r?c=r:e?.workspaces&&(Array.isArray(e.workspaces)?c=e.workspaces:e.workspaces.packages&&(c=e.workspaces.packages)),!c)return t;const a=v(o,c);for(const s of a){const n=k(l(o,s,"package.json"));n&&t.push(n)}return t},b=(o,t)=>{const e=new Set,r=[],c=new Map;for(const s of t){const n=c.get(s.name);n?n.push(s):c.set(s.name,[s])}const a=s=>{if(s)for(const n of Object.keys(s))e.has(n)||(e.add(n),r.push(n))};for(const s of y(o))a(s.dependencies),a(s.peerDependencies),a(s.optionalDependencies);for(;r.length>0;){const s=r.shift(),n=c.get(s);if(n){for(const i of n)for(const p of[i.dependencies,i.peerDependencies,i.optionalDependencies])if(p)for(const f of Object.keys(p))e.has(f)||(e.add(f),r.push(f))}}return e},A=(o,t,e={})=>{const r=m(o,t);if(!r)return[];let c;try{c=u(l(o,r.file))}catch{return[]}const a=d(c,r.type);if(a.length===0)return[];const s=e.includeDev??!0?void 0:b(o,a),n=new Set,i=[];for(const p of a){if(s&&!s.has(p.name))continue;const f=`${p.name}@${p.version}`;n.has(f)||(n.add(f),i.push({isDev:!1,name:p.name,version:p.version}))}return i},E=(o,t)=>{const e=m(o,t);if(!e)return[];let r;try{r=u(l(o,e.file))}catch{return[]}const c=d(r,e.type);if(c.length===0)return[];const a=new Map;for(const n of c)a.has(n.name)||a.set(n.name,new Set),a.get(n.name).add(n.version);const s=[];for(const[n,i]of a)i.size<=1||s.push({name:n,versions:[...i]});return s.sort((n,i)=>n.name.localeCompare(i.name))},M=(o,t)=>{const e=m(o,t);if(!e)return;let r;try{r=u(l(o,e.file))}catch{return}const c=d(r,e.type);if(c.length===0)return;const a=[],s=new Set;for(const n of y(o))for(const i of[n.dependencies,n.devDependencies,n.peerDependencies,n.optionalDependencies])if(i)for(const[p,f]of Object.entries(i)){const h=`${p}@${f}`;s.has(h)||(s.add(h),a.push({name:p,version:f}))}return{entries:c,roots:a}};export{w as L,M as a,E as f,A as l,m as r};
1
+ import{v as u,m as l,f as g}from"./index-CE6MsgcV.js";import{D as d}from"../packem_chunks/cli-main.js";import"./public-api-WqUCiyIe.js";import{e as D,W as v}from"../packem_chunks/catalog.js";const w={bun:{file:"bun.lock",type:"bun"},npm:{aliases:["npm-shrinkwrap.json"],file:"package-lock.json",type:"npm"},pnpm:{file:"pnpm-lock.yaml",type:"pnpm"},yarn:{file:"yarn.lock",type:"yarn"}},j=o=>{const t=w[o];return t?[...t.aliases??[],t.file].map(e=>({file:e,type:t.type})):[]},m=(o,t)=>{const e=j(t);if(e.length!==0)return e.find(r=>g(l(o,r.file)))??e[e.length-1]},k=o=>{try{return JSON.parse(u(o))}catch{return}},y=o=>{const t=[],e=k(l(o,"package.json"));e&&t.push(e);const r=D(o);let c;if(r?c=r:e?.workspaces&&(Array.isArray(e.workspaces)?c=e.workspaces:e.workspaces.packages&&(c=e.workspaces.packages)),!c)return t;const a=v(o,c);for(const s of a){const n=k(l(o,s,"package.json"));n&&t.push(n)}return t},b=(o,t)=>{const e=new Set,r=[],c=new Map;for(const s of t){const n=c.get(s.name);n?n.push(s):c.set(s.name,[s])}const a=s=>{if(s)for(const n of Object.keys(s))e.has(n)||(e.add(n),r.push(n))};for(const s of y(o))a(s.dependencies),a(s.peerDependencies),a(s.optionalDependencies);for(;r.length>0;){const s=r.shift(),n=c.get(s);if(n){for(const i of n)for(const p of[i.dependencies,i.peerDependencies,i.optionalDependencies])if(p)for(const f of Object.keys(p))e.has(f)||(e.add(f),r.push(f))}}return e},A=(o,t,e={})=>{const r=m(o,t);if(!r)return[];let c;try{c=u(l(o,r.file))}catch{return[]}const a=d(c,r.type);if(a.length===0)return[];const s=e.includeDev??!0?void 0:b(o,a),n=new Set,i=[];for(const p of a){if(s&&!s.has(p.name))continue;const f=`${p.name}@${p.version}`;n.has(f)||(n.add(f),i.push({isDev:!1,name:p.name,version:p.version}))}return i},E=(o,t)=>{const e=m(o,t);if(!e)return[];let r;try{r=u(l(o,e.file))}catch{return[]}const c=d(r,e.type);if(c.length===0)return[];const a=new Map;for(const n of c)a.has(n.name)||a.set(n.name,new Set),a.get(n.name).add(n.version);const s=[];for(const[n,i]of a)i.size<=1||s.push({name:n,versions:[...i]});return s.sort((n,i)=>n.name.localeCompare(i.name))},M=(o,t)=>{const e=m(o,t);if(!e)return;let r;try{r=u(l(o,e.file))}catch{return}const c=d(r,e.type);if(c.length===0)return;const a=[],s=new Set;for(const n of y(o))for(const i of[n.dependencies,n.devDependencies,n.peerDependencies,n.optionalDependencies])if(i)for(const[p,f]of Object.entries(i)){const h=`${p}@${f}`;s.has(h)||(s.add(h),a.push({name:p,version:f}))}return{entries:c,roots:a}};export{w as L,M as a,E as f,A as l,m as r};