@consumidor-positivo/aurora 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (614) hide show
  1. package/astro/Button/index.astro +85 -0
  2. package/astro/Drawer/index.astro +95 -0
  3. package/astro/Footer/index.astro +329 -0
  4. package/astro/Header/Actions/index.astro +19 -0
  5. package/astro/Header/Badges/index.astro +19 -0
  6. package/astro/Header/Button/index.astro +16 -0
  7. package/astro/Header/Hamburger/index.astro +28 -0
  8. package/astro/Header/Logo/index.astro +25 -0
  9. package/astro/Header/Navbar/index.astro +24 -0
  10. package/astro/Header/NavbarLink/index.astro +137 -0
  11. package/astro/Header/Navigation/index.astro +11 -0
  12. package/astro/Header/Profile/index.astro +81 -0
  13. package/astro/Header/index.astro +19 -0
  14. package/astro/Icon/index.astro +49 -0
  15. package/astro/Logo/ac/Tertiary.astro +28 -0
  16. package/astro/Logo/cp/Primary.astro +32 -0
  17. package/astro/Logo/index.astro +29 -0
  18. package/astro/NavbarVertical/Link/index.astro +101 -0
  19. package/astro/NavbarVertical/index.astro +27 -0
  20. package/astro/Tabs/TabPanel/index.astro +23 -0
  21. package/astro/Tabs/index.astro +142 -0
  22. package/astro/Text/index.astro +75 -0
  23. package/astro/icons/default/IconActivity.astro +10 -0
  24. package/astro/icons/default/IconAi.astro +10 -0
  25. package/astro/icons/default/IconAiBox.astro +10 -0
  26. package/astro/icons/default/IconAirplay.astro +10 -0
  27. package/astro/icons/default/IconAlertCircle.astro +10 -0
  28. package/astro/icons/default/IconAlertOctagon.astro +10 -0
  29. package/astro/icons/default/IconAlertTriangle.astro +10 -0
  30. package/astro/icons/default/IconAlignCenter.astro +10 -0
  31. package/astro/icons/default/IconAlignJustify.astro +10 -0
  32. package/astro/icons/default/IconAlignLeft.astro +10 -0
  33. package/astro/icons/default/IconAlignRight.astro +10 -0
  34. package/astro/icons/default/IconAnchor.astro +10 -0
  35. package/astro/icons/default/IconAperture.astro +10 -0
  36. package/astro/icons/default/IconArchive.astro +10 -0
  37. package/astro/icons/default/IconArrowDown.astro +10 -0
  38. package/astro/icons/default/IconArrowDownCircle.astro +10 -0
  39. package/astro/icons/default/IconArrowDownLeft.astro +10 -0
  40. package/astro/icons/default/IconArrowDownRight.astro +10 -0
  41. package/astro/icons/default/IconArrowLeft.astro +10 -0
  42. package/astro/icons/default/IconArrowLeftCircle.astro +10 -0
  43. package/astro/icons/default/IconArrowRight.astro +10 -0
  44. package/astro/icons/default/IconArrowRightCircle.astro +10 -0
  45. package/astro/icons/default/IconArrowUp.astro +10 -0
  46. package/astro/icons/default/IconArrowUpCircle.astro +10 -0
  47. package/astro/icons/default/IconArrowUpLeft.astro +10 -0
  48. package/astro/icons/default/IconArrowUpRight.astro +10 -0
  49. package/astro/icons/default/IconAtSign.astro +10 -0
  50. package/astro/icons/default/IconAward.astro +10 -0
  51. package/astro/icons/default/IconBank.astro +10 -0
  52. package/astro/icons/default/IconBarChart.astro +10 -0
  53. package/astro/icons/default/IconBarChart2.astro +10 -0
  54. package/astro/icons/default/IconBarCode.astro +10 -0
  55. package/astro/icons/default/IconBarCode2.astro +10 -0
  56. package/astro/icons/default/IconBattery.astro +10 -0
  57. package/astro/icons/default/IconBatteryCharging.astro +10 -0
  58. package/astro/icons/default/IconBell.astro +10 -0
  59. package/astro/icons/default/IconBellOff.astro +10 -0
  60. package/astro/icons/default/IconBluetooth.astro +10 -0
  61. package/astro/icons/default/IconBold.astro +10 -0
  62. package/astro/icons/default/IconBook.astro +10 -0
  63. package/astro/icons/default/IconBookOpen.astro +10 -0
  64. package/astro/icons/default/IconBookmark.astro +10 -0
  65. package/astro/icons/default/IconBox.astro +10 -0
  66. package/astro/icons/default/IconBriefcase.astro +10 -0
  67. package/astro/icons/default/IconCake.astro +10 -0
  68. package/astro/icons/default/IconCalendar.astro +10 -0
  69. package/astro/icons/default/IconCamera.astro +10 -0
  70. package/astro/icons/default/IconCameraOff.astro +10 -0
  71. package/astro/icons/default/IconCar.astro +10 -0
  72. package/astro/icons/default/IconCast.astro +10 -0
  73. package/astro/icons/default/IconCheck.astro +10 -0
  74. package/astro/icons/default/IconCheckCircle.astro +10 -0
  75. package/astro/icons/default/IconCheckSquare.astro +10 -0
  76. package/astro/icons/default/IconChevronDown.astro +10 -0
  77. package/astro/icons/default/IconChevronLeft.astro +10 -0
  78. package/astro/icons/default/IconChevronRight.astro +10 -0
  79. package/astro/icons/default/IconChevronUp.astro +10 -0
  80. package/astro/icons/default/IconChevronsDown.astro +10 -0
  81. package/astro/icons/default/IconChevronsLeft.astro +10 -0
  82. package/astro/icons/default/IconChevronsRight.astro +10 -0
  83. package/astro/icons/default/IconChevronsUp.astro +10 -0
  84. package/astro/icons/default/IconChrome.astro +10 -0
  85. package/astro/icons/default/IconCircle.astro +10 -0
  86. package/astro/icons/default/IconClipboard.astro +10 -0
  87. package/astro/icons/default/IconClock.astro +10 -0
  88. package/astro/icons/default/IconCloud.astro +10 -0
  89. package/astro/icons/default/IconCloudDrizzle.astro +10 -0
  90. package/astro/icons/default/IconCloudLightning.astro +10 -0
  91. package/astro/icons/default/IconCloudOff.astro +10 -0
  92. package/astro/icons/default/IconCloudRain.astro +10 -0
  93. package/astro/icons/default/IconCloudSnow.astro +10 -0
  94. package/astro/icons/default/IconCode.astro +10 -0
  95. package/astro/icons/default/IconCodepen.astro +10 -0
  96. package/astro/icons/default/IconCodesandbox.astro +10 -0
  97. package/astro/icons/default/IconCoffee.astro +10 -0
  98. package/astro/icons/default/IconCoin.astro +10 -0
  99. package/astro/icons/default/IconCollapseClose.astro +10 -0
  100. package/astro/icons/default/IconCollapseOpen.astro +10 -0
  101. package/astro/icons/default/IconColumns.astro +10 -0
  102. package/astro/icons/default/IconCommand.astro +10 -0
  103. package/astro/icons/default/IconCompass.astro +10 -0
  104. package/astro/icons/default/IconCookie.astro +10 -0
  105. package/astro/icons/default/IconCopy.astro +10 -0
  106. package/astro/icons/default/IconCornerDownLeft.astro +10 -0
  107. package/astro/icons/default/IconCornerDownRight.astro +10 -0
  108. package/astro/icons/default/IconCornerLeftDown.astro +10 -0
  109. package/astro/icons/default/IconCornerLeftUp.astro +10 -0
  110. package/astro/icons/default/IconCornerRightDown.astro +10 -0
  111. package/astro/icons/default/IconCornerRightUp.astro +10 -0
  112. package/astro/icons/default/IconCornerUpLeft.astro +10 -0
  113. package/astro/icons/default/IconCornerUpRight.astro +10 -0
  114. package/astro/icons/default/IconCpu.astro +10 -0
  115. package/astro/icons/default/IconCreditCard.astro +10 -0
  116. package/astro/icons/default/IconCrop.astro +10 -0
  117. package/astro/icons/default/IconCrosshair.astro +10 -0
  118. package/astro/icons/default/IconDatabase.astro +10 -0
  119. package/astro/icons/default/IconDelete.astro +10 -0
  120. package/astro/icons/default/IconDisc.astro +10 -0
  121. package/astro/icons/default/IconDivide.astro +10 -0
  122. package/astro/icons/default/IconDivideCircle.astro +10 -0
  123. package/astro/icons/default/IconDivideSquare.astro +10 -0
  124. package/astro/icons/default/IconDollarSign.astro +10 -0
  125. package/astro/icons/default/IconDownload.astro +10 -0
  126. package/astro/icons/default/IconDownloadCloud.astro +10 -0
  127. package/astro/icons/default/IconDribbble.astro +10 -0
  128. package/astro/icons/default/IconDroplet.astro +10 -0
  129. package/astro/icons/default/IconEdit.astro +10 -0
  130. package/astro/icons/default/IconEdit2.astro +10 -0
  131. package/astro/icons/default/IconEdit3.astro +10 -0
  132. package/astro/icons/default/IconExternalLink.astro +10 -0
  133. package/astro/icons/default/IconEye.astro +10 -0
  134. package/astro/icons/default/IconEyeOff.astro +10 -0
  135. package/astro/icons/default/IconFacebook.astro +10 -0
  136. package/astro/icons/default/IconFastForward.astro +10 -0
  137. package/astro/icons/default/IconFeather.astro +10 -0
  138. package/astro/icons/default/IconFigma.astro +10 -0
  139. package/astro/icons/default/IconFile.astro +10 -0
  140. package/astro/icons/default/IconFileMinus.astro +10 -0
  141. package/astro/icons/default/IconFilePdf.astro +10 -0
  142. package/astro/icons/default/IconFilePlus.astro +10 -0
  143. package/astro/icons/default/IconFileText.astro +10 -0
  144. package/astro/icons/default/IconFilm.astro +10 -0
  145. package/astro/icons/default/IconFilter.astro +10 -0
  146. package/astro/icons/default/IconFirecracker.astro +10 -0
  147. package/astro/icons/default/IconFlag.astro +10 -0
  148. package/astro/icons/default/IconFolder.astro +10 -0
  149. package/astro/icons/default/IconFolderMinus.astro +10 -0
  150. package/astro/icons/default/IconFolderPlus.astro +10 -0
  151. package/astro/icons/default/IconFramer.astro +10 -0
  152. package/astro/icons/default/IconFrown.astro +10 -0
  153. package/astro/icons/default/IconGift.astro +10 -0
  154. package/astro/icons/default/IconGitBranch.astro +10 -0
  155. package/astro/icons/default/IconGitCommit.astro +10 -0
  156. package/astro/icons/default/IconGitMerge.astro +10 -0
  157. package/astro/icons/default/IconGitPullRequest.astro +10 -0
  158. package/astro/icons/default/IconGithub.astro +10 -0
  159. package/astro/icons/default/IconGitlab.astro +10 -0
  160. package/astro/icons/default/IconGiveMoney.astro +10 -0
  161. package/astro/icons/default/IconGlasses.astro +10 -0
  162. package/astro/icons/default/IconGlobe.astro +10 -0
  163. package/astro/icons/default/IconGraduationHat.astro +10 -0
  164. package/astro/icons/default/IconGrid.astro +10 -0
  165. package/astro/icons/default/IconHardDrive.astro +10 -0
  166. package/astro/icons/default/IconHash.astro +10 -0
  167. package/astro/icons/default/IconHeadphones.astro +10 -0
  168. package/astro/icons/default/IconHeart.astro +10 -0
  169. package/astro/icons/default/IconHelpCircle.astro +10 -0
  170. package/astro/icons/default/IconHexagon.astro +10 -0
  171. package/astro/icons/default/IconHome.astro +10 -0
  172. package/astro/icons/default/IconHomeChimney.astro +10 -0
  173. package/astro/icons/default/IconId.astro +10 -0
  174. package/astro/icons/default/IconImage.astro +10 -0
  175. package/astro/icons/default/IconInbox.astro +10 -0
  176. package/astro/icons/default/IconInfo.astro +10 -0
  177. package/astro/icons/default/IconInstagram.astro +10 -0
  178. package/astro/icons/default/IconItalic.astro +10 -0
  179. package/astro/icons/default/IconKey.astro +10 -0
  180. package/astro/icons/default/IconLaptop.astro +10 -0
  181. package/astro/icons/default/IconLayers.astro +10 -0
  182. package/astro/icons/default/IconLayout.astro +10 -0
  183. package/astro/icons/default/IconLifeBuoy.astro +10 -0
  184. package/astro/icons/default/IconLightBulb.astro +10 -0
  185. package/astro/icons/default/IconLink.astro +10 -0
  186. package/astro/icons/default/IconLink2.astro +10 -0
  187. package/astro/icons/default/IconLinkedin.astro +10 -0
  188. package/astro/icons/default/IconLips.astro +10 -0
  189. package/astro/icons/default/IconList.astro +10 -0
  190. package/astro/icons/default/IconLoader.astro +10 -0
  191. package/astro/icons/default/IconLock.astro +10 -0
  192. package/astro/icons/default/IconLogIn.astro +10 -0
  193. package/astro/icons/default/IconLogOut.astro +10 -0
  194. package/astro/icons/default/IconMail.astro +10 -0
  195. package/astro/icons/default/IconMap.astro +10 -0
  196. package/astro/icons/default/IconMapPin.astro +10 -0
  197. package/astro/icons/default/IconMaximize.astro +10 -0
  198. package/astro/icons/default/IconMaximize2.astro +10 -0
  199. package/astro/icons/default/IconMeh.astro +10 -0
  200. package/astro/icons/default/IconMenu.astro +10 -0
  201. package/astro/icons/default/IconMessageCircle.astro +10 -0
  202. package/astro/icons/default/IconMessageSquare.astro +10 -0
  203. package/astro/icons/default/IconMic.astro +10 -0
  204. package/astro/icons/default/IconMicOff.astro +10 -0
  205. package/astro/icons/default/IconMinimize.astro +10 -0
  206. package/astro/icons/default/IconMinimize2.astro +10 -0
  207. package/astro/icons/default/IconMinus.astro +10 -0
  208. package/astro/icons/default/IconMinusCircle.astro +10 -0
  209. package/astro/icons/default/IconMinusSquare.astro +10 -0
  210. package/astro/icons/default/IconMoney.astro +10 -0
  211. package/astro/icons/default/IconMonitor.astro +10 -0
  212. package/astro/icons/default/IconMoon.astro +10 -0
  213. package/astro/icons/default/IconMoreHorizontal.astro +10 -0
  214. package/astro/icons/default/IconMoreVertical.astro +10 -0
  215. package/astro/icons/default/IconMousePointer.astro +10 -0
  216. package/astro/icons/default/IconMove.astro +10 -0
  217. package/astro/icons/default/IconMusic.astro +10 -0
  218. package/astro/icons/default/IconNavigation.astro +10 -0
  219. package/astro/icons/default/IconNavigation2.astro +10 -0
  220. package/astro/icons/default/IconNegotiation.astro +10 -0
  221. package/astro/icons/default/IconObjective.astro +10 -0
  222. package/astro/icons/default/IconOctagon.astro +10 -0
  223. package/astro/icons/default/IconPackage.astro +10 -0
  224. package/astro/icons/default/IconPaperclip.astro +10 -0
  225. package/astro/icons/default/IconPause.astro +10 -0
  226. package/astro/icons/default/IconPauseCircle.astro +10 -0
  227. package/astro/icons/default/IconPenTool.astro +10 -0
  228. package/astro/icons/default/IconPencilPack.astro +10 -0
  229. package/astro/icons/default/IconPercent.astro +10 -0
  230. package/astro/icons/default/IconPercentBalloon.astro +10 -0
  231. package/astro/icons/default/IconPhone.astro +10 -0
  232. package/astro/icons/default/IconPhoneCall.astro +10 -0
  233. package/astro/icons/default/IconPhoneForwarded.astro +10 -0
  234. package/astro/icons/default/IconPhoneIncoming.astro +10 -0
  235. package/astro/icons/default/IconPhoneMissed.astro +10 -0
  236. package/astro/icons/default/IconPhoneOff.astro +10 -0
  237. package/astro/icons/default/IconPhoneOutgoing.astro +10 -0
  238. package/astro/icons/default/IconPieChart.astro +10 -0
  239. package/astro/icons/default/IconPix.astro +10 -0
  240. package/astro/icons/default/IconPlane.astro +10 -0
  241. package/astro/icons/default/IconPlay.astro +10 -0
  242. package/astro/icons/default/IconPlayCircle.astro +10 -0
  243. package/astro/icons/default/IconPlus.astro +10 -0
  244. package/astro/icons/default/IconPlusCircle.astro +10 -0
  245. package/astro/icons/default/IconPlusSquare.astro +10 -0
  246. package/astro/icons/default/IconPocket.astro +10 -0
  247. package/astro/icons/default/IconPower.astro +10 -0
  248. package/astro/icons/default/IconPrinter.astro +10 -0
  249. package/astro/icons/default/IconQrCode.astro +10 -0
  250. package/astro/icons/default/IconRadio.astro +10 -0
  251. package/astro/icons/default/IconRefreshCcw.astro +10 -0
  252. package/astro/icons/default/IconRefreshCw.astro +10 -0
  253. package/astro/icons/default/IconRepeat.astro +10 -0
  254. package/astro/icons/default/IconRewind.astro +10 -0
  255. package/astro/icons/default/IconRotateCcw.astro +10 -0
  256. package/astro/icons/default/IconRotateCw.astro +10 -0
  257. package/astro/icons/default/IconRss.astro +10 -0
  258. package/astro/icons/default/IconSave.astro +10 -0
  259. package/astro/icons/default/IconSaveMoney.astro +10 -0
  260. package/astro/icons/default/IconSchoolBag.astro +10 -0
  261. package/astro/icons/default/IconScissors.astro +10 -0
  262. package/astro/icons/default/IconSearch.astro +10 -0
  263. package/astro/icons/default/IconSend.astro +10 -0
  264. package/astro/icons/default/IconServer.astro +10 -0
  265. package/astro/icons/default/IconSettings.astro +10 -0
  266. package/astro/icons/default/IconShare.astro +10 -0
  267. package/astro/icons/default/IconShare2.astro +10 -0
  268. package/astro/icons/default/IconShield.astro +10 -0
  269. package/astro/icons/default/IconShieldLocked.astro +10 -0
  270. package/astro/icons/default/IconShieldOff.astro +10 -0
  271. package/astro/icons/default/IconShoppingBag.astro +10 -0
  272. package/astro/icons/default/IconShoppingCart.astro +10 -0
  273. package/astro/icons/default/IconShuffle.astro +10 -0
  274. package/astro/icons/default/IconSidebar.astro +10 -0
  275. package/astro/icons/default/IconSkipBack.astro +10 -0
  276. package/astro/icons/default/IconSkipForward.astro +10 -0
  277. package/astro/icons/default/IconSlack.astro +10 -0
  278. package/astro/icons/default/IconSlash.astro +10 -0
  279. package/astro/icons/default/IconSliders.astro +10 -0
  280. package/astro/icons/default/IconSmartphone.astro +10 -0
  281. package/astro/icons/default/IconSmartphoneSms.astro +10 -0
  282. package/astro/icons/default/IconSmile.astro +10 -0
  283. package/astro/icons/default/IconSpark.astro +10 -0
  284. package/astro/icons/default/IconSpeaker.astro +10 -0
  285. package/astro/icons/default/IconSquare.astro +10 -0
  286. package/astro/icons/default/IconStar.astro +10 -0
  287. package/astro/icons/default/IconStopCircle.astro +10 -0
  288. package/astro/icons/default/IconSun.astro +10 -0
  289. package/astro/icons/default/IconSunrise.astro +10 -0
  290. package/astro/icons/default/IconSunset.astro +10 -0
  291. package/astro/icons/default/IconTable.astro +10 -0
  292. package/astro/icons/default/IconTablet.astro +10 -0
  293. package/astro/icons/default/IconTag.astro +10 -0
  294. package/astro/icons/default/IconTarget.astro +10 -0
  295. package/astro/icons/default/IconTerminal.astro +10 -0
  296. package/astro/icons/default/IconThermometer.astro +10 -0
  297. package/astro/icons/default/IconThumbsDown.astro +10 -0
  298. package/astro/icons/default/IconThumbsUp.astro +10 -0
  299. package/astro/icons/default/IconTiktok.astro +10 -0
  300. package/astro/icons/default/IconToggleLeft.astro +10 -0
  301. package/astro/icons/default/IconToggleRight.astro +10 -0
  302. package/astro/icons/default/IconTool.astro +10 -0
  303. package/astro/icons/default/IconTrash.astro +10 -0
  304. package/astro/icons/default/IconTrash2.astro +10 -0
  305. package/astro/icons/default/IconTrello.astro +10 -0
  306. package/astro/icons/default/IconTrendingDown.astro +10 -0
  307. package/astro/icons/default/IconTrendingUp.astro +10 -0
  308. package/astro/icons/default/IconTriangle.astro +10 -0
  309. package/astro/icons/default/IconTrophy.astro +10 -0
  310. package/astro/icons/default/IconTruck.astro +10 -0
  311. package/astro/icons/default/IconTv.astro +10 -0
  312. package/astro/icons/default/IconTwitch.astro +10 -0
  313. package/astro/icons/default/IconTwitter.astro +10 -0
  314. package/astro/icons/default/IconType.astro +10 -0
  315. package/astro/icons/default/IconUmbrella.astro +10 -0
  316. package/astro/icons/default/IconUnderline.astro +10 -0
  317. package/astro/icons/default/IconUnlock.astro +10 -0
  318. package/astro/icons/default/IconUpload.astro +10 -0
  319. package/astro/icons/default/IconUploadCloud.astro +10 -0
  320. package/astro/icons/default/IconUser.astro +10 -0
  321. package/astro/icons/default/IconUserCheck.astro +10 -0
  322. package/astro/icons/default/IconUserMinus.astro +10 -0
  323. package/astro/icons/default/IconUserPlus.astro +10 -0
  324. package/astro/icons/default/IconUserX.astro +10 -0
  325. package/astro/icons/default/IconUsers.astro +10 -0
  326. package/astro/icons/default/IconVelocimeter.astro +10 -0
  327. package/astro/icons/default/IconVideo.astro +10 -0
  328. package/astro/icons/default/IconVideoOff.astro +10 -0
  329. package/astro/icons/default/IconVoicemail.astro +10 -0
  330. package/astro/icons/default/IconVolume1.astro +10 -0
  331. package/astro/icons/default/IconVolume2.astro +10 -0
  332. package/astro/icons/default/IconVolumeX.astro +10 -0
  333. package/astro/icons/default/IconWarning.astro +10 -0
  334. package/astro/icons/default/IconWatch.astro +10 -0
  335. package/astro/icons/default/IconWebsite.astro +10 -0
  336. package/astro/icons/default/IconWhatsapp.astro +10 -0
  337. package/astro/icons/default/IconWifi.astro +10 -0
  338. package/astro/icons/default/IconWifiOff.astro +10 -0
  339. package/astro/icons/default/IconWind.astro +10 -0
  340. package/astro/icons/default/IconX.astro +10 -0
  341. package/astro/icons/default/IconXCircle.astro +10 -0
  342. package/astro/icons/default/IconXOctagon.astro +10 -0
  343. package/astro/icons/default/IconXSquare.astro +10 -0
  344. package/astro/icons/default/IconYoutube.astro +10 -0
  345. package/astro/icons/default/IconZap.astro +10 -0
  346. package/astro/icons/default/IconZapOff.astro +10 -0
  347. package/astro/icons/default/IconZoomIn.astro +10 -0
  348. package/astro/icons/default/IconZoomOut.astro +10 -0
  349. package/astro/icons/social/IconSocialGoogle.astro +10 -0
  350. package/astro/runtime/package.json +6 -0
  351. package/dist/astro/runtime/elementController.d.ts +6 -0
  352. package/dist/astro/runtime/factories.d.ts +5 -0
  353. package/dist/astro/runtime/index.d.ts +2 -0
  354. package/dist/astro/runtime/index.es.js +68 -0
  355. package/dist/astro/runtime/index.es.js.map +1 -0
  356. package/dist/astro/runtime/types.d.ts +28 -0
  357. package/dist/components/AdBox/index.es.js +1 -1
  358. package/dist/components/Alert/index.es.js +3 -3
  359. package/dist/components/BadgeInfo/index.es.js +2 -2
  360. package/dist/components/BadgeState/index.es.js +2 -2
  361. package/dist/components/Button/index.es.js +2 -2
  362. package/dist/components/Card/Container/index.es.js +26 -0
  363. package/dist/components/Card/Container/index.es.js.map +1 -0
  364. package/dist/components/{Emphasis → Card/Emphasis}/index.es.js +1 -1
  365. package/dist/components/Card/Emphasis/index.es.js.map +1 -0
  366. package/dist/components/Card/Image/index.es.js +18 -0
  367. package/dist/components/Card/Image/index.es.js.map +1 -0
  368. package/dist/components/Card/Root/index.es.js +44 -0
  369. package/dist/components/Card/Root/index.es.js.map +1 -0
  370. package/dist/components/{Tag → Card/Tag}/index.es.js +1 -1
  371. package/dist/components/Card/Tag/index.es.js.map +1 -0
  372. package/dist/components/Card/index.es.js +16 -21
  373. package/dist/components/Card/index.es.js.map +1 -1
  374. package/dist/components/Card/styles.css +1 -1
  375. package/dist/components/Card/styles2.css +1 -0
  376. package/dist/components/Chip/index.es.js +1 -1
  377. package/dist/components/ChipBanner/index.es.js +1 -1
  378. package/dist/components/Container/index.es.js +1 -1
  379. package/dist/components/Divider/index.es.js +1 -1
  380. package/dist/components/Drawer/index.es.js +1 -1
  381. package/dist/components/Field/styles.css +1 -1
  382. package/dist/components/Field/styles2.css +1 -0
  383. package/dist/components/Field/styles3.css +1 -0
  384. package/dist/components/Footer/index.es.js +2 -2
  385. package/dist/components/Footer/styles.css +1 -1
  386. package/dist/components/Group/styles2.css +1 -0
  387. package/dist/components/Header/Actions/index.es.js +22 -0
  388. package/dist/components/Header/Actions/index.es.js.map +1 -0
  389. package/dist/components/Header/Badges/index.es.js +16 -0
  390. package/dist/components/Header/Badges/index.es.js.map +1 -0
  391. package/dist/components/Header/Button/index.es.js +21 -0
  392. package/dist/components/Header/Button/index.es.js.map +1 -0
  393. package/dist/components/Header/Hamburger/index.es.js +29 -0
  394. package/dist/components/Header/Hamburger/index.es.js.map +1 -0
  395. package/dist/components/Header/Logo/index.es.js +30 -0
  396. package/dist/components/Header/Logo/index.es.js.map +1 -0
  397. package/dist/components/Header/Navbar/index.es.js +14 -0
  398. package/dist/components/Header/Navbar/index.es.js.map +1 -0
  399. package/dist/components/Header/NavbarLink/index.es.js +104 -0
  400. package/dist/components/Header/NavbarLink/index.es.js.map +1 -0
  401. package/dist/components/Header/Navigation/index.es.js +11 -0
  402. package/dist/components/Header/Navigation/index.es.js.map +1 -0
  403. package/dist/components/Header/Profile/index.es.js +80 -0
  404. package/dist/components/Header/Profile/index.es.js.map +1 -0
  405. package/dist/components/Header/Wrap/index.es.js +24 -0
  406. package/dist/components/Header/Wrap/index.es.js.map +1 -0
  407. package/dist/components/Header/index.d.ts +9 -9
  408. package/dist/components/Header/index.es.js +11 -290
  409. package/dist/components/Header/index.es.js.map +1 -1
  410. package/dist/components/Icon/index.es.js +1 -1
  411. package/dist/components/Image/index.es.js +1 -1
  412. package/dist/components/IsMobile/index.es.js +1 -1
  413. package/dist/components/LinkButton/index.es.js +1 -1
  414. package/dist/components/Modal/index.es.js +1 -1
  415. package/dist/components/NavbarVertical/index.es.js +2 -2
  416. package/dist/components/NavbarVertical/styles.css +1 -1
  417. package/dist/components/NotificationsBar/index.es.js +1 -1
  418. package/dist/components/PartnerBanner/index.es.js +1 -1
  419. package/dist/components/ProgressBar/index.es.js +2 -2
  420. package/dist/components/{Carousel → Prototype/Carousel}/index.es.js +8 -8
  421. package/dist/components/Prototype/Carousel/index.es.js.map +1 -0
  422. package/dist/components/Skeleton/index.es.js +1 -1
  423. package/dist/components/SpecialButton/index.d.ts +6 -0
  424. package/dist/components/SpecialButton/index.es.js +64 -28
  425. package/dist/components/SpecialButton/index.es.js.map +1 -1
  426. package/dist/components/SpecialButton/styles.css +1 -1
  427. package/dist/components/Spinner/index.es.js +2 -2
  428. package/dist/components/SubHeader/index.es.js +1 -1
  429. package/dist/components/Switch/Card/index.es.js +25 -0
  430. package/dist/components/Switch/Card/index.es.js.map +1 -0
  431. package/dist/components/{Pure → Switch/Pure}/index.es.js +1 -1
  432. package/dist/components/Switch/Pure/index.es.js.map +1 -0
  433. package/dist/components/Tabs/index.es.js +1 -1
  434. package/dist/components/Tabs/styles.css +1 -1
  435. package/dist/components/Text/index.es.js +3 -3
  436. package/dist/components/Tooltip/index.es.js +1 -1
  437. package/dist/components/Transition/index.es.js +1 -1
  438. package/dist/components/form/Checkbox/Field/index.es.js +60 -0
  439. package/dist/components/form/Checkbox/Field/index.es.js.map +1 -0
  440. package/dist/components/{Checkbox → form/Checkbox/Group}/index.es.js +8 -66
  441. package/dist/components/form/Checkbox/Group/index.es.js.map +1 -0
  442. package/dist/components/form/Checkbox/index.es.js +14 -0
  443. package/dist/components/form/Checkbox/index.es.js.map +1 -0
  444. package/dist/components/form/Datepicker/Calendar/index.es.js +10 -0
  445. package/dist/components/form/Datepicker/CalendarHeader/index.es.js +12 -0
  446. package/dist/components/{PortalHolder → form/Datepicker/PortalHolder}/index.es.js +3 -3
  447. package/dist/components/form/Datepicker/PortalHolder/index.es.js.map +1 -0
  448. package/dist/components/form/Datepicker/Segment/index.es.js +12 -0
  449. package/dist/components/{Datepicker → form/Datepicker}/index.es.js +8 -8
  450. package/dist/components/form/Datepicker/index.es.js.map +1 -0
  451. package/dist/components/{EmailField → form/EmailField}/index.es.js +3 -3
  452. package/dist/components/form/EmailField/index.es.js.map +1 -0
  453. package/dist/components/form/Field/ErrorMessage/index.es.js.map +1 -0
  454. package/dist/components/{Input → form/Field/Input}/index.es.js +1 -1
  455. package/dist/components/form/Field/Input/index.es.js.map +1 -0
  456. package/dist/components/form/Field/InputHolder/index.es.js.map +1 -0
  457. package/dist/components/{Label → form/Field/Label}/index.es.js +6 -6
  458. package/dist/components/form/Field/Label/index.es.js.map +1 -0
  459. package/dist/components/form/Field/Message/index.es.js.map +1 -0
  460. package/dist/components/{Root → form/Field/Root}/index.es.js +1 -1
  461. package/dist/components/form/Field/Root/index.es.js.map +1 -0
  462. package/dist/components/{TextArea → form/Field/TextArea}/index.es.js +2 -2
  463. package/dist/components/form/Field/TextArea/index.es.js.map +1 -0
  464. package/dist/components/form/Field/index.es.js +20 -0
  465. package/dist/components/form/Field/index.es.js.map +1 -0
  466. package/dist/components/{InputField → form/InputField}/index.es.js +1 -1
  467. package/dist/components/form/InputField/index.es.js.map +1 -0
  468. package/dist/components/{PasswordField → form/PasswordField}/index.es.js +2 -2
  469. package/dist/components/form/PasswordField/index.es.js.map +1 -0
  470. package/dist/components/{Field → form/Radio/Field}/index.es.js +2 -2
  471. package/dist/components/form/Radio/Field/index.es.js.map +1 -0
  472. package/dist/components/{Group → form/Radio/Group}/index.es.js +5 -5
  473. package/dist/components/form/Radio/Group/index.es.js.map +1 -0
  474. package/dist/components/{Radio → form/Radio}/index.es.js +2 -2
  475. package/dist/components/form/Radio/index.es.js.map +1 -0
  476. package/dist/components/{SelectField → form/SelectField}/index.es.js +13 -13
  477. package/dist/components/form/SelectField/index.es.js.map +1 -0
  478. package/dist/components/{TextareaField → form/TextareaField}/index.es.js +1 -1
  479. package/dist/components/form/TextareaField/index.es.js.map +1 -0
  480. package/dist/components/{TokenField → form/TokenField}/index.es.js +2 -2
  481. package/dist/components/form/TokenField/index.es.js.map +1 -0
  482. package/dist/components/globalStyles/index.es.js +2 -0
  483. package/dist/components/globalStyles/index.es.js.map +1 -0
  484. package/dist/components/globalStyles/styles.css +1 -0
  485. package/dist/components/icons/default/index.es.js +655 -0
  486. package/dist/components/icons/social/index.es.js +5 -0
  487. package/dist/components/index/styles.css +1 -1
  488. package/dist/components/index/styles2.css +1 -1
  489. package/dist/components/index/styles3.css +1 -1
  490. package/dist/components/misc/Conditional/index.es.js.map +1 -0
  491. package/dist/components/misc/DynamicTagComponent/index.es.js.map +1 -0
  492. package/dist/components/{Portal → misc/Portal}/index.es.js +2 -2
  493. package/dist/components/misc/Portal/index.es.js.map +1 -0
  494. package/dist/components/misc/index.es.js +1 -1
  495. package/dist/{index-C6Q03EyZ.js → index-BW2ZU5Hx.js} +2 -30
  496. package/dist/{index-C6Q03EyZ.js.map → index-BW2ZU5Hx.js.map} +1 -1
  497. package/dist/{index-DHwXRotU.js → index-BcC9liUl.js} +6 -6
  498. package/dist/{index-DHwXRotU.js.map → index-BcC9liUl.js.map} +1 -1
  499. package/dist/{index-BgBOcVUP.js → index-CFYmtkje.js} +4 -4
  500. package/dist/{index-BgBOcVUP.js.map → index-CFYmtkje.js.map} +1 -1
  501. package/dist/{index-DnQGzfVW.js → index-CeClo_WS.js} +4 -4
  502. package/dist/{index-DnQGzfVW.js.map → index-CeClo_WS.js.map} +1 -1
  503. package/dist/main.d.ts +1 -1
  504. package/dist/main.es.js +80 -164
  505. package/dist/main.es.js.map +1 -1
  506. package/dist/{tokens-C4yCunfz.js → tokens-C4ypB4bY.js} +64 -64
  507. package/dist/{tokens-C4yCunfz.js.map → tokens-C4ypB4bY.js.map} +1 -1
  508. package/package.json +21 -10
  509. package/dist/components/AdBox/AdBox.test.d.ts +0 -1
  510. package/dist/components/Alert/Alert.test.d.ts +0 -1
  511. package/dist/components/BadgeInfo/BadgeInfo.test.d.ts +0 -1
  512. package/dist/components/BadgeState/BadgeState.test.d.ts +0 -1
  513. package/dist/components/Button/Button.test.d.ts +0 -1
  514. package/dist/components/Calendar/index.es.js +0 -10
  515. package/dist/components/CalendarHeader/index.es.js +0 -12
  516. package/dist/components/Card/Card.test.d.ts +0 -1
  517. package/dist/components/Carousel/index.es.js.map +0 -1
  518. package/dist/components/Checkbox/index.es.js.map +0 -1
  519. package/dist/components/Checkbox/styles.css +0 -1
  520. package/dist/components/ChipBanner/ChipBanner.test.d.ts +0 -1
  521. package/dist/components/Conditional/index.es.js.map +0 -1
  522. package/dist/components/Container/Container.test.d.ts +0 -1
  523. package/dist/components/Datepicker/index.es.js.map +0 -1
  524. package/dist/components/Drawer/Drawer.test.d.ts +0 -1
  525. package/dist/components/DynamicTagComponent/index.es.js.map +0 -1
  526. package/dist/components/EmailField/index.es.js.map +0 -1
  527. package/dist/components/Emphasis/index.es.js.map +0 -1
  528. package/dist/components/ErrorMessage/index.es.js.map +0 -1
  529. package/dist/components/Field/index.es.js.map +0 -1
  530. package/dist/components/Footer/Footer.test.d.ts +0 -1
  531. package/dist/components/Group/index.es.js.map +0 -1
  532. package/dist/components/Header/Header.test.d.ts +0 -1
  533. package/dist/components/Image/Image.test.d.ts +0 -1
  534. package/dist/components/Input/index.es.js.map +0 -1
  535. package/dist/components/InputField/index.es.js.map +0 -1
  536. package/dist/components/InputHolder/index.es.js.map +0 -1
  537. package/dist/components/IsMobile/IsMobile.test.d.ts +0 -1
  538. package/dist/components/Label/index.es.js.map +0 -1
  539. package/dist/components/LazyImage/LazyImage.test.d.ts +0 -1
  540. package/dist/components/LinkButton/LinkButton.test.d.ts +0 -1
  541. package/dist/components/Logo/Logo.test.d.ts +0 -1
  542. package/dist/components/Message/index.es.js.map +0 -1
  543. package/dist/components/Modal/Modal.test.d.ts +0 -1
  544. package/dist/components/NavbarVertical/NavbarVertical.test.d.ts +0 -1
  545. package/dist/components/NotificationsBar/NotificationsBar.test.d.ts +0 -1
  546. package/dist/components/PartnerBanner/PartnerBanner.test.d.ts +0 -1
  547. package/dist/components/PasswordField/index.es.js.map +0 -1
  548. package/dist/components/Portal/index.es.js.map +0 -1
  549. package/dist/components/PortalHolder/index.es.js.map +0 -1
  550. package/dist/components/ProfileNav/ProfileNav.test.d.ts +0 -1
  551. package/dist/components/ProgressBar/ProgressBar.test.d.ts +0 -1
  552. package/dist/components/Prototype/Carousel/Carousel.test.d.ts +0 -1
  553. package/dist/components/Pure/index.es.js.map +0 -1
  554. package/dist/components/Radio/index.es.js.map +0 -1
  555. package/dist/components/Root/index.es.js.map +0 -1
  556. package/dist/components/Segment/index.es.js +0 -12
  557. package/dist/components/SelectField/index.es.js.map +0 -1
  558. package/dist/components/Skeleton/Skeleton.test.d.ts +0 -1
  559. package/dist/components/SpecialButton/SpecialButton.test.d.ts +0 -1
  560. package/dist/components/Spinner/Spinner.test.d.ts +0 -1
  561. package/dist/components/SubHeader/SubHeader.test.d.ts +0 -1
  562. package/dist/components/Switch/Card/Card.test.d.ts +0 -1
  563. package/dist/components/Switch/Pure/Switch.test.d.ts +0 -1
  564. package/dist/components/Tabs/Tabs.test.d.ts +0 -1
  565. package/dist/components/Tag/index.es.js.map +0 -1
  566. package/dist/components/Text/Text.test.d.ts +0 -1
  567. package/dist/components/TextArea/index.es.js.map +0 -1
  568. package/dist/components/TextareaField/index.es.js.map +0 -1
  569. package/dist/components/TokenField/index.es.js.map +0 -1
  570. package/dist/components/Transition/Transition.test.d.ts +0 -1
  571. package/dist/components/dataTestId.test.d.ts +0 -1
  572. package/dist/components/default/index.es.js +0 -655
  573. package/dist/components/form/Checkbox/Checkbox.test.d.ts +0 -1
  574. package/dist/components/form/Datepicker/Datepicker.test.d.ts +0 -1
  575. package/dist/components/form/EmailField/EmailField.test.d.ts +0 -1
  576. package/dist/components/form/Field/Field.test.d.ts +0 -1
  577. package/dist/components/form/InputField/InputField.test.d.ts +0 -1
  578. package/dist/components/form/PasswordField/PasswordField.test.d.ts +0 -1
  579. package/dist/components/form/Radio/Radio.test.d.ts +0 -1
  580. package/dist/components/form/SelectField/SelectField.test.d.ts +0 -1
  581. package/dist/components/form/TextareaField/TextareaField.test.d.ts +0 -1
  582. package/dist/components/form/TokenField/TokenField.test.d.ts +0 -1
  583. package/dist/components/icons/Icon.test/index.es.js +0 -36183
  584. package/dist/components/icons/Icon.test/index.es.js.map +0 -1
  585. package/dist/components/icons/Icon.test.d.ts +0 -1
  586. package/dist/components/index/styles4.css +0 -1
  587. package/dist/components/main/styles.css +0 -1
  588. package/dist/components/misc/misc.test.d.ts +0 -1
  589. package/dist/components/social/index.es.js +0 -5
  590. package/dist/index-ZE6zszxw.js +0 -20
  591. package/dist/index-ZE6zszxw.js.map +0 -1
  592. package/dist/magic-string.es-D_W5SHWE.js +0 -1074
  593. package/dist/magic-string.es-D_W5SHWE.js.map +0 -1
  594. /package/dist/components/Header/{parts/HeaderActions.d.ts → Actions/index.d.ts} +0 -0
  595. /package/dist/components/Header/{parts/HeaderBadges.d.ts → Badges/index.d.ts} +0 -0
  596. /package/dist/components/Header/{parts/HeaderButton.d.ts → Button/index.d.ts} +0 -0
  597. /package/dist/components/Header/{parts/HeaderHamburger.d.ts → Hamburger/index.d.ts} +0 -0
  598. /package/dist/components/Header/{parts/HeaderLogo.d.ts → Logo/index.d.ts} +0 -0
  599. /package/dist/components/Header/{parts/HeaderNavbar.d.ts → Navbar/index.d.ts} +0 -0
  600. /package/dist/components/Header/{parts/HeaderNavbarLink.d.ts → NavbarLink/index.d.ts} +0 -0
  601. /package/dist/components/Header/{parts/HeaderNavigation.d.ts → Navigation/index.d.ts} +0 -0
  602. /package/dist/components/Header/{parts/HeaderProfile.d.ts → Profile/index.d.ts} +0 -0
  603. /package/dist/components/Header/{parts/HeaderWrap.d.ts → Wrap/index.d.ts} +0 -0
  604. /package/dist/components/{Calendar → form/Datepicker/Calendar}/index.es.js.map +0 -0
  605. /package/dist/components/{CalendarHeader → form/Datepicker/CalendarHeader}/index.es.js.map +0 -0
  606. /package/dist/components/{Segment → form/Datepicker/Segment}/index.es.js.map +0 -0
  607. /package/dist/components/{ErrorMessage → form/Field/ErrorMessage}/index.es.js +0 -0
  608. /package/dist/components/{InputHolder → form/Field/InputHolder}/index.es.js +0 -0
  609. /package/dist/components/{Message → form/Field/Message}/index.es.js +0 -0
  610. /package/dist/components/{default → icons/default}/index.es.js.map +0 -0
  611. /package/dist/components/{social → icons/social}/index.es.js.map +0 -0
  612. /package/dist/components/{Conditional → misc/Conditional}/index.es.js +0 -0
  613. /package/dist/components/{DynamicTagComponent → misc/DynamicTagComponent}/index.es.js +0 -0
  614. /package/dist/{components/Tooltip/Tooltip.test.d.ts → core/styles/globalStyles.d.ts} +0 -0
@@ -1,1074 +0,0 @@
1
- var comma = ",".charCodeAt(0);
2
- var semicolon = ";".charCodeAt(0);
3
- var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
4
- var intToChar = new Uint8Array(64);
5
- var charToInt = new Uint8Array(128);
6
- for (let i = 0; i < chars.length; i++) {
7
- const c = chars.charCodeAt(i);
8
- intToChar[i] = c;
9
- charToInt[c] = i;
10
- }
11
- function encodeInteger(builder, num, relative) {
12
- let delta = num - relative;
13
- delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
14
- do {
15
- let clamped = delta & 31;
16
- delta >>>= 5;
17
- if (delta > 0) clamped |= 32;
18
- builder.write(intToChar[clamped]);
19
- } while (delta > 0);
20
- return num;
21
- }
22
- var bufLength = 1024 * 16;
23
- var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
24
- decode(buf) {
25
- const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
26
- return out.toString();
27
- }
28
- } : {
29
- decode(buf) {
30
- let out = "";
31
- for (let i = 0; i < buf.length; i++) {
32
- out += String.fromCharCode(buf[i]);
33
- }
34
- return out;
35
- }
36
- };
37
- var StringWriter = class {
38
- constructor() {
39
- this.pos = 0;
40
- this.out = "";
41
- this.buffer = new Uint8Array(bufLength);
42
- }
43
- write(v) {
44
- const { buffer } = this;
45
- buffer[this.pos++] = v;
46
- if (this.pos === bufLength) {
47
- this.out += td.decode(buffer);
48
- this.pos = 0;
49
- }
50
- }
51
- flush() {
52
- const { buffer, out, pos } = this;
53
- return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
54
- }
55
- };
56
- function encode(decoded) {
57
- const writer = new StringWriter();
58
- let sourcesIndex = 0;
59
- let sourceLine = 0;
60
- let sourceColumn = 0;
61
- let namesIndex = 0;
62
- for (let i = 0; i < decoded.length; i++) {
63
- const line = decoded[i];
64
- if (i > 0) writer.write(semicolon);
65
- if (line.length === 0) continue;
66
- let genColumn = 0;
67
- for (let j = 0; j < line.length; j++) {
68
- const segment = line[j];
69
- if (j > 0) writer.write(comma);
70
- genColumn = encodeInteger(writer, segment[0], genColumn);
71
- if (segment.length === 1) continue;
72
- sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
73
- sourceLine = encodeInteger(writer, segment[2], sourceLine);
74
- sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
75
- if (segment.length === 4) continue;
76
- namesIndex = encodeInteger(writer, segment[4], namesIndex);
77
- }
78
- }
79
- return writer.flush();
80
- }
81
- class BitSet {
82
- constructor(arg) {
83
- this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
84
- }
85
- add(n2) {
86
- this.bits[n2 >> 5] |= 1 << (n2 & 31);
87
- }
88
- has(n2) {
89
- return !!(this.bits[n2 >> 5] & 1 << (n2 & 31));
90
- }
91
- }
92
- class Chunk {
93
- constructor(start, end, content) {
94
- this.start = start;
95
- this.end = end;
96
- this.original = content;
97
- this.intro = "";
98
- this.outro = "";
99
- this.content = content;
100
- this.storeName = false;
101
- this.edited = false;
102
- {
103
- this.previous = null;
104
- this.next = null;
105
- }
106
- }
107
- appendLeft(content) {
108
- this.outro += content;
109
- }
110
- appendRight(content) {
111
- this.intro = this.intro + content;
112
- }
113
- clone() {
114
- const chunk = new Chunk(this.start, this.end, this.original);
115
- chunk.intro = this.intro;
116
- chunk.outro = this.outro;
117
- chunk.content = this.content;
118
- chunk.storeName = this.storeName;
119
- chunk.edited = this.edited;
120
- return chunk;
121
- }
122
- contains(index) {
123
- return this.start < index && index < this.end;
124
- }
125
- eachNext(fn) {
126
- let chunk = this;
127
- while (chunk) {
128
- fn(chunk);
129
- chunk = chunk.next;
130
- }
131
- }
132
- eachPrevious(fn) {
133
- let chunk = this;
134
- while (chunk) {
135
- fn(chunk);
136
- chunk = chunk.previous;
137
- }
138
- }
139
- edit(content, storeName, contentOnly) {
140
- this.content = content;
141
- if (!contentOnly) {
142
- this.intro = "";
143
- this.outro = "";
144
- }
145
- this.storeName = storeName;
146
- this.edited = true;
147
- return this;
148
- }
149
- prependLeft(content) {
150
- this.outro = content + this.outro;
151
- }
152
- prependRight(content) {
153
- this.intro = content + this.intro;
154
- }
155
- reset() {
156
- this.intro = "";
157
- this.outro = "";
158
- if (this.edited) {
159
- this.content = this.original;
160
- this.storeName = false;
161
- this.edited = false;
162
- }
163
- }
164
- split(index) {
165
- const sliceIndex = index - this.start;
166
- const originalBefore = this.original.slice(0, sliceIndex);
167
- const originalAfter = this.original.slice(sliceIndex);
168
- this.original = originalBefore;
169
- const newChunk = new Chunk(index, this.end, originalAfter);
170
- newChunk.outro = this.outro;
171
- this.outro = "";
172
- this.end = index;
173
- if (this.edited) {
174
- newChunk.edit("", false);
175
- this.content = "";
176
- } else {
177
- this.content = originalBefore;
178
- }
179
- newChunk.next = this.next;
180
- if (newChunk.next) newChunk.next.previous = newChunk;
181
- newChunk.previous = this;
182
- this.next = newChunk;
183
- return newChunk;
184
- }
185
- toString() {
186
- return this.intro + this.content + this.outro;
187
- }
188
- trimEnd(rx) {
189
- this.outro = this.outro.replace(rx, "");
190
- if (this.outro.length) return true;
191
- const trimmed = this.content.replace(rx, "");
192
- if (trimmed.length) {
193
- if (trimmed !== this.content) {
194
- this.split(this.start + trimmed.length).edit("", void 0, true);
195
- if (this.edited) {
196
- this.edit(trimmed, this.storeName, true);
197
- }
198
- }
199
- return true;
200
- } else {
201
- this.edit("", void 0, true);
202
- this.intro = this.intro.replace(rx, "");
203
- if (this.intro.length) return true;
204
- }
205
- }
206
- trimStart(rx) {
207
- this.intro = this.intro.replace(rx, "");
208
- if (this.intro.length) return true;
209
- const trimmed = this.content.replace(rx, "");
210
- if (trimmed.length) {
211
- if (trimmed !== this.content) {
212
- const newChunk = this.split(this.end - trimmed.length);
213
- if (this.edited) {
214
- newChunk.edit(trimmed, this.storeName, true);
215
- }
216
- this.edit("", void 0, true);
217
- }
218
- return true;
219
- } else {
220
- this.edit("", void 0, true);
221
- this.outro = this.outro.replace(rx, "");
222
- if (this.outro.length) return true;
223
- }
224
- }
225
- }
226
- function getBtoa() {
227
- if (typeof globalThis !== "undefined" && typeof globalThis.btoa === "function") {
228
- return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
229
- } else if (typeof Buffer === "function") {
230
- return (str) => Buffer.from(str, "utf-8").toString("base64");
231
- } else {
232
- return () => {
233
- throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
234
- };
235
- }
236
- }
237
- const btoa = /* @__PURE__ */ getBtoa();
238
- class SourceMap {
239
- constructor(properties) {
240
- this.version = 3;
241
- this.file = properties.file;
242
- this.sources = properties.sources;
243
- this.sourcesContent = properties.sourcesContent;
244
- this.names = properties.names;
245
- this.mappings = encode(properties.mappings);
246
- if (typeof properties.x_google_ignoreList !== "undefined") {
247
- this.x_google_ignoreList = properties.x_google_ignoreList;
248
- }
249
- if (typeof properties.debugId !== "undefined") {
250
- this.debugId = properties.debugId;
251
- }
252
- }
253
- toString() {
254
- return JSON.stringify(this);
255
- }
256
- toUrl() {
257
- return "data:application/json;charset=utf-8;base64," + btoa(this.toString());
258
- }
259
- }
260
- function guessIndent(code) {
261
- const lines = code.split("\n");
262
- const tabbed = lines.filter((line) => /^\t+/.test(line));
263
- const spaced = lines.filter((line) => /^ {2,}/.test(line));
264
- if (tabbed.length === 0 && spaced.length === 0) {
265
- return null;
266
- }
267
- if (tabbed.length >= spaced.length) {
268
- return " ";
269
- }
270
- const min = spaced.reduce((previous, current) => {
271
- const numSpaces = /^ +/.exec(current)[0].length;
272
- return Math.min(numSpaces, previous);
273
- }, Infinity);
274
- return new Array(min + 1).join(" ");
275
- }
276
- function getRelativePath(from, to) {
277
- const fromParts = from.split(/[/\\]/);
278
- const toParts = to.split(/[/\\]/);
279
- fromParts.pop();
280
- while (fromParts[0] === toParts[0]) {
281
- fromParts.shift();
282
- toParts.shift();
283
- }
284
- if (fromParts.length) {
285
- let i = fromParts.length;
286
- while (i--) fromParts[i] = "..";
287
- }
288
- return fromParts.concat(toParts).join("/");
289
- }
290
- const toString = Object.prototype.toString;
291
- function isObject(thing) {
292
- return toString.call(thing) === "[object Object]";
293
- }
294
- function getLocator(source) {
295
- const originalLines = source.split("\n");
296
- const lineOffsets = [];
297
- for (let i = 0, pos = 0; i < originalLines.length; i++) {
298
- lineOffsets.push(pos);
299
- pos += originalLines[i].length + 1;
300
- }
301
- return function locate(index) {
302
- let i = 0;
303
- let j = lineOffsets.length;
304
- while (i < j) {
305
- const m = i + j >> 1;
306
- if (index < lineOffsets[m]) {
307
- j = m;
308
- } else {
309
- i = m + 1;
310
- }
311
- }
312
- const line = i - 1;
313
- const column = index - lineOffsets[line];
314
- return { line, column };
315
- };
316
- }
317
- const wordRegex = /\w/;
318
- class Mappings {
319
- constructor(hires) {
320
- this.hires = hires;
321
- this.generatedCodeLine = 0;
322
- this.generatedCodeColumn = 0;
323
- this.raw = [];
324
- this.rawSegments = this.raw[this.generatedCodeLine] = [];
325
- this.pending = null;
326
- }
327
- addEdit(sourceIndex, content, loc, nameIndex) {
328
- if (content.length) {
329
- const contentLengthMinusOne = content.length - 1;
330
- let contentLineEnd = content.indexOf("\n", 0);
331
- let previousContentLineEnd = -1;
332
- while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {
333
- const segment2 = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
334
- if (nameIndex >= 0) {
335
- segment2.push(nameIndex);
336
- }
337
- this.rawSegments.push(segment2);
338
- this.generatedCodeLine += 1;
339
- this.raw[this.generatedCodeLine] = this.rawSegments = [];
340
- this.generatedCodeColumn = 0;
341
- previousContentLineEnd = contentLineEnd;
342
- contentLineEnd = content.indexOf("\n", contentLineEnd + 1);
343
- }
344
- const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
345
- if (nameIndex >= 0) {
346
- segment.push(nameIndex);
347
- }
348
- this.rawSegments.push(segment);
349
- this.advance(content.slice(previousContentLineEnd + 1));
350
- } else if (this.pending) {
351
- this.rawSegments.push(this.pending);
352
- this.advance(content);
353
- }
354
- this.pending = null;
355
- }
356
- addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
357
- let originalCharIndex = chunk.start;
358
- let first = true;
359
- let charInHiresBoundary = false;
360
- while (originalCharIndex < chunk.end) {
361
- if (original[originalCharIndex] === "\n") {
362
- loc.line += 1;
363
- loc.column = 0;
364
- this.generatedCodeLine += 1;
365
- this.raw[this.generatedCodeLine] = this.rawSegments = [];
366
- this.generatedCodeColumn = 0;
367
- first = true;
368
- charInHiresBoundary = false;
369
- } else {
370
- if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
371
- const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
372
- if (this.hires === "boundary") {
373
- if (wordRegex.test(original[originalCharIndex])) {
374
- if (!charInHiresBoundary) {
375
- this.rawSegments.push(segment);
376
- charInHiresBoundary = true;
377
- }
378
- } else {
379
- this.rawSegments.push(segment);
380
- charInHiresBoundary = false;
381
- }
382
- } else {
383
- this.rawSegments.push(segment);
384
- }
385
- }
386
- loc.column += 1;
387
- this.generatedCodeColumn += 1;
388
- first = false;
389
- }
390
- originalCharIndex += 1;
391
- }
392
- this.pending = null;
393
- }
394
- advance(str) {
395
- if (!str) return;
396
- const lines = str.split("\n");
397
- if (lines.length > 1) {
398
- for (let i = 0; i < lines.length - 1; i++) {
399
- this.generatedCodeLine++;
400
- this.raw[this.generatedCodeLine] = this.rawSegments = [];
401
- }
402
- this.generatedCodeColumn = 0;
403
- }
404
- this.generatedCodeColumn += lines[lines.length - 1].length;
405
- }
406
- }
407
- const n = "\n";
408
- const warned = {
409
- insertLeft: false,
410
- insertRight: false,
411
- storeName: false
412
- };
413
- class MagicString {
414
- constructor(string, options = {}) {
415
- const chunk = new Chunk(0, string.length, string);
416
- Object.defineProperties(this, {
417
- original: { writable: true, value: string },
418
- outro: { writable: true, value: "" },
419
- intro: { writable: true, value: "" },
420
- firstChunk: { writable: true, value: chunk },
421
- lastChunk: { writable: true, value: chunk },
422
- lastSearchedChunk: { writable: true, value: chunk },
423
- byStart: { writable: true, value: {} },
424
- byEnd: { writable: true, value: {} },
425
- filename: { writable: true, value: options.filename },
426
- indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
427
- sourcemapLocations: { writable: true, value: new BitSet() },
428
- storedNames: { writable: true, value: {} },
429
- indentStr: { writable: true, value: void 0 },
430
- ignoreList: { writable: true, value: options.ignoreList },
431
- offset: { writable: true, value: options.offset || 0 }
432
- });
433
- this.byStart[0] = chunk;
434
- this.byEnd[string.length] = chunk;
435
- }
436
- addSourcemapLocation(char) {
437
- this.sourcemapLocations.add(char);
438
- }
439
- append(content) {
440
- if (typeof content !== "string") throw new TypeError("outro content must be a string");
441
- this.outro += content;
442
- return this;
443
- }
444
- appendLeft(index, content) {
445
- index = index + this.offset;
446
- if (typeof content !== "string") throw new TypeError("inserted content must be a string");
447
- this._split(index);
448
- const chunk = this.byEnd[index];
449
- if (chunk) {
450
- chunk.appendLeft(content);
451
- } else {
452
- this.intro += content;
453
- }
454
- return this;
455
- }
456
- appendRight(index, content) {
457
- index = index + this.offset;
458
- if (typeof content !== "string") throw new TypeError("inserted content must be a string");
459
- this._split(index);
460
- const chunk = this.byStart[index];
461
- if (chunk) {
462
- chunk.appendRight(content);
463
- } else {
464
- this.outro += content;
465
- }
466
- return this;
467
- }
468
- clone() {
469
- const cloned = new MagicString(this.original, { filename: this.filename, offset: this.offset });
470
- let originalChunk = this.firstChunk;
471
- let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
472
- while (originalChunk) {
473
- cloned.byStart[clonedChunk.start] = clonedChunk;
474
- cloned.byEnd[clonedChunk.end] = clonedChunk;
475
- const nextOriginalChunk = originalChunk.next;
476
- const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
477
- if (nextClonedChunk) {
478
- clonedChunk.next = nextClonedChunk;
479
- nextClonedChunk.previous = clonedChunk;
480
- clonedChunk = nextClonedChunk;
481
- }
482
- originalChunk = nextOriginalChunk;
483
- }
484
- cloned.lastChunk = clonedChunk;
485
- if (this.indentExclusionRanges) {
486
- cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
487
- }
488
- cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
489
- cloned.intro = this.intro;
490
- cloned.outro = this.outro;
491
- return cloned;
492
- }
493
- generateDecodedMap(options) {
494
- options = options || {};
495
- const sourceIndex = 0;
496
- const names = Object.keys(this.storedNames);
497
- const mappings = new Mappings(options.hires);
498
- const locate = getLocator(this.original);
499
- if (this.intro) {
500
- mappings.advance(this.intro);
501
- }
502
- this.firstChunk.eachNext((chunk) => {
503
- const loc = locate(chunk.start);
504
- if (chunk.intro.length) mappings.advance(chunk.intro);
505
- if (chunk.edited) {
506
- mappings.addEdit(
507
- sourceIndex,
508
- chunk.content,
509
- loc,
510
- chunk.storeName ? names.indexOf(chunk.original) : -1
511
- );
512
- } else {
513
- mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
514
- }
515
- if (chunk.outro.length) mappings.advance(chunk.outro);
516
- });
517
- if (this.outro) {
518
- mappings.advance(this.outro);
519
- }
520
- return {
521
- file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
522
- sources: [
523
- options.source ? getRelativePath(options.file || "", options.source) : options.file || ""
524
- ],
525
- sourcesContent: options.includeContent ? [this.original] : void 0,
526
- names,
527
- mappings: mappings.raw,
528
- x_google_ignoreList: this.ignoreList ? [sourceIndex] : void 0
529
- };
530
- }
531
- generateMap(options) {
532
- return new SourceMap(this.generateDecodedMap(options));
533
- }
534
- _ensureindentStr() {
535
- if (this.indentStr === void 0) {
536
- this.indentStr = guessIndent(this.original);
537
- }
538
- }
539
- _getRawIndentString() {
540
- this._ensureindentStr();
541
- return this.indentStr;
542
- }
543
- getIndentString() {
544
- this._ensureindentStr();
545
- return this.indentStr === null ? " " : this.indentStr;
546
- }
547
- indent(indentStr, options) {
548
- const pattern = /^[^\r\n]/gm;
549
- if (isObject(indentStr)) {
550
- options = indentStr;
551
- indentStr = void 0;
552
- }
553
- if (indentStr === void 0) {
554
- this._ensureindentStr();
555
- indentStr = this.indentStr || " ";
556
- }
557
- if (indentStr === "") return this;
558
- options = options || {};
559
- const isExcluded = {};
560
- if (options.exclude) {
561
- const exclusions = typeof options.exclude[0] === "number" ? [options.exclude] : options.exclude;
562
- exclusions.forEach((exclusion) => {
563
- for (let i = exclusion[0]; i < exclusion[1]; i += 1) {
564
- isExcluded[i] = true;
565
- }
566
- });
567
- }
568
- let shouldIndentNextCharacter = options.indentStart !== false;
569
- const replacer = (match) => {
570
- if (shouldIndentNextCharacter) return `${indentStr}${match}`;
571
- shouldIndentNextCharacter = true;
572
- return match;
573
- };
574
- this.intro = this.intro.replace(pattern, replacer);
575
- let charIndex = 0;
576
- let chunk = this.firstChunk;
577
- while (chunk) {
578
- const end = chunk.end;
579
- if (chunk.edited) {
580
- if (!isExcluded[charIndex]) {
581
- chunk.content = chunk.content.replace(pattern, replacer);
582
- if (chunk.content.length) {
583
- shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === "\n";
584
- }
585
- }
586
- } else {
587
- charIndex = chunk.start;
588
- while (charIndex < end) {
589
- if (!isExcluded[charIndex]) {
590
- const char = this.original[charIndex];
591
- if (char === "\n") {
592
- shouldIndentNextCharacter = true;
593
- } else if (char !== "\r" && shouldIndentNextCharacter) {
594
- shouldIndentNextCharacter = false;
595
- if (charIndex === chunk.start) {
596
- chunk.prependRight(indentStr);
597
- } else {
598
- this._splitChunk(chunk, charIndex);
599
- chunk = chunk.next;
600
- chunk.prependRight(indentStr);
601
- }
602
- }
603
- }
604
- charIndex += 1;
605
- }
606
- }
607
- charIndex = chunk.end;
608
- chunk = chunk.next;
609
- }
610
- this.outro = this.outro.replace(pattern, replacer);
611
- return this;
612
- }
613
- insert() {
614
- throw new Error(
615
- "magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)"
616
- );
617
- }
618
- insertLeft(index, content) {
619
- if (!warned.insertLeft) {
620
- console.warn(
621
- "magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"
622
- );
623
- warned.insertLeft = true;
624
- }
625
- return this.appendLeft(index, content);
626
- }
627
- insertRight(index, content) {
628
- if (!warned.insertRight) {
629
- console.warn(
630
- "magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"
631
- );
632
- warned.insertRight = true;
633
- }
634
- return this.prependRight(index, content);
635
- }
636
- move(start, end, index) {
637
- start = start + this.offset;
638
- end = end + this.offset;
639
- index = index + this.offset;
640
- if (index >= start && index <= end) throw new Error("Cannot move a selection inside itself");
641
- this._split(start);
642
- this._split(end);
643
- this._split(index);
644
- const first = this.byStart[start];
645
- const last = this.byEnd[end];
646
- const oldLeft = first.previous;
647
- const oldRight = last.next;
648
- const newRight = this.byStart[index];
649
- if (!newRight && last === this.lastChunk) return this;
650
- const newLeft = newRight ? newRight.previous : this.lastChunk;
651
- if (oldLeft) oldLeft.next = oldRight;
652
- if (oldRight) oldRight.previous = oldLeft;
653
- if (newLeft) newLeft.next = first;
654
- if (newRight) newRight.previous = last;
655
- if (!first.previous) this.firstChunk = last.next;
656
- if (!last.next) {
657
- this.lastChunk = first.previous;
658
- this.lastChunk.next = null;
659
- }
660
- first.previous = newLeft;
661
- last.next = newRight || null;
662
- if (!newLeft) this.firstChunk = first;
663
- if (!newRight) this.lastChunk = last;
664
- return this;
665
- }
666
- overwrite(start, end, content, options) {
667
- options = options || {};
668
- return this.update(start, end, content, { ...options, overwrite: !options.contentOnly });
669
- }
670
- update(start, end, content, options) {
671
- start = start + this.offset;
672
- end = end + this.offset;
673
- if (typeof content !== "string") throw new TypeError("replacement content must be a string");
674
- if (this.original.length !== 0) {
675
- while (start < 0) start += this.original.length;
676
- while (end < 0) end += this.original.length;
677
- }
678
- if (end > this.original.length) throw new Error("end is out of bounds");
679
- if (start === end)
680
- throw new Error(
681
- "Cannot overwrite a zero-length range – use appendLeft or prependRight instead"
682
- );
683
- this._split(start);
684
- this._split(end);
685
- if (options === true) {
686
- if (!warned.storeName) {
687
- console.warn(
688
- "The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"
689
- );
690
- warned.storeName = true;
691
- }
692
- options = { storeName: true };
693
- }
694
- const storeName = options !== void 0 ? options.storeName : false;
695
- const overwrite = options !== void 0 ? options.overwrite : false;
696
- if (storeName) {
697
- const original = this.original.slice(start, end);
698
- Object.defineProperty(this.storedNames, original, {
699
- writable: true,
700
- value: true,
701
- enumerable: true
702
- });
703
- }
704
- const first = this.byStart[start];
705
- const last = this.byEnd[end];
706
- if (first) {
707
- let chunk = first;
708
- while (chunk !== last) {
709
- if (chunk.next !== this.byStart[chunk.end]) {
710
- throw new Error("Cannot overwrite across a split point");
711
- }
712
- chunk = chunk.next;
713
- chunk.edit("", false);
714
- }
715
- first.edit(content, storeName, !overwrite);
716
- } else {
717
- const newChunk = new Chunk(start, end, "").edit(content, storeName);
718
- last.next = newChunk;
719
- newChunk.previous = last;
720
- }
721
- return this;
722
- }
723
- prepend(content) {
724
- if (typeof content !== "string") throw new TypeError("outro content must be a string");
725
- this.intro = content + this.intro;
726
- return this;
727
- }
728
- prependLeft(index, content) {
729
- index = index + this.offset;
730
- if (typeof content !== "string") throw new TypeError("inserted content must be a string");
731
- this._split(index);
732
- const chunk = this.byEnd[index];
733
- if (chunk) {
734
- chunk.prependLeft(content);
735
- } else {
736
- this.intro = content + this.intro;
737
- }
738
- return this;
739
- }
740
- prependRight(index, content) {
741
- index = index + this.offset;
742
- if (typeof content !== "string") throw new TypeError("inserted content must be a string");
743
- this._split(index);
744
- const chunk = this.byStart[index];
745
- if (chunk) {
746
- chunk.prependRight(content);
747
- } else {
748
- this.outro = content + this.outro;
749
- }
750
- return this;
751
- }
752
- remove(start, end) {
753
- start = start + this.offset;
754
- end = end + this.offset;
755
- if (this.original.length !== 0) {
756
- while (start < 0) start += this.original.length;
757
- while (end < 0) end += this.original.length;
758
- }
759
- if (start === end) return this;
760
- if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
761
- if (start > end) throw new Error("end must be greater than start");
762
- this._split(start);
763
- this._split(end);
764
- let chunk = this.byStart[start];
765
- while (chunk) {
766
- chunk.intro = "";
767
- chunk.outro = "";
768
- chunk.edit("");
769
- chunk = end > chunk.end ? this.byStart[chunk.end] : null;
770
- }
771
- return this;
772
- }
773
- reset(start, end) {
774
- start = start + this.offset;
775
- end = end + this.offset;
776
- if (this.original.length !== 0) {
777
- while (start < 0) start += this.original.length;
778
- while (end < 0) end += this.original.length;
779
- }
780
- if (start === end) return this;
781
- if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
782
- if (start > end) throw new Error("end must be greater than start");
783
- this._split(start);
784
- this._split(end);
785
- let chunk = this.byStart[start];
786
- while (chunk) {
787
- chunk.reset();
788
- chunk = end > chunk.end ? this.byStart[chunk.end] : null;
789
- }
790
- return this;
791
- }
792
- lastChar() {
793
- if (this.outro.length) return this.outro[this.outro.length - 1];
794
- let chunk = this.lastChunk;
795
- do {
796
- if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
797
- if (chunk.content.length) return chunk.content[chunk.content.length - 1];
798
- if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
799
- } while (chunk = chunk.previous);
800
- if (this.intro.length) return this.intro[this.intro.length - 1];
801
- return "";
802
- }
803
- lastLine() {
804
- let lineIndex = this.outro.lastIndexOf(n);
805
- if (lineIndex !== -1) return this.outro.substr(lineIndex + 1);
806
- let lineStr = this.outro;
807
- let chunk = this.lastChunk;
808
- do {
809
- if (chunk.outro.length > 0) {
810
- lineIndex = chunk.outro.lastIndexOf(n);
811
- if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;
812
- lineStr = chunk.outro + lineStr;
813
- }
814
- if (chunk.content.length > 0) {
815
- lineIndex = chunk.content.lastIndexOf(n);
816
- if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;
817
- lineStr = chunk.content + lineStr;
818
- }
819
- if (chunk.intro.length > 0) {
820
- lineIndex = chunk.intro.lastIndexOf(n);
821
- if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;
822
- lineStr = chunk.intro + lineStr;
823
- }
824
- } while (chunk = chunk.previous);
825
- lineIndex = this.intro.lastIndexOf(n);
826
- if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;
827
- return this.intro + lineStr;
828
- }
829
- slice(start = 0, end = this.original.length - this.offset) {
830
- start = start + this.offset;
831
- end = end + this.offset;
832
- if (this.original.length !== 0) {
833
- while (start < 0) start += this.original.length;
834
- while (end < 0) end += this.original.length;
835
- }
836
- let result = "";
837
- let chunk = this.firstChunk;
838
- while (chunk && (chunk.start > start || chunk.end <= start)) {
839
- if (chunk.start < end && chunk.end >= end) {
840
- return result;
841
- }
842
- chunk = chunk.next;
843
- }
844
- if (chunk && chunk.edited && chunk.start !== start)
845
- throw new Error(`Cannot use replaced character ${start} as slice start anchor.`);
846
- const startChunk = chunk;
847
- while (chunk) {
848
- if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
849
- result += chunk.intro;
850
- }
851
- const containsEnd = chunk.start < end && chunk.end >= end;
852
- if (containsEnd && chunk.edited && chunk.end !== end)
853
- throw new Error(`Cannot use replaced character ${end} as slice end anchor.`);
854
- const sliceStart = startChunk === chunk ? start - chunk.start : 0;
855
- const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
856
- result += chunk.content.slice(sliceStart, sliceEnd);
857
- if (chunk.outro && (!containsEnd || chunk.end === end)) {
858
- result += chunk.outro;
859
- }
860
- if (containsEnd) {
861
- break;
862
- }
863
- chunk = chunk.next;
864
- }
865
- return result;
866
- }
867
- // TODO deprecate this? not really very useful
868
- snip(start, end) {
869
- const clone = this.clone();
870
- clone.remove(0, start);
871
- clone.remove(end, clone.original.length);
872
- return clone;
873
- }
874
- _split(index) {
875
- if (this.byStart[index] || this.byEnd[index]) return;
876
- let chunk = this.lastSearchedChunk;
877
- let previousChunk = chunk;
878
- const searchForward = index > chunk.end;
879
- while (chunk) {
880
- if (chunk.contains(index)) return this._splitChunk(chunk, index);
881
- chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
882
- if (chunk === previousChunk) return;
883
- previousChunk = chunk;
884
- }
885
- }
886
- _splitChunk(chunk, index) {
887
- if (chunk.edited && chunk.content.length) {
888
- const loc = getLocator(this.original)(index);
889
- throw new Error(
890
- `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`
891
- );
892
- }
893
- const newChunk = chunk.split(index);
894
- this.byEnd[index] = chunk;
895
- this.byStart[index] = newChunk;
896
- this.byEnd[newChunk.end] = newChunk;
897
- if (chunk === this.lastChunk) this.lastChunk = newChunk;
898
- this.lastSearchedChunk = chunk;
899
- return true;
900
- }
901
- toString() {
902
- let str = this.intro;
903
- let chunk = this.firstChunk;
904
- while (chunk) {
905
- str += chunk.toString();
906
- chunk = chunk.next;
907
- }
908
- return str + this.outro;
909
- }
910
- isEmpty() {
911
- let chunk = this.firstChunk;
912
- do {
913
- if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim())
914
- return false;
915
- } while (chunk = chunk.next);
916
- return true;
917
- }
918
- length() {
919
- let chunk = this.firstChunk;
920
- let length = 0;
921
- do {
922
- length += chunk.intro.length + chunk.content.length + chunk.outro.length;
923
- } while (chunk = chunk.next);
924
- return length;
925
- }
926
- trimLines() {
927
- return this.trim("[\\r\\n]");
928
- }
929
- trim(charType) {
930
- return this.trimStart(charType).trimEnd(charType);
931
- }
932
- trimEndAborted(charType) {
933
- const rx = new RegExp((charType || "\\s") + "+$");
934
- this.outro = this.outro.replace(rx, "");
935
- if (this.outro.length) return true;
936
- let chunk = this.lastChunk;
937
- do {
938
- const end = chunk.end;
939
- const aborted = chunk.trimEnd(rx);
940
- if (chunk.end !== end) {
941
- if (this.lastChunk === chunk) {
942
- this.lastChunk = chunk.next;
943
- }
944
- this.byEnd[chunk.end] = chunk;
945
- this.byStart[chunk.next.start] = chunk.next;
946
- this.byEnd[chunk.next.end] = chunk.next;
947
- }
948
- if (aborted) return true;
949
- chunk = chunk.previous;
950
- } while (chunk);
951
- return false;
952
- }
953
- trimEnd(charType) {
954
- this.trimEndAborted(charType);
955
- return this;
956
- }
957
- trimStartAborted(charType) {
958
- const rx = new RegExp("^" + (charType || "\\s") + "+");
959
- this.intro = this.intro.replace(rx, "");
960
- if (this.intro.length) return true;
961
- let chunk = this.firstChunk;
962
- do {
963
- const end = chunk.end;
964
- const aborted = chunk.trimStart(rx);
965
- if (chunk.end !== end) {
966
- if (chunk === this.lastChunk) this.lastChunk = chunk.next;
967
- this.byEnd[chunk.end] = chunk;
968
- this.byStart[chunk.next.start] = chunk.next;
969
- this.byEnd[chunk.next.end] = chunk.next;
970
- }
971
- if (aborted) return true;
972
- chunk = chunk.next;
973
- } while (chunk);
974
- return false;
975
- }
976
- trimStart(charType) {
977
- this.trimStartAborted(charType);
978
- return this;
979
- }
980
- hasChanged() {
981
- return this.original !== this.toString();
982
- }
983
- _replaceRegexp(searchValue, replacement) {
984
- function getReplacement(match, str) {
985
- if (typeof replacement === "string") {
986
- return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => {
987
- if (i === "$") return "$";
988
- if (i === "&") return match[0];
989
- const num = +i;
990
- if (num < match.length) return match[+i];
991
- return `$${i}`;
992
- });
993
- } else {
994
- return replacement(...match, match.index, str, match.groups);
995
- }
996
- }
997
- function matchAll(re, str) {
998
- let match;
999
- const matches = [];
1000
- while (match = re.exec(str)) {
1001
- matches.push(match);
1002
- }
1003
- return matches;
1004
- }
1005
- if (searchValue.global) {
1006
- const matches = matchAll(searchValue, this.original);
1007
- matches.forEach((match) => {
1008
- if (match.index != null) {
1009
- const replacement2 = getReplacement(match, this.original);
1010
- if (replacement2 !== match[0]) {
1011
- this.overwrite(match.index, match.index + match[0].length, replacement2);
1012
- }
1013
- }
1014
- });
1015
- } else {
1016
- const match = this.original.match(searchValue);
1017
- if (match && match.index != null) {
1018
- const replacement2 = getReplacement(match, this.original);
1019
- if (replacement2 !== match[0]) {
1020
- this.overwrite(match.index, match.index + match[0].length, replacement2);
1021
- }
1022
- }
1023
- }
1024
- return this;
1025
- }
1026
- _replaceString(string, replacement) {
1027
- const { original } = this;
1028
- const index = original.indexOf(string);
1029
- if (index !== -1) {
1030
- if (typeof replacement === "function") {
1031
- replacement = replacement(string, index, original);
1032
- }
1033
- if (string !== replacement) {
1034
- this.overwrite(index, index + string.length, replacement);
1035
- }
1036
- }
1037
- return this;
1038
- }
1039
- replace(searchValue, replacement) {
1040
- if (typeof searchValue === "string") {
1041
- return this._replaceString(searchValue, replacement);
1042
- }
1043
- return this._replaceRegexp(searchValue, replacement);
1044
- }
1045
- _replaceAllString(string, replacement) {
1046
- const { original } = this;
1047
- const stringLength = string.length;
1048
- for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
1049
- const previous = original.slice(index, index + stringLength);
1050
- let _replacement = replacement;
1051
- if (typeof replacement === "function") {
1052
- _replacement = replacement(previous, index, original);
1053
- }
1054
- if (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement);
1055
- }
1056
- return this;
1057
- }
1058
- replaceAll(searchValue, replacement) {
1059
- if (typeof searchValue === "string") {
1060
- return this._replaceAllString(searchValue, replacement);
1061
- }
1062
- if (!searchValue.global) {
1063
- throw new TypeError(
1064
- "MagicString.prototype.replaceAll called with a non-global RegExp argument"
1065
- );
1066
- }
1067
- return this._replaceRegexp(searchValue, replacement);
1068
- }
1069
- }
1070
- export {
1071
- SourceMap,
1072
- MagicString as default
1073
- };
1074
- //# sourceMappingURL=magic-string.es-D_W5SHWE.js.map