polaris_view_components 1.0.1 → 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 (602) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/icons/polaris/AbandonedCartFilledMajor.svg +1 -0
  3. data/app/assets/icons/polaris/AbandonedCartMajor.svg +1 -1
  4. data/app/assets/icons/polaris/AccessibilityMajor.svg +1 -1
  5. data/app/assets/icons/polaris/ActivitiesMajor.svg +1 -1
  6. data/app/assets/icons/polaris/AddCodeMajor.svg +1 -1
  7. data/app/assets/icons/polaris/AddImageMajor.svg +1 -1
  8. data/app/assets/icons/polaris/AddMajor.svg +1 -1
  9. data/app/assets/icons/polaris/AddNoteMajor.svg +1 -1
  10. data/app/assets/icons/polaris/AddProductMajor.svg +1 -1
  11. data/app/assets/icons/polaris/AdjustMinor.svg +1 -1
  12. data/app/assets/icons/polaris/AffiliateMajor.svg +1 -1
  13. data/app/assets/icons/polaris/AlertMinor.svg +1 -1
  14. data/app/assets/icons/polaris/AnalyticsBarHorizontalMinor.svg +1 -1
  15. data/app/assets/icons/polaris/AnalyticsBarStackedMinor.svg +1 -1
  16. data/app/assets/icons/polaris/AnalyticsCohortMinor.svg +1 -1
  17. data/app/assets/icons/polaris/AnalyticsDonutMinor.svg +1 -1
  18. data/app/assets/icons/polaris/AnalyticsFilledMinor.svg +1 -0
  19. data/app/assets/icons/polaris/AnalyticsFunnelMinor.svg +1 -1
  20. data/app/assets/icons/polaris/AnalyticsLineMinor.svg +1 -1
  21. data/app/assets/icons/polaris/AnalyticsMajor.svg +1 -1
  22. data/app/assets/icons/polaris/AnalyticsMinor.svg +1 -1
  23. data/app/assets/icons/polaris/AnalyticsTableMinor.svg +1 -1
  24. data/app/assets/icons/polaris/AnyClickModelMinor.svg +1 -1
  25. data/app/assets/icons/polaris/AppExtensionMinor.svg +1 -1
  26. data/app/assets/icons/polaris/AppsFilledMajor.svg +1 -0
  27. data/app/assets/icons/polaris/AppsMajor.svg +1 -1
  28. data/app/assets/icons/polaris/AppsMinor.svg +1 -1
  29. data/app/assets/icons/polaris/ArchiveMajor.svg +1 -1
  30. data/app/assets/icons/polaris/ArchiveMinor.svg +1 -1
  31. data/app/assets/icons/polaris/ArrowDownMinor.svg +1 -1
  32. data/app/assets/icons/polaris/ArrowLeftMinor.svg +1 -1
  33. data/app/assets/icons/polaris/ArrowRightMinor.svg +1 -1
  34. data/app/assets/icons/polaris/ArrowUpMinor.svg +1 -1
  35. data/app/assets/icons/polaris/AttachmentFilledMajor.svg +1 -0
  36. data/app/assets/icons/polaris/AttachmentMajor.svg +1 -1
  37. data/app/assets/icons/polaris/AutomationFilledMajor.svg +1 -0
  38. data/app/assets/icons/polaris/AutomationMajor.svg +1 -1
  39. data/app/assets/icons/polaris/BackspaceMajor.svg +1 -1
  40. data/app/assets/icons/polaris/BalanceFilledMajor.svg +1 -0
  41. data/app/assets/icons/polaris/BalanceMajor.svg +1 -1
  42. data/app/assets/icons/polaris/BankFilledMajor.svg +1 -0
  43. data/app/assets/icons/polaris/BankMajor.svg +1 -1
  44. data/app/assets/icons/polaris/BarcodeMajor.svg +1 -1
  45. data/app/assets/icons/polaris/BehaviorFilledMajor.svg +1 -0
  46. data/app/assets/icons/polaris/BehaviorMajor.svg +1 -1
  47. data/app/assets/icons/polaris/BehaviorMinor.svg +1 -1
  48. data/app/assets/icons/polaris/BillingStatementDollarFilledMajor.svg +1 -0
  49. data/app/assets/icons/polaris/BillingStatementDollarMajor.svg +1 -1
  50. data/app/assets/icons/polaris/BillingStatementEuroFilledMajor.svg +1 -0
  51. data/app/assets/icons/polaris/BillingStatementEuroMajor.svg +1 -1
  52. data/app/assets/icons/polaris/BillingStatementPoundFilledMajor.svg +1 -0
  53. data/app/assets/icons/polaris/BillingStatementPoundMajor.svg +1 -1
  54. data/app/assets/icons/polaris/BillingStatementRupeeFilledMajor.svg +1 -0
  55. data/app/assets/icons/polaris/BillingStatementRupeeMajor.svg +1 -1
  56. data/app/assets/icons/polaris/BillingStatementYenFilledMajor.svg +1 -0
  57. data/app/assets/icons/polaris/BillingStatementYenMajor.svg +1 -1
  58. data/app/assets/icons/polaris/BlockMinor.svg +1 -1
  59. data/app/assets/icons/polaris/BlockquoteMajor.svg +1 -1
  60. data/app/assets/icons/polaris/BlogMajor.svg +1 -1
  61. data/app/assets/icons/polaris/BoldMajor.svg +1 -0
  62. data/app/assets/icons/polaris/BoldMinor.svg +1 -0
  63. data/app/assets/icons/polaris/BugMajor.svg +1 -1
  64. data/app/assets/icons/polaris/ButtonCornerPillMajor.svg +1 -1
  65. data/app/assets/icons/polaris/ButtonCornerRoundedMajor.svg +1 -1
  66. data/app/assets/icons/polaris/ButtonCornerSquareMajor.svg +1 -1
  67. data/app/assets/icons/polaris/ButtonMinor.svg +1 -1
  68. data/app/assets/icons/polaris/BuyButtonButtonLayoutMajor.svg +1 -1
  69. data/app/assets/icons/polaris/BuyButtonHorizontalLayoutMajor.svg +1 -1
  70. data/app/assets/icons/polaris/BuyButtonMajor.svg +1 -1
  71. data/app/assets/icons/polaris/BuyButtonVerticalLayoutMajor.svg +1 -1
  72. data/app/assets/icons/polaris/CalendarMajor.svg +1 -1
  73. data/app/assets/icons/polaris/CalendarMinor.svg +1 -1
  74. data/app/assets/icons/polaris/CalendarTickMajor.svg +1 -1
  75. data/app/assets/icons/polaris/CalendarTimeMinor.svg +1 -1
  76. data/app/assets/icons/polaris/CameraMajor.svg +1 -1
  77. data/app/assets/icons/polaris/CancelMajor.svg +1 -1
  78. data/app/assets/icons/polaris/CancelMinor.svg +1 -1
  79. data/app/assets/icons/polaris/CancelSmallMinor.svg +1 -1
  80. data/app/assets/icons/polaris/CapitalFilledMajor.svg +1 -0
  81. data/app/assets/icons/polaris/CapitalMajor.svg +1 -1
  82. data/app/assets/icons/polaris/CapturePaymentMinor.svg +1 -1
  83. data/app/assets/icons/polaris/CardReaderChipMajor.svg +1 -1
  84. data/app/assets/icons/polaris/CardReaderMajor.svg +1 -1
  85. data/app/assets/icons/polaris/CardReaderTapMajor.svg +1 -1
  86. data/app/assets/icons/polaris/CaretDownMinor.svg +1 -1
  87. data/app/assets/icons/polaris/CaretUpMinor.svg +1 -1
  88. data/app/assets/icons/polaris/CartDownFilledMajor.svg +1 -0
  89. data/app/assets/icons/polaris/CartDownMajor.svg +1 -1
  90. data/app/assets/icons/polaris/CartFilledMajor.svg +1 -0
  91. data/app/assets/icons/polaris/CartMajor.svg +1 -1
  92. data/app/assets/icons/polaris/CartUpMajor.svg +1 -1
  93. data/app/assets/icons/polaris/CashDollarFilledMajor.svg +1 -0
  94. data/app/assets/icons/polaris/CashDollarMajor.svg +1 -1
  95. data/app/assets/icons/polaris/CashDollarMinor.svg +1 -1
  96. data/app/assets/icons/polaris/CashEuroMajor.svg +1 -1
  97. data/app/assets/icons/polaris/CashPoundMajor.svg +1 -1
  98. data/app/assets/icons/polaris/CashRupeeMajor.svg +1 -1
  99. data/app/assets/icons/polaris/CashYenMajor.svg +1 -1
  100. data/app/assets/icons/polaris/CategoriesMajor.svg +1 -1
  101. data/app/assets/icons/polaris/ChannelsMajor.svg +1 -1
  102. data/app/assets/icons/polaris/ChatMajor.svg +1 -1
  103. data/app/assets/icons/polaris/ChecklistAlternateMajor.svg +1 -1
  104. data/app/assets/icons/polaris/ChecklistMajor.svg +1 -1
  105. data/app/assets/icons/polaris/CheckoutMajor.svg +1 -1
  106. data/app/assets/icons/polaris/ChevronDownMinor.svg +1 -1
  107. data/app/assets/icons/polaris/ChevronLeftMinor.svg +1 -1
  108. data/app/assets/icons/polaris/ChevronRightMinor.svg +1 -1
  109. data/app/assets/icons/polaris/ChevronUpMinor.svg +1 -1
  110. data/app/assets/icons/polaris/CircleAlertMajor.svg +1 -1
  111. data/app/assets/icons/polaris/CircleCancelMajor.svg +1 -1
  112. data/app/assets/icons/polaris/CircleCancelMinor.svg +1 -1
  113. data/app/assets/icons/polaris/CircleChevronDownMinor.svg +1 -1
  114. data/app/assets/icons/polaris/CircleChevronLeftMinor.svg +1 -1
  115. data/app/assets/icons/polaris/CircleChevronRightMinor.svg +1 -1
  116. data/app/assets/icons/polaris/CircleChevronUpMinor.svg +1 -1
  117. data/app/assets/icons/polaris/CircleDisableMinor.svg +1 -1
  118. data/app/assets/icons/polaris/CircleDisabledMajor.svg +1 -1
  119. data/app/assets/icons/polaris/CircleDotsMajor.svg +1 -1
  120. data/app/assets/icons/polaris/CircleDownMajor.svg +1 -1
  121. data/app/assets/icons/polaris/CircleInformationMajor.svg +1 -1
  122. data/app/assets/icons/polaris/CircleLeftMajor.svg +1 -1
  123. data/app/assets/icons/polaris/CircleMinusMajor.svg +1 -1
  124. data/app/assets/icons/polaris/CircleMinusMinor.svg +1 -1
  125. data/app/assets/icons/polaris/CircleMinusOutlineMinor.svg +1 -1
  126. data/app/assets/icons/polaris/CirclePlusMajor.svg +1 -1
  127. data/app/assets/icons/polaris/CirclePlusMinor.svg +1 -1
  128. data/app/assets/icons/polaris/CirclePlusOutlineMinor.svg +1 -1
  129. data/app/assets/icons/polaris/CircleRightMajor.svg +1 -1
  130. data/app/assets/icons/polaris/CircleTickMajor.svg +1 -1
  131. data/app/assets/icons/polaris/CircleTickMinor.svg +1 -1
  132. data/app/assets/icons/polaris/CircleTickOutlineMinor.svg +1 -1
  133. data/app/assets/icons/polaris/CircleUpMajor.svg +1 -1
  134. data/app/assets/icons/polaris/ClipboardMinor.svg +1 -1
  135. data/app/assets/icons/polaris/ClockMajor.svg +1 -1
  136. data/app/assets/icons/polaris/ClockMinor.svg +1 -1
  137. data/app/assets/icons/polaris/CodeMajor.svg +1 -1
  138. data/app/assets/icons/polaris/CodeMinor.svg +1 -1
  139. data/app/assets/icons/polaris/CollectionReferenceMinor.svg +1 -1
  140. data/app/assets/icons/polaris/CollectionsFilledMajor.svg +1 -0
  141. data/app/assets/icons/polaris/CollectionsMajor.svg +1 -1
  142. data/app/assets/icons/polaris/ColorNoneMinor.svg +1 -1
  143. data/app/assets/icons/polaris/ColorsMajor.svg +1 -1
  144. data/app/assets/icons/polaris/Column1Major.svg +1 -1
  145. data/app/assets/icons/polaris/ColumnWithTextMajor.svg +1 -1
  146. data/app/assets/icons/polaris/Columns2Major.svg +1 -1
  147. data/app/assets/icons/polaris/Columns3Major.svg +1 -1
  148. data/app/assets/icons/polaris/Columns3Minor.svg +1 -1
  149. data/app/assets/icons/polaris/ComposeMajor.svg +1 -1
  150. data/app/assets/icons/polaris/ConfettiMajor.svg +1 -1
  151. data/app/assets/icons/polaris/ConnectMinor.svg +1 -1
  152. data/app/assets/icons/polaris/ContentFilledMinor.svg +1 -0
  153. data/app/assets/icons/polaris/ContentMinor.svg +1 -1
  154. data/app/assets/icons/polaris/ConversationMinor.svg +1 -1
  155. data/app/assets/icons/polaris/CreditCardCancelMajor.svg +1 -1
  156. data/app/assets/icons/polaris/CreditCardMajor.svg +1 -1
  157. data/app/assets/icons/polaris/CreditCardPercentMajor.svg +1 -1
  158. data/app/assets/icons/polaris/CreditCardSecureMajor.svg +1 -1
  159. data/app/assets/icons/polaris/CurrencyConvertMinor.svg +1 -1
  160. data/app/assets/icons/polaris/CustomerMinusMajor.svg +1 -1
  161. data/app/assets/icons/polaris/CustomerPlusMajor.svg +1 -1
  162. data/app/assets/icons/polaris/CustomersFilledMinor.svg +1 -0
  163. data/app/assets/icons/polaris/CustomersMajor.svg +1 -1
  164. data/app/assets/icons/polaris/CustomersMinor.svg +1 -1
  165. data/app/assets/icons/polaris/DataDrivenModelMinor.svg +1 -1
  166. data/app/assets/icons/polaris/DataVisualizationMajor.svg +1 -1
  167. data/app/assets/icons/polaris/DecimalMinor.svg +1 -1
  168. data/app/assets/icons/polaris/DeleteMajor.svg +1 -1
  169. data/app/assets/icons/polaris/DeleteMinor.svg +1 -1
  170. data/app/assets/icons/polaris/DesktopMajor.svg +1 -1
  171. data/app/assets/icons/polaris/DetailedPopUpMajor.svg +1 -1
  172. data/app/assets/icons/polaris/DiamondAlertMajor.svg +1 -1
  173. data/app/assets/icons/polaris/DiamondAlertMinor.svg +1 -1
  174. data/app/assets/icons/polaris/DigitalMediaReceiverMajor.svg +1 -1
  175. data/app/assets/icons/polaris/DiscountAutomaticMajor.svg +1 -1
  176. data/app/assets/icons/polaris/DiscountCodeMajor.svg +1 -1
  177. data/app/assets/icons/polaris/DiscountsFilledMinor.svg +1 -0
  178. data/app/assets/icons/polaris/DiscountsMajor.svg +1 -1
  179. data/app/assets/icons/polaris/DiscountsMinor.svg +1 -1
  180. data/app/assets/icons/polaris/DisputeMinor.svg +1 -1
  181. data/app/assets/icons/polaris/DnsSettingsMajor.svg +1 -1
  182. data/app/assets/icons/polaris/DockFloatingMajor.svg +1 -1
  183. data/app/assets/icons/polaris/DockSideMajor.svg +1 -1
  184. data/app/assets/icons/polaris/DomainNewMajor.svg +1 -1
  185. data/app/assets/icons/polaris/DomainRedirectMinor.svg +1 -1
  186. data/app/assets/icons/polaris/DomainsFilledMajor.svg +1 -0
  187. data/app/assets/icons/polaris/DomainsMajor.svg +1 -1
  188. data/app/assets/icons/polaris/DraftOrdersFilledMajor.svg +1 -0
  189. data/app/assets/icons/polaris/DraftOrdersMajor.svg +1 -1
  190. data/app/assets/icons/polaris/DragDropMajor.svg +1 -1
  191. data/app/assets/icons/polaris/DragHandleMinor.svg +1 -1
  192. data/app/assets/icons/polaris/DropdownMinor.svg +1 -1
  193. data/app/assets/icons/polaris/DuplicateMinor.svg +1 -1
  194. data/app/assets/icons/polaris/DynamicSourceMajor.svg +1 -1
  195. data/app/assets/icons/polaris/DynamicSourceMinor.svg +1 -1
  196. data/app/assets/icons/polaris/EditMajor.svg +1 -1
  197. data/app/assets/icons/polaris/EditMinor.svg +1 -1
  198. data/app/assets/icons/polaris/EmailMajor.svg +1 -1
  199. data/app/assets/icons/polaris/EmailNewsletterMajor.svg +1 -1
  200. data/app/assets/icons/polaris/EmbedMinor.svg +1 -1
  201. data/app/assets/icons/polaris/EnableSelectionMinor.svg +1 -1
  202. data/app/assets/icons/polaris/EnterMajor.svg +1 -1
  203. data/app/assets/icons/polaris/EnvelopeMajor.svg +1 -1
  204. data/app/assets/icons/polaris/ExchangeMajor.svg +1 -1
  205. data/app/assets/icons/polaris/ExistingInventoryMajor.svg +1 -1
  206. data/app/assets/icons/polaris/ExitMajor.svg +1 -1
  207. data/app/assets/icons/polaris/ExploreImagesMajor.svg +1 -1
  208. data/app/assets/icons/polaris/ExportMinor.svg +1 -1
  209. data/app/assets/icons/polaris/ExtendMajor.svg +1 -1
  210. data/app/assets/icons/polaris/ExtendMinor.svg +1 -1
  211. data/app/assets/icons/polaris/ExternalMinor.svg +1 -1
  212. data/app/assets/icons/polaris/ExternalSmallMinor.svg +1 -1
  213. data/app/assets/icons/polaris/EyeDropperMinor.svg +1 -1
  214. data/app/assets/icons/polaris/FacebookMinor.svg +1 -0
  215. data/app/assets/icons/polaris/FaviconMajor.svg +1 -1
  216. data/app/assets/icons/polaris/FavoriteMajor.svg +1 -1
  217. data/app/assets/icons/polaris/FeaturedCollectionMajor.svg +1 -1
  218. data/app/assets/icons/polaris/FeaturedContentMajor.svg +1 -1
  219. data/app/assets/icons/polaris/FileFilledMinor.svg +1 -0
  220. data/app/assets/icons/polaris/FileMinor.svg +1 -1
  221. data/app/assets/icons/polaris/FilterMajor.svg +1 -1
  222. data/app/assets/icons/polaris/FilterMinor.svg +1 -1
  223. data/app/assets/icons/polaris/FinancesMajor.svg +1 -1
  224. data/app/assets/icons/polaris/FinancesMinor.svg +1 -1
  225. data/app/assets/icons/polaris/FirstClickModelMinor.svg +1 -1
  226. data/app/assets/icons/polaris/FirstOrderMajor.svg +1 -1
  227. data/app/assets/icons/polaris/FirstVisitMajor.svg +1 -1
  228. data/app/assets/icons/polaris/FlagMajor.svg +1 -1
  229. data/app/assets/icons/polaris/FlipCameraMajor.svg +1 -1
  230. data/app/assets/icons/polaris/FolderDownMajor.svg +1 -1
  231. data/app/assets/icons/polaris/FolderMajor.svg +1 -1
  232. data/app/assets/icons/polaris/FolderMinusMajor.svg +1 -1
  233. data/app/assets/icons/polaris/FolderPlusMajor.svg +1 -1
  234. data/app/assets/icons/polaris/FolderUpMajor.svg +1 -1
  235. data/app/assets/icons/polaris/FollowUpEmailMajor.svg +1 -1
  236. data/app/assets/icons/polaris/FoodMajor.svg +1 -1
  237. data/app/assets/icons/polaris/FooterMajor.svg +1 -1
  238. data/app/assets/icons/polaris/FormsMajor.svg +1 -1
  239. data/app/assets/icons/polaris/FraudProtectMajor.svg +1 -1
  240. data/app/assets/icons/polaris/FraudProtectMinor.svg +1 -1
  241. data/app/assets/icons/polaris/FraudProtectPendingMajor.svg +1 -1
  242. data/app/assets/icons/polaris/FraudProtectPendingMinor.svg +1 -1
  243. data/app/assets/icons/polaris/FraudProtectUnprotectedMajor.svg +1 -1
  244. data/app/assets/icons/polaris/FraudProtectUnprotectedMinor.svg +1 -1
  245. data/app/assets/icons/polaris/FulfillmentFulfilledMajor.svg +1 -1
  246. data/app/assets/icons/polaris/FulfillmentOnHoldMajor.svg +1 -1
  247. data/app/assets/icons/polaris/GamesConsoleMajor.svg +1 -1
  248. data/app/assets/icons/polaris/GaugeMajor.svg +1 -0
  249. data/app/assets/icons/polaris/GaugeMinor.svg +1 -0
  250. data/app/assets/icons/polaris/GiftCardFilledMinor.svg +1 -0
  251. data/app/assets/icons/polaris/GiftCardMajor.svg +1 -1
  252. data/app/assets/icons/polaris/GiftCardMinor.svg +1 -1
  253. data/app/assets/icons/polaris/GlobeMajor.svg +1 -1
  254. data/app/assets/icons/polaris/GlobeMinor.svg +1 -1
  255. data/app/assets/icons/polaris/GrammarMajor.svg +1 -1
  256. data/app/assets/icons/polaris/HashtagMajor.svg +1 -1
  257. data/app/assets/icons/polaris/HashtagMinor.svg +1 -1
  258. data/app/assets/icons/polaris/HeaderMajor.svg +1 -1
  259. data/app/assets/icons/polaris/HeartMajor.svg +1 -1
  260. data/app/assets/icons/polaris/HideKeyboardMajor.svg +1 -1
  261. data/app/assets/icons/polaris/HideMinor.svg +1 -1
  262. data/app/assets/icons/polaris/HintMajor.svg +1 -1
  263. data/app/assets/icons/polaris/HomeFilledMinor.svg +1 -0
  264. data/app/assets/icons/polaris/HomeMajor.svg +1 -1
  265. data/app/assets/icons/polaris/HomeMinor.svg +1 -1
  266. data/app/assets/icons/polaris/HorizontalDotsMinor.svg +1 -1
  267. data/app/assets/icons/polaris/IconsFilledMajor.svg +1 -0
  268. data/app/assets/icons/polaris/IconsMajor.svg +1 -1
  269. data/app/assets/icons/polaris/IdentityCardFilledMajor.svg +1 -0
  270. data/app/assets/icons/polaris/IdentityCardMajor.svg +1 -1
  271. data/app/assets/icons/polaris/IllustrationMajor.svg +1 -1
  272. data/app/assets/icons/polaris/ImageAltMajor.svg +1 -1
  273. data/app/assets/icons/polaris/ImageAltMinor.svg +1 -1
  274. data/app/assets/icons/polaris/ImageMajor.svg +1 -1
  275. data/app/assets/icons/polaris/ImageWithTextMajor.svg +1 -1
  276. data/app/assets/icons/polaris/ImageWithTextOverlayMajor.svg +1 -1
  277. data/app/assets/icons/polaris/ImagesMajor.svg +1 -1
  278. data/app/assets/icons/polaris/ImportMinor.svg +1 -1
  279. data/app/assets/icons/polaris/ImportStoreMajor.svg +1 -1
  280. data/app/assets/icons/polaris/InactiveLocationMajor.svg +1 -1
  281. data/app/assets/icons/polaris/InactiveLocationMinor.svg +1 -1
  282. data/app/assets/icons/polaris/IncomingMajor.svg +1 -1
  283. data/app/assets/icons/polaris/IndentMajor.svg +1 -0
  284. data/app/assets/icons/polaris/IndentMinor.svg +1 -0
  285. data/app/assets/icons/polaris/InfoMinor.svg +1 -1
  286. data/app/assets/icons/polaris/InsertDynamicSourceMajor.svg +1 -1
  287. data/app/assets/icons/polaris/InsertDynamicSourceMinor.svg +1 -1
  288. data/app/assets/icons/polaris/InstagramMinor.svg +1 -0
  289. data/app/assets/icons/polaris/InstallMinor.svg +1 -1
  290. data/app/assets/icons/polaris/InventoryFilledMajor.svg +1 -0
  291. data/app/assets/icons/polaris/InventoryMajor.svg +1 -1
  292. data/app/assets/icons/polaris/InviteMinor.svg +1 -1
  293. data/app/assets/icons/polaris/IqMajor.svg +1 -1
  294. data/app/assets/icons/polaris/ItalicMajor.svg +1 -0
  295. data/app/assets/icons/polaris/ItalicMinor.svg +1 -0
  296. data/app/assets/icons/polaris/JobsFilledMajor.svg +1 -0
  297. data/app/assets/icons/polaris/JobsMajor.svg +1 -1
  298. data/app/assets/icons/polaris/KeyMajor.svg +1 -1
  299. data/app/assets/icons/polaris/KeyboardMajor.svg +1 -1
  300. data/app/assets/icons/polaris/KeyboardMinor.svg +1 -1
  301. data/app/assets/icons/polaris/LabelPrinterMajor.svg +1 -1
  302. data/app/assets/icons/polaris/LandingPageMajor.svg +1 -1
  303. data/app/assets/icons/polaris/LanguageFilledMinor.svg +1 -0
  304. data/app/assets/icons/polaris/LanguageMinor.svg +1 -1
  305. data/app/assets/icons/polaris/LastClickModelMinor.svg +1 -1
  306. data/app/assets/icons/polaris/LastNonDirectClickModelMinor.svg +1 -1
  307. data/app/assets/icons/polaris/LegalFilledMajor.svg +1 -0
  308. data/app/assets/icons/polaris/LegalMajor.svg +1 -1
  309. data/app/assets/icons/polaris/LinearModelMinor.svg +1 -1
  310. data/app/assets/icons/polaris/LinkMinor.svg +1 -1
  311. data/app/assets/icons/polaris/ListFilledMajor.svg +1 -0
  312. data/app/assets/icons/polaris/ListMajor.svg +1 -1
  313. data/app/assets/icons/polaris/ListMinor.svg +1 -1
  314. data/app/assets/icons/polaris/LiveViewFilledMajor.svg +1 -0
  315. data/app/assets/icons/polaris/LiveViewMajor.svg +1 -1
  316. data/app/assets/icons/polaris/LocationFilledMajor.svg +1 -0
  317. data/app/assets/icons/polaris/LocationMajor.svg +1 -1
  318. data/app/assets/icons/polaris/LocationsMinor.svg +1 -1
  319. data/app/assets/icons/polaris/LockFilledMajor.svg +1 -0
  320. data/app/assets/icons/polaris/LockMajor.svg +1 -1
  321. data/app/assets/icons/polaris/LockMinor.svg +1 -1
  322. data/app/assets/icons/polaris/LogOutMinor.svg +1 -1
  323. data/app/assets/icons/polaris/LogoBlockMajor.svg +1 -1
  324. data/app/assets/icons/polaris/MagicMajor.svg +1 -1
  325. data/app/assets/icons/polaris/MagicMinor.svg +1 -1
  326. data/app/assets/icons/polaris/ManagedStoreMajor.svg +1 -1
  327. data/app/assets/icons/polaris/MarkFulfilledMinor.svg +1 -1
  328. data/app/assets/icons/polaris/MarkPaidMinor.svg +1 -1
  329. data/app/assets/icons/polaris/MarketingFilledMinor.svg +1 -0
  330. data/app/assets/icons/polaris/MarketingMajor.svg +1 -1
  331. data/app/assets/icons/polaris/MarketingMinor.svg +1 -1
  332. data/app/assets/icons/polaris/MarketsFilledMajor.svg +1 -0
  333. data/app/assets/icons/polaris/MarketsMajor.svg +1 -1
  334. data/app/assets/icons/polaris/MaximizeMajor.svg +1 -1
  335. data/app/assets/icons/polaris/MaximizeMinor.svg +1 -1
  336. data/app/assets/icons/polaris/MeasurementMinor.svg +1 -1
  337. data/app/assets/icons/polaris/MentionMajor.svg +1 -1
  338. data/app/assets/icons/polaris/MergeMinor.svg +1 -1
  339. data/app/assets/icons/polaris/MetafieldsFilledMinor.svg +1 -0
  340. data/app/assets/icons/polaris/MetafieldsMajor.svg +1 -1
  341. data/app/assets/icons/polaris/MetafieldsMinor.svg +1 -1
  342. data/app/assets/icons/polaris/MetaobjectMinor.svg +1 -1
  343. data/app/assets/icons/polaris/MetaobjectReferenceMinor.svg +1 -1
  344. data/app/assets/icons/polaris/MicrophoneMajor.svg +1 -1
  345. data/app/assets/icons/polaris/MinimizeMajor.svg +1 -1
  346. data/app/assets/icons/polaris/MinimizeMinor.svg +1 -1
  347. data/app/assets/icons/polaris/MinusMajor.svg +1 -1
  348. data/app/assets/icons/polaris/MinusMinor.svg +1 -1
  349. data/app/assets/icons/polaris/MobileAcceptMajor.svg +1 -1
  350. data/app/assets/icons/polaris/MobileBackArrowMajor.svg +1 -1
  351. data/app/assets/icons/polaris/MobileCancelMajor.svg +1 -1
  352. data/app/assets/icons/polaris/MobileChevronMajor.svg +1 -1
  353. data/app/assets/icons/polaris/MobileHamburgerMajor.svg +1 -1
  354. data/app/assets/icons/polaris/MobileHorizontalDotsMajor.svg +1 -1
  355. data/app/assets/icons/polaris/MobileMajor.svg +1 -1
  356. data/app/assets/icons/polaris/MobilePlusMajor.svg +1 -1
  357. data/app/assets/icons/polaris/MobileVerticalDotsMajor.svg +1 -1
  358. data/app/assets/icons/polaris/MonerisMajor.svg +1 -1
  359. data/app/assets/icons/polaris/MoneyFilledMinor.svg +1 -0
  360. data/app/assets/icons/polaris/MoneyMinor.svg +1 -1
  361. data/app/assets/icons/polaris/NatureMajor.svg +1 -1
  362. data/app/assets/icons/polaris/NavigationMajor.svg +1 -1
  363. data/app/assets/icons/polaris/NoteMajor.svg +1 -1
  364. data/app/assets/icons/polaris/NoteMinor.svg +1 -1
  365. data/app/assets/icons/polaris/NotificationFilledMajor.svg +1 -0
  366. data/app/assets/icons/polaris/NotificationMajor.svg +1 -1
  367. data/app/assets/icons/polaris/OnlineStoreMajor.svg +1 -1
  368. data/app/assets/icons/polaris/OnlineStoreMinor.svg +1 -1
  369. data/app/assets/icons/polaris/OrderStatusMinor.svg +1 -1
  370. data/app/assets/icons/polaris/OrderedListMajor.svg +1 -0
  371. data/app/assets/icons/polaris/OrderedListMinor.svg +1 -0
  372. data/app/assets/icons/polaris/OrdersFilledMinor.svg +1 -0
  373. data/app/assets/icons/polaris/OrdersMajor.svg +1 -1
  374. data/app/assets/icons/polaris/OrdersMinor.svg +1 -1
  375. data/app/assets/icons/polaris/OrganizationMajor.svg +1 -1
  376. data/app/assets/icons/polaris/OutdentMajor.svg +1 -0
  377. data/app/assets/icons/polaris/OutdentMinor.svg +1 -0
  378. data/app/assets/icons/polaris/OutgoingMajor.svg +1 -1
  379. data/app/assets/icons/polaris/PackageFilledMajor.svg +1 -0
  380. data/app/assets/icons/polaris/PackageMajor.svg +1 -1
  381. data/app/assets/icons/polaris/PageDownMajor.svg +1 -1
  382. data/app/assets/icons/polaris/PageMajor.svg +1 -1
  383. data/app/assets/icons/polaris/PageMinusMajor.svg +1 -1
  384. data/app/assets/icons/polaris/PagePlusMajor.svg +1 -1
  385. data/app/assets/icons/polaris/PageReferenceMinor.svg +1 -1
  386. data/app/assets/icons/polaris/PageUpMajor.svg +1 -1
  387. data/app/assets/icons/polaris/PaginationEndMinor.svg +1 -1
  388. data/app/assets/icons/polaris/PaginationStartMinor.svg +1 -1
  389. data/app/assets/icons/polaris/PaintBrushMajor.svg +1 -1
  390. data/app/assets/icons/polaris/PaperCheckMajor.svg +1 -1
  391. data/app/assets/icons/polaris/PaperCheckMinor.svg +1 -1
  392. data/app/assets/icons/polaris/PasskeyFilledMinor.svg +1 -0
  393. data/app/assets/icons/polaris/PasskeyMajor.svg +1 -1
  394. data/app/assets/icons/polaris/PasskeyMinor.svg +1 -1
  395. data/app/assets/icons/polaris/PauseCircleMajor.svg +1 -1
  396. data/app/assets/icons/polaris/PauseMajor.svg +1 -1
  397. data/app/assets/icons/polaris/PauseMinor.svg +1 -1
  398. data/app/assets/icons/polaris/PaymentsFilledMajor.svg +1 -0
  399. data/app/assets/icons/polaris/PaymentsMajor.svg +1 -1
  400. data/app/assets/icons/polaris/PersonalizedTextMajor.svg +1 -1
  401. data/app/assets/icons/polaris/PhoneInMajor.svg +1 -1
  402. data/app/assets/icons/polaris/PhoneMajor.svg +1 -1
  403. data/app/assets/icons/polaris/PhoneOutMajor.svg +1 -1
  404. data/app/assets/icons/polaris/PinMajor.svg +1 -1
  405. data/app/assets/icons/polaris/PinMinor.svg +1 -1
  406. data/app/assets/icons/polaris/PinUnfilledMajor.svg +1 -1
  407. data/app/assets/icons/polaris/PinUnfilledMinor.svg +1 -1
  408. data/app/assets/icons/polaris/PintrestMinor.svg +1 -0
  409. data/app/assets/icons/polaris/PlanFilledMinor.svg +1 -0
  410. data/app/assets/icons/polaris/PlanMajor.svg +1 -1
  411. data/app/assets/icons/polaris/PlanMinor.svg +1 -1
  412. data/app/assets/icons/polaris/PlayCircleMajor.svg +1 -1
  413. data/app/assets/icons/polaris/PlayMajor.svg +1 -1
  414. data/app/assets/icons/polaris/PlayMinor.svg +1 -1
  415. data/app/assets/icons/polaris/PlusMinor.svg +1 -1
  416. data/app/assets/icons/polaris/PointOfSaleMajor.svg +1 -1
  417. data/app/assets/icons/polaris/PopularMajor.svg +1 -1
  418. data/app/assets/icons/polaris/PositionBasedModelMinor.svg +1 -1
  419. data/app/assets/icons/polaris/PriceLookupMinor.svg +1 -1
  420. data/app/assets/icons/polaris/PrintMajor.svg +1 -1
  421. data/app/assets/icons/polaris/PrintMinor.svg +1 -1
  422. data/app/assets/icons/polaris/ProductCostMajor.svg +1 -1
  423. data/app/assets/icons/polaris/ProductReferenceMinor.svg +1 -1
  424. data/app/assets/icons/polaris/ProductReturnsMinor.svg +1 -1
  425. data/app/assets/icons/polaris/ProductsFilledMinor.svg +1 -0
  426. data/app/assets/icons/polaris/ProductsMajor.svg +1 -1
  427. data/app/assets/icons/polaris/ProductsMinor.svg +1 -1
  428. data/app/assets/icons/polaris/ProfileMajor.svg +1 -1
  429. data/app/assets/icons/polaris/ProfileMinor.svg +1 -1
  430. data/app/assets/icons/polaris/PromoteFilledMinor.svg +1 -0
  431. data/app/assets/icons/polaris/PromoteMinor.svg +1 -1
  432. data/app/assets/icons/polaris/QuestionMarkInverseMajor.svg +1 -1
  433. data/app/assets/icons/polaris/QuestionMarkInverseMinor.svg +1 -1
  434. data/app/assets/icons/polaris/QuestionMarkMajor.svg +1 -1
  435. data/app/assets/icons/polaris/QuestionMarkMinor.svg +1 -1
  436. data/app/assets/icons/polaris/QuickSaleMajor.svg +1 -1
  437. data/app/assets/icons/polaris/ReadTimeMinor.svg +1 -1
  438. data/app/assets/icons/polaris/ReceiptMajor.svg +1 -1
  439. data/app/assets/icons/polaris/RecentSearchesMajor.svg +1 -1
  440. data/app/assets/icons/polaris/RedoMajor.svg +1 -1
  441. data/app/assets/icons/polaris/ReferralCodeMajor.svg +1 -1
  442. data/app/assets/icons/polaris/ReferralMajor.svg +1 -1
  443. data/app/assets/icons/polaris/RefreshMajor.svg +1 -1
  444. data/app/assets/icons/polaris/RefreshMinor.svg +1 -1
  445. data/app/assets/icons/polaris/RefundMajor.svg +1 -1
  446. data/app/assets/icons/polaris/RefundMinor.svg +1 -1
  447. data/app/assets/icons/polaris/RemoveProductMajor.svg +1 -1
  448. data/app/assets/icons/polaris/RepeatOrderMajor.svg +1 -1
  449. data/app/assets/icons/polaris/ReplaceMajor.svg +1 -1
  450. data/app/assets/icons/polaris/ReplayMinor.svg +1 -1
  451. data/app/assets/icons/polaris/ReportFilledMinor.svg +1 -0
  452. data/app/assets/icons/polaris/ReportMinor.svg +1 -1
  453. data/app/assets/icons/polaris/ReportsMajor.svg +1 -1
  454. data/app/assets/icons/polaris/ResetMinor.svg +1 -1
  455. data/app/assets/icons/polaris/ResourcesMajor.svg +1 -1
  456. data/app/assets/icons/polaris/ReturnMinor.svg +1 -1
  457. data/app/assets/icons/polaris/ReturnsMajor.svg +1 -1
  458. data/app/assets/icons/polaris/RichTextMinor.svg +1 -1
  459. data/app/assets/icons/polaris/RiskMajor.svg +1 -1
  460. data/app/assets/icons/polaris/RiskMinor.svg +1 -1
  461. data/app/assets/icons/polaris/Rows2Major.svg +1 -1
  462. data/app/assets/icons/polaris/SandboxMajor.svg +1 -1
  463. data/app/assets/icons/polaris/SaveMinor.svg +1 -1
  464. data/app/assets/icons/polaris/SearchMajor.svg +1 -1
  465. data/app/assets/icons/polaris/SearchMinor.svg +1 -1
  466. data/app/assets/icons/polaris/SectionMajor.svg +1 -1
  467. data/app/assets/icons/polaris/SecureMajor.svg +1 -1
  468. data/app/assets/icons/polaris/SelectMinor.svg +1 -1
  469. data/app/assets/icons/polaris/SendMajor.svg +1 -1
  470. data/app/assets/icons/polaris/SettingsFilledMinor.svg +1 -0
  471. data/app/assets/icons/polaris/SettingsMajor.svg +1 -1
  472. data/app/assets/icons/polaris/SettingsMinor.svg +1 -1
  473. data/app/assets/icons/polaris/ShareIosMinor.svg +1 -1
  474. data/app/assets/icons/polaris/ShareMinor.svg +1 -1
  475. data/app/assets/icons/polaris/ShipmentFilledMajor.svg +1 -0
  476. data/app/assets/icons/polaris/ShipmentMajor.svg +1 -1
  477. data/app/assets/icons/polaris/ShopcodesMajor.svg +1 -1
  478. data/app/assets/icons/polaris/SidebarLeftMajor.svg +1 -1
  479. data/app/assets/icons/polaris/SidebarRightMajor.svg +1 -1
  480. data/app/assets/icons/polaris/SidekickMajor.svg +1 -0
  481. data/app/assets/icons/polaris/SimplifyMajor.svg +1 -1
  482. data/app/assets/icons/polaris/SimplifyMinor.svg +1 -1
  483. data/app/assets/icons/polaris/SlideshowMajor.svg +1 -1
  484. data/app/assets/icons/polaris/SmileyHappyMajor.svg +1 -1
  485. data/app/assets/icons/polaris/SmileyJoyMajor.svg +1 -1
  486. data/app/assets/icons/polaris/SmileyNeutralMajor.svg +1 -1
  487. data/app/assets/icons/polaris/SmileySadMajor.svg +1 -1
  488. data/app/assets/icons/polaris/SnapchatMinor.svg +1 -0
  489. data/app/assets/icons/polaris/SocialAdMajor.svg +1 -1
  490. data/app/assets/icons/polaris/SocialPostMajor.svg +1 -1
  491. data/app/assets/icons/polaris/SoftPackMajor.svg +1 -1
  492. data/app/assets/icons/polaris/SortAscendingMajor.svg +1 -1
  493. data/app/assets/icons/polaris/SortDescendingMajor.svg +1 -1
  494. data/app/assets/icons/polaris/SortMinor.svg +1 -1
  495. data/app/assets/icons/polaris/SoundMajor.svg +1 -1
  496. data/app/assets/icons/polaris/StarFilledMinor.svg +1 -1
  497. data/app/assets/icons/polaris/StarOutlineMinor.svg +1 -1
  498. data/app/assets/icons/polaris/StatusActiveMajor.svg +1 -1
  499. data/app/assets/icons/polaris/StopMajor.svg +1 -0
  500. data/app/assets/icons/polaris/StoreDetailsFilledMinor.svg +1 -0
  501. data/app/assets/icons/polaris/StoreDetailsMinor.svg +1 -0
  502. data/app/assets/icons/polaris/StoreFilledMinor.svg +1 -0
  503. data/app/assets/icons/polaris/StoreMajor.svg +1 -1
  504. data/app/assets/icons/polaris/StoreMinor.svg +1 -1
  505. data/app/assets/icons/polaris/StoreStatusMajor.svg +1 -1
  506. data/app/assets/icons/polaris/TabletMajor.svg +1 -1
  507. data/app/assets/icons/polaris/TapChipMajor.svg +1 -1
  508. data/app/assets/icons/polaris/TaxFilledMajor.svg +1 -0
  509. data/app/assets/icons/polaris/TaxMajor.svg +1 -1
  510. data/app/assets/icons/polaris/TeamMajor.svg +1 -1
  511. data/app/assets/icons/polaris/TemplateMajor.svg +1 -1
  512. data/app/assets/icons/polaris/TemplateMinor.svg +1 -1
  513. data/app/assets/icons/polaris/TextAlignmentCenterMajor.svg +1 -1
  514. data/app/assets/icons/polaris/TextAlignmentLeftMajor.svg +1 -1
  515. data/app/assets/icons/polaris/TextAlignmentRightMajor.svg +1 -1
  516. data/app/assets/icons/polaris/TextBlockMajor.svg +1 -1
  517. data/app/assets/icons/polaris/TextColorMajor.svg +1 -0
  518. data/app/assets/icons/polaris/TextColorMinor.svg +1 -0
  519. data/app/assets/icons/polaris/TextMajor.svg +1 -1
  520. data/app/assets/icons/polaris/ThemeEditMajor.svg +1 -1
  521. data/app/assets/icons/polaris/ThemeStoreMajor.svg +1 -1
  522. data/app/assets/icons/polaris/ThemesMajor.svg +1 -1
  523. data/app/assets/icons/polaris/ThumbsDownMajor.svg +1 -1
  524. data/app/assets/icons/polaris/ThumbsDownMinor.svg +1 -1
  525. data/app/assets/icons/polaris/ThumbsUpMajor.svg +1 -1
  526. data/app/assets/icons/polaris/ThumbsUpMinor.svg +1 -1
  527. data/app/assets/icons/polaris/TickMinor.svg +1 -1
  528. data/app/assets/icons/polaris/TickSmallMinor.svg +1 -1
  529. data/app/assets/icons/polaris/TiktokMinor.svg +1 -0
  530. data/app/assets/icons/polaris/TimeDecayModelMinor.svg +1 -1
  531. data/app/assets/icons/polaris/TimelineAttachmentMajor.svg +1 -1
  532. data/app/assets/icons/polaris/TipsMajor.svg +1 -1
  533. data/app/assets/icons/polaris/TitleMinor.svg +1 -1
  534. data/app/assets/icons/polaris/ToggleMinor.svg +1 -1
  535. data/app/assets/icons/polaris/ToolsMajor.svg +1 -1
  536. data/app/assets/icons/polaris/TransactionFeeDollarMajor.svg +1 -1
  537. data/app/assets/icons/polaris/TransactionFeeEuroMajor.svg +1 -1
  538. data/app/assets/icons/polaris/TransactionFeePoundMajor.svg +1 -1
  539. data/app/assets/icons/polaris/TransactionFeeRupeeMajor.svg +1 -1
  540. data/app/assets/icons/polaris/TransactionFeeYenMajor.svg +1 -1
  541. data/app/assets/icons/polaris/TransactionMajor.svg +1 -1
  542. data/app/assets/icons/polaris/TransferFilledMajor.svg +1 -0
  543. data/app/assets/icons/polaris/TransferInMajor.svg +1 -1
  544. data/app/assets/icons/polaris/TransferMajor.svg +1 -1
  545. data/app/assets/icons/polaris/TransferOutMajor.svg +1 -1
  546. data/app/assets/icons/polaris/TransferWithinShopifyMajor.svg +1 -1
  547. data/app/assets/icons/polaris/TranslateMajor.svg +1 -0
  548. data/app/assets/icons/polaris/TransportMajor.svg +1 -1
  549. data/app/assets/icons/polaris/TroubleshootMajor.svg +1 -1
  550. data/app/assets/icons/polaris/TumblrMinor.svg +1 -0
  551. data/app/assets/icons/polaris/TwitchMinor.svg +1 -0
  552. data/app/assets/icons/polaris/TwitterMinor.svg +1 -0
  553. data/app/assets/icons/polaris/TypeMajor.svg +1 -1
  554. data/app/assets/icons/polaris/TypeMinor.svg +1 -1
  555. data/app/assets/icons/polaris/UnderlineMajor.svg +1 -0
  556. data/app/assets/icons/polaris/UnderlineMinor.svg +1 -0
  557. data/app/assets/icons/polaris/UndoMajor.svg +1 -1
  558. data/app/assets/icons/polaris/UnfulfilledMajor.svg +1 -1
  559. data/app/assets/icons/polaris/UnknownDeviceMajor.svg +1 -1
  560. data/app/assets/icons/polaris/UpdateInventoryMajor.svg +1 -1
  561. data/app/assets/icons/polaris/UploadMajor.svg +1 -1
  562. data/app/assets/icons/polaris/VariantMajor.svg +1 -1
  563. data/app/assets/icons/polaris/ViewMajor.svg +1 -1
  564. data/app/assets/icons/polaris/ViewMinor.svg +1 -1
  565. data/app/assets/icons/polaris/ViewportNarrowMajor.svg +1 -1
  566. data/app/assets/icons/polaris/ViewportShortMajor.svg +1 -1
  567. data/app/assets/icons/polaris/ViewportTallMajor.svg +1 -1
  568. data/app/assets/icons/polaris/ViewportWideMajor.svg +1 -1
  569. data/app/assets/icons/polaris/VimeoMinor.svg +1 -0
  570. data/app/assets/icons/polaris/VocabularyMajor.svg +1 -1
  571. data/app/assets/icons/polaris/VolumeMinor.svg +1 -1
  572. data/app/assets/icons/polaris/WandMajor.svg +1 -1
  573. data/app/assets/icons/polaris/WandMinor.svg +1 -1
  574. data/app/assets/icons/polaris/WearableMajor.svg +1 -1
  575. data/app/assets/icons/polaris/WeightMinor.svg +1 -1
  576. data/app/assets/icons/polaris/WholesaleMajor.svg +1 -1
  577. data/app/assets/icons/polaris/WifiMajor.svg +1 -1
  578. data/app/assets/icons/polaris/YoutubeMinor.svg +1 -0
  579. data/app/assets/javascripts/polaris_view_components/index.js +4 -1
  580. data/app/assets/javascripts/polaris_view_components/popover_controller.js +50 -29
  581. data/app/assets/javascripts/polaris_view_components/tooltip_controller.js +67 -0
  582. data/app/assets/javascripts/polaris_view_components.js +1113 -1269
  583. data/app/assets/stylesheets/polaris_view_components/custom.pcss +45 -16
  584. data/app/assets/stylesheets/polaris_view_components/shopify_navigation.pcss +8 -8
  585. data/app/assets/stylesheets/polaris_view_components/tooltip_component.pcss +31 -0
  586. data/app/assets/stylesheets/polaris_view_components.css +1543 -680
  587. data/app/assets/stylesheets/polaris_view_components.pcss +1 -0
  588. data/app/components/polaris/autocomplete_component.rb +1 -0
  589. data/app/components/polaris/avatar_component.html.erb +1 -1
  590. data/app/components/polaris/filters_component.html.erb +7 -7
  591. data/app/components/polaris/filters_component.rb +5 -5
  592. data/app/components/polaris/frame/top_bar_component.html.erb +46 -22
  593. data/app/components/polaris/frame/top_bar_component.rb +0 -1
  594. data/app/components/polaris/popover_component.html.erb +2 -8
  595. data/app/components/polaris/popover_component.rb +6 -3
  596. data/app/components/polaris/select_component.html.erb +2 -2
  597. data/app/components/polaris/select_component.rb +58 -4
  598. data/app/components/polaris/tooltip_component.html.erb +9 -0
  599. data/app/components/polaris/tooltip_component.rb +33 -0
  600. data/app/helpers/polaris/view_helper.rb +1 -0
  601. data/lib/polaris/view_components/version.rb +1 -1
  602. metadata +92 -3
@@ -159,7 +159,7 @@ function isEmpty(str) {
159
159
  return str.length === 0 || !str.trim();
160
160
  }
161
161
 
162
- function debounce$1(fn, wait) {
162
+ function debounce(fn, wait) {
163
163
  let timeoutId;
164
164
  return (...args) => {
165
165
  clearTimeout(timeoutId);
@@ -210,7 +210,7 @@ class Autocomplete extends Controller {
210
210
  if (this.hasHiddenInputTarget) this.hiddenInputTarget.value = input.value;
211
211
  }
212
212
  }
213
- onInputChange=debounce$1((() => {
213
+ onInputChange=debounce((() => {
214
214
  if (this.isRemote) {
215
215
  this.fetchResults();
216
216
  } else {
@@ -431,7 +431,7 @@ class Dropzone extends Controller {
431
431
  event.preventDefault();
432
432
  this.onClick();
433
433
  };
434
- onWindowResize=debounce$1((() => {
434
+ onWindowResize=debounce((() => {
435
435
  const size = this.calculateSize();
436
436
  if (size !== this.size) {
437
437
  this.size = size;
@@ -890,1228 +890,999 @@ class Polaris extends Controller {
890
890
  }
891
891
  }
892
892
 
893
- var top = "top";
893
+ const min = Math.min;
894
894
 
895
- var bottom = "bottom";
895
+ const max = Math.max;
896
896
 
897
- var right = "right";
897
+ const round = Math.round;
898
898
 
899
- var left = "left";
899
+ const floor = Math.floor;
900
900
 
901
- var auto = "auto";
902
-
903
- var basePlacements = [ top, bottom, right, left ];
904
-
905
- var start = "start";
906
-
907
- var end = "end";
908
-
909
- var clippingParents = "clippingParents";
910
-
911
- var viewport = "viewport";
912
-
913
- var popper = "popper";
914
-
915
- var reference = "reference";
916
-
917
- var variationPlacements = basePlacements.reduce((function(acc, placement) {
918
- return acc.concat([ placement + "-" + start, placement + "-" + end ]);
919
- }), []);
920
-
921
- var placements = [].concat(basePlacements, [ auto ]).reduce((function(acc, placement) {
922
- return acc.concat([ placement, placement + "-" + start, placement + "-" + end ]);
923
- }), []);
924
-
925
- var beforeRead = "beforeRead";
926
-
927
- var read = "read";
928
-
929
- var afterRead = "afterRead";
930
-
931
- var beforeMain = "beforeMain";
932
-
933
- var main = "main";
934
-
935
- var afterMain = "afterMain";
936
-
937
- var beforeWrite = "beforeWrite";
938
-
939
- var write = "write";
940
-
941
- var afterWrite = "afterWrite";
942
-
943
- var modifierPhases = [ beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite ];
901
+ const createCoords = v => ({
902
+ x: v,
903
+ y: v
904
+ });
944
905
 
945
- function getNodeName(element) {
946
- return element ? (element.nodeName || "").toLowerCase() : null;
947
- }
906
+ const oppositeSideMap = {
907
+ left: "right",
908
+ right: "left",
909
+ bottom: "top",
910
+ top: "bottom"
911
+ };
948
912
 
949
- function getWindow(node) {
950
- if (node == null) {
951
- return window;
952
- }
953
- if (node.toString() !== "[object Window]") {
954
- var ownerDocument = node.ownerDocument;
955
- return ownerDocument ? ownerDocument.defaultView || window : window;
956
- }
957
- return node;
958
- }
913
+ const oppositeAlignmentMap = {
914
+ start: "end",
915
+ end: "start"
916
+ };
959
917
 
960
- function isElement(node) {
961
- var OwnElement = getWindow(node).Element;
962
- return node instanceof OwnElement || node instanceof Element;
918
+ function clamp(start, value, end) {
919
+ return max(start, min(value, end));
963
920
  }
964
921
 
965
- function isHTMLElement(node) {
966
- var OwnElement = getWindow(node).HTMLElement;
967
- return node instanceof OwnElement || node instanceof HTMLElement;
922
+ function evaluate(value, param) {
923
+ return typeof value === "function" ? value(param) : value;
968
924
  }
969
925
 
970
- function isShadowRoot(node) {
971
- if (typeof ShadowRoot === "undefined") {
972
- return false;
973
- }
974
- var OwnElement = getWindow(node).ShadowRoot;
975
- return node instanceof OwnElement || node instanceof ShadowRoot;
926
+ function getSide(placement) {
927
+ return placement.split("-")[0];
976
928
  }
977
929
 
978
- function applyStyles(_ref) {
979
- var state = _ref.state;
980
- Object.keys(state.elements).forEach((function(name) {
981
- var style = state.styles[name] || {};
982
- var attributes = state.attributes[name] || {};
983
- var element = state.elements[name];
984
- if (!isHTMLElement(element) || !getNodeName(element)) {
985
- return;
986
- }
987
- Object.assign(element.style, style);
988
- Object.keys(attributes).forEach((function(name) {
989
- var value = attributes[name];
990
- if (value === false) {
991
- element.removeAttribute(name);
992
- } else {
993
- element.setAttribute(name, value === true ? "" : value);
994
- }
995
- }));
996
- }));
930
+ function getAlignment(placement) {
931
+ return placement.split("-")[1];
997
932
  }
998
933
 
999
- function effect$2(_ref2) {
1000
- var state = _ref2.state;
1001
- var initialStyles = {
1002
- popper: {
1003
- position: state.options.strategy,
1004
- left: "0",
1005
- top: "0",
1006
- margin: "0"
1007
- },
1008
- arrow: {
1009
- position: "absolute"
1010
- },
1011
- reference: {}
1012
- };
1013
- Object.assign(state.elements.popper.style, initialStyles.popper);
1014
- state.styles = initialStyles;
1015
- if (state.elements.arrow) {
1016
- Object.assign(state.elements.arrow.style, initialStyles.arrow);
1017
- }
1018
- return function() {
1019
- Object.keys(state.elements).forEach((function(name) {
1020
- var element = state.elements[name];
1021
- var attributes = state.attributes[name] || {};
1022
- var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
1023
- var style = styleProperties.reduce((function(style, property) {
1024
- style[property] = "";
1025
- return style;
1026
- }), {});
1027
- if (!isHTMLElement(element) || !getNodeName(element)) {
1028
- return;
1029
- }
1030
- Object.assign(element.style, style);
1031
- Object.keys(attributes).forEach((function(attribute) {
1032
- element.removeAttribute(attribute);
1033
- }));
1034
- }));
1035
- };
934
+ function getOppositeAxis(axis) {
935
+ return axis === "x" ? "y" : "x";
1036
936
  }
1037
937
 
1038
- var applyStyles$1 = {
1039
- name: "applyStyles",
1040
- enabled: true,
1041
- phase: "write",
1042
- fn: applyStyles,
1043
- effect: effect$2,
1044
- requires: [ "computeStyles" ]
1045
- };
1046
-
1047
- function getBasePlacement(placement) {
1048
- return placement.split("-")[0];
938
+ function getAxisLength(axis) {
939
+ return axis === "y" ? "height" : "width";
1049
940
  }
1050
941
 
1051
- var max = Math.max;
1052
-
1053
- var min = Math.min;
1054
-
1055
- var round = Math.round;
1056
-
1057
- function getUAString() {
1058
- var uaData = navigator.userAgentData;
1059
- if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
1060
- return uaData.brands.map((function(item) {
1061
- return item.brand + "/" + item.version;
1062
- })).join(" ");
1063
- }
1064
- return navigator.userAgent;
942
+ function getSideAxis(placement) {
943
+ return [ "top", "bottom" ].includes(getSide(placement)) ? "y" : "x";
1065
944
  }
1066
945
 
1067
- function isLayoutViewport() {
1068
- return !/^((?!chrome|android).)*safari/i.test(getUAString());
946
+ function getAlignmentAxis(placement) {
947
+ return getOppositeAxis(getSideAxis(placement));
1069
948
  }
1070
949
 
1071
- function getBoundingClientRect(element, includeScale, isFixedStrategy) {
1072
- if (includeScale === void 0) {
1073
- includeScale = false;
950
+ function getAlignmentSides(placement, rects, rtl) {
951
+ if (rtl === void 0) {
952
+ rtl = false;
1074
953
  }
1075
- if (isFixedStrategy === void 0) {
1076
- isFixedStrategy = false;
954
+ const alignment = getAlignment(placement);
955
+ const alignmentAxis = getAlignmentAxis(placement);
956
+ const length = getAxisLength(alignmentAxis);
957
+ let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
958
+ if (rects.reference[length] > rects.floating[length]) {
959
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
1077
960
  }
1078
- var clientRect = element.getBoundingClientRect();
1079
- var scaleX = 1;
1080
- var scaleY = 1;
1081
- if (includeScale && isHTMLElement(element)) {
1082
- scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
1083
- scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
1084
- }
1085
- var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
1086
- var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
1087
- var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
1088
- var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
1089
- var width = clientRect.width / scaleX;
1090
- var height = clientRect.height / scaleY;
1091
- return {
1092
- width: width,
1093
- height: height,
1094
- top: y,
1095
- right: x + width,
1096
- bottom: y + height,
1097
- left: x,
1098
- x: x,
1099
- y: y
1100
- };
961
+ return [ mainAlignmentSide, getOppositePlacement(mainAlignmentSide) ];
1101
962
  }
1102
963
 
1103
- function getLayoutRect(element) {
1104
- var clientRect = getBoundingClientRect(element);
1105
- var width = element.offsetWidth;
1106
- var height = element.offsetHeight;
1107
- if (Math.abs(clientRect.width - width) <= 1) {
1108
- width = clientRect.width;
1109
- }
1110
- if (Math.abs(clientRect.height - height) <= 1) {
1111
- height = clientRect.height;
1112
- }
1113
- return {
1114
- x: element.offsetLeft,
1115
- y: element.offsetTop,
1116
- width: width,
1117
- height: height
1118
- };
964
+ function getExpandedPlacements(placement) {
965
+ const oppositePlacement = getOppositePlacement(placement);
966
+ return [ getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement) ];
1119
967
  }
1120
968
 
1121
- function contains(parent, child) {
1122
- var rootNode = child.getRootNode && child.getRootNode();
1123
- if (parent.contains(child)) {
1124
- return true;
1125
- } else if (rootNode && isShadowRoot(rootNode)) {
1126
- var next = child;
1127
- do {
1128
- if (next && parent.isSameNode(next)) {
1129
- return true;
1130
- }
1131
- next = next.parentNode || next.host;
1132
- } while (next);
1133
- }
1134
- return false;
969
+ function getOppositeAlignmentPlacement(placement) {
970
+ return placement.replace(/start|end/g, (alignment => oppositeAlignmentMap[alignment]));
1135
971
  }
1136
972
 
1137
- function getComputedStyle$1(element) {
1138
- return getWindow(element).getComputedStyle(element);
1139
- }
973
+ function getSideList(side, isStart, rtl) {
974
+ const lr = [ "left", "right" ];
975
+ const rl = [ "right", "left" ];
976
+ const tb = [ "top", "bottom" ];
977
+ const bt = [ "bottom", "top" ];
978
+ switch (side) {
979
+ case "top":
980
+ case "bottom":
981
+ if (rtl) return isStart ? rl : lr;
982
+ return isStart ? lr : rl;
1140
983
 
1141
- function isTableElement(element) {
1142
- return [ "table", "td", "th" ].indexOf(getNodeName(element)) >= 0;
1143
- }
984
+ case "left":
985
+ case "right":
986
+ return isStart ? tb : bt;
1144
987
 
1145
- function getDocumentElement(element) {
1146
- return ((isElement(element) ? element.ownerDocument : element.document) || window.document).documentElement;
1147
- }
1148
-
1149
- function getParentNode(element) {
1150
- if (getNodeName(element) === "html") {
1151
- return element;
1152
- }
1153
- return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element);
1154
- }
1155
-
1156
- function getTrueOffsetParent(element) {
1157
- if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
1158
- return null;
988
+ default:
989
+ return [];
1159
990
  }
1160
- return element.offsetParent;
1161
991
  }
1162
992
 
1163
- function getContainingBlock(element) {
1164
- var isFirefox = /firefox/i.test(getUAString());
1165
- var isIE = /Trident/i.test(getUAString());
1166
- if (isIE && isHTMLElement(element)) {
1167
- var elementCss = getComputedStyle$1(element);
1168
- if (elementCss.position === "fixed") {
1169
- return null;
1170
- }
1171
- }
1172
- var currentNode = getParentNode(element);
1173
- if (isShadowRoot(currentNode)) {
1174
- currentNode = currentNode.host;
1175
- }
1176
- while (isHTMLElement(currentNode) && [ "html", "body" ].indexOf(getNodeName(currentNode)) < 0) {
1177
- var css = getComputedStyle$1(currentNode);
1178
- if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || [ "transform", "perspective" ].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
1179
- return currentNode;
1180
- } else {
1181
- currentNode = currentNode.parentNode;
993
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
994
+ const alignment = getAlignment(placement);
995
+ let list = getSideList(getSide(placement), direction === "start", rtl);
996
+ if (alignment) {
997
+ list = list.map((side => side + "-" + alignment));
998
+ if (flipAlignment) {
999
+ list = list.concat(list.map(getOppositeAlignmentPlacement));
1182
1000
  }
1183
1001
  }
1184
- return null;
1185
- }
1186
-
1187
- function getOffsetParent(element) {
1188
- var window = getWindow(element);
1189
- var offsetParent = getTrueOffsetParent(element);
1190
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === "static") {
1191
- offsetParent = getTrueOffsetParent(offsetParent);
1192
- }
1193
- if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$1(offsetParent).position === "static")) {
1194
- return window;
1195
- }
1196
- return offsetParent || getContainingBlock(element) || window;
1197
- }
1198
-
1199
- function getMainAxisFromPlacement(placement) {
1200
- return [ "top", "bottom" ].indexOf(placement) >= 0 ? "x" : "y";
1201
- }
1202
-
1203
- function within(min$1, value, max$1) {
1204
- return max(min$1, min(value, max$1));
1002
+ return list;
1205
1003
  }
1206
1004
 
1207
- function withinMaxClamp(min, value, max) {
1208
- var v = within(min, value, max);
1209
- return v > max ? max : v;
1005
+ function getOppositePlacement(placement) {
1006
+ return placement.replace(/left|right|bottom|top/g, (side => oppositeSideMap[side]));
1210
1007
  }
1211
1008
 
1212
- function getFreshSideObject() {
1009
+ function expandPaddingObject(padding) {
1213
1010
  return {
1214
1011
  top: 0,
1215
1012
  right: 0,
1216
1013
  bottom: 0,
1217
- left: 0
1014
+ left: 0,
1015
+ ...padding
1218
1016
  };
1219
1017
  }
1220
1018
 
1221
- function mergePaddingObject(paddingObject) {
1222
- return Object.assign({}, getFreshSideObject(), paddingObject);
1019
+ function getPaddingObject(padding) {
1020
+ return typeof padding !== "number" ? expandPaddingObject(padding) : {
1021
+ top: padding,
1022
+ right: padding,
1023
+ bottom: padding,
1024
+ left: padding
1025
+ };
1223
1026
  }
1224
1027
 
1225
- function expandToHashMap(value, keys) {
1226
- return keys.reduce((function(hashMap, key) {
1227
- hashMap[key] = value;
1228
- return hashMap;
1229
- }), {});
1028
+ function rectToClientRect(rect) {
1029
+ return {
1030
+ ...rect,
1031
+ top: rect.y,
1032
+ left: rect.x,
1033
+ right: rect.x + rect.width,
1034
+ bottom: rect.y + rect.height
1035
+ };
1230
1036
  }
1231
1037
 
1232
- var toPaddingObject = function toPaddingObject(padding, state) {
1233
- padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, {
1234
- placement: state.placement
1235
- })) : padding;
1236
- return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
1237
- };
1038
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
1039
+ let {reference: reference, floating: floating} = _ref;
1040
+ const sideAxis = getSideAxis(placement);
1041
+ const alignmentAxis = getAlignmentAxis(placement);
1042
+ const alignLength = getAxisLength(alignmentAxis);
1043
+ const side = getSide(placement);
1044
+ const isVertical = sideAxis === "y";
1045
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
1046
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
1047
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
1048
+ let coords;
1049
+ switch (side) {
1050
+ case "top":
1051
+ coords = {
1052
+ x: commonX,
1053
+ y: reference.y - floating.height
1054
+ };
1055
+ break;
1238
1056
 
1239
- function arrow(_ref) {
1240
- var _state$modifiersData$;
1241
- var state = _ref.state, name = _ref.name, options = _ref.options;
1242
- var arrowElement = state.elements.arrow;
1243
- var popperOffsets = state.modifiersData.popperOffsets;
1244
- var basePlacement = getBasePlacement(state.placement);
1245
- var axis = getMainAxisFromPlacement(basePlacement);
1246
- var isVertical = [ left, right ].indexOf(basePlacement) >= 0;
1247
- var len = isVertical ? "height" : "width";
1248
- if (!arrowElement || !popperOffsets) {
1249
- return;
1250
- }
1251
- var paddingObject = toPaddingObject(options.padding, state);
1252
- var arrowRect = getLayoutRect(arrowElement);
1253
- var minProp = axis === "y" ? top : left;
1254
- var maxProp = axis === "y" ? bottom : right;
1255
- var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
1256
- var startDiff = popperOffsets[axis] - state.rects.reference[axis];
1257
- var arrowOffsetParent = getOffsetParent(arrowElement);
1258
- var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
1259
- var centerToReference = endDiff / 2 - startDiff / 2;
1260
- var min = paddingObject[minProp];
1261
- var max = clientSize - arrowRect[len] - paddingObject[maxProp];
1262
- var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
1263
- var offset = within(min, center, max);
1264
- var axisProp = axis;
1265
- state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset,
1266
- _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
1267
- }
1268
-
1269
- function effect$1(_ref2) {
1270
- var state = _ref2.state, options = _ref2.options;
1271
- var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
1272
- if (arrowElement == null) {
1273
- return;
1274
- }
1275
- if (typeof arrowElement === "string") {
1276
- arrowElement = state.elements.popper.querySelector(arrowElement);
1277
- if (!arrowElement) {
1278
- return;
1279
- }
1280
- }
1281
- if (!contains(state.elements.popper, arrowElement)) {
1282
- return;
1283
- }
1284
- state.elements.arrow = arrowElement;
1285
- }
1057
+ case "bottom":
1058
+ coords = {
1059
+ x: commonX,
1060
+ y: reference.y + reference.height
1061
+ };
1062
+ break;
1286
1063
 
1287
- var arrow$1 = {
1288
- name: "arrow",
1289
- enabled: true,
1290
- phase: "main",
1291
- fn: arrow,
1292
- effect: effect$1,
1293
- requires: [ "popperOffsets" ],
1294
- requiresIfExists: [ "preventOverflow" ]
1295
- };
1064
+ case "right":
1065
+ coords = {
1066
+ x: reference.x + reference.width,
1067
+ y: commonY
1068
+ };
1069
+ break;
1296
1070
 
1297
- function getVariation(placement) {
1298
- return placement.split("-")[1];
1299
- }
1071
+ case "left":
1072
+ coords = {
1073
+ x: reference.x - floating.width,
1074
+ y: commonY
1075
+ };
1076
+ break;
1300
1077
 
1301
- var unsetSides = {
1302
- top: "auto",
1303
- right: "auto",
1304
- bottom: "auto",
1305
- left: "auto"
1306
- };
1078
+ default:
1079
+ coords = {
1080
+ x: reference.x,
1081
+ y: reference.y
1082
+ };
1083
+ }
1084
+ switch (getAlignment(placement)) {
1085
+ case "start":
1086
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
1087
+ break;
1307
1088
 
1308
- function roundOffsetsByDPR(_ref, win) {
1309
- var x = _ref.x, y = _ref.y;
1310
- var dpr = win.devicePixelRatio || 1;
1311
- return {
1312
- x: round(x * dpr) / dpr || 0,
1313
- y: round(y * dpr) / dpr || 0
1314
- };
1089
+ case "end":
1090
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
1091
+ break;
1092
+ }
1093
+ return coords;
1315
1094
  }
1316
1095
 
1317
- function mapToStyles(_ref2) {
1318
- var _Object$assign2;
1319
- var popper = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
1320
- var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y;
1321
- var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
1322
- x: x,
1323
- y: y
1324
- }) : {
1325
- x: x,
1326
- y: y
1327
- };
1328
- x = _ref3.x;
1329
- y = _ref3.y;
1330
- var hasX = offsets.hasOwnProperty("x");
1331
- var hasY = offsets.hasOwnProperty("y");
1332
- var sideX = left;
1333
- var sideY = top;
1334
- var win = window;
1335
- if (adaptive) {
1336
- var offsetParent = getOffsetParent(popper);
1337
- var heightProp = "clientHeight";
1338
- var widthProp = "clientWidth";
1339
- if (offsetParent === getWindow(popper)) {
1340
- offsetParent = getDocumentElement(popper);
1341
- if (getComputedStyle$1(offsetParent).position !== "static" && position === "absolute") {
1342
- heightProp = "scrollHeight";
1343
- widthProp = "scrollWidth";
1096
+ const computePosition$1 = async (reference, floating, config) => {
1097
+ const {placement: placement = "bottom", strategy: strategy = "absolute", middleware: middleware = [], platform: platform} = config;
1098
+ const validMiddleware = middleware.filter(Boolean);
1099
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
1100
+ let rects = await platform.getElementRects({
1101
+ reference: reference,
1102
+ floating: floating,
1103
+ strategy: strategy
1104
+ });
1105
+ let {x: x, y: y} = computeCoordsFromPlacement(rects, placement, rtl);
1106
+ let statefulPlacement = placement;
1107
+ let middlewareData = {};
1108
+ let resetCount = 0;
1109
+ for (let i = 0; i < validMiddleware.length; i++) {
1110
+ const {name: name, fn: fn} = validMiddleware[i];
1111
+ const {x: nextX, y: nextY, data: data, reset: reset} = await fn({
1112
+ x: x,
1113
+ y: y,
1114
+ initialPlacement: placement,
1115
+ placement: statefulPlacement,
1116
+ strategy: strategy,
1117
+ middlewareData: middlewareData,
1118
+ rects: rects,
1119
+ platform: platform,
1120
+ elements: {
1121
+ reference: reference,
1122
+ floating: floating
1344
1123
  }
1345
- }
1346
- offsetParent = offsetParent;
1347
- if (placement === top || (placement === left || placement === right) && variation === end) {
1348
- sideY = bottom;
1349
- var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp];
1350
- y -= offsetY - popperRect.height;
1351
- y *= gpuAcceleration ? 1 : -1;
1352
- }
1353
- if (placement === left || (placement === top || placement === bottom) && variation === end) {
1354
- sideX = right;
1355
- var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp];
1356
- x -= offsetX - popperRect.width;
1357
- x *= gpuAcceleration ? 1 : -1;
1124
+ });
1125
+ x = nextX != null ? nextX : x;
1126
+ y = nextY != null ? nextY : y;
1127
+ middlewareData = {
1128
+ ...middlewareData,
1129
+ [name]: {
1130
+ ...middlewareData[name],
1131
+ ...data
1132
+ }
1133
+ };
1134
+ if (reset && resetCount <= 50) {
1135
+ resetCount++;
1136
+ if (typeof reset === "object") {
1137
+ if (reset.placement) {
1138
+ statefulPlacement = reset.placement;
1139
+ }
1140
+ if (reset.rects) {
1141
+ rects = reset.rects === true ? await platform.getElementRects({
1142
+ reference: reference,
1143
+ floating: floating,
1144
+ strategy: strategy
1145
+ }) : reset.rects;
1146
+ }
1147
+ ({x: x, y: y} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
1148
+ }
1149
+ i = -1;
1150
+ continue;
1358
1151
  }
1359
1152
  }
1360
- var commonStyles = Object.assign({
1361
- position: position
1362
- }, adaptive && unsetSides);
1363
- var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
1153
+ return {
1364
1154
  x: x,
1365
- y: y
1366
- }, getWindow(popper)) : {
1155
+ y: y,
1156
+ placement: statefulPlacement,
1157
+ strategy: strategy,
1158
+ middlewareData: middlewareData
1159
+ };
1160
+ };
1161
+
1162
+ async function detectOverflow(state, options) {
1163
+ var _await$platform$isEle;
1164
+ if (options === void 0) {
1165
+ options = {};
1166
+ }
1167
+ const {x: x, y: y, platform: platform, rects: rects, elements: elements, strategy: strategy} = state;
1168
+ const {boundary: boundary = "clippingAncestors", rootBoundary: rootBoundary = "viewport", elementContext: elementContext = "floating", altBoundary: altBoundary = false, padding: padding = 0} = evaluate(options, state);
1169
+ const paddingObject = getPaddingObject(padding);
1170
+ const altContext = elementContext === "floating" ? "reference" : "floating";
1171
+ const element = elements[altBoundary ? altContext : elementContext];
1172
+ const clippingClientRect = rectToClientRect(await platform.getClippingRect({
1173
+ element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating)),
1174
+ boundary: boundary,
1175
+ rootBoundary: rootBoundary,
1176
+ strategy: strategy
1177
+ }));
1178
+ const rect = elementContext === "floating" ? {
1179
+ ...rects.floating,
1367
1180
  x: x,
1368
1181
  y: y
1182
+ } : rects.reference;
1183
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
1184
+ const offsetScale = await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)) ? await (platform.getScale == null ? void 0 : platform.getScale(offsetParent)) || {
1185
+ x: 1,
1186
+ y: 1
1187
+ } : {
1188
+ x: 1,
1189
+ y: 1
1369
1190
  };
1370
- x = _ref4.x;
1371
- y = _ref4.y;
1372
- if (gpuAcceleration) {
1373
- var _Object$assign;
1374
- return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "",
1375
- _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)",
1376
- _Object$assign));
1377
- }
1378
- return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "",
1379
- _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
1380
- }
1381
-
1382
- function computeStyles(_ref5) {
1383
- var state = _ref5.state, options = _ref5.options;
1384
- var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
1385
- var commonStyles = {
1386
- placement: getBasePlacement(state.placement),
1387
- variation: getVariation(state.placement),
1388
- popper: state.elements.popper,
1389
- popperRect: state.rects.popper,
1390
- gpuAcceleration: gpuAcceleration,
1391
- isFixed: state.options.strategy === "fixed"
1191
+ const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
1192
+ rect: rect,
1193
+ offsetParent: offsetParent,
1194
+ strategy: strategy
1195
+ }) : rect);
1196
+ return {
1197
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
1198
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
1199
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
1200
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
1392
1201
  };
1393
- if (state.modifiersData.popperOffsets != null) {
1394
- state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
1395
- offsets: state.modifiersData.popperOffsets,
1396
- position: state.options.strategy,
1397
- adaptive: adaptive,
1398
- roundOffsets: roundOffsets
1399
- })));
1400
- }
1401
- if (state.modifiersData.arrow != null) {
1402
- state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
1403
- offsets: state.modifiersData.arrow,
1404
- position: "absolute",
1405
- adaptive: false,
1406
- roundOffsets: roundOffsets
1407
- })));
1408
- }
1409
- state.attributes.popper = Object.assign({}, state.attributes.popper, {
1410
- "data-popper-placement": state.placement
1411
- });
1412
1202
  }
1413
1203
 
1414
- var computeStyles$1 = {
1415
- name: "computeStyles",
1416
- enabled: true,
1417
- phase: "beforeWrite",
1418
- fn: computeStyles,
1419
- data: {}
1420
- };
1421
-
1422
- var passive = {
1423
- passive: true
1424
- };
1425
-
1426
- function effect(_ref) {
1427
- var state = _ref.state, instance = _ref.instance, options = _ref.options;
1428
- var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
1429
- var window = getWindow(state.elements.popper);
1430
- var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
1431
- if (scroll) {
1432
- scrollParents.forEach((function(scrollParent) {
1433
- scrollParent.addEventListener("scroll", instance.update, passive);
1434
- }));
1204
+ const arrow = options => ({
1205
+ name: "arrow",
1206
+ options: options,
1207
+ async fn(state) {
1208
+ const {x: x, y: y, placement: placement, rects: rects, platform: platform, elements: elements, middlewareData: middlewareData} = state;
1209
+ const {element: element, padding: padding = 0} = evaluate(options, state) || {};
1210
+ if (element == null) {
1211
+ return {};
1212
+ }
1213
+ const paddingObject = getPaddingObject(padding);
1214
+ const coords = {
1215
+ x: x,
1216
+ y: y
1217
+ };
1218
+ const axis = getAlignmentAxis(placement);
1219
+ const length = getAxisLength(axis);
1220
+ const arrowDimensions = await platform.getDimensions(element);
1221
+ const isYAxis = axis === "y";
1222
+ const minProp = isYAxis ? "top" : "left";
1223
+ const maxProp = isYAxis ? "bottom" : "right";
1224
+ const clientProp = isYAxis ? "clientHeight" : "clientWidth";
1225
+ const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
1226
+ const startDiff = coords[axis] - rects.reference[axis];
1227
+ const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
1228
+ let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
1229
+ if (!clientSize || !await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent))) {
1230
+ clientSize = elements.floating[clientProp] || rects.floating[length];
1231
+ }
1232
+ const centerToReference = endDiff / 2 - startDiff / 2;
1233
+ const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
1234
+ const minPadding = min(paddingObject[minProp], largestPossiblePadding);
1235
+ const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
1236
+ const min$1 = minPadding;
1237
+ const max = clientSize - arrowDimensions[length] - maxPadding;
1238
+ const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
1239
+ const offset = clamp(min$1, center, max);
1240
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
1241
+ const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
1242
+ return {
1243
+ [axis]: coords[axis] + alignmentOffset,
1244
+ data: {
1245
+ [axis]: offset,
1246
+ centerOffset: center - offset - alignmentOffset,
1247
+ ...shouldAddOffset && {
1248
+ alignmentOffset: alignmentOffset
1249
+ }
1250
+ },
1251
+ reset: shouldAddOffset
1252
+ };
1435
1253
  }
1436
- if (resize) {
1437
- window.addEventListener("resize", instance.update, passive);
1254
+ });
1255
+
1256
+ const flip = function(options) {
1257
+ if (options === void 0) {
1258
+ options = {};
1438
1259
  }
1439
- return function() {
1440
- if (scroll) {
1441
- scrollParents.forEach((function(scrollParent) {
1442
- scrollParent.removeEventListener("scroll", instance.update, passive);
1443
- }));
1444
- }
1445
- if (resize) {
1446
- window.removeEventListener("resize", instance.update, passive);
1260
+ return {
1261
+ name: "flip",
1262
+ options: options,
1263
+ async fn(state) {
1264
+ var _middlewareData$arrow, _middlewareData$flip;
1265
+ const {placement: placement, middlewareData: middlewareData, rects: rects, initialPlacement: initialPlacement, platform: platform, elements: elements} = state;
1266
+ const {mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy: fallbackStrategy = "bestFit", fallbackAxisSideDirection: fallbackAxisSideDirection = "none", flipAlignment: flipAlignment = true, ...detectOverflowOptions} = evaluate(options, state);
1267
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
1268
+ return {};
1269
+ }
1270
+ const side = getSide(placement);
1271
+ const isBasePlacement = getSide(initialPlacement) === initialPlacement;
1272
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
1273
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [ getOppositePlacement(initialPlacement) ] : getExpandedPlacements(initialPlacement));
1274
+ if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") {
1275
+ fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
1276
+ }
1277
+ const placements = [ initialPlacement, ...fallbackPlacements ];
1278
+ const overflow = await detectOverflow(state, detectOverflowOptions);
1279
+ const overflows = [];
1280
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
1281
+ if (checkMainAxis) {
1282
+ overflows.push(overflow[side]);
1283
+ }
1284
+ if (checkCrossAxis) {
1285
+ const sides = getAlignmentSides(placement, rects, rtl);
1286
+ overflows.push(overflow[sides[0]], overflow[sides[1]]);
1287
+ }
1288
+ overflowsData = [ ...overflowsData, {
1289
+ placement: placement,
1290
+ overflows: overflows
1291
+ } ];
1292
+ if (!overflows.every((side => side <= 0))) {
1293
+ var _middlewareData$flip2, _overflowsData$filter;
1294
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
1295
+ const nextPlacement = placements[nextIndex];
1296
+ if (nextPlacement) {
1297
+ return {
1298
+ data: {
1299
+ index: nextIndex,
1300
+ overflows: overflowsData
1301
+ },
1302
+ reset: {
1303
+ placement: nextPlacement
1304
+ }
1305
+ };
1306
+ }
1307
+ let resetPlacement = (_overflowsData$filter = overflowsData.filter((d => d.overflows[0] <= 0)).sort(((a, b) => a.overflows[1] - b.overflows[1]))[0]) == null ? void 0 : _overflowsData$filter.placement;
1308
+ if (!resetPlacement) {
1309
+ switch (fallbackStrategy) {
1310
+ case "bestFit":
1311
+ {
1312
+ var _overflowsData$map$so;
1313
+ const placement = (_overflowsData$map$so = overflowsData.map((d => [ d.placement, d.overflows.filter((overflow => overflow > 0)).reduce(((acc, overflow) => acc + overflow), 0) ])).sort(((a, b) => a[1] - b[1]))[0]) == null ? void 0 : _overflowsData$map$so[0];
1314
+ if (placement) {
1315
+ resetPlacement = placement;
1316
+ }
1317
+ break;
1318
+ }
1319
+
1320
+ case "initialPlacement":
1321
+ resetPlacement = initialPlacement;
1322
+ break;
1323
+ }
1324
+ }
1325
+ if (placement !== resetPlacement) {
1326
+ return {
1327
+ reset: {
1328
+ placement: resetPlacement
1329
+ }
1330
+ };
1331
+ }
1332
+ }
1333
+ return {};
1447
1334
  }
1448
1335
  };
1449
- }
1450
-
1451
- var eventListeners = {
1452
- name: "eventListeners",
1453
- enabled: true,
1454
- phase: "write",
1455
- fn: function fn() {},
1456
- effect: effect,
1457
- data: {}
1458
- };
1459
-
1460
- var hash$1 = {
1461
- left: "right",
1462
- right: "left",
1463
- bottom: "top",
1464
- top: "bottom"
1465
1336
  };
1466
1337
 
1467
- function getOppositePlacement(placement) {
1468
- return placement.replace(/left|right|bottom|top/g, (function(matched) {
1469
- return hash$1[matched];
1470
- }));
1471
- }
1472
-
1473
- var hash = {
1474
- start: "end",
1475
- end: "start"
1476
- };
1477
-
1478
- function getOppositeVariationPlacement(placement) {
1479
- return placement.replace(/start|end/g, (function(matched) {
1480
- return hash[matched];
1481
- }));
1482
- }
1483
-
1484
- function getWindowScroll(node) {
1485
- var win = getWindow(node);
1486
- var scrollLeft = win.pageXOffset;
1487
- var scrollTop = win.pageYOffset;
1488
- return {
1489
- scrollLeft: scrollLeft,
1490
- scrollTop: scrollTop
1338
+ async function convertValueToCoords(state, options) {
1339
+ const {placement: placement, platform: platform, elements: elements} = state;
1340
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
1341
+ const side = getSide(placement);
1342
+ const alignment = getAlignment(placement);
1343
+ const isVertical = getSideAxis(placement) === "y";
1344
+ const mainAxisMulti = [ "left", "top" ].includes(side) ? -1 : 1;
1345
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
1346
+ const rawValue = evaluate(options, state);
1347
+ let {mainAxis: mainAxis, crossAxis: crossAxis, alignmentAxis: alignmentAxis} = typeof rawValue === "number" ? {
1348
+ mainAxis: rawValue,
1349
+ crossAxis: 0,
1350
+ alignmentAxis: null
1351
+ } : {
1352
+ mainAxis: 0,
1353
+ crossAxis: 0,
1354
+ alignmentAxis: null,
1355
+ ...rawValue
1356
+ };
1357
+ if (alignment && typeof alignmentAxis === "number") {
1358
+ crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
1359
+ }
1360
+ return isVertical ? {
1361
+ x: crossAxis * crossAxisMulti,
1362
+ y: mainAxis * mainAxisMulti
1363
+ } : {
1364
+ x: mainAxis * mainAxisMulti,
1365
+ y: crossAxis * crossAxisMulti
1491
1366
  };
1492
1367
  }
1493
1368
 
1494
- function getWindowScrollBarX(element) {
1495
- return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
1496
- }
1497
-
1498
- function getViewportRect(element, strategy) {
1499
- var win = getWindow(element);
1500
- var html = getDocumentElement(element);
1501
- var visualViewport = win.visualViewport;
1502
- var width = html.clientWidth;
1503
- var height = html.clientHeight;
1504
- var x = 0;
1505
- var y = 0;
1506
- if (visualViewport) {
1507
- width = visualViewport.width;
1508
- height = visualViewport.height;
1509
- var layoutViewport = isLayoutViewport();
1510
- if (layoutViewport || !layoutViewport && strategy === "fixed") {
1511
- x = visualViewport.offsetLeft;
1512
- y = visualViewport.offsetTop;
1513
- }
1369
+ const offset = function(options) {
1370
+ if (options === void 0) {
1371
+ options = 0;
1514
1372
  }
1515
1373
  return {
1516
- width: width,
1517
- height: height,
1518
- x: x + getWindowScrollBarX(element),
1519
- y: y
1374
+ name: "offset",
1375
+ options: options,
1376
+ async fn(state) {
1377
+ const {x: x, y: y} = state;
1378
+ const diffCoords = await convertValueToCoords(state, options);
1379
+ return {
1380
+ x: x + diffCoords.x,
1381
+ y: y + diffCoords.y,
1382
+ data: diffCoords
1383
+ };
1384
+ }
1520
1385
  };
1521
- }
1386
+ };
1522
1387
 
1523
- function getDocumentRect(element) {
1524
- var _element$ownerDocumen;
1525
- var html = getDocumentElement(element);
1526
- var winScroll = getWindowScroll(element);
1527
- var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
1528
- var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
1529
- var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
1530
- var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
1531
- var y = -winScroll.scrollTop;
1532
- if (getComputedStyle$1(body || html).direction === "rtl") {
1533
- x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
1388
+ const shift = function(options) {
1389
+ if (options === void 0) {
1390
+ options = {};
1534
1391
  }
1535
1392
  return {
1536
- width: width,
1537
- height: height,
1538
- x: x,
1539
- y: y
1393
+ name: "shift",
1394
+ options: options,
1395
+ async fn(state) {
1396
+ const {x: x, y: y, placement: placement} = state;
1397
+ const {mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter: limiter = {
1398
+ fn: _ref => {
1399
+ let {x: x, y: y} = _ref;
1400
+ return {
1401
+ x: x,
1402
+ y: y
1403
+ };
1404
+ }
1405
+ }, ...detectOverflowOptions} = evaluate(options, state);
1406
+ const coords = {
1407
+ x: x,
1408
+ y: y
1409
+ };
1410
+ const overflow = await detectOverflow(state, detectOverflowOptions);
1411
+ const crossAxis = getSideAxis(getSide(placement));
1412
+ const mainAxis = getOppositeAxis(crossAxis);
1413
+ let mainAxisCoord = coords[mainAxis];
1414
+ let crossAxisCoord = coords[crossAxis];
1415
+ if (checkMainAxis) {
1416
+ const minSide = mainAxis === "y" ? "top" : "left";
1417
+ const maxSide = mainAxis === "y" ? "bottom" : "right";
1418
+ const min = mainAxisCoord + overflow[minSide];
1419
+ const max = mainAxisCoord - overflow[maxSide];
1420
+ mainAxisCoord = clamp(min, mainAxisCoord, max);
1421
+ }
1422
+ if (checkCrossAxis) {
1423
+ const minSide = crossAxis === "y" ? "top" : "left";
1424
+ const maxSide = crossAxis === "y" ? "bottom" : "right";
1425
+ const min = crossAxisCoord + overflow[minSide];
1426
+ const max = crossAxisCoord - overflow[maxSide];
1427
+ crossAxisCoord = clamp(min, crossAxisCoord, max);
1428
+ }
1429
+ const limitedCoords = limiter.fn({
1430
+ ...state,
1431
+ [mainAxis]: mainAxisCoord,
1432
+ [crossAxis]: crossAxisCoord
1433
+ });
1434
+ return {
1435
+ ...limitedCoords,
1436
+ data: {
1437
+ x: limitedCoords.x - x,
1438
+ y: limitedCoords.y - y
1439
+ }
1440
+ };
1441
+ }
1540
1442
  };
1541
- }
1542
-
1543
- function isScrollParent(element) {
1544
- var _getComputedStyle = getComputedStyle$1(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
1545
- return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
1546
- }
1443
+ };
1547
1444
 
1548
- function getScrollParent(node) {
1549
- if ([ "html", "body", "#document" ].indexOf(getNodeName(node)) >= 0) {
1550
- return node.ownerDocument.body;
1445
+ function getNodeName(node) {
1446
+ if (isNode(node)) {
1447
+ return (node.nodeName || "").toLowerCase();
1551
1448
  }
1552
- if (isHTMLElement(node) && isScrollParent(node)) {
1553
- return node;
1554
- }
1555
- return getScrollParent(getParentNode(node));
1449
+ return "#document";
1556
1450
  }
1557
1451
 
1558
- function listScrollParents(element, list) {
1559
- var _element$ownerDocumen;
1560
- if (list === void 0) {
1561
- list = [];
1562
- }
1563
- var scrollParent = getScrollParent(element);
1564
- var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
1565
- var win = getWindow(scrollParent);
1566
- var target = isBody ? [ win ].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
1567
- var updatedList = list.concat(target);
1568
- return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target)));
1452
+ function getWindow(node) {
1453
+ var _node$ownerDocument;
1454
+ return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
1569
1455
  }
1570
1456
 
1571
- function rectToClientRect(rect) {
1572
- return Object.assign({}, rect, {
1573
- left: rect.x,
1574
- top: rect.y,
1575
- right: rect.x + rect.width,
1576
- bottom: rect.y + rect.height
1577
- });
1457
+ function getDocumentElement(node) {
1458
+ var _ref;
1459
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
1578
1460
  }
1579
1461
 
1580
- function getInnerBoundingClientRect(element, strategy) {
1581
- var rect = getBoundingClientRect(element, false, strategy === "fixed");
1582
- rect.top = rect.top + element.clientTop;
1583
- rect.left = rect.left + element.clientLeft;
1584
- rect.bottom = rect.top + element.clientHeight;
1585
- rect.right = rect.left + element.clientWidth;
1586
- rect.width = element.clientWidth;
1587
- rect.height = element.clientHeight;
1588
- rect.x = rect.left;
1589
- rect.y = rect.top;
1590
- return rect;
1591
- }
1592
-
1593
- function getClientRectFromMixedType(element, clippingParent, strategy) {
1594
- return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
1595
- }
1596
-
1597
- function getClippingParents(element) {
1598
- var clippingParents = listScrollParents(getParentNode(element));
1599
- var canEscapeClipping = [ "absolute", "fixed" ].indexOf(getComputedStyle$1(element).position) >= 0;
1600
- var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
1601
- if (!isElement(clipperElement)) {
1602
- return [];
1603
- }
1604
- return clippingParents.filter((function(clippingParent) {
1605
- return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
1606
- }));
1462
+ function isNode(value) {
1463
+ return value instanceof Node || value instanceof getWindow(value).Node;
1607
1464
  }
1608
1465
 
1609
- function getClippingRect(element, boundary, rootBoundary, strategy) {
1610
- var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
1611
- var clippingParents = [].concat(mainClippingParents, [ rootBoundary ]);
1612
- var firstClippingParent = clippingParents[0];
1613
- var clippingRect = clippingParents.reduce((function(accRect, clippingParent) {
1614
- var rect = getClientRectFromMixedType(element, clippingParent, strategy);
1615
- accRect.top = max(rect.top, accRect.top);
1616
- accRect.right = min(rect.right, accRect.right);
1617
- accRect.bottom = min(rect.bottom, accRect.bottom);
1618
- accRect.left = max(rect.left, accRect.left);
1619
- return accRect;
1620
- }), getClientRectFromMixedType(element, firstClippingParent, strategy));
1621
- clippingRect.width = clippingRect.right - clippingRect.left;
1622
- clippingRect.height = clippingRect.bottom - clippingRect.top;
1623
- clippingRect.x = clippingRect.left;
1624
- clippingRect.y = clippingRect.top;
1625
- return clippingRect;
1626
- }
1627
-
1628
- function computeOffsets(_ref) {
1629
- var reference = _ref.reference, element = _ref.element, placement = _ref.placement;
1630
- var basePlacement = placement ? getBasePlacement(placement) : null;
1631
- var variation = placement ? getVariation(placement) : null;
1632
- var commonX = reference.x + reference.width / 2 - element.width / 2;
1633
- var commonY = reference.y + reference.height / 2 - element.height / 2;
1634
- var offsets;
1635
- switch (basePlacement) {
1636
- case top:
1637
- offsets = {
1638
- x: commonX,
1639
- y: reference.y - element.height
1640
- };
1641
- break;
1466
+ function isElement(value) {
1467
+ return value instanceof Element || value instanceof getWindow(value).Element;
1468
+ }
1642
1469
 
1643
- case bottom:
1644
- offsets = {
1645
- x: commonX,
1646
- y: reference.y + reference.height
1647
- };
1648
- break;
1470
+ function isHTMLElement(value) {
1471
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
1472
+ }
1649
1473
 
1650
- case right:
1651
- offsets = {
1652
- x: reference.x + reference.width,
1653
- y: commonY
1654
- };
1655
- break;
1474
+ function isShadowRoot(value) {
1475
+ if (typeof ShadowRoot === "undefined") {
1476
+ return false;
1477
+ }
1478
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
1479
+ }
1656
1480
 
1657
- case left:
1658
- offsets = {
1659
- x: reference.x - element.width,
1660
- y: commonY
1661
- };
1662
- break;
1481
+ function isOverflowElement(element) {
1482
+ const {overflow: overflow, overflowX: overflowX, overflowY: overflowY, display: display} = getComputedStyle$1(element);
1483
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && ![ "inline", "contents" ].includes(display);
1484
+ }
1663
1485
 
1664
- default:
1665
- offsets = {
1666
- x: reference.x,
1667
- y: reference.y
1668
- };
1669
- }
1670
- var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
1671
- if (mainAxis != null) {
1672
- var len = mainAxis === "y" ? "height" : "width";
1673
- switch (variation) {
1674
- case start:
1675
- offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
1676
- break;
1486
+ function isTableElement(element) {
1487
+ return [ "table", "td", "th" ].includes(getNodeName(element));
1488
+ }
1677
1489
 
1678
- case end:
1679
- offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
1680
- break;
1490
+ function isContainingBlock(element) {
1491
+ const webkit = isWebKit();
1492
+ const css = getComputedStyle$1(element);
1493
+ return css.transform !== "none" || css.perspective !== "none" || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || [ "transform", "perspective", "filter" ].some((value => (css.willChange || "").includes(value))) || [ "paint", "layout", "strict", "content" ].some((value => (css.contain || "").includes(value)));
1494
+ }
1495
+
1496
+ function getContainingBlock(element) {
1497
+ let currentNode = getParentNode(element);
1498
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
1499
+ if (isContainingBlock(currentNode)) {
1500
+ return currentNode;
1501
+ } else {
1502
+ currentNode = getParentNode(currentNode);
1681
1503
  }
1682
1504
  }
1683
- return offsets;
1505
+ return null;
1684
1506
  }
1685
1507
 
1686
- function detectOverflow(state, options) {
1687
- if (options === void 0) {
1688
- options = {};
1508
+ function isWebKit() {
1509
+ if (typeof CSS === "undefined" || !CSS.supports) return false;
1510
+ return CSS.supports("-webkit-backdrop-filter", "none");
1511
+ }
1512
+
1513
+ function isLastTraversableNode(node) {
1514
+ return [ "html", "body", "#document" ].includes(getNodeName(node));
1515
+ }
1516
+
1517
+ function getComputedStyle$1(element) {
1518
+ return getWindow(element).getComputedStyle(element);
1519
+ }
1520
+
1521
+ function getNodeScroll(element) {
1522
+ if (isElement(element)) {
1523
+ return {
1524
+ scrollLeft: element.scrollLeft,
1525
+ scrollTop: element.scrollTop
1526
+ };
1689
1527
  }
1690
- var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
1691
- var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
1692
- var altContext = elementContext === popper ? reference : popper;
1693
- var popperRect = state.rects.popper;
1694
- var element = state.elements[altBoundary ? altContext : elementContext];
1695
- var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
1696
- var referenceClientRect = getBoundingClientRect(state.elements.reference);
1697
- var popperOffsets = computeOffsets({
1698
- reference: referenceClientRect,
1699
- element: popperRect,
1700
- strategy: "absolute",
1701
- placement: placement
1702
- });
1703
- var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
1704
- var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
1705
- var overflowOffsets = {
1706
- top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
1707
- bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
1708
- left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
1709
- right: elementClientRect.right - clippingClientRect.right + paddingObject.right
1528
+ return {
1529
+ scrollLeft: element.pageXOffset,
1530
+ scrollTop: element.pageYOffset
1710
1531
  };
1711
- var offsetData = state.modifiersData.offset;
1712
- if (elementContext === popper && offsetData) {
1713
- var offset = offsetData[placement];
1714
- Object.keys(overflowOffsets).forEach((function(key) {
1715
- var multiply = [ right, bottom ].indexOf(key) >= 0 ? 1 : -1;
1716
- var axis = [ top, bottom ].indexOf(key) >= 0 ? "y" : "x";
1717
- overflowOffsets[key] += offset[axis] * multiply;
1718
- }));
1719
- }
1720
- return overflowOffsets;
1721
1532
  }
1722
1533
 
1723
- function computeAutoPlacement(state, options) {
1724
- if (options === void 0) {
1725
- options = {};
1534
+ function getParentNode(node) {
1535
+ if (getNodeName(node) === "html") {
1536
+ return node;
1726
1537
  }
1727
- var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
1728
- var variation = getVariation(placement);
1729
- var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter((function(placement) {
1730
- return getVariation(placement) === variation;
1731
- })) : basePlacements;
1732
- var allowedPlacements = placements$1.filter((function(placement) {
1733
- return allowedAutoPlacements.indexOf(placement) >= 0;
1734
- }));
1735
- if (allowedPlacements.length === 0) {
1736
- allowedPlacements = placements$1;
1737
- }
1738
- var overflows = allowedPlacements.reduce((function(acc, placement) {
1739
- acc[placement] = detectOverflow(state, {
1740
- placement: placement,
1741
- boundary: boundary,
1742
- rootBoundary: rootBoundary,
1743
- padding: padding
1744
- })[getBasePlacement(placement)];
1745
- return acc;
1746
- }), {});
1747
- return Object.keys(overflows).sort((function(a, b) {
1748
- return overflows[a] - overflows[b];
1749
- }));
1538
+ const result = node.assignedSlot || node.parentNode || isShadowRoot(node) && node.host || getDocumentElement(node);
1539
+ return isShadowRoot(result) ? result.host : result;
1750
1540
  }
1751
1541
 
1752
- function getExpandedFallbackPlacements(placement) {
1753
- if (getBasePlacement(placement) === auto) {
1754
- return [];
1755
- }
1756
- var oppositePlacement = getOppositePlacement(placement);
1757
- return [ getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement) ];
1758
- }
1759
-
1760
- function flip(_ref) {
1761
- var state = _ref.state, options = _ref.options, name = _ref.name;
1762
- if (state.modifiersData[name]._skip) {
1763
- return;
1764
- }
1765
- var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
1766
- var preferredPlacement = state.options.placement;
1767
- var basePlacement = getBasePlacement(preferredPlacement);
1768
- var isBasePlacement = basePlacement === preferredPlacement;
1769
- var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [ getOppositePlacement(preferredPlacement) ] : getExpandedFallbackPlacements(preferredPlacement));
1770
- var placements = [ preferredPlacement ].concat(fallbackPlacements).reduce((function(acc, placement) {
1771
- return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
1772
- placement: placement,
1773
- boundary: boundary,
1774
- rootBoundary: rootBoundary,
1775
- padding: padding,
1776
- flipVariations: flipVariations,
1777
- allowedAutoPlacements: allowedAutoPlacements
1778
- }) : placement);
1779
- }), []);
1780
- var referenceRect = state.rects.reference;
1781
- var popperRect = state.rects.popper;
1782
- var checksMap = new Map;
1783
- var makeFallbackChecks = true;
1784
- var firstFittingPlacement = placements[0];
1785
- for (var i = 0; i < placements.length; i++) {
1786
- var placement = placements[i];
1787
- var _basePlacement = getBasePlacement(placement);
1788
- var isStartVariation = getVariation(placement) === start;
1789
- var isVertical = [ top, bottom ].indexOf(_basePlacement) >= 0;
1790
- var len = isVertical ? "width" : "height";
1791
- var overflow = detectOverflow(state, {
1792
- placement: placement,
1793
- boundary: boundary,
1794
- rootBoundary: rootBoundary,
1795
- altBoundary: altBoundary,
1796
- padding: padding
1797
- });
1798
- var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
1799
- if (referenceRect[len] > popperRect[len]) {
1800
- mainVariationSide = getOppositePlacement(mainVariationSide);
1801
- }
1802
- var altVariationSide = getOppositePlacement(mainVariationSide);
1803
- var checks = [];
1804
- if (checkMainAxis) {
1805
- checks.push(overflow[_basePlacement] <= 0);
1806
- }
1807
- if (checkAltAxis) {
1808
- checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
1809
- }
1810
- if (checks.every((function(check) {
1811
- return check;
1812
- }))) {
1813
- firstFittingPlacement = placement;
1814
- makeFallbackChecks = false;
1815
- break;
1816
- }
1817
- checksMap.set(placement, checks);
1818
- }
1819
- if (makeFallbackChecks) {
1820
- var numberOfChecks = flipVariations ? 3 : 1;
1821
- var _loop = function _loop(_i) {
1822
- var fittingPlacement = placements.find((function(placement) {
1823
- var checks = checksMap.get(placement);
1824
- if (checks) {
1825
- return checks.slice(0, _i).every((function(check) {
1826
- return check;
1827
- }));
1828
- }
1829
- }));
1830
- if (fittingPlacement) {
1831
- firstFittingPlacement = fittingPlacement;
1832
- return "break";
1833
- }
1834
- };
1835
- for (var _i = numberOfChecks; _i > 0; _i--) {
1836
- var _ret = _loop(_i);
1837
- if (_ret === "break") break;
1838
- }
1542
+ function getNearestOverflowAncestor(node) {
1543
+ const parentNode = getParentNode(node);
1544
+ if (isLastTraversableNode(parentNode)) {
1545
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
1839
1546
  }
1840
- if (state.placement !== firstFittingPlacement) {
1841
- state.modifiersData[name]._skip = true;
1842
- state.placement = firstFittingPlacement;
1843
- state.reset = true;
1547
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
1548
+ return parentNode;
1844
1549
  }
1550
+ return getNearestOverflowAncestor(parentNode);
1845
1551
  }
1846
1552
 
1847
- var flip$1 = {
1848
- name: "flip",
1849
- enabled: true,
1850
- phase: "main",
1851
- fn: flip,
1852
- requiresIfExists: [ "offset" ],
1853
- data: {
1854
- _skip: false
1553
+ function getOverflowAncestors(node, list, traverseIframes) {
1554
+ var _node$ownerDocument2;
1555
+ if (list === void 0) {
1556
+ list = [];
1855
1557
  }
1856
- };
1558
+ if (traverseIframes === void 0) {
1559
+ traverseIframes = true;
1560
+ }
1561
+ const scrollableAncestor = getNearestOverflowAncestor(node);
1562
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
1563
+ const win = getWindow(scrollableAncestor);
1564
+ if (isBody) {
1565
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
1566
+ }
1567
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
1568
+ }
1857
1569
 
1858
- function getSideOffsets(overflow, rect, preventedOffsets) {
1859
- if (preventedOffsets === void 0) {
1860
- preventedOffsets = {
1861
- x: 0,
1862
- y: 0
1863
- };
1570
+ function getCssDimensions(element) {
1571
+ const css = getComputedStyle$1(element);
1572
+ let width = parseFloat(css.width) || 0;
1573
+ let height = parseFloat(css.height) || 0;
1574
+ const hasOffset = isHTMLElement(element);
1575
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
1576
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
1577
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
1578
+ if (shouldFallback) {
1579
+ width = offsetWidth;
1580
+ height = offsetHeight;
1864
1581
  }
1865
1582
  return {
1866
- top: overflow.top - rect.height - preventedOffsets.y,
1867
- right: overflow.right - rect.width + preventedOffsets.x,
1868
- bottom: overflow.bottom - rect.height + preventedOffsets.y,
1869
- left: overflow.left - rect.width - preventedOffsets.x
1583
+ width: width,
1584
+ height: height,
1585
+ $: shouldFallback
1870
1586
  };
1871
1587
  }
1872
1588
 
1873
- function isAnySideFullyClipped(overflow) {
1874
- return [ top, right, bottom, left ].some((function(side) {
1875
- return overflow[side] >= 0;
1876
- }));
1589
+ function unwrapElement(element) {
1590
+ return !isElement(element) ? element.contextElement : element;
1877
1591
  }
1878
1592
 
1879
- function hide(_ref) {
1880
- var state = _ref.state, name = _ref.name;
1881
- var referenceRect = state.rects.reference;
1882
- var popperRect = state.rects.popper;
1883
- var preventedOffsets = state.modifiersData.preventOverflow;
1884
- var referenceOverflow = detectOverflow(state, {
1885
- elementContext: "reference"
1886
- });
1887
- var popperAltOverflow = detectOverflow(state, {
1888
- altBoundary: true
1889
- });
1890
- var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
1891
- var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
1892
- var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
1893
- var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
1894
- state.modifiersData[name] = {
1895
- referenceClippingOffsets: referenceClippingOffsets,
1896
- popperEscapeOffsets: popperEscapeOffsets,
1897
- isReferenceHidden: isReferenceHidden,
1898
- hasPopperEscaped: hasPopperEscaped
1593
+ function getScale(element) {
1594
+ const domElement = unwrapElement(element);
1595
+ if (!isHTMLElement(domElement)) {
1596
+ return createCoords(1);
1597
+ }
1598
+ const rect = domElement.getBoundingClientRect();
1599
+ const {width: width, height: height, $: $} = getCssDimensions(domElement);
1600
+ let x = ($ ? round(rect.width) : rect.width) / width;
1601
+ let y = ($ ? round(rect.height) : rect.height) / height;
1602
+ if (!x || !Number.isFinite(x)) {
1603
+ x = 1;
1604
+ }
1605
+ if (!y || !Number.isFinite(y)) {
1606
+ y = 1;
1607
+ }
1608
+ return {
1609
+ x: x,
1610
+ y: y
1899
1611
  };
1900
- state.attributes.popper = Object.assign({}, state.attributes.popper, {
1901
- "data-popper-reference-hidden": isReferenceHidden,
1902
- "data-popper-escaped": hasPopperEscaped
1903
- });
1904
1612
  }
1905
1613
 
1906
- var hide$1 = {
1907
- name: "hide",
1908
- enabled: true,
1909
- phase: "main",
1910
- requiresIfExists: [ "preventOverflow" ],
1911
- fn: hide
1912
- };
1614
+ const noOffsets = createCoords(0);
1913
1615
 
1914
- function distanceAndSkiddingToXY(placement, rects, offset) {
1915
- var basePlacement = getBasePlacement(placement);
1916
- var invertDistance = [ left, top ].indexOf(basePlacement) >= 0 ? -1 : 1;
1917
- var _ref = typeof offset === "function" ? offset(Object.assign({}, rects, {
1918
- placement: placement
1919
- })) : offset, skidding = _ref[0], distance = _ref[1];
1920
- skidding = skidding || 0;
1921
- distance = (distance || 0) * invertDistance;
1922
- return [ left, right ].indexOf(basePlacement) >= 0 ? {
1923
- x: distance,
1924
- y: skidding
1925
- } : {
1926
- x: skidding,
1927
- y: distance
1616
+ function getVisualOffsets(element) {
1617
+ const win = getWindow(element);
1618
+ if (!isWebKit() || !win.visualViewport) {
1619
+ return noOffsets;
1620
+ }
1621
+ return {
1622
+ x: win.visualViewport.offsetLeft,
1623
+ y: win.visualViewport.offsetTop
1928
1624
  };
1929
1625
  }
1930
1626
 
1931
- function offset(_ref2) {
1932
- var state = _ref2.state, options = _ref2.options, name = _ref2.name;
1933
- var _options$offset = options.offset, offset = _options$offset === void 0 ? [ 0, 0 ] : _options$offset;
1934
- var data = placements.reduce((function(acc, placement) {
1935
- acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
1936
- return acc;
1937
- }), {});
1938
- var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y;
1939
- if (state.modifiersData.popperOffsets != null) {
1940
- state.modifiersData.popperOffsets.x += x;
1941
- state.modifiersData.popperOffsets.y += y;
1627
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
1628
+ if (isFixed === void 0) {
1629
+ isFixed = false;
1630
+ }
1631
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
1632
+ return false;
1942
1633
  }
1943
- state.modifiersData[name] = data;
1634
+ return isFixed;
1944
1635
  }
1945
1636
 
1946
- var offset$1 = {
1947
- name: "offset",
1948
- enabled: true,
1949
- phase: "main",
1950
- requires: [ "popperOffsets" ],
1951
- fn: offset
1952
- };
1953
-
1954
- function popperOffsets(_ref) {
1955
- var state = _ref.state, name = _ref.name;
1956
- state.modifiersData[name] = computeOffsets({
1957
- reference: state.rects.reference,
1958
- element: state.rects.popper,
1959
- strategy: "absolute",
1960
- placement: state.placement
1637
+ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
1638
+ if (includeScale === void 0) {
1639
+ includeScale = false;
1640
+ }
1641
+ if (isFixedStrategy === void 0) {
1642
+ isFixedStrategy = false;
1643
+ }
1644
+ const clientRect = element.getBoundingClientRect();
1645
+ const domElement = unwrapElement(element);
1646
+ let scale = createCoords(1);
1647
+ if (includeScale) {
1648
+ if (offsetParent) {
1649
+ if (isElement(offsetParent)) {
1650
+ scale = getScale(offsetParent);
1651
+ }
1652
+ } else {
1653
+ scale = getScale(element);
1654
+ }
1655
+ }
1656
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
1657
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
1658
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
1659
+ let width = clientRect.width / scale.x;
1660
+ let height = clientRect.height / scale.y;
1661
+ if (domElement) {
1662
+ const win = getWindow(domElement);
1663
+ const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
1664
+ let currentIFrame = win.frameElement;
1665
+ while (currentIFrame && offsetParent && offsetWin !== win) {
1666
+ const iframeScale = getScale(currentIFrame);
1667
+ const iframeRect = currentIFrame.getBoundingClientRect();
1668
+ const css = getComputedStyle$1(currentIFrame);
1669
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
1670
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
1671
+ x *= iframeScale.x;
1672
+ y *= iframeScale.y;
1673
+ width *= iframeScale.x;
1674
+ height *= iframeScale.y;
1675
+ x += left;
1676
+ y += top;
1677
+ currentIFrame = getWindow(currentIFrame).frameElement;
1678
+ }
1679
+ }
1680
+ return rectToClientRect({
1681
+ width: width,
1682
+ height: height,
1683
+ x: x,
1684
+ y: y
1961
1685
  });
1962
1686
  }
1963
1687
 
1964
- var popperOffsets$1 = {
1965
- name: "popperOffsets",
1966
- enabled: true,
1967
- phase: "read",
1968
- fn: popperOffsets,
1969
- data: {}
1970
- };
1688
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1689
+ let {rect: rect, offsetParent: offsetParent, strategy: strategy} = _ref;
1690
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
1691
+ const documentElement = getDocumentElement(offsetParent);
1692
+ if (offsetParent === documentElement) {
1693
+ return rect;
1694
+ }
1695
+ let scroll = {
1696
+ scrollLeft: 0,
1697
+ scrollTop: 0
1698
+ };
1699
+ let scale = createCoords(1);
1700
+ const offsets = createCoords(0);
1701
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== "fixed") {
1702
+ if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
1703
+ scroll = getNodeScroll(offsetParent);
1704
+ }
1705
+ if (isHTMLElement(offsetParent)) {
1706
+ const offsetRect = getBoundingClientRect(offsetParent);
1707
+ scale = getScale(offsetParent);
1708
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
1709
+ offsets.y = offsetRect.y + offsetParent.clientTop;
1710
+ }
1711
+ }
1712
+ return {
1713
+ width: rect.width * scale.x,
1714
+ height: rect.height * scale.y,
1715
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
1716
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
1717
+ };
1718
+ }
1971
1719
 
1972
- function getAltAxis(axis) {
1973
- return axis === "x" ? "y" : "x";
1720
+ function getClientRects(element) {
1721
+ return Array.from(element.getClientRects());
1974
1722
  }
1975
1723
 
1976
- function preventOverflow(_ref) {
1977
- var state = _ref.state, options = _ref.options, name = _ref.name;
1978
- var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
1979
- var overflow = detectOverflow(state, {
1980
- boundary: boundary,
1981
- rootBoundary: rootBoundary,
1982
- padding: padding,
1983
- altBoundary: altBoundary
1984
- });
1985
- var basePlacement = getBasePlacement(state.placement);
1986
- var variation = getVariation(state.placement);
1987
- var isBasePlacement = !variation;
1988
- var mainAxis = getMainAxisFromPlacement(basePlacement);
1989
- var altAxis = getAltAxis(mainAxis);
1990
- var popperOffsets = state.modifiersData.popperOffsets;
1991
- var referenceRect = state.rects.reference;
1992
- var popperRect = state.rects.popper;
1993
- var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, {
1994
- placement: state.placement
1995
- })) : tetherOffset;
1996
- var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
1997
- mainAxis: tetherOffsetValue,
1998
- altAxis: tetherOffsetValue
1999
- } : Object.assign({
2000
- mainAxis: 0,
2001
- altAxis: 0
2002
- }, tetherOffsetValue);
2003
- var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
2004
- var data = {
2005
- x: 0,
2006
- y: 0
1724
+ function getWindowScrollBarX(element) {
1725
+ return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
1726
+ }
1727
+
1728
+ function getDocumentRect(element) {
1729
+ const html = getDocumentElement(element);
1730
+ const scroll = getNodeScroll(element);
1731
+ const body = element.ownerDocument.body;
1732
+ const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
1733
+ const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
1734
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
1735
+ const y = -scroll.scrollTop;
1736
+ if (getComputedStyle$1(body).direction === "rtl") {
1737
+ x += max(html.clientWidth, body.clientWidth) - width;
1738
+ }
1739
+ return {
1740
+ width: width,
1741
+ height: height,
1742
+ x: x,
1743
+ y: y
2007
1744
  };
2008
- if (!popperOffsets) {
2009
- return;
2010
- }
2011
- if (checkMainAxis) {
2012
- var _offsetModifierState$;
2013
- var mainSide = mainAxis === "y" ? top : left;
2014
- var altSide = mainAxis === "y" ? bottom : right;
2015
- var len = mainAxis === "y" ? "height" : "width";
2016
- var offset = popperOffsets[mainAxis];
2017
- var min$1 = offset + overflow[mainSide];
2018
- var max$1 = offset - overflow[altSide];
2019
- var additive = tether ? -popperRect[len] / 2 : 0;
2020
- var minLen = variation === start ? referenceRect[len] : popperRect[len];
2021
- var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
2022
- var arrowElement = state.elements.arrow;
2023
- var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
2024
- width: 0,
2025
- height: 0
2026
- };
2027
- var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
2028
- var arrowPaddingMin = arrowPaddingObject[mainSide];
2029
- var arrowPaddingMax = arrowPaddingObject[altSide];
2030
- var arrowLen = within(0, referenceRect[len], arrowRect[len]);
2031
- var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
2032
- var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
2033
- var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
2034
- var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
2035
- var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
2036
- var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
2037
- var tetherMax = offset + maxOffset - offsetModifierValue;
2038
- var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
2039
- popperOffsets[mainAxis] = preventedOffset;
2040
- data[mainAxis] = preventedOffset - offset;
2041
- }
2042
- if (checkAltAxis) {
2043
- var _offsetModifierState$2;
2044
- var _mainSide = mainAxis === "x" ? top : left;
2045
- var _altSide = mainAxis === "x" ? bottom : right;
2046
- var _offset = popperOffsets[altAxis];
2047
- var _len = altAxis === "y" ? "height" : "width";
2048
- var _min = _offset + overflow[_mainSide];
2049
- var _max = _offset - overflow[_altSide];
2050
- var isOriginSide = [ top, left ].indexOf(basePlacement) !== -1;
2051
- var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
2052
- var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
2053
- var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
2054
- var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
2055
- popperOffsets[altAxis] = _preventedOffset;
2056
- data[altAxis] = _preventedOffset - _offset;
2057
- }
2058
- state.modifiersData[name] = data;
2059
- }
2060
-
2061
- var preventOverflow$1 = {
2062
- name: "preventOverflow",
2063
- enabled: true,
2064
- phase: "main",
2065
- fn: preventOverflow,
2066
- requiresIfExists: [ "offset" ]
2067
- };
1745
+ }
1746
+
1747
+ function getViewportRect(element, strategy) {
1748
+ const win = getWindow(element);
1749
+ const html = getDocumentElement(element);
1750
+ const visualViewport = win.visualViewport;
1751
+ let width = html.clientWidth;
1752
+ let height = html.clientHeight;
1753
+ let x = 0;
1754
+ let y = 0;
1755
+ if (visualViewport) {
1756
+ width = visualViewport.width;
1757
+ height = visualViewport.height;
1758
+ const visualViewportBased = isWebKit();
1759
+ if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
1760
+ x = visualViewport.offsetLeft;
1761
+ y = visualViewport.offsetTop;
1762
+ }
1763
+ }
1764
+ return {
1765
+ width: width,
1766
+ height: height,
1767
+ x: x,
1768
+ y: y
1769
+ };
1770
+ }
2068
1771
 
2069
- function getHTMLElementScroll(element) {
1772
+ function getInnerBoundingClientRect(element, strategy) {
1773
+ const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
1774
+ const top = clientRect.top + element.clientTop;
1775
+ const left = clientRect.left + element.clientLeft;
1776
+ const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
1777
+ const width = element.clientWidth * scale.x;
1778
+ const height = element.clientHeight * scale.y;
1779
+ const x = left * scale.x;
1780
+ const y = top * scale.y;
2070
1781
  return {
2071
- scrollLeft: element.scrollLeft,
2072
- scrollTop: element.scrollTop
1782
+ width: width,
1783
+ height: height,
1784
+ x: x,
1785
+ y: y
2073
1786
  };
2074
1787
  }
2075
1788
 
2076
- function getNodeScroll(node) {
2077
- if (node === getWindow(node) || !isHTMLElement(node)) {
2078
- return getWindowScroll(node);
1789
+ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
1790
+ let rect;
1791
+ if (clippingAncestor === "viewport") {
1792
+ rect = getViewportRect(element, strategy);
1793
+ } else if (clippingAncestor === "document") {
1794
+ rect = getDocumentRect(getDocumentElement(element));
1795
+ } else if (isElement(clippingAncestor)) {
1796
+ rect = getInnerBoundingClientRect(clippingAncestor, strategy);
2079
1797
  } else {
2080
- return getHTMLElementScroll(node);
1798
+ const visualOffsets = getVisualOffsets(element);
1799
+ rect = {
1800
+ ...clippingAncestor,
1801
+ x: clippingAncestor.x - visualOffsets.x,
1802
+ y: clippingAncestor.y - visualOffsets.y
1803
+ };
2081
1804
  }
1805
+ return rectToClientRect(rect);
2082
1806
  }
2083
1807
 
2084
- function isElementScaled(element) {
2085
- var rect = element.getBoundingClientRect();
2086
- var scaleX = round(rect.width) / element.offsetWidth || 1;
2087
- var scaleY = round(rect.height) / element.offsetHeight || 1;
2088
- return scaleX !== 1 || scaleY !== 1;
1808
+ function hasFixedPositionAncestor(element, stopNode) {
1809
+ const parentNode = getParentNode(element);
1810
+ if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
1811
+ return false;
1812
+ }
1813
+ return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
2089
1814
  }
2090
1815
 
2091
- function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
2092
- if (isFixed === void 0) {
2093
- isFixed = false;
1816
+ function getClippingElementAncestors(element, cache) {
1817
+ const cachedResult = cache.get(element);
1818
+ if (cachedResult) {
1819
+ return cachedResult;
1820
+ }
1821
+ let result = getOverflowAncestors(element, [], false).filter((el => isElement(el) && getNodeName(el) !== "body"));
1822
+ let currentContainingBlockComputedStyle = null;
1823
+ const elementIsFixed = getComputedStyle$1(element).position === "fixed";
1824
+ let currentNode = elementIsFixed ? getParentNode(element) : element;
1825
+ while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
1826
+ const computedStyle = getComputedStyle$1(currentNode);
1827
+ const currentNodeIsContaining = isContainingBlock(currentNode);
1828
+ if (!currentNodeIsContaining && computedStyle.position === "fixed") {
1829
+ currentContainingBlockComputedStyle = null;
1830
+ }
1831
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && [ "absolute", "fixed" ].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
1832
+ if (shouldDropCurrentNode) {
1833
+ result = result.filter((ancestor => ancestor !== currentNode));
1834
+ } else {
1835
+ currentContainingBlockComputedStyle = computedStyle;
1836
+ }
1837
+ currentNode = getParentNode(currentNode);
2094
1838
  }
2095
- var isOffsetParentAnElement = isHTMLElement(offsetParent);
2096
- var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
2097
- var documentElement = getDocumentElement(offsetParent);
2098
- var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
2099
- var scroll = {
1839
+ cache.set(element, result);
1840
+ return result;
1841
+ }
1842
+
1843
+ function getClippingRect(_ref) {
1844
+ let {element: element, boundary: boundary, rootBoundary: rootBoundary, strategy: strategy} = _ref;
1845
+ const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
1846
+ const clippingAncestors = [ ...elementClippingAncestors, rootBoundary ];
1847
+ const firstClippingAncestor = clippingAncestors[0];
1848
+ const clippingRect = clippingAncestors.reduce(((accRect, clippingAncestor) => {
1849
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
1850
+ accRect.top = max(rect.top, accRect.top);
1851
+ accRect.right = min(rect.right, accRect.right);
1852
+ accRect.bottom = min(rect.bottom, accRect.bottom);
1853
+ accRect.left = max(rect.left, accRect.left);
1854
+ return accRect;
1855
+ }), getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
1856
+ return {
1857
+ width: clippingRect.right - clippingRect.left,
1858
+ height: clippingRect.bottom - clippingRect.top,
1859
+ x: clippingRect.left,
1860
+ y: clippingRect.top
1861
+ };
1862
+ }
1863
+
1864
+ function getDimensions(element) {
1865
+ return getCssDimensions(element);
1866
+ }
1867
+
1868
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1869
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
1870
+ const documentElement = getDocumentElement(offsetParent);
1871
+ const isFixed = strategy === "fixed";
1872
+ const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
1873
+ let scroll = {
2100
1874
  scrollLeft: 0,
2101
1875
  scrollTop: 0
2102
1876
  };
2103
- var offsets = {
2104
- x: 0,
2105
- y: 0
2106
- };
1877
+ const offsets = createCoords(0);
2107
1878
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
2108
- if (getNodeName(offsetParent) !== "body" || isScrollParent(documentElement)) {
1879
+ if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
2109
1880
  scroll = getNodeScroll(offsetParent);
2110
1881
  }
2111
- if (isHTMLElement(offsetParent)) {
2112
- offsets = getBoundingClientRect(offsetParent, true);
2113
- offsets.x += offsetParent.clientLeft;
2114
- offsets.y += offsetParent.clientTop;
1882
+ if (isOffsetParentAnElement) {
1883
+ const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
1884
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
1885
+ offsets.y = offsetRect.y + offsetParent.clientTop;
2115
1886
  } else if (documentElement) {
2116
1887
  offsets.x = getWindowScrollBarX(documentElement);
2117
1888
  }
@@ -2124,210 +1895,202 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
2124
1895
  };
2125
1896
  }
2126
1897
 
2127
- function order(modifiers) {
2128
- var map = new Map;
2129
- var visited = new Set;
2130
- var result = [];
2131
- modifiers.forEach((function(modifier) {
2132
- map.set(modifier.name, modifier);
2133
- }));
2134
- function sort(modifier) {
2135
- visited.add(modifier.name);
2136
- var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
2137
- requires.forEach((function(dep) {
2138
- if (!visited.has(dep)) {
2139
- var depModifier = map.get(dep);
2140
- if (depModifier) {
2141
- sort(depModifier);
2142
- }
2143
- }
2144
- }));
2145
- result.push(modifier);
1898
+ function getTrueOffsetParent(element, polyfill) {
1899
+ if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
1900
+ return null;
2146
1901
  }
2147
- modifiers.forEach((function(modifier) {
2148
- if (!visited.has(modifier.name)) {
2149
- sort(modifier);
2150
- }
2151
- }));
2152
- return result;
1902
+ if (polyfill) {
1903
+ return polyfill(element);
1904
+ }
1905
+ return element.offsetParent;
2153
1906
  }
2154
1907
 
2155
- function orderModifiers(modifiers) {
2156
- var orderedModifiers = order(modifiers);
2157
- return modifierPhases.reduce((function(acc, phase) {
2158
- return acc.concat(orderedModifiers.filter((function(modifier) {
2159
- return modifier.phase === phase;
2160
- })));
2161
- }), []);
1908
+ function getOffsetParent(element, polyfill) {
1909
+ const window = getWindow(element);
1910
+ if (!isHTMLElement(element)) {
1911
+ return window;
1912
+ }
1913
+ let offsetParent = getTrueOffsetParent(element, polyfill);
1914
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === "static") {
1915
+ offsetParent = getTrueOffsetParent(offsetParent, polyfill);
1916
+ }
1917
+ if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$1(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
1918
+ return window;
1919
+ }
1920
+ return offsetParent || getContainingBlock(element) || window;
2162
1921
  }
2163
1922
 
2164
- function debounce(fn) {
2165
- var pending;
2166
- return function() {
2167
- if (!pending) {
2168
- pending = new Promise((function(resolve) {
2169
- Promise.resolve().then((function() {
2170
- pending = undefined;
2171
- resolve(fn());
2172
- }));
2173
- }));
1923
+ const getElementRects = async function(_ref) {
1924
+ let {reference: reference, floating: floating, strategy: strategy} = _ref;
1925
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1926
+ const getDimensionsFn = this.getDimensions;
1927
+ return {
1928
+ reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
1929
+ floating: {
1930
+ x: 0,
1931
+ y: 0,
1932
+ ...await getDimensionsFn(floating)
2174
1933
  }
2175
- return pending;
2176
1934
  };
2177
- }
2178
-
2179
- function mergeByName(modifiers) {
2180
- var merged = modifiers.reduce((function(merged, current) {
2181
- var existing = merged[current.name];
2182
- merged[current.name] = existing ? Object.assign({}, existing, current, {
2183
- options: Object.assign({}, existing.options, current.options),
2184
- data: Object.assign({}, existing.data, current.data)
2185
- }) : current;
2186
- return merged;
2187
- }), {});
2188
- return Object.keys(merged).map((function(key) {
2189
- return merged[key];
2190
- }));
2191
- }
2192
-
2193
- var DEFAULT_OPTIONS = {
2194
- placement: "bottom",
2195
- modifiers: [],
2196
- strategy: "absolute"
2197
1935
  };
2198
1936
 
2199
- function areValidElements() {
2200
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2201
- args[_key] = arguments[_key];
2202
- }
2203
- return !args.some((function(element) {
2204
- return !(element && typeof element.getBoundingClientRect === "function");
2205
- }));
2206
- }
1937
+ function isRTL(element) {
1938
+ return getComputedStyle$1(element).direction === "rtl";
1939
+ }
1940
+
1941
+ const platform = {
1942
+ convertOffsetParentRelativeRectToViewportRelativeRect: convertOffsetParentRelativeRectToViewportRelativeRect,
1943
+ getDocumentElement: getDocumentElement,
1944
+ getClippingRect: getClippingRect,
1945
+ getOffsetParent: getOffsetParent,
1946
+ getElementRects: getElementRects,
1947
+ getClientRects: getClientRects,
1948
+ getDimensions: getDimensions,
1949
+ getScale: getScale,
1950
+ isElement: isElement,
1951
+ isRTL: isRTL
1952
+ };
2207
1953
 
2208
- function popperGenerator(generatorOptions) {
2209
- if (generatorOptions === void 0) {
2210
- generatorOptions = {};
1954
+ function observeMove(element, onMove) {
1955
+ let io = null;
1956
+ let timeoutId;
1957
+ const root = getDocumentElement(element);
1958
+ function cleanup() {
1959
+ clearTimeout(timeoutId);
1960
+ io && io.disconnect();
1961
+ io = null;
2211
1962
  }
2212
- var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
2213
- return function createPopper(reference, popper, options) {
2214
- if (options === void 0) {
2215
- options = defaultOptions;
1963
+ function refresh(skip, threshold) {
1964
+ if (skip === void 0) {
1965
+ skip = false;
2216
1966
  }
2217
- var state = {
2218
- placement: "bottom",
2219
- orderedModifiers: [],
2220
- options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
2221
- modifiersData: {},
2222
- elements: {
2223
- reference: reference,
2224
- popper: popper
2225
- },
2226
- attributes: {},
2227
- styles: {}
1967
+ if (threshold === void 0) {
1968
+ threshold = 1;
1969
+ }
1970
+ cleanup();
1971
+ const {left: left, top: top, width: width, height: height} = element.getBoundingClientRect();
1972
+ if (!skip) {
1973
+ onMove();
1974
+ }
1975
+ if (!width || !height) {
1976
+ return;
1977
+ }
1978
+ const insetTop = floor(top);
1979
+ const insetRight = floor(root.clientWidth - (left + width));
1980
+ const insetBottom = floor(root.clientHeight - (top + height));
1981
+ const insetLeft = floor(left);
1982
+ const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
1983
+ const options = {
1984
+ rootMargin: rootMargin,
1985
+ threshold: max(0, min(1, threshold)) || 1
2228
1986
  };
2229
- var effectCleanupFns = [];
2230
- var isDestroyed = false;
2231
- var instance = {
2232
- state: state,
2233
- setOptions: function setOptions(setOptionsAction) {
2234
- var options = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
2235
- cleanupModifierEffects();
2236
- state.options = Object.assign({}, defaultOptions, state.options, options);
2237
- state.scrollParents = {
2238
- reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
2239
- popper: listScrollParents(popper)
2240
- };
2241
- var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers)));
2242
- state.orderedModifiers = orderedModifiers.filter((function(m) {
2243
- return m.enabled;
2244
- }));
2245
- runModifierEffects();
2246
- return instance.update();
2247
- },
2248
- forceUpdate: function forceUpdate() {
2249
- if (isDestroyed) {
2250
- return;
1987
+ let isFirstUpdate = true;
1988
+ function handleObserve(entries) {
1989
+ const ratio = entries[0].intersectionRatio;
1990
+ if (ratio !== threshold) {
1991
+ if (!isFirstUpdate) {
1992
+ return refresh();
2251
1993
  }
2252
- var _state$elements = state.elements, reference = _state$elements.reference, popper = _state$elements.popper;
2253
- if (!areValidElements(reference, popper)) {
2254
- return;
2255
- }
2256
- state.rects = {
2257
- reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === "fixed"),
2258
- popper: getLayoutRect(popper)
2259
- };
2260
- state.reset = false;
2261
- state.placement = state.options.placement;
2262
- state.orderedModifiers.forEach((function(modifier) {
2263
- return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
2264
- }));
2265
- for (var index = 0; index < state.orderedModifiers.length; index++) {
2266
- if (state.reset === true) {
2267
- state.reset = false;
2268
- index = -1;
2269
- continue;
2270
- }
2271
- var _state$orderedModifie = state.orderedModifiers[index], fn = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
2272
- if (typeof fn === "function") {
2273
- state = fn({
2274
- state: state,
2275
- options: _options,
2276
- name: name,
2277
- instance: instance
2278
- }) || state;
2279
- }
1994
+ if (!ratio) {
1995
+ timeoutId = setTimeout((() => {
1996
+ refresh(false, 1e-7);
1997
+ }), 100);
1998
+ } else {
1999
+ refresh(false, ratio);
2280
2000
  }
2281
- },
2282
- update: debounce((function() {
2283
- return new Promise((function(resolve) {
2284
- instance.forceUpdate();
2285
- resolve(state);
2286
- }));
2287
- })),
2288
- destroy: function destroy() {
2289
- cleanupModifierEffects();
2290
- isDestroyed = true;
2291
2001
  }
2292
- };
2293
- if (!areValidElements(reference, popper)) {
2294
- return instance;
2002
+ isFirstUpdate = false;
2295
2003
  }
2296
- instance.setOptions(options).then((function(state) {
2297
- if (!isDestroyed && options.onFirstUpdate) {
2298
- options.onFirstUpdate(state);
2004
+ try {
2005
+ io = new IntersectionObserver(handleObserve, {
2006
+ ...options,
2007
+ root: root.ownerDocument
2008
+ });
2009
+ } catch (e) {
2010
+ io = new IntersectionObserver(handleObserve, options);
2011
+ }
2012
+ io.observe(element);
2013
+ }
2014
+ refresh(true);
2015
+ return cleanup;
2016
+ }
2017
+
2018
+ function autoUpdate(reference, floating, update, options) {
2019
+ if (options === void 0) {
2020
+ options = {};
2021
+ }
2022
+ const {ancestorScroll: ancestorScroll = true, ancestorResize: ancestorResize = true, elementResize: elementResize = typeof ResizeObserver === "function", layoutShift: layoutShift = typeof IntersectionObserver === "function", animationFrame: animationFrame = false} = options;
2023
+ const referenceEl = unwrapElement(reference);
2024
+ const ancestors = ancestorScroll || ancestorResize ? [ ...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating) ] : [];
2025
+ ancestors.forEach((ancestor => {
2026
+ ancestorScroll && ancestor.addEventListener("scroll", update, {
2027
+ passive: true
2028
+ });
2029
+ ancestorResize && ancestor.addEventListener("resize", update);
2030
+ }));
2031
+ const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
2032
+ let reobserveFrame = -1;
2033
+ let resizeObserver = null;
2034
+ if (elementResize) {
2035
+ resizeObserver = new ResizeObserver((_ref => {
2036
+ let [firstEntry] = _ref;
2037
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
2038
+ resizeObserver.unobserve(floating);
2039
+ cancelAnimationFrame(reobserveFrame);
2040
+ reobserveFrame = requestAnimationFrame((() => {
2041
+ resizeObserver && resizeObserver.observe(floating);
2042
+ }));
2299
2043
  }
2044
+ update();
2300
2045
  }));
2301
- function runModifierEffects() {
2302
- state.orderedModifiers.forEach((function(_ref3) {
2303
- var name = _ref3.name, _ref3$options = _ref3.options, options = _ref3$options === void 0 ? {} : _ref3$options, effect = _ref3.effect;
2304
- if (typeof effect === "function") {
2305
- var cleanupFn = effect({
2306
- state: state,
2307
- name: name,
2308
- instance: instance,
2309
- options: options
2310
- });
2311
- var noopFn = function noopFn() {};
2312
- effectCleanupFns.push(cleanupFn || noopFn);
2313
- }
2314
- }));
2046
+ if (referenceEl && !animationFrame) {
2047
+ resizeObserver.observe(referenceEl);
2315
2048
  }
2316
- function cleanupModifierEffects() {
2317
- effectCleanupFns.forEach((function(fn) {
2318
- return fn();
2319
- }));
2320
- effectCleanupFns = [];
2049
+ resizeObserver.observe(floating);
2050
+ }
2051
+ let frameId;
2052
+ let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
2053
+ if (animationFrame) {
2054
+ frameLoop();
2055
+ }
2056
+ function frameLoop() {
2057
+ const nextRefRect = getBoundingClientRect(reference);
2058
+ if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
2059
+ update();
2060
+ }
2061
+ prevRefRect = nextRefRect;
2062
+ frameId = requestAnimationFrame(frameLoop);
2063
+ }
2064
+ update();
2065
+ return () => {
2066
+ ancestors.forEach((ancestor => {
2067
+ ancestorScroll && ancestor.removeEventListener("scroll", update);
2068
+ ancestorResize && ancestor.removeEventListener("resize", update);
2069
+ }));
2070
+ cleanupIo && cleanupIo();
2071
+ resizeObserver && resizeObserver.disconnect();
2072
+ resizeObserver = null;
2073
+ if (animationFrame) {
2074
+ cancelAnimationFrame(frameId);
2321
2075
  }
2322
- return instance;
2323
2076
  };
2324
2077
  }
2325
2078
 
2326
- var defaultModifiers = [ eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1 ];
2327
-
2328
- var createPopper = popperGenerator({
2329
- defaultModifiers: defaultModifiers
2330
- });
2079
+ const computePosition = (reference, floating, options) => {
2080
+ const cache = new Map;
2081
+ const mergedOptions = {
2082
+ platform: platform,
2083
+ ...options
2084
+ };
2085
+ const platformWithCache = {
2086
+ ...mergedOptions.platform,
2087
+ _c: cache
2088
+ };
2089
+ return computePosition$1(reference, floating, {
2090
+ ...mergedOptions,
2091
+ platform: platformWithCache
2092
+ });
2093
+ };
2331
2094
 
2332
2095
  class Popover extends Controller {
2333
2096
  static targets=[ "activator", "popover", "template" ];
@@ -2335,43 +2098,55 @@ class Popover extends Controller {
2335
2098
  static values={
2336
2099
  appendToBody: Boolean,
2337
2100
  placement: String,
2338
- active: Boolean
2101
+ active: Boolean,
2102
+ textFieldActivator: Boolean
2339
2103
  };
2340
2104
  connect() {
2341
- const popperOptions = {
2342
- placement: this.placementValue,
2343
- modifiers: [ {
2344
- name: "offset",
2345
- options: {
2346
- offset: [ 0, 5 ]
2347
- }
2348
- }, {
2349
- name: "flip",
2350
- options: {
2351
- allowedAutoPlacements: [ "top-start", "bottom-start", "top-end", "bottom-end" ]
2352
- }
2353
- } ]
2354
- };
2355
2105
  if (this.appendToBodyValue) {
2356
2106
  const clonedTemplate = this.templateTarget.content.cloneNode(true);
2357
2107
  this.target = clonedTemplate.firstElementChild;
2358
- popperOptions["strategy"] = "fixed";
2359
2108
  document.body.appendChild(clonedTemplate);
2360
2109
  }
2361
- this.popper = createPopper(this.activatorTarget, this.target, popperOptions);
2110
+ this.target.style.display = "none";
2362
2111
  if (this.activeValue) {
2363
2112
  this.show();
2364
2113
  }
2365
2114
  }
2366
- async toggle() {
2367
- this.target.classList.toggle(this.closedClass);
2368
- this.target.classList.toggle(this.openClass);
2369
- await this.popper.update();
2115
+ disconnect() {
2116
+ if (this.cleanup) {
2117
+ this.cleanup();
2118
+ }
2119
+ }
2120
+ updatePosition() {
2121
+ if (this.cleanup) {
2122
+ this.cleanup();
2123
+ }
2124
+ this.cleanup = autoUpdate(this.activator, this.target, (() => {
2125
+ computePosition(this.activator, this.target, {
2126
+ placement: this.placementValue,
2127
+ middleware: [ offset(5), flip(), shift({
2128
+ padding: 5
2129
+ }) ]
2130
+ }).then((({x: x, y: y}) => {
2131
+ Object.assign(this.target.style, {
2132
+ left: `${x}px`,
2133
+ top: `${y}px`
2134
+ });
2135
+ }));
2136
+ }));
2137
+ }
2138
+ toggle() {
2139
+ if (this.target.classList.contains(this.openClass)) {
2140
+ this.forceHide();
2141
+ } else {
2142
+ this.show();
2143
+ }
2370
2144
  }
2371
- async show() {
2145
+ show() {
2146
+ this.target.style.display = "block";
2372
2147
  this.target.classList.remove(this.closedClass);
2373
2148
  this.target.classList.add(this.openClass);
2374
- await this.popper.update();
2149
+ this.updatePosition();
2375
2150
  }
2376
2151
  hide(event) {
2377
2152
  if (this.element.contains(event.target)) return;
@@ -2380,9 +2155,17 @@ class Popover extends Controller {
2380
2155
  this.forceHide();
2381
2156
  }
2382
2157
  forceHide() {
2158
+ this.target.style.display = "none";
2383
2159
  this.target.classList.remove(this.openClass);
2384
2160
  this.target.classList.add(this.closedClass);
2385
2161
  }
2162
+ get activator() {
2163
+ if (this.textFieldActivatorValue) {
2164
+ return this.activatorTarget.querySelector('[data-controller="polaris-text-field"]');
2165
+ } else {
2166
+ return this.activatorTarget;
2167
+ }
2168
+ }
2386
2169
  get target() {
2387
2170
  if (this.hasPopoverTarget) {
2388
2171
  return this.popoverTarget;
@@ -2616,6 +2399,66 @@ class Toast extends Controller {
2616
2399
  }
2617
2400
  }
2618
2401
 
2402
+ class Tooltip extends Controller {
2403
+ static targets=[ "template" ];
2404
+ static values={
2405
+ active: Boolean,
2406
+ position: String
2407
+ };
2408
+ show(event) {
2409
+ if (!this.activeValue) return;
2410
+ const element = event.currentTarget;
2411
+ let tooltip = document.createElement("span");
2412
+ tooltip.className = "Polaris-Tooltip";
2413
+ tooltip.innerHTML = this.templateTarget.innerHTML;
2414
+ this.tooltip = element.appendChild(tooltip);
2415
+ const arrowElement = element.querySelector("[data-tooltip-arrow]");
2416
+ computePosition(element, this.tooltip, {
2417
+ placement: this.positionValue,
2418
+ middleware: [ offset(this.offsetValue), flip(), shift({
2419
+ padding: 5
2420
+ }), arrow({
2421
+ element: arrowElement
2422
+ }) ]
2423
+ }).then((({x: x, y: y, placement: placement, middlewareData: middlewareData}) => {
2424
+ Object.assign(this.tooltip.style, {
2425
+ left: `${x}px`,
2426
+ top: `${y}px`
2427
+ });
2428
+ const {x: arrowX, y: arrowY} = middlewareData.arrow;
2429
+ const staticSide = {
2430
+ top: "bottom",
2431
+ right: "left",
2432
+ bottom: "top",
2433
+ left: "right"
2434
+ }[placement.split("-")[0]];
2435
+ Object.assign(arrowElement.style, {
2436
+ left: arrowX != null ? `${arrowX}px` : "",
2437
+ top: arrowY != null ? `${arrowY}px` : "",
2438
+ right: "",
2439
+ bottom: "",
2440
+ [staticSide]: "-4px"
2441
+ });
2442
+ }));
2443
+ }
2444
+ hide() {
2445
+ if (this.tooltip) {
2446
+ this.tooltip.remove();
2447
+ }
2448
+ }
2449
+ get offsetValue() {
2450
+ switch (this.positionValue) {
2451
+ case "top":
2452
+ case "bottom":
2453
+ case "left":
2454
+ return 8;
2455
+
2456
+ case "right":
2457
+ return 6;
2458
+ }
2459
+ }
2460
+ }
2461
+
2619
2462
  function registerPolarisControllers(application) {
2620
2463
  application.register("polaris-autocomplete", Autocomplete);
2621
2464
  application.register("polaris-button", Button);
@@ -2632,6 +2475,7 @@ function registerPolarisControllers(application) {
2632
2475
  application.register("polaris-select", Select);
2633
2476
  application.register("polaris-text-field", TextField);
2634
2477
  application.register("polaris-toast", Toast);
2478
+ application.register("polaris-tooltip", Tooltip);
2635
2479
  }
2636
2480
 
2637
- export { Frame, Modal, Polaris, Popover, ResourceItem, Scrollable, Select, TextField, registerPolarisControllers };
2481
+ export { Frame, Modal, Polaris, Popover, ResourceItem, Scrollable, Select, TextField, Tooltip, registerPolarisControllers };